1 <!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [ 2 <!--ArborText, Inc., 1988-1999, v.4002--> 3 <!ENTITY cmd "libggzmod"> 4 <!ENTITY % commonents SYSTEM "smancommon.ent"> 5 %commonents; 6 <!ENTITY % booktitles SYSTEM "booktitles.ent"> 7 %booktitles; 8 <!ENTITY suncopy "Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved."> 9 ]> 10 <?Pub UDT _bookmark _target> 11 <?Pub Inc> 12 <refentry id="libggzmod-3"> 13 <!-- %Z%%M% %I% %E% SMI; --> 14 <refmeta> 15 <refentrytitle>libggzmod</refentrytitle><manvolnum>3</manvolnum> 16 <refmiscinfo class="date">29 May 2008</refmiscinfo> 17 <refmiscinfo class="sectdesc">&man3;</refmiscinfo> 18 <refmiscinfo class="software">&release;</refmiscinfo> 19 <refmiscinfo class="arch">generic</refmiscinfo> 20 <refmiscinfo class="copyright">&suncopy;</refmiscinfo> 21 </refmeta> 22 23 <indexterm><primary>libggzmod</primary></indexterm> 24 <indexterm><primary>The GGZ Gaming Zone game frontend library</primary></indexterm> 25 26 <refnamediv id="libggzmod-3-name"> 27 <refname>libggzmod</refname> 28 <refpurpose> 29 The GGZ Gaming Zone game frontend library. 30 </refpurpose> 31 </refnamediv> 32 33 <refsect1 id="libggzmod-3-desc"> 34 <title>&desc-tt;</title> 35 <para> 36 This library allows games to communicate with the GGZ Gaming Zone 37 core client, which allows establishing the connection to the GGZ Gaming Zone 38 server and its associated game server. 39 </para> 40 <para> 41 The <filename>libggzmod</filename> allows game authors to use GGZ Gaming Zone in 42 their game clients. This library provides a state engine and an event 43 dispatcher. The states are associated with the game tables. Each table has a 44 current state which is tracked by GGZMod and the GGZMOD_EVENT_STATE is 45 propagated to the game server, each time game state changes. 46 </para> 47 48 <refsect3 id="libggzmod-3-exde-optb-stat"> 49 <title>STATES</title> 50 <para> 51 <variablelist termlength="medium"> 52 <varlistentry><term><literal>GGZMOD_STATE_CREATED</literal></term><listitem> 53 <para> 54 The game is in this state when it is executed for the first time. This state 55 should never be changed back once the state is set. 56 </listitem> 57 </varlistentry> 58 <varlistentry><term><literal>GGZMOD_STATE_CONNECTED</literal></term><listitem> 59 Once the GGZ client and the game are connected, the game changes state to this 60 automatically. This state should never be changed back once the game leaves 61 this state. 62 </listitem> 63 </varlistentry> 64 <varlistentry><term><literal>GGZMOD_STATE_WAITING</literal></term><listitem> 65 After the game client and game server are connected, the client enters this 66 state. The game client may now call ggzmod_set_state to change states 67 between GGZMOD_STATE_WAITING, GGZMOD_STATE_PLAYING, and GGZMOD_STATE_DONE. 68 </listitem> 69 </varlistentry> 70 <varlistentry><term><literal>GGZMOD_STATE_PLAYING</literal></term><listitem> 71 This state tells that the game is actively being played, while the 72 GGZMOD_STATE_WAITING state in the game is considered waiting for players. 73 </listitem> 74 </varlistentry> 75 <varlistentry><term><literal>GGZMOD_STATE_DONE</literal></term><listitem> 76 This state indicates the table is considered dead and will exit shortly 77 thereafter. 78 </listitem> 79 </varlistentry> 80 </variablelist> 81 </para> 82 </refsect3> 83 84 <refsect3 id="libggzmod-3-exde-optb-even"> 85 <title>EVENTS</title> 86 <para> 87 For each of the events available in GGZModEvent, the table may register a 88 handler to handle that event. 89 Events include: 90 <variablelist termlength="long"> 91 <varlistentry><term><literal>GGZMOD_EVENT_STATE</literal></term><listitem> 92 Inform about a new game status. The old state (a GGZModState*) is passed as the 93 event's data. 94 </listitem> 95 </varlistentry> 96 <varlistentry><term><literal>GGZMOD_EVENT_SERVER</literal></term><listitem> 97 This event occurs when a new connection to the game server has been made, 98 either by the core client or by the game client itself. In this case the fd is 99 passed as the event's data. 100 </listitem> 101 </varlistentry> 102 <varlistentry><term><literal>GGZMOD_EVENT_PLAYER</literal></term><listitem> 103 This event occurs when the player's seat status changes. For example, if a 104 player or bot joins, leaves seat, or starts/stops spectating. The passed event 105 data is a int[2] pair consisting of the old {is_spectator, seat_num}. 106 </listitem> 107 </varlistentry> 108 <varlistentry><term><literal>GGZMOD_EVENT_SEAT</literal></term><listitem> 109 Informs about seat changes. The old seat (a GGZSeat*) is passed as the event 110 data. The seat information will be updated before this event is invoked. 111 </listitem> 112 </varlistentry> 113 <varlistentry><term><literal>GGZMOD_EVENT_SPECTATOR_SEAT</literal></term><listitem> 114 This event occurs when a spectator seat change happens. The old spectator (a 115 GGZSpectator*) is passed as the event data. The spectator information will be 116 updated before this event is invoked. 117 </listitem> 118 </varlistentry> 119 <varlistentry><term><literal>GGZMOD_EVENT_CHAT</literal></term><listitem> 120 This is an event for receiving a chat. The chat may have originated in another 121 game client or from the GGZ client. The chat information (a GGZChat*) is passed 122 as the event's data. 123 </listitem> 124 </varlistentry> 125 <varlistentry><term><literal>GGZMOD_EVENT_STATS</literal></term><listitem> 126 This is an event informing that player's statistics have been updated. 127 </listitem> 128 </varlistentry> 129 <varlistentry><term><literal>GGZMOD_EVENT_INFO</literal></term><listitem> 130 This event fires when information about one or more other players has been 131 requested and has been received. The event's data is in a GGZPlayerInfo* 132 structure or NULL if information about all players was requested. 133 </listitem> 134 </varlistentry> 135 <varlistentry><term><literal>GGZMOD_EVENT_ERROR</literal></term><listitem> 136 This event informs about GGZMod errors. An error message (a char*) is passed as 137 the event's data. The GGZMod may attempt to recover from the error, but it is 138 not guaranteed that the GGZ connection will continue to work after an error has 139 happened. 140 </listitem> 141 </varlistentry> 142 </variablelist> 143 </para> 144 </refsect3> 145 </refsect1> 146 147 <refsect1 id="libggzmod-3-file"> 148 <title>&file-tt;</title> 149 <para>The following files are used by this library:</para> 150 <variablelist termlength="wide"> 151 <varlistentry> 152 <term><filename>/usr/lib/&cmd;.so</filename> </term> 153 <listitem> 154 <para>The GGZ Gaming Zone game frontend shared library</para> 155 </listitem> 156 </varlistentry> 157 <varlistentry> 158 <term><filename>/etc/ggz.modules</filename> </term> 159 <listitem> 160 <para>Game module registry for game clients</para> 161 </listitem> 162 </varlistentry> 163 </variablelist> 164 </refsect1> 165 166 <refsect1 id="libggzmod-3-attr"> 167 <title>&attr-tt;</title> 168 <para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry> 169 <refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry> 170 </olink> for descriptions of the following attributes: 171 </para> 172 <informaltable frame="all"> 173 <tgroup cols="2" colsep="1" rowsep="1"> 174 <colspec colname="COLSPEC0" colwidth="1*"> 175 <colspec colname="COLSPEC1" colwidth="1*"> 176 <thead> 177 <row> 178 <entry align="center" valign="middle">ATTRIBUTE TYPE</entry> 179 <entry align="center" valign="middle">ATTRIBUTE VALUE</entry> 180 </row> 181 </thead> 182 <tbody> 183 <row> 184 <entry><para>Availability</para></entry> 185 <entry><para>SUNWgnome-games</para></entry> 186 </row> 187 <row> 188 <entry colname="COLSPEC0"><para>Interface stability</para></entry> 189 <entry colname="COLSPEC1"><para>Volatile</para></entry> 190 </row> 191 </tbody> 192 </tgroup> 193 </informaltable> 194 </refsect1> 195 196 <refsect1 id="libggzmod-3-also"><title>&also-tt;</title> 197 <!--Reference to another man page--> 198 <!--Reference to a Help manual--> 199 <!--Reference to a book.--> 200 <para> 201 <citerefentry><refentrytitle>ggz_h</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 202 <citerefentry><refentrytitle>ggzcore_h</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 203 <citerefentry><refentrytitle>ggzmod_h</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 204 <citerefentry><refentrytitle>libggz</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 205 <citerefentry><refentrytitle>libggzcore</refentrytitle><manvolnum>3</manvolnum></citerefentry>, 206 <citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>, 207 <citerefentry><refentrytitle>ggz.modules</refentrytitle><manvolnum>5</manvolnum></citerefentry>, 208 <citerefentry><refentrytitle>gnome-interfaces</refentrytitle><manvolnum>5</manvolnum></citerefentry>, 209 <citerefentry><refentrytitle>ggz</refentrytitle><manvolnum>6</manvolnum></citerefentry>, 210 <citerefentry><refentrytitle>ggz-config</refentrytitle><manvolnum>6</manvolnum></citerefentry>, 211 <citerefentry><refentrytitle>ggz</refentrytitle><manvolnum>7</manvolnum></citerefentry> 212 </para> 213 <variablelist termlength="wholeline"> 214 <varlistentry> 215 <term><filename>GGZ Gaming Zone:</filename></term> 216 <listitem><para> 217 <programlisting> 218 <literal>http://www.ggzgamingzone.org/</literal> 219 <literal>http://www.ggzgamingzone.org/docs/api/libggz/</literal> 220 <literal>http://www.ggzgamingzone.org/docs/api/ggzcore/</literal> 221 <literal>http://www.ggzgamingzone.org/docs/api/ggzmod/</literal> 222 </programlisting></para> 223 </listitem> 224 </varlistentry> 225 </variablelist> 226 </refsect1> 227 228 <refsect1 id="libggzmod-3-note"><title>¬e-tt;</title> 229 <para>Written by Michal Pryc, Sun Microsystems Inc., 2008.</para> 230 </refsect1> 231 </refentry> 232