Zappy Protocols =============== This document describes the communication protocols used in the Zappy project. --- GUI Protocol ------------ The GUI protocol defines messages exchanged between the server and the GUI client. ### Symbols and Meanings - **X**: width or horizontal position - **Y**: height or vertical position - **q0** to **q6**: quantities of resources - q0: food - q1: linemate - q2: deraumere - q3: sibur - q4: mendiane - q5: phiras - q6: thystame - **n**: player number - **O**: orientation (1=N, 2=E, 3=S, 4=W) - **L**: player or incantation level - **e**: egg number - **T**: time unit - **N**: name of the team - **R**: incantation result - **M**: message - **i**: resource number ### Server to Client Messages +--------------+------------------------------------+----------------------------------+ | Command | Description | Example | +==============+====================================+==================================+ | msz X Y | Map size | msz 10 10 | +--------------+------------------------------------+----------------------------------+ | bct X Y q0 q1 q2 q3 q4 q5 q6 | Content of a tile | bct 2 3 1 0 0 0 0 0 0 | +--------------+------------------------------------+----------------------------------+ | mct | Content of the entire map | mct | +--------------+------------------------------------+----------------------------------+ | tna N | Name of a team | tna TeamName | +--------------+------------------------------------+----------------------------------+ | pnw #n X Y O L N | New player connection | pnw #5 4 4 1 2 TeamName | +--------------+------------------------------------+----------------------------------+ | ppo #n X Y O | Player position | ppo #5 4 4 1 | +--------------+------------------------------------+----------------------------------+ | plv #n L | Player level | plv #5 3 | +--------------+------------------------------------+----------------------------------+ | pin #n X Y q0 q1 q2 q3 q4 q5 q6 | Player inventory | pin #5 4 4 1 0 0 0 0 0 0 | +--------------+------------------------------------+----------------------------------+ | pex #n | Expulsion | pex #5 | +--------------+------------------------------------+----------------------------------+ | pbc #n M | Broadcast message | pbc #5 Hello team! | +--------------+------------------------------------+----------------------------------+ | pic X Y L #n ... | Start of an incantation | pic 2 3 2 #5 #6 | +--------------+------------------------------------+----------------------------------+ | pie X Y R | End of an incantation | pie 2 3 1 | +--------------+------------------------------------+----------------------------------+ | pfk #n | Egg laying | pfk #5 | +--------------+------------------------------------+----------------------------------+ | pdr #n i | Resource dropping | pdr #5 0 | +--------------+------------------------------------+----------------------------------+ | pgt #n i | Resource collecting | pgt #5 0 | +--------------+------------------------------------+----------------------------------+ | pdi #n | Player death | pdi #5 | +--------------+------------------------------------+----------------------------------+ | enw #e #n X Y | Egg laid by a player | enw #10 #5 4 4 | +--------------+------------------------------------+----------------------------------+ | ebo #e | Player connection for egg | ebo #10 | +--------------+------------------------------------+----------------------------------+ | edi #e | Death of an egg | edi #10 | +--------------+------------------------------------+----------------------------------+ | sgt T | Time unit request | sgt 100 | +--------------+------------------------------------+----------------------------------+ | sst T | Time unit modification | sst 50 | +--------------+------------------------------------+----------------------------------+ | seg N | End of game | seg TeamName | +--------------+------------------------------------+----------------------------------+ | smg M | Message from the server | smg Welcome to Zappy! | +--------------+------------------------------------+----------------------------------+ | suc | Unknown command | suc | +--------------+------------------------------------+----------------------------------+ | sbp | Command parameter | sbp | +--------------+------------------------------------+----------------------------------+ --- For the AI client protocol, please refer to the `developer/usage_ai.rst`. ---