[Commit] rrserver protocol,1.5,1.6

Keith Packard commit@keithp.com
Wed, 28 May 2003 11:36:03 -0700


Committed by: keithp

Update of /local/src/CVS/rrserver
In directory home.keithp.com:/tmp/cvs-serv8995

Modified Files:
	protocol 
Log Message:
Switch to single line reply/response to make telnet mode nicer

Index: protocol
===================================================================
RCS file: /local/src/CVS/rrserver/protocol,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- protocol	28 May 2003 14:20:06 -0000	1.5
+++ protocol	28 May 2003 18:36:01 -0000	1.6
@@ -26,17 +26,13 @@
 
 	->
 
-	<success-code>
 	<response> <data>
 
-	<success-code> is one of:
+	<response-code> is one of:
 
-	OK
+	<command> <args>
 	ERROR <message>
 
-	If <success-code> is "OK", then the reply data will follow and be
-	terminated by "DONE"
-
 1. Requests
 
 1.1 Connection setup
@@ -49,9 +45,7 @@
 	
 	->
 	
-	OK
-	WELCOME <servername>
-	DONE
+	HELO <servername>
 
 1.2. Listing available users
 
@@ -59,11 +53,7 @@
 
 	->
 
-	OK
-	USER <username1>
-	USER <username2>
-	...
-	DONE
+	WHO <username1> <username2> ...
 
 1.3. Listing available games
 
@@ -71,11 +61,7 @@
 
 	->
 
-	OK
-	GAME <game1>
-	GAME <game2>
-	...
-	DONE
+	GAMES <game1> <game2> ...
 
 1.4. Listing users in a game
 
@@ -83,11 +69,7 @@
 
 	->
 
-	OK
-	USER <username1>, <score1>
-	USER <username2>, <score2>
-	...
-	DONE
+	USERS <username1> <score1> <username2> <score2> ...
 
 1.5. Creating a new game
 
@@ -95,9 +77,7 @@
 
 	->
 
-	OK
-	GAME <game>
-	DONE
+	NEW <game>
 
 1.6. Joining an existing game
 
@@ -105,11 +85,7 @@
 
 	->
 
-	OK
-	USER <username1>
-	USER <username2>
-	...
-	DONE
+	JOIN <username1> <username2> ...
 
 	Possible errors: NOGAME
 
@@ -119,11 +95,7 @@
 
 	->
 
-	OK
-	USER <username1>
-	USER <username2>
-	...
-	DONE
+	WATCH <username1> <username2> ...
 
 	The client will monitor the game, but not be listed in the
 	userlist nor be allowed to make moves.
@@ -136,18 +108,21 @@
 
 	->
 
-	OK
-	SPC <spc-data>
-	ROW <row-data>
-	...
-	DONE
-
-	"<spc-data>" is either '   ', ' | ' or '---'.  "<row-data>" is
-	either ' . ', ' | ', ' <color><shape>', '_<color><shape>',
-	' ww', '_ww', ' <color> ' or '_<color>_'.
+	SHOW "\n
+	 ==
+	|.. .. ..
+	|RR .. gg
 	
-	<color> is 'R', 'Y', 'G' or 'B', shape is 't', 's', 'o', 'c'
+	 gs|.. RT|
+	 ..|.. ..|
+	 ==    =="
+	
+	RT =	Red triangle (goal target)
+	gs = 	Green square (non-goal target)
+	RR = 	Red robot (goal robot)
+	gg = 	Green robot (non-goal target)
 
+	
 	Possible errors: NOGAME
 
 1.9. Bid
@@ -156,19 +131,17 @@
 
 	->
 
-	OK
-	DONE
+	BID <number>
 
 	Possible errors: TIMEOUT
 
 1.10. Move
 
-	MOVE <color>, <dir>
+	MOVE <color> <dir>
 
 	->
 
-	OK
-	DONE
+	MOVE
 
 	<color> is one of 'R', 'Y', 'G' or 'B', <dir> is one of 'N', 'E',
 	'S' or 'W'.
@@ -181,8 +154,7 @@
 
 	->
 
-	OK
-	DONE
+	UNDO
 
 	Undoes the last move
 
@@ -194,8 +166,7 @@
 
 	->
 
-	OK
-	DONE
+	RESET
 
 	Resets robot positions to that at the start of the turn.
 
@@ -207,8 +178,7 @@
 
 	->
 
-	OK
-	DONE
+	TURN
 
 	Advance the game to the next turn, (which will have a new
 	target square). The robots will start in their final positions
@@ -226,8 +196,7 @@
 
 	->
 
-	OK
-	DONE
+	PASS
 
 1.16. Message
 
@@ -235,8 +204,7 @@
 
 	->
 	
-	OK
-	DONE
+	MESSAGE
 
 2. Asynchronous notification.  
 
@@ -245,100 +213,63 @@
         client when additional people join or new games are
         started. These are of the form:
 
-	NOTICE
-	<notice-code> <args>
-	DONE
+	NOTICE <notice-code> <args>
 
 2.1. Move notice
 
-	NOTICE
-	MOVE <color>, <dir>
-	DONE
+	NOTICE MOVE <color> <dir>
 
 2.2. New users
 
-	NOTICE
-	USER <username>
-	DONE
+	NOTICE USER <username>
 
 2.3. Disconnected user
 
-	NOTICE
-	PART <username>
-	DONE
+	NOTICE PART <username>
 
 2.4. New games
 
-	NOTICE
-	GAME <game>
-	DONE
+	NOTICE GAME <game>
 
 2.5. Terminated games
 
-	NOTICE
-	TERMINATE <game>
-	DONE
+	NOTICE TERMINATE <game>
 
 2.6. Bids
 
-	NOTICE
-	BID <number>, <username>
-	DONE
+	NOTICE BID <username> <number>
 
 2.7. Timer
 
-	NOTICE
-	TIME <seconds>
-	DONE
+	NOTICE TIME <seconds>
 
 	Timer ticks are sent every 10 seconds
 
 2.8. Select active player
 
-	NOTICE
-	ACTIVE <username>
-	DONE
+	NOTICE ACTIVE <username>
 
 	Only the active player may move the robots
 
-2.9. Move
-
-	NOTICE
-	MOVE <color>, <dir>
-	DONE
-
-2.10. Undo
+2.9. Undo
 
-	NOTICE
-	UNDO
-	DONE
+	NOTICE UNDO
 
 2.11. Reset
 
-	NOTICE
-	RESET
-	DONE
+	NOTICE RESET
 
 2.12. Next turn
 
-	NOTICE
-	TURN <color>, <shape>
-	DONE
-
-	<color><shape> will be 'ww' for the whirlpool.
+	NOTICE TURN <color> <shape>
 
 2.13. Message
 
-	NOTICE
-	MESSAGE <text>
-	USER <username>
-	DONE
+	NOTICE MESSAGE <text>
 
 2.14. Abandon request
 
-	NOTICE
-	ABANDON <username>
-	DONE
+	NOTICE ABANDON <username>
 
 	<username> has requested that the current turn be abandoned
 	(i.e. TURN requested without a solution demonstrated>