vn_tochki - Post a comment
[Recent Entries][Archive][Friends][User Info]
rss этого журнала
[http://lj.rossia.org/users/vn_tochki/data/rss]
|
06:02 pm vn_tochki[Link] | This is a protocol which I (Vasya Novikov) think would be best for the game Points.
1) The communication is done via small simple text messages -- in both directions. (From server to the client and vice versa.)
2) Protocol messages are numbered -- one enumeration for the server and one for the client.
The main protocol structure:
req N; -- request all server messages starting at N.
req N1-N2; -- request server messages from N1 to N2.
null N; -- there are no messages that must be sent. The last message number was N.
msg N .....; -- I'm sending some message and it has number N.
Structure-messages "req", "null" aren't stored and numbered. Structure-message "msg" should be.
If the client wants to update himself, he sends the "req N" request.
From now I'm forgetting about all these structure-messages and focus on what comes after the "msg N". I'll call them just messages.
The form of the messages is:
Command <arguments>
Basic Client->Server messages:
subscribe <room> - the user is "entering" the room and get's subscribed to updates. "room" is a string that represents a room.
unsubscribe <room> - unsubscribing
chat <room> <message> - send chat
kick <room> - kick someone from a room.
version <text> - the client's version. If it is not up-to-date - the server should block the user.
getGameRooms <room> - get games played inside a global (language) room.
getRoomList - return all global (language) rooms
makeMove <room> <move> - make a move. The move is in the form B[15:4], like in SGF.
requestUndo <room> - request an undo
agreeUndo - argee for an undo for your opponent.
addTime <room> - add time to your opponent
gameSTOP <room> - the game action "STOP"
gamePass <room> - the game action "pass"
gameSettings <room> <settings> - game settings in the form like in SGF
gameInit <room> - initializes the game.. Starts the timers and generates crosses.
privGameChat <room> <message> - sends a chat to your opponent if you're the player or to all other spectators if you're a spectator
register <nick> <text> - here must be some registration info. Maybe OpenID, maybe pass+email...
login <nick> <text> - log in.
userInfo <text> - userinfo
.....
....
Basic Server-Client messages:
subscribed <room>
unsubscribed <room>
chat <room>
kicked <room>
moveMaked <room> <move> <time> (time left)
undoMaked <room>
requestingUndo <room>
addedTime <room>
.....
....
Any suggestions and criticism is welcome.
|
|
|
| |