Use reactive documents during Unity boot

This commit is contained in:
Meta Vens 2026-06-28 22:39:32 +01:00
commit d2eb22160b
3 changed files with 31 additions and 29 deletions

View file

@ -4,6 +4,7 @@
using System;
using GameCult.Aetheria.State.Verse;
using GameCult.Mesh;
public sealed class AetheriaUnityGameplayBootShell
{
@ -36,12 +37,12 @@ public sealed class AetheriaUnityGameplayBootShell
var aetheria = AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)
.State;
using var runtimeCatalogSession = aetheria.ObserveCatalog();
var runtimeCatalog = runtimeCatalogSession.Current;
using var runtimeCatalogDocument = aetheria.ReactiveCatalog();
var runtimeCatalog = runtimeCatalogDocument.Current;
if (runtimeCatalog == null)
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
using var sectorMapSession = aetheria.ObserveSectorMap();
var sectorMap = sectorMapSession.Current;
using var sectorMapDocument = aetheria.ReactiveSectorMap();
var sectorMap = sectorMapDocument.Current;
if (sectorMap == null)
throw new InvalidOperationException("Aetheria typed sector map is required before gameplay boot.");

View file

@ -6,13 +6,14 @@ using System;
using System.Collections.Generic;
using System.IO;
using GameCult.Aetheria.State.Verse;
using GameCult.Mesh;
using UnityEngine;
public static class AetheriaUnityRuntimeClientProvider
{
private static readonly Dictionary<string, AetheriaClient> RuntimeClients =
new Dictionary<string, AetheriaClient>(StringComparer.Ordinal);
private static AetheriaRuntimePlayerSettingsSession _playerSettingsDocument;
private static CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettingsDocument;
private static RuntimePlayerSettings _runtimePlayerSettings;
private static bool _playerSettingsLoaded;
@ -96,7 +97,7 @@ public static class AetheriaUnityRuntimeClientProvider
_playerSettingsDocument ??= ResolveClient(AetheriaUnityRuntimePaths.RuntimeStateFilePath)
.State
.Settings
.ObservePlayer();
.ReactivePlayer();
var stored = _playerSettingsDocument.Current;
if (stored == null)