Devlog: N6 and N9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -723,3 +723,40 @@ four days left. Next: N6 (#37, joining: direct connect, LAN and server list, and
|
||||
joining a running match as a spectator), N9 (#40, server-side protection) and N8
|
||||
(#39, the 24-client soak), then N7 (#38). To make Monday, v0.6 has to be cut to its
|
||||
high-priority issues, and A3, A7, A12 and A13 deferred.
|
||||
|
||||
## 2026-11-12 (evening): N6 and N9
|
||||
|
||||
**Start of run:** clean tree, and the fast-forward pull was a no-op. The Agents category had nothing new for this task, and nothing was posted.
|
||||
|
||||
**Done:**
|
||||
- **N6 (#37), joining games.**
|
||||
- LAN discovery: `ServerBeacon` answers on the game port + 1, and `ServerBrowser` scans eight game ports from 24650.
|
||||
- A self-hostable list server: `--list-server`, `ListServer`, UDP 24660. A game server registers with `--list=HOST[:PORT] --name=NAME` and is listed under its source address only after it echoes a challenge token.
|
||||
- Discovery messages are in `NetDiscovery`. Queries are padded to 512 bytes and no answer is larger.
|
||||
- `--browse` prints the servers found as JSON.
|
||||
- People who connect mid-match or during results now watch (`Match.watch()`) and take places ahead of bots in the next lobby, instead of being told the server is full.
|
||||
- `make discovery-check` is new.
|
||||
- **N9 (#40), cheat and abuse protection.**
|
||||
- A hostile client crafts INPUT bytes through `NetGame.take_input()` into a real match. Its speed, teleport, rapid-fire, out-of-range build and duplicate-item cheats all fail.
|
||||
- Fix: a far-future command tick no longer advances NetGame's dedupe marker. One bogus packet could otherwise lock a player out of their own commands.
|
||||
- Per-address connection limits, with a new `REASON_BUSY`.
|
||||
- `ParserFuzz` and `make fuzz`.
|
||||
- Deferred with comments, per the pacing rule: A3 (#43), A7 (#47), A12 (#52), A13 (#53), H7 (#70), H8 (#71) and H10 (#74).
|
||||
|
||||
**Tests:**
|
||||
- `make check` passes on the pushed tree: 478 tests, self-check and smoke (p99 2.4 ms with 24 bots).
|
||||
- `make client-check` passes, two processes over UDP: joined, lobby to drop, 3,647 frames playing, no bad packets.
|
||||
- `make discovery-check` passes. Real processes found the server both on the LAN (loopback) and through the list server.
|
||||
- `make fuzz`: 1,000,000 messages in 35 s, 0 engine errors, 2.9 KB of memory growth past warm-up, 114,340 accepted by some parser, and no list entries.
|
||||
|
||||
**Decisions and what I learned:**
|
||||
- `Match.join()` now refuses during DROP, PLAY and RESULTS. Before, a join with a free place succeeded mid-match, which left a participant with no entity and no view. Watchers live in `Match.watchers` and reuse the spectator machinery (`_retarget`), so `NetGame.viewer_of()` needed only a reorder.
|
||||
- The list server keys entries by source address and port, binds the token to both, and derives it from a per-start secret, so nothing is stored per challenge. The per-address cap of 8 matters in tests: every fake server is 127.0.0.1.
|
||||
- A LAN scan only asks game ports 24650 to 24664 (even numbers). A server elsewhere is found with `--lan-port`, through a list, or by address.
|
||||
- Hostile tests have to respect `MAX_INPUT_COMMANDS` (8). A bigger INPUT is refused whole, which first made a speed test pass because nothing moved. The test now also asserts the cheater does move.
|
||||
- `tools/godot.sh` with no mode runs the game headless and never exits. Don't run it bare: I did once, as a parse check, and had to stop it. Use `make parse`.
|
||||
- New `class_name` files need `make import` before `tools/run_tests.sh` can see them. `make test` does that itself.
|
||||
|
||||
**Known gaps:** broadcast discovery hasn't been tried on a physical LAN; only loopback was tested. There are no menus yet, so the list exists only through `--browse` (A10). The connection limits are guesses and have not been tested against a real attack.
|
||||
|
||||
**Pace:** v0.5 has N7 (#38, packaging) and N8 (#39, soak) left. It was due on the 11th, so this is still more than a day behind with three and a half days left. Next: N8 (#39), then N7 (#38). After that, v0.6 is cut to its high-priority issues: #78, A1, A2, A4, A5, A6, A8, A9, A10 and A11.
|
||||
|
||||
Reference in New Issue
Block a user