-
Notifications
You must be signed in to change notification settings - Fork 0
Soarez edited this page Aug 14, 2012
·
8 revisions
Start -- Create a game.
{
"nickname": "Rulio"
}
This is the result
{
"id": "PbDHs",
"nickname": "Rulio",
"score": 0,
"rolled": [
{ "color": "red", "face": "shot" },
{ "color": "green", "face": "runner" },
{ "color": "yellow", "face": "brain" }
],
"brains": [],
"shots": [],
"runners": []
}
The last three fields are arrays of the dice's colors.
Play -- Update the game state.
{
"id": "PbDHs",
"nickname": "Rulio",
"action": "roll",
"score": 0,
"brains": ["yellow"],
"shots": ["red"],
"runners": ["green"]
}
The server only cares about the three first fields.
The nickname can be updated.
The action, if any, can be either roll
or stop
. If no action is provided the server returns 400 Bad Request
{
"id": "PbDHs",
"nickname": "Rulio",
"score": 0,
"rolled": [
{ "color": "red", "face": "shot" },
{ "color": "green", "face": "runner" },
{ "color": "yellow", "face": "brain" }
],
"brains": ["yellow", "green", "yellow"],
"shots": ["red", "yellow"],
"runners": ["green"]
}
This is the response in case the specified action was roll
. If the specified action was stop
, the rolled
would be ommited.