Update api

This commit is contained in:
Loic Guegan 2019-05-09 18:38:31 +02:00
parent f0ccb136eb
commit d261883d41
6 changed files with 91 additions and 11 deletions

View file

@ -22,8 +22,8 @@
"syn": 1,
"game-id": 1,
"game-over": false,
"snake": [(1,2),(1,3)],
"food": [(6,7)]
"snake": [[1,2],[1,3]],
"food": [[6,7]]
}
#+END_SRC
Note that, syn entry is used to keep packet ordering consistent and detecting packet inversion on the network. Thus,
@ -46,8 +46,8 @@
"syn": 2,
"game-id": 1,
"game-over": false,
"snake": [(0,2),(1,2)],
"food": [(6,7)]
"snake": [[0,2],[1,2]],
"food": [[6,7]]
}
#+END_SRC
*** Refresh Screen
@ -67,8 +67,8 @@
"syn": 3,
"game-id": 1,
"game-over": false,
"snake": [(1,2),(0,2)],
"food": [(6,7)]
"snake": [[1,2],[0,2]],
"food": [[6,7]]
}
#+END_SRC
*** End Game
@ -79,8 +79,8 @@
"syn": null,
"game-id": 1,
"game-over": true,
"snake": [(0,2),(1,2)],
"food": [(6,7)]
"snake": [[0,2],[1,2]],
"food": [[6,7]]
}
#+END_SRC
- No reply is expected from the client and server will be in charge to free local memory. Note that syn=null.