From 0e60567a7a0addb9421769ee7be7853bfa8788cb Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 19 Sep 2026 03:15:59 -0400 Subject: refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code --- internal/casino/blackjack.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/casino/blackjack.go') diff --git a/internal/casino/blackjack.go b/internal/casino/blackjack.go index cb71034..ed56d15 100644 --- a/internal/casino/blackjack.go +++ b/internal/casino/blackjack.go @@ -777,6 +777,7 @@ func (t *blackjackTable) markDisconnectedLocked(name string) []Event { if index < 0 { return nil } + refundFailed := false if p := t.players.get(name); p != nil && p.HasBet && p.Wallet != nil { if t.phase == blackjackPlaying || t.phase == blackjackInsurance { // A disconnected player forfeits the round in flight: consume @@ -791,12 +792,17 @@ func (t *blackjackTable) markDisconnectedLocked(name string) []Event { } else { // No card has been dealt for this stake yet, so refund it: nothing // the bettor paid for has been revealed or played. - p.Wallet.RefundOutstanding() + if _, _, err := p.Wallet.RefundOutstanding(); err != nil { + refundFailed = true + } } } t.removeSeatLocked(name) events := []Event{t.event(fmt.Sprintf("%s stands up.", name), true)} events = t.closeIfEmptyLocked(events) + if refundFailed { + events = append(events, t.private(name, "Your stake could not be returned just now; it stays pending and will be refunded after the next server restart.")) + } if t.phase != blackjackPlaying { // Betting and insurance resolve against the remaining seats on the // next tick; waiting has no round in flight. -- cgit v1.2.3