
<para>
  As of protocol version &protonum;, the following messages are defined.
</para>

<para>
  Four types of data are exchanged between the client and the server:
  <itemizedlist>
    <listitem>
  <para>char: a 1-byte signed char.</para>
    </listitem>
    <listitem>
  <para>int: a 4-byte signed integer in network byte order.</para>
    </listitem>
    <listitem>
  <para>
    string: a multibyte null-terminated string preceded by
    its length (including null-termination) as an integer.
  </para>
    </listitem>
    <listitem>
  <para>
    varying: data format depends on the message type.
  </para>
    </listitem>
  </itemizedlist>
</para>

<para>
  Interactions take one of three forms: server messages, client
  requests, and server responses. Each interaction is prefaced
  by an opcode identifying it (some interactions consist solely
  of the opcode). The opcode (stored as an enumerated value) is
  sent as an int. A minor opcode sometimes follows it.
</para>

<section id ="client-to-server"><title>Client to server messages</title>

<para>
These messages are sent by the client to the server.
This section does not cover responses to messages generated by the server,
since those are valid in both direction. Instead, messages generated by the
client on its own are documented here.
</para>

  <refentry id="client.move"><?dbhtml filename="client.op_move.html">
    <refmeta>
      <indexterm>
        <primary>OP_MOVE</primary>
      </indexterm>
      <refentrytitle>OP_MOVE</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>OP_MOVE</refname>
      <refpurpose>Client moved character</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
OP_MOVE [gen] [direction]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>gen</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>direction</entry>
		    <entry>int</entry>
			<entry><itemizedlist>
				<listitem><para>MOVE_UP</para></listitem>
				<listitem><para>MOVE_DOWN</para></listitem>
				<listitem><para>MOVE_LEFT</para></listitem>
				<listitem><para>MOVE_RIGHT</para></listitem>
			</itemizedlist></entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Client moved character</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">gen</emphasis></term>
	    <listitem>
	      <para>
		Message counter.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">direction</emphasis></term>
	    <listitem>
	      <para>
		The direction of the move.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  Whenever a player moves on the map.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

  <refentry id="client.action"><?dbhtml filename="client.op_action.html">
    <refmeta>
      <indexterm>
        <primary>OP_ACTION</primary>
      </indexterm>
      <refentrytitle>OP_ACTION</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>OP_ACTION</refname>
      <refpurpose>Client initiated some action</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
OP_ACTION [action]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>action</entry>
			<entry>int</entry>
			<entry>ACTION_NEWBOMB</entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Client initiated some action</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">action</emphasis></term>
	    <listitem>
	      <para>
		The action in question which was initiated by the player.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  Whenever a player sets up a bomb or does similar work.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

</section>

<section id ="server-to-client"><title>Server to client messages</title>

<para>
This section covers both broadcasts of player input messages and independent
server messages which can occur at any time.
</para>

  <refentry id="server.move"><?dbhtml filename="server.op_move.html">
    <refmeta>
      <indexterm>
        <primary>server.OP_MOVE</primary>
      </indexterm>
      <refentrytitle>server.OP_MOVE</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>server.OP_MOVE</refname>
      <refpurpose>Broadcast of character move by client</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
server.OP_MOVE [gen] [type] [id] [direction]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>gen</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>type</entry>
			<entry>int</entry>
			<entry><itemizedlist>
				<listitem><para>MOVE_PLAYER</para></listitem>
				<listitem><para>MOVE_MONSTER</para></listitem>
			</itemizedlist></entry>
		  </row>

		  <row rowsep="1">
		    <entry>direction</entry>
		    <entry>int</entry>
			<entry><itemizedlist>
				<listitem><para>MOVE_UP</para></listitem>
				<listitem><para>MOVE_DOWN</para></listitem>
				<listitem><para>MOVE_LEFT</para></listitem>
				<listitem><para>MOVE_RIGHT</para></listitem>
			</itemizedlist></entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Broadcast of character move by client</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">gen</emphasis></term>
	    <listitem>
	      <para>
		Message counter.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">id</emphasis></term>
	    <listitem>
	      <para>
		ID of the player of origin.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">type</emphasis></term>
	    <listitem>
	      <para>
		Can be either of move_player or move_monster.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">direction</emphasis></term>
	    <listitem>
	      <para>
		The direction of the move.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  The server sends this message whenever it receives a valid player move,
	  and whenever a monster has been moved.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

  <refentry id="server.cheat"><?dbhtml filename="server.op_cheat.html">
    <refmeta>
      <indexterm>
        <primary>server.OP_CHEAT</primary>
      </indexterm>
      <refentrytitle>server.OP_CHEAT</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>server.OP_CHEAT</refname>
      <refpurpose>Player ban notification</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
