diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index ce6050a15..d88d87ec1 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index ded5e5ec4..280ec3a89 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -15,39 +15,39 @@ public interface IRuntimeItemCatalogReader public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader { private readonly Dictionary _typedItems; - private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = new Dictionary + private static readonly IReadOnlyDictionary BehaviorTypesByKind = new Dictionary(StringComparer.Ordinal) { - { 0, typeof(GuidedWeaponData) }, - { 1, typeof(LauncherData) }, - { 2, typeof(ReactorData) }, - { 3, typeof(RadiatorData) }, - { 4, typeof(StatModifierData) }, - { 5, typeof(SensorData) }, - { 6, typeof(ReflectorData) }, - { 7, typeof(ShieldData) }, - { 8, typeof(ThrusterData) }, - { 9, typeof(WearData) }, - { 10, typeof(VelocityConversionData) }, - { 11, typeof(VelocityLimitData) }, - { 12, typeof(AetherDriveData) }, - { 15, typeof(CooldownData) }, - { 16, typeof(HeatData) }, - { 18, typeof(ItemUsageData) }, - { 20, typeof(SwitchData) }, - { 21, typeof(TriggerData) }, - { 22, typeof(VisibilityData) }, - { 23, typeof(ThermotoggleData) }, - { 24, typeof(EnergyDrawData) }, - { 26, typeof(MiningToolData) }, - { 28, typeof(ResourceScannerData) }, - { 31, typeof(CapacitorData) }, - { 32, typeof(CockpitData) }, - { 33, typeof(HeatStorageData) }, - { 34, typeof(TurretControllerData) }, - { 35, typeof(InstantWeaponData) }, - { 36, typeof(ConstantWeaponData) }, - { 37, typeof(ChargedWeaponData) }, - { 38, typeof(AutoWeaponData) } + { "GuidedWeapon", typeof(GuidedWeaponData) }, + { "Launcher", typeof(LauncherData) }, + { "Reactor", typeof(ReactorData) }, + { "Radiator", typeof(RadiatorData) }, + { "StatModifier", typeof(StatModifierData) }, + { "Sensor", typeof(SensorData) }, + { "Reflector", typeof(ReflectorData) }, + { "Shield", typeof(ShieldData) }, + { "Thruster", typeof(ThrusterData) }, + { "Wear", typeof(WearData) }, + { "VelocityConversion", typeof(VelocityConversionData) }, + { "VelocityLimit", typeof(VelocityLimitData) }, + { "AetherDrive", typeof(AetherDriveData) }, + { "Cooldown", typeof(CooldownData) }, + { "Heat", typeof(HeatData) }, + { "ItemUsage", typeof(ItemUsageData) }, + { "Switch", typeof(SwitchData) }, + { "Trigger", typeof(TriggerData) }, + { "Visibility", typeof(VisibilityData) }, + { "Thermotoggle", typeof(ThermotoggleData) }, + { "EnergyDraw", typeof(EnergyDrawData) }, + { "MiningTool", typeof(MiningToolData) }, + { "ResourceScanner", typeof(ResourceScannerData) }, + { "Capacitor", typeof(CapacitorData) }, + { "Cockpit", typeof(CockpitData) }, + { "HeatStorage", typeof(HeatStorageData) }, + { "TurretController", typeof(TurretControllerData) }, + { "InstantWeapon", typeof(InstantWeaponData) }, + { "ConstantWeapon", typeof(ConstantWeaponData) }, + { "ChargedWeapon", typeof(ChargedWeaponData) }, + { "AutoWeapon", typeof(AutoWeaponData) } }; public AetheriaRuntimeItemCatalog(AetheriaRuntimeCatalogSnapshot catalog) @@ -95,7 +95,7 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader private static BehaviorData BuildBehaviorConfig(AetheriaRuntimeBehaviorPayload payload) { - if (!BehaviorTypesByUnionKey.TryGetValue(payload.UnionKey, out var behaviorType)) + if (!BehaviorTypesByKind.TryGetValue(payload.Kind, out var behaviorType)) { return null; } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 27236fed4..2522547f5 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -529,9 +529,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. 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. Runtime item category classification uses - package-owned `AetheriaRuntimeItemCategories` tokens; gameplay code should not - ask C# legacy DTO class names to classify typed catalog rows. + `UnionAttribute` reflection, and the temporary behavior config constructor + map is keyed by typed behavior payload kind rather than legacy union key. + Runtime item category classification uses package-owned + `AetheriaRuntimeItemCategories` tokens; gameplay code should not ask C# + legacy DTO class names to classify typed catalog rows. Item/behavior DTO field layout for the temporary projection bridge is now marked with project-owned `LegacyPayloadKeyAttribute`, not MessagePack metadata. Item properties @@ -786,6 +788,9 @@ First Aetheria surfaces to publish: off `Data.Behaviors` and onto typed runtime behavior payload config construction; `BehaviorData` remains only the temporary behavior-class config bridge. + - Done: move the temporary behavior config constructor map from legacy union + keys to typed behavior payload kind strings; union keys remain migration + provenance only for this runtime path. - Done: move `StatModifier` behavior requirements and behavior-stat targets off `EquippableItemData.Behaviors` and onto typed runtime behavior config; the obsolete item-DTO stat target branch is deleted because the live