Update wire protocol to version 5, introducing pupil slots and item counts in map snapshots. Enhance UI components to display pupil slots and item counts in game screens and map editors. Revise localization strings for improved user guidance. Update tests to validate new functionalities and ensure robustness in handling room and item data.
ci / server (push) Failing after 3m37s
ci / client (push) Successful in 28s

This commit is contained in:
Leonid Pershin
2026-08-18 17:21:16 +03:00
parent f000b128f6
commit 38afbcad36
26 changed files with 349 additions and 64 deletions
+10 -3
View File
@@ -1,4 +1,4 @@
# Wire protocol v4
# Wire protocol v5
The client talks to the server two ways:
@@ -65,6 +65,10 @@ Placeable (non-abstract) types plus labels in `lang`, and the last-wins `maps/de
`core` plus the listed extras. The server always prepends `core`. `mods` is a comma-separated
list of extra pack ids; omit it for vanilla. Unknown extras return `400` `unknown-mod`.
Room slots include a `count` (how many of the default thing the def places). Things carry
`pupilSlots` — how many pupils that thing hosts for lessons. The create editor copies both onto
the map instance; the snapshot's per-node pupil-slot total is computed on the server.
`lang` is the same value Hello carries — not `Accept-Language`. Anything other than `en` is
Russian.
@@ -243,9 +247,12 @@ Each node:
| string | instance id |
| string | parent id (empty for the yard) |
| string | display name |
| `u8` | item count, then that many strings |
| `u16` | pupil slots — how many pupils can take a lesson here. Summed from things on the server. |
| `u8` | item count, then that many records of: string name + `u8` count |
| `u8` | position count, then that many strings |
Item `count` is how many of that thing stand in the room (`Парта ×16` is one record, not sixteen). The client must not recompute pupil slots from items.
## Guarantees and limits
- **Inbound** frames larger than 8 KiB are refused with close status `1009 MessageTooBig`. That
@@ -258,7 +265,7 @@ Each node:
the oldest, because a stale clock is worthless once a newer one exists.
- The map snapshot uses a separate reliable queue so ticks cannot crowd it out.
## Not in v4 yet
## Not in v5 yet
Authentication, Sit orders, an event log, and `OpenLocation` on the server — the tree is filtered
on the client from the snapshot. The school's ECS world is created but still empty.