server.OP_CHEAT

			</entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Player ban notification</para>

      <refsect2>
	<title>Usage</title>
	<para>
	  If a player tries to cheat or a game client runs snafu, it will be
	  detected by the server. The offending player receives this message
	  immediately, while all other players get notified of this ban via
	  <link linkend="server.action">server.OP_ACTION</link>.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

  <refentry id="server.action"><?dbhtml filename="server.op_action.html">
    <refmeta>
      <indexterm>
        <primary>server.OP_ACTION</primary>
      </indexterm>
      <refentrytitle>server.OP_ACTION</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>server.OP_ACTION</refname>
      <refpurpose>Events of any kind</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
server.OP_ACTION [minor] [data...]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>minor</entry>
			<entry>int</entry>
			<!-- <entry>action_newplayer|...|action_highlightexit</entry> -->
			<entry><itemizedlist>
				<listitem><para>ACTION_NEWPLAYER</para></listitem>
				<listitem><para>ACTION_NEWMONSTER</para></listitem>
				<listitem><para>ACTION_NEWITEM</para></listitem>
				<listitem><para>ACTION_NEWEXIT</para></listitem>
				<listitem><para>ACTION_NEWBLAST</para></listitem>
				<listitem><para>ACTION_NEWBOMB</para></listitem>
				<listitem><para>ACTION_ITEM</para></listitem>
				<listitem><para>ACTION_REMOVEPLAYER</para></listitem>
				<listitem><para>ACTION_REMOVEMONSTER</para></listitem>
				<listitem><para>ACTION_REMOVEITEM</para></listitem>
				<listitem><para>ACTION_REMOVEBOMB</para></listitem>
				<listitem><para>ACTION_REMOVEBLAST</para></listitem>
				<listitem><para>ACTION_ACTIVATEITEM</para></listitem>
				<listitem><para>ACTION_ACTIVATEEXIT</para></listitem>
				<listitem><para>ACTION_HIGHLIGHTITEM</para></listitem>
				<listitem><para>ACTION_HIGHLIGHTEXIT</para></listitem>
			</itemizedlist></entry>
		  </row>

		  <row rowsep="1">
		    <entry>data</entry>
			<entry>varying</entry>
			<entry>...</entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Events of any kind</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">minor</emphasis></term>
	    <listitem>
	      <para>
		Minor opcode for further determining the event.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">data</emphasis></term>
	    <listitem>
	      <para>
		Event-specific data, outlined below.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

    <refsect2><title>Data formats</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWPLAYER
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>player</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWMONSTER
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWITEM
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>type</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWEXIT
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWBOMB
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>type</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_NEWBLAST
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>x</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>y</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_ITEM
			</entry>
		  </row>

		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>type</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>
		  <row rowsep="1">
		    <entry>change</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_REMOVEPLAYER
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_REMOVEMONSTER
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_REMOVEBOMB
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_REMOVEBLAST
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_REMOVEITEM
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_ACTIVATEITEM
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_HIGHLIGHTITEM
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>id</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_ACTIVATEEXIT
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>(none)</entry>
			<entry></entry>
			<entry></entry>
		  </row>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
ACTION_HIGHLIGHTEXIT
			</entry>
		  </row>
		  <row rowsep="1">
		    <entry>(none)</entry>
			<entry></entry>
			<entry></entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  All events such as map changes, player actions, item activations and so
	  on are announced with this message.
	</para>
      </refsect2>
    </refsect1>

  </refentry>

  <refentry id="server.state"><?dbhtml filename="server.op_state.html">
    <refmeta>
      <indexterm>
        <primary>server.OP_STATE</primary>
      </indexterm>
      <refentrytitle>server.OP_STATE</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>server.OP_STATE</refname>
      <refpurpose>Game state changes</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
server.OP_STATE [state]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>state</entry>
			<entry>int</entry>
			<entry><itemizedlist>
				<listitem><para>STATE_START</para></listitem>
				<listitem><para>STATE_STOP</para></listitem>
			</itemizedlist></entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Game state changes</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">state</emphasis></term>
	    <listitem>
	      <para>
		The new game state.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  The game isn't started before all requirements are in place, and might be
	  stopped anytime such a requirement is not fulfilled anymore.
	  Requirements include the correct player configuration and a running game.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

