diff options
| author | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
| commit | 0e60567a7a0addb9421769ee7be7853bfa8788cb (patch) | |
| tree | 7645112db0e4eae95b8a83c1e4f9aab38bede655 /internal/game/cmd_quit.go | |
| parent | cc33072eced3d5460512c09c42ec4531c807d7af (diff) | |
| download | thehouseoficarus-0e60567a7a0addb9421769ee7be7853bfa8788cb.tar.gz | |
refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code
Diffstat (limited to 'internal/game/cmd_quit.go')
| -rw-r--r-- | internal/game/cmd_quit.go | 19 |
1 files changed, 8 insertions, 11 deletions
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) } |
