aboutsummaryrefslogtreecommitdiff
path: root/internal/game/game.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/game.go')
-rw-r--r--internal/game/game.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/game/game.go b/internal/game/game.go
index a1b7bbe..b9b54ba 100644
--- a/internal/game/game.go
+++ b/internal/game/game.go
@@ -59,6 +59,8 @@ type Game struct {
hackingStates map[string]*hacking.Session
safespotMu sync.Mutex
safespotStates map[string]*SafespotState
+ enterMu sync.Mutex
+ enterSeqs map[string]*enterSeq
}
type SafespotState struct {
@@ -92,6 +94,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.Vali
guardWatchTimers: make(map[string]int),
hackingStates: make(map[string]*hacking.Session),
safespotStates: make(map[string]*SafespotState),
+ enterSeqs: make(map[string]*enterSeq),
}
g.CourseStore.LoadAll()
g.LoadMods()
@@ -105,6 +108,7 @@ func (g *Game) SetHub(hub *net.Hub) {
hub.OnRemove(func(sess *net.Session) {
if p := sess.Player; p != nil {
p.DeactivateAllTechs()
+ g.cancelEnterSeq(p.Name)
g.charsMu.Lock()
delete(g.loggedInChars, p.Name)
g.charsMu.Unlock()
@@ -167,6 +171,8 @@ func (g *Game) HandleSession(sess *net.Session, input string) {
g.handleColorChoice(sess, input)
case net.StateHacking:
g.handleHackingInput(sess, input)
+ case net.StateDangerConfirm:
+ g.handleDangerConfirm(sess, input)
}
}