game / pragma.party / PartyService /
PartyService #
internal class PartyService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, instanceCount: Int = pragmaNode.getDistributedServiceInstanceCount(PartyService::class), inviteCodeGenerator: InviteCodeGenerator = InviteCodeGenerator(instanceId, instanceCount), partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), multiplayerClient: MultiplayerClient = MultiplayerClient(), alertingMutexFactory: AlertingMutexFactory = AlertingMutexFactory(), partyManager: PartyManager = PartyManager(), partyProxy: PartyProxy = PartyProxy(), gameServerCompatibility: GameServerCompatibility = GameServerCompatibility(), timeProxy: TimeProxy = TimeProxy()) : DistributedService, ConfigHandler<PartyConfig>
The PartyService is a game loop service where players may join up with each other, configure their game settings, and then enter matchmaking.
Updates to a party’s state are automatically communicated to all members of a party. The player who caused the state change (e.g. by creating the party, or updating their ready state) will receive a direct response containing the result of their action, and all the other players will receive a PartyRpc.PartyDetailsV1Notification containing updated party details.
The PartyService interacts with Inventory data. Whenever a player is added to a party, their latest player data is retrieved from the InventoryService and cached within the party. This cached value is mutable and may be updated by plugin code to react to changes in player data.
Constructors #
PartyService | fun PartyService(pragmaNode: PragmaNode, instanceId: <ERROR CLASS>, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, instanceCount: Int = pragmaNode.getDistributedServiceInstanceCount(PartyService::class), inviteCodeGenerator: InviteCodeGenerator = InviteCodeGenerator(instanceId, instanceCount), partyClient: PartyClient = PartyClient(), gameInstanceClient: GameInstanceClient = GameInstanceClient(), matchmakingClient: MatchmakingClient = MatchmakingClient(), multiplayerClient: MultiplayerClient = MultiplayerClient(), alertingMutexFactory: AlertingMutexFactory = AlertingMutexFactory(), partyManager: PartyManager = PartyManager(), partyProxy: PartyProxy = PartyProxy(), gameServerCompatibility: GameServerCompatibility = GameServerCompatibility(), timeProxy: TimeProxy = TimeProxy()) |
Functions #
Name | Summary |
---|---|
Assigns a target player as a leader of the party. | |
Cancels a party invite. | |
Creates a new party. | |
Development override feature for game server versions. Manually overrides a party’s game server version, and disables any future game server version calculations from occurring within that party. | |
Enters a party into matchmaking. | |
Queries cached party data by party id. | |
Queries cached party data by party id. | |
Joins a party with an invite code. | |
Joins a party with a party ID. | |
Kicks a target player from the party. | |
Leaves the current party. | |
Leaves the current party. | |
Notification handler for player disconnect. Removes the player from the party they were in. | |
Responds to a party invite. | |
Service endpoint used to return players to their party after they finish a game. Broadcasts new party details to all players upon success. | |
Service endpoint used to return players to their party after they leave matchmaking. Broadcasts new party details to all players upon success. | |
Sends a party invite. | |
Sets a player’s ping latency map for different game server zones. | |
Sets a player’s preferred game server zones. | |
Sets a player’s ready state. Invokes PartyPlugin.canChangeReady before allowing the ready state update to apply. | |
Syncs party state from the platform to the client. | |
Updates a player’s selections details. Invokes PartyPlugin.updatePlayer to process updates. | |
Updates the party’s selections. Invokes PartyPlugin.updateParty to process updates. | |
Backend method to update the party’s selections. Invokes PartyPlugin.handleBackendUpdateRequest to process updates. |