1.2. Pregame phase

Now that the table is created, all the bots are going to join it automatically, but humans will join one after the other. Each of them triggers a GAME_SEAT message, consisting of the name, player type and, most important, the file descriptor to access the player's game client.

If the game server allows spectators to watch a game, they will be handled similarly, by triggering a GAME_SPECTATOR_SEAT message. Since a game might allow a spectator to become a player and vice-versa, a special GAME_RESEAT message might appear at any time.

The abovementioned state change is done via the GAME_STATE request, sent by the game server to indicate that its internal state has changed. In response to a game server's GAME_STATE request, ggzd will always send a GAME_STATE response, with no further data attached. After the PREGAME phase, the state will most likely be changed to PLAYING.