The dice roll once
Rejoining a room replays the whole chronicle through the same events channel that carries live play, so the opening roll-off modal fired on every return. The replayed chronicle is now flagged, and one-time fanfare stays quiet on it — the log still rebuilds in full. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ef5336caa8
commit
4a4e164e88
@@ -319,9 +319,11 @@ wss.on("connection", (socket) => {
|
||||
session.roomId = room.id;
|
||||
session.token = result.token;
|
||||
send(socket, { type: "seat", playerId: name, token: result.token });
|
||||
// Rejoining a running game: replay the chronicle so far.
|
||||
// Rejoining a running game: replay the chronicle so far. The
|
||||
// replayed flag keeps one-time fanfare (the opening roll-off)
|
||||
// from firing again on every return to the room.
|
||||
if (room.state) {
|
||||
send(socket, { type: "events", events: redactFor(room.events, name) });
|
||||
send(socket, { type: "events", events: redactFor(room.events, name), replayed: true });
|
||||
}
|
||||
broadcastRoomState(room);
|
||||
runBots(room);
|
||||
|
||||
Reference in New Issue
Block a user