Sample sector map through current typed access

This commit is contained in:
Meta Vens 2026-06-29 10:16:04 +01:00
commit 19ca2619c8
2 changed files with 18 additions and 19 deletions

View file

@ -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<AetheriaRuntimeSectorMapDocument>",
".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[]
{

View file

@ -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<IEnumerable<int>> _queuedZoneReveals = new Queue<IEnumerable<int>>();
private readonly Dictionary<int, AetheriaRuntimeSectorMapZone> _zonesByIndex =
new Dictionary<int, AetheriaRuntimeSectorMapZone>();
private CultMeshReactiveDocument<AetheriaRuntimeSectorMapDocument> _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))