Use reactive documents for sector map reads
This commit is contained in:
parent
78a3f0983d
commit
0460a5c821
3 changed files with 17 additions and 13 deletions
|
|
@ -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<AetheriaRuntimeSectorMapDocument> _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.");
|
||||
|
|
|
|||
|
|
@ -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<IEnumerable<int>> _queuedZoneReveals = new Queue<IEnumerable<int>>();
|
||||
private readonly Dictionary<int, AetheriaRuntimeSectorMapZone> _zonesByIndex =
|
||||
new Dictionary<int, AetheriaRuntimeSectorMapZone>();
|
||||
private AetheriaRuntimeSectorMapSession _sectorMapDocument;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeSectorMapDocument> _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;
|
||||
|
|
|
|||
|
|
@ -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 ?? ""));
|
||||
|
|
|
|||
Loading…
Reference in a new issue