game / pragma.gameinstance / GameInstanceService / createGameInstanceServiceV1 /

createGameInstanceServiceV1 #

suspend fun createGameInstanceServiceV1(session: ServiceSession, request: GameInstanceRpc.CreateGameInstanceServiceV1Request): GameInstanceRpc.CreateGameInstanceServiceV1Response

Create a new game instance.

This endpoint creates a game instance object representing the state of the game to be tracked by this service. The game instance object keeps track of the currently connected players to the game.

If a game server is requested, a timeout of length GameInstanceServiceConfig.connectPlayersTimeoutMillis milliseconds is set to wait for a game server to call ConnectPlayers for this game instance. If a ConnectPlayers call is not received within the timeout, the game instance is canceled and all players are released back to their party.

If the GameInstancePlugin.handleBackendCreateRequest call throws an ApplicationErrorException, the game instance will not be created.

Plugins

  • GameInstancePlugin.handleBackendCreateRequest - Add requested players and optionally allocate a game server.