Remove reactive loadout projector wrapper

This commit is contained in:
Meta Vens 2026-06-28 12:54:55 +01:00
commit f05d2f57b2
3 changed files with 23 additions and 65 deletions

View file

@ -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",

View file

@ -267,18 +267,6 @@ namespace GameCult.Aetheria.State.Verse
return ReactiveDockingStateAsync(options).ConfigureAwait(false).GetAwaiter().GetResult();
}
public Task<AetheriaRuntimeReactiveLoadoutSnapshotProjector> ReactiveLoadoutSnapshotProjectorAsync(
CultMeshReactiveDocumentOptions? options = null)
{
return AetheriaRuntimeReactiveLoadoutSnapshotProjector.CreateAsync(this, options);
}
public AetheriaRuntimeReactiveLoadoutSnapshotProjector ReactiveLoadoutSnapshotProjector(
CultMeshReactiveDocumentOptions? options = null)
{
return ReactiveLoadoutSnapshotProjectorAsync(options).ConfigureAwait(false).GetAwaiter().GetResult();
}
public Task<AetheriaRuntimeReactiveObservedDaemonState> ReactiveObservedDaemonAsync(
CultMeshReactiveDocumentOptions? options = null)
{

View file

@ -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<AetheriaRuntimeDaemonFrameDocument> _frame;
private AetheriaRuntimeReactiveLoadoutSnapshotProjector(
CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument> frame)
{
_frame = frame ?? throw new ArgumentNullException(nameof(frame));
}
public static async Task<AetheriaRuntimeReactiveLoadoutSnapshotProjector> 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();
}
}
}