connected-spaces-platform.web 5.22.0 → 6.0.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/Debug/ConnectedSpacesPlatform_WASM.js +115 -93
- package/Debug/ConnectedSpacesPlatform_WASM.wasm +0 -0
- package/Debug/ConnectedSpacesPlatform_WASM.wasm.debug.wasm +0 -0
- package/README.md +1 -1
- package/Release/ConnectedSpacesPlatform_WASM.js +1 -1
- package/Release/ConnectedSpacesPlatform_WASM.wasm +0 -0
- package/connectedspacesplatform.d.ts +323 -261
- package/connectedspacesplatform.js +940 -702
- package/connectedspacesplatform.js.map +1 -1
- package/connectedspacesplatform.ts +1941 -1534
- package/package.json +1 -1
|
@@ -733,16 +733,16 @@ function csp_common_Vector4Factory(nativePointer) {
|
|
|
733
733
|
return new Common.Vector4(nativePointer);
|
|
734
734
|
}
|
|
735
735
|
ProxyClassFactories["csp_common_Vector4"] = csp_common_Vector4Factory;
|
|
736
|
-
function csp_common_InvalidInterfaceUseErrorFactory(nativePointer) {
|
|
737
|
-
return new Common.InvalidInterfaceUseError(nativePointer);
|
|
738
|
-
}
|
|
739
|
-
ProxyClassFactories["csp_common_InvalidInterfaceUseError"] =
|
|
740
|
-
csp_common_InvalidInterfaceUseErrorFactory;
|
|
741
736
|
function csp_common_IJSScriptRunnerFactory(nativePointer) {
|
|
742
737
|
return new Common.IJSScriptRunner(nativePointer);
|
|
743
738
|
}
|
|
744
739
|
ProxyClassFactories["csp_common_IJSScriptRunner"] =
|
|
745
740
|
csp_common_IJSScriptRunnerFactory;
|
|
741
|
+
function csp_common_InvalidInterfaceUseErrorFactory(nativePointer) {
|
|
742
|
+
return new Common.InvalidInterfaceUseError(nativePointer);
|
|
743
|
+
}
|
|
744
|
+
ProxyClassFactories["csp_common_InvalidInterfaceUseError"] =
|
|
745
|
+
csp_common_InvalidInterfaceUseErrorFactory;
|
|
746
746
|
function csp_common_IRealtimeEngineFactory(nativePointer) {
|
|
747
747
|
return new Common.IRealtimeEngine(nativePointer);
|
|
748
748
|
}
|
|
@@ -787,11 +787,6 @@ function csp_multiplayer_SpaceEntityFactory(nativePointer) {
|
|
|
787
787
|
}
|
|
788
788
|
ProxyClassFactories["csp_multiplayer_SpaceEntity"] =
|
|
789
789
|
csp_multiplayer_SpaceEntityFactory;
|
|
790
|
-
function csp_multiplayer_SpaceEntitySystemFactory(nativePointer) {
|
|
791
|
-
return new Multiplayer.SpaceEntitySystem(nativePointer);
|
|
792
|
-
}
|
|
793
|
-
ProxyClassFactories["csp_multiplayer_SpaceEntitySystem"] =
|
|
794
|
-
csp_multiplayer_SpaceEntitySystemFactory;
|
|
795
790
|
function csp_multiplayer_SpaceTransformFactory(nativePointer) {
|
|
796
791
|
return new Multiplayer.SpaceTransform(nativePointer);
|
|
797
792
|
}
|
|
@@ -990,6 +985,11 @@ function csp_systems_SequenceFactory(nativePointer) {
|
|
|
990
985
|
return new Systems.Sequence(nativePointer);
|
|
991
986
|
}
|
|
992
987
|
ProxyClassFactories["csp_systems_Sequence"] = csp_systems_SequenceFactory;
|
|
988
|
+
function csp_systems_ApplicationSettingsFactory(nativePointer) {
|
|
989
|
+
return new Systems.ApplicationSettings(nativePointer);
|
|
990
|
+
}
|
|
991
|
+
ProxyClassFactories["csp_systems_ApplicationSettings"] =
|
|
992
|
+
csp_systems_ApplicationSettingsFactory;
|
|
993
993
|
function csp_systems_SettingsCollectionFactory(nativePointer) {
|
|
994
994
|
return new Systems.SettingsCollection(nativePointer);
|
|
995
995
|
}
|
|
@@ -1099,6 +1099,11 @@ function csp_common_SequenceChangedNetworkEventDataFactory(nativePointer) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
ProxyClassFactories["csp_common_SequenceChangedNetworkEventData"] =
|
|
1101
1101
|
csp_common_SequenceChangedNetworkEventDataFactory;
|
|
1102
|
+
function csp_multiplayer_OnlineRealtimeEngineFactory(nativePointer) {
|
|
1103
|
+
return new Multiplayer.OnlineRealtimeEngine(nativePointer);
|
|
1104
|
+
}
|
|
1105
|
+
ProxyClassFactories["csp_multiplayer_OnlineRealtimeEngine"] =
|
|
1106
|
+
csp_multiplayer_OnlineRealtimeEngineFactory;
|
|
1102
1107
|
function csp_multiplayer_AnimatedModelSpaceComponentFactory(nativePointer) {
|
|
1103
1108
|
return new Multiplayer.AnimatedModelSpaceComponent(nativePointer);
|
|
1104
1109
|
}
|
|
@@ -1494,6 +1499,16 @@ function csp_systems_SequenceSystemFactory(nativePointer) {
|
|
|
1494
1499
|
}
|
|
1495
1500
|
ProxyClassFactories["csp_systems_SequenceSystem"] =
|
|
1496
1501
|
csp_systems_SequenceSystemFactory;
|
|
1502
|
+
function csp_systems_ApplicationSettingsResultFactory(nativePointer) {
|
|
1503
|
+
return new Systems.ApplicationSettingsResult(nativePointer);
|
|
1504
|
+
}
|
|
1505
|
+
ProxyClassFactories["csp_systems_ApplicationSettingsResult"] =
|
|
1506
|
+
csp_systems_ApplicationSettingsResultFactory;
|
|
1507
|
+
function csp_systems_ApplicationSettingsSystemFactory(nativePointer) {
|
|
1508
|
+
return new Systems.ApplicationSettingsSystem(nativePointer);
|
|
1509
|
+
}
|
|
1510
|
+
ProxyClassFactories["csp_systems_ApplicationSettingsSystem"] =
|
|
1511
|
+
csp_systems_ApplicationSettingsSystemFactory;
|
|
1497
1512
|
function csp_systems_SettingsCollectionResultFactory(nativePointer) {
|
|
1498
1513
|
return new Systems.SettingsCollectionResult(nativePointer);
|
|
1499
1514
|
}
|
|
@@ -2160,8 +2175,8 @@ export var Systems;
|
|
|
2160
2175
|
*/
|
|
2161
2176
|
let RealtimeEngineType;
|
|
2162
2177
|
(function (RealtimeEngineType) {
|
|
2163
|
-
RealtimeEngineType[RealtimeEngineType["
|
|
2164
|
-
RealtimeEngineType[RealtimeEngineType["
|
|
2178
|
+
RealtimeEngineType[RealtimeEngineType["Online"] = 0] = "Online";
|
|
2179
|
+
RealtimeEngineType[RealtimeEngineType["Offline"] = 1] = "Offline";
|
|
2165
2180
|
})(RealtimeEngineType = Common.RealtimeEngineType || (Common.RealtimeEngineType = {}));
|
|
2166
2181
|
})(Common || (Common = {}));
|
|
2167
2182
|
(function (Common) {
|
|
@@ -2251,6 +2266,10 @@ export var Systems;
|
|
|
2251
2266
|
MultiplayerHubMethod[MultiplayerHubMethod["SET_SCOPES"] = 11] = "SET_SCOPES";
|
|
2252
2267
|
MultiplayerHubMethod[MultiplayerHubMethod["START_LISTENING"] = 12] = "START_LISTENING";
|
|
2253
2268
|
MultiplayerHubMethod[MultiplayerHubMethod["STOP_LISTENING"] = 13] = "STOP_LISTENING";
|
|
2269
|
+
MultiplayerHubMethod[MultiplayerHubMethod["ON_OBJECT_MESSAGE"] = 14] = "ON_OBJECT_MESSAGE";
|
|
2270
|
+
MultiplayerHubMethod[MultiplayerHubMethod["ON_OBJECT_PATCH"] = 15] = "ON_OBJECT_PATCH";
|
|
2271
|
+
MultiplayerHubMethod[MultiplayerHubMethod["ON_REQUEST_TO_SEND_OBJECT"] = 16] = "ON_REQUEST_TO_SEND_OBJECT";
|
|
2272
|
+
MultiplayerHubMethod[MultiplayerHubMethod["ON_REQUEST_TO_DISCONNECT"] = 17] = "ON_REQUEST_TO_DISCONNECT";
|
|
2254
2273
|
})(MultiplayerHubMethod = Multiplayer.MultiplayerHubMethod || (Multiplayer.MultiplayerHubMethod = {}));
|
|
2255
2274
|
})(Multiplayer || (Multiplayer = {}));
|
|
2256
2275
|
(function (Multiplayer) {
|
|
@@ -10043,56 +10062,56 @@ export class CSPFoundation {
|
|
|
10043
10062
|
Common.Vector4 = Vector4;
|
|
10044
10063
|
})(Common || (Common = {}));
|
|
10045
10064
|
(function (Common) {
|
|
10046
|
-
class
|
|
10065
|
+
class IJSScriptRunner extends NativeClassWrapper {
|
|
10047
10066
|
/** @internal */
|
|
10048
10067
|
constructor(pointer) {
|
|
10049
10068
|
super(pointer);
|
|
10050
10069
|
}
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
var _nPtr = getNativePointer(_ptr);
|
|
10055
|
-
return new InvalidInterfaceUseError(_nPtr);
|
|
10056
|
-
}
|
|
10070
|
+
/**
|
|
10071
|
+
* @description Virtual destructor.
|
|
10072
|
+
*/
|
|
10057
10073
|
delete() {
|
|
10058
10074
|
if (this.ownsPointer && !this.disposed) {
|
|
10059
|
-
Module.ccall("
|
|
10075
|
+
Module.ccall("csp_common_IJSScriptRunner_Dtor", "void", ["number"], [this.pointer]);
|
|
10060
10076
|
this.disposed = true;
|
|
10061
10077
|
}
|
|
10062
10078
|
}
|
|
10063
|
-
|
|
10064
|
-
|
|
10079
|
+
runScript(contextId, scriptText) {
|
|
10080
|
+
assert(contextId >= Limits.INT64_MIN);
|
|
10081
|
+
assert(contextId <= Limits.INT64_MAX);
|
|
10082
|
+
let _result = Module.ccall("csp_common_IJSScriptRunner_RunScript_bool_int64_t_StringRC", "boolean", ["number", "bigint", "string"], [this.pointer, contextId, scriptText]);
|
|
10065
10083
|
return _result;
|
|
10066
10084
|
}
|
|
10067
|
-
set msg(value) {
|
|
10068
|
-
Module.ccall("csp_common_InvalidInterfaceUseError__Set_msg", "void", ["number", "string"], [this.pointer, value]);
|
|
10069
|
-
}
|
|
10070
10085
|
}
|
|
10071
|
-
Common.
|
|
10086
|
+
Common.IJSScriptRunner = IJSScriptRunner;
|
|
10072
10087
|
})(Common || (Common = {}));
|
|
10073
10088
|
(function (Common) {
|
|
10074
|
-
class
|
|
10089
|
+
class InvalidInterfaceUseError extends NativeClassWrapper {
|
|
10075
10090
|
/** @internal */
|
|
10076
10091
|
constructor(pointer) {
|
|
10077
10092
|
super(pointer);
|
|
10078
10093
|
}
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10094
|
+
static create_msg(msg) {
|
|
10095
|
+
var _ptr = Module._malloc(8);
|
|
10096
|
+
Module.ccall("csp_common_InvalidInterfaceUseError_Ctor_StringRC", "void", ["number", "string"], [_ptr, msg]);
|
|
10097
|
+
var _nPtr = getNativePointer(_ptr);
|
|
10098
|
+
return new InvalidInterfaceUseError(_nPtr);
|
|
10099
|
+
}
|
|
10082
10100
|
delete() {
|
|
10083
10101
|
if (this.ownsPointer && !this.disposed) {
|
|
10084
|
-
Module.ccall("
|
|
10102
|
+
Module.ccall("csp_common_InvalidInterfaceUseError_Dtor", "void", ["number"], [this.pointer]);
|
|
10085
10103
|
this.disposed = true;
|
|
10086
10104
|
}
|
|
10087
10105
|
}
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
assert(contextId <= Limits.INT64_MAX);
|
|
10091
|
-
let _result = Module.ccall("csp_common_IJSScriptRunner_RunScript_bool_int64_t_StringRC", "boolean", ["number", "bigint", "string"], [this.pointer, contextId, scriptText]);
|
|
10106
|
+
get msg() {
|
|
10107
|
+
let _result = Module.ccall("csp_common_InvalidInterfaceUseError__Get_msg", "string", ["number"], [this.pointer]);
|
|
10092
10108
|
return _result;
|
|
10093
10109
|
}
|
|
10110
|
+
set msg(value) {
|
|
10111
|
+
Module.ccall("csp_common_InvalidInterfaceUseError__Set_msg", "void", ["number", "string"], [this.pointer, value]);
|
|
10112
|
+
}
|
|
10094
10113
|
}
|
|
10095
|
-
Common.
|
|
10114
|
+
Common.InvalidInterfaceUseError = InvalidInterfaceUseError;
|
|
10096
10115
|
})(Common || (Common = {}));
|
|
10097
10116
|
(function (Common) {
|
|
10098
10117
|
class IRealtimeEngine extends NativeClassWrapper {
|
|
@@ -10119,14 +10138,17 @@ export class CSPFoundation {
|
|
|
10119
10138
|
/**
|
|
10120
10139
|
* @description Create and add a SpaceEntity with type Avatar, and relevant components and default states as specified.
|
|
10121
10140
|
* @param name - The entity name of the newly created avatar entity.
|
|
10141
|
+
* @param userId - Id of the user creating this avatar. If your backend data store requires authentication, this will
|
|
10142
|
+
* probably be your username or some similar unique identifier.
|
|
10122
10143
|
* @param spaceTransform - The initial transform to set the SpaceEntity to.
|
|
10123
|
-
* @param
|
|
10144
|
+
* @param isVisible - Whether the avatar defaults to being visible.
|
|
10145
|
+
* @param avatarState - The initial Avatar State to set.
|
|
10124
10146
|
* @param avatarId - The ID to be set on the AvatarSpaceComponent
|
|
10125
10147
|
* @param avatarPlayMode - The Initial AvatarPlayMode to set.
|
|
10126
10148
|
* @param callback - Csp::multiplayer::entitycreatedcallback a callback that executes when the creation is complete,
|
|
10127
10149
|
* which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
|
|
10128
10150
|
*/
|
|
10129
|
-
async createAvatar(name, spaceTransform,
|
|
10151
|
+
async createAvatar(name, userId, spaceTransform, isVisible, avatarState, avatarId, avatarPlayMode) {
|
|
10130
10152
|
var _resolve;
|
|
10131
10153
|
var _promise = new Promise((_r) => {
|
|
10132
10154
|
_resolve = _r;
|
|
@@ -10139,10 +10161,12 @@ export class CSPFoundation {
|
|
|
10139
10161
|
Module.removeFunction(_callbackPtr);
|
|
10140
10162
|
};
|
|
10141
10163
|
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
10142
|
-
Module.ccall("
|
|
10164
|
+
Module.ccall("csp_common_IRealtimeEngine_CreateAvatar_void_StringRC_StringRC_SpaceTransformRC_bool_AvatarStateRC_StringRC_AvatarPlayModeRC_EntityCreatedCallback", "void", [
|
|
10143
10165
|
"number",
|
|
10144
10166
|
"string",
|
|
10167
|
+
"string",
|
|
10145
10168
|
"number",
|
|
10169
|
+
"boolean",
|
|
10146
10170
|
"number",
|
|
10147
10171
|
"string",
|
|
10148
10172
|
"number",
|
|
@@ -10151,8 +10175,10 @@ export class CSPFoundation {
|
|
|
10151
10175
|
], [
|
|
10152
10176
|
this.pointer,
|
|
10153
10177
|
name,
|
|
10178
|
+
userId,
|
|
10154
10179
|
spaceTransform.pointer,
|
|
10155
|
-
|
|
10180
|
+
isVisible,
|
|
10181
|
+
avatarState,
|
|
10156
10182
|
avatarId,
|
|
10157
10183
|
avatarPlayMode,
|
|
10158
10184
|
_callbackPtr,
|
|
@@ -10164,10 +10190,12 @@ export class CSPFoundation {
|
|
|
10164
10190
|
* @description Create and add a SpaceEntity, with relevant default values.
|
|
10165
10191
|
* @param name - The name of the newly created SpaceEntity.
|
|
10166
10192
|
* @param spaceTransform - The initial transform to set the SpaceEntity to.
|
|
10193
|
+
* @param parentID - ID of another entity in the space that this entity should be created as a child to. If
|
|
10194
|
+
* empty, entity is created as a root entity.
|
|
10167
10195
|
* @param callback - A callback that executes when the creation is complete,
|
|
10168
10196
|
* which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
|
|
10169
10197
|
*/
|
|
10170
|
-
async createEntity(name, spaceTransform) {
|
|
10198
|
+
async createEntity(name, spaceTransform, parentID) {
|
|
10171
10199
|
var _resolve;
|
|
10172
10200
|
var _promise = new Promise((_r) => {
|
|
10173
10201
|
_resolve = _r;
|
|
@@ -10180,9 +10208,27 @@ export class CSPFoundation {
|
|
|
10180
10208
|
Module.removeFunction(_callbackPtr);
|
|
10181
10209
|
};
|
|
10182
10210
|
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
10183
|
-
|
|
10211
|
+
var parentIDPointer = 0;
|
|
10212
|
+
if (parentID != null) {
|
|
10213
|
+
parentIDPointer = Module._malloc(4);
|
|
10214
|
+
Module.setValue(parentIDPointer, parentID, "i32");
|
|
10215
|
+
}
|
|
10216
|
+
Module.ccall("csp_common_IRealtimeEngine_CreateEntity_void_StringRC_SpaceTransformRC_uint64_tRC_EntityCreatedCallback", "void", ["number", "string", "number", "bigint", "number", "number"], [
|
|
10217
|
+
this.pointer,
|
|
10218
|
+
name,
|
|
10219
|
+
spaceTransform.pointer,
|
|
10220
|
+
parentIDPointer,
|
|
10221
|
+
_callbackPtr,
|
|
10222
|
+
0,
|
|
10223
|
+
]);
|
|
10224
|
+
if (parentIDPointer) {
|
|
10225
|
+
Module._free(parentIDPointer);
|
|
10226
|
+
}
|
|
10184
10227
|
return _promise;
|
|
10185
10228
|
}
|
|
10229
|
+
addEntity(entityToAdd) {
|
|
10230
|
+
Module.ccall("csp_common_IRealtimeEngine_AddEntity_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entityToAdd.pointer]);
|
|
10231
|
+
}
|
|
10186
10232
|
/**
|
|
10187
10233
|
* @description Destroy the specified entity.
|
|
10188
10234
|
* @param entity - A non-owning pointer to the entity to be destroyed.
|
|
@@ -10205,6 +10251,8 @@ export class CSPFoundation {
|
|
|
10205
10251
|
/**
|
|
10206
10252
|
* @description Sets a callback to be executed when an entity is fully created.
|
|
10207
10253
|
* /// Only one EntityCreatedCallback may be registered, calling this function again will override whatever was previously set.
|
|
10254
|
+
* The better way to set this and avoid initialisation race conditions is via passing this in the constructor, only use this if you wish to
|
|
10255
|
+
* override or remove this callback.
|
|
10208
10256
|
* /// @param Callback csp::multiplayer::EntityCreatedCallback : the callback to execute.
|
|
10209
10257
|
*/
|
|
10210
10258
|
setEntityCreatedCallback(callback) {
|
|
@@ -10355,15 +10403,24 @@ export class CSPFoundation {
|
|
|
10355
10403
|
return _nPtr;
|
|
10356
10404
|
}
|
|
10357
10405
|
/**
|
|
10358
|
-
* @description
|
|
10359
|
-
*
|
|
10406
|
+
* @description Set Callback that notifies when the OnlineRealtimeEngine is in a valid state
|
|
10407
|
+
* after entering a space, and entity mutation can begin. Users should not mutate entities before receiving this callback.
|
|
10408
|
+
* This callback should be emitted in response to FetchAllEntitiesAndPopulateBuffers completing, either syncronously or asyncronously.
|
|
10409
|
+
* This callback must be set prior to entering a space.
|
|
10410
|
+
* @param fetchCompleteCallback - Callback that notifies when the RealtimeEngine has completed initial
|
|
10411
|
+
* entity fetch
|
|
10360
10412
|
*/
|
|
10361
|
-
|
|
10413
|
+
setEntityFetchCompleteCallback(callback) {
|
|
10362
10414
|
var _callback = (_stateObject__, arg1) => {
|
|
10415
|
+
{
|
|
10416
|
+
const _unfixedValue = arg1;
|
|
10417
|
+
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
10418
|
+
arg1 = _fixedValue;
|
|
10419
|
+
}
|
|
10363
10420
|
callback(arg1);
|
|
10364
10421
|
};
|
|
10365
10422
|
var _callbackPtr = Module.addFunction(_callback, "vii");
|
|
10366
|
-
Module.ccall("
|
|
10423
|
+
Module.ccall("csp_common_IRealtimeEngine_SetEntityFetchCompleteCallback_void_EntityFetchCompleteCallback", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
|
|
10367
10424
|
}
|
|
10368
10425
|
/**
|
|
10369
10426
|
* @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
|
|
@@ -10650,13 +10707,13 @@ export class CSPFoundation {
|
|
|
10650
10707
|
/**
|
|
10651
10708
|
* @description Constructor for CSPSceneDescription by deserializing a SceneDescription json file.
|
|
10652
10709
|
* @param sceneDescriptionJson - The SceneDescription to deserialize.
|
|
10653
|
-
* @param entitySystem - The
|
|
10654
|
-
* @param logSystem - The
|
|
10710
|
+
* @param entitySystem - The OnlineRealtimeEngine for this session.
|
|
10711
|
+
* @param logSystem - The OnlineRealtimeEngine for this session.
|
|
10655
10712
|
* @param remoteScriptRunner - The ScriptRunner for this session.
|
|
10656
10713
|
*/
|
|
10657
10714
|
static create_sceneDescriptionJson_entitySystem_logSystem_remoteScriptRunner(sceneDescriptionJson, entitySystem, logSystem, remoteScriptRunner) {
|
|
10658
10715
|
var _ptr = Module._malloc(8);
|
|
10659
|
-
Module.ccall("
|
|
10716
|
+
Module.ccall("csp_multiplayer_CSPSceneDescription_Ctor_StringRC_OnlineRealtimeEngineR_LogSystemR_IJSScriptRunnerR", "void", ["number", "string", "number", "number", "number"], [
|
|
10660
10717
|
_ptr,
|
|
10661
10718
|
sceneDescriptionJson,
|
|
10662
10719
|
entitySystem.pointer,
|
|
@@ -10791,6 +10848,18 @@ export class CSPFoundation {
|
|
|
10791
10848
|
let _result = Module.ccall("csp_multiplayer_MultiplayerConnection_GetAllowSelfMessagingFlagC_bool", "boolean", ["number"], [this.pointer]);
|
|
10792
10849
|
return _result;
|
|
10793
10850
|
}
|
|
10851
|
+
/**
|
|
10852
|
+
* @description Get the currently set realtime engine.
|
|
10853
|
+
* @return Non-owning pointer to currently set realtime engine. This should be non-null when in a space, and null before entering, or after
|
|
10854
|
+
* exiting a space.
|
|
10855
|
+
*/
|
|
10856
|
+
getOnlineRealtimeEngine() {
|
|
10857
|
+
var _ret = Module._malloc(8);
|
|
10858
|
+
Module.ccall("csp_multiplayer_MultiplayerConnection_GetOnlineRealtimeEngineC_OnlineRealtimeEngineP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
10859
|
+
var _nPtr = new Multiplayer.OnlineRealtimeEngine(getNativePointer(_ret));
|
|
10860
|
+
Module._free(_ret);
|
|
10861
|
+
return _nPtr;
|
|
10862
|
+
}
|
|
10794
10863
|
delete() {
|
|
10795
10864
|
if (this.ownsPointer && !this.disposed) {
|
|
10796
10865
|
Module.ccall("csp_multiplayer_MultiplayerConnection_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -11032,7 +11101,7 @@ export class CSPFoundation {
|
|
|
11032
11101
|
*/
|
|
11033
11102
|
static create_entitySystem_scriptRunner_logSystem(entitySystem, scriptRunner, logSystem) {
|
|
11034
11103
|
var _ptr = Module._malloc(8);
|
|
11035
|
-
Module.ccall("
|
|
11104
|
+
Module.ccall("csp_multiplayer_SpaceEntity_Ctor_OnlineRealtimeEngineP_IJSScriptRunnerR_LogSystemP", "void", ["number", "number", "number", "number"], [_ptr, entitySystem.pointer, scriptRunner.pointer, logSystem.pointer]);
|
|
11036
11105
|
var _nPtr = getNativePointer(_ptr);
|
|
11037
11106
|
return new SpaceEntity(_nPtr);
|
|
11038
11107
|
}
|
|
@@ -11244,17 +11313,6 @@ export class CSPFoundation {
|
|
|
11244
11313
|
let _result = Module.ccall("csp_multiplayer_SpaceEntity_GetEntityTypeC_SpaceEntityType", "number", ["number"], [this.pointer]);
|
|
11245
11314
|
return _result;
|
|
11246
11315
|
}
|
|
11247
|
-
/**
|
|
11248
|
-
* @description Get SpaceEntitySystem Object
|
|
11249
|
-
* @return SpaceEntitySystem
|
|
11250
|
-
*/
|
|
11251
|
-
getSpaceEntitySystem() {
|
|
11252
|
-
var _ret = Module._malloc(8);
|
|
11253
|
-
Module.ccall("csp_multiplayer_SpaceEntity_GetSpaceEntitySystem_SpaceEntitySystemP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
11254
|
-
var _nPtr = new Multiplayer.SpaceEntitySystem(getNativePointer(_ret));
|
|
11255
|
-
Module._free(_ret);
|
|
11256
|
-
return _nPtr;
|
|
11257
|
-
}
|
|
11258
11316
|
/**
|
|
11259
11317
|
* @description Sets the parent for this entity
|
|
11260
11318
|
* QueueUpdate() should be called afterwards to enable changes to the parent.
|
|
@@ -11524,632 +11582,187 @@ export class CSPFoundation {
|
|
|
11524
11582
|
})(Multiplayer || (Multiplayer = {}));
|
|
11525
11583
|
(function (Multiplayer) {
|
|
11526
11584
|
/**
|
|
11527
|
-
* @description
|
|
11528
|
-
* /// This provides functions to create and manage multiple player avatars and other objects.
|
|
11529
|
-
* It manages things like queueing updated entities and triggering tick events. Callbacks
|
|
11530
|
-
* can be registered for certain events that occur within the entity system so clients can
|
|
11531
|
-
* react appropriately.
|
|
11585
|
+
* @description Simple class for holding the position, rotation and scale of a transform.
|
|
11532
11586
|
*/
|
|
11533
|
-
class
|
|
11587
|
+
class SpaceTransform extends NativeClassWrapper {
|
|
11534
11588
|
/** @internal */
|
|
11535
11589
|
constructor(pointer) {
|
|
11536
11590
|
super(pointer);
|
|
11537
11591
|
}
|
|
11538
11592
|
/**
|
|
11539
|
-
* @description
|
|
11540
|
-
* @param inName - The name to give the new SpaceEntity.
|
|
11541
|
-
* @param inSpaceTransform - The initial transform to set the SpaceEntity to.
|
|
11542
|
-
* @param isVisible - The initial visibility of the Avatar.
|
|
11543
|
-
* @param inState - The initial Avatar State to set.
|
|
11544
|
-
* @param inAvatarId - The Initial AvatarID to set.
|
|
11545
|
-
* @param inAvatarPlayMode - The Initial AvatarPlayMode to set.
|
|
11546
|
-
* @param callback - EntityCreatedCallback A callback that executes when the creation is complete,
|
|
11547
|
-
* which contains a pointer to the new SpaceEntity so that it can be used on the local client.
|
|
11593
|
+
* @description Default constuctor for the SpaceTransform
|
|
11548
11594
|
*/
|
|
11549
|
-
|
|
11550
|
-
var
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
var _callbackPtr;
|
|
11555
|
-
var _callback = (_stateObject__, arg1) => {
|
|
11556
|
-
var _arg1Ptr = getNativePointer(arg1);
|
|
11557
|
-
var _arg1Instance = new Multiplayer.SpaceEntity(_arg1Ptr);
|
|
11558
|
-
_resolve(_arg1Instance);
|
|
11559
|
-
Module.removeFunction(_callbackPtr);
|
|
11560
|
-
};
|
|
11561
|
-
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
11562
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_CreateAvatar_void_StringRC_LoginStateRC_SpaceTransformRC_bool_AvatarState_StringRC_AvatarPlayMode_EntityCreatedCallback", "void", [
|
|
11563
|
-
"number",
|
|
11564
|
-
"string",
|
|
11565
|
-
"number",
|
|
11566
|
-
"number",
|
|
11567
|
-
"boolean",
|
|
11568
|
-
"number",
|
|
11569
|
-
"string",
|
|
11570
|
-
"number",
|
|
11571
|
-
"number",
|
|
11572
|
-
"number",
|
|
11573
|
-
], [
|
|
11574
|
-
this.pointer,
|
|
11575
|
-
name,
|
|
11576
|
-
loginState.pointer,
|
|
11577
|
-
spaceTransform.pointer,
|
|
11578
|
-
isVisible,
|
|
11579
|
-
state,
|
|
11580
|
-
avatarId,
|
|
11581
|
-
avatarPlayMode,
|
|
11582
|
-
_callbackPtr,
|
|
11583
|
-
0,
|
|
11584
|
-
]);
|
|
11585
|
-
return _promise;
|
|
11595
|
+
static create() {
|
|
11596
|
+
var _ptr = Module._malloc(8);
|
|
11597
|
+
Module.ccall("csp_multiplayer_SpaceTransform_Ctor", "void", ["number"], [_ptr]);
|
|
11598
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11599
|
+
return new SpaceTransform(_nPtr);
|
|
11586
11600
|
}
|
|
11587
11601
|
/**
|
|
11588
|
-
* @description
|
|
11589
|
-
* @param
|
|
11590
|
-
* @param
|
|
11591
|
-
* @param
|
|
11592
|
-
* which contains a pointer to the new SpaceEntity so that it can be used on the local client.
|
|
11602
|
+
* @description Custom constructor for the SpaceTransform.
|
|
11603
|
+
* @param position - The position value for the transform.
|
|
11604
|
+
* @param rotation - The rotation value for the transform, will be normalized during multiplication operations.
|
|
11605
|
+
* @param scale - The scale value for the transform.
|
|
11593
11606
|
*/
|
|
11594
|
-
|
|
11595
|
-
var
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
var _callbackPtr;
|
|
11600
|
-
var _callback = (_stateObject__, arg1) => {
|
|
11601
|
-
var _arg1Ptr = getNativePointer(arg1);
|
|
11602
|
-
var _arg1Instance = new Multiplayer.SpaceEntity(_arg1Ptr);
|
|
11603
|
-
_resolve(_arg1Instance);
|
|
11604
|
-
Module.removeFunction(_callbackPtr);
|
|
11605
|
-
};
|
|
11606
|
-
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
11607
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_CreateObject_void_StringRC_SpaceTransformRC_EntityCreatedCallback", "void", ["number", "string", "number", "number", "number"], [this.pointer, name, spaceTransform.pointer, _callbackPtr, 0]);
|
|
11608
|
-
return _promise;
|
|
11607
|
+
static create_position_rotation_scale(position, rotation, scale) {
|
|
11608
|
+
var _ptr = Module._malloc(8);
|
|
11609
|
+
Module.ccall("csp_multiplayer_SpaceTransform_Ctor_Vector3RC_Vector4RC_Vector3RC", "void", ["number", "number", "number", "number"], [_ptr, position.pointer, rotation.pointer, scale.pointer]);
|
|
11610
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11611
|
+
return new SpaceTransform(_nPtr);
|
|
11609
11612
|
}
|
|
11610
11613
|
/**
|
|
11611
|
-
* @description
|
|
11612
|
-
* @param
|
|
11613
|
-
* @param callback - The callback to execute.
|
|
11614
|
+
* @description Equality operator
|
|
11615
|
+
* @param spaceTransform - Transform
|
|
11614
11616
|
*/
|
|
11615
|
-
|
|
11616
|
-
var _resolve;
|
|
11617
|
-
var _promise = new Promise((_r) => {
|
|
11618
|
-
_resolve = _r;
|
|
11619
|
-
});
|
|
11620
|
-
var _callbackPtr;
|
|
11621
|
-
var _callback = (_stateObject__, arg1) => {
|
|
11622
|
-
_resolve(!!arg1);
|
|
11623
|
-
Module.removeFunction(_callbackPtr);
|
|
11624
|
-
};
|
|
11625
|
-
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
11626
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_DestroyEntity_void_SpaceEntityP_CallbackHandler", "void", ["number", "number", "number", "number"], [this.pointer, entity.pointer, _callbackPtr, 0]);
|
|
11627
|
-
return _promise;
|
|
11628
|
-
}
|
|
11617
|
+
// operator==
|
|
11629
11618
|
/**
|
|
11630
|
-
* @description
|
|
11631
|
-
* @param
|
|
11619
|
+
* @description Inequality operator
|
|
11620
|
+
* @param spaceTransform - Transform
|
|
11632
11621
|
*/
|
|
11633
|
-
|
|
11634
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_LocalDestroyEntity_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entity.pointer]);
|
|
11635
|
-
}
|
|
11622
|
+
// operator!=
|
|
11636
11623
|
/**
|
|
11637
|
-
* @description
|
|
11638
|
-
* @param
|
|
11639
|
-
*
|
|
11624
|
+
* @description Multiplication operator
|
|
11625
|
+
* @param spaceTransform - Transform
|
|
11626
|
+
* NOTE: This performs TRS matrix composition, then decomposes back to Pos, Rot, Scale.
|
|
11640
11627
|
*/
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11628
|
+
// operator*
|
|
11629
|
+
delete() {
|
|
11630
|
+
if (this.ownsPointer && !this.disposed) {
|
|
11631
|
+
Module.ccall("csp_multiplayer_SpaceTransform_Dtor", "void", ["number"], [this.pointer]);
|
|
11632
|
+
this.disposed = true;
|
|
11633
|
+
}
|
|
11647
11634
|
}
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
findSpaceEntityById(entityId) {
|
|
11654
|
-
assert(entityId >= Limits.UINT64_MIN);
|
|
11655
|
-
assert(entityId <= Limits.UINT64_MAX);
|
|
11656
|
-
var _ret = Module._malloc(8);
|
|
11657
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_FindSpaceEntityById_SpaceEntityP_uint64_t", "void", ["number", "number", "bigint"], [_ret, this.pointer, entityId]);
|
|
11658
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11659
|
-
Module._free(_ret);
|
|
11660
|
-
return _nPtr;
|
|
11635
|
+
get position() {
|
|
11636
|
+
const _ptr = Module._malloc(8);
|
|
11637
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Get_Position", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
11638
|
+
const _nPtr = getNativePointer(_ptr);
|
|
11639
|
+
return new Common.Vector3(_nPtr);
|
|
11661
11640
|
}
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
* @param inName - The name to search.
|
|
11665
|
-
* @return A pointer to the first found match SpaceEntity.
|
|
11666
|
-
*/
|
|
11667
|
-
findSpaceAvatar(name) {
|
|
11668
|
-
var _ret = Module._malloc(8);
|
|
11669
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_FindSpaceAvatar_SpaceEntityP_StringRC", "void", ["number", "number", "string"], [_ret, this.pointer, name]);
|
|
11670
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11671
|
-
Module._free(_ret);
|
|
11672
|
-
return _nPtr;
|
|
11641
|
+
set position(value) {
|
|
11642
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Set_Position", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
11673
11643
|
}
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
findSpaceObject(name) {
|
|
11680
|
-
var _ret = Module._malloc(8);
|
|
11681
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_FindSpaceObject_SpaceEntityP_StringRC", "void", ["number", "number", "string"], [_ret, this.pointer, name]);
|
|
11682
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11683
|
-
Module._free(_ret);
|
|
11684
|
-
return _nPtr;
|
|
11644
|
+
get rotation() {
|
|
11645
|
+
const _ptr = Module._malloc(8);
|
|
11646
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Get_Rotation", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
11647
|
+
const _nPtr = getNativePointer(_ptr);
|
|
11648
|
+
return new Common.Vector4(_nPtr);
|
|
11685
11649
|
}
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
*/
|
|
11689
|
-
lockEntityUpdate() {
|
|
11690
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_LockEntityUpdateC_void", "void", ["number"], [this.pointer]);
|
|
11650
|
+
set rotation(value) {
|
|
11651
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Set_Rotation", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
11691
11652
|
}
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11653
|
+
get scale() {
|
|
11654
|
+
const _ptr = Module._malloc(8);
|
|
11655
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Get_Scale", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
11656
|
+
const _nPtr = getNativePointer(_ptr);
|
|
11657
|
+
return new Common.Vector3(_nPtr);
|
|
11697
11658
|
}
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
* @return The total number of entities.
|
|
11701
|
-
*/
|
|
11702
|
-
getNumEntities() {
|
|
11703
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_GetNumEntitiesC_size_t", "number", ["number"], [this.pointer]);
|
|
11704
|
-
const _unfixedValue = _result;
|
|
11705
|
-
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
11706
|
-
_result = _fixedValue;
|
|
11707
|
-
return _result;
|
|
11708
|
-
}
|
|
11709
|
-
/**
|
|
11710
|
-
* @description Get the number of total Avatars in the system.
|
|
11711
|
-
* @return The total number of Avatar entities.
|
|
11712
|
-
*/
|
|
11713
|
-
getNumAvatars() {
|
|
11714
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_GetNumAvatarsC_size_t", "number", ["number"], [this.pointer]);
|
|
11715
|
-
const _unfixedValue = _result;
|
|
11716
|
-
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
11717
|
-
_result = _fixedValue;
|
|
11718
|
-
return _result;
|
|
11719
|
-
}
|
|
11720
|
-
/**
|
|
11721
|
-
* @description Get the number of total Objects in the system.
|
|
11722
|
-
* @return The total number of object entities.
|
|
11723
|
-
*/
|
|
11724
|
-
getNumObjects() {
|
|
11725
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_GetNumObjectsC_size_t", "number", ["number"], [this.pointer]);
|
|
11726
|
-
const _unfixedValue = _result;
|
|
11727
|
-
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
11728
|
-
_result = _fixedValue;
|
|
11729
|
-
return _result;
|
|
11730
|
-
}
|
|
11731
|
-
/**
|
|
11732
|
-
* @description Get an Entity (Avatar or Object) by its index.
|
|
11733
|
-
* /// Note this is not currently thread safe and should only be called from the main thread.
|
|
11734
|
-
* /// @param EntityIndex size_t : The index of the entity to get.
|
|
11735
|
-
* @return A pointer to the entity with the given index.
|
|
11736
|
-
*/
|
|
11737
|
-
getEntityByIndex(entityIndex) {
|
|
11738
|
-
assert(Number.isInteger(entityIndex));
|
|
11739
|
-
assert(entityIndex >= Limits.UINT32_MIN);
|
|
11740
|
-
assert(entityIndex <= Limits.UINT32_MAX);
|
|
11741
|
-
var _ret = Module._malloc(8);
|
|
11742
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_GetEntityByIndex_SpaceEntityP_size_tC", "void", ["number", "number", "number"], [_ret, this.pointer, entityIndex]);
|
|
11743
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11744
|
-
Module._free(_ret);
|
|
11745
|
-
return _nPtr;
|
|
11746
|
-
}
|
|
11747
|
-
/**
|
|
11748
|
-
* @description Get an Avatar by its index.
|
|
11749
|
-
* /// Note this is not currently thread safe and should only be called from the main thread.
|
|
11750
|
-
* /// @param AvatarIndex size_t : The index of the avatar entity to get.
|
|
11751
|
-
* @return A pointer to the avatar entity with the given index.
|
|
11752
|
-
*/
|
|
11753
|
-
getAvatarByIndex(avatarIndex) {
|
|
11754
|
-
assert(Number.isInteger(avatarIndex));
|
|
11755
|
-
assert(avatarIndex >= Limits.UINT32_MIN);
|
|
11756
|
-
assert(avatarIndex <= Limits.UINT32_MAX);
|
|
11757
|
-
var _ret = Module._malloc(8);
|
|
11758
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_GetAvatarByIndex_SpaceEntityP_size_tC", "void", ["number", "number", "number"], [_ret, this.pointer, avatarIndex]);
|
|
11759
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11760
|
-
Module._free(_ret);
|
|
11761
|
-
return _nPtr;
|
|
11762
|
-
}
|
|
11763
|
-
/**
|
|
11764
|
-
* @description Get an Object by its index.
|
|
11765
|
-
* /// Note this is not currently thread safe and should only be called from the main thread.
|
|
11766
|
-
* /// @param ObjectIndex size_t : The index of the object entity to get.
|
|
11767
|
-
* @return A pointer to the object entity with the given index.
|
|
11768
|
-
*/
|
|
11769
|
-
getObjectByIndex(objectIndex) {
|
|
11770
|
-
assert(Number.isInteger(objectIndex));
|
|
11771
|
-
assert(objectIndex >= Limits.UINT32_MIN);
|
|
11772
|
-
assert(objectIndex <= Limits.UINT32_MAX);
|
|
11773
|
-
var _ret = Module._malloc(8);
|
|
11774
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_GetObjectByIndex_SpaceEntityP_size_tC", "void", ["number", "number", "number"], [_ret, this.pointer, objectIndex]);
|
|
11775
|
-
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
11776
|
-
Module._free(_ret);
|
|
11777
|
-
return _nPtr;
|
|
11778
|
-
}
|
|
11779
|
-
/**
|
|
11780
|
-
* @description Add a new entity to the system.
|
|
11781
|
-
* /// This can be called at any time from any thread and internally add the entity to a pending
|
|
11782
|
-
* list which is then updated in a thread safe manner when ProcessPendingEntityOperations
|
|
11783
|
-
* is called from the main thread.
|
|
11784
|
-
* /// @param EntityToAdd SpaceEntity : Pointer to the entity to be added.
|
|
11785
|
-
*/
|
|
11786
|
-
addEntity(entityToAdd) {
|
|
11787
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_AddEntity_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entityToAdd.pointer]);
|
|
11788
|
-
}
|
|
11789
|
-
/**
|
|
11790
|
-
* @description Sets a callback to be executed when an entity is remotely created.
|
|
11791
|
-
* /// Only one callback may be registered, calling this function again will override whatever was previously set.
|
|
11792
|
-
* If this is not set, some patch functions may fail.
|
|
11793
|
-
* /// @param Callback EntityCreatedCallback : the callback to execute.
|
|
11794
|
-
*/
|
|
11795
|
-
setEntityCreatedCallback(callback) {
|
|
11796
|
-
var _callback = (_stateObject__, arg1) => {
|
|
11797
|
-
var _arg1 = new Multiplayer.SpaceEntity(getNativePointer(arg1));
|
|
11798
|
-
callback(_arg1);
|
|
11799
|
-
};
|
|
11800
|
-
var _callbackPtr = Module.addFunction(_callback, "vii");
|
|
11801
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_SetEntityCreatedCallback_void_EntityCreatedCallback", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
|
|
11802
|
-
}
|
|
11803
|
-
/**
|
|
11804
|
-
* @description Sets a callback to be executed when all existing entities have been retrieved after entering a space.
|
|
11805
|
-
* @param callback - The callback to execute.
|
|
11806
|
-
*/
|
|
11807
|
-
setInitialEntitiesRetrievedCallback(callback) {
|
|
11808
|
-
var _callback = (_stateObject__, arg1) => {
|
|
11809
|
-
callback(arg1);
|
|
11810
|
-
};
|
|
11811
|
-
var _callbackPtr = Module.addFunction(_callback, "vii");
|
|
11812
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_SetInitialEntitiesRetrievedCallback_void_CallbackHandler", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
|
|
11659
|
+
set scale(value) {
|
|
11660
|
+
Module.ccall("csp_multiplayer_SpaceTransform__Set_Scale", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
11813
11661
|
}
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11662
|
+
}
|
|
11663
|
+
Multiplayer.SpaceTransform = SpaceTransform;
|
|
11664
|
+
})(Multiplayer || (Multiplayer = {}));
|
|
11665
|
+
(function (Multiplayer) {
|
|
11666
|
+
/**
|
|
11667
|
+
@ingroup Conversation
|
|
11668
|
+
* @description Contains information about a conversation message.
|
|
11669
|
+
*/
|
|
11670
|
+
class MessageInfo extends NativeClassWrapper {
|
|
11671
|
+
/** @internal */
|
|
11672
|
+
constructor(pointer) {
|
|
11673
|
+
super(pointer);
|
|
11824
11674
|
}
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
*/
|
|
11831
|
-
queueEntityUpdate(entityToUpdate) {
|
|
11832
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_QueueEntityUpdate_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entityToUpdate.pointer]);
|
|
11675
|
+
static create() {
|
|
11676
|
+
var _ptr = Module._malloc(8);
|
|
11677
|
+
Module.ccall("csp_multiplayer_MessageInfo_Ctor", "void", ["number"], [_ptr]);
|
|
11678
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11679
|
+
return new MessageInfo(_nPtr);
|
|
11833
11680
|
}
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11681
|
+
static create_conversationId_isConversation_message(conversationId, isConversation, message) {
|
|
11682
|
+
var _ptr = Module._malloc(8);
|
|
11683
|
+
Module.ccall("csp_multiplayer_MessageInfo_Ctor_StringRC_bool_StringRC", "void", ["number", "string", "boolean", "string"], [_ptr, conversationId, isConversation, message]);
|
|
11684
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11685
|
+
return new MessageInfo(_nPtr);
|
|
11839
11686
|
}
|
|
11840
|
-
|
|
11841
|
-
|
|
11687
|
+
static create_conversationId_isConversation_message_messageId(conversationId, isConversation, message, messageId) {
|
|
11688
|
+
var _ptr = Module._malloc(8);
|
|
11689
|
+
Module.ccall("csp_multiplayer_MessageInfo_Ctor_StringRC_bool_StringRC_StringRC", "void", ["number", "string", "boolean", "string", "string"], [_ptr, conversationId, isConversation, message, messageId]);
|
|
11690
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11691
|
+
return new MessageInfo(_nPtr);
|
|
11842
11692
|
}
|
|
11843
|
-
|
|
11844
|
-
|
|
11693
|
+
static create_messageData(messageData) {
|
|
11694
|
+
var _ptr = Module._malloc(8);
|
|
11695
|
+
Module.ccall("csp_multiplayer_MessageInfo_Ctor_MessageInfoRC", "void", ["number", "number"], [_ptr, messageData.pointer]);
|
|
11696
|
+
var _nPtr = getNativePointer(_ptr);
|
|
11697
|
+
return new MessageInfo(_nPtr);
|
|
11845
11698
|
}
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11699
|
+
// operator=
|
|
11700
|
+
delete() {
|
|
11701
|
+
if (this.ownsPointer && !this.disposed) {
|
|
11702
|
+
Module.ccall("csp_multiplayer_MessageInfo_Dtor", "void", ["number"], [this.pointer]);
|
|
11703
|
+
this.disposed = true;
|
|
11704
|
+
}
|
|
11852
11705
|
}
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
*/
|
|
11857
|
-
markEntityForUpdate(entity) {
|
|
11858
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_MarkEntityForUpdate_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entity.pointer]);
|
|
11706
|
+
get conversationId() {
|
|
11707
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_ConversationId", "string", ["number"], [this.pointer]);
|
|
11708
|
+
return _result;
|
|
11859
11709
|
}
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
* /// Note this should only be called from main thread
|
|
11863
|
-
*/
|
|
11864
|
-
processPendingEntityOperations() {
|
|
11865
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_ProcessPendingEntityOperations_void", "void", ["number"], [this.pointer]);
|
|
11710
|
+
set conversationId(value) {
|
|
11711
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_ConversationId", "void", ["number", "string"], [this.pointer, value]);
|
|
11866
11712
|
}
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
* If this is called by a client manually without first deleting all existing tracked entities, it is possible there will be duplicates.
|
|
11871
|
-
* It is highly advised not to call this function unless you know what you are doing.
|
|
11872
|
-
*/
|
|
11873
|
-
retrieveAllEntities() {
|
|
11874
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_RetrieveAllEntities_void", "void", ["number"], [this.pointer]);
|
|
11713
|
+
get createdTimestamp() {
|
|
11714
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_CreatedTimestamp", "string", ["number"], [this.pointer]);
|
|
11715
|
+
return _result;
|
|
11875
11716
|
}
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
* /// They still reside on the server, however they will not be accessible in the client application.
|
|
11879
|
-
*/
|
|
11880
|
-
localDestroyAllEntities() {
|
|
11881
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_LocalDestroyAllEntities_void", "void", ["number"], [this.pointer]);
|
|
11717
|
+
set createdTimestamp(value) {
|
|
11718
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_CreatedTimestamp", "void", ["number", "string"], [this.pointer, value]);
|
|
11882
11719
|
}
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
* /// Criteria:
|
|
11886
|
-
* For Selection:
|
|
11887
|
-
* - Entity must be deselected currently
|
|
11888
|
-
* For Deselection:
|
|
11889
|
-
* - Entity must be selected currently
|
|
11890
|
-
* - Entity must be selected by the client attempting the deselection (SpaceEntity::GetSelectingClientID will return this information)
|
|
11891
|
-
* /// @param SelectedState bool : The state to set the entity to, Selected = True, Deselected = false.
|
|
11892
|
-
* @param entity - A pointer to the entity to modify selection state on.
|
|
11893
|
-
* @return True if a selection state change has occurred, false if no change was made (due to one of the above criteria not being met).
|
|
11894
|
-
*/
|
|
11895
|
-
setSelectionStateOfEntity(selectedState, entity) {
|
|
11896
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_SetSelectionStateOfEntity_bool_boolC_SpaceEntityP", "boolean", ["number", "boolean", "number"], [this.pointer, selectedState, entity.pointer]);
|
|
11720
|
+
get editedTimestamp() {
|
|
11721
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_EditedTimestamp", "string", ["number"], [this.pointer]);
|
|
11897
11722
|
return _result;
|
|
11898
11723
|
}
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
*/
|
|
11902
|
-
enableLeaderElection() {
|
|
11903
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_EnableLeaderElection_void", "void", ["number"], [this.pointer]);
|
|
11904
|
-
}
|
|
11905
|
-
/**
|
|
11906
|
-
* @description Disable Leader Election feature.
|
|
11907
|
-
*/
|
|
11908
|
-
disableLeaderElection() {
|
|
11909
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_DisableLeaderElection_void", "void", ["number"], [this.pointer]);
|
|
11724
|
+
set editedTimestamp(value) {
|
|
11725
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_EditedTimestamp", "void", ["number", "string"], [this.pointer, value]);
|
|
11910
11726
|
}
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
* @return True if enabled, false otherwise.
|
|
11914
|
-
*/
|
|
11915
|
-
isLeaderElectionEnabled() {
|
|
11916
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_IsLeaderElectionEnabledC_bool", "boolean", ["number"], [this.pointer]);
|
|
11727
|
+
get userId() {
|
|
11728
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_UserId", "string", ["number"], [this.pointer]);
|
|
11917
11729
|
return _result;
|
|
11918
11730
|
}
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
* @return The id of the leader.
|
|
11922
|
-
*/
|
|
11923
|
-
getLeaderId() {
|
|
11924
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_GetLeaderIdC_uint64_t", "bigint", ["number"], [this.pointer]);
|
|
11925
|
-
const _unfixedValue = _result;
|
|
11926
|
-
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2n ** 64n : _unfixedValue;
|
|
11927
|
-
_result = _fixedValue;
|
|
11928
|
-
return _result;
|
|
11731
|
+
set userId(value) {
|
|
11732
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_UserId", "void", ["number", "string"], [this.pointer, value]);
|
|
11929
11733
|
}
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
* @return True if enabled, false otherwise.
|
|
11933
|
-
*/
|
|
11934
|
-
getEntityPatchRateLimitEnabled() {
|
|
11935
|
-
let _result = Module.ccall("csp_multiplayer_SpaceEntitySystem_GetEntityPatchRateLimitEnabledC_bool", "boolean", ["number"], [this.pointer]);
|
|
11734
|
+
get message() {
|
|
11735
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_Message", "string", ["number"], [this.pointer]);
|
|
11936
11736
|
return _result;
|
|
11937
11737
|
}
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
* /// This feature is enabled by default and should only be disabled if you are encountering issues.
|
|
11941
|
-
* /// @param Enabled : sets if the feature should be enabled or not.
|
|
11942
|
-
* \rst
|
|
11943
|
-
* .. note::
|
|
11944
|
-
* If disabling this feature, more requests will be made to Magnopus Connected Services,
|
|
11945
|
-
* and consequently more patch merges may occur on the server as a result.
|
|
11946
|
-
* \endrst
|
|
11947
|
-
*/
|
|
11948
|
-
setEntityPatchRateLimitEnabled(enabled) {
|
|
11949
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_SetEntityPatchRateLimitEnabled_void_bool", "void", ["number", "boolean"], [this.pointer, enabled]);
|
|
11738
|
+
set message(value) {
|
|
11739
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_Message", "void", ["number", "string"], [this.pointer, value]);
|
|
11950
11740
|
}
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
*/
|
|
11955
|
-
getRootHierarchyEntities() {
|
|
11956
|
-
var _ret = Module._malloc(8);
|
|
11957
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_GetRootHierarchyEntitiesC_ListPC", "void", ["number", "number"], [_ret, this.pointer]);
|
|
11958
|
-
var _nPtr = new Common.List(getNativePointer(_ret), csp_multiplayer_SpaceEntityFactory, "csp_multiplayer_SpaceEntity");
|
|
11959
|
-
Module._free(_ret);
|
|
11960
|
-
return _nPtr;
|
|
11741
|
+
get messageId() {
|
|
11742
|
+
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_MessageId", "string", ["number"], [this.pointer]);
|
|
11743
|
+
return _result;
|
|
11961
11744
|
}
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
Module.ccall("csp_multiplayer_SpaceEntitySystem_Dtor", "void", ["number"], [this.pointer]);
|
|
11965
|
-
this.disposed = true;
|
|
11966
|
-
}
|
|
11745
|
+
set messageId(value) {
|
|
11746
|
+
Module.ccall("csp_multiplayer_MessageInfo__Set_MessageId", "void", ["number", "string"], [this.pointer, value]);
|
|
11967
11747
|
}
|
|
11968
11748
|
}
|
|
11969
|
-
Multiplayer.
|
|
11749
|
+
Multiplayer.MessageInfo = MessageInfo;
|
|
11970
11750
|
})(Multiplayer || (Multiplayer = {}));
|
|
11971
11751
|
(function (Multiplayer) {
|
|
11972
11752
|
/**
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11753
|
+
@ingroup Conversation
|
|
11754
|
+
* @description Information used to update a message
|
|
11755
|
+
*/
|
|
11756
|
+
class MessageUpdateParams extends NativeClassWrapper {
|
|
11976
11757
|
/** @internal */
|
|
11977
11758
|
constructor(pointer) {
|
|
11978
11759
|
super(pointer);
|
|
11979
11760
|
}
|
|
11980
|
-
/**
|
|
11981
|
-
* @description Default constuctor for the SpaceTransform
|
|
11982
|
-
*/
|
|
11983
11761
|
static create() {
|
|
11984
11762
|
var _ptr = Module._malloc(8);
|
|
11985
|
-
Module.ccall("
|
|
11763
|
+
Module.ccall("csp_multiplayer_MessageUpdateParams_Ctor", "void", ["number"], [_ptr]);
|
|
11986
11764
|
var _nPtr = getNativePointer(_ptr);
|
|
11987
|
-
return new
|
|
11988
|
-
}
|
|
11989
|
-
/**
|
|
11990
|
-
* @description Custom constructor for the SpaceTransform.
|
|
11991
|
-
* @param position - The position value for the transform.
|
|
11992
|
-
* @param rotation - The rotation value for the transform, will be normalized during multiplication operations.
|
|
11993
|
-
* @param scale - The scale value for the transform.
|
|
11994
|
-
*/
|
|
11995
|
-
static create_position_rotation_scale(position, rotation, scale) {
|
|
11996
|
-
var _ptr = Module._malloc(8);
|
|
11997
|
-
Module.ccall("csp_multiplayer_SpaceTransform_Ctor_Vector3RC_Vector4RC_Vector3RC", "void", ["number", "number", "number", "number"], [_ptr, position.pointer, rotation.pointer, scale.pointer]);
|
|
11998
|
-
var _nPtr = getNativePointer(_ptr);
|
|
11999
|
-
return new SpaceTransform(_nPtr);
|
|
12000
|
-
}
|
|
12001
|
-
/**
|
|
12002
|
-
* @description Equality operator
|
|
12003
|
-
* @param spaceTransform - Transform
|
|
12004
|
-
*/
|
|
12005
|
-
// operator==
|
|
12006
|
-
/**
|
|
12007
|
-
* @description Inequality operator
|
|
12008
|
-
* @param spaceTransform - Transform
|
|
12009
|
-
*/
|
|
12010
|
-
// operator!=
|
|
12011
|
-
/**
|
|
12012
|
-
* @description Multiplication operator
|
|
12013
|
-
* @param spaceTransform - Transform
|
|
12014
|
-
* NOTE: This performs TRS matrix composition, then decomposes back to Pos, Rot, Scale.
|
|
12015
|
-
*/
|
|
12016
|
-
// operator*
|
|
12017
|
-
delete() {
|
|
12018
|
-
if (this.ownsPointer && !this.disposed) {
|
|
12019
|
-
Module.ccall("csp_multiplayer_SpaceTransform_Dtor", "void", ["number"], [this.pointer]);
|
|
12020
|
-
this.disposed = true;
|
|
12021
|
-
}
|
|
12022
|
-
}
|
|
12023
|
-
get position() {
|
|
12024
|
-
const _ptr = Module._malloc(8);
|
|
12025
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Get_Position", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
12026
|
-
const _nPtr = getNativePointer(_ptr);
|
|
12027
|
-
return new Common.Vector3(_nPtr);
|
|
12028
|
-
}
|
|
12029
|
-
set position(value) {
|
|
12030
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Set_Position", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
12031
|
-
}
|
|
12032
|
-
get rotation() {
|
|
12033
|
-
const _ptr = Module._malloc(8);
|
|
12034
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Get_Rotation", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
12035
|
-
const _nPtr = getNativePointer(_ptr);
|
|
12036
|
-
return new Common.Vector4(_nPtr);
|
|
12037
|
-
}
|
|
12038
|
-
set rotation(value) {
|
|
12039
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Set_Rotation", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
12040
|
-
}
|
|
12041
|
-
get scale() {
|
|
12042
|
-
const _ptr = Module._malloc(8);
|
|
12043
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Get_Scale", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
12044
|
-
const _nPtr = getNativePointer(_ptr);
|
|
12045
|
-
return new Common.Vector3(_nPtr);
|
|
12046
|
-
}
|
|
12047
|
-
set scale(value) {
|
|
12048
|
-
Module.ccall("csp_multiplayer_SpaceTransform__Set_Scale", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
12049
|
-
}
|
|
12050
|
-
}
|
|
12051
|
-
Multiplayer.SpaceTransform = SpaceTransform;
|
|
12052
|
-
})(Multiplayer || (Multiplayer = {}));
|
|
12053
|
-
(function (Multiplayer) {
|
|
12054
|
-
/**
|
|
12055
|
-
@ingroup Conversation
|
|
12056
|
-
* @description Contains information about a conversation message.
|
|
12057
|
-
*/
|
|
12058
|
-
class MessageInfo extends NativeClassWrapper {
|
|
12059
|
-
/** @internal */
|
|
12060
|
-
constructor(pointer) {
|
|
12061
|
-
super(pointer);
|
|
12062
|
-
}
|
|
12063
|
-
static create() {
|
|
12064
|
-
var _ptr = Module._malloc(8);
|
|
12065
|
-
Module.ccall("csp_multiplayer_MessageInfo_Ctor", "void", ["number"], [_ptr]);
|
|
12066
|
-
var _nPtr = getNativePointer(_ptr);
|
|
12067
|
-
return new MessageInfo(_nPtr);
|
|
12068
|
-
}
|
|
12069
|
-
static create_conversationId_isConversation_message(conversationId, isConversation, message) {
|
|
12070
|
-
var _ptr = Module._malloc(8);
|
|
12071
|
-
Module.ccall("csp_multiplayer_MessageInfo_Ctor_StringRC_bool_StringRC", "void", ["number", "string", "boolean", "string"], [_ptr, conversationId, isConversation, message]);
|
|
12072
|
-
var _nPtr = getNativePointer(_ptr);
|
|
12073
|
-
return new MessageInfo(_nPtr);
|
|
12074
|
-
}
|
|
12075
|
-
static create_conversationId_isConversation_message_messageId(conversationId, isConversation, message, messageId) {
|
|
12076
|
-
var _ptr = Module._malloc(8);
|
|
12077
|
-
Module.ccall("csp_multiplayer_MessageInfo_Ctor_StringRC_bool_StringRC_StringRC", "void", ["number", "string", "boolean", "string", "string"], [_ptr, conversationId, isConversation, message, messageId]);
|
|
12078
|
-
var _nPtr = getNativePointer(_ptr);
|
|
12079
|
-
return new MessageInfo(_nPtr);
|
|
12080
|
-
}
|
|
12081
|
-
static create_messageData(messageData) {
|
|
12082
|
-
var _ptr = Module._malloc(8);
|
|
12083
|
-
Module.ccall("csp_multiplayer_MessageInfo_Ctor_MessageInfoRC", "void", ["number", "number"], [_ptr, messageData.pointer]);
|
|
12084
|
-
var _nPtr = getNativePointer(_ptr);
|
|
12085
|
-
return new MessageInfo(_nPtr);
|
|
12086
|
-
}
|
|
12087
|
-
delete() {
|
|
12088
|
-
if (this.ownsPointer && !this.disposed) {
|
|
12089
|
-
Module.ccall("csp_multiplayer_MessageInfo_Dtor", "void", ["number"], [this.pointer]);
|
|
12090
|
-
this.disposed = true;
|
|
12091
|
-
}
|
|
12092
|
-
}
|
|
12093
|
-
get conversationId() {
|
|
12094
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_ConversationId", "string", ["number"], [this.pointer]);
|
|
12095
|
-
return _result;
|
|
12096
|
-
}
|
|
12097
|
-
set conversationId(value) {
|
|
12098
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_ConversationId", "void", ["number", "string"], [this.pointer, value]);
|
|
12099
|
-
}
|
|
12100
|
-
get createdTimestamp() {
|
|
12101
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_CreatedTimestamp", "string", ["number"], [this.pointer]);
|
|
12102
|
-
return _result;
|
|
12103
|
-
}
|
|
12104
|
-
set createdTimestamp(value) {
|
|
12105
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_CreatedTimestamp", "void", ["number", "string"], [this.pointer, value]);
|
|
12106
|
-
}
|
|
12107
|
-
get editedTimestamp() {
|
|
12108
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_EditedTimestamp", "string", ["number"], [this.pointer]);
|
|
12109
|
-
return _result;
|
|
12110
|
-
}
|
|
12111
|
-
set editedTimestamp(value) {
|
|
12112
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_EditedTimestamp", "void", ["number", "string"], [this.pointer, value]);
|
|
12113
|
-
}
|
|
12114
|
-
get userId() {
|
|
12115
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_UserId", "string", ["number"], [this.pointer]);
|
|
12116
|
-
return _result;
|
|
12117
|
-
}
|
|
12118
|
-
set userId(value) {
|
|
12119
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_UserId", "void", ["number", "string"], [this.pointer, value]);
|
|
12120
|
-
}
|
|
12121
|
-
get message() {
|
|
12122
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_Message", "string", ["number"], [this.pointer]);
|
|
12123
|
-
return _result;
|
|
12124
|
-
}
|
|
12125
|
-
set message(value) {
|
|
12126
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_Message", "void", ["number", "string"], [this.pointer, value]);
|
|
12127
|
-
}
|
|
12128
|
-
get messageId() {
|
|
12129
|
-
let _result = Module.ccall("csp_multiplayer_MessageInfo__Get_MessageId", "string", ["number"], [this.pointer]);
|
|
12130
|
-
return _result;
|
|
12131
|
-
}
|
|
12132
|
-
set messageId(value) {
|
|
12133
|
-
Module.ccall("csp_multiplayer_MessageInfo__Set_MessageId", "void", ["number", "string"], [this.pointer, value]);
|
|
12134
|
-
}
|
|
12135
|
-
}
|
|
12136
|
-
Multiplayer.MessageInfo = MessageInfo;
|
|
12137
|
-
})(Multiplayer || (Multiplayer = {}));
|
|
12138
|
-
(function (Multiplayer) {
|
|
12139
|
-
/**
|
|
12140
|
-
@ingroup Conversation
|
|
12141
|
-
* @description Information used to update a message
|
|
12142
|
-
*/
|
|
12143
|
-
class MessageUpdateParams extends NativeClassWrapper {
|
|
12144
|
-
/** @internal */
|
|
12145
|
-
constructor(pointer) {
|
|
12146
|
-
super(pointer);
|
|
12147
|
-
}
|
|
12148
|
-
static create() {
|
|
12149
|
-
var _ptr = Module._malloc(8);
|
|
12150
|
-
Module.ccall("csp_multiplayer_MessageUpdateParams_Ctor", "void", ["number"], [_ptr]);
|
|
12151
|
-
var _nPtr = getNativePointer(_ptr);
|
|
12152
|
-
return new MessageUpdateParams(_nPtr);
|
|
11765
|
+
return new MessageUpdateParams(_nPtr);
|
|
12153
11766
|
}
|
|
12154
11767
|
delete() {
|
|
12155
11768
|
if (this.ownsPointer && !this.disposed) {
|
|
@@ -12252,6 +11865,7 @@ export class CSPFoundation {
|
|
|
12252
11865
|
var _nPtr = getNativePointer(_ptr);
|
|
12253
11866
|
return new AnnotationData(_nPtr);
|
|
12254
11867
|
}
|
|
11868
|
+
// operator=
|
|
12255
11869
|
delete() {
|
|
12256
11870
|
if (this.ownsPointer && !this.disposed) {
|
|
12257
11871
|
Module.ccall("csp_multiplayer_AnnotationData_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -12792,6 +12406,17 @@ export class CSPFoundation {
|
|
|
12792
12406
|
Module._free(_ret);
|
|
12793
12407
|
return _nPtr;
|
|
12794
12408
|
}
|
|
12409
|
+
/**
|
|
12410
|
+
* @description Retrieves the Application Settings system.
|
|
12411
|
+
* @return Pointer to the application settings system class
|
|
12412
|
+
*/
|
|
12413
|
+
getApplicationSettingsSystem() {
|
|
12414
|
+
var _ret = Module._malloc(8);
|
|
12415
|
+
Module.ccall("csp_systems_SystemsManager_GetApplicationSettingsSystem_ApplicationSettingsSystemP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
12416
|
+
var _nPtr = new Systems.ApplicationSettingsSystem(getNativePointer(_ret));
|
|
12417
|
+
Module._free(_ret);
|
|
12418
|
+
return _nPtr;
|
|
12419
|
+
}
|
|
12795
12420
|
/**
|
|
12796
12421
|
* @description Retrieves the Settings system.
|
|
12797
12422
|
* @return Pointer to the settings system class
|
|
@@ -12891,13 +12516,6 @@ export class CSPFoundation {
|
|
|
12891
12516
|
Module._free(_ret);
|
|
12892
12517
|
return _nPtr;
|
|
12893
12518
|
}
|
|
12894
|
-
getSpaceEntitySystem() {
|
|
12895
|
-
var _ret = Module._malloc(8);
|
|
12896
|
-
Module.ccall("csp_systems_SystemsManager_GetSpaceEntitySystem_SpaceEntitySystemP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
12897
|
-
var _nPtr = new Multiplayer.SpaceEntitySystem(getNativePointer(_ret));
|
|
12898
|
-
Module._free(_ret);
|
|
12899
|
-
return _nPtr;
|
|
12900
|
-
}
|
|
12901
12519
|
getMultiplayerConnection() {
|
|
12902
12520
|
var _ret = Module._malloc(8);
|
|
12903
12521
|
Module.ccall("csp_systems_SystemsManager_GetMultiplayerConnection_MultiplayerConnectionP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
@@ -12912,6 +12530,13 @@ export class CSPFoundation {
|
|
|
12912
12530
|
Module._free(_ret);
|
|
12913
12531
|
return _nPtr;
|
|
12914
12532
|
}
|
|
12533
|
+
makeOnlineRealtimeEngine() {
|
|
12534
|
+
var _ret = Module._malloc(8);
|
|
12535
|
+
Module.ccall("csp_systems_SystemsManager_MakeOnlineRealtimeEngine_OnlineRealtimeEngineP", "void", ["number", "number"], [_ret, this.pointer]);
|
|
12536
|
+
var _nPtr = new Multiplayer.OnlineRealtimeEngine(getNativePointer(_ret));
|
|
12537
|
+
Module._free(_ret);
|
|
12538
|
+
return _nPtr;
|
|
12539
|
+
}
|
|
12915
12540
|
}
|
|
12916
12541
|
Systems.SystemsManager = SystemsManager;
|
|
12917
12542
|
})(Systems || (Systems = {}));
|
|
@@ -13136,6 +12761,7 @@ export class CSPFoundation {
|
|
|
13136
12761
|
var _nPtr = getNativePointer(_ptr);
|
|
13137
12762
|
return new Asset(_nPtr);
|
|
13138
12763
|
}
|
|
12764
|
+
// operator=
|
|
13139
12765
|
delete() {
|
|
13140
12766
|
if (this.ownsPointer && !this.disposed) {
|
|
13141
12767
|
Module.ccall("csp_systems_Asset_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -14906,6 +14532,61 @@ export class CSPFoundation {
|
|
|
14906
14532
|
}
|
|
14907
14533
|
Systems.Sequence = Sequence;
|
|
14908
14534
|
})(Systems || (Systems = {}));
|
|
14535
|
+
(function (Systems) {
|
|
14536
|
+
/**
|
|
14537
|
+
@ingroup Application Settings System
|
|
14538
|
+
* @description Represents configuration settings for an application context.
|
|
14539
|
+
*/
|
|
14540
|
+
class ApplicationSettings extends NativeClassWrapper {
|
|
14541
|
+
/** @internal */
|
|
14542
|
+
constructor(pointer) {
|
|
14543
|
+
super(pointer);
|
|
14544
|
+
}
|
|
14545
|
+
static create() {
|
|
14546
|
+
var _ptr = Module._malloc(8);
|
|
14547
|
+
Module.ccall("csp_systems_ApplicationSettings_Ctor", "void", ["number"], [_ptr]);
|
|
14548
|
+
var _nPtr = getNativePointer(_ptr);
|
|
14549
|
+
return new ApplicationSettings(_nPtr);
|
|
14550
|
+
}
|
|
14551
|
+
delete() {
|
|
14552
|
+
if (this.ownsPointer && !this.disposed) {
|
|
14553
|
+
Module.ccall("csp_systems_ApplicationSettings_Dtor", "void", ["number"], [this.pointer]);
|
|
14554
|
+
this.disposed = true;
|
|
14555
|
+
}
|
|
14556
|
+
}
|
|
14557
|
+
get applicationName() {
|
|
14558
|
+
let _result = Module.ccall("csp_systems_ApplicationSettings__Get_ApplicationName", "string", ["number"], [this.pointer]);
|
|
14559
|
+
return _result;
|
|
14560
|
+
}
|
|
14561
|
+
set applicationName(value) {
|
|
14562
|
+
Module.ccall("csp_systems_ApplicationSettings__Set_ApplicationName", "void", ["number", "string"], [this.pointer, value]);
|
|
14563
|
+
}
|
|
14564
|
+
get context() {
|
|
14565
|
+
let _result = Module.ccall("csp_systems_ApplicationSettings__Get_Context", "string", ["number"], [this.pointer]);
|
|
14566
|
+
return _result;
|
|
14567
|
+
}
|
|
14568
|
+
set context(value) {
|
|
14569
|
+
Module.ccall("csp_systems_ApplicationSettings__Set_Context", "void", ["number", "string"], [this.pointer, value]);
|
|
14570
|
+
}
|
|
14571
|
+
get allowAnonymous() {
|
|
14572
|
+
let _result = Module.ccall("csp_systems_ApplicationSettings__Get_AllowAnonymous", "boolean", ["number"], [this.pointer]);
|
|
14573
|
+
return _result;
|
|
14574
|
+
}
|
|
14575
|
+
set allowAnonymous(value) {
|
|
14576
|
+
Module.ccall("csp_systems_ApplicationSettings__Set_AllowAnonymous", "void", ["number", "boolean"], [this.pointer, value]);
|
|
14577
|
+
}
|
|
14578
|
+
get settings() {
|
|
14579
|
+
const _ptr = Module._malloc(8);
|
|
14580
|
+
Module.ccall("csp_systems_ApplicationSettings__Get_Settings", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
14581
|
+
const _nPtr = getNativePointer(_ptr);
|
|
14582
|
+
return new Common.Map(_nPtr, StringFactory, "String", StringFactory, "String");
|
|
14583
|
+
}
|
|
14584
|
+
set settings(value) {
|
|
14585
|
+
Module.ccall("csp_systems_ApplicationSettings__Set_Settings", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
14586
|
+
}
|
|
14587
|
+
}
|
|
14588
|
+
Systems.ApplicationSettings = ApplicationSettings;
|
|
14589
|
+
})(Systems || (Systems = {}));
|
|
14909
14590
|
(function (Systems) {
|
|
14910
14591
|
/**
|
|
14911
14592
|
@ingroup Settings System
|
|
@@ -15159,6 +14840,7 @@ export class CSPFoundation {
|
|
|
15159
14840
|
var _nPtr = getNativePointer(_ptr);
|
|
15160
14841
|
return new UserRoleInfo(_nPtr);
|
|
15161
14842
|
}
|
|
14843
|
+
// operator=
|
|
15162
14844
|
delete() {
|
|
15163
14845
|
if (this.ownsPointer && !this.disposed) {
|
|
15164
14846
|
Module.ccall("csp_systems_UserRoleInfo_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -15204,6 +14886,7 @@ export class CSPFoundation {
|
|
|
15204
14886
|
var _nPtr = getNativePointer(_ptr);
|
|
15205
14887
|
return new InviteUserRoleInfo(_nPtr);
|
|
15206
14888
|
}
|
|
14889
|
+
// operator=
|
|
15207
14890
|
delete() {
|
|
15208
14891
|
if (this.ownsPointer && !this.disposed) {
|
|
15209
14892
|
Module.ccall("csp_systems_InviteUserRoleInfo_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -15249,6 +14932,7 @@ export class CSPFoundation {
|
|
|
15249
14932
|
var _nPtr = getNativePointer(_ptr);
|
|
15250
14933
|
return new InviteUserRoleInfoCollection(_nPtr);
|
|
15251
14934
|
}
|
|
14935
|
+
// operator=
|
|
15252
14936
|
delete() {
|
|
15253
14937
|
if (this.ownsPointer && !this.disposed) {
|
|
15254
14938
|
Module.ccall("csp_systems_InviteUserRoleInfoCollection_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -16220,87 +15904,519 @@ export class CSPFoundation {
|
|
|
16220
15904
|
set spaceId(value) {
|
|
16221
15905
|
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Set_SpaceId", "void", ["number", "string"], [this.pointer, value]);
|
|
16222
15906
|
}
|
|
16223
|
-
get userRoles() {
|
|
16224
|
-
const _ptr = Module._malloc(8);
|
|
16225
|
-
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Get_UserRoles", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
16226
|
-
const _nPtr = getNativePointer(_ptr);
|
|
16227
|
-
return new Common.Array(_nPtr, csp_systems_SpaceUserRoleFactory, "csp_systems_SpaceUserRole");
|
|
15907
|
+
get userRoles() {
|
|
15908
|
+
const _ptr = Module._malloc(8);
|
|
15909
|
+
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Get_UserRoles", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
15910
|
+
const _nPtr = getNativePointer(_ptr);
|
|
15911
|
+
return new Common.Array(_nPtr, csp_systems_SpaceUserRoleFactory, "csp_systems_SpaceUserRole");
|
|
15912
|
+
}
|
|
15913
|
+
set userRoles(value) {
|
|
15914
|
+
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Set_UserRoles", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
15915
|
+
}
|
|
15916
|
+
get changeType() {
|
|
15917
|
+
let _result = Module.ccall("csp_common_AccessControlChangedNetworkEventData__Get_ChangeType", "number", ["number"], [this.pointer]);
|
|
15918
|
+
return _result;
|
|
15919
|
+
}
|
|
15920
|
+
set changeType(value) {
|
|
15921
|
+
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Set_ChangeType", "void", ["number", "number"], [this.pointer, value]);
|
|
15922
|
+
}
|
|
15923
|
+
get userId() {
|
|
15924
|
+
let _result = Module.ccall("csp_common_AccessControlChangedNetworkEventData__Get_UserId", "string", ["number"], [this.pointer]);
|
|
15925
|
+
return _result;
|
|
15926
|
+
}
|
|
15927
|
+
set userId(value) {
|
|
15928
|
+
Module.ccall("csp_common_AccessControlChangedNetworkEventData__Set_UserId", "void", ["number", "string"], [this.pointer, value]);
|
|
15929
|
+
}
|
|
15930
|
+
}
|
|
15931
|
+
Common.AccessControlChangedNetworkEventData = AccessControlChangedNetworkEventData;
|
|
15932
|
+
})(Common || (Common = {}));
|
|
15933
|
+
(function (Common) {
|
|
15934
|
+
class SequenceChangedNetworkEventData extends Common.NetworkEventData {
|
|
15935
|
+
/** @internal */
|
|
15936
|
+
constructor(pointer) {
|
|
15937
|
+
super(pointer);
|
|
15938
|
+
}
|
|
15939
|
+
static fromNetworkEventData(baseInstance) {
|
|
15940
|
+
const nativeClassWrapper = baseInstance;
|
|
15941
|
+
return new Common.SequenceChangedNetworkEventData(new NativePointer(nativeClassWrapper.pointer, nativeClassWrapper.ownsPointer));
|
|
15942
|
+
}
|
|
15943
|
+
static create() {
|
|
15944
|
+
var _ptr = Module._malloc(8);
|
|
15945
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData_Ctor", "void", ["number"], [_ptr]);
|
|
15946
|
+
var _nPtr = getNativePointer(_ptr);
|
|
15947
|
+
return new SequenceChangedNetworkEventData(_nPtr);
|
|
15948
|
+
}
|
|
15949
|
+
delete() {
|
|
15950
|
+
if (this.ownsPointer && !this.disposed) {
|
|
15951
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData_Dtor", "void", ["number"], [this.pointer]);
|
|
15952
|
+
this.disposed = true;
|
|
15953
|
+
}
|
|
15954
|
+
}
|
|
15955
|
+
get updateType() {
|
|
15956
|
+
let _result = Module.ccall("csp_common_SequenceChangedNetworkEventData__Get_UpdateType", "number", ["number"], [this.pointer]);
|
|
15957
|
+
return _result;
|
|
15958
|
+
}
|
|
15959
|
+
set updateType(value) {
|
|
15960
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData__Set_UpdateType", "void", ["number", "number"], [this.pointer, value]);
|
|
15961
|
+
}
|
|
15962
|
+
get key() {
|
|
15963
|
+
let _result = Module.ccall("csp_common_SequenceChangedNetworkEventData__Get_Key", "string", ["number"], [this.pointer]);
|
|
15964
|
+
return _result;
|
|
15965
|
+
}
|
|
15966
|
+
set key(value) {
|
|
15967
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData__Set_Key", "void", ["number", "string"], [this.pointer, value]);
|
|
15968
|
+
}
|
|
15969
|
+
get newKey() {
|
|
15970
|
+
let _result = Module.ccall("csp_common_SequenceChangedNetworkEventData__Get_NewKey", "string", ["number"], [this.pointer]);
|
|
15971
|
+
return _result;
|
|
15972
|
+
}
|
|
15973
|
+
set newKey(value) {
|
|
15974
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData__Set_NewKey", "void", ["number", "string"], [this.pointer, value]);
|
|
15975
|
+
}
|
|
15976
|
+
get hotspotData() {
|
|
15977
|
+
const _ptr = Module._malloc(8);
|
|
15978
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData__Get_HotspotData", "void", ["number", "number"], [_ptr, this.pointer]);
|
|
15979
|
+
const _nPtr = getNativePointer(_ptr);
|
|
15980
|
+
return new Common.HotspotSequenceChangedNetworkEventData(_nPtr);
|
|
15981
|
+
}
|
|
15982
|
+
set hotspotData(value) {
|
|
15983
|
+
Module.ccall("csp_common_SequenceChangedNetworkEventData__Set_HotspotData", "void", ["number", "number"], [this.pointer, value.pointer]);
|
|
15984
|
+
}
|
|
15985
|
+
}
|
|
15986
|
+
Common.SequenceChangedNetworkEventData = SequenceChangedNetworkEventData;
|
|
15987
|
+
})(Common || (Common = {}));
|
|
15988
|
+
(function (Multiplayer) {
|
|
15989
|
+
/**
|
|
15990
|
+
* @description Class for creating and managing multiplayer objects known as space entities.
|
|
15991
|
+
* /// This provides functions to create and manage multiple player avatars and other objects.
|
|
15992
|
+
* It manages things like queueing updated entities and triggering tick events. Callbacks
|
|
15993
|
+
* can be registered for certain events that occur within the entity system so clients can
|
|
15994
|
+
* react appropriately.
|
|
15995
|
+
*/
|
|
15996
|
+
class OnlineRealtimeEngine extends Common.IRealtimeEngine {
|
|
15997
|
+
/** @internal */
|
|
15998
|
+
constructor(pointer) {
|
|
15999
|
+
super(pointer);
|
|
16000
|
+
}
|
|
16001
|
+
static fromIRealtimeEngine(baseInstance) {
|
|
16002
|
+
const nativeClassWrapper = baseInstance;
|
|
16003
|
+
return new Multiplayer.OnlineRealtimeEngine(new NativePointer(nativeClassWrapper.pointer, nativeClassWrapper.ownsPointer));
|
|
16004
|
+
}
|
|
16005
|
+
/**
|
|
16006
|
+
* @description OnlineRealtimeEngine constructor
|
|
16007
|
+
* @param inMultiplayerConnection - The multiplayer connection to construct the onlinerealtimeengine with
|
|
16008
|
+
* @param logSystem - Logger such that this system can print status and debug output
|
|
16009
|
+
* @param networkEventBus - Reference the the network event bus, used for leadership election messaging.
|
|
16010
|
+
* @param remoteScriptRunner - Object capable of running a script. Called to execute scripts when the leader
|
|
16011
|
+
* election system
|
|
16012
|
+
*/
|
|
16013
|
+
static create_multiplayerConnection_logSystem_networkEventBus_remoteScriptRunner(multiplayerConnection, logSystem, networkEventBus, remoteScriptRunner) {
|
|
16014
|
+
var _ptr = Module._malloc(8);
|
|
16015
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_Ctor_MultiplayerConnectionR_LogSystemR_NetworkEventBusR_IJSScriptRunnerR", "void", ["number", "number", "number", "number", "number"], [
|
|
16016
|
+
_ptr,
|
|
16017
|
+
multiplayerConnection.pointer,
|
|
16018
|
+
logSystem.pointer,
|
|
16019
|
+
networkEventBus.pointer,
|
|
16020
|
+
remoteScriptRunner.pointer,
|
|
16021
|
+
]);
|
|
16022
|
+
var _nPtr = getNativePointer(_ptr);
|
|
16023
|
+
return new OnlineRealtimeEngine(_nPtr);
|
|
16024
|
+
}
|
|
16025
|
+
/**
|
|
16026
|
+
* @description Returns the concrete type of the instantiation of the abstract IRealtimeEngine.
|
|
16027
|
+
*/
|
|
16028
|
+
getRealtimeEngineType() {
|
|
16029
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetRealtimeEngineTypeC_RealtimeEngineType", "number", ["number"], [this.pointer]);
|
|
16030
|
+
return _result;
|
|
16031
|
+
}
|
|
16032
|
+
/**
|
|
16033
|
+
* @description Create and add a SpaceEntity with type Avatar, and relevant components and default states as specified.
|
|
16034
|
+
* @param name - The entity name of the newly created avatar entity.
|
|
16035
|
+
* @param userId - The Id of the user creating the avatar. This can be fetched from csp::systems::UserSystem::GetLoginState
|
|
16036
|
+
* @param spaceTransform - The initial transform to set the SpaceEntity to.
|
|
16037
|
+
* @param state - The initial Avatar State to set.
|
|
16038
|
+
* @param avatarId - The ID to be set on the AvatarSpaceComponent
|
|
16039
|
+
* @param avatarPlayMode - The Initial AvatarPlayMode to set.
|
|
16040
|
+
* @param callback - Csp::multiplayer::entitycreatedcallback a callback that executes when the creation is complete,
|
|
16041
|
+
* which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
|
|
16042
|
+
*/
|
|
16043
|
+
async createAvatar(name, userId, spaceTransform, isVisible, state, avatarId, avatarPlayMode) {
|
|
16044
|
+
var _resolve;
|
|
16045
|
+
var _promise = new Promise((_r) => {
|
|
16046
|
+
_resolve = _r;
|
|
16047
|
+
});
|
|
16048
|
+
var _callbackPtr;
|
|
16049
|
+
var _callback = (_stateObject__, arg1) => {
|
|
16050
|
+
var _arg1Ptr = getNativePointer(arg1);
|
|
16051
|
+
var _arg1Instance = new Multiplayer.SpaceEntity(_arg1Ptr);
|
|
16052
|
+
_resolve(_arg1Instance);
|
|
16053
|
+
Module.removeFunction(_callbackPtr);
|
|
16054
|
+
};
|
|
16055
|
+
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
16056
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_CreateAvatar_void_StringRC_StringRC_SpaceTransformRC_bool_AvatarStateRC_StringRC_AvatarPlayModeRC_EntityCreatedCallback", "void", [
|
|
16057
|
+
"number",
|
|
16058
|
+
"string",
|
|
16059
|
+
"string",
|
|
16060
|
+
"number",
|
|
16061
|
+
"boolean",
|
|
16062
|
+
"number",
|
|
16063
|
+
"string",
|
|
16064
|
+
"number",
|
|
16065
|
+
"number",
|
|
16066
|
+
"number",
|
|
16067
|
+
], [
|
|
16068
|
+
this.pointer,
|
|
16069
|
+
name,
|
|
16070
|
+
userId,
|
|
16071
|
+
spaceTransform.pointer,
|
|
16072
|
+
isVisible,
|
|
16073
|
+
state,
|
|
16074
|
+
avatarId,
|
|
16075
|
+
avatarPlayMode,
|
|
16076
|
+
_callbackPtr,
|
|
16077
|
+
0,
|
|
16078
|
+
]);
|
|
16079
|
+
return _promise;
|
|
16080
|
+
}
|
|
16081
|
+
/**
|
|
16082
|
+
* @description Create and add a SpaceEntity, with relevant default values.
|
|
16083
|
+
* @param name - The name of the newly created SpaceEntity.
|
|
16084
|
+
* @param spaceTransform - The initial transform to set the SpaceEntity to.
|
|
16085
|
+
* @param parentID - ID of another entity in the space that this entity should be created as a child to. If empty,
|
|
16086
|
+
* entity is created as a root entity.
|
|
16087
|
+
* @param callback - A callback that executes when the creation is complete,
|
|
16088
|
+
* which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
|
|
16089
|
+
*/
|
|
16090
|
+
async createEntity(name, spaceTransform, parentID) {
|
|
16091
|
+
var _resolve;
|
|
16092
|
+
var _promise = new Promise((_r) => {
|
|
16093
|
+
_resolve = _r;
|
|
16094
|
+
});
|
|
16095
|
+
var _callbackPtr;
|
|
16096
|
+
var _callback = (_stateObject__, arg1) => {
|
|
16097
|
+
var _arg1Ptr = getNativePointer(arg1);
|
|
16098
|
+
var _arg1Instance = new Multiplayer.SpaceEntity(_arg1Ptr);
|
|
16099
|
+
_resolve(_arg1Instance);
|
|
16100
|
+
Module.removeFunction(_callbackPtr);
|
|
16101
|
+
};
|
|
16102
|
+
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
16103
|
+
var parentIDPointer = 0;
|
|
16104
|
+
if (parentID != null) {
|
|
16105
|
+
parentIDPointer = Module._malloc(4);
|
|
16106
|
+
Module.setValue(parentIDPointer, parentID, "i32");
|
|
16107
|
+
}
|
|
16108
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_CreateEntity_void_StringRC_SpaceTransformRC_uint64_tRC_EntityCreatedCallback", "void", ["number", "string", "number", "bigint", "number", "number"], [
|
|
16109
|
+
this.pointer,
|
|
16110
|
+
name,
|
|
16111
|
+
spaceTransform.pointer,
|
|
16112
|
+
parentIDPointer,
|
|
16113
|
+
_callbackPtr,
|
|
16114
|
+
0,
|
|
16115
|
+
]);
|
|
16116
|
+
if (parentIDPointer) {
|
|
16117
|
+
Module._free(parentIDPointer);
|
|
16118
|
+
}
|
|
16119
|
+
return _promise;
|
|
16120
|
+
}
|
|
16121
|
+
/**
|
|
16122
|
+
* @description Add a new entity to the system.
|
|
16123
|
+
* /// This can be called at any time from any thread and internally add the entity to a pending
|
|
16124
|
+
* list which is then updated in a thread safe manner when ProcessPendingEntityOperations
|
|
16125
|
+
* is called from the main thread.
|
|
16126
|
+
* /// @param EntityToAdd SpaceEntity : Pointer to the entity to be added.
|
|
16127
|
+
*/
|
|
16128
|
+
addEntity(entityToAdd) {
|
|
16129
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_AddEntity_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entityToAdd.pointer]);
|
|
16130
|
+
}
|
|
16131
|
+
/**
|
|
16132
|
+
* @description Destroy the specified entity.
|
|
16133
|
+
* @param entity - A non-owning pointer to the entity to be destroyed.
|
|
16134
|
+
* @param callback - A callback that executes when the entity destruction is complete.
|
|
16135
|
+
*/
|
|
16136
|
+
async destroyEntity(entity) {
|
|
16137
|
+
var _resolve;
|
|
16138
|
+
var _promise = new Promise((_r) => {
|
|
16139
|
+
_resolve = _r;
|
|
16140
|
+
});
|
|
16141
|
+
var _callbackPtr;
|
|
16142
|
+
var _callback = (_stateObject__, arg1) => {
|
|
16143
|
+
_resolve(!!arg1);
|
|
16144
|
+
Module.removeFunction(_callbackPtr);
|
|
16145
|
+
};
|
|
16146
|
+
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
16147
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_DestroyEntity_void_SpaceEntityP_CallbackHandler", "void", ["number", "number", "number", "number"], [this.pointer, entity.pointer, _callbackPtr, 0]);
|
|
16148
|
+
return _promise;
|
|
16149
|
+
}
|
|
16150
|
+
/**
|
|
16151
|
+
* @description Sets a callback to be executed when an entity is fully created.
|
|
16152
|
+
* /// Only one EntityCreatedCallback may be registered, calling this function again will override whatever was previously set.
|
|
16153
|
+
* /// @param Callback csp::multiplayer::EntityCreatedCallback : the callback to execute.
|
|
16154
|
+
*/
|
|
16155
|
+
setEntityCreatedCallback(callback) {
|
|
16156
|
+
var _callback = (_stateObject__, arg1) => {
|
|
16157
|
+
var _arg1 = new Multiplayer.SpaceEntity(getNativePointer(arg1));
|
|
16158
|
+
callback(_arg1);
|
|
16159
|
+
};
|
|
16160
|
+
var _callbackPtr = Module.addFunction(_callback, "vii");
|
|
16161
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_SetEntityCreatedCallback_void_EntityCreatedCallback", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
|
|
16162
|
+
}
|
|
16163
|
+
/**
|
|
16164
|
+
* @description Finds the first found SpaceEntity of a matching Name.
|
|
16165
|
+
* @param name - The name to search.
|
|
16166
|
+
* @return A non-owning pointer to the first found matching SpaceEntity.
|
|
16167
|
+
*/
|
|
16168
|
+
findSpaceEntity(name) {
|
|
16169
|
+
var _ret = Module._malloc(8);
|
|
16170
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_FindSpaceEntity_SpaceEntityP_StringRC", "void", ["number", "number", "string"], [_ret, this.pointer, name]);
|
|
16171
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16172
|
+
Module._free(_ret);
|
|
16173
|
+
return _nPtr;
|
|
16174
|
+
}
|
|
16175
|
+
/**
|
|
16176
|
+
* @description Finds the first found SpaceEntity that has the ID EntityId.
|
|
16177
|
+
* @param entityId - The Id to look for.
|
|
16178
|
+
* @return A non-owning pointer to the first found matching SpaceEntity.
|
|
16179
|
+
*/
|
|
16180
|
+
findSpaceEntityById(entityId) {
|
|
16181
|
+
assert(entityId >= Limits.UINT64_MIN);
|
|
16182
|
+
assert(entityId <= Limits.UINT64_MAX);
|
|
16183
|
+
var _ret = Module._malloc(8);
|
|
16184
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_FindSpaceEntityById_SpaceEntityP_uint64_t", "void", ["number", "number", "bigint"], [_ret, this.pointer, entityId]);
|
|
16185
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16186
|
+
Module._free(_ret);
|
|
16187
|
+
return _nPtr;
|
|
16188
|
+
}
|
|
16189
|
+
/**
|
|
16190
|
+
* @description Finds the first found SpaceEntity of a matching Name. The found SpaceEntity will contain an AvatarSpaceComponent.
|
|
16191
|
+
* @param name - The name to search for.
|
|
16192
|
+
* @return A pointer to the first found matching SpaceEntity.
|
|
16193
|
+
*/
|
|
16194
|
+
findSpaceAvatar(name) {
|
|
16195
|
+
var _ret = Module._malloc(8);
|
|
16196
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_FindSpaceAvatar_SpaceEntityP_StringRC", "void", ["number", "number", "string"], [_ret, this.pointer, name]);
|
|
16197
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16198
|
+
Module._free(_ret);
|
|
16199
|
+
return _nPtr;
|
|
16200
|
+
}
|
|
16201
|
+
/**
|
|
16202
|
+
* @description Finds the first found SpaceEntity of a matching Name. The found SpaceEntity will not contain an AvatarSpaceComponent.
|
|
16203
|
+
* @param name - The name to search for.
|
|
16204
|
+
* @return A pointer to the first found matching SpaceEntity.
|
|
16205
|
+
*/
|
|
16206
|
+
findSpaceObject(name) {
|
|
16207
|
+
var _ret = Module._malloc(8);
|
|
16208
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_FindSpaceObject_SpaceEntityP_StringRC", "void", ["number", "number", "string"], [_ret, this.pointer, name]);
|
|
16209
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16210
|
+
Module._free(_ret);
|
|
16211
|
+
return _nPtr;
|
|
16212
|
+
}
|
|
16213
|
+
/**
|
|
16214
|
+
* @description Get an Entity by its index.
|
|
16215
|
+
* /// @param EntityIndex size_t : The index of the entity to get.
|
|
16216
|
+
* @return A non-owning pointer to the entity at the given index.
|
|
16217
|
+
*/
|
|
16218
|
+
getEntityByIndex(entityIndex) {
|
|
16219
|
+
assert(Number.isInteger(entityIndex));
|
|
16220
|
+
assert(entityIndex >= Limits.UINT32_MIN);
|
|
16221
|
+
assert(entityIndex <= Limits.UINT32_MAX);
|
|
16222
|
+
var _ret = Module._malloc(8);
|
|
16223
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetEntityByIndex_SpaceEntityP_size_t", "void", ["number", "number", "number"], [_ret, this.pointer, entityIndex]);
|
|
16224
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16225
|
+
Module._free(_ret);
|
|
16226
|
+
return _nPtr;
|
|
16227
|
+
}
|
|
16228
|
+
/**
|
|
16229
|
+
* @description Get an Avatar by its index. The returned pointer will be an entity that contains an AvatarSpaceComponent.
|
|
16230
|
+
* /// @param AvatarIndex size_t : The index of the avatar entity to get.
|
|
16231
|
+
* @return A non-owning pointer to the avatar entity with the given index.
|
|
16232
|
+
*/
|
|
16233
|
+
getAvatarByIndex(avatarIndex) {
|
|
16234
|
+
assert(Number.isInteger(avatarIndex));
|
|
16235
|
+
assert(avatarIndex >= Limits.UINT32_MIN);
|
|
16236
|
+
assert(avatarIndex <= Limits.UINT32_MAX);
|
|
16237
|
+
var _ret = Module._malloc(8);
|
|
16238
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetAvatarByIndex_SpaceEntityP_size_t", "void", ["number", "number", "number"], [_ret, this.pointer, avatarIndex]);
|
|
16239
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16240
|
+
Module._free(_ret);
|
|
16241
|
+
return _nPtr;
|
|
16242
|
+
}
|
|
16243
|
+
/**
|
|
16244
|
+
* @description Get an Object by its index. The returned pointer will be an entity that does not contain an AvatarSpaceComponent.
|
|
16245
|
+
* /// @param ObjectIndex size_t : The index of the object entity to get.
|
|
16246
|
+
* @return A non-owning pointer to the object entity with the given index.
|
|
16247
|
+
*/
|
|
16248
|
+
getObjectByIndex(objectIndex) {
|
|
16249
|
+
assert(Number.isInteger(objectIndex));
|
|
16250
|
+
assert(objectIndex >= Limits.UINT32_MIN);
|
|
16251
|
+
assert(objectIndex <= Limits.UINT32_MAX);
|
|
16252
|
+
var _ret = Module._malloc(8);
|
|
16253
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetObjectByIndex_SpaceEntityP_size_t", "void", ["number", "number", "number"], [_ret, this.pointer, objectIndex]);
|
|
16254
|
+
var _nPtr = new Multiplayer.SpaceEntity(getNativePointer(_ret));
|
|
16255
|
+
Module._free(_ret);
|
|
16256
|
+
return _nPtr;
|
|
16257
|
+
}
|
|
16258
|
+
/**
|
|
16259
|
+
* @description Get the number of total entities in the system.
|
|
16260
|
+
* @return The total number of entities.
|
|
16261
|
+
*/
|
|
16262
|
+
getNumEntities() {
|
|
16263
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetNumEntitiesC_size_t", "number", ["number"], [this.pointer]);
|
|
16264
|
+
const _unfixedValue = _result;
|
|
16265
|
+
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
16266
|
+
_result = _fixedValue;
|
|
16267
|
+
return _result;
|
|
16228
16268
|
}
|
|
16229
|
-
|
|
16230
|
-
|
|
16269
|
+
/**
|
|
16270
|
+
* @description Get the number of total Avatars in the system. Avatars are entities that contain AvatarSpaceComponents.
|
|
16271
|
+
* @return The total number of Avatar entities.
|
|
16272
|
+
*/
|
|
16273
|
+
getNumAvatars() {
|
|
16274
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetNumAvatarsC_size_t", "number", ["number"], [this.pointer]);
|
|
16275
|
+
const _unfixedValue = _result;
|
|
16276
|
+
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
16277
|
+
_result = _fixedValue;
|
|
16278
|
+
return _result;
|
|
16231
16279
|
}
|
|
16232
|
-
|
|
16233
|
-
|
|
16280
|
+
/**
|
|
16281
|
+
* @description Get the number of total Objects in the system. Objects are entities that do not contain AvatarSpaceComponents.
|
|
16282
|
+
* @return The total number of object entities.
|
|
16283
|
+
*/
|
|
16284
|
+
getNumObjects() {
|
|
16285
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetNumObjectsC_size_t", "number", ["number"], [this.pointer]);
|
|
16286
|
+
const _unfixedValue = _result;
|
|
16287
|
+
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2 ** 32 : _unfixedValue;
|
|
16288
|
+
_result = _fixedValue;
|
|
16234
16289
|
return _result;
|
|
16235
16290
|
}
|
|
16236
|
-
|
|
16237
|
-
|
|
16291
|
+
/**
|
|
16292
|
+
* @description Retrieves all entities that exist at the root level (do not have a parent entity).
|
|
16293
|
+
* @return A list of root entities containing non-owning pointers to entities.
|
|
16294
|
+
*/
|
|
16295
|
+
getRootHierarchyEntities() {
|
|
16296
|
+
var _ret = Module._malloc(8);
|
|
16297
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetRootHierarchyEntitiesC_ListPC", "void", ["number", "number"], [_ret, this.pointer]);
|
|
16298
|
+
var _nPtr = new Common.List(getNativePointer(_ret), csp_multiplayer_SpaceEntityFactory, "csp_multiplayer_SpaceEntity");
|
|
16299
|
+
Module._free(_ret);
|
|
16300
|
+
return _nPtr;
|
|
16238
16301
|
}
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16302
|
+
/**
|
|
16303
|
+
* @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
|
|
16304
|
+
* From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
|
|
16305
|
+
* @param entity - A non-owning pointer to the entity to be marked.
|
|
16306
|
+
*/
|
|
16307
|
+
markEntityForUpdate(entity) {
|
|
16308
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_MarkEntityForUpdate_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entity.pointer]);
|
|
16242
16309
|
}
|
|
16243
|
-
|
|
16244
|
-
|
|
16310
|
+
/**
|
|
16311
|
+
* @description Applies any pending changes to entities that have been marked for update.
|
|
16312
|
+
*/
|
|
16313
|
+
processPendingEntityOperations() {
|
|
16314
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_ProcessPendingEntityOperations_void", "void", ["number"], [this.pointer]);
|
|
16245
16315
|
}
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16316
|
+
/**
|
|
16317
|
+
* @description Sets a callback to be executed when the script system is ready to run scripts.
|
|
16318
|
+
* @param callback - The callback to execute.
|
|
16319
|
+
*/
|
|
16320
|
+
setScriptLeaderReadyCallback(callback) {
|
|
16321
|
+
var _callback = (_stateObject__, arg1) => {
|
|
16322
|
+
callback(arg1);
|
|
16323
|
+
};
|
|
16324
|
+
var _callbackPtr = Module.addFunction(_callback, "vii");
|
|
16325
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_SetScriptLeaderReadyCallback_void_CallbackHandler", "void", ["number", "number", "number"], [this.pointer, _callbackPtr, 0]);
|
|
16254
16326
|
}
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16327
|
+
/**
|
|
16328
|
+
* @description Sets the script owner for the given entity to the current client
|
|
16329
|
+
* @param entity - A pointer to the entity
|
|
16330
|
+
*/
|
|
16331
|
+
claimScriptOwnership(entity) {
|
|
16332
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_ClaimScriptOwnershipC_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entity.pointer]);
|
|
16258
16333
|
}
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16263
|
-
|
|
16334
|
+
/**
|
|
16335
|
+
* @description Enable Leader Election feature.
|
|
16336
|
+
*/
|
|
16337
|
+
enableLeaderElection() {
|
|
16338
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_EnableLeaderElection_void", "void", ["number"], [this.pointer]);
|
|
16264
16339
|
}
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
|
|
16269
|
-
|
|
16340
|
+
/**
|
|
16341
|
+
* @description Disable Leader Election feature.
|
|
16342
|
+
*/
|
|
16343
|
+
disableLeaderElection() {
|
|
16344
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_DisableLeaderElection_void", "void", ["number"], [this.pointer]);
|
|
16270
16345
|
}
|
|
16271
|
-
|
|
16272
|
-
|
|
16346
|
+
/**
|
|
16347
|
+
* @description Check if the Leader Election feature is enabled.
|
|
16348
|
+
* @return True if enabled, false otherwise.
|
|
16349
|
+
*/
|
|
16350
|
+
isLeaderElectionEnabled() {
|
|
16351
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_IsLeaderElectionEnabledC_bool", "boolean", ["number"], [this.pointer]);
|
|
16273
16352
|
return _result;
|
|
16274
16353
|
}
|
|
16275
|
-
|
|
16276
|
-
|
|
16354
|
+
/**
|
|
16355
|
+
* @description Debug helper to get the id of the currently elected script leader.
|
|
16356
|
+
* @return The id of the leader.
|
|
16357
|
+
*/
|
|
16358
|
+
getLeaderId() {
|
|
16359
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetLeaderIdC_uint64_t", "bigint", ["number"], [this.pointer]);
|
|
16360
|
+
const _unfixedValue = _result;
|
|
16361
|
+
let _fixedValue = _unfixedValue < 0 ? _unfixedValue + 2n ** 64n : _unfixedValue;
|
|
16362
|
+
_result = _fixedValue;
|
|
16363
|
+
return _result;
|
|
16277
16364
|
}
|
|
16278
|
-
|
|
16279
|
-
|
|
16365
|
+
/**
|
|
16366
|
+
* @description Retrieve the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
|
|
16367
|
+
* @return True if enabled, false otherwise.
|
|
16368
|
+
*/
|
|
16369
|
+
getEntityPatchRateLimitEnabled() {
|
|
16370
|
+
let _result = Module.ccall("csp_multiplayer_OnlineRealtimeEngine_GetEntityPatchRateLimitEnabledC_bool", "boolean", ["number"], [this.pointer]);
|
|
16280
16371
|
return _result;
|
|
16281
16372
|
}
|
|
16282
|
-
|
|
16283
|
-
|
|
16373
|
+
/**
|
|
16374
|
+
* @description Set the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
|
|
16375
|
+
* /// This feature is enabled by default and should only be disabled if you are encountering issues.
|
|
16376
|
+
* /// @param Enabled : sets if the feature should be enabled or not.
|
|
16377
|
+
* \rst
|
|
16378
|
+
* .. note::
|
|
16379
|
+
* If disabling this feature, more requests will be made to Magnopus Connected Services,
|
|
16380
|
+
* and consequently more patch merges may occur on the server as a result.
|
|
16381
|
+
* \endrst
|
|
16382
|
+
*/
|
|
16383
|
+
setEntityPatchRateLimitEnabled(enabled) {
|
|
16384
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_SetEntityPatchRateLimitEnabled_void_bool", "void", ["number", "boolean"], [this.pointer, enabled]);
|
|
16284
16385
|
}
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
|
|
16386
|
+
/**
|
|
16387
|
+
* @description Locks the entity mutex.
|
|
16388
|
+
*/
|
|
16389
|
+
lockEntityUpdate() {
|
|
16390
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_LockEntityUpdateC_void", "void", ["number"], [this.pointer]);
|
|
16288
16391
|
}
|
|
16289
|
-
|
|
16290
|
-
|
|
16392
|
+
/**
|
|
16393
|
+
* @description Unlocks the entity mutex.
|
|
16394
|
+
*/
|
|
16395
|
+
unlockEntityUpdate() {
|
|
16396
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_UnlockEntityUpdateC_void", "void", ["number"], [this.pointer]);
|
|
16291
16397
|
}
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16398
|
+
/**
|
|
16399
|
+
* @description Queues a specific entity to update. Used in SpaceEntity to queue updates via passing the this pointer
|
|
16400
|
+
*/
|
|
16401
|
+
queueEntityUpdate(entityToUpdate) {
|
|
16402
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_QueueEntityUpdate_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entityToUpdate.pointer]);
|
|
16297
16403
|
}
|
|
16298
|
-
|
|
16299
|
-
|
|
16404
|
+
/**
|
|
16405
|
+
* @description "Resolves" the entity heirarchy, such that the entity is parented appropriately, and internal buffers are populated appropriately.
|
|
16406
|
+
* (Vague, need more understanding about what this does)
|
|
16407
|
+
*/
|
|
16408
|
+
resolveEntityHierarchy(entity) {
|
|
16409
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_ResolveEntityHierarchy_void_SpaceEntityP", "void", ["number", "number"], [this.pointer, entity.pointer]);
|
|
16410
|
+
}
|
|
16411
|
+
delete() {
|
|
16412
|
+
if (this.ownsPointer && !this.disposed) {
|
|
16413
|
+
Module.ccall("csp_multiplayer_OnlineRealtimeEngine_Dtor", "void", ["number"], [this.pointer]);
|
|
16414
|
+
this.disposed = true;
|
|
16415
|
+
}
|
|
16300
16416
|
}
|
|
16301
16417
|
}
|
|
16302
|
-
|
|
16303
|
-
})(
|
|
16418
|
+
Multiplayer.OnlineRealtimeEngine = OnlineRealtimeEngine;
|
|
16419
|
+
})(Multiplayer || (Multiplayer = {}));
|
|
16304
16420
|
(function (Multiplayer) {
|
|
16305
16421
|
/**
|
|
16306
16422
|
@ingroup AnimatedModelSpaceComponent
|
|
@@ -26167,6 +26283,123 @@ export class CSPFoundation {
|
|
|
26167
26283
|
}
|
|
26168
26284
|
Systems.SequenceSystem = SequenceSystem;
|
|
26169
26285
|
})(Systems || (Systems = {}));
|
|
26286
|
+
(function (Systems) {
|
|
26287
|
+
/**
|
|
26288
|
+
@ingroup Application Settings System
|
|
26289
|
+
* @description Represents the result of a request for application settings.
|
|
26290
|
+
*/
|
|
26291
|
+
class ApplicationSettingsResult extends Systems.ResultBase {
|
|
26292
|
+
/** @internal */
|
|
26293
|
+
constructor(pointer) {
|
|
26294
|
+
super(pointer);
|
|
26295
|
+
}
|
|
26296
|
+
static fromResultBase(baseInstance) {
|
|
26297
|
+
const nativeClassWrapper = baseInstance;
|
|
26298
|
+
return new Systems.ApplicationSettingsResult(new NativePointer(nativeClassWrapper.pointer, nativeClassWrapper.ownsPointer));
|
|
26299
|
+
}
|
|
26300
|
+
getApplicationSettings() {
|
|
26301
|
+
var _ret = Module._malloc(8);
|
|
26302
|
+
Module.ccall("csp_systems_ApplicationSettingsResult_GetApplicationSettingsC_ApplicationSettingsRC", "void", ["number", "number"], [_ret, this.pointer]);
|
|
26303
|
+
var _nPtr = new Systems.ApplicationSettings(getNativePointer(_ret));
|
|
26304
|
+
Module._free(_ret);
|
|
26305
|
+
return _nPtr;
|
|
26306
|
+
}
|
|
26307
|
+
delete() {
|
|
26308
|
+
if (this.ownsPointer && !this.disposed) {
|
|
26309
|
+
Module.ccall("csp_systems_ApplicationSettingsResult_Dtor", "void", ["number"], [this.pointer]);
|
|
26310
|
+
this.disposed = true;
|
|
26311
|
+
}
|
|
26312
|
+
}
|
|
26313
|
+
}
|
|
26314
|
+
Systems.ApplicationSettingsResult = ApplicationSettingsResult;
|
|
26315
|
+
})(Systems || (Systems = {}));
|
|
26316
|
+
(function (Systems) {
|
|
26317
|
+
/**
|
|
26318
|
+
@ingroup Application Settings System
|
|
26319
|
+
* @description Public facing system that allows interfacing with Magnopus Connected Services' application settings service.
|
|
26320
|
+
*/
|
|
26321
|
+
class ApplicationSettingsSystem extends Systems.SystemBase {
|
|
26322
|
+
/** @internal */
|
|
26323
|
+
constructor(pointer) {
|
|
26324
|
+
super(pointer);
|
|
26325
|
+
}
|
|
26326
|
+
static fromSystemBase(baseInstance) {
|
|
26327
|
+
const nativeClassWrapper = baseInstance;
|
|
26328
|
+
return new Systems.ApplicationSettingsSystem(new NativePointer(nativeClassWrapper.pointer, nativeClassWrapper.ownsPointer));
|
|
26329
|
+
}
|
|
26330
|
+
/**
|
|
26331
|
+
* @description Asynchronously retrieves application settings for a specific context.
|
|
26332
|
+
* @param applicationName - The name of the application for which settings are requested.
|
|
26333
|
+
* @param context - The specific context whose settings should be retrieved.
|
|
26334
|
+
* @param keys - Array of setting keys to retrieve. If not provided, all settings
|
|
26335
|
+
* for the context are returned.
|
|
26336
|
+
* @param callback - Callback when asynchronous task finishes.
|
|
26337
|
+
*/
|
|
26338
|
+
async getSettingsByContext(applicationName, context, keys) {
|
|
26339
|
+
var _resolve;
|
|
26340
|
+
var _promise = new Promise((_r) => {
|
|
26341
|
+
_resolve = _r;
|
|
26342
|
+
});
|
|
26343
|
+
var _callbackPtr;
|
|
26344
|
+
var _callback = (_stateObject__, result) => {
|
|
26345
|
+
var _resultPtr = getNativePointer(result);
|
|
26346
|
+
var _resultInstance = new Systems.ApplicationSettingsResult(_resultPtr);
|
|
26347
|
+
if (_resultInstance.getResultCode() == Systems.EResultCode.InProgress) {
|
|
26348
|
+
return;
|
|
26349
|
+
}
|
|
26350
|
+
_resolve(_resultInstance);
|
|
26351
|
+
Module.removeFunction(_callbackPtr);
|
|
26352
|
+
};
|
|
26353
|
+
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
26354
|
+
Module.ccall("csp_systems_ApplicationSettingsSystem_GetSettingsByContext_void_StringRC_StringRC_ArrayRC_ApplicationSettingsResultCallback", "void", ["number", "string", "string", "number", "number", "number"], [
|
|
26355
|
+
this.pointer,
|
|
26356
|
+
applicationName,
|
|
26357
|
+
context,
|
|
26358
|
+
keys != null ? keys.pointer : 0,
|
|
26359
|
+
_callbackPtr,
|
|
26360
|
+
0,
|
|
26361
|
+
]);
|
|
26362
|
+
return _promise;
|
|
26363
|
+
}
|
|
26364
|
+
/**
|
|
26365
|
+
* @description Asynchronously retrieves application settings for a specific context without requiring authentication.
|
|
26366
|
+
* @param tenant - The tenant identifier under which the application and settings are scoped.
|
|
26367
|
+
* @param applicationName - The name of the application for which settings are requested.
|
|
26368
|
+
* @param context - The specific context whose settings should be retrieved.
|
|
26369
|
+
* @param keys - Array of setting keys to retrieve. If not provided, all settings
|
|
26370
|
+
* for the context are returned.
|
|
26371
|
+
* @param callback - Callback when asynchronous task finishes.
|
|
26372
|
+
*/
|
|
26373
|
+
async getSettingsByContextAnonymous(tenant, applicationName, context, keys) {
|
|
26374
|
+
var _resolve;
|
|
26375
|
+
var _promise = new Promise((_r) => {
|
|
26376
|
+
_resolve = _r;
|
|
26377
|
+
});
|
|
26378
|
+
var _callbackPtr;
|
|
26379
|
+
var _callback = (_stateObject__, result) => {
|
|
26380
|
+
var _resultPtr = getNativePointer(result);
|
|
26381
|
+
var _resultInstance = new Systems.ApplicationSettingsResult(_resultPtr);
|
|
26382
|
+
if (_resultInstance.getResultCode() == Systems.EResultCode.InProgress) {
|
|
26383
|
+
return;
|
|
26384
|
+
}
|
|
26385
|
+
_resolve(_resultInstance);
|
|
26386
|
+
Module.removeFunction(_callbackPtr);
|
|
26387
|
+
};
|
|
26388
|
+
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
26389
|
+
Module.ccall("csp_systems_ApplicationSettingsSystem_GetSettingsByContextAnonymous_void_StringRC_StringRC_StringRC_ArrayRC_ApplicationSettingsResultCallback", "void", ["number", "string", "string", "string", "number", "number", "number"], [
|
|
26390
|
+
this.pointer,
|
|
26391
|
+
tenant,
|
|
26392
|
+
applicationName,
|
|
26393
|
+
context,
|
|
26394
|
+
keys != null ? keys.pointer : 0,
|
|
26395
|
+
_callbackPtr,
|
|
26396
|
+
0,
|
|
26397
|
+
]);
|
|
26398
|
+
return _promise;
|
|
26399
|
+
}
|
|
26400
|
+
}
|
|
26401
|
+
Systems.ApplicationSettingsSystem = ApplicationSettingsSystem;
|
|
26402
|
+
})(Systems || (Systems = {}));
|
|
26170
26403
|
(function (Systems) {
|
|
26171
26404
|
/**
|
|
26172
26405
|
@ingroup Settings System
|
|
@@ -26736,6 +26969,7 @@ export class CSPFoundation {
|
|
|
26736
26969
|
var _nPtr = getNativePointer(_ptr);
|
|
26737
26970
|
return new Space(_nPtr);
|
|
26738
26971
|
}
|
|
26972
|
+
// operator=
|
|
26739
26973
|
delete() {
|
|
26740
26974
|
if (this.ownsPointer && !this.disposed) {
|
|
26741
26975
|
Module.ccall("csp_systems_Space_Dtor", "void", ["number"], [this.pointer]);
|
|
@@ -27150,14 +27384,18 @@ export class CSPFoundation {
|
|
|
27150
27384
|
}
|
|
27151
27385
|
/**
|
|
27152
27386
|
* @description Enter a space if you have permission to, based on the Space settings.
|
|
27153
|
-
*
|
|
27154
|
-
*
|
|
27387
|
+
* Registers the user as in the space on the backend service, and calls csp::common::IRealtimeEngine::FetchAllEntitiesAndPopulateBuffers.
|
|
27388
|
+
* The initial load behaviour will differ based on the concrete IRealtimeEngine passed to this function.
|
|
27155
27389
|
* If user does not have permission to discover or enter the space, callback will be called with EResultCode::Failed and
|
|
27156
27390
|
* ERequestFailureReason::UserSpaceAccessDenied
|
|
27157
27391
|
* @param space - Space to enter into
|
|
27392
|
+
* @param realtimeEngine - RealtimeEngine to load the space with. This object belongs to the caller, and does not
|
|
27393
|
+
* transfer ownership. Once the space is loaded, the caller should be sure to maintain the lifetime of the RealtimeEngine so long
|
|
27394
|
+
* as the space is active. Once the caller has called csp::systems::SpaceSystem::ExitSpace and received the callback, then they are
|
|
27395
|
+
* free to release the memory.
|
|
27158
27396
|
* @param callback - Callback when asynchronous task finishes
|
|
27159
27397
|
*/
|
|
27160
|
-
async enterSpace(spaceId) {
|
|
27398
|
+
async enterSpace(spaceId, realtimeEngine) {
|
|
27161
27399
|
var _resolve;
|
|
27162
27400
|
var _promise = new Promise((_r) => {
|
|
27163
27401
|
_resolve = _r;
|
|
@@ -27165,7 +27403,7 @@ export class CSPFoundation {
|
|
|
27165
27403
|
var _callbackPtr;
|
|
27166
27404
|
var _callback = (_stateObject__, result) => {
|
|
27167
27405
|
var _resultPtr = getNativePointer(result);
|
|
27168
|
-
var _resultInstance = new Systems.
|
|
27406
|
+
var _resultInstance = new Systems.SpaceResult(_resultPtr);
|
|
27169
27407
|
if (_resultInstance.getResultCode() == Systems.EResultCode.InProgress) {
|
|
27170
27408
|
return;
|
|
27171
27409
|
}
|
|
@@ -27173,7 +27411,7 @@ export class CSPFoundation {
|
|
|
27173
27411
|
Module.removeFunction(_callbackPtr);
|
|
27174
27412
|
};
|
|
27175
27413
|
_callbackPtr = Module.addFunction(_callback, "vii");
|
|
27176
|
-
Module.ccall("
|
|
27414
|
+
Module.ccall("csp_systems_SpaceSystem_EnterSpace_void_StringRC_IRealtimeEngineP_SpaceResultCallback", "void", ["number", "string", "number", "number", "number"], [this.pointer, spaceId, realtimeEngine.pointer, _callbackPtr, 0]);
|
|
27177
27415
|
return _promise;
|
|
27178
27416
|
}
|
|
27179
27417
|
/**
|