Compare commits
2
Commits
0ced49ca6c
...
bca4d5eba7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bca4d5eba7 | ||
|
|
29025f2ccb |
@@ -640,6 +640,11 @@ class Net {
|
|||||||
break;
|
break;
|
||||||
case "events": {
|
case "events": {
|
||||||
let talk = 0;
|
let talk = 0;
|
||||||
|
// A replay is the whole chronicle from the deal, sent on every
|
||||||
|
// (re)join: it replaces what we hold, or a dropped socket's return
|
||||||
|
// would count each turn (and each line of talk) twice and the eyes
|
||||||
|
// would ask for turns the server has not reached.
|
||||||
|
if (msg.replayed) this.resetChronicle();
|
||||||
if (!msg.replayed) this.onFx?.(msg.events as GameEvent[]);
|
if (!msg.replayed) this.onFx?.(msg.events as GameEvent[]);
|
||||||
for (const e of msg.events as GameEvent[]) {
|
for (const e of msg.events as GameEvent[]) {
|
||||||
if (e.type === "tableTalk") { talk++; this.lastTalkBy = e.player; }
|
if (e.type === "tableTalk") { talk++; this.lastTalkBy = e.player; }
|
||||||
@@ -749,7 +754,8 @@ class Net {
|
|||||||
for (const key of voided) { if (this.voidedOnce.has(key)) doubted.add(key); }
|
for (const key of voided) { if (this.voidedOnce.has(key)) doubted.add(key); }
|
||||||
this.voidedOnce = voided;
|
this.voidedOnce = voided;
|
||||||
let kept = this.seats.filter((s) => !doubted.has(`${s.roomId}:${s.name}`));
|
let kept = this.seats.filter((s) => !doubted.has(`${s.roomId}:${s.name}`));
|
||||||
if (kept.length > 50) kept = kept.slice(kept.length - 50);
|
// Newest first (rememberSeat puts a seat at the front): the oldest go.
|
||||||
|
if (kept.length > 50) kept = kept.slice(0, 50);
|
||||||
if (kept.length !== this.seats.length) {
|
if (kept.length !== this.seats.length) {
|
||||||
this.seats = kept;
|
this.seats = kept;
|
||||||
saveSeats(this.seats);
|
saveSeats(this.seats);
|
||||||
@@ -1085,6 +1091,7 @@ class Net {
|
|||||||
private resetChronicle(): void {
|
private resetChronicle(): void {
|
||||||
this.log = [];
|
this.log = [];
|
||||||
this.turnCounter = -1;
|
this.turnCounter = -1;
|
||||||
|
this.chatCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Summon one turn's reel by its chronicle turn number. */
|
/** Summon one turn's reel by its chronicle turn number. */
|
||||||
|
|||||||
Reference in new issue
Block a user