diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 8aee4cdfa..8de3ab32d 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 9f15ebdfd..0c6da91d5 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -37,6 +37,7 @@ public class ActionGameManager : MonoBehaviour public static string AetheriaStateFilePath => LegacyCatalogBoundary.GetStateFilePath(GameDataDirectory); public static string LegacyAetherDatabasePath => LegacyCatalogBoundary.GetLegacyCatalogPath(GameDataDirectory); + public static ILegacyCatalogReader LegacyCatalog => LegacyCatalogBoundary.GetCatalog(GameDataDirectory); private static PlayerSettings _playerSettings; public static PlayerSettings PlayerSettings @@ -234,7 +235,7 @@ public class ActionGameManager : MonoBehaviour Debug.Log($"Aetheria typed state file: {AetheriaStateFilePath}"); Debug.Log($"Aetheria legacy item catalog: {LegacyAetherDatabasePath}"); ItemManager = new ItemManager( - LegacyCatalogBoundary.GetCatalog(GameDataDirectory), + LegacyCatalog, Settings.GameplaySettings, Debug.Log); ZoneRenderer.ItemManager = ItemManager; diff --git a/Assets/Scripts/UI/MainMenu.cs b/Assets/Scripts/UI/MainMenu.cs index 29392bbec..b4361293c 100644 --- a/Assets/Scripts/UI/MainMenu.cs +++ b/Assets/Scripts/UI/MainMenu.cs @@ -117,7 +117,7 @@ public class MainMenu : MonoBehaviour Settings.SectorGenerationSettings, Settings.SectorBackgroundSettings, Settings.NameGeneratorSettings, - LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory), + ActionGameManager.LegacyCatalog, Debug.Log, setState); Observable.NextFrame().Subscribe(_ => @@ -143,7 +143,7 @@ public class MainMenu : MonoBehaviour Settings.TutorialGenerationSettings, Settings.TutorialBackgroundSettings, Settings.NameGeneratorSettings, - LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory), + ActionGameManager.LegacyCatalog, ActionGameManager.PlayerSettings, ActionGameManager.GameDataDirectory.CreateSubdirectory("Narrative"), Debug.Log, diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 0044bfe71..02f7a33e5 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -390,7 +390,7 @@ public class PropertiesPanel : MonoBehaviour AddProperty("Quantity", () => simpleCommodity.Quantity.ToString()); var sheet = AddStatSheet(); - var manufacturer = LegacyCatalogBoundary.GetCatalog(ActionGameManager.GameDataDirectory).Get(data.Manufacturer); + var manufacturer = GameManager.ItemManager.ItemData.Get(data.Manufacturer); sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult"); sheet.AddStat("Mass", () => ActionGameManager.PlayerSettings.Format(GameManager.ItemManager.GetMass(item))); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 1e3cb516b..0aa174eba 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -18,11 +18,12 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. ## Current Mechanism - Unity client/runtime lives under `Assets/`. Gameplay still reads the legacy - item/name catalog through `LegacyCatalogBoundary`, but `ActionGameManager` no - longer owns a global legacy cache. Local run saves, loadouts, player settings - files, zone files, and generated keyboard layout caches no longer write - bespoke durable files. The legacy `PlayerSettings` runtime object is no - longer decorated as a MessagePack persistence shape. + item/name catalog through `ActionGameManager.LegacyCatalog`, which is now the + only runtime entrypoint that calls `LegacyCatalogBoundary.GetCatalog`. + `ActionGameManager` no longer owns a global legacy cache. Local run saves, + loadouts, player settings files, zone files, and generated keyboard layout + caches no longer write bespoke durable files. The legacy `PlayerSettings` + runtime object is no longer decorated as a MessagePack persistence shape. - Shared domain state is still partly built around `DatabaseEntry`, GUID identity, MessagePack attributes, and static cache references. Newtonsoft, JsonKnownTypes, RethinkDB, LiteNetLib client transport, and the broken @@ -59,14 +60,17 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `EntityPack` serialization. Unity has not wired its save/loadout UI to this document yet, so the old in-memory `EntityPack` path is still a runtime construction helper, not durable authority. -- `LegacyCatalogBoundary` opens `LegacyCatalogCache` as the only concrete - pull-only catalog cache. Runtime consumers receive `ILegacyCatalogReader`, - so old MessagePack backing stores may hydrate in-memory domain objects for - the current Unity runtime, but this path cannot push or delete legacy files. - The legacy backing-store write/realtime APIs and public cache mutation methods - have been deleted; only backing-store pull hydration can populate it. The - backing-store serializer methods are also deleted, so the legacy cache - implementation exposes deserialization only. +- `ActionGameManager.LegacyCatalog` is the Unity runtime's single public legacy + catalog access point. It delegates to `LegacyCatalogBoundary`, which opens + `LegacyCatalogCache` as the only concrete pull-only catalog cache. Runtime + consumers receive `ILegacyCatalogReader`, so old MessagePack backing stores + may hydrate in-memory domain objects for the current Unity runtime, but this + path cannot push or delete legacy files. The legacy backing-store + write/realtime APIs and public cache mutation methods have been deleted; only + backing-store pull hydration can populate it. The backing-store serializer + methods are also deleted, so the legacy cache implementation exposes + deserialization only. UI code no longer reaches into + `LegacyCatalogBoundary.GetCatalog` directly. - `DatabaseLink.Value` can resolve legacy links only after `LegacyCatalogBoundary` binds the pull-only catalog cache. Legacy catalog construction no longer grabs global `DatabaseLinkBase` authority. @@ -169,12 +173,14 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. ## Current Authority Map - Owner: `Aetheria.State` owns the new typed state spine for durable state. - `LegacyCatalogBoundary` is the only named owner for old MessagePack catalog - reads and legacy `DatabaseLink` resolution inside the Unity runtime until - catalog migration lands. Runtime code receives `ILegacyCatalogReader`, not the - concrete cache. `Aetheria.State.Unity` owns a read-only typed catalog facade - for future Unity consumers; it does not write state or own simulation. The - legacy cache no longer has a public mutation surface. + `ActionGameManager.LegacyCatalog` is the only Unity runtime access point for + old MessagePack catalog reads, and `LegacyCatalogBoundary` is the only named + owner for opening the old catalog and binding legacy `DatabaseLink` + resolution until catalog migration lands. Runtime code receives + `ILegacyCatalogReader`, not the concrete cache. `Aetheria.State.Unity` owns a + read-only typed catalog facade for future Unity consumers; it does not write + state or own simulation. The legacy cache no longer has a public mutation + surface. - Inputs: Unity gameplay code, legacy catalog files, typed state documents, and CultMesh server state. - Outputs: `Aetheria.State` emits `.cc` state and CultMesh documents. Legacy @@ -214,9 +220,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `DatabaseEntry.ID`, global cache statics, and any compatibility reader. - Shared paths: gameplay input, editor edits, import/deep-load, replication, simulation ticks, and tests all call the same typed state service. -- Deletion line: after catalog migration smokes pass, delete or quarantine the - remaining `LegacyCatalogCache`/`DatabaseEntry` runtime catalog dependency and - remove old MessagePack backing store classes from live Unity source. +- Deletion line: after catalog migration smokes pass, replace + `ActionGameManager.LegacyCatalog`/`ItemManager` boot with the typed runtime + catalog package, then delete or quarantine the remaining + `LegacyCatalogCache`/`DatabaseEntry` runtime catalog dependency and remove old + MessagePack backing store classes from live Unity source. ## Intended Change