connected-spaces-platform.web 6.20.0 → 6.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -257,6 +257,16 @@ export declare namespace Multiplayer {
257
257
  SpaceUserLimitExceeded = 4
258
258
  }
259
259
  }
260
+ export declare namespace Multiplayer {
261
+ /**
262
+ * @description Enum representing the failure reason of an entity modification operation returned from IRealtimeEngine::IsEntityModifiable.
263
+ */
264
+ enum ModifiableStatus {
265
+ Modifiable = 0,
266
+ EntityLocked = 1,
267
+ EntityNotOwnedAndUntransferable = 2
268
+ }
269
+ }
260
270
  export declare namespace Systems {
261
271
  /**
262
272
  * @description Indicates special handling for any thirdparty platform
@@ -4151,6 +4161,19 @@ export declare namespace Common {
4151
4161
  * entity fetch
4152
4162
  */
4153
4163
  setEntityFetchCompleteCallback(callback: (arg1: number) => void): void;
4164
+ /**
4165
+ * @description Checks if the given entity can be modified by this client.
4166
+ @details Modification in this context can mean any of the following:
4167
+ * - Updating an entity property
4168
+ * - Sending an entity patch
4169
+ * - Creating a component
4170
+ * - Deleting a component
4171
+ * - Updating a component property
4172
+ * @param spaceEntity - The entity we are checking can be modified.
4173
+ * @return The result of this operation signifying if the entity can be modified.
4174
+ * Will return ModifiableStatus::Modifiable if the entity can be modified.
4175
+ */
4176
+ isEntityModifiable(spaceEntity: Multiplayer.SpaceEntity): Multiplayer.ModifiableStatus;
4154
4177
  }
4155
4178
  }
