connected-spaces-platform.web 5.21.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.
@@ -300,8 +300,8 @@ export declare namespace Common {
300
300
  * @description Enum of concrete types of RealtimeEngines.
301
301
  */
302
302
  enum RealtimeEngineType {
303
- OnlineMultiUser = 0,
304
- OnlineSingleUser = 1
303
+ Online = 0,
304
+ Offline = 1
305
305
  }
306
306
  }
307
307
  export declare namespace Common {
@@ -385,7 +385,11 @@ export declare namespace Multiplayer {
385
385
  SET_ALLOW_SELF_MESSAGING = 10,
386
386
  SET_SCOPES = 11,
387
387
  START_LISTENING = 12,
388
- STOP_LISTENING = 13
388
+ STOP_LISTENING = 13,
389
+ ON_OBJECT_MESSAGE = 14,
390
+ ON_OBJECT_PATCH = 15,
391
+ ON_REQUEST_TO_SEND_OBJECT = 16,
392
+ ON_REQUEST_TO_DISCONNECT = 17
389
393
  }
390
394
  }
391
395
  export declare namespace Multiplayer {
@@ -1514,7 +1518,7 @@ export declare namespace Systems {
1514
1518
  }
1515
1519
  }
1516
1520
  /**
1517
- * @description Represents definition for identifying and versioning an external service endpoint..
1521
+ * @description Represents definition for identifying and versioning an external service endpoint.
1518
1522
  */
1519
1523
  export declare class ServiceDefinition extends NativeClassWrapper implements INativeResource {
1520
1524
  /** @internal */
@@ -3784,24 +3788,24 @@ export declare namespace Common {
3784
3788
  }
3785
3789
  }
