From d37826ea9a148bbd303389a44348f9e7cc788360 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 11:44:28 +0100 Subject: [PATCH] Remove observed run projection shim --- Aetheria.State.Verify/Program.cs | 31 +++---------------- Assets/Scripts/Gameplay/ActionGameManager.cs | 16 +++++++++- .../AetheriaUnityGameplayBootShell.cs | 2 +- .../AetheriaUnityObservedRunProjection.cs | 22 ------------- ...AetheriaUnityObservedRunProjection.cs.meta | 2 -- .../ServerShared/RuntimeProjection.meta | 8 ----- 6 files changed, 21 insertions(+), 60 deletions(-) delete mode 100644 Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs delete mode 100644 Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs.meta delete mode 100644 Assets/Scripts/ServerShared/RuntimeProjection.meta diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 172fbe89a..f90c7dfe7 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -11786,7 +11786,7 @@ static void RequireMainMenuContinueRunState(string root) "private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>", "private Galaxy ObservedGalaxy { get; set; }", "ObservedGalaxy = boot.ObservedGalaxy", - "zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex)", + "ResolveObservedGalaxyZone", "private AetheriaUnityObservedZoneContextProjector ObservedZoneContextProjector =>", "entity => CurrentEntityBinder.RestoreBinding(entity)", "private AetheriaUnityObservedTargetQuery ObservedTargetQuery =>", @@ -12767,7 +12767,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) "private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>", "private Galaxy ObservedGalaxy { get; set; }", "ObservedGalaxy = boot.ObservedGalaxy", - "zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex)", + "ResolveObservedGalaxyZone", "private AetheriaUnityObservedZoneContextProjector ObservedZoneContextProjector =>", "entity => CurrentEntityBinder.RestoreBinding(entity)", "private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>", @@ -15123,7 +15123,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) "runtimeCatalogDocument.Current", ".ReactiveSectorMap()", "sectorMapDocument.Current", - "AetheriaUnityObservedRunProjection.Project(", + "Galaxy.ProjectObservedSectorMap(", "sectorMap.IsTutorial", "sectorMap.GenerationSeed", "new AetheriaUnityGameplayBootResult(", @@ -15140,31 +15140,10 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) } var observedRunProjectionPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedRunProjection.cs"); - var observedRunProjection = File.Exists(observedRunProjectionPath) - ? File.ReadAllText(observedRunProjectionPath) - : throw new InvalidOperationException("Cannot verify observed run projection ownership; AetheriaUnityObservedRunProjection.cs is missing."); - if (observedRunProjection.Contains("public static Galaxy Galaxy", StringComparison.Ordinal) || - observedRunProjection.Contains("private set;", StringComparison.Ordinal)) + if (File.Exists(observedRunProjectionPath)) { throw new InvalidOperationException( - "AetheriaUnityObservedRunProjection must be a pure projector; observed galaxy ownership belongs to gameplay boot state."); - } - - var forbiddenObservedRunProjectionSymbols = new[] - { - "AetheriaRuntimeDaemonFrameDocument", - "AetheriaRuntimeRunCheckpointCommit", - "ProjectObservedDaemonRun", - "FindZoneSnapshot" - }; - var observedRunProjectionHits = forbiddenObservedRunProjectionSymbols - .Where(symbol => observedRunProjection.Contains(symbol, StringComparison.Ordinal)) - .ToArray(); - if (observedRunProjectionHits.Length > 0) - { - throw new InvalidOperationException( - "AetheriaUnityObservedRunProjection still accepts daemon-frame/run-checkpoint inputs; gameplay boot must use the managed sector-map document: " + - string.Join(", ", observedRunProjectionHits)); + "AetheriaUnityObservedRunProjection is legacy projection chaff; gameplay boot should project the managed sector-map document directly."); } var forbiddenMainMenuReaderSymbols = new[] diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index cb2ff76c4..c5837147f 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -96,7 +96,7 @@ public class ActionGameManager : MonoBehaviour private AetheriaUnityObservedFrameApplier ObservedFrameApplier => _observedFrameApplier ??= new AetheriaUnityObservedFrameApplier( ResolveDaemonObserver, - zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex), + ResolveObservedGalaxyZone, () => Zone, zone => Zone = zone, _observedEntityIndex, @@ -370,6 +370,20 @@ public class ActionGameManager : MonoBehaviour return ObservedDocking.IsEntityUndocked(CurrentEntity); } + private GalaxyZone ResolveObservedGalaxyZone(int daemonZoneIndex) + { + if (daemonZoneIndex < 0 || ObservedGalaxy?.Zones == null) + return null; + + foreach (var zone in ObservedGalaxy.Zones) + { + if (zone != null && zone.ZoneIndex == daemonZoneIndex) + return zone; + } + + return null; + } + // public void ToggleEditMode() // { // _editMode = !_editMode; diff --git a/Assets/Scripts/Gameplay/AetheriaUnityGameplayBootShell.cs b/Assets/Scripts/Gameplay/AetheriaUnityGameplayBootShell.cs index a462cda2b..86b305c03 100644 --- a/Assets/Scripts/Gameplay/AetheriaUnityGameplayBootShell.cs +++ b/Assets/Scripts/Gameplay/AetheriaUnityGameplayBootShell.cs @@ -52,7 +52,7 @@ public sealed class AetheriaUnityGameplayBootShell ? Settings.TutorialBackgroundSettings : Settings.SectorBackgroundSettings; backgroundSettings.NoisePosition = sectorMap.GenerationSeed == 0 ? 1 : sectorMap.GenerationSeed; - var observedGalaxy = AetheriaUnityObservedRunProjection.Project( + var observedGalaxy = global::Galaxy.ProjectObservedSectorMap( sectorMap, backgroundSettings, runtimeCatalog, diff --git a/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs b/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs deleted file mode 100644 index 88be93447..000000000 --- a/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Linq; -using GameCult.Aetheria.State.Verse; - -public static class AetheriaUnityObservedRunProjection -{ - public static Galaxy Project( - AetheriaRuntimeSectorMapDocument sectorMap, - SectorBackgroundSettings backgroundSettings, - AetheriaRuntimeCatalogSnapshot runtimeCatalog, - Action log) - { - return global::Galaxy.ProjectObservedSectorMap(sectorMap, backgroundSettings, runtimeCatalog, log); - } - - public static GalaxyZone FindZone(Galaxy galaxy, int daemonZoneIndex) - { - return daemonZoneIndex < 0 - ? null - : galaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex); - } -} diff --git a/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs.meta b/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs.meta deleted file mode 100644 index b80a8c94f..000000000 --- a/Assets/Scripts/Gameplay/AetheriaUnityObservedRunProjection.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5262d4719f1ec6647a465a9450b2787c \ No newline at end of file diff --git a/Assets/Scripts/ServerShared/RuntimeProjection.meta b/Assets/Scripts/ServerShared/RuntimeProjection.meta deleted file mode 100644 index 84e29514d..000000000 --- a/Assets/Scripts/ServerShared/RuntimeProjection.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 49ec0c83548c7084ab0d3f6c2175ee71 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: