Enhance school simulation and management by integrating roster functionality, allowing for the installation and persistence of student and staff data. Update the school architecture to include a roster alongside existing components, ensuring proper validation against map layouts. Revise room definitions to support homeroom designations and update related tests to validate new functionalities and ensure robustness in roster handling.
ci / server (push) Failing after 3m43s
ci / client (push) Failing after 10s

This commit is contained in:
Leonid Pershin
2026-08-18 19:21:40 +03:00
parent e6182e0e45
commit 52c5082418
27 changed files with 732 additions and 66 deletions
+12 -9
View File
@@ -16,8 +16,9 @@ there is no UI on the server.
│ │ │ ├─ Clock│ │
│ │ │ ├─ Catalog (frozen Content) │
│ │ │ ├─ Map │
│ │ │ World│ (Arch ECS, empty for now)
│ │ ├── SchoolStore │ saves/{id}.json
│ │ │ Roster
│ │ │ └─ World│ (Arch ECS: people, classes)
│ │ ├── SchoolStore │ saves/{id}.json + {id}.people.json │
│ │ ├── ModContent │ mods/<id>/ │
│ │ └── ClientRegistry │ │
│ └────────────────────────┘ │
@@ -75,9 +76,8 @@ touching a school itself.
## Schools
A `School` is one save: an id, a name, a `GameClock` and an Arch `World`. The world is empty
today — pupils, rooms and staff land in it as the game grows — but it is created and destroyed
with the school so ownership is never in question.
A `School` is one save: an id, a name, a `GameClock`, a frozen catalog, a map, a roster and an
Arch `World`. Pupils, staff and parents live in that world as entities; they do not walk yet.
`GameClock` moves while it is running, in fixed steps:
`realSeconds × gameMinutesPerRealSecond × speedMultiplier`. At the defaults that is 5 game minutes
@@ -97,13 +97,16 @@ cannot land between a mouse-down and a click.
## Saves
Each school is a JSON file under `Simulation:SavesDirectory` (`saves/{id}.json` plus `index.json`
for the next id). The worker writes on create, on shutdown, and on a rare clock snapshot
(`SaveIntervalSeconds`, 30 by default) — never on every tick. Pause and speed changes are written
for the next id, and `saves/{id}.people.json` for the roster). The worker writes the clock file on
create, on shutdown, and on a rare clock snapshot (`SaveIntervalSeconds`, 30 by default) — never
on every tick. The people file is written only when composition changes (create, and later yearly
intake). Pause and speed changes are written
too, but coalesced to at most one write per `MinSaveIntervalMilliseconds`: a client can send those
as fast as the socket allows, and each one is a file write on the school's own thread. Shutdown
always flushes, so a pause is never lost. The file also stores the
always flushes, so a pause is never lost. The clock file also stores the
mod pack ids and the map layout; the catalog is loaded again from `mods/` on start. A missing
mod folder or a map that no longer validates leaves the file in place and that school unstarted.
mod folder, a map that no longer validates, or a roster that no longer fits the map leaves the
files in place and that school unstarted.
## Connection lifetime