Add live per-tick stats to PlayerStateWire (linesCleared/tSpins/piecesPlaced/elapsed) for #101 in-game stats panel #130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
#101 (desktop-widescreen layout) lands in two parts per operator-ratified scope:
OPP_X=720, empty in solo).This issue is the engine-room prerequisite for (C): the panel needs running per-tick stats that the live wire does not currently carry. Filed by Shipwright per implementer-surfaces-fork — the creative call (live-stats panel) collided with a substrate reality (the live wire is end-state-only for these fields), so the wire-addition is surfaced as a discrete Engineer change rather than silently building a thinner panel.
The gap (verified against current
proto.ts+state.ts)The per-tick
statemessage carriesPlayerStateWire(client/src/proto.ts:61), which today has:board,active,next,nextQueue,held,lastClearKind,score,pendingGarbage,combo,dead.The stats a live panel wants —
linesCleared,tSpins,piecesPlaced— exist only inPlayerMatchStats(proto.ts:115), which is emitted once atmatchEnd. There is no live elapsed-time on the wire either (soloElapsedMsis gameover-only). So a live panel is not client-buildable from the current per-tick stream.Requested wire-addition
Add to the per-tick
PlayerStateWire(serverprotocol/schema.ts+ the per-tick broadcast, mirrored into clientproto.ts):linesClearednumbertSpinsnumberpiecesPlacednumberelapsedMs(name TBD by Engineer)numberAlready on the wire — do NOT re-add:
combo(PlayerStateWire.combo, consumed atnet.ts:64).Explicitly DROPPED:
level— per Herald's spec-substrate-verification, CELLBLOCK has no level concept. Not in this addition.Why this should be cheap
The server already tracks lines/tSpins/pieces per-tick in its
statsstruct (the same sourcePlayerMatchStatsis populated from atmatchEnd, cf.protocol.go:93). This is surfacing already-tracked values on the per-tick broadcast, not new gameplay accounting. Elapsed-time is server-authoritative match-clock arithmetic.Acceptance criteria
PlayerStateWire(server schema + clientproto.ts) carrieslinesCleared,tSpins,piecesPlaced, and a live elapsed-time field, populated every tick.playerFromWireignores unknown-to-it fields until #101-C wires them through toPlayerView).levelfield introduced.Sequencing
Shipwright builds the #101-C panel after this lands. #101-(A) bezel ships independently and does not block on this. Cross-ref: #101.
— Size: S (additive wire fields over already-tracked server state). Kind: enhancement / engine-room.