game / pragma.party / PartyService /
PartyService #
internal class PartyService(pragmaNode: PragmaNode, instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, instanceCount: Int = pragmaNode.getDistributedServiceInstanceCount(PartyService::class), inviteCodeGenerator: InviteCodeGenerator = InviteCodeGenerator(instanceId, instanceCount), partyClient: PartyClient = PartyClient(), inventoryClient: InventoryClient = InventoryClient(), sessionClient: SessionClient = SessionClient(), partyInventoryClient: PartyInventoryClient = PartyInventoryClient(inventoryClient), matchmakingClient: MatchmakingClient = MatchmakingClient(), mutexFactory: MutexFactory = MutexFactory(), createPartyCommand: CreatePartyCommand = CreatePartyCommand(
routingUtils,
instanceId,
instanceCount,
partyInventoryClient,
inviteCodeGenerator,
partyClient,
), setReadyStateCommand: SetReadyStateCommand = SetReadyStateCommand(), startMatchmakingCommand: StartMatchmakingCommand = StartMatchmakingCommand(matchmakingClient, sessionClient), removePlayerCommand: RemovePlayerCommand = RemovePlayerCommand(sessionClient), invitePlayerCommand: InvitePlayerCommand = InvitePlayerCommand(
routingUtils, instanceId, instanceCount, partyInventoryClient, partyClient
), updatePartyCommand: UpdatePartyCommand = UpdatePartyCommand(), setPreferredGameServerZonesCommand: SetPreferredGameServerZonesCommand = SetPreferredGameServerZonesCommand(), setGameServerZoneToPingCommand: SetGameServerZoneToPingCommand = SetGameServerZoneToPingCommand(), partyProxy: PartyProxy = PartyProxyImpl(sessionClient)) : DistributedService, ConfigHandler<PartyConfig>
Party service is a game loop service where players may join up with each other, configure their match settings, and then enter matchmaking.
Updates to party state are automatically communicated to all members of a party. The player who caused the state change (eg. by joining the party, or updating their ready state) will receive a direct response containing the result of their action, and all of the other players will receive a PartyRpc.PartyDetailsV1Notification containing updated details.
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 PartyService. 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: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, instanceCount: Int = pragmaNode.getDistributedServiceInstanceCount(PartyService::class), inviteCodeGenerator: InviteCodeGenerator = InviteCodeGenerator(instanceId, instanceCount), partyClient: PartyClient = PartyClient(), inventoryClient: InventoryClient = InventoryClient(), sessionClient: SessionClient = SessionClient(), partyInventoryClient: PartyInventoryClient = PartyInventoryClient(inventoryClient), matchmakingClient: MatchmakingClient = MatchmakingClient(), mutexFactory: MutexFactory = MutexFactory(), createPartyCommand: CreatePartyCommand = CreatePartyCommand(
routingUtils,
instanceId,
instanceCount,
partyInventoryClient,
inviteCodeGenerator,
partyClient,
), setReadyStateCommand: SetReadyStateCommand = SetReadyStateCommand(), startMatchmakingCommand: StartMatchmakingCommand = StartMatchmakingCommand(matchmakingClient, sessionClient), removePlayerCommand: RemovePlayerCommand = RemovePlayerCommand(sessionClient), invitePlayerCommand: InvitePlayerCommand = InvitePlayerCommand(
routingUtils, instanceId, instanceCount, partyInventoryClient, partyClient
), updatePartyCommand: UpdatePartyCommand = UpdatePartyCommand(), setPreferredGameServerZonesCommand: SetPreferredGameServerZonesCommand = SetPreferredGameServerZonesCommand(), setGameServerZoneToPingCommand: SetGameServerZoneToPingCommand = SetGameServerZoneToPingCommand(), partyProxy: PartyProxy = PartyProxyImpl(sessionClient)) |
Functions #
Name | Summary |
---|---|
Assigns a target player as a leader of the party. | |
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 plugin calculations from occurring within that party. | |
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. | |
Responds to a party invite. | |
Service endpoint used to return players to their party after they leave matchmaking. Broadcasts new party details to all players upon success. | |
Service endpoint used to return players to their party after they finish a match. Broadcasts new party details to all players upon success. | |
Sends a party invite. | |
Allows a player client to set their quality of service map for different game server zones. | |
Allows a player to declare their preferred game server zones. | |
Sets ready state. Invokes PartyPlugin.canChangeReady before allowing the ready state update to apply. | |
Allows a party leader to start matchmaking. | |
Updates party’s selections. Invokes PartyPlugin.updateParty to process updates. | |
Updates player’s selections details. Invokes PartyPlugin.updatePlayer to process updates. |