diff options
Diffstat (limited to 'internal/game/cmd_quit.go')
| -rw-r--r-- | internal/game/cmd_quit.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/game/cmd_quit.go b/internal/game/cmd_quit.go index f8075c1..bf46748 100644 --- a/internal/game/cmd_quit.go +++ b/internal/game/cmd_quit.go @@ -30,7 +30,14 @@ func (g *Game) doQuit(sess *net.Session) { // exits never forfeit a stake or reveal cards mid-hand. Forfeit-on-leave // stays reserved for genuine disconnects and "quit now". if !g.leaveCasinoGames(p) { - sess.WriteLine(g.colorize(sess, "warning", "Type \"quit now\" to log out anyway — your bet will be forfeited.")) + // A committed wager blocks the departure; whether it is actually lost + // depends on whether the game has dealt/started a round for it. A + // stake the game has not dealt for yet is refunded on disconnect + // (baccarat always, blackjack while the betting window is open), and + // a dealt hand or a spin in progress is forfeited. The refusal + // therefore states both outcomes instead of promising a forfeit that + // an undealt stake does not suffer. + sess.WriteLine(g.colorize(sess, "warning", "Type \"quit now\" to log out anyway — a bet still awaiting the deal is refunded; a hand or spin in progress is forfeited.")) return } @@ -86,6 +93,13 @@ func (g *Game) beginQuitCountdown(sess *net.Session) { g.charsMu.Lock() delete(g.loggedInChars, p.Name) g.charsMu.Unlock() + // The character is leaving the world: drop its queued free/ + // active/consume commands with the registry entry, or they + // retain this session and replay on a later login as the same + // character. + if g.queue != nil { + g.queue.ClearPlayer(p.Name) + } if g.Hub != nil { g.Hub.LeaveRoom(sess) } |
