From 1a7ea0a0e5d44496d04aa057c6de6530ac40c092 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 09:19:53 +0100 Subject: [PATCH] Rename runtime item reader around typed catalog --- .voidbot/state/aetheria.cc | Bin 80774 -> 82500 bytes .../AetheriaRuntimeItemCatalog.cs | 16 +++--- .../ServerShared/Behaviors/StatModifier.cs | 4 +- Assets/Scripts/ServerShared/Entity.cs | 4 +- Assets/Scripts/ServerShared/ItemManager.cs | 12 ++--- ...ectionEntry.cs => RuntimeItemReference.cs} | 0 ...y.cs.meta => RuntimeItemReference.cs.meta} | 0 docs/aetheria-perfect-machine-map.md | 50 +++++++++--------- 8 files changed, 43 insertions(+), 43 deletions(-) rename Assets/Scripts/ServerShared/{RuntimeProjection/RuntimeItemProjectionEntry.cs => RuntimeItemReference.cs} (100%) rename Assets/Scripts/ServerShared/{RuntimeProjection/RuntimeItemProjectionEntry.cs.meta => RuntimeItemReference.cs.meta} (100%) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 7026d82a2517a76c239432cb96703f13baaf7e0b..e90ea905ae22064c4d57cee06f22bfcc895d47c7 100644 GIT binary patch delta 1888 zcmZ`)U2GLa6wbDV7LqE0P`Ma87&X>(_x{jZN(D=#q9rKUpdskP&fT58J9c;Hc4ltN zHNoVWfS z`ti*zUw$;Ot$b*wMYFl@Xkobq&5b}6dQci_*6^AXJlx6pfY@MV(7-i zkhOLA`VMPu+_`imCNbl!1%KVfM23V@Z1ZL!X-sS?No;e1eZuVo$3&#xJz~AQ_QYcT zj`Taq-%<9C61ED4AR?Ybveh6y^034at0T6W5H3R6a6a@ROyl;z&NCrFqRCh23Qg+h zg@no$GO2r^QG;=bs6g(5Nn2Qew8!$Wi&=5*BqWyLppGu(NaNYh3q>#;1Ka1DYo!~k8lxEiN^ zouH5c(^IlaB<&GKl{+&Ob-OH21(TNH@n8#*8X{x&7BjPNY4BwRN(>z3R|G{oD5HO z3E~3s9mr4Tv7jL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X7vx4Csz&t diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index 1131b373a..ded5e5ec4 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -6,13 +6,13 @@ using System.Reflection; using GameCult.Aetheria.State.Unity; using Unity.Mathematics; -public interface IRuntimeItemProjectionReader +public interface IRuntimeItemCatalogReader { AetheriaRuntimeCatalogItem GetRuntimeItem(Guid guid); - IReadOnlyList GetBehaviorProjections(Guid guid); + IReadOnlyList GetRuntimeBehaviorConfigs(Guid guid); } -public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader +public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader { private readonly Dictionary _typedItems; private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = new Dictionary @@ -65,18 +65,18 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader return item; } - public IReadOnlyList GetBehaviorProjections(Guid guid) + public IReadOnlyList GetRuntimeBehaviorConfigs(Guid guid) { var item = GetRuntimeItem(guid); return item == null ? Array.Empty() - : ProjectBehaviors(item); + : BuildBehaviorConfigs(item); } - private static BehaviorData[] ProjectBehaviors(AetheriaRuntimeCatalogItem item) + private static BehaviorData[] BuildBehaviorConfigs(AetheriaRuntimeCatalogItem item) { return item.BehaviorPayloads - .Select(ProjectBehavior) + .Select(BuildBehaviorConfig) .Where(behavior => behavior != null) .ToArray(); } @@ -93,7 +93,7 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader }; } - private static BehaviorData ProjectBehavior(AetheriaRuntimeBehaviorPayload payload) + private static BehaviorData BuildBehaviorConfig(AetheriaRuntimeBehaviorPayload payload) { if (!BehaviorTypesByUnionKey.TryGetValue(payload.UnionKey, out var behaviorType)) { diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index 296822341..08617a7cc 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -66,7 +66,7 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa _stats = Entity.Equipment .Select(hp => hp.EquippableItem) .Where(HasRequiredBehavior) - .SelectMany(gear => ItemManager.GetRuntimeBehaviorProjections(gear)) + .SelectMany(gear => ItemManager.GetRuntimeBehaviorConfigs(gear)) .Where(behaviorData => behaviorData.GetType() == targetType) .Select(behaviorData => statField.GetValue(behaviorData) as PerformanceStat) .ToArray(); @@ -77,7 +77,7 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa private bool HasRequiredBehavior(EquippableItem gear) { return _data.RequireBehavior == null || - ItemManager.GetRuntimeBehaviorProjections(gear) + ItemManager.GetRuntimeBehaviorConfigs(gear) .Any(behavior => behavior.GetType() == _data.RequireBehavior); } diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 6aa1dd5b6..43ff1841c 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -1188,7 +1188,7 @@ public class ConsumableItemEffect _effectiveness = CreateEffectivenessCurve(RuntimeItem); RemainingDuration = _duration; - Behaviors = entity.ItemManager.GetRuntimeBehaviorProjections(item) + Behaviors = entity.ItemManager.GetRuntimeBehaviorConfigs(item) .Select(bd => bd.CreateInstance(this)) .ToArray(); } @@ -1393,7 +1393,7 @@ public class EquippedItem .CombineLatest(Online, (enabled, online) => enabled && online).DistinctUntilChanged()); - Behaviors = ItemManager.GetRuntimeBehaviorProjections(item) + Behaviors = ItemManager.GetRuntimeBehaviorConfigs(item) .Select(bd => bd.CreateInstance(this)) .ToArray(); diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 13b8aa750..0ebb9fbeb 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -30,7 +30,7 @@ public class ItemManager // private Guid _forceLoadZone; - private readonly IRuntimeItemProjectionReader _itemProjections; + private readonly IRuntimeItemCatalogReader _runtimeItems; public GameplaySettings GameplaySettings { get; } // public double Time @@ -46,9 +46,9 @@ public class ItemManager // private readonly Dictionary Tier = new Dictionary(); - public ItemManager(IRuntimeItemProjectionReader itemProjections, GameplaySettings settings, Action logger) + public ItemManager(IRuntimeItemCatalogReader runtimeItems, GameplaySettings settings, Action logger) { - _itemProjections = itemProjections; + _runtimeItems = runtimeItems; GameplaySettings = settings; _logger = logger; } @@ -61,15 +61,15 @@ public class ItemManager public AetheriaRuntimeCatalogItem GetRuntimeItem(Guid itemId) { - return itemId == Guid.Empty ? null : _itemProjections.GetRuntimeItem(itemId); + return itemId == Guid.Empty ? null : _runtimeItems.GetRuntimeItem(itemId); } - public IReadOnlyList GetRuntimeBehaviorProjections(ItemInstance item) + public IReadOnlyList GetRuntimeBehaviorConfigs(ItemInstance item) { var itemId = item?.Data?.ItemId ?? Guid.Empty; return itemId == Guid.Empty ? Array.Empty() - : _itemProjections.GetBehaviorProjections(itemId); + : _runtimeItems.GetRuntimeBehaviorConfigs(itemId); } public Shape GetRuntimeShape(ItemInstance item) diff --git a/Assets/Scripts/ServerShared/RuntimeProjection/RuntimeItemProjectionEntry.cs b/Assets/Scripts/ServerShared/RuntimeItemReference.cs similarity index 100% rename from Assets/Scripts/ServerShared/RuntimeProjection/RuntimeItemProjectionEntry.cs rename to Assets/Scripts/ServerShared/RuntimeItemReference.cs diff --git a/Assets/Scripts/ServerShared/RuntimeProjection/RuntimeItemProjectionEntry.cs.meta b/Assets/Scripts/ServerShared/RuntimeItemReference.cs.meta similarity index 100% rename from Assets/Scripts/ServerShared/RuntimeProjection/RuntimeItemProjectionEntry.cs.meta rename to Assets/Scripts/ServerShared/RuntimeItemReference.cs.meta diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index e2a382681..45fb5ad54 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -147,7 +147,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. gameplay/UI API, and its old `GetData`/`Hydrate` item DTO projection path has been deleted. `AetheriaRuntimeItemCatalog` no longer materializes whole `ItemData` DTOs as a runtime cache; it exposes typed item rows plus the - temporary behavior payload projection bridge. The item properties UI no longer uses + temporary behavior config bridge. The item properties UI no longer uses `ItemManager` for manufacturer display; it resolves the manufacturer through the package-owned `ActionGameManager.RuntimeCatalog` typed snapshot. Entity restore and loadout manufacturer-distance weighting no longer use `ItemManager` @@ -208,11 +208,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. derives from the typed runtime catalog row. `EquippedItem.InsetShape` now derives from typed hull/item shape rows. `EquippedItem` and `ConsumableItemEffect` behavior construction now read typed behavior payloads - through the runtime behavior projection bridge before instantiating the + through the runtime behavior config bridge before instantiating the current `BehaviorData`-backed behavior classes. `BehaviorData` remains the temporary behavior-class config bridge, not the runtime behavior payload owner. `StatModifier` behavior requirements and behavior-stat targets also - read that typed behavior projection bridge instead of hydrating + read that typed behavior config bridge instead of hydrating `EquippableItemData.Behaviors`. Its old item-DTO stat branch was deleted after inspection showed no active `PerformanceStat` fields on the live equippable item DTO hierarchy. @@ -415,15 +415,12 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. legacy `Faction` entries through `ItemManager`; they use `Galaxy.ResolveFaction` over the typed corporation projection. - The `give` command no longer enumerates legacy item catalog entries; typed - catalog selection owns the command match, with runtime item projection kept - as an instantiation-only bridge. + catalog selection owned the command match before the command was deleted. - `LoadoutGenerator` no longer enumerates legacy item catalog entries for its candidate pool; typed catalog filtering owns the first item selection pass, - with runtime item projection kept as a fitting/instantiation bridge. -- `LoadoutGenerator` names the post-selection bridge as runtime item - projection: typed catalog rows own candidate selection, and `ItemManager` - only projects the selected row into the temporary DTO shape needed by fitting - and instantiation. + and typed runtime item rows are passed directly to `ItemManager` for + instantiation. The remaining post-selection bridge is behavior config + construction for old behavior constructors, not whole-item DTO hydration. - `TradeMenuDebug` no longer enumerates legacy item catalog entries for its table rows; typed trade catalog records own the row set, with legacy DTO hydration kept for the old debug UI callbacks. @@ -525,19 +522,19 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. contract for full .NET smokes and Eve surface reads. Neither writes state or owns simulation. The runtime no longer has a MessagePack catalog cache or whole-item DTO projection cache. `AetheriaRuntimeItemCatalog` exposes typed - item rows and temporarily projects typed behavior payloads into `BehaviorData` - objects for the old behavior class constructors. `RuntimeItemReference.ItemId` - is the only item reference value. The reader interface for this bridge is named - `IRuntimeItemProjectionReader` so callers cannot mistake it for catalog - ownership. Behavior type selection now uses an explicit runtime catalog map - instead of `UnionAttribute` reflection. + item rows and temporarily builds `BehaviorData` config objects from typed + behavior payloads for the old behavior class constructors. + `RuntimeItemReference.ItemId` is the only item reference value. The reader + interface for this bridge is named `IRuntimeItemCatalogReader` so callers see + typed catalog row ownership rather than old DTO projection ownership. Behavior + type selection now uses an explicit runtime catalog map instead of + `UnionAttribute` reflection. Item/behavior DTO field layout for the temporary projection bridge is now marked with project-owned `LegacyPayloadKeyAttribute`, not MessagePack metadata. Item properties - manufacturer display is a typed snapshot consumer; loadout generation is the - remaining runtime single-ID item projection bridge, but typed catalog rows own - the loadout candidate prefilters for hull type, shape, category, hardpoint - type, and behavior kind before that bridge is invoked. The old trade debug UI + manufacturer display is a typed snapshot consumer; loadout generation uses + typed catalog rows for hull type, shape, category, hardpoint type, behavior + kind prefilters, and selected-item instantiation. The old trade debug UI and console `give` command have been deleted. The surviving trade menu also uses typed catalog rows for first-pass size, hardpoint, and behavior filters before hydrating row projections. No live caller can enumerate @@ -569,7 +566,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. file save, and migration all need to converge on one typed commit primitive. - Deletion line: no new behavior should be added to old `ItemData` DTO metadata or MessagePack catalog paths except bounded migration readers and the - current typed behavior projection bridge. + current typed behavior config bridge. ## Target Authority Map @@ -794,7 +791,7 @@ First Aetheria surfaces to publish: no longer exist, so behavior state cannot smuggle itself through the blueprint projection path. - Done: delete the runtime item DTO hydration bridge; `ItemManager.GetData`, - `ItemManager.Hydrate`, `IRuntimeItemProjectionReader.Get`, the + `ItemManager.Hydrate`, the old projection reader item DTO API, the `AetheriaRuntimeItemCatalog` whole-item DTO cache, and `RuntimeItemReference.Projection` are gone. - Done: move final `Entity.ItemFits`, `TryFindSpace`, `TryEquip`, and @@ -886,9 +883,8 @@ First Aetheria surfaces to publish: MessagePack, Newtonsoft, RethinkDB, or bespoke save-file serializer symbols. - Done: delete dead `PlayerData` and `GalaxyMapLayerData` catalog roots, and remove legacy catalog group/table annotations from surviving runtime DTOs. - - Done: rename loadout generation's selected-item bridge from legacy - hydration to runtime item projection; typed catalog filtering remains the - selection owner. + - Done: move loadout generation's selected-item instantiation onto typed + runtime item rows; typed catalog filtering remains the selection owner. - Done: remove stale main-menu/editor database vocabulary from Unity UI surfaces; galaxy generation now reports typed catalog loading. - Done: remove the stale `MessagePack` assembly reference from @@ -997,6 +993,10 @@ First Aetheria surfaces to publish: - Done: delete the dead `ItemManager.GetRuntimeItemProjection` bridge after loadout generation stopped hydrating selected typed rows into `EquippableItemData` merely to instantiate equipment. + - Done: rename the surviving runtime item read port from + `IRuntimeItemProjectionReader` to `IRuntimeItemCatalogReader`, and rename + behavior config methods to temporary behavior config construction so + old projection vocabulary no longer implies item DTO authority. - Done: quarantine the vendored Unity `MessagePack` assembly by disabling asmdef auto-reference; only explicit state-spine assemblies should see it while the Unity CultCache bridge still needs a low-level `.cc` codec.