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/game.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/game.go')
| -rw-r--r-- | internal/game/game.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/internal/game/game.go b/internal/game/game.go index 5aad784..6066179 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -197,22 +197,18 @@ func (g *Game) SetHub(hub *net.Hub) { return } if p := sess.Player; p != nil { - // The session is leaving the world: end any live fight and - // cancel a running logout countdown first, so neither keeps - // acting on a detached session (ghost combat that saves over - // a reconnected character, or a duplicate logout that drops - // the reconnected session's registry entry). - g.stopCombat(p.Name) - g.cancelRest(p.Name) + // The session is leaving the world: end any live fight, cancel + // a running logout countdown, and step out of any safespot + // cover first, so nothing keeps acting on a detached session + // (ghost combat that saves over a reconnected character, a + // duplicate logout that drops the reconnected session's + // registry entry, or a phantom cover occupant). + g.releaseCharacterRuntime(sess, p) g.restoreGodPlayer(p) g.persistLockedOnDisconnect(p) g.saveCharacter(p) p.DeactivateAllTechs() g.detachSession(p.Name) - delete(g.hackingStates, p.Name) - if ss, ok := g.safespot.Get(p.Name); ok { - g.forceLeaveSafespot(sess, p, &ss, "") - } } }) }) @@ -440,7 +436,7 @@ func (g *Game) HandleSession(sess *net.Session, input string) { g.handleRecipeChoice(sess, input) case net.StateHowMany: g.handleHowMany(sess, input) - case net.StateSmithProduct, net.StateFletchProduct, net.StateCraftProduct, net.StateProductChoice: + case net.StateProductChoice: g.handleProductChoice(sess, input) case net.StateColorChoice: g.handleColorChoice(sess, input) |
