aboutsummaryrefslogtreecommitdiff
path: root/doc/api.org
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api.org')
-rw-r--r--doc/api.org15
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