Query daemon zones by explicit zone index
This commit is contained in:
parent
7440eda8a9
commit
d7fc9d29eb
3 changed files with 14 additions and 13 deletions
|
|
@ -3712,7 +3712,7 @@ static void RequireSectorMapZoneDetailsUseEveSurface(string root)
|
|||
"AetheriaEveUnitySurfaceHost.Hide(_zoneDetailsSurfaceDocument)",
|
||||
"AetheriaRuntimeZoneDetailsSurfaceBuilder.Build(ProjectZoneDetailsSurfaceState(",
|
||||
"ProjectZoneDetailsSurfaceState(",
|
||||
"GameManager?.FindDaemonZoneSnapshot(zone)",
|
||||
"GameManager?.FindDaemonZoneSnapshot(zone?.ZoneIndex ?? -1)",
|
||||
"daemonZone.Bodies ?? Array.Empty<AetheriaRuntimeBodySnapshotCommit>()",
|
||||
"daemonZone.Entities ?? Array.Empty<AetheriaRuntimeEntitySnapshotCommit>()",
|
||||
"typedHull.HullType",
|
||||
|
|
@ -8060,9 +8060,9 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
{
|
||||
"ApplyLatestAuthoritativeDaemonFrame()",
|
||||
"ResolveDaemonObserver()",
|
||||
"public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(GalaxyZone zone)",
|
||||
"public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(int daemonZoneIndex)",
|
||||
"public GalaxyZone CurrentDaemonGalaxyZone",
|
||||
"zone?.ZoneIndex ?? -1",
|
||||
"snapshot.ZoneIndex == daemonZoneIndex",
|
||||
"FindObservedGalaxyZone(run.CurrentZoneIndex)",
|
||||
"observed.IsAuthoritative",
|
||||
"TryRestoreEntityGraphFromDaemonRun(observed.Run)",
|
||||
|
|
@ -8152,6 +8152,13 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
"Unity gameplay must resolve observed zones by daemon zone identity, not projected array slot.");
|
||||
}
|
||||
|
||||
if (actionGameManager.Contains("FindDaemonZoneSnapshot(GalaxyZone", StringComparison.Ordinal) ||
|
||||
sectorRenderer.Contains("FindDaemonZoneSnapshot(zone)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Unity UI must query daemon zone snapshots by daemon zone identity instead of passing projected zone objects.");
|
||||
}
|
||||
|
||||
if (galaxy.Contains("public Zone Contents", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
|
|
|
|||
|
|
@ -851,11 +851,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
return RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
|
||||
private static int ZoneIndex(GalaxyZone zone)
|
||||
{
|
||||
return zone?.ZoneIndex ?? -1;
|
||||
}
|
||||
|
||||
private static GalaxyZone FindObservedGalaxyZone(int daemonZoneIndex)
|
||||
{
|
||||
return daemonZoneIndex < 0
|
||||
|
|
@ -863,15 +858,14 @@ public class ActionGameManager : MonoBehaviour
|
|||
: ObservedGalaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(GalaxyZone zone)
|
||||
public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(int daemonZoneIndex)
|
||||
{
|
||||
var zoneIndex = ZoneIndex(zone);
|
||||
if (zoneIndex < 0)
|
||||
if (daemonZoneIndex < 0)
|
||||
return null;
|
||||
|
||||
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
|
||||
return (run?.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == zoneIndex);
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
public GalaxyZone CurrentDaemonGalaxyZone
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
.Where(name => !string.IsNullOrWhiteSpace(name))
|
||||
.ToArray();
|
||||
|
||||
var daemonZone = GameManager?.FindDaemonZoneSnapshot(zone);
|
||||
var daemonZone = GameManager?.FindDaemonZoneSnapshot(zone?.ZoneIndex ?? -1);
|
||||
if (daemonZone == null)
|
||||
{
|
||||
return new AetheriaRuntimeZoneDetailsSurfaceState(
|
||||
|
|
|
|||
Loading…
Reference in a new issue