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.
@@ -410,6 +410,14 @@ function csp_multiplayer_ErrorCodeFactory(
410
410
  ProxyClassFactories["csp_multiplayer_ErrorCode"] =
411
411
  csp_multiplayer_ErrorCodeFactory;
412
412
 
413
+ function csp_multiplayer_ModifiableStatusFactory(
414
+ nativePointer: NativePointer,
415
+ ): Multiplayer.ModifiableStatus {
416
+ return nativePointer.pointer as Multiplayer.ModifiableStatus;
417
+ }
418
+ ProxyClassFactories["csp_multiplayer_ModifiableStatus"] =
419
+ csp_multiplayer_ModifiableStatusFactory;
420
+
413
421
  function csp_systems_EThirdPartyPlatformFactory(
414
422
  nativePointer: NativePointer,
415
423
  ): Systems.EThirdPartyPlatform {
@@ -3643,6 +3651,17 @@ export namespace Multiplayer {
3643
3651
  }
3644
3652
  }
3645
3653
 
3654
+ export namespace Multiplayer {
3655
+ /**
3656
+ * @description Enum representing the failure reason of an entity modification operation returned from IRealtimeEngine::IsEntityModifiable.
3657
+ */
3658
+ export enum ModifiableStatus {
3659
+ Modifiable,
3660
+ EntityLocked,
3661
+ EntityNotOwnedAndUntransferable,
3662
+ }
3663
+ }
3664
+
3646
3665
  export namespace Systems {
3647
3666
  /**
3648
3667
  * @description Indicates special handling for any thirdparty platform
@@ -24218,6 +24237,32 @@ export namespace Common {
24218
24237
  [this.pointer, _callbackPtr, 0],
24219
24238
  );
24220
24239
  }
24240
+
24241
+ /**
24242
+ * @description Checks if the given entity can be modified by this client.
24243
+ @details Modification in this context can mean any of the following:
24244
+ * - Updating an entity property
24245
+ * - Sending an entity patch
24246
+ * - Creating a component
24247
+ * - Deleting a component
24248
+ * - Updating a component property
24249
+ * @param spaceEntity - The entity we are checking can be modified.
24250
+ * @return The result of this operation signifying if the entity can be modified.
24251
+ * Will return ModifiableStatus::Modifiable if the entity can be modified.
24252
+ */
24253
+
24254
+ isEntityModifiable(
24255
+ spaceEntity: Multiplayer.SpaceEntity,
24256
+ ): Multiplayer.ModifiableStatus {
24257
+ let _result = Module.ccall(
24258
+ "csp_common_IRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC",
24259
+ "number",
24260
+ ["number", "number"],
24261
+ [this.pointer, spaceEntity.pointer],
24262
+ );
24263
+
24264
+ return _result;
24265
+ }
24221
24266
  }
24222
24267
  }
24223
24268
 
@@ -26249,15 +26294,15 @@ export namespace Multiplayer {
26249
26294
  }
26250
26295
 
26251
26296
  /**
26252
- * @description Checks if the entity can be modified.
26253
- * Specifically whether the local client already owns the entity or can take ownership of the entity.
26254
- * @return True if the entity can be modified, False if not.
26297
+ * Checks if the entity can be modified, with a failure reason if the entity isn't modifiable.
26298
+ * The criteria for failures can be found on specific RealtimeEngine IsEntityModifiable overridden functions.
26299
+ * @return ModifiableStatus::Modifiable on success.
26255
26300
  */
26256
26301
 
