Server-run play, part 1: game prerequisites and shared contracts

Groundwork for running multiplayer games on the session server; nothing
of it is switched on yet, and the plain build is unchanged.

- A new network in two halves (beginState/beginShow), the coach split into
  tutAdvance/coachDom, toastPop split out of toast, bootNotes() for the
  once-per-load toasts, the five text actions take their text as an
  argument, and srvOn() with its two checks in the loop.
- Live state is what a reload makes of it (migrate() is a no-op on it):
  new POPs, ports, PNIs, customers, attacks, dark fiber and the intern's
  notes are written in their saved shape; a 365-day test proves it.
- pniAll and bstdApply check the quote the sheet showed (bstdApply by its
  plan, within 1% for the daily hardware drift; utilityKit too).
- assemble({mp}) leaves src/game/98-server-play/ and its CSS out of every
  page but a multiplayer build's, which also gets a SIM_ID build id.
- Contracts for the server, protocol and browser parts: the action tables
  and envelope check (scripts/lib/mp-sim-acts.js), event fixtures, a shape
  checker, a fake engine, and load({mp:true}) in the test harness.
- route-fuzz judges both pages with one migrate(), so reload repairs of
  the base no longer count as divergences.
This commit is contained in:
jvanvik 2026-11-07 10:26:06 +01:00
parent e25f843526
commit d1e127da67
60 changed files with 2200 additions and 105 deletions

View file

@ -5,6 +5,7 @@
"tests/backbone-core.test.js": 27.5,
"tests/badges-variants.test.js": 20.2,
"tests/build.test.js": 1.3,
"tests/canonical-state.test.js": 64.0,
"tests/capacity-deals.test.js": 12.6,
"tests/chaos-monkey.test.js": 30.3,
"tests/city-size.test.js": 8.5,
@ -31,6 +32,7 @@
"tests/modes.test.js": 41.1,
"tests/more-cables.test.js": 14.3,
"tests/moscow-premium.test.js": 12.0,
"tests/mp-sim-contract.test.js": 7.0,
"tests/networks-list.test.js": 6.4,
"tests/new-game-speed.test.js": 10.1,
"tests/optic-counts.test.js": 9.7,
@ -59,6 +61,7 @@
"tests/save-slots.test.js": 48.5,
"tests/scenarios-playtest.test.js": 113.2,
"tests/sea-routing.test.js": 42.6,
"tests/server-sim-prereqs.test.js": 16.0,
"tests/services.test.js": 15.7,
"tests/specialist.test.js": 14.3,
"tests/speed.test.js": 144.6,