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 is intended to handle the routing mismatch between players and their various multiplayer states.
Underlying systems like PartyService have their endpoints routed based on their entity id (in this case PartyId). Player clients may lose track of their entity ids due to disconnect or desyncing, making it difficult to rely on the client as a source of truth.
This service is responsible for caching and receiving cache updates on various multiplayer states, 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 |
---|---|
Queries cached multiplayer data by player id. | |
Gets the cached routing values for a given player. | |
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. | |
Attempts to leave any party the player currently belongs to, or does nothing if the player is not a member of any party. | |
Removes a cached received party invite for a given player. | |
Removes the cached party id for a given player. | |
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. | |
Adds or modifies a cached received party invite for a given player. | |
Adds or modifies the cached routing value for a given player. |