Exit Game ✓ Done
Overview
- Description: Called when a player clicks "Back to Lobby / Exit Game" inside the game or closes the game page. The backend notifies Hub to kick the player out and releases the local game lock.
Call Relationship
NOTE
This exit interface internally calls Hub's /papi/v1/player/reclaim to kick the player out and reclaim the balance. The member_id is the player's native username (same as the game launch interface /papi/v1/game/launch). After a successful reclaim, Hub zeroes the player's active wallet balance and triggers the /settle callback to return funds, then calls back the platform's /api/v1/callback/offline to notify the player is offline (session log is recorded). Clients do not need to care about these callbacks.
1. POST - Exit Game
- Path:
/client/games/exit
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | String | Yes | Bearer Token (player JWT, must be logged in) |
Request Parameters
None (player identity comes from the JWT)
Response Example
{
"status": true,
"code": 0,
"data": null,
"msg": "Success"
}NOTE
A successful exit does not return the player's balance. The final balance after exiting should be fetched via GET /client/member/getBalance. The reclaimed amount (reclaimed_amount) from Hub is only used by the backend for reconciliation/audit.
Error Response Example
{
"status": false,
"code": 7,
"data": {},
"msg": "Failed to exit the game. Please try again later."
}NOTE
The msg field is returned according to the player's language (from the JWT language claim, x-language header, or player profile). The example above shows English (en_us) messages.