The host may let the Peanut Gallery talk
A gallery line wears the eye and a name that no wizard at the table holds; the host opens or hushes it from the lobby or the mast, on the ledger, and the gallery is reined per address. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
f68b3cef06
commit
13a6fc2603
@@ -385,6 +385,8 @@ class Net {
|
||||
keeper = $state<string | null>(null);
|
||||
/** The keeper's time zone (IANA), for telling a caller what hour it is there. */
|
||||
keeperZone = $state<string | null>(null);
|
||||
/** The host lets the Peanut Gallery talk. */
|
||||
galleryTalk = $state(false);
|
||||
view = $state<GameView | null>(null);
|
||||
log = $state<LogLine[]>([]);
|
||||
error = $state<string | null>(null);
|
||||
@@ -544,6 +546,7 @@ class Net {
|
||||
this.challenge = msg.challenge ?? null;
|
||||
if (typeof msg.keeper === "string") this.keeper = msg.keeper;
|
||||
if (typeof msg.keeperZone === "string") this.keeperZone = msg.keeperZone;
|
||||
this.galleryTalk = msg.galleryTalk === true;
|
||||
if (this.you && this.token) {
|
||||
const seat: Seat = { name: this.you, roomId: msg.roomId, token: this.token };
|
||||
localStorage.setItem(SEAT_KEY, JSON.stringify(seat));
|
||||
@@ -656,7 +659,7 @@ class Net {
|
||||
this.roomIdPending = msg.roomId;
|
||||
break;
|
||||
case "chat": {
|
||||
if (msg.player === this.you && this.chatPending === msg.text) this.chatPending = null;
|
||||
if ((msg.player === this.you || this.spectating) && this.chatPending === msg.text) this.chatPending = null;
|
||||
this.lastTalkBy = msg.player;
|
||||
this.log = [...this.log, { text: `\u{1F4AC} ${msg.player}: ${msg.text}`, turn: null, notable: false, actor: msg.player }];
|
||||
this.chatCount += 1;
|
||||
@@ -834,12 +837,17 @@ class Net {
|
||||
}
|
||||
|
||||
/** True when the line left; the composer keeps it otherwise. */
|
||||
sendChat(text: string): boolean {
|
||||
if (!this.send({ type: "chat", text })) return false;
|
||||
sendChat(text: string, galleryName?: string): boolean {
|
||||
if (!this.send(galleryName ? { type: "chat", text, name: galleryName } : { type: "chat", text })) return false;
|
||||
this.chatPending = text;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Host only: let the Peanut Gallery talk at this table, or hush it. */
|
||||
setGalleryTalk(on: boolean): void {
|
||||
this.send({ type: "galleryTalk", on });
|
||||
}
|
||||
|
||||
/** Call the keeper of this site to the table: a seat is held, and their phone rings. */
|
||||
challengeKeeper(): void {
|
||||
this.send({ type: "challengeKeeper" });
|
||||
|
||||
Reference in New Issue
Block a user