diff options
| author | historia <[not public]> | 2026-09-18 05:31:09 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 05:31:09 -0400 |
| commit | 153acb7f644d755c45533b7c5311e3ffa47e8973 (patch) | |
| tree | 7645e6f7b65bc3830b078e3b9336d2e6b199d584 /internal/game/session_registry.go | |
| parent | 87d08f0151e643951769e323995f1c5ed89ee200 (diff) | |
| download | thehouseoficarus-153acb7f644d755c45533b7c5311e3ffa47e8973.tar.gz | |
fix: harden engine across casino, economy, concurrency, security, and content
Diffstat (limited to 'internal/game/session_registry.go')
| -rw-r--r-- | internal/game/session_registry.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/game/session_registry.go b/internal/game/session_registry.go index 0e47f82..c4f5d67 100644 --- a/internal/game/session_registry.go +++ b/internal/game/session_registry.go @@ -11,9 +11,15 @@ func (g *Game) attachSession(sess *net.Session) { g.charsMu.Unlock() } -// detachSession removes a character's registry entry. +// detachSession removes a character's registry entry and drops every command +// queued under its name. Leftover queue entries retain the departed session +// (and its transport) and would otherwise replay against the next session +// that logs in as the same character. func (g *Game) detachSession(name string) { g.charsMu.Lock() delete(g.loggedInChars, name) g.charsMu.Unlock() + if g.queue != nil { + g.queue.ClearPlayer(name) + } } |
