feedback1c WJ: ticker queue helpers; a newer leader-damage line replaces the older one

Review follow-up for the Hidden Core broadcast fix. The strip's queue rules are
now pure, exported helpers (tickerSupersedes, enqueueTickerLines,
pruneTickerLines, nextTickerLine) with unit tests across a round 14 -> 15
change, instead of source regex checks only.

A player's newer BOSS_HIT line of the same round replaces their older one,
queued or on screen (it names a higher threshold), so a burst finish shows its
highest milestone before the round ends and the last round's lines are dropped.
Lines now carry playerId from main.js. The solo match test is labelled 绝境
(HARD), the difficulty it runs.
This commit is contained in:
sganggs committed 2026-10-03 03:16:44 +08:00
1 parent 7b1964707d
commit 93afe2ccf2
5 files changed
+215 -21

No files matched your search

+4 -2
View File
@@ -217,9 +217,11 @@ function wireNet() {
});
net.on('m.ticker', (msg) => {
if (typeof msg.text !== 'string') return;
// type + the round it came in: a BOSS_HIT line is dropped once its boss round is over (ui/ticker.js tickerLineLive)
// type, player + the round it came in: a BOSS_HIT line is dropped once its boss round is over and superseded by the
// same player's next one (ui/ticker.js tickerLineLive / tickerSupersedes)
const type = typeof msg.type === 'string' ? msg.type : null;
store.set((s) => ({ ticker: [...s.ticker.slice(-(TICKER_KEEP - 1)), { id: ++seq, text: msg.text, at: Date.now(), type, round: s.match?.public?.round ?? null }] }));
const playerId = typeof msg.playerId === 'string' ? msg.playerId : null;
store.set((s) => ({ ticker: [...s.ticker.slice(-(TICKER_KEEP - 1)), { id: ++seq, text: msg.text, at: Date.now(), type, playerId, round: s.match?.public?.round ?? null }] }));
});
net.on('m.emote', (msg) => {
store.set((s) => ({ emotes: [...s.emotes.slice(-(EMOTE_KEEP - 1)), { seq: ++seq, playerId: msg.playerId, id: msg.id, at: Date.now() }] }));