3786
3790
  export declare namespace Common {
3787
- class InvalidInterfaceUseError extends NativeClassWrapper implements INativeResource {
3791
+ class IJSScriptRunner extends NativeClassWrapper implements INativeResource {
3788
3792
  /** @internal */
3789
3793
  constructor(pointer: NativePointer);
3790
- static create_msg(msg: string): InvalidInterfaceUseError;
3794
+ /**
3795
+ * @description Virtual destructor.
3796
+ */
3791
3797
  delete(): void;
3792
- get msg(): string;
3793
- set msg(value: string);
3798
+ runScript(contextId: bigint, scriptText: string): boolean;
3794
3799
  }
3795
3800
  }
3796
3801
  export declare namespace Common {
3797
- class IJSScriptRunner extends NativeClassWrapper implements INativeResource {
3802
+ class InvalidInterfaceUseError extends NativeClassWrapper implements INativeResource {
3798
3803
  /** @internal */
3799
3804
  constructor(pointer: NativePointer);
3800
- /**
3801
- * @description Virtual destructor.
3802
- */
3805
+ static create_msg(msg: string): InvalidInterfaceUseError;
3803
3806
  delete(): void;
3804
- runScript(contextId: bigint, scriptText: string): boolean;
3807
+ get msg(): string;
3808
+ set msg(value: string);
3805
3809
  }
3806
3810
  }
3807
3811
  export declare namespace Common {
@@ -3819,22 +3823,28 @@ export declare namespace Common {
3819
3823
  /**
3820
3824
  * @description Create and add a SpaceEntity with type Avatar, and relevant components and default states as specified.
3821
3825
  * @param name - The entity name of the newly created avatar entity.
3826
+ * @param userId - Id of the user creating this avatar. If your backend data store requires authentication, this will
3827
+ * probably be your username or some similar unique identifier.
3822
3828
  * @param spaceTransform - The initial transform to set the SpaceEntity to.
3823
- * @param state - The initial Avatar State to set.
3829
+ * @param isVisible - Whether the avatar defaults to being visible.
3830
+ * @param avatarState - The initial Avatar State to set.
3824
3831
  * @param avatarId - The ID to be set on the AvatarSpaceComponent
3825
3832
  * @param avatarPlayMode - The Initial AvatarPlayMode to set.
3826
3833
  * @param callback - Csp::multiplayer::entitycreatedcallback a callback that executes when the creation is complete,
3827
3834
  * which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
3828
3835
  */
3829
- createAvatar(name: string, spaceTransform: Multiplayer.SpaceTransform, state: Multiplayer.AvatarState, avatarId: string, avatarPlayMode: Multiplayer.AvatarPlayMode): Promise<Multiplayer.SpaceEntity>;
3836
+ createAvatar(name: string, userId: string, spaceTransform: Multiplayer.SpaceTransform, isVisible: boolean, avatarState: Multiplayer.AvatarState, avatarId: string, avatarPlayMode: Multiplayer.AvatarPlayMode): Promise<Multiplayer.SpaceEntity>;
3830
3837
  /**
3831
3838
  * @description Create and add a SpaceEntity, with relevant default values.
3832
3839
  * @param name - The name of the newly created SpaceEntity.
3833
3840
  * @param spaceTransform - The initial transform to set the SpaceEntity to.
3841
+ * @param parentID - ID of another entity in the space that this entity should be created as a child to. If
3842
+ * empty, entity is created as a root entity.
3834
3843
  * @param callback - A callback that executes when the creation is complete,
3835
3844
  * which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
3836
3845
  */
3837
- createEntity(name: string, spaceTransform: Multiplayer.SpaceTransform): Promise<Multiplayer.SpaceEntity>;
3846
+ createEntity(name: string, spaceTransform: Multiplayer.SpaceTransform, parentID: bigint | null): Promise<Multiplayer.SpaceEntity>;
3847
+ addEntity(entityToAdd: Multiplayer.SpaceEntity): void;
3838
3848
  /**
3839
3849
  * @description Destroy the specified entity.
3840
3850
  * @param entity - A non-owning pointer to the entity to be destroyed.
@@ -3844,6 +3854,8 @@ export declare namespace Common {
3844
3854
  /**
3845
3855
  * @description Sets a callback to be executed when an entity is fully created.
3846
3856
  * /// Only one EntityCreatedCallback may be registered, calling this function again will override whatever was previously set.
3857
+ * 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
3858
+ * override or remove this callback.
3847
3859
  * /// @param Callback csp::multiplayer::EntityCreatedCallback : the callback to execute.
3848
3860
  */
3849
3861
  setEntityCreatedCallback(callback: (arg1: Multiplayer.SpaceEntity) => void): void;
@@ -3910,10 +3922,14 @@ export declare namespace Common {
3910
3922
  */
3911
3923
  getRootHierarchyEntities(): Common.List<Multiplayer.SpaceEntity>;
3912
3924
  /**
3913
- * @description Sets a callback to be executed when all existing entities have been retrieved after entering a space.
3914
- * @param callback - A callback that executes when all existing entities have been retrieved.
3925
+ * @description Set Callback that notifies when the OnlineRealtimeEngine is in a valid state
3926
+ * after entering a space, and entity mutation can begin. Users should not mutate entities before receiving this callback.
3927
+ * This callback should be emitted in response to FetchAllEntitiesAndPopulateBuffers completing, either syncronously or asyncronously.
3928
+ * This callback must be set prior to entering a space.
3929
+ * @param fetchCompleteCallback - Callback that notifies when the RealtimeEngine has completed initial
3930
+ * entity fetch
3915
3931
  */
3916
- setInitialEntitiesRetrievedCallback(callback: (arg1: boolean) => void): void;
3932
+ setEntityFetchCompleteCallback(callback: (arg1: number) => void): void;
3917
3933
  /**
3918
3934
  * @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
3919
3935
  * From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
@@ -4072,11 +4088,11 @@ export declare namespace Multiplayer {
4072
4088
  /**
4073
4089
  * @description Constructor for CSPSceneDescription by deserializing a SceneDescription json file.
4074
4090
  * @param sceneDescriptionJson - The SceneDescription to deserialize.
4075
- * @param entitySystem - The SpaceEntitySystem for this session.
4076
- * @param logSystem - The SpaceEntitySystem for this session.
4091
+ * @param entitySystem - The OnlineRealtimeEngine for this session.
4092
+ * @param logSystem - The OnlineRealtimeEngine for this session.
4077
4093
  * @param remoteScriptRunner - The ScriptRunner for this session.
4078
4094
  */
4079
- static create_sceneDescriptionJson_entitySystem_logSystem_remoteScriptRunner(sceneDescriptionJson: string, entitySystem: Multiplayer.SpaceEntitySystem, logSystem: Common.LogSystem, remoteScriptRunner: Common.IJSScriptRunner): CSPSceneDescription;
4095
+ static create_sceneDescriptionJson_entitySystem_logSystem_remoteScriptRunner(sceneDescriptionJson: string, entitySystem: Multiplayer.OnlineRealtimeEngine, logSystem: Common.LogSystem, remoteScriptRunner: Common.IJSScriptRunner): CSPSceneDescription;
4080
4096
  delete(): void;
4081
4097
  get entities(): Common.Array<Multiplayer.SpaceEntity>;
4082
4098
  set entities(value: Common.Array<Multiplayer.SpaceEntity>);
@@ -4129,6 +4145,12 @@ export declare namespace Multiplayer {
4129
4145
  * @return True if self messaging is allowed, false otherwise.
4130
4146
  */
4131
4147
  getAllowSelfMessagingFlag(): boolean;
4148
+ /**
4149
+ * @description Get the currently set realtime engine.
4150
+ * @return Non-owning pointer to currently set realtime engine. This should be non-null when in a space, and null before entering, or after
4151
+ * exiting a space.
4152
+ */
4153
+ getOnlineRealtimeEngine(): Multiplayer.OnlineRealtimeEngine;
4132
4154
  delete(): void;
4133
4155
  }
4134
4156
  }
@@ -4181,25 +4203,21 @@ export declare namespace Multiplayer {
4181
4203
  sendNetworkEventToClient(eventName: string, args: Common.Array<Common.ReplicatedValue>, targetClientId: bigint): Promise<Multiplayer.ErrorCode>;
4182
4204
  /**
4183
4205
  * @description Register interest in a network event, such that the NetworkEventBus will call the provided callback when it arrives
4184
- * @param registration - Registration information, containing a ReceiverID and an EventName.
4185
- * @param callback - Callback to invoke when specified event is received.
4186
- * @return True if the registration was successful, false otherwise, such as in the case where Registration was not-unique, or the callback was
4187
- * null.
4206
+ * @param registration - Registration information, containing a ReceiverID and an EventName. Will fail to register if
4207
+ * identical callback registration already registered.
4208
+ * @param callback - Callback to invoke when specified event is received. Will fail to register if null.
4188
4209
  */
4189
- listenNetworkEvent(registration: Multiplayer.NetworkEventRegistration, callback: (networkEventData: Common.NetworkEventData) => void): boolean;
4210
+ listenNetworkEvent(registration: Multiplayer.NetworkEventRegistration, callback: (networkEventData: Common.NetworkEventData) => void): void;
4190
4211
  /**
4191
4212
  * @description Deregister interest in a network event
4192
4213
  * @param registration - Registration information of already registered event, containing a ReceiverID and an EventName.
4193
- * @return True if the deregistration was successful, false otherwise, such as in the case where Registration was not found
4194
4214
  */
4195
- stopListenNetworkEvent(registration: Multiplayer.NetworkEventRegistration): boolean;
4215
+ stopListenNetworkEvent(registration: Multiplayer.NetworkEventRegistration): void;
4196
4216
  /**
4197
4217
  * @description Deregister interest in all network events registered to a particular EventReceiverId
4198
4218
  * @param eventReceiverId - EventReceiverId to deregister.
4199
- * @return True if the deregistration was successful, false otherwise, such as if no events were found to deregister under the provided
4200
- * EventReceiverId.
4201
4219
  */
4202
- stopListenAllNetworkEvents(eventReceiverId: string): boolean;
4220
+ stopListenAllNetworkEvents(eventReceiverId: string): void;
4203
4221
  /**
4204
4222
  * @description Get an array of all interests currently registered to the NetworkEventBus
4205
4223
  * @return Csp::common::array&lt;csp::multiplayer::networkeventregistration&gt; a container of all currently registered registrations.
@@ -4242,7 +4260,7 @@ export declare namespace Multiplayer {
4242
4260
  /**
4243
4261
  * @description Creates a SpaceEntity instance using the space entity system provided.
4244
4262
  */
4245
- static create_entitySystem_scriptRunner_logSystem(entitySystem: Multiplayer.SpaceEntitySystem, scriptRunner: Common.IJSScriptRunner, logSystem: Common.LogSystem): SpaceEntity;
4263
+ static create_entitySystem_scriptRunner_logSystem(entitySystem: Multiplayer.OnlineRealtimeEngine, scriptRunner: Common.IJSScriptRunner, logSystem: Common.LogSystem): SpaceEntity;
4246
4264
  /**
4247
4265
  * @description Destroys the SpaceEntity instance.
4248
4266
  */
@@ -4353,11 +4371,6 @@ export declare namespace Multiplayer {
4353
4371
  * @return The SpaceEntityType enum value.
4354
4372
  */
4355
4373
  getEntityType(): Multiplayer.SpaceEntityType;
4356
- /**
4357
- * @description Get SpaceEntitySystem Object
4358
- * @return SpaceEntitySystem
4359
- */
4360
- getSpaceEntitySystem(): Multiplayer.SpaceEntitySystem;
4361
4374
  /**
4362
4375
  * @description Sets the parent for this entity
4363
4376
  * QueueUpdate() should be called afterwards to enable changes to the parent.
@@ -4499,236 +4512,6 @@ export declare namespace Multiplayer {
4499
4512
  isLocked(): boolean;
4500
4513
  }
4501
4514
  }
4502
- export declare namespace Multiplayer {
4503
- /**
4504
- * @description Class for creating and managing multiplayer objects known as space entities.
4505
- * /// This provides functions to create and manage multiple player avatars and other objects.
4506
- * It manages things like queueing updated entities and triggering tick events. Callbacks
4507
- * can be registered for certain events that occur within the entity system so clients can
4508
- * react appropriately.
4509
- */
4510
- class SpaceEntitySystem extends NativeClassWrapper implements INativeResource {
4511
- /** @internal */
4512
- constructor(pointer: NativePointer);
4513
- /**
4514
- * @description Creates a SpaceEntity with type Avatar, and relevant components and default states as specified.
4515
- * @param inName - The name to give the new SpaceEntity.
4516
- * @param inSpaceTransform - The initial transform to set the SpaceEntity to.
4517
- * @param isVisible - The initial visibility of the Avatar.
4518
- * @param inState - The initial Avatar State to set.
4519
- * @param inAvatarId - The Initial AvatarID to set.
4520
- * @param inAvatarPlayMode - The Initial AvatarPlayMode to set.
4521
- * @param callback - EntityCreatedCallback A callback that executes when the creation is complete,
4522
- * which contains a pointer to the new SpaceEntity so that it can be used on the local client.
4523
- */
4524
- createAvatar(name: string, loginState: Common.LoginState, spaceTransform: Multiplayer.SpaceTransform, isVisible: boolean, state: Multiplayer.AvatarState, avatarId: string, avatarPlayMode: Multiplayer.AvatarPlayMode): Promise<Multiplayer.SpaceEntity>;
4525
- /**
4526
- * @description Creates a SpaceEntity of type Object, and relevant default values.
4527
- * @param inName - The name to give the new SpaceEntity.
4528
- * @param inSpaceTransform - The initial transform to set the SpaceEntity to.
4529
- * @param callback - A callback that executes when the creation is complete,
4530
- * which contains a pointer to the new SpaceEntity so that it can be used on the local client.
4531
- */
4532
- createObject(name: string, spaceTransform: Multiplayer.SpaceTransform): Promise<Multiplayer.SpaceEntity>;
4533
- /**
4534
- * @description Destroys both the remote view and the local view of the specified entity.
4535
- * @param entity - The entity to be destroyed.
4536
- * @param callback - The callback to execute.
4537
- */
4538
- destroyEntity(entity: Multiplayer.SpaceEntity): Promise<boolean>;
4539
- /**
4540
- * @description Destroys the local client's view of the specified entity.
4541
- * @param entity - The entity to be destroyed locally.
4542
- */
4543
- localDestroyEntity(entity: Multiplayer.SpaceEntity): void;
4544
- /**
4545
- * @description Finds the first SpaceEntity that matches InName.
4546
- * @param inName - The name to search.
4547
- * @return A pointer to the first found match SpaceEntity.
4548
- */
4549
- findSpaceEntity(name: string): Multiplayer.SpaceEntity;
4550
- /**
4551
- * @description Finds the first SpaceEntity that has the ID EntityId.
4552
- * @param entityId - The Id to look for.
4553
- * @return A pointer to the first found match SpaceEntity.
4554
- */
4555
- findSpaceEntityById(entityId: bigint): Multiplayer.SpaceEntity;
4556
- /**
4557
- * @description Finds the first SpaceEntity of type Avatar that matches InName.
4558
- * @param inName - The name to search.
4559
- * @return A pointer to the first found match SpaceEntity.
4560
- */
4561
- findSpaceAvatar(name: string): Multiplayer.SpaceEntity;
4562
- /**
4563
- * @description Finds the first SpaceEntity of type Object that matches InName.
4564
- * @param inName - The name to search.
4565
- * @return A pointer to the first found match SpaceEntity.
4566
- */
4567
- findSpaceObject(name: string): Multiplayer.SpaceEntity;
4568
- /**
4569
- * @description Locks the entity mutex.
4570
- */
4571
- lockEntityUpdate(): void;
4572
- /**
4573
- * @description Unlocks the entity mutex.
4574
- */
4575
- unlockEntityUpdate(): void;
4576
- /**
4577
- * @description Get the number of total entities in the system (both Avatars and Objects).
4578
- * @return The total number of entities.
4579
- */
4580
- getNumEntities(): number;
4581
- /**
4582
- * @description Get the number of total Avatars in the system.
4583
- * @return The total number of Avatar entities.
4584
- */
4585
- getNumAvatars(): number;
4586
- /**
4587
- * @description Get the number of total Objects in the system.
4588
- * @return The total number of object entities.
4589
- */
4590
- getNumObjects(): number;
4591
- /**
4592
- * @description Get an Entity (Avatar or Object) by its index.
4593
- * /// Note this is not currently thread safe and should only be called from the main thread.
4594
- * /// @param EntityIndex size_t : The index of the entity to get.
4595
- * @return A pointer to the entity with the given index.
4596
- */
4597
- getEntityByIndex(entityIndex: number): Multiplayer.SpaceEntity;
4598
- /**
4599
- * @description Get an Avatar by its index.
4600
- * /// Note this is not currently thread safe and should only be called from the main thread.
4601
- * /// @param AvatarIndex size_t : The index of the avatar entity to get.
4602
- * @return A pointer to the avatar entity with the given index.
4603
- */
4604
- getAvatarByIndex(avatarIndex: number): Multiplayer.SpaceEntity;
4605
- /**
4606
- * @description Get an Object by its index.
4607
- * /// Note this is not currently thread safe and should only be called from the main thread.
4608
- * /// @param ObjectIndex size_t : The index of the object entity to get.
4609
- * @return A pointer to the object entity with the given index.
4610
- */
4611
- getObjectByIndex(objectIndex: number): Multiplayer.SpaceEntity;
4612
- /**
4613
- * @description Add a new entity to the system.
4614
- * /// This can be called at any time from any thread and internally add the entity to a pending
4615
- * list which is then updated in a thread safe manner when ProcessPendingEntityOperations
4616
- * is called from the main thread.
4617
- * /// @param EntityToAdd SpaceEntity : Pointer to the entity to be added.
4618
- */
4619
- addEntity(entityToAdd: Multiplayer.SpaceEntity): void;
4620
- /**
4621
- * @description Sets a callback to be executed when an entity is remotely created.
4622
- * /// Only one callback may be registered, calling this function again will override whatever was previously set.
4623
- * If this is not set, some patch functions may fail.
4624
- * /// @param Callback EntityCreatedCallback : the callback to execute.
4625
- */
4626
- setEntityCreatedCallback(callback: (arg1: Multiplayer.SpaceEntity) => void): void;
4627
- /**
4628
- * @description Sets a callback to be executed when all existing entities have been retrieved after entering a space.
4629
- * @param callback - The callback to execute.
4630
- */
4631
- setInitialEntitiesRetrievedCallback(callback: (arg1: boolean) => void): void;
4632
- /**
4633
- * @description Sets a callback to be executed when the script system is ready to run scripts.
4634
- * @param callback - The callback to execute.
4635
- */
4636
- setScriptSystemReadyCallback(callback: (arg1: boolean) => void): void;
4637
- /**
4638
- * @description Triggers queuing of the SpaceEntities updated components and replicated data.
4639
- * /// Causes the replication of a SpaceEntities data on next Tick() or ProcessPendingEntityOperations(). However, this is bound by an
4640
- * entities rate limit and will only be replicated if there has been sufficient time since the last time the entity sent a message.
4641
- * /// @param EntityToUpdate SpaceEntity : A pointer to the SpaceEntity to update.
4642
- */
4643
- queueEntityUpdate(entityToUpdate: Multiplayer.SpaceEntity): void;
4644
- /**
4645
- * @description Processes pending entity operations and then calls tick on scripts if necessary.
4646
- */
4647
- tickEntities(): void;
4648
- registerEntityScriptAsModule(newEntity: Multiplayer.SpaceEntity): void;
4649
- bindNewEntityToScript(newEntity: Multiplayer.SpaceEntity): void;
4650
- /**
4651
- * @description Sets the script owner for the given entity to the current client
4652
- * @param entity - A pointer to the entity
4653
- */
4654
- claimScriptOwnership(entity: Multiplayer.SpaceEntity): void;
4655
- /**
4656
- * @description Adds the entity to a list of entities to be updated on tick
4657
- * @param entity - A pointer to the entity to be added
4658
- */
4659
- markEntityForUpdate(entity: Multiplayer.SpaceEntity): void;
4660
- /**
4661
- * @description Process pending entity adds/removes and Patch message send and receives.
4662
- * /// Note this should only be called from main thread
4663
- */
4664
- processPendingEntityOperations(): void;
4665
- /**
4666
- * @description Retrieves all entities from the endpoint, calls "GetAllScopedObjects" currently.
4667
- * /// Note this will generate new entity objects for every entity in the current scopes.
4668
- * If this is called by a client manually without first deleting all existing tracked entities, it is possible there will be duplicates.
4669
- * It is highly advised not to call this function unless you know what you are doing.
4670
- */
4671
- retrieveAllEntities(): void;
4672
- /**
4673
- * @description Destroys the client's local view of all currently known entities.
4674
- * /// They still reside on the server, however they will not be accessible in the client application.
4675
- */
4676
- localDestroyAllEntities(): void;
4677
- /**
4678
- * @description Sets the selected state of an entity, if the operation is acceptable.
4679
- * /// Criteria:
4680
- * For Selection:
4681
- * - Entity must be deselected currently
4682
- * For Deselection:
4683
- * - Entity must be selected currently
4684
- * - Entity must be selected by the client attempting the deselection (SpaceEntity::GetSelectingClientID will return this information)
4685
- * /// @param SelectedState bool : The state to set the entity to, Selected = True, Deselected = false.
4686
- * @param entity - A pointer to the entity to modify selection state on.
4687
- * @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).
4688
- */
4689
- setSelectionStateOfEntity(selectedState: boolean, entity: Multiplayer.SpaceEntity): boolean;
4690
- /**
4691
- * @description Enable Leader Election feature.
4692
- */
4693
- enableLeaderElection(): void;
4694
- /**
4695
- * @description Disable Leader Election feature.
4696
- */
4697
- disableLeaderElection(): void;
4698
- /**
4699
- * @description Check if the Leader Election feature is enabled.
4700
- * @return True if enabled, false otherwise.
4701
- */
4702
- isLeaderElectionEnabled(): boolean;
4703
- /**
4704
- * @description Debug helper to get the id of the currently elected script leader.
4705
- * @return The id of the leader.
4706
- */
4707
- getLeaderId(): bigint;
4708
- /**
4709
- * @description Retrieve the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
4710
- * @return True if enabled, false otherwise.
4711
- */
4712
- getEntityPatchRateLimitEnabled(): boolean;
4713
- /**
4714
- * @description Set the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
4715
- * /// This feature is enabled by default and should only be disabled if you are encountering issues.
4716
- * /// @param Enabled : sets if the feature should be enabled or not.
4717
- * \rst
4718
- * .. note::
4719
- * If disabling this feature, more requests will be made to Magnopus Connected Services,
4720
- * and consequently more patch merges may occur on the server as a result.
4721
- * \endrst
4722
- */
4723
- setEntityPatchRateLimitEnabled(enabled: boolean): void;
4724
- /**
4725
- * @description Retrieves all entities that exist at the root level (do not have a parent entity).
4726
- * @return A list of root entities.
4727
- */
4728
- getRootHierarchyEntities(): Common.List<Multiplayer.SpaceEntity>;
4729
- delete(): void;
4730
- }
4731
- }
4732
4515
  export declare namespace Multiplayer {
4733
4516
  /**
4734
4517
  * @description Simple class for holding the position, rotation and scale of a transform.
@@ -4972,6 +4755,58 @@ export declare namespace Systems {
4972
4755
  set sequences(value: Common.Array<Systems.Sequence>);
4973
4756
  }
4974
4757
  }
4758
+ export declare namespace Systems {
4759
+ /**
4760
+ @ingroup Status System
4761
+ * @description Stores the version and deprecation information for a service
4762
+ */
4763
+ class VersionMetadata extends NativeClassWrapper implements INativeResource {
4764
+ /** @internal */
4765
+ constructor(pointer: NativePointer);
4766
+ static create(): VersionMetadata;
4767
+ delete(): void;
4768
+ get version(): string;
4769
+ set version(value: string);
4770
+ get deprecationDatetime(): string;
4771
+ set deprecationDatetime(value: string);
4772
+ }
4773
+ }
4774
+ export declare namespace Systems {
4775
+ /**
4776
+ @ingroup Status System
4777
+ * @description Stores information about a service, including available versions
4778
+ */
4779
+ class ServiceStatus extends NativeClassWrapper implements INativeResource {
4780
+ /** @internal */
4781
+ constructor(pointer: NativePointer);
4782
+ static create(): ServiceStatus;
4783
+ delete(): void;
4784
+ get reverseProxy(): string;
4785
+ set reverseProxy(value: string);
4786
+ get name(): string;
4787
+ set name(value: string);
4788
+ get apiVersions(): Common.Array<Systems.VersionMetadata>;
4789
+ set apiVersions(value: Common.Array<Systems.VersionMetadata>);
4790
+ get currentApiVersion(): string;
4791
+ set currentApiVersion(value: string);
4792
+ }
4793
+ }
4794
+ export declare namespace Systems {
4795
+ /**
4796
+ @ingroup Status System
4797
+ * @description Store information about the current service deployment
4798
+ */
4799
+ class ServicesDeploymentStatus extends NativeClassWrapper implements INativeResource {
4800
+ /** @internal */
4801
+ constructor(pointer: NativePointer);
4802
+ static create(): ServicesDeploymentStatus;
4803
+ delete(): void;
4804
+ get version(): string;
4805
+ set version(value: string);
4806
+ get services(): Common.Array<Systems.ServiceStatus>;
4807
+ set services(value: Common.Array<Systems.ServiceStatus>);
4808
+ }
4809
+ }
4975
4810
  export declare namespace Systems {
4976
4811
  /**
4977
4812
  * @description Base class for all Connected Spaces Platform Systems, which enforces passing of a WebClient or NetworkEventBus instance in the constructor
@@ -5042,6 +4877,11 @@ export declare namespace Systems {
5042
4877
  * @return Pointer to the log system class
5043
4878
  */
5044
4879
  getLogSystem(): Common.LogSystem;
4880
+ /**
4881
+ * @description Retrieves the Application Settings system.
4882
+ * @return Pointer to the application settings system class
4883
+ */
4884
+ getApplicationSettingsSystem(): Systems.ApplicationSettingsSystem;
5045
4885
  /**
5046
4886
  * @description Retrieves the Settings system.
5047
4887
  * @return Pointer to the settings system class
@@ -5087,9 +4927,9 @@ export declare namespace Systems {
5087
4927
  * @return Pointer to the hotspotsequencesystem system class
5088
4928
  */
5089
4929
  getHotspotSequenceSystem(): Systems.HotspotSequenceSystem;
5090
- getSpaceEntitySystem(): Multiplayer.SpaceEntitySystem;
5091
4930
  getMultiplayerConnection(): Multiplayer.MultiplayerConnection;
5092
4931
  getEventBus(): Multiplayer.NetworkEventBus;
4932
+ makeOnlineRealtimeEngine(): Multiplayer.OnlineRealtimeEngine;
5093
4933
  }
5094
4934
  }
5095
4935
  export declare namespace Systems {
@@ -5903,6 +5743,26 @@ export declare namespace Systems {
5903
5743
  set metaData(value: Common.Map<string, string>);
5904
5744
  }
5905
5745
  }
5746
+ export declare namespace Systems {
5747
+ /**
5748
+ @ingroup Application Settings System
5749
+ * @description Represents configuration settings for an application context.
5750
+ */
5751
+ class ApplicationSettings extends NativeClassWrapper implements INativeResource {
5752
+ /** @internal */
5753
+ constructor(pointer: NativePointer);
5754
+ static create(): ApplicationSettings;
5755
+ delete(): void;
5756
+ get applicationName(): string;
5757
+ set applicationName(value: string);
5758
+ get context(): string;
5759
+ set context(value: string);
5760
+ get allowAnonymous(): boolean;
5761
+ set allowAnonymous(value: boolean);
5762
+ get settings(): Common.Map<string, string>;
5763
+ set settings(value: Common.Map<string, string>);
5764
+ }
5765
+ }
5906
5766
  export declare namespace Systems {
5907
5767
  /**
5908
5768
  @ingroup Settings System
@@ -6395,6 +6255,209 @@ export declare namespace Common {
6395
6255
  set hotspotData(value: Common.HotspotSequenceChangedNetworkEventData);
6396
6256
  }
6397
6257
  }
6258
+ export declare namespace Multiplayer {
6259
+ /**
6260
+ * @description Class for creating and managing multiplayer objects known as space entities.
6261
+ * /// This provides functions to create and manage multiple player avatars and other objects.
6262
+ * It manages things like queueing updated entities and triggering tick events. Callbacks
6263
+ * can be registered for certain events that occur within the entity system so clients can
6264
+ * react appropriately.
6265
+ */
6266
+ class OnlineRealtimeEngine extends Common.IRealtimeEngine implements INativeResource {
6267
+ /** @internal */
6268
+ constructor(pointer: NativePointer);
6269
+ static fromIRealtimeEngine(baseInstance: Common.IRealtimeEngine): Multiplayer.OnlineRealtimeEngine;
6270
+ /**
6271
+ * @description OnlineRealtimeEngine constructor
6272
+ * @param inMultiplayerConnection - The multiplayer connection to construct the onlinerealtimeengine with
6273
+ * @param logSystem - Logger such that this system can print status and debug output
6274
+ * @param networkEventBus - Reference the the network event bus, used for leadership election messaging.
6275
+ * @param remoteScriptRunner - Object capable of running a script. Called to execute scripts when the leader
6276
+ * election system
6277
+ */
6278
+ static create_multiplayerConnection_logSystem_networkEventBus_remoteScriptRunner(multiplayerConnection: Multiplayer.MultiplayerConnection, logSystem: Common.LogSystem, networkEventBus: Multiplayer.NetworkEventBus, remoteScriptRunner: Common.IJSScriptRunner): OnlineRealtimeEngine;
6279
+ /**
6280
+ * @description Returns the concrete type of the instantiation of the abstract IRealtimeEngine.
6281
+ */
6282
+ getRealtimeEngineType(): Common.RealtimeEngineType;
6283
+ /**
6284
+ * @description Create and add a SpaceEntity with type Avatar, and relevant components and default states as specified.
6285
+ * @param name - The entity name of the newly created avatar entity.
6286
+ * @param userId - The Id of the user creating the avatar. This can be fetched from csp::systems::UserSystem::GetLoginState
6287
+ * @param spaceTransform - The initial transform to set the SpaceEntity to.
6288
+ * @param state - The initial Avatar State to set.
6289
+ * @param avatarId - The ID to be set on the AvatarSpaceComponent
6290
+ * @param avatarPlayMode - The Initial AvatarPlayMode to set.
6291
+ * @param callback - Csp::multiplayer::entitycreatedcallback a callback that executes when the creation is complete,
6292
+ * which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
6293
+ */
6294
+ createAvatar(name: string, userId: string, spaceTransform: Multiplayer.SpaceTransform, isVisible: boolean, state: Multiplayer.AvatarState, avatarId: string, avatarPlayMode: Multiplayer.AvatarPlayMode): Promise<Multiplayer.SpaceEntity>;
6295
+ /**
6296
+ * @description Create and add a SpaceEntity, with relevant default values.
6297
+ * @param name - The name of the newly created SpaceEntity.
6298
+ * @param spaceTransform - The initial transform to set the SpaceEntity to.
6299
+ * @param parentID - ID of another entity in the space that this entity should be created as a child to. If empty,
6300
+ * entity is created as a root entity.
6301
+ * @param callback - A callback that executes when the creation is complete,
6302
+ * which will provide a non-owning pointer to the new SpaceEntity so that it can be used on the local client.
6303
+ */
6304
+ createEntity(name: string, spaceTransform: Multiplayer.SpaceTransform, parentID: bigint | null): Promise<Multiplayer.SpaceEntity>;
6305
+ /**
6306
+ * @description Add a new entity to the system.
6307
+ * /// This can be called at any time from any thread and internally add the entity to a pending
6308
+ * list which is then updated in a thread safe manner when ProcessPendingEntityOperations
6309
+ * is called from the main thread.
6310
+ * /// @param EntityToAdd SpaceEntity : Pointer to the entity to be added.
6311
+ */
6312
+ addEntity(entityToAdd: Multiplayer.SpaceEntity): void;
6313
+ /**
6314
+ * @description Destroy the specified entity.
6315
+ * @param entity - A non-owning pointer to the entity to be destroyed.
6316
+ * @param callback - A callback that executes when the entity destruction is complete.
6317
+ */
6318
+ destroyEntity(entity: Multiplayer.SpaceEntity): Promise<boolean>;
6319
+ /**
6320
+ * @description Sets a callback to be executed when an entity is fully created.
6321
+ * /// Only one EntityCreatedCallback may be registered, calling this function again will override whatever was previously set.
6322
+ * /// @param Callback csp::multiplayer::EntityCreatedCallback : the callback to execute.
6323
+ */
6324
+ setEntityCreatedCallback(callback: (arg1: Multiplayer.SpaceEntity) => void): void;
6325
+ /**
6326
+ * @description Finds the first found SpaceEntity of a matching Name.
6327
+ * @param name - The name to search.
6328
+ * @return A non-owning pointer to the first found matching SpaceEntity.
6329
+ */
6330
+ findSpaceEntity(name: string): Multiplayer.SpaceEntity;
6331
+ /**
6332
+ * @description Finds the first found SpaceEntity that has the ID EntityId.
6333
+ * @param entityId - The Id to look for.
6334
+ * @return A non-owning pointer to the first found matching SpaceEntity.
6335
+ */
6336
+ findSpaceEntityById(entityId: bigint): Multiplayer.SpaceEntity;
6337
+ /**
6338
+ * @description Finds the first found SpaceEntity of a matching Name. The found SpaceEntity will contain an AvatarSpaceComponent.
6339
+ * @param name - The name to search for.
6340
+ * @return A pointer to the first found matching SpaceEntity.
6341
+ */
6342
+ findSpaceAvatar(name: string): Multiplayer.SpaceEntity;
6343
+ /**
6344
+ * @description Finds the first found SpaceEntity of a matching Name. The found SpaceEntity will not contain an AvatarSpaceComponent.
6345
+ * @param name - The name to search for.
6346
+ * @return A pointer to the first found matching SpaceEntity.
6347
+ */
6348
+ findSpaceObject(name: string): Multiplayer.SpaceEntity;
6349
+ /**
6350
+ * @description Get an Entity by its index.
6351
+ * /// @param EntityIndex size_t : The index of the entity to get.
6352
+ * @return A non-owning pointer to the entity at the given index.
6353
+ */
6354
+ getEntityByIndex(entityIndex: number): Multiplayer.SpaceEntity;
6355
+ /**
6356
+ * @description Get an Avatar by its index. The returned pointer will be an entity that contains an AvatarSpaceComponent.
6357
+ * /// @param AvatarIndex size_t : The index of the avatar entity to get.
6358
+ * @return A non-owning pointer to the avatar entity with the given index.
6359
+ */
6360
+ getAvatarByIndex(avatarIndex: number): Multiplayer.SpaceEntity;
6361
+ /**
6362
+ * @description Get an Object by its index. The returned pointer will be an entity that does not contain an AvatarSpaceComponent.
6363
+ * /// @param ObjectIndex size_t : The index of the object entity to get.
6364
+ * @return A non-owning pointer to the object entity with the given index.
6365
+ */
6366
+ getObjectByIndex(objectIndex: number): Multiplayer.SpaceEntity;
6367
+ /**
6368
+ * @description Get the number of total entities in the system.
6369
+ * @return The total number of entities.
6370
+ */
6371
+ getNumEntities(): number;
6372
+ /**
6373
+ * @description Get the number of total Avatars in the system. Avatars are entities that contain AvatarSpaceComponents.
6374
+ * @return The total number of Avatar entities.
6375
+ */
6376
+ getNumAvatars(): number;
6377
+ /**
6378
+ * @description Get the number of total Objects in the system. Objects are entities that do not contain AvatarSpaceComponents.
6379
+ * @return The total number of object entities.
6380
+ */
6381
+ getNumObjects(): number;
6382
+ /**
6383
+ * @description Retrieves all entities that exist at the root level (do not have a parent entity).
6384
+ * @return A list of root entities containing non-owning pointers to entities.
6385
+ */
6386
+ getRootHierarchyEntities(): Common.List<Multiplayer.SpaceEntity>;
6387
+ /**
6388
+ * @description Adds an entity to a list of entities to be updated when ProcessPendingEntityOperations is called.
6389
+ * From a client perspective, ProcessPendingEntityOperations is normally called via the CSPFoundation::Tick method.
6390
+ * @param entity - A non-owning pointer to the entity to be marked.
6391
+ */
6392
+ markEntityForUpdate(entity: Multiplayer.SpaceEntity): void;
6393
+ /**
6394
+ * @description Applies any pending changes to entities that have been marked for update.
6395
+ */
6396
+ processPendingEntityOperations(): void;
6397
+ /**
6398
+ * @description Sets a callback to be executed when the script system is ready to run scripts.
6399
+ * @param callback - The callback to execute.
6400
+ */
6401
+ setScriptLeaderReadyCallback(callback: (arg1: boolean) => void): void;
6402
+ /**
6403
+ * @description Sets the script owner for the given entity to the current client
6404
+ * @param entity - A pointer to the entity
6405
+ */
6406
+ claimScriptOwnership(entity: Multiplayer.SpaceEntity): void;
6407
+ /**
6408
+ * @description Enable Leader Election feature.
6409
+ */
6410
+ enableLeaderElection(): void;
6411
+ /**
6412
+ * @description Disable Leader Election feature.
6413
+ */
6414
+ disableLeaderElection(): void;
6415
+ /**
6416
+ * @description Check if the Leader Election feature is enabled.
6417
+ * @return True if enabled, false otherwise.
6418
+ */
6419
+ isLeaderElectionEnabled(): boolean;
6420
+ /**
6421
+ * @description Debug helper to get the id of the currently elected script leader.
6422
+ * @return The id of the leader.
6423
+ */
6424
+ getLeaderId(): bigint;
6425
+ /**
6426
+ * @description Retrieve the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
6427
+ * @return True if enabled, false otherwise.
6428
+ */
6429
+ getEntityPatchRateLimitEnabled(): boolean;
6430
+ /**
6431
+ * @description Set the state of the patch rate limiter. If true, patches are limited for each individual entity to a fixed rate.
6432
+ * /// This feature is enabled by default and should only be disabled if you are encountering issues.
6433
+ * /// @param Enabled : sets if the feature should be enabled or not.
6434
+ * \rst
6435
+ * .. note::
6436
+ * If disabling this feature, more requests will be made to Magnopus Connected Services,
6437
+ * and consequently more patch merges may occur on the server as a result.
6438
+ * \endrst
6439
+ */
6440
+ setEntityPatchRateLimitEnabled(enabled: boolean): void;
6441
+ /**
6442
+ * @description Locks the entity mutex.
6443
+ */
6444
+ lockEntityUpdate(): void;
6445
+ /**
6446
+ * @description Unlocks the entity mutex.
6447
+ */
6448
+ unlockEntityUpdate(): void;
6449
+ /**
6450
+ * @description Queues a specific entity to update. Used in SpaceEntity to queue updates via passing the this pointer
6451
+ */
6452
+ queueEntityUpdate(entityToUpdate: Multiplayer.SpaceEntity): void;
6453
+ /**
6454
+ * @description "Resolves" the entity heirarchy, such that the entity is parented appropriately, and internal buffers are populated appropriately.
6455
+ * (Vague, need more understanding about what this does)
6456
+ */
6457
+ resolveEntityHierarchy(entity: Multiplayer.SpaceEntity): void;
6458
+ delete(): void;
6459
+ }
6460
+ }
6398
6461
  export declare namespace Multiplayer {
6399
6462
  /**
6400
6463
  @ingroup AnimatedModelSpaceComponent
@@ -9499,6 +9562,23 @@ export declare namespace Multiplayer {
9499
9562
  delete(): void;
9500
9563
  }
9501
9564
  }
9565
+ export declare namespace Systems {
9566
+ /**
9567
+ @ingroup Status System
9568
+ * @description Data class used to contain information when a Response is received from the Status Server
9569
+ */
9570
+ class ServicesDeploymentStatusResult extends Systems.ResultBase implements INativeResource {
9571
+ /** @internal */
9572
+ constructor(pointer: NativePointer);
9573
+ static fromResultBase(baseInstance: Systems.ResultBase): Systems.ServicesDeploymentStatusResult;
9574
+ /**
9575
+ * @description Will return services deployment status for the latest available deployment from the server
9576
+ * @return The latest services deployment status
9577
+ */
9578
+ getLatestServicesDeploymentStatus(): Systems.ServicesDeploymentStatus;
9579
+ delete(): void;
9580
+ }
9581
+ }
9502
9582
  export declare namespace Systems {
9503
9583
  /**
9504
9584
  * @description A result handler that is used to notify a user of an error.
@@ -11145,6 +11225,49 @@ export declare namespace Systems {
11145
11225
  deregisterSystemCallback(): void;
11146
11226
  }
11147
11227
  }
11228
+ export declare namespace Systems {
11229
+ /**
11230
+ @ingroup Application Settings System
11231
+ * @description Represents the result of a request for application settings.
11232
+ */
11233
+ class ApplicationSettingsResult extends Systems.ResultBase implements INativeResource {
11234
+ /** @internal */
11235
+ constructor(pointer: NativePointer);
11236
+ static fromResultBase(baseInstance: Systems.ResultBase): Systems.ApplicationSettingsResult;
11237
+ getApplicationSettings(): Systems.ApplicationSettings;
11238
+ delete(): void;
11239
+ }
11240
+ }
11241
+ export declare namespace Systems {
11242
+ /**
11243
+ @ingroup Application Settings System
11244
+ * @description Public facing system that allows interfacing with Magnopus Connected Services' application settings service.
11245
+ */
11246
+ class ApplicationSettingsSystem extends Systems.SystemBase {
11247
+ /** @internal */
11248
+ constructor(pointer: NativePointer);
11249
+ static fromSystemBase(baseInstance: Systems.SystemBase): Systems.ApplicationSettingsSystem;
11250
+ /**
11251
+ * @description Asynchronously retrieves application settings for a specific context.
11252
+ * @param applicationName - The name of the application for which settings are requested.
11253
+ * @param context - The specific context whose settings should be retrieved.
11254
+ * @param keys - Array of setting keys to retrieve. If not provided, all settings
11255
+ * for the context are returned.
11256
+ * @param callback - Callback when asynchronous task finishes.
11257
+ */
11258
+ getSettingsByContext(applicationName: string, context: string, keys: Common.Array<string> | null): Promise<Systems.ApplicationSettingsResult>;
11259
+ /**
11260
+ * @description Asynchronously retrieves application settings for a specific context without requiring authentication.
11261
+ * @param tenant - The tenant identifier under which the application and settings are scoped.
11262
+ * @param applicationName - The name of the application for which settings are requested.
11263
+ * @param context - The specific context whose settings should be retrieved.
11264
+ * @param keys - Array of setting keys to retrieve. If not provided, all settings
11265
+ * for the context are returned.
11266
+ * @param callback - Callback when asynchronous task finishes.
11267
+ */
11268
+ getSettingsByContextAnonymous(tenant: string, applicationName: string, context: string, keys: Common.Array<string> | null): Promise<Systems.ApplicationSettingsResult>;
11269
+ }
11270
+ }
11148
11271
  export declare namespace Systems {
11149
11272
  /**
11150
11273
  @ingroup Settings System
@@ -11522,14 +11645,18 @@ export declare namespace Systems {
11522
11645
  static fromSystemBase(baseInstance: Systems.SystemBase): Systems.SpaceSystem;
11523
11646
  /**
11524
11647
  * @description Enter a space if you have permission to, based on the Space settings.
11525
- * This includes setting scopes (and toggling event listening in order to set the scope).
11526
- * It also retrieves all entities in the space. Ensure Connect is called prior to this.
11648
+ * Registers the user as in the space on the backend service, and calls csp::common::IRealtimeEngine::FetchAllEntitiesAndPopulateBuffers.
11649
+ * The initial load behaviour will differ based on the concrete IRealtimeEngine passed to this function.
11527
11650
  * If user does not have permission to discover or enter the space, callback will be called with EResultCode::Failed and
11528
11651
  * ERequestFailureReason::UserSpaceAccessDenied
11529
11652
  * @param space - Space to enter into
11653
+ * @param realtimeEngine - RealtimeEngine to load the space with. This object belongs to the caller, and does not
11654
+ * transfer ownership. Once the space is loaded, the caller should be sure to maintain the lifetime of the RealtimeEngine so long
11655
+ * as the space is active. Once the caller has called csp::systems::SpaceSystem::ExitSpace and received the callback, then they are
11656
+ * free to release the memory.
11530
11657
  * @param callback - Callback when asynchronous task finishes
11531
11658
  */
11532
- enterSpace(spaceId: string): Promise<Systems.NullResult>;
11659
+ enterSpace(spaceId: string, realtimeEngine: Common.IRealtimeEngine): Promise<Systems.SpaceResult>;
11533
11660
  /**
11534
11661
  * @description Exits the space and deregisters from the space scope.
11535
11662
  */
@@ -12343,6 +12470,8 @@ export declare namespace Common {
12343
12470
  static ofcsp_systems_AssetCollection(): Array<Systems.AssetCollection>;
12344
12471
  static ofcsp_systems_Asset(): Array<Systems.Asset>;
12345
12472
  static ofcsp_systems_Sequence(): Array<Systems.Sequence>;
12473
+ static ofcsp_systems_VersionMetadata(): Array<Systems.VersionMetadata>;
12474
+ static ofcsp_systems_ServiceStatus(): Array<Systems.ServiceStatus>;
12346
12475
  static ofString(): Array<string>;
12347
12476
  static ofcsp_systems_EAssetPlatform(): Array<Systems.EAssetPlatform>;
12348
12477
  static ofcsp_systems_EAssetCollectionType(): Array<Systems.EAssetCollectionType>;
@@ -12386,6 +12515,8 @@ export declare namespace Common {
12386
12515
  static ofcsp_systems_AssetCollection_number(size: number): Array<Systems.AssetCollection>;
12387
12516
  static ofcsp_systems_Asset_number(size: number): Array<Systems.Asset>;
12388
12517
  static ofcsp_systems_Sequence_number(size: number): Array<Systems.Sequence>;
12518
+ static ofcsp_systems_VersionMetadata_number(size: number): Array<Systems.VersionMetadata>;
12519
+ static ofcsp_systems_ServiceStatus_number(size: number): Array<Systems.ServiceStatus>;
12389
12520
  static ofString_number(size: number): Array<string>;
12390
12521
  static ofcsp_systems_EAssetPlatform_number(size: number): Array<Systems.EAssetPlatform>;
12391
12522
  static ofcsp_systems_EAssetCollectionType_number(size: number): Array<Systems.EAssetCollectionType>;