26257
- isModifiable(): boolean {
26302
+ isModifiable(): Multiplayer.ModifiableStatus {
26258
26303
  let _result = Module.ccall(
26259
- "csp_multiplayer_SpaceEntity_IsModifiableC_bool",
26260
- "boolean",
26304
+ "csp_multiplayer_SpaceEntity_IsModifiableC_ModifiableStatus",
26305
+ "number",
26261
26306
  ["number"],
26262
26307
  [this.pointer],
26263
26308
  );
@@ -32100,7 +32145,7 @@ export namespace Systems {
32100
32145
  export namespace Systems {
32101
32146
  /**
32102
32147
  @ingroup HotspotSequence System
32103
- * @description A basic class abstraction for a Hot Spot Group, including name, and items within the group.
32148
+ * @description A basic class abstraction for a Hotspot Group, including the Name and Items within the group.
32104
32149
  */
32105
32150
  export class HotspotGroup
32106
32151
  extends NativeClassWrapper
@@ -36595,6 +36640,26 @@ export namespace Multiplayer {
36595
36640
  return _nPtr;
36596
36641
  }
36597
36642
 
36643
+ /**
36644
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
36645
+ @details This result will contain ModifiableStatus::EntityLocked if the given entities LockType is equal to UserAgnostic.
36646
+ * @param spaceEntity - The space entity to check its modfiable state.
36647
+ * @return This will contain a failure reason if the entity isn't modifiable.
36648
+ */
36649
+
36650
+ isEntityModifiable(
36651
+ spaceEntity: Multiplayer.SpaceEntity,
36652
+ ): Multiplayer.ModifiableStatus {
36653
+ let _result = Module.ccall(
36654
+ "csp_multiplayer_OfflineRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC",
36655
+ "number",
36656
+ ["number", "number"],
36657
+ [this.pointer, spaceEntity.pointer],
36658
+ );
36659
+
36660
+ return _result;
36661
+ }
36662
+
36598
36663
  /**
36599
36664
  * @description The client ID of the local client. An arbitrary unchanging value.
36600
36665
  * @return INT53_MAX, the maximum number expressible in all our interop languages (you can thank javascript for the weird sizing).
@@ -37131,6 +37196,28 @@ export namespace Multiplayer {
37131
37196
  return _nPtr;
37132
37197
  }
37133
37198
 
37199
+ /**
37200
+ * @description Returns a ModifiableStatus enum containing ModifiableStatus::Modifiable if the entity can be modified.
37201
+ @detail This entity is considered non-modifiable in the following circumstances:
37202
+ * - The given entities LockType is equal to UserAgnostic, and we dont have an unprocessed patch updating the lock type.
37203
+ * - The entities owner id doesn't match this clients id, and the entity is not transferable.
37204
+ * @param spaceEntity - The space entity to check its modfiable state.
37205
+ * @return This will contain a failure reason if the entity isn't modifiable.
37206
+ */
37207
+
37208
+ isEntityModifiable(
37209
+ spaceEntity: Multiplayer.SpaceEntity,
37210
+ ): Multiplayer.ModifiableStatus {
37211
+ let _result = Module.ccall(
37212
+ "csp_multiplayer_OnlineRealtimeEngine_IsEntityModifiableC_ModifiableStatus_SpaceEntityPC",
37213
+ "number",
37214
+ ["number", "number"],
37215
+ [this.pointer, spaceEntity.pointer],
37216
+ );
37217
+
37218
+ return _result;
37219
+ }
37220
+
37134
37221
  /**
37135
37222
  * @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
37136
37223
  * From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
@@ -56276,6 +56363,51 @@ export namespace Systems {
56276
56363
  return _promise;
56277
56364
  }
56278
56365
 
56366
+ /**
56367
+ * @description Set the tier of the user. Tiers effect things such as limits of users inside spaces, among other quota restrictions
56368
+ * @param tier - Tier to set.
56369
+ * @param userId - Id of the user to set the tier for.
56370
+ * @param callback - Callback when asynchronous task finishes.
56371
+ @pre This method should only be called when logged in as an administrator tier account.
56372
+ * If called when not an administrator, you will receive a 403 error (Forbidden)
56373
+ */
56374
+
56375
+ async setUserTier(
56376
+ tier: Systems.TierNames,
56377
+ userId: string,
56378
+ ): Promise<Systems.UserTierResult> {
56379
+ var _resolve;
56380
+
56381
+ var _promise = new Promise<Systems.UserTierResult>((_r) => {
56382
+ _resolve = _r;
56383
+ });
56384
+
56385
+ var _callbackPtr: number;
56386
+ var _callback = (_stateObject__: number, result) => {
56387
+ var _resultPtr = getNativePointer(result);
56388
+ var _resultInstance = new Systems.UserTierResult(_resultPtr);
56389
+
56390
+ if (_resultInstance.getResultCode() == Systems.EResultCode.InProgress) {
56391
+ return;
56392
+ }
56393
+
56394
+ _resolve(_resultInstance);
56395
+
56396
+ Module.removeFunction(_callbackPtr);
56397
+ };
56398
+
56399
+ _callbackPtr = Module.addFunction(_callback, "vii");
56400
+
56401
+ Module.ccall(
56402
+ "csp_systems_QuotaSystem_SetUserTier_void_TierNames_StringRC_UserTierCallback",
56403
+ "void",
56404
+ ["number", "number", "string", "number", "number"],
56405
+ [this.pointer, tier, userId, _callbackPtr, 0],
56406
+ );
56407
+
56408
+ return _promise;
56409
+ }
56410
+
56279
56411
  /**
56280
56412
  * @description Get current users tier information
56281
56413
  * @param callback - Callback when asynchronous task finishes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "connected-spaces-platform.web",
3
3
  "displayName": "connected-spaces-platform.web",
4
- "version": "6.20.0",
4
+ "version": "6.22.0",
5
5
  "description": "This package provides the binaries required to interface with the Connected Spaces Platform API.",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {