connected-spaces-platform.web 4.20.0 → 4.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.
- package/ConnectedSpacesPlatform_WASM.d.ts +2 -0
- package/Debug/ConnectedSpacesPlatform_WASM.js +8 -20
- package/Debug/ConnectedSpacesPlatform_WASM.wasm +0 -0
- package/Debug/ConnectedSpacesPlatform_WASM.wasm.debug.wasm +0 -0
- package/README.md +24 -10
- package/Release/ConnectedSpacesPlatform_WASM.js +1 -1
- package/Release/ConnectedSpacesPlatform_WASM.wasm +0 -0
- package/connectedspacesplatform.d.ts +10222 -10245
- package/connectedspacesplatform.js +25200 -25277
- package/connectedspacesplatform.js.map +1 -1
- package/connectedspacesplatform.ts +41 -188
- package/package.json +1 -1
|
@@ -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
|
|
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,149 +21372,12 @@ 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
|
-
/**
|
|
21429
|
-
* @description Start the connection and register to start receiving updates from the server.
|
|
21430
|
-
* @param callback - A callback with failure state.
|
|
21431
|
-
*/
|
|
21432
|
-
|
|
21433
|
-
async connect(): Promise<Multiplayer.ErrorCode> {
|
|
21434
|
-
var _resolve;
|
|
21435
|
-
|
|
21436
|
-
var _promise = new Promise<Multiplayer.ErrorCode>((_r) => {
|
|
21437
|
-
_resolve = _r;
|
|
21438
|
-
});
|
|
21439
|
-
|
|
21440
|
-
var _callbackPtr: number;
|
|
21441
|
-
var _callback = (_stateObject__: number, arg1) => {
|
|
21442
|
-
_resolve(arg1);
|
|
21443
|
-
|
|
21444
|
-
Module.removeFunction(_callbackPtr);
|
|
21445
|
-
};
|
|
21446
|
-
|
|
21447
|
-
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
21448
|
-
|
|
21449
|
-
Module.ccall(
|
|
21450
|
-
"csp_multiplayer_MultiplayerConnection_Connect_void_ErrorCodeCallbackHandler",
|
|
21451
|
-
"void",
|
|
21452
|
-
["number", "number", "number"],
|
|
21453
|
-
[this.pointer, _callbackPtr, 0],
|
|
21454
|
-
);
|
|
21455
|
-
|
|
21456
|
-
return _promise;
|
|
21457
|
-
}
|
|
21458
|
-
|
|
21459
|
-
/**
|
|
21460
|
-
* @description End the multiplayer connection.
|
|
21461
|
-
* @param callback - A callback with failure state.
|
|
21462
|
-
*/
|
|
21463
|
-
|
|
21464
|
-
async disconnect(): Promise<Multiplayer.ErrorCode> {
|
|
21465
|
-
var _resolve;
|
|
21466
|
-
|
|
21467
|
-
var _promise = new Promise<Multiplayer.ErrorCode>((_r) => {
|
|
21468
|
-
_resolve = _r;
|
|
21469
|
-
});
|
|
21470
|
-
|
|
21471
|
-
var _callbackPtr: number;
|
|
21472
|
-
var _callback = (_stateObject__: number, arg1) => {
|
|
21473
|
-
_resolve(arg1);
|
|
21474
|
-
|
|
21475
|
-
Module.removeFunction(_callbackPtr);
|
|
21476
|
-
};
|
|
21477
|
-
|
|
21478
|
-
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
21479
|
-
|
|
21480
|
-
Module.ccall(
|
|
21481
|
-
"csp_multiplayer_MultiplayerConnection_Disconnect_void_ErrorCodeCallbackHandler",
|
|
21482
|
-
"void",
|
|
21483
|
-
["number", "number", "number"],
|
|
21484
|
-
[this.pointer, _callbackPtr, 0],
|
|
21485
|
-
);
|
|
21486
|
-
|
|
21487
|
-
return _promise;
|
|
21488
|
-
}
|
|
21489
|
-
|
|
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
21381
|
/**
|
|
21522
21382
|
* @description Sends a network event by EventName to all currently connected clients.
|
|
21523
21383
|
* @param eventName - The identifying name for the event.
|
|
@@ -21821,26 +21681,6 @@ export namespace Multiplayer {
|
|
|
21821
21681
|
return _result;
|
|
21822
21682
|
}
|
|
21823
21683
|
|
|
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
21684
|
/**
|
|
21845
21685
|
* @description Gets a pointer to the conversation system.
|
|
21846
21686
|
* @return A pointer to the conversation system.
|
|
@@ -23606,26 +23446,6 @@ export namespace Multiplayer {
|
|
|
23606
23446
|
return _nPtr;
|
|
23607
23447
|
}
|
|
23608
23448
|
|
|
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
23449
|
/**
|
|
23630
23450
|
* @description Add a new entity to the system.
|
|
23631
23451
|
* /// This can be called at any time from any thread and internally add the entity to a pending
|
|
@@ -25376,6 +25196,36 @@ export namespace Systems {
|
|
|
25376
25196
|
|
|
25377
25197
|
return _nPtr;
|
|
25378
25198
|
}
|
|
25199
|
+
|
|
25200
|
+
getSpaceEntitySystem(): Multiplayer.SpaceEntitySystem {
|
|
25201
|
+
var _ret = Module._malloc(8);
|
|
25202
|
+
|
|
25203
|
+
Module.ccall(
|
|
25204
|
+
"csp_systems_SystemsManager_GetSpaceEntitySystem_SpaceEntitySystemP",
|
|
25205
|
+
"void",
|
|
25206
|
+
["number", "number"],
|
|
25207
|
+
[_ret, this.pointer],
|
|
25208
|
+
);
|
|
25209
|
+
var _nPtr = new Multiplayer.SpaceEntitySystem(getNativePointer(_ret));
|
|
25210
|
+
Module._free(_ret);
|
|
25211
|
+
|
|
25212
|
+
return _nPtr;
|
|
25213
|
+
}
|
|
25214
|
+
|
|
25215
|
+
getMultiplayerConnection(): Multiplayer.MultiplayerConnection {
|
|
25216
|
+
var _ret = Module._malloc(8);
|
|
25217
|
+
|
|
25218
|
+
Module.ccall(
|
|
25219
|
+
"csp_systems_SystemsManager_GetMultiplayerConnection_MultiplayerConnectionP",
|
|
25220
|
+
"void",
|
|
25221
|
+
["number", "number"],
|
|
25222
|
+
[_ret, this.pointer],
|
|
25223
|
+
);
|
|
25224
|
+
var _nPtr = new Multiplayer.MultiplayerConnection(getNativePointer(_ret));
|
|
25225
|
+
Module._free(_ret);
|
|
25226
|
+
|
|
25227
|
+
return _nPtr;
|
|
25228
|
+
}
|
|
25379
25229
|
}
|
|
25380
25230
|
}
|
|
25381
25231
|
|
|
@@ -45049,10 +44899,11 @@ export namespace Systems {
|
|
|
45049
44899
|
* @description Retrieves the Avatar Portrait information associated with the space
|
|
45050
44900
|
* If the user of the Avatar portrait associated with it the result callback will be successful, the HTTP res code will be ResponseNotFound
|
|
45051
44901
|
* and the Uri field inside the UriResult will be empty
|
|
44902
|
+
* @param inUserID - The id of the user we are seelomg to retrieve the portrait for
|
|
45052
44903
|
* @param callback - Callback when asynchronous task finishes
|
|
45053
44904
|
*/
|
|
45054
44905
|
|
|
45055
|
-
async getAvatarPortrait(): Promise<Systems.UriResult> {
|
|
44906
|
+
async getAvatarPortrait(userID: string): Promise<Systems.UriResult> {
|
|
45056
44907
|
var _resolve;
|
|
45057
44908
|
|
|
45058
44909
|
var _promise = new Promise<Systems.UriResult>((_r) => {
|
|
@@ -45076,10 +44927,10 @@ export namespace Systems {
|
|
|
45076
44927
|
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
45077
44928
|
|
|
45078
44929
|
Module.ccall(
|
|
45079
|
-
"
|
|
44930
|
+
"csp_systems_SettingsSystem_GetAvatarPortrait_void_StringC_UriResultCallback",
|
|
45080
44931
|
"void",
|
|
45081
|
-
["number", "number", "number"],
|
|
45082
|
-
[this.pointer, _callbackPtr, 0],
|
|
44932
|
+
["number", "string", "number", "number"],
|
|
44933
|
+
[this.pointer, userID, _callbackPtr, 0],
|
|
45083
44934
|
);
|
|
45084
44935
|
|
|
45085
44936
|
return _promise;
|
|
@@ -46100,7 +45951,9 @@ export namespace Systems {
|
|
|
46100
45951
|
}
|
|
46101
45952
|
|
|
46102
45953
|
/**
|
|
46103
|
-
* @description Enter a space.
|
|
45954
|
+
* @description Enter a space if you have permission to, based on the Space settings.
|
|
45955
|
+
* This includes setting scopes (and toggling event listening in order to set the scope).
|
|
45956
|
+
* It also retrieves all entities in the space. Ensure Connect is called prior to this.
|
|
46104
45957
|
* @param space - Space to enter into
|
|
46105
45958
|
* @param callback - Callback when asynchronous task finishes
|
|
46106
45959
|
*/
|
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.
|
|
4
|
+
"version": "4.22.0+502",
|
|
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": {
|