From c2f5d04e915e760154ef3ee9ee38521c8d900db5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 03:19:40 +0100 Subject: [PATCH] Make runtime item catalog key-only --- .voidbot/state/aetheria.cc | Bin 99690 -> 100126 bytes Aetheria.State/README.md | 7 +++--- .../AetheriaRuntimeItemCatalog.cs | 21 ++-------------- .../AetheriaRuntimeItemReference.cs | 23 ------------------ docs/aetheria-perfect-machine-map.md | 3 +++ 5 files changed, 9 insertions(+), 45 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index f94de5d1b7089eea1775cad8b59d80df4c9a0385..3d4d5febb6b369e5fef66c3ee6b23e9b211802ee 100644 GIT binary patch delta 1353 zcmZ8hJ!lj`6m}Cy{OeTwA>u1k{L5+7i09da9EL;@4Y3gg=XPK2#_Z0lGqZ_n0s-wr z1>IshEkpzn6oRA`!9oP1c0n7_%0jUc71XzXxr?x{yKm;bdGGs~FV{Nm-0XPrplx~i z@ZN)^1LeJEZdq%i7j4&zz`-;i+b4@aISnjZy18xqEbu|d31GI3zR|QKq~JDlvz=oYYLLPWOZRP;ac};2^mc6H5T#JEsG|a(DUBKw zn}C7SgH_N*aZ#rvm45m(-b(R)Xm5x31}ya(Ky?NxkD(XLdM9 z-3~gtVMONt^i73FRCqEuwg^_z7Qr+SDBtBaH*i!*uUH3P$qQ&3E(J8u^{H)z9^*on z9vBqUnil3iEz01U+UKqdfkp?IX%=?V&RR>>WFQ=-IO@YtlTJv*wG5PvU`x;AM(-wg zlf%1fOhKM+n5v@z?)kD)8QLM7=-k};p%RQV2mwH+PB7?(3|t31IgVf?n9!$gQc?&< znwJyG*-^T|`~+TwbbKw~u8A%_T{Hc@DhXXfF)oafPC#8Pa8=My2!V?fLzQbKmq`iw zi7r$cyg(ZwT(`<3q39Tf1@Dz&zQHQ(XI)`NO)bGfjH5Ccnu2-gM0@5o?Stenm(ERw zZX($_Na-OHc0;OR9MvC|RA+v@d0|=Am<1MWCM>!WeZqfD=OfMhc=vg0=hb_pzWH+8 zSG6`pb5UnB`C(^Yxqq<>i1EY-4o|6KDlAZ`g$rKDtdNzfw3b^L{e8V6`uc6%NdGX> zm^4eqb9ZWrrv5ZcAW`I?iv&ewu}lk5KEiSCps+EYIDUN8Iy*D))7}*ypRfjI|7@}T zwDo6g98vW}W|?YwW$J&QObuhAq=d4QsUPF>+pI26oFF%IQdlmf21yo1$!F9LZFlIM zjno_?w~?-ZBkk;l01t^ta+t3;<>nJ+mjbO2p1vdv-hQo!f#zzuhe{**x7^wC&+n;)8t_GgrE`rTeK?3s} zu%)L1mn{i|$@!cHPp(E!enR=VEf{yVt(Fl51|huyD!`k* z)CjW+xoMCkR6;UGLtZLiw&5k}xZ6iaxg7ZY=@7Q0nRNYC|10OY(k2bz23=}Y%c7D- zF;C}FW#PICucwb31tsHCM;m>kX=F$;moWrw6!!`V3xzk(rf)A0Vh~;5goE5GF~OZi zVNjj85}>9ihbxK}VRp@+r@8dDt+wdv^5N*!?}NP;lyv8?!0a&RPzx>u3BlvEm^o=8 zxXn!@HoIE-lirm{ZFQBo>q}+Q1YgP8JR&IsBp@@AsBq871_4c6i(G>p7*Obv#2QR7 zHF9u|xGHs+%mf{%JhQQ%d@_LKN(e45s8(i(2QY{E23553_DK2rv`m5&ah9sSAH-o# z<=KD~YIvK4%eV>!=AtiH*bfW28p9jb)vS?ruRxyfOo{G6T{RVY+}MW_4q0r>E^DmbinS zjkQ`+)gOP~oov4}PyA>$9WM=?3lk!os2ppxIx8na>-hRkkM%DTWj=RQKK5C?`)db0 zc4qxgpLOU;;~8x>9j%@2*l=>XmC0MyMjc76yV8BzDy7J&Q}KCMs<*9sb!0R~*00^M L-XEw#` abstraction, `ItemManager.GetData` hydration path, vague `ItemInstance.Data` identity field, and old `RuntimeItemReference.Projection` cache have been deleted; runtime item facts diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index 69d0e8042..facb6c016 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using GameCult.Aetheria.State.Unity; @@ -10,9 +9,6 @@ public interface IRuntimeItemCatalogReader public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader { - private const string ItemDefinitionPrefix = "aetheria.item_definition:"; - private const string LegacyItemDefinitionPrefix = "aetheria.item_definition:legacy:"; - private readonly Dictionary _typedItemsByKey; public AetheriaRuntimeItemCatalog(AetheriaRuntimeCatalogSnapshot catalog) @@ -29,21 +25,8 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader if (string.IsNullOrWhiteSpace(itemKey)) return null; - if (_typedItemsByKey.TryGetValue(itemKey, out var item)) - return item; - - return Guid.TryParse(RemoveItemPrefix(itemKey), out var legacyId) - ? GetRuntimeItem(AetheriaRuntimeItemReference.FromLegacyId(legacyId)) + return _typedItemsByKey.TryGetValue(itemKey, out var item) + ? item : null; } - - private static string RemoveItemPrefix(string itemKey) - { - if (itemKey.StartsWith(LegacyItemDefinitionPrefix, StringComparison.OrdinalIgnoreCase)) - return itemKey.Substring(LegacyItemDefinitionPrefix.Length); - - return itemKey.StartsWith(ItemDefinitionPrefix, StringComparison.OrdinalIgnoreCase) - ? itemKey.Substring(ItemDefinitionPrefix.Length) - : itemKey; - } } diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemReference.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemReference.cs index 1e6eccf4a..1b7a0f24f 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemReference.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemReference.cs @@ -12,7 +12,6 @@ public interface INamedEntry public class AetheriaRuntimeItemReference { - private const string ItemDefinitionPrefix = "aetheria.item_definition:"; private const string LegacyItemDefinitionPrefix = "aetheria.item_definition:legacy:"; public string ItemKey; @@ -26,32 +25,10 @@ public class AetheriaRuntimeItemReference ItemKey = itemKey; } - public Guid LegacyItemId => TryParseLegacyId(ItemKey, out var itemId) ? itemId : Guid.Empty; - public static string FromLegacyId(Guid legacyItemId) { return legacyItemId == Guid.Empty ? "" : $"{LegacyItemDefinitionPrefix}{legacyItemId:D}"; } - - public static Guid ToLegacyId(string itemKey) - { - return TryParseLegacyId(itemKey, out var itemId) ? itemId : Guid.Empty; - } - - private static bool TryParseLegacyId(string itemKey, out Guid itemId) - { - itemId = Guid.Empty; - if (string.IsNullOrWhiteSpace(itemKey)) - return false; - - var legacyId = itemKey.StartsWith(LegacyItemDefinitionPrefix, StringComparison.OrdinalIgnoreCase) - ? itemKey.Substring(LegacyItemDefinitionPrefix.Length) - : itemKey.StartsWith(ItemDefinitionPrefix, StringComparison.OrdinalIgnoreCase) - ? itemKey.Substring(ItemDefinitionPrefix.Length) - : itemKey; - - return Guid.TryParse(legacyId, out itemId); - } } public interface ITintInspector diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 66394339e..31f230060 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1232,6 +1232,9 @@ First Aetheria surfaces to publish: - Done: delete `Entity`/`EquippedCargoBay` cargo and consumable GUID lookup overloads; transfer, count, active-consumable, and first-item APIs now expose item-key contracts only. + - Done: delete the runtime catalog raw-GUID string fallback and unused + reverse legacy-GUID projections from `AetheriaRuntimeItemReference`; catalog + lookup accepts canonical item keys only. - Remove runtime dependency on `ItemData` DTOs as item instance owners. 5. Mesh host