connected-spaces-platform.web 4.20.0 → 4.21.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.
@@ -168,10 +168,7 @@ export class Limits {
168
168
  }
169
169
 
170
170
  class NativePointer {
171
- constructor(
172
- public pointer: number,
173
- public ownsOwnData: boolean,
174
- ) {}
171
+ constructor(public pointer: number, public ownsOwnData: boolean) {}
175
172
  }
176
173
 
177
174
  function getNativePointer(pointer: number): NativePointer {
@@ -4550,7 +4547,7 @@ export class CSPFoundation {
4550
4547
  }
4551
4548
 
4552
4549
  /**
4553
- * @description This should been used at the end of the of the application lifescyle.
4550
+ * @description This should be used at the end of the application lifecycle.
4554
4551
  * Clears event queues and destroys foundation systems.
4555
4552
  * After shutdown, no other Foundation functions should be called until Initialise is called again.
4556
4553
  * @return True for successful shutdown
@@ -21375,58 +21372,15 @@ export namespace Multiplayer {
21375
21372
  @ingroup Multiplayer
21376
21373
  * @description Handling of all multiplayer connection functionality, such as connect, disconnect, entity replication and network events.
21377
21374
  */
21378
- export class MultiplayerConnection
21379
- extends NativeClassWrapper
21380
- implements INativeResource
21381
- {
21375
+ export class MultiplayerConnection extends NativeClassWrapper {
21382
21376
  /** @internal */
21383
21377
  constructor(pointer: NativePointer) {
21384
21378
  super(pointer);
21385
21379
  }
21386
21380
 
21387
- static create_spaceId(spaceId: string): MultiplayerConnection {
21388
- var _ptr = Module._malloc(8);
21389
- Module.ccall(
21390
- "csp_multiplayer_MultiplayerConnection_Ctor_String",
21391
- "void",
21392
- ["number", "string"],
21393
- [_ptr, spaceId],
21394
- );
21395
- var _nPtr = getNativePointer(_ptr);
21396
-
21397
- return new MultiplayerConnection(_nPtr);
21398
- }
21399
-
21400
- delete(): void {
21401
- if (this.ownsPointer && !this.disposed) {
21402
- Module.ccall(
21403
- "csp_multiplayer_MultiplayerConnection_Dtor",
21404
- "void",
21405
- ["number"],
21406
- [this.pointer],
21407
- );
21408
-
21409
- this.disposed = true;
21410
- }
21411
- }
21412
-
21413
- static create_boundConnection(
21414
- boundConnection: Multiplayer.MultiplayerConnection,
21415
- ): MultiplayerConnection {
21416
- var _ptr = Module._malloc(8);
21417
- Module.ccall(
21418
- "csp_multiplayer_MultiplayerConnection_Ctor_MultiplayerConnectionRC",
21419
- "void",
21420
- ["number", "number"],
21421
- [_ptr, boundConnection.pointer],
21422
- );
21423
- var _nPtr = getNativePointer(_ptr);
21424
-
21425
- return new MultiplayerConnection(_nPtr);
21426
- }
21427
-
21428
21381
  /**
21429
21382
  * @description Start the connection and register to start receiving updates from the server.
21383
+ * Connect should be called after LogIn and before EnterSpace.
21430
21384
  * @param callback - A callback with failure state.
21431
21385
  */
21432
21386
 
@@ -21487,37 +21441,6 @@ export namespace Multiplayer {
21487
21441
  return _promise;
21488
21442
  }
21489
21443
 
21490
- /**
21491
- * @description Initialise the connection and get initial entity data from the server.
21492
- * @param callback - A callback with failure state.
21493
- */
21494
-
21495
- async initialiseConnection(): Promise<Multiplayer.ErrorCode> {
21496
- var _resolve;
21497
-
21498
- var _promise = new Promise<Multiplayer.ErrorCode>((_r) => {
21499
- _resolve = _r;
21500
- });
21501
-
21502
- var _callbackPtr: number;
21503
- var _callback = (_stateObject__: number, arg1) => {
21504
- _resolve(arg1);
21505
-
21506
- Module.removeFunction(_callbackPtr);
21507
- };
21508
-
21509
- _callbackPtr = Module.addFunction(_callback, "vii");
21510
-
21511
- Module.ccall(
21512
- "csp_multiplayer_MultiplayerConnection_InitialiseConnection_void_ErrorCodeCallbackHandler",
21513
- "void",
21514
- ["number", "number", "number"],
21515
- [this.pointer, _callbackPtr, 0],
21516
- );
21517
-
21518
- return _promise;
21519
- }
21520
-
21521
21444
  /**
21522
21445
  * @description Sends a network event by EventName to all currently connected clients.
21523
21446
  * @param eventName - The identifying name for the event.
@@ -21821,26 +21744,6 @@ export namespace Multiplayer {
21821
21744
  return _result;
21822
21745
  }
21823
21746
 
21824
- /**
21825
- * @description Gets a pointer to the space entity system.
21826
- * @return A pointer to the space entity system.
21827
- */
21828
-
21829
- getSpaceEntitySystem(): Multiplayer.SpaceEntitySystem {
21830
- var _ret = Module._malloc(8);
21831
-
21832
- Module.ccall(
21833
- "csp_multiplayer_MultiplayerConnection_GetSpaceEntitySystemC_SpaceEntitySystemP",
21834
- "void",
21835
- ["number", "number"],
21836
- [_ret, this.pointer],
21837
- );
21838
- var _nPtr = new Multiplayer.SpaceEntitySystem(getNativePointer(_ret));
21839
- Module._free(_ret);
21840
-
21841
- return _nPtr;
21842
- }
21843
-
21844
21747
  /**
21845
21748
  * @description Gets a pointer to the conversation system.
21846
21749
  * @return A pointer to the conversation system.
@@ -23606,26 +23509,6 @@ export namespace Multiplayer {
23606
23509
  return _nPtr;
23607
23510
  }
23608
23511
 
23609
- /**
23610
- * @description Get the MultiplayerConnection object.
23611
- * @return A pointer to the MultiplayerConnection object.
23612
- */
23613
-
23614
- getMultiplayerConnection(): Multiplayer.MultiplayerConnection {
23615
- var _ret = Module._malloc(8);
23616
-
23617
- Module.ccall(
23618
- "csp_multiplayer_SpaceEntitySystem_GetMultiplayerConnection_MultiplayerConnectionP",
23619
- "void",
23620
- ["number", "number"],
23621
- [_ret, this.pointer],
23622
- );
23623
- var _nPtr = new Multiplayer.MultiplayerConnection(getNativePointer(_ret));
23624
- Module._free(_ret);
23625
-
23626
- return _nPtr;
23627
- }
23628
-
23629
23512
  /**
23630
23513
  * @description Add a new entity to the system.
23631
23514
  * /// This can be called at any time from any thread and internally add the entity to a pending
@@ -25376,6 +25259,36 @@ export namespace Systems {
25376
25259
 
25377
25260
  return _nPtr;
25378
25261
  }
25262
+
25263
+ getSpaceEntitySystem(): Multiplayer.SpaceEntitySystem {
25264
+ var _ret = Module._malloc(8);
25265
+
25266
+ Module.ccall(
25267
+ "csp_systems_SystemsManager_GetSpaceEntitySystem_SpaceEntitySystemP",
25268
+ "void",
25269
+ ["number", "number"],
25270
+ [_ret, this.pointer],
25271
+ );
25272
+ var _nPtr = new Multiplayer.SpaceEntitySystem(getNativePointer(_ret));
25273
+ Module._free(_ret);
25274
+
25275
+ return _nPtr;
25276
+ }
25277
+
25278
+ getMultiplayerConnection(): Multiplayer.MultiplayerConnection {
25279
+ var _ret = Module._malloc(8);
25280
+
25281
+ Module.ccall(
25282
+ "csp_systems_SystemsManager_GetMultiplayerConnection_MultiplayerConnectionP",
25283
+ "void",
25284
+ ["number", "number"],
25285
+ [_ret, this.pointer],
25286
+ );
25287
+ var _nPtr = new Multiplayer.MultiplayerConnection(getNativePointer(_ret));
25288
+ Module._free(_ret);
25289
+
25290
+ return _nPtr;
25291
+ }
25379
25292
  }
25380
25293
  }
25381
25294
 
@@ -46100,7 +46013,9 @@ export namespace Systems {
46100
46013
  }
46101
46014
 
46102
46015
  /**
46103
- * @description Enter a space.
46016
+ * @description Enter a space if you have permission to, based on the Space settings.
46017
+ * This includes setting scopes (and toggling event listening in order to set the scope).
46018
+ * It also retrieves all entities in the space. Ensure Connect is called prior to this.
46104
46019
  * @param space - Space to enter into
46105
46020
  * @param callback - Callback when asynchronous task finishes
46106
46021
  */
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": "4.20.0+498",
4
+ "version": "4.21.0+501",
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": {