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

DEPRECATED in version 0.4.0, removal by 0.6.0. Override handleBackendAddPlayersRequest and use the GameInstance.GamePlayer.dataStore instead.

buildExtGameServerPlayer

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

Called to prepare custom data about a player in a game instance to send to the game server.

buildExtGameStart

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

Called to prepare custom data about the game instance to send to the game server.

handleBackendAddPlayersByMatchmakingRequest

open suspend fun handleBackendAddPlayersByMatchmakingRequest(gameInstanceSnapshot: GameInstance.GameInstance, addedPlayers: List<GameInstance.GamePlayer>)

DEPRECATED in version 0.5.0, removal by 0.6.0. Use handleBackendAddPlayersRequest instead.

handleBackendAddPlayersRequest

open suspend fun handleBackendAddPlayersRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestExt: ExtBackendAddPlayersRequest, playersToAdd: List<PlayerToAdd>)

Called when receiving a backend request to add players to a game instance.

handleBackendCreateByMatchmakingRequest

open suspend fun handleBackendCreateByMatchmakingRequest(gameInstanceSnapshot: GameInstance.GameInstance)

DEPRECATED in version 0.5.0, removal by 0.6.0. Use handleBackendCreateRequest instead.

handleBackendCreateRequest

open suspend fun handleBackendCreateRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestExt: ExtBackendCreateRequest, playersToAdd: List<PlayerToAdd>)

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

handleBackendRemovePlayersRequest

open suspend fun handleBackendRemovePlayersRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestExt: ExtBackendRemovePlayersRequest, playersToRemove: Map<<ERROR CLASS>, ExtBackendRemovePlayer>)

Called when receiving a backend request to remove players from a game instance.

handleBackendUpdateRequest

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

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

handlePlayerCreateRequest

open suspend fun handlePlayerCreateRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestingPlayerId: <ERROR CLASS>, requestExt: ExtPlayerCreateRequest)

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

handlePlayerJoinRequest

open suspend fun handlePlayerJoinRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestingPlayerId: <ERROR CLASS>, requestExt: ExtPlayerJoinGameInstanceRequest)

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

handlePlayerLeaveRequest

open suspend fun handlePlayerLeaveRequest(gameInstanceSnapshot: GameInstance.GameInstance, requestingPlayer: GameInstance.GamePlayer, requestExt: ExtPlayerLeaveRequest)

Called when receiving a player request to leave 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.

onGameInstanceExpired

open suspend fun onGameInstanceExpired(readOnlyGameInstance: GameInstance.ReadOnlyGameInstance)

Called when a game instance expires.

onGameServerAllocationFailed

open suspend fun onGameServerAllocationFailed(gameInstanceSnapshot: GameInstance.GameInstance)

Called when game server allocation fails for a game instance.

onGameServerDisconnected

open suspend fun onGameServerDisconnected(readOnlyGameInstance: GameInstance.ReadOnlyGameInstance)

Called when a game server disconnects.

onGameServerFailedToConnectInitialPlayers

open suspend fun onGameServerFailedToConnectInitialPlayers(readOnlyGameInstance: GameInstance.ReadOnlyGameInstance, initialPlayers: List<GameInstance.ReadOnlyGamePlayer>)

Called when a game server fails to connect the initial players.

onGameServerFailedToConnectMorePlayers

open suspend fun onGameServerFailedToConnectMorePlayers(readOnlyGameInstance: GameInstance.ReadOnlyGameInstance, morePlayers: List<GameInstance.ReadOnlyGamePlayer>)

Called when a game server fails to connect more players.