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/game/cmd_quit.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'internal/game/cmd_quit.go') diff --git a/internal/game/cmd_quit.go b/internal/game/cmd_quit.go index 0a8b8ca..50f1ec5 100644 --- a/internal/game/cmd_quit.go +++ b/internal/game/cmd_quit.go @@ -92,7 +92,10 @@ func (g *Game) beginQuitCountdown(sess *net.Session) { case 3: sess.WriteLine("You close your eyes...") case 0: - g.cancelRest(p.Name) + // Release combat, cover, actions and hacking state before the + // disconnect. This path used to leave the character occupying a + // safespot cover after logging out. + g.releaseCharacterRuntime(sess, p) g.restoreGodPlayer(p) // Forfeit any committed casino wager and free the seat only // now — immediately before the disconnect. Settling games only @@ -101,16 +104,10 @@ func (g *Game) beginQuitCountdown(sess *net.Session) { g.emitCasinoEvents(g.Casino.MarkDisconnected(p.Name)) } g.saveCharacter(p) - 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) - } + // Drop the registry entry and any queued commands: leftover queue + // entries retain this session and would replay on a later login as + // the same character. + g.detachSession(p.Name) if g.Hub != nil { g.Hub.LeaveRoom(sess) } -- cgit v1.2.3