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.

Interactions are presented here categorically. For a complete reference of client-server interactions, please see the appendix.

# Game startup

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: OP_MAP 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 OP_MAP message. A rule set might not be sent at all (in which case the default rules are used), unless the OP_RULES message is sent by the client.

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

## Player interaction

The player is moving in either horizontal or vertical direction. Those moves are sent to the server as an OP_MOVE message. A player can set up a bomb somewhere, in which case the server will receive an OP_ACTION 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 OP_MOVE and OP_ACTION are for.

## Game flow

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