</section>

<section id ="game-messages"><title>Game message in both directions</title>

<para>
The messages present in this section exist in two formats: sent by the client,
and sent by the server. One of those is a request while the other one is a
response to it. Currently, this kind of messages is not used during the
gameplay itself.
</para>

  <refentry id="game.rules"><?dbhtml filename="game.op_rules.html">
    <refmeta>
      <indexterm>
        <primary>OP_RULES</primary>
      </indexterm>
      <refentrytitle>OP_RULES</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>OP_RULES</refname>
      <refpurpose>Client selected a rule set</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
OP_RULES [custom] [rulesetting...]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>custom</entry>
			<entry>int</entry>
			<entry>0/1</entry>
		  </row>

		  <row rowsep="1">
		    <entry>rulesetting</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Client selected a rule set.</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">custom</emphasis></term>
	    <listitem>
	      <para>
		Custom rules have been selected as opposed to default rules.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">rulesetting</emphasis></term>
	    <listitem>
	      <para>
		This multi-value field defines each aspect of the rule set.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  At the beginning of the game, when the rules have not been set yet,
	  and before the actual gameplay starts, the client may transmit the rules
	  to the server. Once the game starts, the same message is then broadcasted
	  to all participating clients.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

  <refentry id="game.map"><?dbhtml filename="game.op_map.html">
    <refmeta>
      <indexterm>
        <primary>OP_MAP</primary>
      </indexterm>
      <refentrytitle>OP_MAP</refentrytitle>
    </refmeta>

    <refnamediv>
      <refname>OP_MAP</refname>
      <refpurpose>Client sent a map of choice</refpurpose>
    </refnamediv>

    <refsynopsisdiv><title>Synopsis</title>
      <informaltable>
    <tgroup cols="3">
      <colspec colnum="1" colname="C1" align="left">
        <colspec colnum="2" colname="C2">
          <colspec colnum="3" colname="C3">
        <tbody>

		  <row rowsep="0">
		    <entry namest="C1" nameend="C3">
OP_MAP [minor] [mapname] [numplayers]

			</entry>
		  </row>

		  <row rowsep="1">
		    <entry><emphasis role="bold">Data</emphasis></entry>
		    <entry><emphasis role="bold">Type</emphasis></entry>
		    <entry><emphasis role="bold">Example</emphasis></entry>
		  </row>

		  <row rowsep="1">
		    <entry>minor</entry>
			<entry>int</entry>
			<entry><itemizedlist>
				<listitem><para>MAP_SELECT</para></listitem>
				<listitem><para>MAP_SELECTED</para></listitem>
			</itemizedlist></entry>
		  </row>

		  <row rowsep="1">
		    <entry>mapname</entry>
			<entry>string</entry>
			<entry>...</entry>
		  </row>

		  <row rowsep="1">
		    <entry>numplayers</entry>
			<entry>int</entry>
			<entry>...</entry>
		  </row>

		</tbody>
	</tgroup>
      </informaltable>
    </refsynopsisdiv>

    <refsect1>
      <title>Description</title>
      <para>Client sent a map of choice.</para>
      <refsect2>
	<title>Message Data</title>
	<variablelist>
	  <varlistentry>
	    <term><emphasis role="bold">minor</emphasis></term>
	    <listitem>
	      <para>
		Minor opcode distinguishing all OP_MAP messages.
		Can be MAP_SELECTED in this case, meaning a map has been selected for
		the game, or MAP_SELECT (sent by server), meaning a map should be
		selected.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">mapname</emphasis></term>
	    <listitem>
	      <para>
		The name of the chosen map (level).
		Only sent with MAP_SELECTED, not with MAP_SELECT.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><emphasis role="bold">numplayers</emphasis></term>
	    <listitem>
	      <para>
		Number of players expected to play with.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect2>

      <refsect2>
	<title>Usage</title>
	<para>
	  Similar to OP_RULES, this message is sent by the game host (usually the
	  first player) to the server, and then broadcasted at the start of the
	  game.
	  Contrary to it however, the message is only sent after having received
	  an OP_RULES with MAP_SELECT first. This message omits the mapname
	  parameter.
	</para>
      </refsect2>
    </refsect1>
  </refentry>

</section>

