From 19ca2619c8b8be3a059e8336262c5ca8e239371f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 29 Jun 2026 10:16:04 +0100 Subject: [PATCH] Sample sector map through current typed access --- Aetheria.State.Verify/Program.cs | 22 +++++++++++++++------- Assets/Scripts/UI/Menu/SectorMap.cs | 15 +++------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 08803760d..b1e8ae849 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -14950,7 +14950,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) !compactSectorRenderer.Contains(".ReactiveCatalogSnapshot(\"unity-sector-renderer\")", StringComparison.Ordinal) || !compactSectorRenderer.Contains(".ReactivePlayerSettingsDocument(\"unity-sector-renderer\")", StringComparison.Ordinal) || !sectorMap.Contains("AetheriaUnityRuntimeClientProvider", StringComparison.Ordinal) || - !compactSectorMap.Contains(".ReactiveSectorMap(\"unity-sector-map\")", StringComparison.Ordinal) || + !compactSectorMap.Contains(".RuntimeState(\"unity-sector-map\").CurrentSectorMap()", StringComparison.Ordinal) || !sectorRenderer.Contains("AetheriaRuntimeZoneDetailsSurfaceBuilder.Facts(", StringComparison.Ordinal)) { throw new InvalidOperationException( @@ -14964,14 +14964,22 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) "Map and sector UI must not read the raw ObservedGalaxy projection directly."); } - RequireReactiveTypedDocumentAccess( - sectorMap, - "SectorMap", - "AetheriaRuntimeSectorMapDocument", - "_sectorMapDocument", + var forbiddenSectorMapSymbols = new[] + { + "CultMeshReactiveDocument", ".ReactiveSectorMap(\"unity-sector-map\")", "AetheriaRuntimeSectorMapSession", - ".ObserveSectorMap()"); + ".ObserveSectorMap()", + "_sectorMapDocument?.Dispose()" + } + .Where(symbol => sectorMap.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (forbiddenSectorMapSymbols.Length > 0) + { + throw new InvalidOperationException( + "SectorMap should sample the sector map through named current typed state instead of owning a reactive/session handle: " + + string.Join(", ", forbiddenSectorMapSymbols)); + } var requiredDaemonControlValidationSymbols = new[] { diff --git a/Assets/Scripts/UI/Menu/SectorMap.cs b/Assets/Scripts/UI/Menu/SectorMap.cs index 5c0037fd9..43bf9624d 100644 --- a/Assets/Scripts/UI/Menu/SectorMap.cs +++ b/Assets/Scripts/UI/Menu/SectorMap.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using GameCult.Aetheria.State.Verse; -using GameCult.Mesh; using TMPro; using UniRx; using UnityEngine; @@ -53,7 +52,6 @@ public class SectorMap : MonoBehaviour private readonly Queue> _queuedZoneReveals = new Queue>(); private readonly Dictionary _zonesByIndex = new Dictionary(); - private CultMeshReactiveDocument _sectorMapDocument; private AetheriaRuntimeSectorMapDocument _sectorMap; private bool _sectorMapLoaded; @@ -221,9 +219,9 @@ public class SectorMap : MonoBehaviour private void EnsureSectorMapLoaded() { - _sectorMapDocument ??= AetheriaUnityRuntimeClientProvider - .ReactiveSectorMap("unity-sector-map"); - _sectorMap = _sectorMapDocument?.Current; + _sectorMap = AetheriaUnityRuntimeClientProvider + .RuntimeState("unity-sector-map") + .CurrentSectorMap(); if (_sectorMapLoaded) return; @@ -252,13 +250,6 @@ public class SectorMap : MonoBehaviour TryMarkPlayerLocation(_sectorMap.CurrentZoneIndex); } - private void OnDestroy() - { - _sectorMapDocument?.Dispose(); - _sectorMapDocument = null; - _sectorMapLoaded = false; - } - private void AddFactionMaterials(int factionIndex) { if (_factionMaterials.ContainsKey(factionIndex))