games: no mercy on the felt, and the bill that went to the wrong window
The engine has been able to play No Mercy since aca523e. Now a browser can.
The switch is a switch, not a fourth table: the tier is still the table size,
because that is what you are paid for, and the deck is the other dial. Six faces
the normal box does not print, sized by the card's own vars and never by the box
they sit in. The stack says what the bill is on the felt, in the turn line and on
the button, and under it the deck is dead — you cannot draw your way out of a
bill somebody has run up and pointed at you.
The wild draws glow. That started as decoration and turned out to be doing work:
No Mercy prints a coloured +4 right beside the wild one, and in a hand of twenty
the glow is what tells them apart.
A buried seat is not an empty one, which is the whole trap here — a seat killed
at twenty-five holds no cards, and neither does a seat that just went out and
won. The view asks the engine which it is instead of counting to zero, so the
winner is never the corpse.
Two bugs, both found in a browser and neither findable anywhere else:
The felt's stack bill was writing into the chip bar. It was [data-pending], and
so is the bar's "your chips are still coming" readout — and the bar lives inside
the table's own root and comes first in the document. A stack quietly overwrote
the escrow message and never appeared on the felt at all. A table's attributes
are not a private namespace.
And hold'em, re-driven on the 20M-hand policy (six hands, got up 61 ahead of a
100 buy-in, money conserved to the chip — Phase 4 closed), let you click a button
that did nothing: Deal, Leave and Top up stayed alive through the whole deal
animation, where send() drops the click on purpose. The lock is on the buttons
now, not only in the variable.
Claude-Session: https://claude.ai/code/session_013M5nD7PgUboJXoDcYHzpuJ
This commit is contained in:
@@ -514,9 +514,30 @@
|
||||
|
||||
// ---- talking to the table --------------------------------------------------
|
||||
|
||||
// lock is busy, said out loud on the buttons.
|
||||
//
|
||||
// send() drops a click that arrives while a move is in flight, and it is right
|
||||
// to: the board on screen during a script is a board the server has already
|
||||
// moved past. But the *between-hands* buttons — Deal, Leave, Top up — stayed
|
||||
// enabled through the whole deal animation, so clicking Leave while the cards
|
||||
// were still flying did nothing at all: no move, no message, no reason given.
|
||||
// (The action buttons never had this problem; panels() hides the whole row when
|
||||
// it isn't your turn.) A button that looks alive and does nothing has lied to
|
||||
// you, so the lock lives on the buttons and not only in the variable.
|
||||
//
|
||||
// Top up keeps its own rule — it is dead when the wallet cannot cover it — and
|
||||
// panels() owns that, so this only ever adds a reason to be disabled.
|
||||
function lock(on) {
|
||||
[foldBtn, checkBtn, callBtn, raiseBtn, dealBtn, leaveBtn].forEach(function (b) {
|
||||
if (b) b.disabled = on;
|
||||
});
|
||||
if (topupBtn) topupBtn.disabled = on || Number(topupBtn.dataset.amount || 0) <= 0;
|
||||
}
|
||||
|
||||
function send(body, msgEl) {
|
||||
if (busy) return Promise.resolve();
|
||||
busy = true;
|
||||
lock(true);
|
||||
say(msgEl, "");
|
||||
// Whatever the last hand said about itself stops being true the moment you do
|
||||
// something. Only the "hand" beat used to clear this, so a verdict could linger
|
||||
@@ -540,7 +561,7 @@
|
||||
});
|
||||
})
|
||||
.catch(function (err) { say(msgEl, err.message, "bad"); })
|
||||
.then(function () { busy = false; });
|
||||
.then(function () { busy = false; lock(false); });
|
||||
}
|
||||
|
||||
// render0 is the table with nobody at it.
|
||||
|
||||
Reference in New Issue
Block a user