diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index f94de5d1b..3d4d5febb 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 205a5e202..ec4d6a358 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -100,9 +100,10 @@ The package runtime catalog snapshot indexes items by canonical item key; Unity gameplay, HUD, inventory, trade, ship, and zone helper lookups use `ItemKey` directly instead of deriving `ItemId` and searching by legacy GUID. The shared runtime item catalog reader is also item-key-only now: its GUID index, -`GetRuntimeItem(Guid)` entry point, and `AetheriaRuntimeItemReference(Guid)` -constructor have been deleted. Legacy GUID helpers remain only as explicit -compatibility projections. +`GetRuntimeItem(Guid)` entry point, raw GUID string fallback, +`AetheriaRuntimeItemReference(Guid)` constructor, and reverse legacy-GUID +projections have been deleted. `FromLegacyId` remains only as an explicit +migration/projection helper. The old generic `RuntimeCatalogLink` 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