diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index f7baae957..e544d00c2 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -9282,6 +9282,16 @@ static void RequireAetheriaRuntimeVerseClientContract(string root) "private AetheriaClientState? _aetheriaState", "return Aetheria().Catalog.Latest()", "return _aetheriaState ??= CreateAetheriaStateFacade();", + "var state = Aetheria();", + "state.Daemon.LatestFrame.LatestAsync()", + "state.Daemon.LatestSoaView.LatestAsync()", + "state.Daemon.Health.LatestAsync()", + "state.Daemon.CommandBoundary.LatestAsync()", + "Aetheria().Daemon.LatestFrame.LatestAsync()", + "Aetheria().Daemon.GameSurface.LatestAsync()", + "Aetheria().Daemon.GameTuiSurface.LatestAsync()", + "Aetheria().Daemon.EditorSurface.LatestAsync()", + "Aetheria().Daemon.EditorTuiSurface.LatestAsync()", "GetPlayerSettingsAsync()", "Aetheria().Settings.Player.LatestAsync()", "Aetheria().Settings.VerseHost.LatestAsync()", @@ -9337,7 +9347,16 @@ static void RequireAetheriaRuntimeVerseClientContract(string root) "return Task.FromResult(AetheriaRuntimeCatalogStore.ReadPlayerSettings(StatePath));", "return Task.FromResult(AetheriaRuntimeCatalogStore.ReadVerseHostSettings(StatePath));", "() => Task.FromResult(OpenRuntimeCatalog())", - "OpenRuntimeCatalog());" + "OpenRuntimeCatalog());", + "var frame = await GetLatestFrameAsync().ConfigureAwait(false);", + "var soaView = await GetLatestSoaViewAsync().ConfigureAwait(false);", + "var frameTask = GetLatestFrameAsync();", + "var healthTask = GetHealthAsync();", + "var commandBoundaryTask = GetCommandBoundaryAsync();", + "return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);", + "return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);", + "return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);", + "return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);" }; var clientCompatibilityStoreBypassHits = forbiddenClientCompatibilityStoreBypasses .Where(symbol => client.Contains(symbol, StringComparison.Ordinal)) @@ -9345,7 +9364,7 @@ static void RequireAetheriaRuntimeVerseClientContract(string root) if (clientCompatibilityStoreBypassHits.Length > 0) { throw new InvalidOperationException( - "AetheriaRuntimeVerseClient compatibility reads still bypass managed typed catalog/settings documents: " + + "AetheriaRuntimeVerseClient compatibility reads still bypass managed typed documents: " + string.Join(", ", clientCompatibilityStoreBypassHits)); } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs index aee188d84..85d5e06fe 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs @@ -290,11 +290,12 @@ namespace GameCult.Aetheria.State.Verse { ThrowIfDisposed(); - var frame = await GetLatestFrameAsync().ConfigureAwait(false); + var state = Aetheria(); + var frame = await state.Daemon.LatestFrame.LatestAsync().ConfigureAwait(false); if (frame == null) return null; - var soaView = await GetLatestSoaViewAsync().ConfigureAwait(false); + var soaView = await state.Daemon.LatestSoaView.LatestAsync().ConfigureAwait(false); if (soaView == null || !string.Equals(soaView.Schema, AetheriaRuntimeDaemonSchemas.SoaView, StringComparison.Ordinal)) { @@ -322,9 +323,10 @@ namespace GameCult.Aetheria.State.Verse { ThrowIfDisposed(); - var frameTask = GetLatestFrameAsync(); - var healthTask = GetHealthAsync(); - var commandBoundaryTask = GetCommandBoundaryAsync(); + var state = Aetheria(); + var frameTask = state.Daemon.LatestFrame.LatestAsync(); + var healthTask = state.Daemon.Health.LatestAsync(); + var commandBoundaryTask = state.Daemon.CommandBoundary.LatestAsync(); await Task.WhenAll(frameTask, healthTask, commandBoundaryTask).ConfigureAwait(false); @@ -339,7 +341,7 @@ namespace GameCult.Aetheria.State.Verse { ThrowIfDisposed(); - var frame = await GetLatestFrameAsync().ConfigureAwait(false); + var frame = await Aetheria().Daemon.LatestFrame.LatestAsync().ConfigureAwait(false); if (frame == null || !frame.IsAuthoritative || frame.Run == null || @@ -352,28 +354,28 @@ namespace GameCult.Aetheria.State.Verse return frame; } - public Task GetDaemonGameSurfaceAsync() + public async Task GetDaemonGameSurfaceAsync() { ThrowIfDisposed(); - return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface); + return await Aetheria().Daemon.GameSurface.LatestAsync().ConfigureAwait(false); } - public Task GetDaemonGameTuiSurfaceAsync() + public async Task GetDaemonGameTuiSurfaceAsync() { ThrowIfDisposed(); - return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface); + return await Aetheria().Daemon.GameTuiSurface.LatestAsync().ConfigureAwait(false); } - public Task GetDaemonEditorSurfaceAsync() + public async Task GetDaemonEditorSurfaceAsync() { ThrowIfDisposed(); - return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface); + return await Aetheria().Daemon.EditorSurface.LatestAsync().ConfigureAwait(false); } - public Task GetDaemonEditorTuiSurfaceAsync() + public async Task GetDaemonEditorTuiSurfaceAsync() { ThrowIfDisposed(); - return Database.GetAsync(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface); + return await Aetheria().Daemon.EditorTuiSurface.LatestAsync().ConfigureAwait(false); } public CultMeshMutableStatePointer ProviderAdvertisement() @@ -943,7 +945,7 @@ namespace GameCult.Aetheria.State.Verse private async Task RequireFrameAsync() { - var frame = await GetLatestFrameAsync().ConfigureAwait(false); + var frame = await Aetheria().Daemon.LatestFrame.LatestAsync().ConfigureAwait(false); if (frame == null) throw new InvalidOperationException("Aetheria Verse client has no daemon frame yet."); return frame;