game / pragma.gameinstance / GameInstanceService / leaveV1 /

leaveV1 #

suspend fun leaveV1(session: PlayerSession, request: GameInstanceRpc.LeaveV1Request): GameInstanceRpc.LeaveV1Response

Leave a game. Invokes the GameInstancePlugin.handlePlayerLeaveRequest function to validate whether to allow the player to leave.

To deny the player from leaving, throw an application error in the plugin.

After leaving, a notification will be sent to the game server running the game instance.

PragmaResultErrors

  • PragmaError.GameInstanceService_PlayerNotInGameInstance - If the player is not in the game instance specified.
  • PragmaError.GameInstanceService_InternalError - If a lock on the specified game instance could not be held.