game-common / pragma.gameinstance / GameInstanceApi /

GameInstanceApi #

class GameInstanceApi(service: Service)

The backend entrypoint for sending service RPCs to the GameInstanceService.

Constructors #

GameInstanceApi

fun GameInstanceApi(service: Service)

Functions #

NameSummary

addPlayers

suspend fun addPlayers(gameInstanceId: <ERROR CLASS>, requestExt: ExtBackendAddPlayersRequest, playersToAdd: Map<<ERROR CLASS>, ExtBackendAddPlayer>): PragmaResult<Unit, PragmaFailure>

Request to add players to a GameInstance. Triggers the GameInstancePlugin.handleBackendAddPlayersRequest plugin method.

create

suspend fun create(requestExt: ExtBackendCreateRequest, playersToAdd: Map<<ERROR CLASS>, ExtBackendAddPlayer>, gameServerVersion: <ERROR CLASS>, gameServerZone: <ERROR CLASS>): PragmaResult<<ERROR CLASS>, PragmaFailure>

Request to create a game instance. Triggers the GameInstancePlugin.handleBackendCreateRequest plugin method.

get

suspend fun get(gameInstanceId: <ERROR CLASS>): PragmaResult<GameInstanceCommon.GameInstanceSummary, PragmaFailure>

Request to get a game instance summary.

getForPlayer

suspend fun getForPlayer(playerId: <ERROR CLASS>): PragmaResult<GameInstanceCommon.GameInstanceSummary?, PragmaFailure>

Request to get the game instance that a player is in.

getIdForPlayer

suspend fun getIdForPlayer(playerId: <ERROR CLASS>): PragmaResult<<ERROR CLASS>?, PragmaFailure>

Request to get the game instance id of the game instance that a player is in.

removePlayers

suspend fun removePlayers(gameInstanceId: <ERROR CLASS>, requestExt: ExtBackendRemovePlayersRequest, playersToRemove: Map<<ERROR CLASS>, ExtBackendRemovePlayer>): PragmaResult<Unit, PragmaFailure>

Request to remove players from a GameInstance. Triggers the GameInstancePlugin.handleBackendRemovePlayersRequest plugin method.

update

suspend fun update(gameInstanceId: <ERROR CLASS>, requestExt: ExtBackendUpdateRequest): PragmaResult<Unit, PragmaFailure>

Request to update a GameInstance. Triggers the GameInstancePlugin.handleBackendUpdateRequest plugin method.