B7.2.1 · dive 1 of 3 · module B7.2
Room as template and mode.
A ROM is a template — emoji set, duration, fee, seed pool, and a mode with its four policies; a GAM is one game in it that snapshots the template, and a RMP is a player’s reified place in the room.
The idea
codemojex · rooms and modesA room is a template, not a game. A ROM holds the durable settings — an emoji set, a duration, a guess fee, whether it is paid or free, a seed pool — and, in the reconciled model, a mode and its four policies. A game, a GAM, is one instance played in that room: when it opens it snapshots the room’s settings and generates the secret, so a change to the template later does not disturb a game already running.
Only one game runs in a room at a time. The room is the long-lived thing players return to; the game is the bounded round with a secret, a timer, and a state. This separation is what lets the engine carry a mode on the room and have every game inherit it: a classic room produces live games, a Golden Room produces blind ones, from the same template shape.
A player’s place in a room is itself an entity, a RMP membership, with a lifecycle — joined, active, left, banned — and a per-game display alias. Reifying the membership rather than leaving it an unnamed edge is what makes moderation, presence, and the anonymized leaderboard work without a new identity type.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- Helland — Life Beyond Distributed Transactions (CIDR 2007)a room template and a game as durable entities a record can hold
- Erlang/OTP — the gen_server behaviourthe room and game as systems behind a boundary
- The Go Blog — Share Memory By Communicatinga membership and a snapshot passed by value, not by shared state
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus