diff options
| author | Loic Guegan <manzerberdes@gmx.com> | 2019-05-12 11:16:16 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerberdes@gmx.com> | 2019-05-12 11:16:16 +0200 |
| commit | 8cba94e0812539191b40ad0f823bdaa3b14bb278 (patch) | |
| tree | a64783b15582b7310f227b9bc58c04a99e942b95 /doc/api.org | |
| parent | 4ce40ee01db2ecfc3cb1c55de2f5fa23fae87a4e (diff) | |
Update api
Diffstat (limited to 'doc/api.org')
| -rw-r--r-- | doc/api.org | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/doc/api.org b/doc/api.org index e5da347..736fe55 100644 --- a/doc/api.org +++ b/doc/api.org @@ -4,14 +4,10 @@ #+LATEX_HEADER: \usepackage{fullpage} * General Description - - All transmissions will be based on TCP since: - - Packet length are not fixed (large variance depending on the snake size and food) - - Packet ordering is important (inverted request can compromise gameplay) - - All TCP streams from *client to server* will: - - Contain _plain json data_ - - Be terminated by an "#EOF" line (in order for the server to detect the end of the client request) - - All TCP stream from *server to client* will contains _plain json data_ (connection will be closed by the server - so, there is no need of "#EOF"). + - All transmissions will be based on UDP since latency is important + - All UDP datagrams between *client and server* will contain _plain json data_ + - All data should be sent in *one* datagram + - All utf-8 characters in UDP datagram are in lower case * Communications ** Initialisation 1. Client sent: @@ -19,7 +15,6 @@ { "type": "new-game" } - #EOF #+END_SRC 2. Server can reply: #+BEGIN_SRC json @@ -40,7 +35,6 @@ "game-id": 1, "direction": "left", } - #EOF #+END_SRC 2. Then, server can reply: #+BEGIN_SRC json @@ -60,7 +54,6 @@ "game-id": 1, "direction": null } - #EOF #+END_SRC 2. Server can reply: #+BEGIN_SRC json |
