From 8ee8982b8759bcae116647cc993867f4c8b0a6ce Mon Sep 17 00:00:00 2001 From: workhorse Date: Fri, 19 Jun 2026 20:24:52 -0400 Subject: reorganized items, objects, and rooms in directories. oranized module names. added startup checks. --- internal/game/game.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'internal/game/game.go') diff --git a/internal/game/game.go b/internal/game/game.go index b8eadce..5d6e21e 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -35,18 +35,19 @@ type QueuedCommand struct { } type Game struct { - World *world.World - ObjectStore *object.ObjectStore - ItemStore *object.ItemStore - AccountStore *player.AccountStore - MobStore *world.MobStore - RecipeStore *action.RecipeStore - CourseStore *CourseStore - Hub *net.Hub - Ticks *engine.Engine - WorldFlags map[string]any - ColorConfig *config.ColorsConfig - DataDir string + World *world.World + ObjectStore *object.ObjectStore + ItemStore *object.ItemStore + AccountStore *player.AccountStore + MobStore *world.MobStore + RecipeStore *action.RecipeStore + CourseStore *CourseStore + Hub *net.Hub + Ticks *engine.Engine + WorldFlags map[string]any + ColorConfig *config.ColorsConfig + DataDir string + ValidationConfig config.StartupValidationConfig restTimers map[string]uint64 charsMu sync.Mutex loggedInChars map[string]*net.Session @@ -59,7 +60,7 @@ type Game struct { hackingStates map[string]*hacking.Session } -func New(dataDir string, colorConfig *config.ColorsConfig) *Game { +func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.StartupValidationConfig) *Game { g := &Game{ World: world.New(dataDir), ObjectStore: object.NewObjectStore(dataDir), @@ -72,6 +73,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig) *Game { WorldFlags: make(map[string]any), ColorConfig: colorConfig, DataDir: dataDir, + ValidationConfig: valConfig, restTimers: make(map[string]uint64), loggedInChars: make(map[string]*net.Session), freeQueue: make(map[string][]QueuedCommand), @@ -83,6 +85,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig) *Game { } g.CourseStore.LoadAll() g.LoadMods() + g.ValidateAndLog() return g } -- cgit v1.2.3