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/game.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'internal/game/game.go') 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) -- cgit v1.2.3