Game server for 2016 booth
The server will return the state of the game on most endpoints. The state will be a JSON object containing the data for all the players and the monster in the game. Each player and monster will be represented as a JSON object as well.
{"id": identifier, "hitpoints": int, "last_attack": string}
{"player1" player1, "player2": player2, "monster": monster}
POST /hello {"player": player, "player_number": 1/2} Adds a player, returns state
POST /hello-monster {"monster": monster} Adds a monster, returns state. this state will be fresh (no characters other than the monsters).
POST /attack {"damage": int, "attacker": attacker_id, "target": target_id, "attack_name": name} Does an attack of "damage" to the identifier, returns the state.
POST /poll {"id": identifier} Returns {"can_attack": true/false, "state": state}, true if identifier can take another attack, otherwise false.