5 Commits
Author SHA1 Message Date
SirStone fda83621f3 fix(server): broadcast roster on plain connect and close (#88)
A reconnect with an existing name fires no intent, so the only roster the
GM saw was the connecting connection's own resync; the row stayed offline
while the player badge said Connected.

Send the GM roster when a connection activates (skipping the connecting
connection, which already got it in the 6.3 resync) and after a close, with
the registry entry removed first so connected is recomputed. Also cover the
server-initiated malformed-flood close. The setname ack-before-resync
ordering is unchanged.

Tests: WS connect/close/reconnect roster states; e2e GM row follows a
player tab reload and close. protocol test updated for the extra roster on
a second connection.
2026-11-21 23:44:51 +01:00
SirStone 41c2fe695b fix: player.setname acks before its effects (#33)
The durable write and registry update stay put; the ack is enqueued
between the commit and the first effect, then hello, the full resync and
roster follow in their existing order. The failure paths are unchanged.
Frame-order test pins ack first on the renaming connection.
2026-11-20 21:36:47 +01:00
SirStone 8e045b0ac8 names: per-player reveal, one encountered write path, link by update (#27, #29, #30)
name.reveal wrote the subject's actual name into the encountered row of every
player who had met it: the SQL had no player predicate, so the leak was silent
live and visible only after a restart. rewriteEncountered is now the one path
that keeps a snapshot in step with its subject: it rewrites the SQLite row and
the live in-memory entry together from the name rule, takes onlyPlayer for
name.reveal (every player for reveal_all), and also runs on a rename, a link
change and an owner change, so the wire and a post-restart reload cannot
disagree (#30). The DB-only renameEncountered*/revealEncountered* helpers are
gone, which is what let the two stores drift.

token.update {character_id} now drops the token's own two names as part of the
link patch (#29): a plain token can be linked, names supplied with a link stay
invalid and unlinking still needs both names.

Tests: tcharacters covers the per-player row, the DB/memory equality, the link
handover; restart.test.mjs builds three named players, reveals to one of them
and asserts the rows directly and the whole resync over SIGTERM/SIGKILL, plus a
mid-session rename; leak.mjs/leakcheck.nim pit two players on the same subject
and pin each entry's expected name (STALE_NAME). Mutations e1-e3 and the
repointed b2 pin the three rules.
2026-11-15 14:26:07 +01:00
SirStone ea6d92bf76 server: refresh a player's sight when a connection starts receiving state (#23) 2026-11-15 12:11:42 +01:00
SirStone f134534c6c tests: characters, names, the encountered list and migration step 7 (#23) 2026-11-15 12:01:30 +01:00