From 0460a5c8218f1082cb7c579b3a1b6a3599f452d1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 22:53:02 +0100 Subject: [PATCH] Use reactive documents for sector map reads --- Aetheria.State.Verify/Program.cs | 21 +++++++++++-------- Assets/Scripts/UI/Menu/SectorMap.cs | 7 ++++--- ...AetheriaRuntimeLoadoutSnapshotProjector.cs | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 685a029f9..d8bdee295 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -13832,7 +13832,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) !sectorRenderer.Contains(".ReactivePlayer()", StringComparison.Ordinal) || !sectorMap.Contains("AetheriaUnityRuntimeClientProvider.ResolveClient(", StringComparison.Ordinal) || !sectorMap.Contains(".State", StringComparison.Ordinal) || - !sectorMap.Contains(".ObserveSectorMap()", StringComparison.Ordinal) || + !sectorMap.Contains(".ReactiveSectorMap()", StringComparison.Ordinal) || !sectorRenderer.Contains("AetheriaRuntimeZoneDetailsSurfaceBuilder.ProjectDaemonZone(", StringComparison.Ordinal)) { throw new InvalidOperationException( @@ -13846,12 +13846,14 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) "Map and sector UI must not read the raw ObservedGalaxy projection directly."); } - if (sectorMap.Contains("CultMeshReactiveDocument _sectorMapDocument", StringComparison.Ordinal) || - sectorMap.Contains(".ReactiveSectorMap()", StringComparison.Ordinal)) - { - throw new InvalidOperationException( - "SectorMap still owns a raw sector-map CultMesh document instead of AetheriaRuntimeSectorMapSession."); - } + RequireReactiveTypedDocumentAccess( + sectorMap, + "SectorMap", + "AetheriaRuntimeSectorMapDocument", + "_sectorMapDocument", + ".ReactiveSectorMap()", + "AetheriaRuntimeSectorMapSession", + ".ObserveSectorMap()"); var requiredDaemonControlValidationSymbols = new[] { @@ -17298,7 +17300,7 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) { "ProjectLoadoutTemplateAsync(", "AetheriaClientState state", - ".ObserveDaemonFrame()", + ".ReactiveDaemonFrame()", "ProjectLoadoutTemplate(", "frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit()" }; @@ -17319,7 +17321,8 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) } if (loadoutSnapshotProjector.Contains("state.Daemon.LatestFrame.ReactiveAsync", StringComparison.Ordinal) || - loadoutSnapshotProjector.Contains("state.LatestFrame.ReactiveAsync", StringComparison.Ordinal)) + loadoutSnapshotProjector.Contains("state.LatestFrame.ReactiveAsync", StringComparison.Ordinal) || + loadoutSnapshotProjector.Contains(".ObserveDaemonFrame()", StringComparison.Ordinal)) { throw new InvalidOperationException( "Loadout template save payloads must use named AetheriaClientState reactive daemon frame access instead of walking raw CultMesh handles."); diff --git a/Assets/Scripts/UI/Menu/SectorMap.cs b/Assets/Scripts/UI/Menu/SectorMap.cs index 8c62d62f7..07cc2d339 100644 --- a/Assets/Scripts/UI/Menu/SectorMap.cs +++ b/Assets/Scripts/UI/Menu/SectorMap.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using GameCult.Aetheria.State.Verse; +using GameCult.Mesh; using TMPro; using UniRx; using UnityEngine; @@ -52,7 +53,7 @@ public class SectorMap : MonoBehaviour private readonly Queue> _queuedZoneReveals = new Queue>(); private readonly Dictionary _zonesByIndex = new Dictionary(); - private AetheriaRuntimeSectorMapSession _sectorMapDocument; + private CultMeshReactiveDocument _sectorMapDocument; private AetheriaRuntimeSectorMapDocument _sectorMap; private bool _sectorMapLoaded; @@ -222,8 +223,8 @@ public class SectorMap : MonoBehaviour { _sectorMapDocument ??= ResolveClient() .State - .ObserveSectorMap(); - _sectorMap = _sectorMapDocument.Current; + .ReactiveSectorMap(); + _sectorMap = _sectorMapDocument?.Current; if (_sectorMapLoaded) return; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs index 4c0fa4d4b..401b21d57 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs @@ -15,7 +15,7 @@ namespace GameCult.Aetheria.State.Verse { if (state == null) throw new ArgumentNullException(nameof(state)); - using var frame = state.ObserveDaemonFrame(); + using var frame = state.ReactiveDaemonFrame(); return Task.FromResult(ProjectLoadoutTemplate( frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit(), entityKey ?? ""));