Route catalog reads through managed document
This commit is contained in:
parent
943a210bc5
commit
03b1e082ea
15 changed files with 43 additions and 15 deletions
|
|
@ -4491,7 +4491,7 @@ static void RequireSectorMapZoneDetailsUseEveSurface(string root)
|
|||
".LatestAsync()",
|
||||
".Details",
|
||||
".Zone(zoneIndex)",
|
||||
"OpenRuntimeCatalog()",
|
||||
".Catalog",
|
||||
".Settings",
|
||||
".Player",
|
||||
".Latest()",
|
||||
|
|
@ -4534,6 +4534,7 @@ static void RequireSectorMapZoneDetailsUseEveSurface(string root)
|
|||
"Properties.AddProperty(\"Ships\"",
|
||||
"GameManager.Settings.ZoneSettings.ZoneRadius.Evaluate(",
|
||||
"GameManager.Settings.ZoneSettings.ZoneMass.Evaluate(",
|
||||
"OpenRuntimeCatalog()",
|
||||
"ProjectZoneBodies(",
|
||||
"ProjectZoneEntities(",
|
||||
"new AetheriaRuntimeZoneDetailsBodyProjection(",
|
||||
|
|
@ -7305,7 +7306,8 @@ static void RequireClientTargetBootAuthority(string root)
|
|||
"stateBoot.StateFileExists",
|
||||
"private static AetheriaRuntimeCatalogSnapshot _runtimeCatalog",
|
||||
"FindTypedRuntimeItem(",
|
||||
"_runtimeCatalog?.FindItem("
|
||||
"_runtimeCatalog?.FindItem(",
|
||||
".OpenRuntimeCatalog()"
|
||||
};
|
||||
var actionGameManagerBootHits = forbiddenActionGameManagerBootSymbols
|
||||
.Where(symbol => actionGameManager.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -7328,7 +7330,9 @@ static void RequireClientTargetBootAuthority(string root)
|
|||
"!stateBoot.SupportsLocalStateFileRead",
|
||||
"stateBoot.StateFileExists",
|
||||
"AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)",
|
||||
".OpenRuntimeCatalog()",
|
||||
".Aetheria()",
|
||||
".Catalog",
|
||||
".Latest()",
|
||||
"new ItemManager(",
|
||||
"new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog)",
|
||||
"ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)",
|
||||
|
|
@ -11429,7 +11433,8 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
!sectorRenderer.Contains(".LatestAsync()", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Details", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Zone(zoneIndex)", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains("OpenRuntimeCatalog()", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Catalog", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Latest()", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Settings", StringComparison.Ordinal) ||
|
||||
!sectorRenderer.Contains(".Player", StringComparison.Ordinal) ||
|
||||
!sectorMap.Contains("private AetheriaClient _client", StringComparison.Ordinal) ||
|
||||
|
|
@ -12853,7 +12858,9 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"public AetheriaUnityGameplayBootResult Boot()",
|
||||
"AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory)",
|
||||
"AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)",
|
||||
"OpenRuntimeCatalog()",
|
||||
".Aetheria()",
|
||||
".Catalog",
|
||||
".Latest()",
|
||||
"new ItemManager(",
|
||||
"new AetheriaUnityLoadoutItemProjector(itemManager, runtimeCatalog)",
|
||||
"ZoneRenderer.SetDroppedPickupItemProjector(loadoutItemProjector.CreateLoadoutItem)",
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public abstract class ActionBarBinding
|
|||
|
||||
try
|
||||
{
|
||||
_catalog ??= Client.OpenRuntimeCatalog();
|
||||
_catalog ??= Client.Aetheria().Catalog.Latest();
|
||||
return _catalog?.FindItem(item.ItemKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ public sealed class AetheriaUnityGameplayBootShell
|
|||
}
|
||||
|
||||
var runtimeCatalog = AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)
|
||||
.OpenRuntimeCatalog();
|
||||
.Aetheria()
|
||||
.Catalog
|
||||
.Latest();
|
||||
if (runtimeCatalog == null)
|
||||
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
|
||||
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ public class DaemonRuntimeDocumentTests
|
|||
|
||||
var currentEntity = client.Aetheria().Current.Entity.LatestAsync().GetAwaiter().GetResult();
|
||||
var latestFrame = client.Aetheria().LatestFrame.LatestAsync().GetAwaiter().GetResult();
|
||||
var catalog = client.Aetheria().Catalog.LatestAsync().GetAwaiter().GetResult();
|
||||
var playerSettings = client.Aetheria().Settings.Player.LatestAsync().GetAwaiter().GetResult();
|
||||
var verseHostSettings = client.Aetheria().Settings.VerseHost.LatestAsync().GetAwaiter().GetResult();
|
||||
var currentEntityByType = client.Aetheria()
|
||||
|
|
@ -217,6 +218,7 @@ public class DaemonRuntimeDocumentTests
|
|||
|
||||
Assert.AreEqual("aetheria.current.entity", client.State.Current.Entity.DocumentId);
|
||||
Assert.AreSame(client.State.Current.Entity, client.State.Document<AetheriaRuntimeCurrentEntityDocument>());
|
||||
Assert.AreSame(client.State.Catalog, client.Document<AetheriaRuntimeCatalogSnapshot>());
|
||||
Assert.AreSame(client.State.ZoneRender, client.Document<AetheriaRuntimeZoneRenderDocument>());
|
||||
Assert.AreSame(client.State.LatestFrame, client.Document<AetheriaRuntimeDaemonFrameDocument>());
|
||||
Assert.AreSame(client.State.Settings.Player, client.Document<AetheriaRuntimePlayerSettingsDocument>());
|
||||
|
|
@ -240,6 +242,8 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.Frame, latestFrame.Schema);
|
||||
Assert.AreEqual(frame.FrameId, latestFrame.FrameId);
|
||||
Assert.AreEqual(frame.FrameId, latestFrameByType.FrameId);
|
||||
Assert.AreEqual(AetheriaRuntimeCatalogSnapshot.SchemaId, client.State.Catalog.Sources.Last().SchemaId);
|
||||
Assert.GreaterOrEqual(catalog.Items.Count, 0);
|
||||
Assert.AreEqual(AetheriaRuntimePlayerSettingsDocument.SchemaId, playerSettings.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeVerseHostSettingsDocument.SchemaId, verseHostSettings.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.ObjectsViewport, objectsViewport.Schema);
|
||||
|
|
@ -278,7 +282,10 @@ public class DaemonRuntimeDocumentTests
|
|||
|
||||
var player = client.Aetheria().Settings.Player.LatestAsync().GetAwaiter().GetResult();
|
||||
var verseHost = client.Aetheria().Settings.VerseHost.LatestAsync().GetAwaiter().GetResult();
|
||||
var catalog = client.Aetheria().Catalog.LatestAsync().GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(AetheriaRuntimeCatalogSnapshot.SchemaId, client.State.Catalog.Sources.Last().SchemaId);
|
||||
Assert.IsNotNull(catalog);
|
||||
Assert.AreEqual(AetheriaRuntimePlayerSettingsDocument.SchemaId, player.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeVerseHostSettingsDocument.SchemaId, verseHost.Schema);
|
||||
Assert.AreEqual("", player.PlayerName);
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ public class MainMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient(stateBoot).OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient(stateBoot).Aetheria().Catalog.Latest();
|
||||
return _catalog;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -1038,7 +1038,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1530,7 +1530,7 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -650,7 +650,7 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1182,7 +1182,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().OpenRuntimeCatalog();
|
||||
_catalog = ResolveClient().Aetheria().Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public AetheriaRuntimeCatalogSnapshot OpenRuntimeCatalog()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return _verse.OpenRuntimeCatalog();
|
||||
return State.Catalog.Latest();
|
||||
}
|
||||
|
||||
public async Task<AetheriaRuntimePlayerSettingsSnapshot?> PlayerSettingsAsync()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
internal AetheriaClientState(
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonFrameDocument> latestFrame,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonSoaViewDocument> latestSoaView,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeCatalogSnapshot> catalog,
|
||||
CultMeshDocumentHandle<AetheriaRuntimePlayerSettingsDocument> playerSettings,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeVerseHostSettingsDocument> verseHostSettings,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeCurrentZoneDocument> currentZone,
|
||||
|
|
@ -38,6 +39,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
LatestFrame = latestFrame ?? throw new ArgumentNullException(nameof(latestFrame));
|
||||
LatestSoaView = latestSoaView ?? throw new ArgumentNullException(nameof(latestSoaView));
|
||||
Catalog = catalog ?? throw new ArgumentNullException(nameof(catalog));
|
||||
Settings = new AetheriaClientSettingsState(playerSettings, verseHostSettings);
|
||||
Current = new AetheriaClientCurrentState(currentZone, currentEntity, currentDocking);
|
||||
ZoneContacts = zoneContacts ?? throw new ArgumentNullException(nameof(zoneContacts));
|
||||
|
|
@ -62,6 +64,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
_documents = CultMesh.Documents(
|
||||
LatestFrame,
|
||||
LatestSoaView,
|
||||
Catalog,
|
||||
Settings.Player,
|
||||
Settings.VerseHost,
|
||||
Current.Zone,
|
||||
|
|
@ -79,6 +82,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeDaemonSoaViewDocument> LatestSoaView { get; }
|
||||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeCatalogSnapshot> Catalog { get; }
|
||||
|
||||
public AetheriaClientSettingsState Settings { get; }
|
||||
|
||||
public AetheriaClientCurrentState Current { get; }
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
public sealed class AetheriaRuntimeCatalogSnapshot
|
||||
{
|
||||
public const string SchemaId = "gamecult.aetheria.runtime_catalog.v1";
|
||||
|
||||
private readonly Dictionary<string, AetheriaRuntimeCatalogItem> _itemsByKey;
|
||||
private readonly Dictionary<string, AetheriaRuntimeCorporation> _corporationsByKey;
|
||||
private readonly Dictionary<string, AetheriaRuntimeNameFile> _nameFilesByKey;
|
||||
|
|
|
|||
|
|
@ -734,6 +734,11 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest),
|
||||
Document<AetheriaRuntimeDaemonSoaViewDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest),
|
||||
CatalogDocument(
|
||||
"aetheria.catalog.runtime",
|
||||
() => Task.FromResult(OpenRuntimeCatalog()),
|
||||
AetheriaRuntimeCatalogSnapshot.SchemaId,
|
||||
CultMesh.ProjectionSource("catalog:aetheria.runtime")),
|
||||
CatalogDocument(
|
||||
"aetheria.settings.player",
|
||||
() => Task.FromResult(AetheriaRuntimePlayerSettingsDocument.FromSnapshot(
|
||||
|
|
|
|||
Loading…
Reference in a new issue