diff options
| author | historia <[not public]> | 2026-09-18 01:50:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 01:50:17 -0400 |
| commit | 87d08f0151e643951769e323995f1c5ed89ee200 (patch) | |
| tree | dc42a0b30ebb5a00dd7ba505cc4eaa44f4f308bc /internal/game/game.go | |
| parent | 32a3c59cebf2a16277e54d715a67adfdbe00b456 (diff) | |
| download | thehouseoficarus-87d08f0151e643951769e323995f1c5ed89ee200.tar.gz | |
fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths
Diffstat (limited to 'internal/game/game.go')
| -rw-r--r-- | internal/game/game.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/game/game.go b/internal/game/game.go index fc6914f..ef48b63 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -187,6 +187,13 @@ func (g *Game) SetHub(hub *net.Hub) { }) hub.OnDisconnect(func(sess *net.Session) { g.run(func() { + // During graceful shutdown the shutdown sequence owns final + // persistence and refunds outstanding wagers; a disconnect + // forfeit here would destroy a stake the shutdown policy + // promises to return. Mirrors the OnRemove guard. + if g.isShuttingDown() { + return + } if sess.Player != nil { g.emitCasinoEvents(g.Casino.MarkDisconnected(sess.Player.Name)) } |
