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

### 3.10 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:

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

COMMAND format:

    Todo...