This is work in progress protocol/data specification based on our discussions in code club today.
Creating a Game
Joining a Game
-
GET /game/avail: A user's browser can make a GET request to this address to get a list of the
available game_ids and game_names of games that are in the Joining state i.e.
[{
"game_id": 72,
"game_name": "Code Club Cardiff"
},
{
"game_id": 128,
"game_name": "Code Club Bristol"
}]
-
POST /game/join A user's browser can POST to this URL the following data:
game_id: The ID number of the game they wish to join
user_name: The user's nickname that they want displayed throughout the game
In response the server will send:
user_id: The user's ID number for the game
This is enough to get a 'Hello World' application running where people can create a game, and people can join the game. We will sort out starting the game and assigning roles etc. once we have this up and running.
This is work in progress protocol/data specification based on our discussions in code club today.
Creating a Game
POST /game/new: A user's browser will be responsible forPOSTing the following data to the server:game_name: a human readable 'nickname' for a gameIn response the server will send:
game_id: The ID number used to refer to this game on the serverJoining a Game
GET /game/avail: A user's browser can make aGETrequest to this address to get a list of theavailable
game_idsandgame_namesof games that are in theJoiningstate i.e.POST /game/joinA user's browser canPOSTto this URL the following data:game_id: The ID number of the game they wish to joinuser_name: The user's nickname that they want displayed throughout the gameIn response the server will send:
user_id: The user's ID number for the gameThis is enough to get a 'Hello World' application running where people can create a game, and people can join the game. We will sort out starting the game and assigning roles etc. once we have this up and running.