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(), notificationClient: PartyNotificationClient = PartyNotificationClient(), timeProxy: TimeProxy = TimeProxy()) : DistributedService, RoutingIdGenerator, ConfigHandler<PartyConfig>

The PartyService is a game loop service where players may join up with each other, configure their game settings, and enter matchmaking together.

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(), notificationClient: PartyNotificationClient = PartyNotificationClient(), timeProxy: TimeProxy = TimeProxy())

Functions #

NameSummary

assignPartyLeaderV1

suspend fun assignPartyLeaderV1(session: PlayerSession, request: PartyRpc.AssignPartyLeaderV1Request): PartyRpc.AssignPartyLeaderV1Response

Assigns party leader to another player.

cancelInviteV1

suspend fun cancelInviteV1(session: PlayerSession, request: PartyRpc.CancelInviteV1Request): PartyRpc.CancelInviteV1Response

Cancels a party invite, invoking PartyPlugin.handlePlayerCancelInviteRequest to process the cancel request.

createV1

suspend fun createV1(session: PlayerSession, request: PartyRpc.CreateV1Request): PartyRpc.CreateV1Response

Creates a new party, invoking PartyPlugin.initializeParty on the party and PartyPlugin.onAddPlayer for customization of party and player.

developmentOverrideGameServerVersionV1

suspend fun developmentOverrideGameServerVersionV1(session: PlayerSession, request: PartyRpc.DevelopmentOverrideGameServerVersionV1Request): PartyRpc.DevelopmentOverrideGameServerVersionV1Response

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.

enterMatchmakingV1

suspend fun enterMatchmakingV1(session: PlayerSession, request: PartyRpc.EnterMatchmakingV1Request): PartyRpc.EnterMatchmakingV1Response

Enters a party into matchmaking.

getCacheInfoOperatorV1

suspend fun getCacheInfoOperatorV1(session: OperatorSession, request: PartyRpc.GetCacheInfoOperatorV1Request): PartyRpc.GetCacheInfoOperatorV1Response

Queries cached party data by party id.

getCacheInfoServiceV1

suspend fun getCacheInfoServiceV1(session: ServiceSession, request: PartyRpc.GetCacheInfoServiceV1Request): PartyRpc.GetCacheInfoServiceV1Response

Queries cached party data by party id.

joinWithInviteCodeV1

suspend fun joinWithInviteCodeV1(session: PlayerSession, request: PartyRpc.JoinWithInviteCodeV1Request): PartyRpc.JoinWithInviteCodeV1Response

Joins a party using an invite code. PartyPlugin.onAddPlayer is called to customize the new party player.

joinWithPartyIdV1

suspend fun joinWithPartyIdV1(session: PlayerSession, request: PartyRpc.JoinWithPartyIdV1Request): PartyRpc.JoinWithPartyIdV1Response

Joins a party using a party id. PartyPlugin.onAddPlayer is called to customize the new party player.

kickV1

suspend fun kickV1(session: PlayerSession, request: PartyRpc.KickV1Request): PartyRpc.KickV1Response

Kicks a player from the party. Only usable by party leaders. Invokes PartyPlugin.onRemovePlayer for kicked player.

leaveServiceV1

suspend fun leaveServiceV1(session: ServiceSession, request: PartyRpc.LeaveServiceV1Request): PartyRpc.LeaveServiceV1Response

Removes a player from a party, invoking PartyPlugin.onRemovePlayer.

leaveV1

suspend fun leaveV1(session: PlayerSession, request: PartyRpc.LeaveV1Request): PartyRpc.LeaveV1Response

Leaves the party. Invokes PartyPlugin.onRemovePlayer for the removed player.

onSessionTerminated

open suspend override fun onSessionTerminated(notification: PlayerSessionRpc.SessionTerminatedForServiceV1Notification)

Notification handler for player disconnect. Removes the player from the party they were in.

respondToInviteV1

suspend fun respondToInviteV1(session: PlayerSession, request: PartyRpc.RespondToInviteV1Request): PartyRpc.RespondToInviteV1Response

Responds to a party invite. If the invite is accepted, PartyPlugin.onAddPlayer is called to customize the new party player.

returnFromMatchmakingV1

suspend fun returnFromMatchmakingV1(session: ServiceSession, request: PartyRpc.ReturnFromMatchmakingV1Request): PartyRpc.ReturnFromMatchmakingV1Response

Called by the matchmaking service to invoke PartyPlugin.returnFromMatchmaking to allow for party state updates in response to no longer being in matchmaking.

sendInviteV1

suspend fun sendInviteV1(session: PlayerSession, request: PartyRpc.SendInviteV1Request): PartyRpc.SendInviteV1Response

Sends a party invite.

setGameServerZoneToPingV1

suspend fun setGameServerZoneToPingV1(session: PlayerSession, request: PartyRpc.SetGameServerZoneToPingV1Request): PartyRpc.SetGameServerZoneToPingV1Response

Sets a player’s ping latency map for different game server zones.

setPreferredGameServerZonesV1

suspend fun setPreferredGameServerZonesV1(session: PlayerSession, request: PartyRpc.SetPreferredGameServerZonesV1Request): PartyRpc.SetPreferredGameServerZonesV1Response

Sets a player’s preferred game server zones.

setReadyStateV1

suspend fun setReadyStateV1(session: PlayerSession, request: PartyRpc.SetReadyStateV1Request): PartyRpc.SetReadyStateV1Response

Sets a player’s ready state, calling PartyPlugin.canChangeReady before allowing the ready state update to apply.

syncServiceV1

suspend fun syncServiceV1(session: ServiceSession, request: PartyRpc.SyncServiceV1Request): PartyRpc.SyncServiceV1Response

Syncs party state from the platform to the client.

updatePartyPlayerV1

suspend fun updatePartyPlayerV1(session: PlayerSession, request: PartyRpc.UpdatePartyPlayerV1Request): PartyRpc.UpdatePartyPlayerV1Response

Updates a party, scoped to yourself. Invokes PartyPlugin.updatePlayer to process updates.

updatePartyV1

suspend fun updatePartyV1(session: PlayerSession, request: PartyRpc.UpdatePartyV1Request): PartyRpc.UpdatePartyV1Response

Updates a party. Invokes PartyPlugin.updateParty to process updates.

updateServiceV1

suspend fun updateServiceV1(session: ServiceSession, request: PartyRpc.UpdateServiceV1Request): PartyRpc.UpdateServiceV1Response

Update a party by invoking PartyPlugin.handleBackendUpdateRequest.