Publish daemon SoA view from tick result

This commit is contained in:
Meta Vens 2026-06-28 04:35:04 +01:00
commit 6172136de8
3 changed files with 13 additions and 6 deletions

View file

@ -751,10 +751,10 @@ static async Task PublishDaemonApiDocumentsAsync(
AetheriaRuntimeDaemonTickResult result)
{
await node.PutDaemonFrameAsync(result.Frame).ConfigureAwait(false);
if (AetheriaRuntimeDaemonSoaViewStore.TryReadView(node.StatePath, out var soaView) &&
string.Equals(soaView.Schema, AetheriaRuntimeDaemonSchemas.SoaView, StringComparison.Ordinal))
if (result.SoaView != null &&
string.Equals(result.SoaView.Schema, AetheriaRuntimeDaemonSchemas.SoaView, StringComparison.Ordinal))
{
await node.PutDaemonSoaViewAsync(soaView).ConfigureAwait(false);
await node.PutDaemonSoaViewAsync(result.SoaView).ConfigureAwait(false);
}
if (result.ProviderAdvertisement != null)

View file

@ -8882,6 +8882,7 @@ static void RequireDaemonVersePublication(string root)
"AetheriaRuntimeDaemonEditorSurfaceBuilder.Build",
"AetheriaRuntimeDaemonPublicationStore.PublishEditorSurface",
"AetheriaRuntimeDaemonPublicationStore.PublishEditorTuiSurface",
"SoaView = soaView",
"ProviderAdvertisement = providerAdvertisement",
"Health = health",
"CommandBoundary = commandBoundary",
@ -8920,6 +8921,7 @@ static void RequireDaemonVersePublication(string root)
"discoveryHost.Update(",
"PublishDaemonApiDocumentsAsync(node, result)",
"PutDaemonFrameAsync(result.Frame)",
"PutDaemonSoaViewAsync(result.SoaView)",
"PutDaemonProviderAdvertisementAsync(result.ProviderAdvertisement)",
"PutDaemonHealthAsync(result.Health)",
"PutDaemonCommandBoundaryAsync(result.CommandBoundary)",
@ -8964,10 +8966,11 @@ static void RequireDaemonVersePublication(string root)
var apiPublicationBlock = apiPublicationStart >= 0 && apiPublicationEnd > apiPublicationStart
? daemonHostSource.Substring(apiPublicationStart, apiPublicationEnd - apiPublicationStart)
: "";
if (apiPublicationBlock.Contains("AetheriaRuntimeDaemonPublicationStore.TryRead", StringComparison.Ordinal))
if (apiPublicationBlock.Contains("AetheriaRuntimeDaemonPublicationStore.TryRead", StringComparison.Ordinal) ||
apiPublicationBlock.Contains("AetheriaRuntimeDaemonSoaViewStore.TryRead", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Daemon API document publication must use typed tick result documents instead of reopening publication-store witness files.");
"Daemon API document publication must use typed tick result documents instead of reopening witness files.");
}
if (daemonTickRunner.Contains("AetheriaRuntimeDaemonPublicationStore.TryReadHealth(stateFilePath", StringComparison.Ordinal))

View file

@ -47,6 +47,7 @@ namespace GameCult.Aetheria.State.Verse
string gameTuiSurfacePath,
string editorSurfacePath,
string editorTuiSurfacePath,
AetheriaRuntimeDaemonSoaViewDocument? soaView = null,
AetheriaRuntimeDaemonProviderAdvertisementDocument? providerAdvertisement = null,
AetheriaRuntimeDaemonHealthDocument? health = null,
AetheriaRuntimeDaemonCommandBoundaryDocument? commandBoundary = null,
@ -70,6 +71,7 @@ namespace GameCult.Aetheria.State.Verse
GameTuiSurfacePath = gameTuiSurfacePath ?? "";
EditorSurfacePath = editorSurfacePath ?? "";
EditorTuiSurfacePath = editorTuiSurfacePath ?? "";
SoaView = soaView;
ProviderAdvertisement = providerAdvertisement;
Health = health;
CommandBoundary = commandBoundary;
@ -91,6 +93,7 @@ namespace GameCult.Aetheria.State.Verse
public string GameTuiSurfacePath { get; }
public string EditorSurfacePath { get; }
public string EditorTuiSurfacePath { get; }
public AetheriaRuntimeDaemonSoaViewDocument? SoaView { get; }
public AetheriaRuntimeDaemonProviderAdvertisementDocument? ProviderAdvertisement { get; }
public AetheriaRuntimeDaemonHealthDocument? Health { get; }
public AetheriaRuntimeDaemonCommandBoundaryDocument? CommandBoundary { get; }
@ -207,7 +210,7 @@ namespace GameCult.Aetheria.State.Verse
}
var framePath = AetheriaRuntimeDaemonFrameStore.PublishFrame(stateFilePath, frame);
AetheriaRuntimeDaemonSoaFramePublisher.PublishCurrentZoneEntities(stateFilePath, frame);
var soaView = AetheriaRuntimeDaemonSoaFramePublisher.PublishCurrentZoneEntities(stateFilePath, frame);
var commandBoundary = AetheriaRuntimeDaemonCommandBoundaryDocument.Create(options.DaemonId);
var commandBoundaryPath = AetheriaRuntimeDaemonPublicationStore.PublishCommandBoundary(
stateFilePath,
@ -291,6 +294,7 @@ namespace GameCult.Aetheria.State.Verse
gameTuiSurfacePath,
editorSurfacePath,
editorTuiSurfacePath,
soaView,
providerAdvertisement,
health,
commandBoundary,