Publish canonical Eve provider advertisements
This commit is contained in:
parent
7772d9eb36
commit
29c0bc287b
6 changed files with 178 additions and 340 deletions
|
|
@ -2011,7 +2011,7 @@ static async Task PublishStateSurfacesAsync(
|
|||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildPlayerSettingsSurface(playerSettings, playerSettingsUpdatedAt))
|
||||
.ConfigureAwait(false);
|
||||
await node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
await node.MutableDocument<EveProviderAdvertisementDocument>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildProviderAdvertisement(verseHost, node.StatePath, updatedAtUtc))
|
||||
.ConfigureAwait(false);
|
||||
await node.FlushAsync().ConfigureAwait(false);
|
||||
|
|
@ -2045,6 +2045,9 @@ static async Task PublishOdinSurfaceAnnouncementsAsync(
|
|||
};
|
||||
|
||||
var documents = new List<CultNetDocumentPutRawMessage>();
|
||||
var providerAdvertisement = await node.MutableDocument<EveProviderAdvertisementDocument>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
.ReadAsync()
|
||||
.ConfigureAwait(false);
|
||||
var assetManifest = await node.MutableDocument<AetheriaRuntimeAssetManifestDocument>(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest)
|
||||
.ReadAsync()
|
||||
.ConfigureAwait(false);
|
||||
|
|
@ -2063,10 +2066,13 @@ static async Task PublishOdinSurfaceAnnouncementsAsync(
|
|||
if (surface?.Surface?.Root == null)
|
||||
continue;
|
||||
|
||||
documents.Add(CreateOdinRawPut(
|
||||
"gamecult.eve.provider_advertisement.v1",
|
||||
providerId,
|
||||
BuildOdinProviderAdvertisement(providerId, title, options, updatedAtUtc)));
|
||||
if (providerAdvertisement != null)
|
||||
{
|
||||
documents.Add(CreateOdinRawPut(
|
||||
EveProviderAdvertisementDocument.SchemaId,
|
||||
providerId,
|
||||
BuildOdinProviderAdvertisement(providerId, title, providerAdvertisement, updatedAtUtc)));
|
||||
}
|
||||
documents.Add(CreateOdinRawPut(
|
||||
"gamecult.eve.surface_state.v1",
|
||||
providerId,
|
||||
|
|
@ -2174,10 +2180,10 @@ static CultMeshCdnArtifact PackAssetBundle(string path, string platform)
|
|||
});
|
||||
}
|
||||
|
||||
static CultNetDocumentPutRawMessage CreateOdinRawPut(
|
||||
static CultNetDocumentPutRawMessage CreateOdinRawPut<T>(
|
||||
string schemaId,
|
||||
string recordKey,
|
||||
object payload)
|
||||
T payload)
|
||||
{
|
||||
var now = DateTimeOffset.UtcNow.ToString("O");
|
||||
return new CultNetDocumentPutRawMessage
|
||||
|
|
@ -2197,53 +2203,32 @@ static CultNetDocumentPutRawMessage CreateOdinRawPut(
|
|||
};
|
||||
}
|
||||
|
||||
static Dictionary<string, object?> BuildOdinProviderAdvertisement(
|
||||
static EveProviderAdvertisementDocument BuildOdinProviderAdvertisement(
|
||||
string providerId,
|
||||
string title,
|
||||
AetheriaDaemonHostOptions options,
|
||||
EveProviderAdvertisementDocument canonical,
|
||||
string updatedAtUtc)
|
||||
{
|
||||
return new Dictionary<string, object?>(StringComparer.Ordinal)
|
||||
{
|
||||
["schema"] = "gamecult.eve.provider_advertisement.v1",
|
||||
["providerId"] = providerId,
|
||||
["serviceId"] = options.DaemonId,
|
||||
["verseId"] = options.VerseId,
|
||||
["rootVerse"] = "asgard",
|
||||
["canonicalService"] = "aetheria",
|
||||
["locatedService"] = options.DaemonId,
|
||||
["cultMeshAddress"] = options.CultMeshAddress,
|
||||
["title"] = title,
|
||||
["kind"] = "game.runtime",
|
||||
["status"] = "active",
|
||||
["updatedAt"] = string.IsNullOrWhiteSpace(updatedAtUtc) ? DateTimeOffset.UtcNow.ToString("O") : updatedAtUtc,
|
||||
["capabilities"] = new[] { "cultui-surface", "eve-surface", "cultmesh-cdn-assets", "aetheria-game-surface" },
|
||||
["routes"] = new[]
|
||||
{
|
||||
new Dictionary<string, object?>(StringComparer.Ordinal)
|
||||
{
|
||||
["transport"] = "cultmesh",
|
||||
["address"] = options.OdinCultMeshUri,
|
||||
["resolver"] = "odin-cultmesh",
|
||||
["role"] = "odin-provider-announcement"
|
||||
},
|
||||
new Dictionary<string, object?>(StringComparer.Ordinal)
|
||||
{
|
||||
["transport"] = "cultmesh-rudp",
|
||||
["address"] = $"rudp://{options.ClientCultMeshAdvertiseHost}:{options.ClientCultMeshPort}",
|
||||
["resolver"] = "provider-cultmesh-rudp",
|
||||
["role"] = "cultmesh-snapshot"
|
||||
},
|
||||
new Dictionary<string, object?>(StringComparer.Ordinal)
|
||||
{
|
||||
["transport"] = "cultmesh-rudp",
|
||||
["address"] = $"rudp://{options.ClientCultMeshAdvertiseHost}:{options.ClientCultMeshPort}",
|
||||
["schemaId"] = AetheriaRuntimeDaemonSchemas.CultMeshCdnAssetBlob,
|
||||
["resolver"] = "provider-cultmesh-rudp",
|
||||
["role"] = "cultmesh-cdn"
|
||||
}
|
||||
}
|
||||
};
|
||||
var surfaces = canonical.Surfaces
|
||||
.Where(surface => string.Equals(surface.SurfaceId, providerId, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
var commands = canonical.Commands
|
||||
.Where(command => string.IsNullOrWhiteSpace(command.SurfaceId) ||
|
||||
string.Equals(command.SurfaceId, providerId, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
return new EveProviderAdvertisementDocument(
|
||||
providerId,
|
||||
canonical.ServiceId,
|
||||
canonical.VerseId,
|
||||
title,
|
||||
canonical.Kind,
|
||||
canonical.CultMeshAddress,
|
||||
string.IsNullOrWhiteSpace(updatedAtUtc) ? canonical.UpdatedAtUtc : updatedAtUtc,
|
||||
canonical.Freshness,
|
||||
canonical.Schemas,
|
||||
canonical.Witnesses,
|
||||
surfaces,
|
||||
commands);
|
||||
}
|
||||
|
||||
static object[] BuildOdinSurfaceState(
|
||||
|
|
|
|||
|
|
@ -10742,7 +10742,7 @@ static void RequireVerseSettingsShellAndBridge(string root)
|
|||
"ExecuteVerseHostCommandAsync",
|
||||
"node.MutableDocument<AetheriaVerseHostSettings>(AetheriaStateNode.VerseHostSettingsKey)",
|
||||
".ReplaceAsync(normalized)",
|
||||
"node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)",
|
||||
"node.MutableDocument<EveProviderAdvertisementDocument>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)",
|
||||
"AetheriaEveSurfaceDocuments.BuildOperationsSurface(",
|
||||
"switch (command.Kind)"
|
||||
};
|
||||
|
|
@ -11515,6 +11515,7 @@ static void RequireDaemonVersePublication(string root)
|
|||
var stateNodePath = Path.Combine(root, "Aetheria.State", "AetheriaStateNode.cs");
|
||||
var runtimeSurfaceDocumentsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeSurfaceDocuments.cs");
|
||||
var providerAdvertisementPath = Path.Combine(root, "Aetheria.State", "AetheriaEveSurfaceDocuments.cs");
|
||||
var legacyProviderAdvertisementPath = Path.Combine(root, "Aetheria.State", "Documents", "EveProviderAdvertisementState.cs");
|
||||
var documentStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeCultCacheDocumentStore.cs");
|
||||
var boundaryPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeStateBoundary.cs");
|
||||
var testsPath = Path.Combine(root, "Assets", "Scripts", "Tests", "DaemonRuntimeDocumentTests.cs");
|
||||
|
|
@ -11681,6 +11682,12 @@ static void RequireDaemonVersePublication(string root)
|
|||
"Daemon SoA frame publisher no longer turns authoritative frames into observer-readable direct-memory slabs: " +
|
||||
string.Join(", ", missingSoaFramePublisherSymbols));
|
||||
}
|
||||
if (File.Exists(legacyProviderAdvertisementPath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"The deleted Aetheria-specific EveProviderAdvertisementState writer has returned: " +
|
||||
Path.GetRelativePath(root, legacyProviderAdvertisementPath));
|
||||
}
|
||||
|
||||
if (assetDocuments.Contains("UnityAddressable", StringComparison.Ordinal) ||
|
||||
assetDocuments.Contains("unity_addressable", StringComparison.Ordinal) ||
|
||||
|
|
@ -12138,8 +12145,13 @@ static void RequireDaemonVersePublication(string root)
|
|||
"node.MutableDocument<AetheriaPlayerSettings>(AetheriaStateNode.PlayerSettingsKey).ReadAsync()",
|
||||
"node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey)",
|
||||
"node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey)",
|
||||
"node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)",
|
||||
"node.MutableDocument<EveProviderAdvertisementDocument>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)",
|
||||
"AetheriaEveSurfaceDocuments.BuildProviderAdvertisement(verseHost, node.StatePath, updatedAtUtc)",
|
||||
"static EveProviderAdvertisementDocument BuildOdinProviderAdvertisement(",
|
||||
"static CultNetDocumentPutRawMessage CreateOdinRawPut<T>(",
|
||||
"EveProviderAdvertisementDocument.SchemaId",
|
||||
"EveProviderAdvertisementDocument canonical",
|
||||
"MessagePackSerializer.Serialize(payload)",
|
||||
"AetheriaEveSurfaceDocuments.BuildOperationsSurface(eveStatus, verseHost, runtimeSession)",
|
||||
"AetheriaEveSurfaceDocuments.BuildPlayerSettingsSurface(playerSettings, playerSettingsUpdatedAt)",
|
||||
"Role = \"verse-daemon\"",
|
||||
|
|
@ -12190,6 +12202,25 @@ static void RequireDaemonVersePublication(string root)
|
|||
"Remote committed fact import must pass the managed runtime catalog document into the tick importer instead of reopening catalog storage.");
|
||||
}
|
||||
|
||||
var forbiddenEveProviderAdvertisementWriters = new[]
|
||||
{
|
||||
"EveProviderAdvertisementState",
|
||||
"static Dictionary<string, object?> BuildOdinProviderAdvertisement(",
|
||||
"[\"rootVerse\"]",
|
||||
"[\"canonicalService\"]",
|
||||
"[\"locatedService\"]",
|
||||
"[\"routes\"]"
|
||||
};
|
||||
var survivingEveProviderAdvertisementWriters = forbiddenEveProviderAdvertisementWriters
|
||||
.Where(symbol => daemonHostProgram.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (survivingEveProviderAdvertisementWriters.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Daemon Odin publication still writes the deleted Aetheria-specific Eve provider advertisement shape: " +
|
||||
string.Join(", ", survivingEveProviderAdvertisementWriters));
|
||||
}
|
||||
|
||||
if (committedFactImporter.Contains("AetheriaRuntimeCatalogStore.OpenReadOnly", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ public static class AetheriaDocumentRegistry
|
|||
typeof(EveSurfaceDocument),
|
||||
typeof(EveSurfaceCommandRequest),
|
||||
typeof(EveCommandReceiptDocument),
|
||||
typeof(EveAssetCatalogDocument),
|
||||
typeof(EveProviderAdvertisementState)
|
||||
typeof(EveAssetCatalogDocument)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Aetheria.State.Documents;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using EveProviderAdvertisementDocument = GameCult.Eve.Surface.EveProviderAdvertisementDocument;
|
||||
using EveSurfaceDocument = GameCult.Eve.Surface.EveSurfaceDocument;
|
||||
|
||||
namespace Aetheria.State;
|
||||
|
|
@ -304,7 +305,7 @@ public static class AetheriaEveCommandBridge
|
|||
normalized,
|
||||
runtimeSession))
|
||||
.ConfigureAwait(false);
|
||||
await node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
await node.MutableDocument<EveProviderAdvertisementDocument>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildProviderAdvertisement(normalized, node.StatePath, command.IssuedAtUtc))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,16 @@ using Aetheria.State.Documents;
|
|||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using EveCommandTemplate = GameCult.Eve.Surface.EveCommandTemplate;
|
||||
using EveAdvertisedCommand = GameCult.Eve.Surface.EveAdvertisedCommand;
|
||||
using EveAdvertisedSurface = GameCult.Eve.Surface.EveAdvertisedSurface;
|
||||
using EveProviderAdvertisementDocument = GameCult.Eve.Surface.EveProviderAdvertisementDocument;
|
||||
using EveProviderFreshness = GameCult.Eve.Surface.EveProviderFreshness;
|
||||
using EveProviderWitness = GameCult.Eve.Surface.EveProviderWitness;
|
||||
using EveStyleToken = GameCult.Eve.Surface.EveStyleToken;
|
||||
using EveSurfaceComponent = GameCult.Eve.Surface.EveSurfaceComponent;
|
||||
using EveSurfaceDocument = GameCult.Eve.Surface.EveSurfaceDocument;
|
||||
using EveSurfaceTree = GameCult.Eve.Surface.EveSurfaceTree;
|
||||
using EveWorldInteractionAdvertisement = GameCult.Eve.Surface.EveWorldInteractionAdvertisement;
|
||||
|
||||
namespace Aetheria.State;
|
||||
|
||||
|
|
@ -210,185 +216,119 @@ public static class AetheriaEveSurfaceDocuments
|
|||
return AetheriaRuntimeSurfaceDocuments.ToPortableSurface(surface);
|
||||
}
|
||||
|
||||
public static EveProviderAdvertisementState BuildProviderAdvertisement(
|
||||
public static EveProviderAdvertisementDocument BuildProviderAdvertisement(
|
||||
AetheriaVerseHostSettings settings,
|
||||
string statePath,
|
||||
string updatedAtUtc)
|
||||
{
|
||||
var normalized = AetheriaVerseHostSettingsNormalizer.Normalize(settings);
|
||||
return new EveProviderAdvertisementState
|
||||
var schemas = new[]
|
||||
{
|
||||
ProviderId = ProviderId,
|
||||
ServiceId = normalized.ServiceId,
|
||||
VerseId = normalized.VerseId,
|
||||
RootVerse = normalized.RootVerse,
|
||||
CanonicalService = normalized.CanonicalService,
|
||||
LocatedService = normalized.LocatedService,
|
||||
CultMeshAddress = normalized.CultMeshAddress,
|
||||
Title = normalized.Title,
|
||||
Kind = "game.runtime",
|
||||
UpdatedAtUtc = updatedAtUtc,
|
||||
Freshness = new EveProviderFreshness
|
||||
{
|
||||
State = "fresh",
|
||||
LastSeenAtUtc = updatedAtUtc,
|
||||
MaxAgeMs = 15000
|
||||
},
|
||||
Schemas =
|
||||
[
|
||||
"aetheria.world_state.v1",
|
||||
"aetheria.item_definition.v1",
|
||||
"aetheria.corporation.v2",
|
||||
"aetheria.name_file.v2",
|
||||
"aetheria.trade_value_policy.v1",
|
||||
"aetheria.player_settings.v1",
|
||||
"aetheria.loadout_template.v1",
|
||||
"aetheria.run_state.v1",
|
||||
"aetheria.zone_state.v1",
|
||||
"aetheria.entity_snapshot.v1",
|
||||
"aetheria.verse_host_settings.v1",
|
||||
"aetheria.runtime_session.v1",
|
||||
"aetheria.eve_command_acceptance_status.v1",
|
||||
"gamecult.eve.surface.v1",
|
||||
"gamecult.eve.command.v1",
|
||||
AetheriaRuntimeDaemonSchemas.ProviderAdvertisement,
|
||||
AetheriaRuntimeDaemonSchemas.Frame,
|
||||
AetheriaRuntimeDaemonSchemas.SoaView,
|
||||
AetheriaRuntimeDaemonSchemas.Health,
|
||||
AetheriaRuntimeDaemonSchemas.CommandBoundary,
|
||||
AetheriaRuntimeDaemonSchemas.GameSurface,
|
||||
AetheriaRuntimeDaemonSchemas.EditorSurface,
|
||||
AetheriaRuntimeDaemonSchemas.Command
|
||||
],
|
||||
Witnesses =
|
||||
[
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = "cultcache",
|
||||
Ref = statePath,
|
||||
Summary = "Aetheria typed CultCache state file"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement.ToString(),
|
||||
Summary = "Aetheria daemon-owned provider advertisement record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString(),
|
||||
Summary = "Aetheria daemon latest simulation frame record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest.ToString(),
|
||||
Summary = "Aetheria daemon latest SoA view record for thin clients"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonHealth.ToString(),
|
||||
Summary = "Aetheria daemon health record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary.ToString(),
|
||||
Summary = "Aetheria daemon typed command boundary record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonGameSurface.ToString(),
|
||||
Summary = "Aetheria daemon game Eve GUI surface record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface.ToString(),
|
||||
Summary = "Aetheria daemon game Eve TUI surface record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface.ToString(),
|
||||
Summary = "Aetheria daemon editor Eve GUI surface record"
|
||||
},
|
||||
new EveProviderWitness
|
||||
{
|
||||
Kind = DaemonRecordTransport,
|
||||
Ref = AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface.ToString(),
|
||||
Summary = "Aetheria daemon editor Eve TUI surface record"
|
||||
}
|
||||
],
|
||||
Surfaces = AetheriaRuntimeEveSurfaceCatalog.All
|
||||
.Select(ToProviderSurfaceRef)
|
||||
.ToArray(),
|
||||
Commands =
|
||||
[
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = DaemonCommandBoundaryId,
|
||||
Transport = "cultmesh",
|
||||
Summary = "Aetheria daemon typed command boundary"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimeCatalogCommands.Refresh,
|
||||
Summary = "Refresh catalog state"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimeOperationsCommands.Refresh,
|
||||
Summary = "Refresh operations state"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.Refresh,
|
||||
Summary = "Refresh player settings state"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.CycleTemperatureUnit,
|
||||
Summary = "Cycle the typed player temperature unit"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.DecrementSignificantDigits,
|
||||
Summary = "Decrease typed player significant digits"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.IncrementSignificantDigits,
|
||||
Summary = "Increase typed player significant digits"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.CycleNebulaQuality,
|
||||
Summary = "Cycle typed player nebula quality"
|
||||
},
|
||||
new EveProviderCommandRef
|
||||
{
|
||||
Command = AetheriaRuntimePlayerSettingsCommands.ToggleShowAsteroidsInMinimap,
|
||||
Summary = "Toggle typed player minimap asteroid visibility"
|
||||
}
|
||||
]
|
||||
"aetheria.world_state.v1",
|
||||
"aetheria.item_definition.v1",
|
||||
"aetheria.corporation.v2",
|
||||
"aetheria.name_file.v2",
|
||||
"aetheria.trade_value_policy.v1",
|
||||
"aetheria.player_settings.v1",
|
||||
"aetheria.loadout_template.v1",
|
||||
"aetheria.run_state.v1",
|
||||
"aetheria.zone_state.v1",
|
||||
"aetheria.entity_snapshot.v1",
|
||||
"aetheria.verse_host_settings.v1",
|
||||
"aetheria.runtime_session.v1",
|
||||
"aetheria.eve_command_acceptance_status.v1",
|
||||
EveSurfaceDocument.SchemaId,
|
||||
AetheriaRuntimeEveCommandDocument.SchemaId,
|
||||
AetheriaRuntimeDaemonSchemas.ProviderAdvertisement,
|
||||
AetheriaRuntimeDaemonSchemas.Frame,
|
||||
AetheriaRuntimeDaemonSchemas.SoaView,
|
||||
AetheriaRuntimeDaemonSchemas.Health,
|
||||
AetheriaRuntimeDaemonSchemas.CommandBoundary,
|
||||
AetheriaRuntimeDaemonSchemas.GameSurface,
|
||||
AetheriaRuntimeDaemonSchemas.EditorSurface,
|
||||
AetheriaRuntimeDaemonSchemas.Command
|
||||
};
|
||||
var witnesses = new[]
|
||||
{
|
||||
Witness("cultcache", statePath, "Aetheria typed CultCache state file"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement.ToString(),
|
||||
"Aetheria daemon-owned provider advertisement record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString(),
|
||||
"Aetheria daemon latest simulation frame record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest.ToString(),
|
||||
"Aetheria daemon latest SoA view record for thin clients"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonHealth.ToString(),
|
||||
"Aetheria daemon health record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary.ToString(),
|
||||
"Aetheria daemon typed command boundary record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonGameSurface.ToString(),
|
||||
"Aetheria daemon game Eve GUI surface record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface.ToString(),
|
||||
"Aetheria daemon game Eve TUI surface record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface.ToString(),
|
||||
"Aetheria daemon editor Eve GUI surface record"),
|
||||
Witness(DaemonRecordTransport, AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface.ToString(),
|
||||
"Aetheria daemon editor Eve TUI surface record")
|
||||
};
|
||||
var commands = new[]
|
||||
{
|
||||
Command(DaemonCommandBoundaryId, "", "Aetheria daemon typed command boundary"),
|
||||
Command(AetheriaRuntimeCatalogCommands.Refresh, AetheriaRuntimeCatalogCommands.SurfaceId, "Refresh catalog state"),
|
||||
Command(AetheriaRuntimeOperationsCommands.Refresh, AetheriaRuntimeOperationsCommands.SurfaceId, "Refresh operations state"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.Refresh, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Refresh player settings state"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.CycleTemperatureUnit, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Cycle the typed player temperature unit"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.DecrementSignificantDigits, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Decrease typed player significant digits"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.IncrementSignificantDigits, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Increase typed player significant digits"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.CycleNebulaQuality, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Cycle typed player nebula quality"),
|
||||
Command(AetheriaRuntimePlayerSettingsCommands.ToggleShowAsteroidsInMinimap, AetheriaRuntimePlayerSettingsCommands.SurfaceId, "Toggle typed player minimap asteroid visibility")
|
||||
};
|
||||
|
||||
return new EveProviderAdvertisementDocument(
|
||||
ProviderId,
|
||||
normalized.ServiceId,
|
||||
normalized.VerseId,
|
||||
normalized.Title,
|
||||
"game.runtime",
|
||||
normalized.CultMeshAddress,
|
||||
updatedAtUtc,
|
||||
new EveProviderFreshness("fresh", updatedAtUtc, 15000),
|
||||
schemas,
|
||||
witnesses,
|
||||
AetheriaRuntimeEveSurfaceCatalog.All.Select(ToProviderSurface).ToArray(),
|
||||
commands);
|
||||
}
|
||||
|
||||
private static EveProviderSurfaceRef ToProviderSurfaceRef(AetheriaRuntimeEveSurfaceAdvertisement surface)
|
||||
private static EveProviderWitness Witness(string kind, string reference, string summary) =>
|
||||
new(kind, reference, summary);
|
||||
|
||||
private static EveAdvertisedCommand Command(string command, string surfaceId, string summary) =>
|
||||
new(command, surfaceId, "cultmesh", summary);
|
||||
|
||||
private static EveAdvertisedSurface ToProviderSurface(AetheriaRuntimeEveSurfaceAdvertisement surface)
|
||||
{
|
||||
return new EveProviderSurfaceRef
|
||||
{
|
||||
SurfaceId = surface.SurfaceId,
|
||||
Key = surface.RecordRef,
|
||||
Transport = surface.Transport,
|
||||
Status = surface.Status
|
||||
};
|
||||
var interaction = surface.WorldInteraction == null
|
||||
? null
|
||||
: new EveWorldInteractionAdvertisement(
|
||||
surface.WorldInteraction.ProjectionKind,
|
||||
surface.WorldInteraction.StateSchemas,
|
||||
surface.WorldInteraction.CommandBoundary,
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary.ToString(),
|
||||
surface.WorldInteraction.ReceiptSchema,
|
||||
"",
|
||||
"",
|
||||
surface.WorldInteraction.LoweringTargets,
|
||||
surface.WorldInteraction.Ownership);
|
||||
return new EveAdvertisedSurface(
|
||||
surface.SurfaceId,
|
||||
EveSurfaceDocument.SchemaId,
|
||||
surface.RecordRef,
|
||||
surface.Transport,
|
||||
surface.Status,
|
||||
surface.SurfaceKind,
|
||||
interaction);
|
||||
}
|
||||
|
||||
|
||||
private static string LatestTimestamp(params string?[] timestamps)
|
||||
{
|
||||
var latest = "";
|
||||
|
|
|
|||
|
|
@ -1,118 +0,0 @@
|
|||
using GameCult.Caching;
|
||||
using MessagePack;
|
||||
|
||||
namespace Aetheria.State.Documents;
|
||||
|
||||
[CultDocument("gamecult.eve.provider_advertisement", "gamecult.eve.provider_advertisement.v1")]
|
||||
[CultGlobal]
|
||||
[MessagePackObject]
|
||||
public sealed class EveProviderAdvertisementState
|
||||
{
|
||||
[Key(0)]
|
||||
[CultIndex("schema")]
|
||||
public string Schema { get; set; } = "gamecult.eve.provider_advertisement.v1";
|
||||
|
||||
[Key(1)]
|
||||
[CultName]
|
||||
public string ProviderId { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public string ServiceId { get; set; } = "";
|
||||
|
||||
[Key(3)]
|
||||
public string VerseId { get; set; } = "";
|
||||
|
||||
[Key(4)]
|
||||
public string RootVerse { get; set; } = "asgard";
|
||||
|
||||
[Key(5)]
|
||||
public string CanonicalService { get; set; } = "";
|
||||
|
||||
[Key(6)]
|
||||
public string LocatedService { get; set; } = "";
|
||||
|
||||
[Key(7)]
|
||||
public string CultMeshAddress { get; set; } = "";
|
||||
|
||||
[Key(8)]
|
||||
public string Title { get; set; } = "";
|
||||
|
||||
[Key(9)]
|
||||
public string Kind { get; set; } = "game.runtime";
|
||||
|
||||
[Key(10)]
|
||||
public string UpdatedAtUtc { get; set; } = "";
|
||||
|
||||
[Key(11)]
|
||||
public EveProviderFreshness Freshness { get; set; } = new();
|
||||
|
||||
[Key(12)]
|
||||
public string[] Schemas { get; set; } = [];
|
||||
|
||||
[Key(13)]
|
||||
public EveProviderWitness[] Witnesses { get; set; } = [];
|
||||
|
||||
[Key(14)]
|
||||
public EveProviderSurfaceRef[] Surfaces { get; set; } = [];
|
||||
|
||||
[Key(15)]
|
||||
public EveProviderCommandRef[] Commands { get; set; } = [];
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveProviderFreshness
|
||||
{
|
||||
[Key(0)]
|
||||
public string State { get; set; } = "fresh";
|
||||
|
||||
[Key(1)]
|
||||
public string LastSeenAtUtc { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public int MaxAgeMs { get; set; } = 15000;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveProviderWitness
|
||||
{
|
||||
[Key(0)]
|
||||
public string Kind { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public string Ref { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public string Summary { get; set; } = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveProviderSurfaceRef
|
||||
{
|
||||
[Key(0)]
|
||||
public string Schema { get; set; } = "gamecult.eve.surface.v1";
|
||||
|
||||
[Key(1)]
|
||||
public string SurfaceId { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public string Key { get; set; } = "";
|
||||
|
||||
[Key(3)]
|
||||
public string Transport { get; set; } = "cultmesh";
|
||||
|
||||
[Key(4)]
|
||||
public string Status { get; set; } = "available";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveProviderCommandRef
|
||||
{
|
||||
[Key(0)]
|
||||
public string Command { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public string Transport { get; set; } = "cultmesh";
|
||||
|
||||
[Key(2)]
|
||||
public string Summary { get; set; } = "";
|
||||
}
|
||||
Loading…
Reference in a new issue