jGGZDMod Documentation
0.99.3
jGGZDMod is a library of the GGZ Gaming Zone project which implements the protocol between the main GGZ server and the game server. It sends signals about player changes, arriving data, savegame continuations and other interesting events to the game server, and can be used to query information about the game state and to request changes in the game table's configuration.
Using GGZDMod::GGZDMod (which is also the main class for this package) starts by inheriting from this class and reimplementing the four abstract methods provided by its base class GGZDMod::Handler. Upon construction of your object, don't forget to call super() to initialise the connection to GGZ. That's all!
A typical reimplementation would do the following:
- In GGZDMod::Handler::stateEvent, react on state changes if needed.
- In GGZDMod::Handler::savegameEvent, load a savegame and continue to use it, instead of starting a new one. In particular, the game's internal state should be initialised from the contents of the savegame file. This is an advanced feature only needed if the game supports savegames.
- In GGZDMod::Handler::dataEvent, get the connection channel of the player whose connection contains the data by calling GGZDMod::Spectator::getClient. Use this channel to read and write data to the game client.
- In GGZDMod::Handler::seatEvent, check if the old seat is null for player joins, if the new seat is null for player leaves, or if both seats are set for seat switches, e.g. a player becoming a spectator or the other way around. In particular, this event can be used to find out if all seats are occupied by calling GGZDMod::Handler::getSeats and starting the game by changing its state with GGZDMod::Handler::setState(GGZDMod::Protocol::STATE_PLAYING).
A game server can always send log messages to the GGZ server by calling GGZDMod::GGZDMod::log.
Generated on Fri Mar 28 20:37:22 2008 for jGGZDMod by
1.5.4