Client-Server Communication Protocol

Table of Contents
Logging in
Requesting server information
Rooms
Requesting room information
Server updates
Table Management
Chatting with friends
Game Interactions

The client and GGZ server will communicate via the protocol described here. Individual games will of course communicate via their own protocol. These messages are transferred on a separate (direct) connection between game client and game server. While GGZ games are free to use whatever communication protocol they like, the GGZ protocol itself is currently encoded in XML.

Interactions are presented here categorically. For a complete reference of client-server interactions, please see the appendix.


Logging in

When a client first connects to the server, the server will start the SESSION and respond with SERVER, notifying the client of the server type, name and protocol version number. If the server is full (ie. no more user logins allowed), it will indicate this. After establishing a connection to the server, the client may send one of three commands to login:

Note: Clients may choose to send login requests immediately, not waiting for the SERVER. This is acceptable, provided the client handle the case where the server tells that it doesn't accept any more connections (i.e. is full). It will receive no further notification that the login has failed.

After a successful login, the server may optionally send a message-of-the-day to the client via a MOTD tag. This is a text message, possibly with embedded color codes. For more details, see MOTD System.

Any time after logging in, the client may logout of the server by closing the session, i.e. by sending the closing part of the SESSION tag. The server will end its SESSION then, too. Clients should not simply disconnect from the server without logging out as player data and game statistics may not get written back to the database.

Note: A client may only login once. At the present, if the player wishes to re-login for some reason (eg. to become anonymous, or to switch accounts), he will have to logout and then back in again. We may make account-switching possible at a future date, once we implement player preferences.

Warning

Although it is not explicitly disallowed by the server, clients are discouraged from allowing players to logout while at a game table. The client should send the appropriate LEAVE request first.