game / pragma.gameinstance / GameInstanceService / connectPlayersV1 /

connectPlayersV1 #

suspend fun connectPlayersV1(session: PartnerSession, request: GameInstanceRpc.ConnectPlayersV1Request): GameInstanceRpc.ConnectPlayersV1Response

Signals a game is ready to be joined by players. Invoked by the game server.

Each player receives a GameInstanceRpc.GameInstanceDetailsV1Notification containing the host connection details.

After notifying each player, this endpoint will optionally kick off a background task for keep alive heartbeats that will remove players from the game instance if a GameInstanceService.gameKeepAliveV1 request is not received in GameInstanceServiceConfig.keepAliveIntervalMillis after GameInstanceServiceConfig.keepAliveMissesLimit missed requests, and only if GameInstanceServiceConfig.enableKeepAlive is enabled.

If additional players have been added to the game instance since the first GameStart data was provided, those players will be sent in batches to the game server after GameInstancePlugin.buildExtGameServerPlayer is invoked for each of them.

Plugins

  • GameInstancePlugin.buildExtGameServerPlayer - Provide ext data of each player to the game server before connecting the player.

PragmaResultErrors

  • PragmaError.GameInstanceService_UnknownGameInstanceId - If the game instance id from request is not found.
  • PragmaError.GameInstanceService_MissingPlayerConnectionDetails - If a PlayerConnectionDetails for an expected player was not present on the request.
  • PragmaError.GameInstanceService_InternalError - If a lock on the specified game instance could not be held.