game-common / pragma.gameinstance / GameInstancePlugin /

GameInstancePlugin #

interface GameInstancePlugin

GameInstancePlugin is used to define custom interactions throughout the lifecycle of a game instance.

Functions #

NameSummary

buildExtAddedToGame

open suspend fun buildExtAddedToGame(gameInstanceSnapshot: GameInstance.GameInstance, player: GameInstance.GamePlayer): ExtAddedToGame

Called to prepare any custom data to send to the game client when a player joins a game instance.

buildExtGameServerPlayer

open suspend fun buildExtGameServerPlayer(gameInstanceSnapshot: GameInstance.GameInstance, player: GameInstance.GamePlayer): ExtGameServerPlayer

Called to prepare any custom data about a player in a game instance to send to the game server when a player is joining the game instance.

buildExtGameStart

open suspend fun buildExtGameStart(gameInstanceSnapshot: GameInstance.GameInstance): ExtGameStart

Called to prepare any custom data about the game instance to send to the game server when the game server is allocated.

handleBackendCreateByMatchmakingRequest

open suspend fun handleBackendCreateByMatchmakingRequest(gameInstanceSnapshot: GameInstance.GameInstance)

Called when a game instance is being created out of matchmaking. The matched players will already be added to the game instance.

handleBackendUpdateRequest

open suspend fun handleBackendUpdateRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestExt: ExtBackendUpdateRequest)

Called when receiving a backend request to update a game instance.

handlePlayerUpdateRequest

open suspend fun handlePlayerUpdateRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestingPlayer: GameInstance.GamePlayer, requestExt: ExtPlayerUpdateRequest)

Called when receiving a player request to update a game instance.

onEndGame

open suspend fun onEndGame(gameInstanceSnapshot: GameInstance.GameInstance, playerGameResults: List<PlayerGameResult>, requestExt: ExtEndGameRequest)

Called when receiving a game server request to end the game instance.

onRemovePlayers

open suspend fun onRemovePlayers(gameInstanceSnapshot: GameInstance.GameInstance, playersToRemove: List<PlayerToRemove>, requestExt: ExtRemovePlayersRequest): Map<<ERROR CLASS>, ExtRemovedFromGame>

Called when players are removed from the game to prepare any custom data to send to the removed players.