From 87d08f0151e643951769e323995f1c5ed89ee200 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 01:50:17 -0400 Subject: fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths --- internal/game/game.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/game/game.go') 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)) } -- cgit v1.2.3