seriesoftubes/scripts
jvanvik 95aa9b6532 Multiplayer for self-hosted copies: sessions, server-side saves, a leaderboard
Off unless the page is built with MP_API set (MP_API=/api/mp npm run
build): a plain build has no door, no chip and makes no requests. The
session server is scripts/mp-server.js (npm run mp), plain node:http,
which can also serve the built site so one process sits behind the
reverse proxy; docs/MULTIPLAYER.md has the nginx and Caddy setups.

A session has a six-character code, one seed and one rules preset, so
every player starts in the same world, and up to twelve players with
their own AS numbers. Saves go to the server on a new game day at most
every 15 s and when the page hides, ordered by a sequence number (409 on
a stale push, and the player picks which one to keep). Tokens live in
localStorage, never in the save; the server keeps only their hash. A
#mp= link moves a network to another device. The session panel shows
the leaderboard, the feed and a short chat; each player's public card
(tier, POPs, links, exchanges, transit, peak, customers, score) carries
what in-game peering between players will need next.

Server limits: body sizes, one upload per player, uploads per address
and in total, sessions per hour, wrong-code lockout; addresses counted
per IPv6 /64, X-Forwarded-For only with --trust-proxy.
2026-11-07 00:42:39 +01:00
..
agent Tests wait for state instead of sleeping, on free ports 2026-11-05 11:38:26 +01:00
legacy Docs: the single-file page and English keys lasted until 1.34 2026-10-27 11:28:17 +01:00
lib Multiplayer for self-hosted copies: sessions, server-side saves, a leaderboard 2026-11-07 00:42:39 +01:00
build.js Multiplayer for self-hosted copies: sessions, server-side saves, a leaderboard 2026-11-07 00:42:39 +01:00
dev.js Multiplayer for self-hosted copies: sessions, server-side saves, a leaderboard 2026-11-07 00:42:39 +01:00
gpu-bench.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
i18n-add.js Harden workflows and dev scripts against code-scanning findings 2026-11-05 21:04:21 +01:00
i18n-check.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
mcp.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
mp-server.js Multiplayer for self-hosted copies: sessions, server-side saves, a leaderboard 2026-11-07 00:42:39 +01:00
perf-bench.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
perf-browser.js GPU benchmark: isolate trials, time the card, say which map drew 2026-11-04 22:37:13 +01:00
perf-fixture.js Performance benchmark on a big network, posted on every PR 2026-10-26 06:39:23 +01:00
perf-stats.js Benchmark in real Chromium too, and only call a row slower when the samples say so 2026-10-26 12:04:57 +01:00
release-notes.js Release notes: a story for big releases, and the 2.0 story 2026-10-30 16:28:19 +01:00
route-fuzz.js Differential random games: main's page and this checkout's play the same seeded game move for move 2026-11-01 21:44:30 +01:00
test-timings.js CI: tests in four parts on four runners, every core in use, older PR runs cancelled 2026-10-31 14:11:02 +01:00
test.js Tests wait for state instead of sleeping, on free ports 2026-11-05 11:38:26 +01:00
weekly-architect.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
weekly-puzzle.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00
weekly-scenario.js Fix CodeQL code-scanning alerts 2026-11-05 21:24:26 +01:00