From b059ab4a106d8f3e5cba513693e27be20eb2aab6 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 08:52:31 +0100 Subject: [PATCH] Delete dead behavior persistence hook --- .voidbot/state/aetheria.cc | Bin 78984 -> 79797 bytes .../ServerShared/Behaviors/Behaviors.cs | 10 --------- .../RuntimeEntityBlueprintProjector.cs | 21 ------------------ docs/aetheria-perfect-machine-map.md | 8 ++++++- 4 files changed, 7 insertions(+), 32 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index cf7833bbe6645de91dc1e27379bcf0bb5410e67d..8966cb30d47835000a595d1349b3b91c0a8e6373 100644 GIT binary patch delta 1533 zcmZux&2Jk;6xRf+NqPdcDWV_g>j4pmtYf!vNpe7KlOjdpqpgAv5eJWVo_D8R?`&pf z-54R6suv`XP+5r;7cP9Nl@LJ+IU(S{smGquKcEsP#E~0s*SqdVa`Noc_|5PAKHevP zS9boX{QUjc;bwh#p;=p8I=^v;O(lPgeOgqO>W#djp8IfAY37xQ%IUFJwr*D|yVVN& zWooxN%}yRZ``M3O>?++~6MGGg)<-S5(?*~7q|#1+9(VhWuhb3W2n^7oNMD#@AMp1s zhgRA?lviPO{T^&XIr?M67w6#v9JeW9utT zj!HInjtm~M@l}=I(nu!KO2p(A5{xd8DSH^eGZPK1ck#+vPR2p@D?LGt+JS15*l)y{ zcShsFO{H&u@l`w?2A!O*0gH@I<*ry*D-Wz72c9(}P@o)`0Cb|8M#?IK@N^6B(^lI zi(c~ao7ZN~y~QK?bd?rE2bC}Gi+J+t#Pr1r+Jgf^_0hqvjmnRcl-#;=VrJ%T%DyDJ zh#P`KOT=W5xD0`J$bGq$Nw0+6pBi6SZ#0%0^)x!lrjO*u<$AqVuh%!ewcImbrvIK| zFD`Buf;c1B{FDjebfu?xCj8xE4GOF70%g5qK*RrYWdx{`q)H2^(FqKn?*c0#@U2rjy2?6x6-a!8*<$m)zAnz zGhFPlXn~00s8DMIWJKLPO)k&Rcjw=8UBHn&C?0tWs76xrJeu#QR@X<#L}sost-?_P z^ZHS)Se9v7*6J%sUGd^wvbXOOcJZce`{+`;WjHe2?kU#0ySqO|E({KBv%rq3RO&%K zQ+tCXf8tUlIhay=KQorx%FJx%R@Api@+rBfvemh$t^OXq-2R)%t6K(nlt$FvB+2jo NHpt#UQfIcb`VVN>M}z where T : IBehavior -{ - PersistentBehaviorData Store(); - void Restore(PersistentBehaviorData data); -} - public interface IPopulationAssignment { int AssignedPopulation { get; set; } } -public abstract class PersistentBehaviorData -{ -} - [Inspectable] public abstract class BehaviorData { diff --git a/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs b/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs index 4f3dac1cb..ec4dc2662 100644 --- a/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs +++ b/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs @@ -27,16 +27,6 @@ public static class RuntimeEntityBlueprintProjector blueprint.Settings = entity.Settings; - // Filter item behavior collections by those with any persistent behaviors - // For each item create an object containing the item position and a list of persistent behaviors - // Then turn that into a dictionary mapping from item position to an array of every behaviors persistent data - blueprint.PersistedBehaviors = entity.Equipment - .Where(item => item.Behaviors.Any(b=>b is IPersistentBehavior)) - .Select(item => new {equippable=item, behaviors = item.Behaviors - .Where(b=>b is IPersistentBehavior) - .Cast()}) - .ToDictionary(x=> x.equippable.Position, x=>x.behaviors.Select(b => b.Store()).ToArray()); - blueprint.Hull = entity.Hull; blueprint.Name = entity.Name; blueprint.Faction = entity.Faction?.ID ?? Guid.Empty; @@ -117,16 +107,6 @@ public static class RuntimeEntityBlueprintProjector foreach (var (position, item) in blueprint.DockingBayContents[bayIndex]) entity.DockingBays[bayIndex].TryStore(instantiate ? itemManager.Instantiate(item) : item, position); - // Iterate only over the behaviors of items which contain persistent data - // Filter the behaviors for each item to get the persistent ones, then cast them and combine with the persisted data array for that item - foreach (var persistentBehaviorData in entity.Equipment - .Where(item => blueprint.PersistedBehaviors.ContainsKey(item.Position)) - .SelectMany(item => item.Behaviors - .Where(b=> b is IPersistentBehavior) - .Cast() - .Zip(blueprint.PersistedBehaviors[item.Position], (behavior, data) => new{behavior, data}))) - persistentBehaviorData.behavior.Restore(persistentBehaviorData.data); - if(!instantiate) entity.Temperature = blueprint.Temperature; @@ -168,7 +148,6 @@ public abstract class RuntimeEntityBlueprint public (int2 position, EquippableItem item)[] Equipment; public (int2 position, EquippableItem item)[] CargoBays; public (int2 position, EquippableItem item)[] DockingBays; - public Dictionary PersistedBehaviors; public float[,] Temperature; public float[,] Armor; public bool2[,] Conductivity; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index b45295e23..bdf5a6cbf 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -122,7 +122,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. rather than durable file formats. Runtime blueprint restore now iterates typed hull shape rows when restoring saved conductivity, and blueprint price aggregation uses typed runtime item prices through `ItemManager` instead of - hydrating `HullData.Shape` or `ItemData.Price`. + hydrating `HullData.Shape` or `ItemData.Price`. Runtime blueprints no longer + capture or restore behavior-private `PersistentBehaviorData` blobs; that dead + save-shape hook and its `IPersistentBehavior` interface are deleted. - `Aetheria.State` now defines `AetheriaLoadoutTemplate` as the typed Verse replacement for bespoke `.loadout` files. It stores structured hull, equipment, cargo bay, docking bay, child-entity, assignment, and weapon-group @@ -775,6 +777,10 @@ First Aetheria surfaces to publish: typed runtime item rows; `ItemManager.Instantiate` now clones simple commodities, crafted items, consumables, and equippables from `AetheriaRuntimeCatalogItem` identity and facets. + - Done: delete dead runtime blueprint behavior-private persistence: + `PersistedBehaviors`, `IPersistentBehavior`, and `PersistentBehaviorData` + 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 `AetheriaRuntimeItemCatalog` whole-item DTO cache, and