Maintain a read-only JSON string representing the state of the game:
- Current permanent marker positions
- Current temporary marker position
- Current player turn
- Current dice roll
- Claimed columns for each player
- Player number and info (name, color, etc)
Returns JSON string representing game state
{
players: [
{ // player object
username: "matt",
positions: [
[12, 1], // 12th column, 1st position
[7, 9]
// ...
]
},
// ...
],
tempMarkers: [
[12, 2],
// ...
],
turn: “Joe Somebody”,
dice: [2, 6, 4, 3],
columnsClaimed: [4, /* ... */]
},
success: true, // request successful
msg: '' // use for error messages
Accepts a JSON string representing the attempted move.
{
username: "matt",
token: "string",
columns: [], // Array of integers 2-12 (max length: 3)
continue: true // Boolean
}
Returns a JSON string representing game state and/or validation error.
Return an array of all usernames. Example:
[ "tim", "blake", "matt", "anna" ]