game-common / pragma.party / PartyPlugin /

PartyPlugin #

interface PartyPlugin

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

Functions #

NameSummary

buildExtBroadcastParty

open suspend fun buildExtBroadcastParty(party: Party.Party): ExtBroadcastParty

Called when broadcasting a change to the party. Use to build any ext data that should be shared about the party.

buildExtBroadcastPlayer

open suspend fun buildExtBroadcastPlayer(party: Party.Party, player: Party.PartyPlayer): ExtBroadcastPlayer

Called when broadcasting a change to the party member. Use to build any ext data that should be shared about a player.

buildExtMatchmakingParty

open suspend fun buildExtMatchmakingParty(party: 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.Party, player: Party.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.

buildExtPrivatePlayer

open suspend fun buildExtPrivatePlayer(party: Party.Party, player: Party.PartyPlayer): ExtPrivatePlayer

Called when broadcasting a change to the party member. Use to build any private ext data that should only be sent to the player.

buildMatchmakingKey

open suspend fun buildMatchmakingKey(party: 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

open suspend fun canChangeReady(player: Party.PartyPlayer, newReadyState: Boolean, party: 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.

handleBackendUpdateRequest

open suspend fun handleBackendUpdateRequest(party: Party.Party, requestExt: ExtBackendUpdatePartyRequest)

Called when receiving a backend request to update a party.

handlePlayerCancelInviteRequest

open suspend fun handlePlayerCancelInviteRequest(party: Party.Party, requestingPlayer: Party.PartyPlayer, invite: Party.PartyInvite)

Called when receiving a player request to cancel a party invite. Use to determine whether the player should be allowed to cancel the party invite by calling Party.Party.cancelInvite.

handlePlayerSendInviteRequest

open suspend fun handlePlayerSendInviteRequest(party: Party.Party, requestingPlayer: Party.PartyPlayer, inviteePlayerId: <ERROR CLASS>)

Called when receiving a player request to send a party invite. Use to determine whether the player should be allowed to send the party invite by calling Party.Party.sendInvite.

initializeParty

open suspend fun initializeParty(party: 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

open suspend fun onAddPlayer(requestExt: ExtPlayerJoinRequest, playerToAdd: Party.PartyPlayer, party: 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

open suspend fun onRemovePlayer(party: Party.Party, removedPlayer: Party.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.

returnFromGameInstance

open suspend fun returnFromGameInstance(party: Party.Party, returningPlayers: List<Party.PartyPlayer>, config: PartyConfig)

DEPRECATED in version 0.4.0 REMOVAL by 0.6.0.

returnFromMatchmaking

open suspend fun returnFromMatchmaking(party: Party.Party, returningPlayers: List<Party.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

open suspend fun updateParty(requestingPlayer: Party.PartyPlayer, requestExt: ExtUpdatePartyRequest, party: 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

open suspend fun updatePlayer(playerToUpdate: Party.PartyPlayer, requestExt: ExtUpdatePartyPlayerRequest, party: 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.