<para>
  The &kamikaze; server and client communicate via messages encoded
  in raw binary format for performance reasons. Most messages consist
  of a major opcode, a minor opcode and the payload of the message.
</para>

<para>
  Interactions are presented here categorically. For a complete
  reference of client-server interactions, please see the
  <link linkend="appendix">appendix</link>.
</para>

<section id="startup">
  <title>Game startup</title>

  <para>
    The first player, called game host, selects a map and a set of rules for
    the game. It gets notified about the number of player by the server first:
    <link linkend="game.map">OP_MAP</link>
    The map and the final number of participants (which may range from 1 to the
    number received from the server) is then sent to the server via a similar
    <link linkend="game.map">OP_MAP</link>
    message. A rule set might not be sent at all (in which case the default
    rules are used), unless the
    <link linkend="game.rules">OP_RULES</link>
    message is sent by the client.
  </para>

  <para>
    Once a game starts, the server builds the map and sends it back to all
    participating players with the
    <link linkend="game.map">OP_MAP</link>
    command. The same applies for the game rules which are sent via the
    <link linkend="game.rules">OP_RULES</link>
    message.
  </para>

</section>

<section id="player-interaction">
  <title>Player interaction</title>

  <para>
    The player is moving in either horizontal or vertical direction.
    Those moves are sent to the server as an
    <link linkend="client.move">OP_MOVE</link>
    message. A player can set up a bomb somewhere, in which case the server
    will receive an
    <link linkend="client.action">OP_ACTION</link>
    message.
    Both messages are broadcasted to all players by the server, whereas more
    might be sent out (with different meanings) by the server itself.
    This is what the server-side
    <link linkend="server.move">OP_MOVE</link>
    and
    <link linkend="server.action">OP_ACTION</link>
    are for.
  </para>

</section>

<section id="game-flow">
  <title>Game flow</title>

  <para>
    At any time, the server controls the game flow. The game can be started and
    stopped, indicated by the
    <link linkend="server.state">OP_STATE</link>
    messages. Another message sent out without explicit request is
    <link linkend="server.cheat">OP_CHEAT</link>,
    which notifies a player that his client has been disconnected due to
    unexpected behaviour.
  </para>

</section>

