diff --git a/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs b/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs index 08ee05e7a..ac509657e 100644 --- a/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs +++ b/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs @@ -20,6 +20,11 @@ internal static class AetheriaDaemonZoneGenerator .Where(value => !string.IsNullOrWhiteSpace(value)) .OrderBy(value => value, StringComparer.Ordinal) .ToArray(); + if (corporationKeys.Length == 0) + { + throw new InvalidDataException( + "Terminus generation requires at least one typed corporation with a stable corporation key."); + } var homeZones = corporationKeys.ToDictionary(value => value, _ => 0, StringComparer.Ordinal); var availabilityFactions = new Dictionary(StringComparer.Ordinal) { diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index 7b9f3207d..7a36f926c 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -449,13 +449,15 @@ static async Task PublishCommittedFactAsync( applied ? "reconciled" : "denied", "Aetheria", fact.SourceDaemonId, - "aetheria.daemon", + "aetheria", AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, applied ? "Command applied by authoritative daemon." : "Command rejected by authoritative daemon.", fact.CommittedAtUtc, Math.Max(fact.SourceFrameId, 0)); await node.Database.PutAsync(AetheriaRuntimeVerseRecordKeys.EveReceiptForCommand(receipt.CommandId), receipt) .ConfigureAwait(false); + if (string.Equals(Environment.GetEnvironmentVariable("AETHERIA_TRACE_EVE_SNAPSHOTS"), "1", StringComparison.Ordinal)) + Console.WriteLine($"Eve command receipt command={receipt.CommandId} state={receipt.State} provider={receipt.ProviderId}"); } static RudpCultNetSchemaServer StartClientCultMeshHost( @@ -1644,7 +1646,8 @@ static EveProviderAdvertisementDocument BuildCoreProviderAdvertisement( "interactive-world", interaction) }, - Array.Empty()); + Array.Empty(), + new[] { AetheriaRuntimeDaemonSoaFramePublisher.ProducerId }); } static async Task PublishDaemonMenuSurfacesAsync( diff --git a/Aetheria.State.Import/Program.cs b/Aetheria.State.Import/Program.cs index d2b5e5b19..d6f308004 100644 --- a/Aetheria.State.Import/Program.cs +++ b/Aetheria.State.Import/Program.cs @@ -298,6 +298,16 @@ foreach (var nameFile in parsedNameFiles) await node.FlushAsync(); var runtimeCatalog = await node.RuntimeCatalog().LatestAsync().ConfigureAwait(false); +var importedCorporationKeys = runtimeCatalog.Corporations + .Select(corporation => corporation.CorporationKey) + .Where(key => !string.IsNullOrWhiteSpace(key)) + .Distinct(StringComparer.Ordinal) + .ToArray(); +if (importedCorporationKeys.Length != corporations.Length) +{ + throw new InvalidDataException( + $"Runtime catalog projected {importedCorporationKeys.Length} corporation keys from {corporations.Length} typed corporation documents."); +} var runtimeMines = runtimeCatalog.Items .Where(item => string.Equals(item.WeaponType, "Mine", StringComparison.Ordinal)) .ToArray(); @@ -327,6 +337,7 @@ Console.WriteLine($"Catalog: {catalog.RelativePath} {catalog.Bytes} bytes {catal Console.WriteLine($"Name files: {nameFiles.Length}"); Console.WriteLine($"Mapped items: {itemDefinitions.Length}"); Console.WriteLine($"Mapped factions: {corporations.Length}"); +Console.WriteLine($"Runtime corporation keys: {string.Join(", ", importedCorporationKeys)}"); Console.WriteLine($"Mapped name files: {parsedNameFiles.Length}"); Console.WriteLine($"Mapped mine weapons: {string.Join(", ", runtimeMines.Select(item => item.Name + " (" + item.ItemKey + ")"))}"); diff --git a/Aetheria.State/AetheriaEveSurfaceDocuments.cs b/Aetheria.State/AetheriaEveSurfaceDocuments.cs index 73d6e8274..f3c665f42 100644 --- a/Aetheria.State/AetheriaEveSurfaceDocuments.cs +++ b/Aetheria.State/AetheriaEveSurfaceDocuments.cs @@ -5,6 +5,7 @@ using Aetheria.State.Documents; using GameCult.Aetheria.State.Verse; using GameCult.Mesh; using EveCommandTemplate = GameCult.Eve.Surface.EveCommandTemplate; +using EveCommandReceiptDocument = GameCult.Eve.Surface.EveCommandReceiptDocument; using EveAdvertisedCommand = GameCult.Eve.Surface.EveAdvertisedCommand; using EveAdvertisedSurface = GameCult.Eve.Surface.EveAdvertisedSurface; using EveProviderAdvertisementDocument = GameCult.Eve.Surface.EveProviderAdvertisementDocument; @@ -295,7 +296,8 @@ public static class AetheriaEveSurfaceDocuments schemas, witnesses, AetheriaRuntimeEveSurfaceCatalog.All.Select(ToProviderSurface).ToArray(), - commands); + commands, + new[] { AetheriaRuntimeDaemonSoaFramePublisher.ProducerId }); } private static EveProviderWitness Witness(string kind, string reference, string summary) => @@ -313,9 +315,9 @@ public static class AetheriaEveSurfaceDocuments surface.WorldInteraction.StateSchemas, surface.WorldInteraction.CommandBoundary, AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary.ToString(), - surface.WorldInteraction.ReceiptSchema, - "", - "", + EveCommandReceiptDocument.SchemaId, + AetheriaRuntimeVerseRecordKeys.EveReceiptRecordPrefix, + AetheriaRuntimeVerseRecordKeys.EveAssetCatalog.ToString(), surface.WorldInteraction.LoweringTargets, surface.WorldInteraction.Ownership); return new EveAdvertisedSurface( diff --git a/Aetheria.State/Documents/AetheriaGameSessionState.cs b/Aetheria.State/Documents/AetheriaGameSessionState.cs index b195bcd00..e241705df 100644 --- a/Aetheria.State/Documents/AetheriaGameSessionState.cs +++ b/Aetheria.State/Documents/AetheriaGameSessionState.cs @@ -17,5 +17,5 @@ public sealed class AetheriaGameSessionState [Key(4)] public string EntrySurfaceId { get; set; } = "aetheria.pilot"; [Key(5)] public string LastStartCommandId { get; set; } = ""; [Key(6)] public string UpdatedAtUtc { get; set; } = ""; - [Key(7)] public double SimulationRate { get; set; } + [Key(7)] public double SimulationRate { get; set; } = 1; } diff --git a/Aetheria.Unity/Packages/manifest.json b/Aetheria.Unity/Packages/manifest.json index ed4482727..c4b34e022 100644 --- a/Aetheria.Unity/Packages/manifest.json +++ b/Aetheria.Unity/Packages/manifest.json @@ -8,7 +8,7 @@ "com.unity.render-pipelines.universal": "17.4.0", "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.10", "org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.1.1", - "org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0", - "org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.0" + "org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.1", + "org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.15" } } diff --git a/Aetheria.Unity/Packages/packages-lock.json b/Aetheria.Unity/Packages/packages-lock.json index 6996eb399..fd9f8bdc3 100644 --- a/Aetheria.Unity/Packages/packages-lock.json +++ b/Aetheria.Unity/Packages/packages-lock.json @@ -133,25 +133,25 @@ "hash": "0b099274a4e2b4c301eced4322166837792f585a" }, "org.gamecult.eve.surface": { - "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0", + "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.1", "depth": 0, "source": "git", "dependencies": { "org.gamecult.cultlib": "1.0.8" }, - "hash": "010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac" + "hash": "d0aa50d31f3b6da96bffc194fdc3aa358f37e332" }, "org.gamecult.eve.unity-scene": { - "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.0", + "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.15", "depth": 0, "source": "git", "dependencies": { "org.gamecult.cultlib": "1.0.10", "org.gamecult.eve.plugin-fields": "0.1.1", - "org.gamecult.eve.surface": "0.2.0", + "org.gamecult.eve.surface": "0.2.1", "com.unity.mathematics": "1.3.2" }, - "hash": "e45171952030dbb7ea3997f7abdc0af96b483b26" + "hash": "474cadac1c173e24b2c9b9ddde7b781059dbae4c" }, "com.unity.modules.assetbundle": { "version": "1.0.0", diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs index 435fd465d..8578233ce 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs @@ -99,7 +99,7 @@ namespace GameCult.Aetheria.State.Verse WeaponStateItems(entity, run, zone))); return new AetheriaRuntimeSurfaceDocument( - providerId: "aetheria.daemon", + providerId: "aetheria", providerKind: "game.daemon", title: "Aetheria Daemon", version: frame.FrameId, @@ -150,7 +150,7 @@ namespace GameCult.Aetheria.State.Verse BuildStarbridgeRuntimeRolesCard(starbridge)); return new AetheriaRuntimeSurfaceDocument( - "aetheria.daemon", + "aetheria", "game.daemon", "Starbridge Commander", frame.FrameId, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs index 6393df83d..3e4b230a4 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs @@ -405,7 +405,7 @@ public sealed class AetheriaRuntimeDaemonOperationsClient { envelope = null; if (request == null || - !string.Equals(request.ProviderId, "aetheria.daemon", StringComparison.Ordinal) || + !string.Equals(request.ProviderId, "aetheria", StringComparison.Ordinal) || !TryResolveSurfaceCommandKind(request, out var kind)) { return false; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSoaFramePublisher.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSoaFramePublisher.cs index b01d75ba8..9345837d3 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSoaFramePublisher.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSoaFramePublisher.cs @@ -61,7 +61,8 @@ namespace GameCult.Aetheria.State.Verse if (cache == null) throw new ArgumentNullException(nameof(cache)); _localPublisher = new CultMeshFrameBodyPublisher( BodyId, BodySchemaId, LayoutVersion, Capacity, producerEpoch, - checked((int)EntityHotSlabLayout.Create(Capacity).TotalByteLength)); + checked((int)EntityHotSlabLayout.Create(Capacity).TotalByteLength), + TimeSpan.FromSeconds(30)); _networkPublisher = new CultMeshNetworkBodyPublisher( cache, generation => string.Equals(generation.ProducerId, ProducerId, StringComparison.Ordinal)); diff --git a/scripts/verify-aetheria-unity-client.ps1 b/scripts/verify-aetheria-unity-client.ps1 index bafa77341..db03ff991 100644 --- a/scripts/verify-aetheria-unity-client.ps1 +++ b/scripts/verify-aetheria-unity-client.ps1 @@ -17,11 +17,11 @@ $expected = @{ "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.10", "085aa2c0756328770623474c4e9fbacd7218b390") "org.gamecult.eve.surface" = @( - "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0", - "010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac") + "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.1", + "d0aa50d31f3b6da96bffc194fdc3aa358f37e332") "org.gamecult.eve.unity-scene" = @( - "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.0", - "e45171952030dbb7ea3997f7abdc0af96b483b26") + "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.15", + "474cadac1c173e24b2c9b9ddde7b781059dbae4c") } foreach ($packageName in $expected.Keys) {