diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index a0ea9adcc..8e1febdd2 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index ec7d7ffb4..39eb0009a 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -14,6 +14,7 @@ RequireTypedRuntimeFactionKeys(root); RequireTypedGalaxyFactionRelationships(root); RequireRuntimeCatalogKeyOnlyLookups(root); RequireTypedBehaviorBodyKeys(root); +RequireTypedFactionShellLinks(root); RequireEveRuntimeBootstrap(root); RequireNoRendererLocalConsole(root); RequireNoRendererLocalDebugPanels(root); @@ -772,6 +773,42 @@ static void RequireTypedBehaviorBodyKeys(string root) } } +static void RequireTypedFactionShellLinks(string root) +{ + var checkedFiles = new[] + { + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Corporations.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Galaxy.cs") + }; + + var forbiddenSymbols = new[] + { + "Guid GeonameFile", + "Guid BossHull", + "GeonameFile =", + "BossHull =", + "ParseOptionalLegacyId", + "GeonameFileLegacyId", + "BossHullLegacyId", + ".BossHull != Guid.Empty" + }; + + var hits = checkedFiles + .Where(File.Exists) + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => forbiddenSymbols.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal))) + .Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}") + .ToArray(); + + if (hits.Length > 0) + { + throw new InvalidOperationException( + "Temporary Faction shell links must use typed key fields, not geoname/boss-hull legacy GUID projections: " + + string.Join("; ", hits)); + } +} + static void RequireEveRuntimeBootstrap(string root) { var bootstrapPath = Path.Combine( diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 15b482e04..3498d7c0a 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -111,6 +111,9 @@ longer rebuild corporation references from legacy `Faction.ID` GUIDs. Galaxy faction relationship projection is also typed-key-only: the old `Faction.Allegiance` GUID dictionary, GUID containment helper, and GUID faction resolver are deleted from the simulation shell. +The remaining temporary `Faction` shell also uses `GeonameFileKey` and +`BossHullItemKey`; it no longer parses name-file or boss-hull legacy IDs into +GUID link fields. Run checkpoint commit DTOs carry typed `OrbitKey`, `ParentOrbitKey`, and `BodyKey` only for zone orbit/body snapshots. The old pending-command `OrbitLegacyId`, `ParentLegacyId`, and `BodyLegacyId` fallback fields are diff --git a/Assets/Scripts/ServerShared/Corporations.cs b/Assets/Scripts/ServerShared/Corporations.cs index 997196abc..5750267a1 100644 --- a/Assets/Scripts/ServerShared/Corporations.cs +++ b/Assets/Scripts/ServerShared/Corporations.cs @@ -33,9 +33,8 @@ public class Faction : INamedEntry [InspectableColor] public float3 SecondaryColor; - public Guid GeonameFile; public string GeonameFileKey; - public Guid BossHull; + public string BossHullItemKey; [Inspectable] public int InfluenceDistance = 4; diff --git a/Assets/Scripts/ServerShared/Galaxy.cs b/Assets/Scripts/ServerShared/Galaxy.cs index 862827f85..4af3b6e68 100644 --- a/Assets/Scripts/ServerShared/Galaxy.cs +++ b/Assets/Scripts/ServerShared/Galaxy.cs @@ -261,9 +261,8 @@ public class Galaxy Name = corporation.Name, ShortName = corporation.ShortName, Description = corporation.Description, - GeonameFile = ParseLegacyId(corporation.GeonameFileLegacyId, nameof(corporation.GeonameFileLegacyId), corporation.Name), GeonameFileKey = corporation.GeonameFileKey, - BossHull = ParseOptionalLegacyId(corporation.BossHullLegacyId), + BossHullItemKey = corporation.BossHullItemKey, InfluenceDistance = corporation.InfluenceDistance, }; } @@ -278,11 +277,6 @@ public class Galaxy throw new InvalidOperationException($"Typed catalog corporation {ownerName} has invalid {fieldName} '{legacyId}'."); } - private static Guid ParseOptionalLegacyId(string legacyId) - { - return Guid.TryParse(legacyId, out var parsed) ? parsed : Guid.Empty; - } - private void PlaceFactionsMain(int bossCount, Action progressCallback = null) { progressCallback?.Invoke("Finding Chokepoints"); @@ -298,7 +292,7 @@ public class Galaxy // Choose some megas to have bosses placed based on whether a boss hull is assigned var bossMegas = Factions - .Where(m => m.BossHull != Guid.Empty) + .Where(m => !string.IsNullOrWhiteSpace(m.BossHullItemKey)) .Take(bossCount) .ToArray(); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 4e59f4624..9b6c26a6d 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1019,6 +1019,9 @@ First Aetheria surfaces to publish: `Galaxy.ResolveFaction(Guid)`; galaxy/loadout faction relationship logic now uses `AllegianceByKey`, `ContainsFaction(string)`, and `ResolveFactionByKey` only. + - Done: delete the temporary `Faction` shell's `GeonameFile` and `BossHull` + GUID link fields; galaxy name generation and boss-zone eligibility use + `GeonameFileKey` and `BossHullItemKey`. - Done: move package and canonical manufacturer/corporation/name-file lookup to typed keys (`ManufacturerKey`, `CorporationKey`, `GeonameFileKey`, and `NameFileKey`), and move loadout manufacturer-distance weighting to @@ -1759,6 +1762,8 @@ First Aetheria surfaces to publish: resource-scanner and mining-tool runtime state surfaces use `BodyKey` fields; old `*BodyId` readback names and generic legacy reference parsers may not return. +- `Aetheria.State.Verify` guards temporary `Faction` shell links: geoname and + boss-hull relationships use typed keys, not legacy GUID projection fields. - Unity batchmode compile returned cleanly after the runtime blueprint rename; live Unity source has no `EntityPack`, `ShipPack`, `OrbitalEntityPack`, `ZonePack`, `PackedContents`, `PackZone`, `EntitySerializer.Pack`, or