Visszaadja a szoba és a játokos állapotát
-
URL
/state/{room_id}/{player_id}
-
Method:
GET
-
Success Response:
-
Case: Game state in Waiting
- Content:
{ status: 'OK', gameState: [string], numberOfPlayers: [int] }
- Content:
-
Case: Game state in Preparing
- Content:
{ status: 'OK', gameState: [string], tileId: [int] }
- Content:
-
Case: Game state in Showing Pattern
- Content:
{ status: 'OK', gameState: [string], pattern: [string] }
- Content:
-
Case: Game state in Playing
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
Case: Game state in Successful End
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
Case: Game state in Fail End
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
-
Error Response:
- TODO
-
Example
- URL paraméterként várja a room és player id-t:
GET /state/1234/1234
Szoba létrehozása
-
URL
/create
-
Method:
POST
-
JSON Params
roomId:[string]
playerId:[string]
-
Success Response:
- Case: Successful creation and join
- Content:
{ status: 'OK', numberOfPlayers: [int] }
- Content:
- Case: Successful creation and join
-
Error Response:
- Reason: Room already exists
- Content:
{ status: 'ERROR', reason: 'ROOM_ALREADY_EXISTS' }
- Content:
- Reason: Room already exists
Csatlakozás szobához saját player id-val
-
URL
/join
-
Method:
POST
-
JSON Params
roomId:[string]
playerId:[string]
-
Success Response:
- Case: Successful join
- Content:
{ status: 'OK', numberOfPlayers: [int] }
- Content:
- Case: Successful join
-
Error Response:
-
Reason: Room does not exist
- Content:
{ status: 'ERROR', reason: 'ROOM_DOES_NOT_EXIST' }
- Content:
-
Reason: Room full
- Content:
{ status: 'ERROR', reason: 'ROOM_IS_FULL' }
- Content:
-
Kilépés szobából amíg WAITING state-ben van
-
URL
/leave
-
Method:
POST
-
JSON Params
playerId:[string]
-
Success Response:
- Case: Successfully left
- Content:
{ status: 'OK' }
- Content:
- Case: Successfully left
-
Error Response:
- Reason: Not left from room
- Content:
{ status: 'ERROR', reason: 'NOT_LEFT' }
- Content:
- Reason: Not left from room
Showing Pattern után ezen az endpointon jelez egyszer a játékos, hogy kész.
-
URL
/start
-
Method:
POST
-
JSON Params
roomId:[string]
playerId:[string]
-
Success Response:
- Case: Success
- Content:
{ status: 'OK'}
- Content:
- Case: Success
-
Error Response:
- TODO
Gombot nyomott a játékos
-
URL
/game
-
Method:
POST
-
JSON Params
roomId:[string]
playerId:[string]
-
Success Response:
-
Case: Successful press and game is still in Playing State
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
Case: Wrong Press
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
Case: Successful press and game is in Successful End State
- Content:
{ status: 'OK', gameState: [string] }
- Content:
-
-
Error Response:
- TODO
Újrakezdés ugyanazokkal a játékosokkal
-
URL
/restart
-
Method:
POST
-
JSON Params
roomId:[string]
playerId:[string]
-
Success Response:
- Case: Success
- Content:
{ status: 'OK', numberOfRestartPlayers: [int] }
- Content:
- Case: Success
-
Error Response:
- TODO
Kliens verziójának ellenőrzése
-
URL
/version/{version}
-
Method:
GET
-
Success Response:
- Case: Passed version check
- Content:
{ status: 'OK', compatible: [boolean] }
- Content:
- Case: Passed version check
-
Error Response:
- Case: Failed version check
- Content:
{ status: 'ERROR', reason: 'FORBIDDEN' }
- Content:
- Case: Failed version check
-
1_waiting
-
2_preparing
-
3_showing_pattern
-
4_playing
-
5_successful_end
-
5_fail_end
- WAITING
- 1000 ms-enként
- PREPARING
- 250 ms-enként
- SHOWING PATTERN
- 250 ms-enként
- PLAYING
- 250 ms-enként