This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Message Exchanges
tsimbalar edited this page Nov 21, 2012
·
7 revisions
This document is a list of the messages/notifications used for communication between the server and the client.
Id | When | Consequence |
---|---|---|
POST /rooms/:roomId/games/:gameId/solution | Player wants to publish his solution |
Server should validate and take submission into account
|
GET /rooms/:roomId/games/:gameId/status | Check status of the game (how long is left, is the game over ...). Future : current phase of the game ? |
Allows to refresh game timer
|
GET /rooms/:roomId/games/:gameId/scores | Get list of members + scores in the current game | Allows to refresh list of players when somebody connects/disconnect and scores when somebody submits a solution
{"scores":[{"player":"hermione","score":0},{"player":"admin","score":0},{"player":"tibal","score":8}]} |
POST /rooms/:roomId/eject | Player wants to close existing sessions from another browser/computer | ... |
Id | When | Consequence |
---|---|---|
room.player.connected | A player has just connected to the current room | Client should refresh list of player |
room.player.disconnected | A player has just disconnected to the current room | Client should refresh list of player |
room.player.submittedSolution | Somebody submitted a valid solution to the current game in the current room | Client should refresh scores of current game |
player.kickout | Player has asked to close current existing session in another tab/browser in the same room | Browser will stop the game in the ejected session/tab/browser |
- change of game phase (for instance : somebody has submitted a solution ... now there is only 30 seconds left .... or time is up and user must show his solution to the world)
- end of match (N games have been played ... show the overall winner)
- end of game because all the other people have left the room
- error notification ?? (server errors or things like that ??? )
- movement notification in "replay mode" to show other player's solution (user is showing his solution)
- ask for the new board at the end of a game (no need to leave page)
- submit solution "step by step" (to forward to other players, looking at the proposed solution) ....