Commit Graph
10 Commits
Author SHA1 Message Date
SirStone ea6d92bf76 server: refresh a player's sight when a connection starts receiving state (#23) 2026-11-15 12:11:42 +01:00
SirStone 20dcb87afb server: the character and name intents, player names and the roster (#23) 2026-11-15 12:01:26 +01:00
SirStone 81898ab69c server: resize, status and prop intents in the mutation pipeline (#22)
`token.resize`, `status.set`, `status.clear`, `prop.set` and `prop.unset`
answer the 6.1 acks and codes; `token.create` now accepts `radius` and
`props` and computes the placement status before writing the row, so a token
dropped on a wall is born `stuck`. `token.update` keeps refusing the
character link and ignores `radius`/`props` (their intents own them).

Wall add/update/remove and door.set now run the pure rules on a snapshot
taken before the write and apply the outcome after it committed
(`applyRuleOutcome`: positions and walls-sourced statuses in one NORMAL
transaction, memory after COMMIT), which replaces the door-push-only helpers
and adds the 5.5 SET/KEEP/CLEAR rules and the squeeze of a failed push. A
value over the bucket cap is refused without touching the token (the clone
makes the cap check side-effect free). Prop keys are never logged.
2026-11-15 11:02:35 +01:00
SirStone df4634d12a server: load and persist explored with every mutation (#21)
Startup restores each player's grid from its chunk rows (explored_loaded log) and every
mutation writes only the chunks its refresh dirtied, in the mutation's transaction: a move
keeps position and chunks in one NORMAL commit, a GM authoring write adds one NORMAL chunk
transaction under the same lock, before the ack. db.withTransaction is the shared seam.
2026-11-15 09:58:19 +01:00
SirStone 9c512e74bc server: tidy the slice comments after the rollout (#20) 2026-11-15 09:37:33 +01:00
SirStone 6fcf7f8271 server: token intents, the resync and the door push (#20)
token.create/update/remove (GM) and token.move (controller, or GM) through
moverules: the uniform nack for locked/over-cap/collision and for an out-of-bounds
GM move, one not-allowed code for a player's unknown and not-yours targets, not-found
for the GM; accepted moves are persisted with NORMAL durability and the mover's
vision recomputed. token.update honours kind, both names, controller, gm_only,
flags and vision_radius, and refuses character_id until slice 8.

connect now sends hello, the GM walls snapshot and the 6.3 token half (vision,
explored full, tokens) under the global lock, so hello is always the first frame and
the resync is the diff base. Egress runs under the same lock, per mutation, so no two
threads touch a connection's known table and an unnamed player is never fed state.

door.set applies the 5.5 push: the move rules compute the new positions against the
pre-write state, the positions are persisted in one transaction, then memory and
vision follow (stuck/squeezed are slice 7). player.remove hands the controlled
tokens to the GM in memory as the FK already does in the DB.
2026-11-15 09:35:19 +01:00
SirStone a8f508ef2e server: wall and door intents, GM wall snapshot and fan-out (#19)
wall.add, wall.update, wall.remove and door.set leave the unknown-type rollout
list: field shapes and ranges per 6.1 (and the payload rules recorded FIXED in
4.4/6.1), lookup failures not-found, non-GM refused by the existing GM-only
gate. wall.add acks {id} from the scene's next_wall_id; wall.update patches
a/b/kind/flags only (open belongs to door.set); door.set is invalid on a plain
wall. Effects go to every GM connection only: wall / wall_gone, plus one walls
snapshot right after hello (the wall part of the 6.3 resync). Players receive
no wall data in any message (3.1, T2).

protocol.nim gains the wallObject/wallsFrame/wallFrame/wallGoneFrame builders
(no n: the sender stamps it per recipient) and the five wall intents in the
implemented set.
2026-11-15 08:49:20 +01:00
SirStone 88dd27e2cc server: hello, one ack per intent, proto check, rate limit, flood, ping (#18)
The protocol shell over the socket, in DESIGN 6.5 order: spend a token, parse, then
unknown type / unnamed player / role / fields / lookup / semantics. Every readable
intent gets exactly one ack with a 6.5 code; an unreadable frame gets one error.

- hello {proto, role, me} as the first frame (n = 1); the scene block lands in slice 5
- /ws?proto=N is required: 400 when absent or not an integer, 101 + closing 4003 on
  a mismatch (no hello, no state)
- intent bucket 30/s burst 100 and the 10-in-10-s malformed flood (closing 1008);
  a rate-limited intent applies nothing and the connection stays open
- mummy maxMessageLen stated explicitly (64 KB) and mummy's own log lines routed
  through the event log instead of stdout
- server Ping(seq) right after hello and every 20 s (lag enforcement stays M5);
  inbound Pings are answered with a Pong, which mummy does not do itself
- close reasons: every server-initiated close sends closing {reason, code} then the
  close frame, and slice 2's eviction/revocation paths do the same (FIXED, #18)
2026-11-15 08:33:07 +01:00
SirStone 9d43aef9ed server: /join, session cookies, ws auth and gm-key CLI (#17) 2026-11-14 22:13:09 +01:00
SirStone f376efdc39 server: config, migrations, redacted logging, /healthz entrypoint (#16) 2026-11-14 21:40:39 +01:00