aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_stop.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-15 17:04:48 -0400
committerhistoria <[not public]>2026-09-15 17:04:48 -0400
commit69fb90f6876d7f7dbe7be0d515c94849e5431caf (patch)
tree15fb0f5897c537315d4283bb8265d28a13aae313 /internal/game/cmd_stop.go
parentd89504c3df74706b387b8fa829dd291e31ca01c7 (diff)
downloadthehouseoficarus-69fb90f6876d7f7dbe7be0d515c94849e5431caf.tar.gz
cmd_quit gracefully departs casino games; cmd_stop cancels a pending quit
Diffstat (limited to 'internal/game/cmd_stop.go')
-rw-r--r--internal/game/cmd_stop.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/internal/game/cmd_stop.go b/internal/game/cmd_stop.go
index 5c347e6..b05e1fc 100644
--- a/internal/game/cmd_stop.go
+++ b/internal/game/cmd_stop.go
@@ -6,16 +6,11 @@ import (
func (g *Game) executeStop(sess *net.Session, args []string, rawInput string) {
p := sess.Player
- if table, playing := g.Casino.Participation(p.Name); playing {
- if table != nil {
- g.emitCasinoEvents(g.Casino.Leave(table.RoomID, table.Config.ID, p.Name))
- } else if machine, ok := g.Casino.MachineFor(p.Name); ok {
- if events, stopped := g.Casino.StopMachineAutoBet(machine.RoomID, machine.Config.ID, p.Name); stopped {
- g.emitCasinoEvents(events)
- return
- }
- g.emitCasinoEvents(g.Casino.LeaveMachine(machine.RoomID, machine.Config.ID, p.Name))
- }
+ // "stop" is an instant command, so it executes outside the command
+ // queue; cancel a pending quit countdown explicitly.
+ g.cancelRest(p.Name)
+ if _, playing := g.Casino.Participation(p.Name); playing {
+ g.leaveCasinoGames(sess, p)
return
}
ss, _ := g.safespot.Get(p.Name)