From 9655d5ad7b81becd659b5af256dd0d337e4f252a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 14:07:21 +0100 Subject: [PATCH] Narrow legacy catalog to item hydration --- .voidbot/state/aetheria.cc | Bin 31490 -> 31873 bytes .../ServerShared/Behaviors/ResourceScanner.cs | 4 +--- .../ServerShared/CultCache/DatabaseEntry.cs | 6 +++--- .../CultCache/LegacyCatalogCache.cs | 16 ++++++++-------- Assets/Scripts/ServerShared/Extensions.cs | 3 --- Assets/Scripts/ServerShared/ItemManager.cs | 11 +---------- docs/aetheria-perfect-machine-map.md | 10 ++++++++-- 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 5b16574e81634254b9afb3102cccceaea253b848..f28321160344e8e62472e7bb8e65e6688755358b 100644 GIT binary patch delta 1371 zcmaJ>&uS9j3uzHaU1-x1Wrq;5WRp-3WZ5({C{mPOkc#lmcxSBj+Jo)c zu~ExbPpK9x8F`vu8FcZN+7G{Mpa%d*Az>Z~oPD z<899`4|{i=nw^^Trpje=BR*)J_ulEx0Q08skr9O-^8M*ax4)}zxR=$^FZ!ZSmTRjK zL5zgh?;sy*%tVMJ!2yv7^8i%=s$)f#C~pF;1Z&$JNf6bfRT7+a5EpCSPd>x6wY7Pd z7FWjKi8{S{X53x12mzNc$03p40@3qXvI|_x4xDj!`hqJhG36vcS|A%?33%r9N^xCj z0R)gs+1)_|!YQDZD-F3j!38f_cH1;u4q)#K87S0{qJ_>89T8bQ@3mAIW54M=)PyT4 z_{*N%D+$-MMO^wtAcVP3yy_Jof~Z1DQ^vNhwz{0|vdIfw5;zcvULc%E45agrs1v{v zxav*}^*M$<@TP%9&DF|*%70~gA=r4kUOO7 z3=kZF!m*H8cCu2|v-;pFRF^aefi;-JLsbC=(I`>YGN=Je8d-8RjyMLH8XLSiG)-{ zc|Su3BOzBvL%rHjOYe_P_aC(KXZFoYbM(#cwW6t%52X7_cMl&uI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*9zm9+JdWzS%gTlsig#F>*p>p){^xpQu zK)5^!TM`PD{)|JcVd{fu)48#=h2!Dn>E7^7HUxaa(pR98K?u#o$dGIAWE{mF(hJ g7v8=W#3dB0l<%tt>$CUpTd^m4rQUXC6_x7DZ-a@WTmS$7 diff --git a/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs b/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs index 4cbb9f24d..aef533138 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs @@ -81,7 +81,6 @@ public class ResourceScanner : Behavior, IAlwaysUpdatedBehavior if (_scanTime > ScanDuration) { // TODO: Implement Scanning! - //Context.ItemData.Get(Entity.Corporation).PlanetSurveyFloor[ScanTarget] = MinimumDensity; _scanTime = 0; } return true; @@ -94,7 +93,6 @@ public class ResourceScanner : Behavior, IAlwaysUpdatedBehavior _scanTime += dt; if (_scanTime > ScanDuration) { - //Context.ItemData.Get(Entity.Corporation).PlanetSurveyFloor[ScanTarget] = MinimumDensity; _scanTime = 0; } return true; @@ -110,4 +108,4 @@ public class ResourceScanner : Behavior, IAlwaysUpdatedBehavior MinimumDensity = Evaluate(_data.MinimumDensity); ScanDuration = Evaluate(_data.ScanDuration); } -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs index eb82a61f1..409b2d017 100644 --- a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs +++ b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs @@ -65,7 +65,7 @@ public abstract class DatabaseEntry } [MessagePackObject] -public class DatabaseLink : DatabaseLinkBase where T : DatabaseEntry +public class DatabaseLink : DatabaseLinkBase where T : ItemData { [IgnoreMember] public T Value => ResolveLegacyCatalog(LinkID); @@ -80,10 +80,10 @@ public class DatabaseLinkBase [IgnoreMember] private static ILegacyCatalogReader Catalog { get; set; } - protected static T ResolveLegacyCatalog(Guid linkId) where T : DatabaseEntry + protected static T ResolveLegacyCatalog(Guid linkId) where T : ItemData { if (Catalog == null) - throw new InvalidOperationException("Legacy DatabaseLink resolution is not bound. Open LegacyCatalogBoundary before reading legacy catalog object graphs."); + throw new InvalidOperationException("Legacy item link resolution is not bound. Open LegacyCatalogBoundary before reading legacy item object graphs."); return Catalog.Get(linkId); } diff --git a/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs b/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs index e5a0127a3..3c18b71f4 100644 --- a/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs +++ b/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs @@ -10,8 +10,8 @@ using UniRx; public interface ILegacyCatalogReader { - DatabaseEntry Get(Guid guid); - T Get(Guid guid) where T : DatabaseEntry; + ItemData Get(Guid guid); + T Get(Guid guid) where T : ItemData; } public class LegacyCatalogCache : ILegacyCatalogReader @@ -21,7 +21,7 @@ public class LegacyCatalogCache : ILegacyCatalogReader private List _backingStores = new List(); - private readonly Dictionary _entries = new Dictionary(); + private readonly Dictionary _entries = new Dictionary(); public void AddBackingStore(CacheBackingStore store) { @@ -41,21 +41,21 @@ public class LegacyCatalogCache : ILegacyCatalogReader { lock(addLock) { - if (entry != null) + if (entry is ItemData item) { - _entries[entry.ID] = entry; + _entries[item.ID] = item; } } } - public DatabaseEntry Get(Guid guid) + public ItemData Get(Guid guid) { - DatabaseEntry entry; + ItemData entry; _entries.TryGetValue(guid, out entry); return entry; } - public T Get(Guid guid) where T : DatabaseEntry + public T Get(Guid guid) where T : ItemData { return Get(guid) as T; } diff --git a/Assets/Scripts/ServerShared/Extensions.cs b/Assets/Scripts/ServerShared/Extensions.cs index dbc5aa5de..5950c3da0 100644 --- a/Assets/Scripts/ServerShared/Extensions.cs +++ b/Assets/Scripts/ServerShared/Extensions.cs @@ -14,9 +14,6 @@ using float2 = Unity.Mathematics.float2; public static class Extensions { - //public static IDatabaseEntry Get(this Guid entry) => Database.Get(entry); - //public static T Get(this Guid entry) where T : class, IDatabaseEntry => Database.Get(entry) as T; - public static bool IsImplementationOf(this Type baseType, Type interfaceType) { return baseType.GetInterfaces().Any(interfaceType.Equals); diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 085b878bb..635d5baeb 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -53,7 +53,7 @@ public class ItemManager _logger = logger; } - public T GetCatalogEntry(Guid id) where T : DatabaseEntry + public T GetCatalogEntry(Guid id) where T : ItemData { return _itemData.Get(id); } @@ -63,15 +63,6 @@ public class ItemManager _logger(s); } - // public int ItemTier(CraftedItemData itemData) - // { - // if (Tier.ContainsKey(itemData)) return Tier[itemData]; - // - // Tier[itemData] = itemData.Ingredients.Keys.Max(ci => _cache.Get(ci) is CraftedItemData craftableIngredient ? ItemTier(craftableIngredient) : 0); - // - // return Tier[itemData]; - // } - public SimpleCommodityData GetData(SimpleCommodity item) { return item.Data.Value as SimpleCommodityData; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index f3848c1aa..1cfab11ec 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -79,7 +79,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `LegacyCatalogBoundary`, which opens `LegacyCatalogCache` as the only concrete pull-only catalog cache. Runtime consumers receive `ILegacyCatalogReader`, so the old `AetherDB.msgpack` backing store may hydrate - in-memory item domain objects for the current Unity runtime, but this path cannot + in-memory item domain objects for the current Unity runtime, but the cache now + admits only `ItemData` entries and cannot resolve generic `DatabaseEntry` + object graphs. This path cannot push or delete legacy files. The legacy backing-store write/realtime APIs, public cache mutation methods, enumeration methods, and global-setting lookup methods have been deleted; only backing-store pull @@ -270,7 +272,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `Aetheria.State.Unity` facade maps typed `.cc` documents into the same contract for full .NET smokes and Eve surface reads. Neither writes state or owns simulation. The legacy cache no longer has a public mutation surface, but - it still materializes `ItemManager`. Item properties manufacturer display is + it still materializes `ItemManager`. The legacy cache is item-only; old + `Faction`, `NameFile`, global, zone, player, task, and body entries are no + longer accepted as runtime catalog entries. Item properties manufacturer display is a typed snapshot consumer; loadout generation is the remaining runtime single-ID item hydration bridge. The old trade debug UI and console `give` command have been deleted. No live @@ -445,6 +449,8 @@ First Aetheria surfaces to publish: - Done: remove `GameData/NameFile/*.msgpack` from Unity runtime legacy catalog boot; typed name files now own runtime names, and old name files remain migration inputs only. + - Done: narrow `ILegacyCatalogReader` and `DatabaseLink` to `ItemData`; + `LegacyCatalogCache` ignores non-item entries from `AetherDB.msgpack`. - Replace `ActionGameManager` cache bootstrap with the new state runtime. - Convert domain references from GUID/base-class patterns to typed record refs.