<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >The Protocol</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="GGZ Gaming Zone Server/Game Server Protocol Specification" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Objectives" HREF="f19.html"><LINK REL="NEXT" TITLE="Pregame phase" HREF="x38.html"></HEAD ><BODY CLASS="CHAPTER" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >GGZ Gaming Zone Server/Game Server Protocol Specification</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="f19.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x38.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="CHAPTER" ><H1 ><A NAME="PROTOCOL" ></A >Chapter 1. The Protocol</H1 ><P > Communication between server and game server happens by means of binary tokens (opcodes), which are of type integer, followed by zero or more opcode-specific variables which can be of type integer, character, or string.</P ><P > At each point in time, a game server happens to be in a specific state. Messages received from the server may lead to state changes, as may some explicit transitions being executed by the game server itself. A list of all states can be found in the <A HREF="r896.html" > appendix of states</A >.</P ><P > Several actions refer to seats on the table the game is being played on. Each seat can be either empty or have an assignment. A full list can be found in the <A HREF="r854.html" >appendix of seat assignments</A >.</P ><P > Interactions are presented here categorically. For a complete reference of game server/server interactions, please see the <A HREF="a62.html" >appendix</A >.</P ><DIV CLASS="SECTION" ><H1 CLASS="SECTION" ><A NAME="STARTUP" >1.1. Startup</A ></H1 ><P > The GGZ server ggzd and the game server communicate via a connection which gets established using socketpair(). The game server can then access the communication channel on a certain file descriptor. Usually this descriptor has the value 3, but if the environment variable GGZSOCKET is set, its value should be used instead. Likewise, the environment variable GGZMODE can be queried to see if the game server is running on GGZ at all. </P ><P > The first message which will arrive is the <A HREF="r66.html" >GAME_LAUNCH</A > message, used to configure the game based on the table information: how many players are going to participate, are there any reserved seats, and so on. The game server will then notify ggzd about it having the data received, and set its internal status from CREATED to WAITING. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="f19.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x38.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Objectives</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Pregame phase</TD ></TR ></TABLE ></DIV ></BODY ></HTML >