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(gameInstance: GameInstance.GameInstance, player: GameInstance.GamePlayer): ExtAddedToGame

Called to prepare any custom data to send to the player client when they are joining a game.

buildExtGameServerPlayer

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

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

buildExtGameStart

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

Called to prepare any custom data to provide to the game server when the game server has been allocated to a game.

onEndGame

open suspend fun onEndGame(gameInstance: GameInstance.GameInstance, playerGameResults: List<PlayerGameResult>, requestExt: ExtEndGameRequest): Map<<ERROR CLASS>, ExtGameEnded>

Called when the game is ending to prepare any custom data to send to players from the game.

onRemovePlayers

open suspend fun onRemovePlayers(gameInstance: 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.

updateGameInstance

open suspend fun updateGameInstance(gameInstance: GameInstance.GameInstance, requestExt: ExtUpdateGameInstanceRequest)

Called to perform updates to a running game instance.