Next: Using GNU Arch, Previous: Use as a library, Up: Hacker's guide

### 3.13 Network protocol

This section describes how Liquid War 6 handles network messages. Note that for now this is purely theorical, more of a draft, a plan, it might change before being implemented.

Bare technical stuff.

Out of band messages:

- UPTIME -> uptime in seconds
- ROUND -> number of rounds (session related)
- BPS -> number of net messages send per second
- LIST -> list all known servers
- PEERS -> list servers with active connections
- VERSION -> version of the program
- ID -> the id of this server
- SESSION -> the id of the session
- PING -> expects PONG
- URL -> an alternate URL, possibly proxied
- MAX -> max number of teams on this server/session
- PLAYERS -> players playing
- COLORS -> colors playing
- LOCKED -> expects "YES" or "NO"
- MOTD -> message of the day

TCP messages:

    LW6 <passwd> <client-id>
    MSG1
    MSG2

UDP messages:

    LW6 <passwd> <client-id> MSG1
    LW6 <passwd> <client-id> MSG2

HTTP messages:

    /lw6/<passwd>/<client-id>/MSG1
    /lw6/<passwd>/<client-id>/MSG2

HTTP public URLs:

    error 404 -> /lw6/
    /lw6/ -> HTML human readbable page
    /favicon.ico
    /lw6/favicon.ico
    /lw6/screenshot.jpg
    /lw6/<oob>

MSG syntax:

    <serial>-<i>-<n> COMMAND

COMMAND format:

    <round> <server-id> <command> <arg1> ... <argN>

COMMAND examples:

    2 1234abcd1234abcd REGISTER
    3 1234abcd1234abcd ADD 5678 YELLOW
    4 1234abcd1234abcd SET 5678 20 5
    10 1234abcd1234abcd NOP
    400 1234abcd1234abcd REMOVE 5678
    1000 1234abcd1234abcd UNREGISTER