| ParlorNet Turn-based game server for any computer, old or new | |
| Clients | Protocols | Browsers | Telnet programs | Docs | Source |
Two players. Single-step moves (no staged). A hidden-information game: each player places a fleet on their own grid, and the two then take turns firing one shot at the other's grid. The server holds both fleets; a view and the events never show a square of a ship to anyone but its owner until that ship is sunk.
Rulesets (the grid is 10 by 10 in both):
Every ship lies straight, across or down. Options: none; NEW with any game option is refused (ERR BADOPT no options for this game). turn=, vis= and players= are the server's (protocol.md). Planned: salvo=1, a salvo of one shot per ship still afloat each turn; it would add a staged turn (one MOV per shot, then END) and is not part of this version.
Seat 0 fires first. There is no draw: the game ends when one fleet is entirely sunk, or by the shared ends (resign, timeout, abandoned).
The turn clock: the game starts with TURN 0, so seat 0 is on the clock while placing. When seat 0 is ready and seat 1 is not, TURN 1 puts seat 1 on the clock. When both are ready, TURN 0 starts the shooting with a fresh clock. A player who never places their fleet loses on time like any other.
| Line | Meaning |
|---|---|
| BRD w h | The grid: BRD 10 10. |
| FL len len ... | The fleet, in placement order: FL 5 4 3 3 2 (classic), FL 4 3 3 2 2 2 1 1 1 1 (batnav). |
What a line shows depends on who asks: the server builds each seat's view (and the watchers' view) from what that viewer may know.
| Line | Meaning |
|---|---|
| Q phase | place, shoot or over. |
| W seat | Whose turn it is; W - when the game is over. While placing, a seat whose fleet is not ready sees its own seat (it has a move to make); others see the first seat still placing (the one on the clock). |
| RD r0 r1 | 1 when that seat's fleet is placed and ready. |
| B seat y cells | Row y (1-10, from the top) of seat's waters, one character per column a-j: . nothing known (for the owner: open water), o a miss, x a hit, # a square of a sunk ship, and only in the owner's own view s a ship square not hit. Rows that are all . are not sent. |
| Y len from-to | The viewer's own ships (seated players only, never another seat's), in placement order: Y 5 a1-e1. |
| N len | While placing: the length of the viewer's next ship (absent once the fleet is complete or ready). |
| K seat len from-to | A sunk ship of seat's fleet, for everyone: every square of it has been hit. |
| L n0 n1 | Ships afloat per seat (the whole fleet until that seat is ready). |
| LS seat sq | The last shot: who fired, and where. |
The common lines S, M and CLK mean what protocol.md says.
For a watcher, both grids show only shots and sunk ships; no Y or N lines. A seat's view of the other grid is the same as a watcher's. The view's data (JSON for modern clients) carries the same filtered rows, never the state.
The rows are a dense encoding because a grid fills with shots: 20 rows of 17 bytes is the worst case, and an empty grid sends nothing.
CHK of a shot says only whether it may be fired (OK); it never tells hit or miss.
Events go to every player and watcher, so none names a square of a ship that has not been hit:
A full view is about 60 bytes while placing (plus the M list: up to about 140 placements of 6 to 8 bytes for the player placing), and at most about 450 bytes late in the game. Typical event 15-30 bytes.
| These pages cover every ParlorNet server. | Source code | ParlorNet is free software. |