From fe01e43ba13f7fd5dc700b83aafb3caab816a99b Mon Sep 17 00:00:00 2001 From: jeena Date: Fri, 11 Feb 2011 07:09:15 -0800 Subject: [PATCH] Updated Protocol draft 2.0 (markdown) --- Protocol-draft-2.0.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Protocol-draft-2.0.md b/Protocol-draft-2.0.md index c3238f6..6dfbdcf 100644 --- a/Protocol-draft-2.0.md +++ b/Protocol-draft-2.0.md @@ -1,10 +1,11 @@ + The 2.0 specification is quite different from the old one. This one is based on a stable and mature protocol; HTTP. We will borrow certain elements from the protocol, with main focus on HTTP's POST style. Here is a link: http://www.jmarshall.com/easy/http/#http1.1c1 Below is a typical POST message in HTTP.
POST /path/script.cgi HTTP/1.0
 From: frog@jmarshall.com
 User-Agent: HTTPTool/1.0
-Content-Type: application/x-www-form-urlencoded
-Content-Length: 32
+Content-Encoding: application/x-www-form-urlencoded
+Content-Size: 32
 
 home=Cosby&favorite+flavor=flies
@@ -16,10 +17,10 @@ Accept: plaintext You will get an answer with your own client token: -
Server-Command: token
-Content-Type: plaintext
-Content-Length: 45
-Server-Version: 1.0
+
Client-Command: welcome
+Content-Encoding: plaintext
+Content-Size: 45
+GGS-Version: 1.0
 Accept: gzip,plaintext
 
 913AB7FD-F795-45E4-B31C-035FD81D0773
@@ -28,8 +29,9 @@ Then you will define your game, that means, you send the source code of your gam
Token: 913AB7FD-F795-45E4-B31C-035FD81D0773
 Server-Command: define
-Content-Type: text
-Content-Length: 666
+Content-Encoding: plaintext
+Content-Type: javascript
+Content-Size: 666
 
 function userCommand(user, cmd, args) {
 	if(cmd == "moveUp") {
@@ -67,8 +69,8 @@ Now you can call commands in that game:
 
 
Token: 913AB7FD-F795-45E4-B31C-035FD81D0773
 Command: moveUp
-Content-Type: text
-Content-Length: 40
+Content-Encoding: plaintext
+Content-Size: 1
 
 5
@@ -76,8 +78,8 @@ or:
Token: 913AB7FD-F795-45E4-B31C-035FD81D0773
 Command: chat
-Content-Type: text
-Content-Length: 90
+Content-Encoding: plaintext
+Content-Size: 90
 
 Hi guys,
 
@@ -102,10 +104,9 @@ Accept: plaintext
You will get as an answer just the game session token: -
Server-Command: game-session-token
-Content-Type: plaintext
-Content-Length: 45
-Server-Version: 1.0
+
Client-Command: game-session-token
+Content-Encoding: plaintext
+Content-Size: 45
 Accept: gzip,plaintext
 
 018FF079-B383-4523-93A2-6053E7EDC2BC