From be1c8801ed6360b42e3d355359c2fc63f14c6c3b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 10:45:01 +0100 Subject: [PATCH] Centralize legacy catalog access --- .voidbot/state/aetheria.cc | Bin 23227 -> 23990 bytes Assets/Scripts/Gameplay/ActionGameManager.cs | 3 +- Assets/Scripts/UI/MainMenu.cs | 4 +- .../UI/Properties Panel/PropertiesPanel.cs | 2 +- docs/aetheria-perfect-machine-map.md | 52 ++++++++++-------- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 8aee4cdfa479b0734db5be326ff58ce642d6fd85..8de3ab32db87ae27e7f168a01d6843e5a36f8612 100644 GIT binary patch delta 1736 zcmah~&5ImG6nA&Sx=HX9B@q!HLG-fIyR*qo)`2~&yAl>Mn;|9#bMj61o0&4zRh_Ep zT{|K}5Dy+hga3f2ARd%KFFA-_1qpbHNd5+M_2jGm+L;(wm_yI&>Z;%SeY|@3)56aW z7k>C=apm%*Zo3_9ZRJmw&gV}Kmh;~iKR;6z-)XPkez5RLu9xoBl}@Lqtekp%vG>XJ z?Ni|!lMi>ujmZdvP)mu4r3fNnD0Fa3375gGeULQ5FoO^sN<9J$L$VeIG!`m?ozMxb zu3}6*R5&6NTq~CEmaBuWLy02(YhiP){H{(_geIE=SIJdNLFpqHqXn%9q&Or#QA#o( zRE5Q)%88ikI-)Kx?vqZ3#OQ>K%L3@3P(4y9q?Rmyiw^7i5qiXAGN2Ng9SoFzF7zICK5Q~dbfn`2>te_F{55SoRxasf1AS|_B0aTXbL47={I zmQW8qVuiVZ<+6kP!S=byD(uf`bfbW~3VW>N04=?zoXJXldTapJx{u)8v6i7aR#!N>{?_K1))<-Eos^UT^I?XTvFOR}!Pv2JWV4kegM+ z^u2t=pD{;O*>_>&GD=pbCZymyRN+{g8#J_kzi@H-$6L`d;!f(g<^vaF0%;O4HPJD| zkeGbWF&8VJ)O7hbS)zq?~!y`0;yL-GQ?@x>a66QbG@6_4mf7|NO}7bSY9a! zl61fkC(y!{_s CD0-Cu delta 1053 zcmZWoOKTKC5H=5V6A?TmD61*)5QJo6H2Xk2D8Yb_gUMoqfQQaZ?M|DS?zX#U*Y&cB zM^7@~J%|b-s4RNPK|F|Oj}fn)Joyi-p4nM7IdxZcRdsz|ef4o?Waq=kyO*P-^OXxr z=e%ky{XI6Fei?l-kvnQ^4l*SLQ6v+U_h1M#**pMuL+_QP_P7+gUvCM=W`nhJlv&5la=0m&M-fO7 zb)mzwfZithEHSu;2H=K9W`W0!KN=Q|g}I4Y9wV%yrVPdWE!IL0T;ZE!WItWWhMAcf zW5$V|L6$Ftu{!ZBb?LNl7wNiA&bjQXV&W{Zp(Ogd-g}nCUX4}6edf}3zuo2rACXz--cNn2{gLER4Q7{Cz@DH$} zd5449(0H$z@TuuFY?>bjW*$E$MZERs7bXQ|a}_qv3nadHTN^pC=~sy|336H~s+SPI{*R 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