4156
4179
  export declare namespace Common {
@@ -4694,11 +4717,11 @@ export declare namespace Multiplayer {
4694
4717
  */
4695
4718
  deselect(): boolean;
4696
4719
  /**
4697
- * @description Checks if the entity can be modified.
4698
- * Specifically whether the local client already owns the entity or can take ownership of the entity.
4699
- * @return True if the entity can be modified, False if not.
4720
+ * Checks if the entity can be modified, with a failure reason if the entity isn't modifiable.
4721
+ * The criteria for failures can be found on specific RealtimeEngine IsEntityModifiable overridden functions.
4722
+ * @return ModifiableStatus::Modifiable on success.
4700
4723
  */
4701
- isModifiable(): boolean;
4724
+ isModifiable(): Multiplayer.ModifiableStatus;
4702
4725
  /**
4703
4726
  * @description Locks the entity if it hasn't been locked already.
4704
4727
  @pre The entity must not already be locked.
@@ -5860,7 +5883,7 @@ export declare namespace Systems {
5860
5883
  export declare namespace Systems {
5861
5884
  /**
5862
5885
  @ingroup HotspotSequence System
5863
- * @description A basic class abstraction for a Hot Spot Group, including name, and items within the group.
5886
+ * @description A basic class abstraction for a Hotspot Group, including the Name and Items within the group.
5864
5887
  */
5865
5888
  class HotspotGroup extends NativeClassWrapper implements INativeResource {
5866
5889
  /** @internal */
@@ -6612,6 +6635,13 @@ export declare namespace Multiplayer {
6612
6635
  * @return A list of root entities containing non-owning pointers to entities.
6613
6636
  */
6614
6637
  getRootHierarchyEntities(): Common.List<Multiplayer.SpaceEntity>;
6638
+ /**
6639
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
6640
+ @details This result will contain ModifiableStatus::EntityLocked if the given entities LockType is equal to UserAgnostic.
6641
+ * @param spaceEntity - The space entity to check its modfiable state.
6642
+ * @return This will contain a failure reason if the entity isn't modifiable.
6643
+ */
6644
+ isEntityModifiable(spaceEntity: Multiplayer.SpaceEntity): Multiplayer.ModifiableStatus;
6615
6645
  /**
6616
6646
  * @description The client ID of the local client. An arbitrary unchanging value.
6617
6647
  * @return INT53_MAX, the maximum number expressible in all our interop languages (you can thank javascript for the weird sizing).
@@ -6740,6 +6770,15 @@ export declare namespace Multiplayer {
6740
6770
  * @return A list of root entities containing non-owning pointers to entities.
6741
6771
  */
6742
6772
  getRootHierarchyEntities(): Common.List<Multiplayer.SpaceEntity>;
6773
+ /**
6774
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
6775
+ @detail This entity is considered non-modifiable in the following circumstances:
6776
+ * - The given entities LockType is equal to UserAgnostic, and we dont have an unprocessed patch updating the lock type.
6777
+ * - The entities owner id doesn't match this clients id, and the entity is not transferable.
6778
+ * @param spaceEntity - The space entity to check its modfiable state.
6779
+ * @return This will contain a failure reason if the entity isn't modifiable.
6780
+ */
6781
+ isEntityModifiable(spaceEntity: Multiplayer.SpaceEntity): Multiplayer.ModifiableStatus;
6743
6782
  /**
6744
6783
  * @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
6745
6784
  * From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
@@ -11889,6 +11928,15 @@ export declare namespace Systems {
11889
11928
  * @param callback - Callback when asynchronous task finishes
11890
11929
  */
11891
11930
  getTierFeatureProgressForSpace(spaceId: string, featureNames: Common.Array<Systems.TierFeatures>): Promise<Systems.FeaturesLimitResult>;
11931
+ /**
11932
+ * @description Set the tier of the user. Tiers effect things such as limits of users inside spaces, among other quota restrictions
11933
+ * @param tier - Tier to set.
11934
+ * @param userId - Id of the user to set the tier for.
11935
+ * @param callback - Callback when asynchronous task finishes.
11936
+ @pre This method should only be called when logged in as an administrator tier account.
11937
+ * If called when not an administrator, you will receive a 403 error (Forbidden)
11938
+ */
11939
+ setUserTier(tier: Systems.TierNames, userId: string): Promise<Systems.UserTierResult>;
11892
11940
  /**
11893
11941
  * @description Get current users tier information
11894
11942
  * @param callback - Callback when asynchronous task finishes
@@ -312,6 +312,11 @@ function csp_multiplayer_ErrorCodeFactory(nativePointer) {
312
312
  }
313
313
  ProxyClassFactories["csp_multiplayer_ErrorCode"] =
314
314
  csp_multiplayer_ErrorCodeFactory;
315
+ function csp_multiplayer_ModifiableStatusFactory(nativePointer) {
316
+ return nativePointer.pointer;
317
+ }
318
+ ProxyClassFactories["csp_multiplayer_ModifiableStatus"] =
319
+ csp_multiplayer_ModifiableStatusFactory;
315
320
  function csp_systems_EThirdPartyPlatformFactory(nativePointer) {
316
321
  return nativePointer.pointer;
317
322
  }
@@ -2240,6 +2245,17 @@ export var Multiplayer;
2240
2245
  ErrorCode[ErrorCode["SpaceUserLimitExceeded"] = 4] = "SpaceUserLimitExceeded";
2241
2246
  })(ErrorCode = Multiplayer.ErrorCode || (Multiplayer.ErrorCode = {}));
2242
2247
  })(Multiplayer || (Multiplayer = {}));
2248
+ (function (Multiplayer) {
2249
+ /**
2250
+ * @description Enum representing the failure reason of an entity modification operation returned from IRealtimeEngine::IsEntityModifiable.
2251
+ */
2252
+ let ModifiableStatus;
2253
+ (function (ModifiableStatus) {
2254
+ ModifiableStatus[ModifiableStatus["Modifiable"] = 0] = "Modifiable";
2255
+ ModifiableStatus[ModifiableStatus["EntityLocked"] = 1] = "EntityLocked";
2256
+ ModifiableStatus[ModifiableStatus["EntityNotOwnedAndUntransferable"] = 2] = "EntityNotOwnedAndUntransferable";
2257
+ })(ModifiableStatus = Multiplayer.ModifiableStatus || (Multiplayer.ModifiableStatus = {}));
2258
+ })(Multiplayer || (Multiplayer = {}));
2243
2259
  export var Systems;
2244
2260
  (function (Systems) {
2245
2261
  /**
@@ -10841,6 +10857,22 @@ export class CSPFoundation {
10841
10857
  var _callbackPtr = Module.addFunction(_callback, "vii");
10842
10858
  Module.ccall("csp_common_IRealtimeEngine_SetEntityFetchCompleteCallback_void_EntityFetchCompleteCallback", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
10843
10859
  }
10860
+ /**
10861
+ * @description Checks if the given entity can be modified by this client.
10862
+ @details Modification in this context can mean any of the following:
10863
+ * - Updating an entity property
10864
+ * - Sending an entity patch
10865
+ * - Creating a component
10866
+ * - Deleting a component
10867
+ * - Updating a component property
10868
+ * @param spaceEntity - The entity we are checking can be modified.
10869
+ * @return The result of this operation signifying if the entity can be modified.
10870
+ * Will return ModifiableStatus::Modifiable if the entity can be modified.
10871
+ */
10872
+ isEntityModifiable(spaceEntity) {
10873
+ let _result = Module.ccall("csp_common_IRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC", "number", ["number", "number"], [this.pointer, spaceEntity.pointer]);
10874
+ return _result;
10875
+ }
10844
10876
  }
10845
10877
  Common.IRealtimeEngine = IRealtimeEngine;
10846
10878
  })(Common || (Common = {}));
@@ -11949,12 +11981,12 @@ export class CSPFoundation {
11949
11981
  return _result;
11950
11982
  }
11951
11983
  /**
11952
- * @description Checks if the entity can be modified.
11953
- * Specifically whether the local client already owns the entity or can take ownership of the entity.
11954
- * @return True if the entity can be modified, False if not.
11984
+ * Checks if the entity can be modified, with a failure reason if the entity isn't modifiable.
11985
+ * The criteria for failures can be found on specific RealtimeEngine IsEntityModifiable overridden functions.
11986
+ * @return ModifiableStatus::Modifiable on success.
11955
11987
  */
11956
11988
  isModifiable() {
11957
- let _result = Module.ccall("csp_multiplayer_SpaceEntity_IsModifiableC_bool", "boolean", ["number"], [this.pointer]);
11989
+ let _result = Module.ccall("csp_multiplayer_SpaceEntity_IsModifiableC_ModifiableStatus", "number", ["number"], [this.pointer]);
11958
11990
  return _result;
11959
11991
  }
11960
11992
  /**
@@ -14703,7 +14735,7 @@ export class CSPFoundation {
14703
14735
  (function (Systems) {
14704
14736
  /**
14705
14737
  @ingroup HotspotSequence System
14706
- * @description A basic class abstraction for a Hot Spot Group, including name, and items within the group.
14738
+ * @description A basic class abstraction for a Hotspot Group, including the Name and Items within the group.
14707
14739
  */
14708
14740
  class HotspotGroup extends NativeClassWrapper {
14709
14741
  /** @internal */
@@ -16762,6 +16794,16 @@ export class CSPFoundation {
16762
16794
  Module._free(_ret);
16763
16795
  return _nPtr;
16764
16796
  }
16797
+ /**
16798
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
16799
+ @details This result will contain ModifiableStatus::EntityLocked if the given entities LockType is equal to UserAgnostic.
16800
+ * @param spaceEntity - The space entity to check its modfiable state.
16801
+ * @return This will contain a failure reason if the entity isn't modifiable.
16802
+ */
16803
+ isEntityModifiable(spaceEntity) {
16804
+ let _result = Module.ccall("csp_multiplayer_OfflineRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC", "number", ["number", "number"], [this.pointer, spaceEntity.pointer]);
16805
+ return _result;
16806
+ }
16765
16807
  /**
16766
16808
  * @description The client ID of the local client. An arbitrary unchanging value.
16767
16809
  * @return INT53_MAX, the maximum number expressible in all our interop languages (you can thank javascript for the weird sizing).
@@ -17079,6 +17121,18 @@ export class CSPFoundation {
17079
17121
  Module._free(_ret);
17080
17122
  return _nPtr;
17081
17123
  }
17124
+ /**
17125
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
17126
+ @detail This entity is considered non-modifiable in the following circumstances:
17127
+ * - The given entities LockType is equal to UserAgnostic, and we dont have an unprocessed patch updating the lock type.
17128
+ * - The entities owner id doesn't match this clients id, and the entity is not transferable.
17129
+ * @param spaceEntity - The space entity to check its modfiable state.
17130
+ * @return This will contain a failure reason if the entity isn't modifiable.
17131
+ */
17132
+ isEntityModifiable(spaceEntity) {
17133
+ let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC", "number", ["number", "number"], [this.pointer, spaceEntity.pointer]);
17134
+ return _result;
17135
+ }
17082
17136
  /**
17083
17137
  * @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
17084
17138
  * From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
@@ -27536,6 +27590,33 @@ export class CSPFoundation {
27536
27590
  Module.ccall("csp_systems_QuotaSystem_GetTierFeatureProgressForSpace_void_StringRC_ArrayRC_FeaturesLimitCallback", "void", ["number", "string", "number", "number", "number"], [this.pointer, spaceId, featureNames.pointer, _callbackPtr, 0]);
27537
27591
  return _promise;
27538
27592
  }
27593
+ /**
27594
+ * @description Set the tier of the user. Tiers effect things such as limits of users inside spaces, among other quota restrictions
27595
+ * @param tier - Tier to set.
27596
+ * @param userId - Id of the user to set the tier for.
27597
+ * @param callback - Callback when asynchronous task finishes.
27598
+ @pre This method should only be called when logged in as an administrator tier account.
27599
+ * If called when not an administrator, you will receive a 403 error (Forbidden)
27600
+ */
27601
+ async setUserTier(tier, userId) {
27602
+ var _resolve;
27603
+ var _promise = new Promise((_r) => {
27604
+ _resolve = _r;
27605
+ });
27606
+ var _callbackPtr;
27607
+ var _callback = (_stateObject__, result) => {
27608
+ var _resultPtr = getNativePointer(result);
27609
+ var _resultInstance = new Systems.UserTierResult(_resultPtr);
27610
+ if (_resultInstance.getResultCode() == Systems.EResultCode.InProgress) {
27611
+ return;
27612
+ }
27613
+ _resolve(_resultInstance);
27614
+ Module.removeFunction(_callbackPtr);
27615
+ };
27616
+ _callbackPtr = Module.addFunction(_callback, "vii");
27617
+ Module.ccall("csp_systems_QuotaSystem_SetUserTier_void_TierNames_StringRC_UserTierCallback", "void", ["number", "number", "string", "number", "number"], [this.pointer, tier, userId, _callbackPtr, 0]);
27618
+ return _promise;
27619
+ }
27539
27620
  /**
27540
27621
  * @description Get current users tier information
27541
27622
  * @param callback - Callback when asynchronous task finishes