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/baccarat.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'internal/casino/baccarat.go') diff --git a/internal/casino/baccarat.go b/internal/casino/baccarat.go index 62a83a5..53ed0a9 100644 --- a/internal/casino/baccarat.go +++ b/internal/casino/baccarat.go @@ -241,7 +241,15 @@ func (t *baccaratTable) markDisconnected(name string) []Event { return nil } if p := t.players.get(name); p != nil && p.HasBet && p.Wallet != nil { - p.Wallet.RefundOutstanding() + if _, _, err := p.Wallet.RefundOutstanding(); err != nil { + // The stake stays pending on disk and startup recovery will return + // it, but tell the departing player instead of silently swallowing + // the failure. + t.removeSeatLocked(name) + events := []Event{t.event(fmt.Sprintf("%s stands up.", name), true)} + 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.")) + return t.closeIfEmptyLocked(events) + } } t.removeSeatLocked(name) events := []Event{t.event(fmt.Sprintf("%s stands up.", name), true)} -- cgit v1.2.3