.gitignore | ||
game_manager.py | ||
LICENSE | ||
main.py | ||
README.md | ||
settings.py |
ultimate_tictactoe_server
a python server backend for ultimate tic-tac-toe.
communication with the web client is done by a (far from any standard and almost random) json protocol:
register as player and in game queue:
{
"type": "register",
"data": {
"id": "<player_id>",
"name": "<player_name>"
}
}
response:
{
"type": "register_response",
"data": {
"success": true,
"msg": "<additional info e.g. in case of error>"
}
}
message from server that game started
{
"type": "game_starts",
"data": {
"msg": "...",
"opponent_name": "...",
"is_first_move": true
}
}
note: is_first_move
indicates whether the player or it's opponent begins
move
{
"type": "move",
"data": {
"sub_x": "...",
"sub_y": "...",
"x": "...",
"y": "..."
}
}
response:
{
"type": "move_response",
"data": {
"success": true,
"msg": "..."
}
}
end game
{
"type": "end_game",
"data": {
"msg": "..."
}
}
(response?)