game-common / pragma.party / PartyPlugin /

PartyPlugin #

interface PartyPlugin

The PartyPlugin allows for custom definition of logic within the PartyService.

Functions #

NameSummary

buildExtMatchmakingParty

open suspend fun buildExtMatchmakingParty(party: Party): ExtMatchmakingParty

Called when the party is attempting to enter matchmaking. Use to build any ext data the matchmaking system will need to know about the party.

buildExtMatchmakingPlayer

open suspend fun buildExtMatchmakingPlayer(party: Party, player: PartyPlayer): ExtMatchmakingPlayer

Called for each player within a party when the party is attempting to enter matchmaking. Use to build any ext data the matchmaking system will need to know about each player.

buildMatchmakingKey

abstract suspend fun buildMatchmakingKey(party: Party): ExtMatchmakingKey

Called when the party is attempting to enter matchmaking. Use to build the matchmaking key they will use to enter matchmaking.

canChangeReady

abstract suspend fun canChangeReady(player: PartyPlayer, newReadyState: Boolean, party: Party, partyConfig: PartyConfig): Boolean

Called when receiving a change ready state request. Use to determine whether a player can change their ready state. Return true to allow Pragma to change their ready state to the new ready state, or return false to block the change.

initializeParty

abstract suspend fun initializeParty(party: Party, requestExt: ExtCreateRequest, partyConfig: PartyConfig)

Called when a new party is created before any players have been added. Use to initialize any party state. Perform any state mutations directly on the party object.

onAddPlayer

abstract suspend fun onAddPlayer(requestExt: ExtPlayerJoinRequest, playerToAdd: PartyPlayer, party: Party, partyConfig: PartyConfig)

Called before the player has been added to the party. Use to prepare the new player to be added to the party. Perform any state mutations directly on the player or party objects. The player will be added to the party by the platform after this call.

onRemovePlayer

abstract suspend fun onRemovePlayer(party: Party, removedPlayer: PartyPlayer, removalReason: PartyRpc.RemovalReason)

Called after a player has been removed from the party. Use to perform any necessary updates to the party state. Perform any state mutations directly on the party object. The provided player will have already been removed from the party.

returnFromMatch

abstract suspend fun returnFromMatch(party: Party, returningPlayers: List<PartyPlayer>, config: PartyConfig)

Called when players are returning from a match. Use to perform any necessary updates to the player or party state. The returning players may be a subset of all the players in the party.

returnFromMatchmaking

abstract suspend fun returnFromMatchmaking(party: Party, returningPlayers: List<PartyPlayer>, config: PartyConfig)

Called when players are returning from matchmaking. Use to perform any necessary updates to the player or party state. The returning players may be a subset of all the players in the party.

updateParty

abstract suspend fun updateParty(requestingPlayer: PartyPlayer, requestExt: ExtUpdatePartySelectionsRequest, party: Party, partyConfig: PartyConfig)

Called when receiving an update party selections request. Use to perform any necessary updates to the party state. Perform any state mutations directly on the party object.

updatePlayer

abstract suspend fun updatePlayer(playerToUpdate: PartyPlayer, requestExt: ExtUpdatePlayerSelectionsRequest, party: Party, partyConfig: PartyConfig)

Called when receiving an update player selections request. Use to perform any necessary updates to the player or party state. Perform any state mutations directly on the player or party objects.