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.
This commit is contained in:
+12
-9
@@ -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
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
Protocol — ни на кого из игровых проектов (только байты)
|
||||
Content — ни на Protocol, ни на Simulation, ни на ASP.NET
|
||||
People → Content (defs, карта, склонения; без Arch и хоста)
|
||||
Simulation → Content (каталог и раскладка; People — в фазе 7)
|
||||
Server → Protocol, Simulation, Content
|
||||
Simulation → People, Content (ростер в World; без HTTP)
|
||||
Server → Protocol, Simulation, People, Content
|
||||
Client — своя сторона Protocol (TS) + HTTP
|
||||
```
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
|
||||
## Задачи
|
||||
|
||||
- [ ] Ванильная карта дорабатывается до одиннадцати кабинетов; подписи кабинетов становятся
|
||||
- [x] Ванильная карта дорабатывается до одиннадцати кабинетов; подписи кабинетов становятся
|
||||
номерами помещений («204»), а не именами классов
|
||||
- [ ] Компоненты Arch под слои человека; сущности собираются из записей генератора
|
||||
- [ ] Класс как сущность: параллель, литера, закреплённый кабинет
|
||||
- [ ] Нужды тикают вместе со школой — механика есть, скорость в `core` нулевая
|
||||
- [ ] `saves/{id}.people.json`: сид, люди, семьи, классы. Пишется **только** при изменении
|
||||
- [x] Компоненты Arch под слои человека; сущности собираются из записей генератора
|
||||
- [x] Класс как сущность: параллель, литера, закреплённый кабинет
|
||||
- [x] Нужды тикают вместе со школой — механика есть, скорость в `core` нулевая
|
||||
- [x] `saves/{id}.people.json`: сид, люди, семьи, классы. Пишется **только** при изменении
|
||||
состава, не по таймеру; `saves/{id}.json` остаётся маленьким и частым
|
||||
- [ ] Загрузка ростера при старте школы; ростер, не сходящийся с картой, оставляет школу
|
||||
- [x] Загрузка ростера при старте школы; ростер, не сходящийся с картой, оставляет школу
|
||||
незапущенной и файл нетронутым — как сейчас с картой
|
||||
- [ ] Воркер публикует неизменяемый снимок ростера, как публикует `SchoolState`
|
||||
- [x] Воркер публикует неизменяемый снимок ростера, как публикует `SchoolState`
|
||||
|
||||
## Критерий готовности
|
||||
|
||||
|
||||
@@ -33,6 +33,6 @@
|
||||
| --- | --- | --- |
|
||||
| [5. Дефы человека](05-people-defs.md) | ✅ | Навыки, черты, тело, нужды, наборы имён в каталоге |
|
||||
| [6. Библиотека генерации](06-people-generator.md) | ✅ | `HSchool.People`: семьи из карты и сида |
|
||||
| [7. Люди в школе](07-people-in-school.md) | ⬜ | Сущности в `World`, ростер на диске, 11 кабинетов в `core` |
|
||||
| [7. Люди в школе](07-people-in-school.md) | ✅ | Сущности в `World`, ростер на диске, 11 кабинетов в `core` |
|
||||
| [8. Просмотр людей](08-people-browser.md) | ⬜ | Панель со списком, фильтрами и карточкой |
|
||||
| [9. Годовой набор](09-yearly-intake.md) | ⬜ | Первое сентября: переход, выпуск, набор |
|
||||
|
||||
Reference in New Issue
Block a user