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 game client when a player joins a game instance.

buildExtGameServerPlayer

open suspend fun buildExtGameServerPlayer(gameInstance: 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(gameInstance: 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(gameInstance: 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(gameInstance: GameInstance.GameInstance, requestExt: ExtBackendUpdateRequest)

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

handlePlayerUpdateRequest

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

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

onEndGame

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

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

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.