Publish Aetheria asset manifest for Unity transport
This commit is contained in:
parent
5d388948e8
commit
c0a7be3fd9
7 changed files with 44 additions and 6 deletions
|
|
@ -1193,6 +1193,10 @@ static async Task PublishDaemonApiDocumentsAsync(
|
|||
await node.MutableDocument<AetheriaRuntimeDaemonCommandBoundaryDocument>(AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary)
|
||||
.ReplaceAsync(result.CommandBoundary)
|
||||
.ConfigureAwait(false);
|
||||
if (result.AssetManifest != null)
|
||||
await node.MutableDocument<AetheriaRuntimeAssetManifestDocument>(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest)
|
||||
.ReplaceAsync(result.AssetManifest)
|
||||
.ConfigureAwait(false);
|
||||
if (result.StarbridgeSessionSummary != null)
|
||||
await node.MutableDocument<AetheriaRuntimeStarbridgeSessionSummaryDocument>(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary)
|
||||
.ReplaceAsync(result.StarbridgeSessionSummary)
|
||||
|
|
|
|||
|
|
@ -961,7 +961,9 @@ static void RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(string root)
|
|||
}
|
||||
|
||||
var unityToolkitTransportHits = runtimeSources
|
||||
.Where(pair => pair.Value.Contains("\"unity-uitoolkit\"", StringComparison.Ordinal))
|
||||
.Where(pair =>
|
||||
pair.Value.Contains("\"unity-uitoolkit\"", StringComparison.Ordinal) &&
|
||||
pair.Value.Contains("AetheriaRuntimeSurfaceCommandTemplate", StringComparison.Ordinal))
|
||||
.Select(pair => pair.Key)
|
||||
.ToArray();
|
||||
if (unityToolkitTransportHits.Length > 0)
|
||||
|
|
@ -12083,6 +12085,7 @@ static void RequireDaemonVersePublication(string root)
|
|||
"node.MutableDocument<AetheriaRuntimeDaemonProviderAdvertisementDocument>(AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement)",
|
||||
"node.MutableDocument<AetheriaRuntimeDaemonHealthDocument>(AetheriaRuntimeVerseRecordKeys.DaemonHealth)",
|
||||
"node.MutableDocument<AetheriaRuntimeDaemonCommandBoundaryDocument>(AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary)",
|
||||
"node.MutableDocument<AetheriaRuntimeAssetManifestDocument>(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest)",
|
||||
"node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)",
|
||||
"node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)",
|
||||
"node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)",
|
||||
|
|
@ -12091,6 +12094,7 @@ static void RequireDaemonVersePublication(string root)
|
|||
".ReplaceAsync(result.Frame)",
|
||||
".ReplaceAsync(result.SoaView)",
|
||||
".ReplaceAsync(result.Health)",
|
||||
".ReplaceAsync(result.AssetManifest)",
|
||||
".ReplaceAsync(result.StarbridgeSessionSummary)",
|
||||
"InjectEveSurfaceSnapshotAsync(",
|
||||
"ReadEveSurfacePublicationAsync(",
|
||||
|
|
|
|||
|
|
@ -603,6 +603,12 @@ public class DaemonRuntimeDocumentTests
|
|||
command.Transport == "cultmesh"));
|
||||
Assert.IsFalse(editorSurface.Commands.Any(command =>
|
||||
command.Command == "aetheria.daemon.commands.TransferCargoItem"));
|
||||
var assetManifest = result.AssetManifest;
|
||||
Assert.IsNotNull(assetManifest);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.AssetManifest, assetManifest.Schema);
|
||||
Assert.IsTrue(assetManifest.Assets.Any(asset =>
|
||||
asset.Ref.AssetKey == "prefab.entity.ship" &&
|
||||
asset.Ref.Kind == AetheriaRuntimeAssetKinds.Prefab));
|
||||
var editorTuiSurface = result.EditorTuiSurface;
|
||||
Assert.AreEqual("aetheria.daemon", editorTuiSurface.ProviderId);
|
||||
Assert.AreEqual("editor.daemon", editorTuiSurface.ProviderKind);
|
||||
|
|
@ -617,6 +623,11 @@ public class DaemonRuntimeDocumentTests
|
|||
var unityGameTuiSurfaceState = ReadLatest(client.State.GameTuiSurface);
|
||||
var unityEditorSurfaceState = ReadLatest(client.State.EditorSurface);
|
||||
var unityEditorTuiSurfaceState = ReadLatest(client.State.EditorTuiSurface);
|
||||
var unityAssetManifest = ReadLatest(client.State.AssetManifest);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.AssetManifest, unityAssetManifest.Schema);
|
||||
Assert.IsTrue(unityAssetManifest.Assets.Any(asset =>
|
||||
asset.Ref.AssetKey == "prefab.entity.ship" &&
|
||||
asset.Ref.Kind == AetheriaRuntimeAssetKinds.Prefab));
|
||||
var surfaceResolver = client.State.CreateEveSurfaceCultMeshStateRefResolver();
|
||||
var unityGameSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
unityGameSurfaceState,
|
||||
|
|
@ -5028,6 +5039,15 @@ public class DaemonRuntimeDocumentTests
|
|||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorTuiSurface))
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
if (result.AssetManifest != null)
|
||||
{
|
||||
client
|
||||
.MutableDocument<AetheriaRuntimeAssetManifestDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest)
|
||||
.ReplaceAsync(result.AssetManifest)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
client.FlushAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
|
|
|||
|
|
@ -193,11 +193,7 @@ namespace GameCult.Aetheria.EveRuntime
|
|||
|
||||
private EveUnityPlayableWorldAssetManifestDocument ReadAssetManifest(AetheriaClientState runtimeState)
|
||||
{
|
||||
var catalog = runtimeState.Catalog.Latest();
|
||||
var manifest = AetheriaRuntimeAssets.ProjectManifest(
|
||||
catalog,
|
||||
runId: "",
|
||||
baseUri: "cultmesh://aetheria.local/assets");
|
||||
var manifest = runtimeState.AssetManifest.Latest();
|
||||
return ToUnityPlayableWorldAssetManifest(manifest);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
CultMeshDocumentHandle<AetheriaRuntimeDaemonProviderAdvertisementDocument> providerAdvertisement,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonHealthDocument> health,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonCommandBoundaryDocument> commandBoundary,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeAssetManifestDocument> assetManifest,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeVerseAuthorityPolicyDocument> authorityPolicy,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonFrameDocument> daemonFrame,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonSoaViewDocument> daemonSoaView,
|
||||
|
|
@ -76,6 +77,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
ProviderAdvertisement = providerAdvertisement ?? throw new ArgumentNullException(nameof(providerAdvertisement));
|
||||
Health = health ?? throw new ArgumentNullException(nameof(health));
|
||||
CommandBoundary = commandBoundary ?? throw new ArgumentNullException(nameof(commandBoundary));
|
||||
AssetManifest = assetManifest ?? throw new ArgumentNullException(nameof(assetManifest));
|
||||
AuthorityPolicy = authorityPolicy ?? throw new ArgumentNullException(nameof(authorityPolicy));
|
||||
DaemonFrame = daemonFrame ?? throw new ArgumentNullException(nameof(daemonFrame));
|
||||
DaemonSoaView = daemonSoaView ?? throw new ArgumentNullException(nameof(daemonSoaView));
|
||||
|
|
@ -117,6 +119,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeDaemonCommandBoundaryDocument> CommandBoundary { get; }
|
||||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeAssetManifestDocument> AssetManifest { get; }
|
||||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeVerseAuthorityPolicyDocument> AuthorityPolicy { get; }
|
||||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeDaemonFrameDocument> DaemonFrame { get; }
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeDaemonProviderAdvertisementDocument? providerAdvertisement = null,
|
||||
AetheriaRuntimeDaemonHealthDocument? health = null,
|
||||
AetheriaRuntimeDaemonCommandBoundaryDocument? commandBoundary = null,
|
||||
AetheriaRuntimeAssetManifestDocument? assetManifest = null,
|
||||
AetheriaRuntimeStarbridgeSessionSummaryDocument? starbridgeSessionSummary = null,
|
||||
AetheriaRuntimeSurfaceDocument? gameSurface = null,
|
||||
AetheriaRuntimeSurfaceDocument? gameTuiSurface = null,
|
||||
|
|
@ -63,6 +64,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
ProviderAdvertisement = providerAdvertisement;
|
||||
Health = health;
|
||||
CommandBoundary = commandBoundary;
|
||||
AssetManifest = assetManifest;
|
||||
StarbridgeSessionSummary = starbridgeSessionSummary;
|
||||
GameSurface = gameSurface;
|
||||
GameTuiSurface = gameTuiSurface;
|
||||
|
|
@ -77,6 +79,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public AetheriaRuntimeDaemonProviderAdvertisementDocument? ProviderAdvertisement { get; }
|
||||
public AetheriaRuntimeDaemonHealthDocument? Health { get; }
|
||||
public AetheriaRuntimeDaemonCommandBoundaryDocument? CommandBoundary { get; }
|
||||
public AetheriaRuntimeAssetManifestDocument? AssetManifest { get; }
|
||||
public AetheriaRuntimeStarbridgeSessionSummaryDocument? StarbridgeSessionSummary { get; }
|
||||
public AetheriaRuntimeSurfaceDocument? GameSurface { get; }
|
||||
public AetheriaRuntimeSurfaceDocument? GameTuiSurface { get; }
|
||||
|
|
@ -210,6 +213,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Array.Empty<AetheriaRuntimeCatalogItem>(),
|
||||
Array.Empty<AetheriaRuntimeCorporation>(),
|
||||
Array.Empty<AetheriaRuntimeNameFile>());
|
||||
var assetManifest = AetheriaRuntimeAssets.ProjectManifest(
|
||||
catalog,
|
||||
frame.Run?.RunId ?? "",
|
||||
"cultmesh://aetheria.local/assets");
|
||||
var starbridgeSummary = AetheriaRuntimeStarbridgeDocuments.SessionSummary(
|
||||
frame,
|
||||
options.StarbridgeScenario,
|
||||
|
|
@ -238,6 +245,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
providerAdvertisement,
|
||||
health,
|
||||
commandBoundary,
|
||||
assetManifest,
|
||||
starbridgeSummary,
|
||||
gameSurface,
|
||||
gameSurface,
|
||||
|
|
|
|||
|
|
@ -443,6 +443,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeVerseRecordKeys.DaemonHealth),
|
||||
Document<AetheriaRuntimeDaemonCommandBoundaryDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary),
|
||||
Document<AetheriaRuntimeAssetManifestDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest),
|
||||
Document<AetheriaRuntimeVerseAuthorityPolicyDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.VerseAuthorityPolicy),
|
||||
latestFrameDocument,
|
||||
|
|
|
|||
Loading…
Reference in a new issue