game / pragma.multiplayer / MultiplayerService /
MultiplayerService #
internal class MultiplayerService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), cache: MultiplayerCache = MultiplayerCache()) : DistributedService, ConfigHandler<MultiplayerConfig>
The MultiplayerService handles the routing between players and their various multiplayer states.
Game flow services, like the PartyService, have their endpoints routed based on their entity id (e.g. PartyId). Player clients may lose track of their entity ids due to disconnecting or desyncing, making it difficult to rely on the client as a source of truth.
This service is responsible for caching various multiplayer states from the game flow services, so it can provide a consistent routing mechanism and act as the source of truth for the client.
Constructors #
MultiplayerService | fun MultiplayerService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), cache: MultiplayerCache = MultiplayerCache()) |
Functions #
Name | Summary |
---|---|
Gets the cached multiplayer data for a given player. | |
Queries cached multiplayer data by player id. | |
Retrieves latest game instance state. Used to synchronize the client to the platform. | |
Retrieves latest party state. Used to synchronize the client to the platform. | |
Process the updates provided from the GameInstanceService. | |
Process the updates provided from the PartyService. | |
Synchronizes latest game instance state. Used to resynchronize the client to the platform. | |
Retrieves latest party state. Used to synchronize the client to the platform. |