diff options
| author | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
| commit | a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 (patch) | |
| tree | 4ff8fefb029c93f2aa3db7361658b0b4e9805b66 /internal/game/cmd_reload.go | |
| parent | 87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (diff) | |
| download | thehouseoficarus-a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295.tar.gz | |
feat: admin accounts, god mode, OLC commands like dig/room, 'inline' objects changed to 'local' objects
Diffstat (limited to 'internal/game/cmd_reload.go')
| -rw-r--r-- | internal/game/cmd_reload.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/game/cmd_reload.go b/internal/game/cmd_reload.go new file mode 100644 index 0000000..2b8230a --- /dev/null +++ b/internal/game/cmd_reload.go @@ -0,0 +1,37 @@ +package game + +import ( + "thehouseoficarus/internal/behavior" + "thehouseoficarus/internal/net" +) + +func (g *Game) executeReload(sess *net.Session, args []string, rawInput string) { + if !g.checkAdmin(sess) { + sess.WriteLine("Unknown command.") + return + } + + g.ItemStore.Reload(g.DataDir) + g.ObjectStore.Reload(g.DataDir) + g.MobStore.ReloadDefs(g.DataDir) + behavior.ClearDropIndex() + + items, err := g.ItemStore.LoadAll() + if err == nil { + g.CraftIndex.Build(items) + } + + g.LoadTechs() + g.LoadMods() + + g.CourseStore.ReloadAll() + + g.World.RebuildRoomIndex(g.DataDir) + g.World.ClearHazardCache() + + g.TriggerStore.ClearTriggers() + g.TriggerStore.LoadGlobal(g.DataDir) + g.seedRoomTriggers() + + sess.WriteLine("All caches reloaded.") +} |
