From f05d2f57b23e9015ae3a01cfa41715919153ae36 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 12:54:55 +0100 Subject: [PATCH] Remove reactive loadout projector wrapper --- Aetheria.State.Verify/Program.cs | 25 ++++++--- .../Runtime/AetheriaClientState.cs | 12 ----- ...AetheriaRuntimeLoadoutSnapshotProjector.cs | 51 ++----------------- 3 files changed, 23 insertions(+), 65 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 7976e825b..23b26eb18 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -7707,7 +7707,6 @@ static void RequireAetheriaManagedStateAccessorsCoverDomainDocuments(string root "public AetheriaClientReactiveDockingState ReactiveDockingState(", "public AetheriaRuntimeObservedDaemonState? LatestObservedDaemon()", "public AetheriaRuntimeReactiveObservedDaemonState ReactiveObservedDaemon(", - "public AetheriaRuntimeReactiveLoadoutSnapshotProjector ReactiveLoadoutSnapshotProjector(", "public AetheriaRuntimeLoadoutTemplatesDocument LatestLoadoutTemplates()", "public AetheriaRuntimeStationRefitDocument LatestStationRefit()", "public AetheriaRuntimeZoneRenderDocument LatestZoneRender()", @@ -16626,11 +16625,17 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeLoadoutSnapshotProjector.cs"); + var clientStatePath = Path.Combine( + root, + "Packages", + "org.gamecult.aetheria.state", + "Runtime", + "AetheriaClientState.cs"); var dragSessionPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityDragSession.cs"); var dragObjectsPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityDragObjects.cs"); var gameplaySceneWiringPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityGameplaySceneWiring.cs"); - var requiredFiles = new[] { eveCommandDocumentPath, loadoutCommandsPath, eveBridgePath, runtimeStateMapperPath, inventoryPanelPath, loadoutProjectorPath, loadoutSnapshotProjectorPath, dragSessionPath, gameplaySceneWiringPath }; + var requiredFiles = new[] { eveCommandDocumentPath, loadoutCommandsPath, eveBridgePath, runtimeStateMapperPath, inventoryPanelPath, loadoutProjectorPath, loadoutSnapshotProjectorPath, clientStatePath, dragSessionPath, gameplaySceneWiringPath }; var missingFiles = requiredFiles.Where(path => !File.Exists(path)).ToArray(); if (missingFiles.Length > 0) { @@ -16646,6 +16651,7 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) var inventoryPanel = File.ReadAllText(inventoryPanelPath); var loadoutProjector = File.ReadAllText(loadoutProjectorPath); var loadoutSnapshotProjector = File.ReadAllText(loadoutSnapshotProjectorPath); + var clientState = File.ReadAllText(clientStatePath); var dragSession = File.ReadAllText(dragSessionPath); var gameplaySceneWiring = File.ReadAllText(gameplaySceneWiringPath); var dragObjects = File.Exists(dragObjectsPath) @@ -16750,12 +16756,9 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) { "ProjectLoadoutTemplateAsync(", "AetheriaClientState state", - "public sealed class AetheriaRuntimeReactiveLoadoutSnapshotProjector", - "state.ReactiveDaemonFrameAsync(options)", - "public AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(string entityKey)", + ".ReactiveDaemonFrameAsync()", "ProjectLoadoutTemplate(", - "frame.Run ?? new AetheriaRuntimeRunCheckpointCommit()", - "public void Dispose()" + "frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit()" }; var missingLoadoutSnapshotProjectorSymbols = requiredLoadoutSnapshotProjectorSymbols .Where(symbol => !loadoutSnapshotProjector.Contains(symbol, StringComparison.Ordinal)) @@ -16780,6 +16783,14 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) "Loadout template save payloads must use named AetheriaClientState reactive daemon frame access instead of walking raw CultMesh handles."); } + if (clientState.Contains("ReactiveLoadoutSnapshotProjector", StringComparison.Ordinal) || + loadoutSnapshotProjector.Contains("AetheriaRuntimeReactiveLoadoutSnapshotProjector", StringComparison.Ordinal) || + loadoutSnapshotProjector.Contains("ProjectLoadoutTemplate(string entityKey)", StringComparison.Ordinal)) + { + throw new InvalidOperationException( + "Loadout template save payloads must not recreate aggregate reactive projector wrappers; cache or sample the managed typed daemon frame document directly."); + } + var forbiddenActionSymbols = new[] { "AetheriaRuntimeStateCommitLog.QueueLoadoutTemplate", diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs index 2499136c9..7575a3bc9 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs @@ -267,18 +267,6 @@ namespace GameCult.Aetheria.State.Verse return ReactiveDockingStateAsync(options).ConfigureAwait(false).GetAwaiter().GetResult(); } - public Task ReactiveLoadoutSnapshotProjectorAsync( - CultMeshReactiveDocumentOptions? options = null) - { - return AetheriaRuntimeReactiveLoadoutSnapshotProjector.CreateAsync(this, options); - } - - public AetheriaRuntimeReactiveLoadoutSnapshotProjector ReactiveLoadoutSnapshotProjector( - CultMeshReactiveDocumentOptions? options = null) - { - return ReactiveLoadoutSnapshotProjectorAsync(options).ConfigureAwait(false).GetAwaiter().GetResult(); - } - public Task ReactiveObservedDaemonAsync( CultMeshReactiveDocumentOptions? options = null) { diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs index ae180fce8..2520e3e00 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeLoadoutSnapshotProjector.cs @@ -16,10 +16,12 @@ namespace GameCult.Aetheria.State.Verse { if (state == null) throw new ArgumentNullException(nameof(state)); - using var projector = await state - .ReactiveLoadoutSnapshotProjectorAsync() + using var frame = await state + .ReactiveDaemonFrameAsync() .ConfigureAwait(false); - return projector.ProjectLoadoutTemplate(entityKey); + return ProjectLoadoutTemplate( + frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit(), + entityKey ?? ""); } public static AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate( @@ -251,47 +253,4 @@ namespace GameCult.Aetheria.State.Verse } } - public sealed class AetheriaRuntimeReactiveLoadoutSnapshotProjector : IDisposable - { - private readonly CultMeshReactiveDocument _frame; - - private AetheriaRuntimeReactiveLoadoutSnapshotProjector( - CultMeshReactiveDocument frame) - { - _frame = frame ?? throw new ArgumentNullException(nameof(frame)); - } - - public static async Task CreateAsync( - AetheriaClientState state, - CultMeshReactiveDocumentOptions? options = null) - { - if (state == null) throw new ArgumentNullException(nameof(state)); - - var frame = await state.ReactiveDaemonFrameAsync(options).ConfigureAwait(false); - return new AetheriaRuntimeReactiveLoadoutSnapshotProjector(frame); - } - - public static AetheriaRuntimeReactiveLoadoutSnapshotProjector Create( - AetheriaClientState state, - CultMeshReactiveDocumentOptions? options = null) - { - return CreateAsync(state, options).ConfigureAwait(false).GetAwaiter().GetResult(); - } - - public AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(string entityKey) - { - var frame = _frame.Current; - if (frame == null) - return new AetheriaRuntimeLoadoutTemplateCommit(); - - return AetheriaRuntimeLoadoutSnapshotProjector.ProjectLoadoutTemplate( - frame.Run ?? new AetheriaRuntimeRunCheckpointCommit(), - entityKey ?? ""); - } - - public void Dispose() - { - _frame.Dispose(); - } - } }