GGZ Gaming Zone Design Specification | |||
---|---|---|---|
<<< Previous Page | Home | Next Page >>> |
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.
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:
LOGIN is used for normal player logins. The server will respond with a RESULT tag. There are 3 types: First-time logins (which result in an account to be created and a password to be assigned), anonymous logins (which don't require a password), and registered logins.
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. |