aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/blackjack.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-15 13:56:10 -0400
committerhistoria <[not public]>2026-09-15 13:56:48 -0400
commitb3568f03e4103dd46db2ccc680fbab0a6454d604 (patch)
treedb3f6bb4f3d7c1deefbcd50de0f5022756d6b9ae /internal/casino/blackjack.go
parentf4ea40c4b3589104dfaced3481ba19c5735889ae (diff)
downloadthehouseoficarus-b3568f03e4103dd46db2ccc680fbab0a6454d604.tar.gz
fix: telnet buffer reuse, bank stack handling,
transport casino gate, and admin cache invalidation
Diffstat (limited to 'internal/casino/blackjack.go')
-rw-r--r--internal/casino/blackjack.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/casino/blackjack.go b/internal/casino/blackjack.go
index 442d4a2..4901c31 100644
--- a/internal/casino/blackjack.go
+++ b/internal/casino/blackjack.go
@@ -214,6 +214,9 @@ func (t *blackjackTable) tick() []Event {
}
active.hands[t.activeHand].stood = true
events := []Event{t.private(name, "Your action timed out; standing.")}
+ // Restart the timer so the next active hand gets a full action window
+ // instead of timing out on the following tick.
+ t.timer.start(t.Rules.ActionTicks)
events = append(events, t.finishHand()...)
return events
default:
@@ -232,7 +235,8 @@ func (t *blackjackTable) action(name, action string) []Event {
}
p := t.players.get(name)
hand := p.hands[t.activeHand]
- t.timer.start(t.Rules.ActionTicks)
+ // The action window only restarts when a new turn is actually prompted
+ // (see prompt()); a rejected command can no longer stall the table.
switch action {
case "hit":
if fromSplitAces(hand) {
@@ -421,6 +425,9 @@ func (t *blackjackTable) beginPlay() {
}
func (t *blackjackTable) prompt() []Event {
+ // Every freshly-prompted turn gets a full action window; rejected inputs
+ // and timeouts can never extend the deadline.
+ t.timer.start(t.Rules.ActionTicks)
name := t.activeName()
if name == "" {
return t.settle()