From 392c24a7dab2f8bec31bc7e9ce57b1721a6c4a28 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 16 Jun 2026 11:22:18 +0100 Subject: [PATCH] Use typed keys for faction shell links --- .voidbot/state/aetheria.cc | Bin 166347 -> 168243 bytes Aetheria.State.Verify/Program.cs | 37 ++++++++++++++++++++ Aetheria.State/README.md | 3 ++ Assets/Scripts/ServerShared/Corporations.cs | 3 +- Assets/Scripts/ServerShared/Galaxy.cs | 10 ++---- docs/aetheria-perfect-machine-map.md | 5 +++ 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index a0ea9adcc5dfac6d76c0446d4fd21ddf72e0cf1d..8e1febdd218e19ac1184085f41c240712854b002 100644 GIT binary patch delta 2313 zcma)8J8T?97}l;G6C6O1%%cdl2gL<8zP&sA2(cA~5U_KKkxj5uL;_{JJ9j&HZ)P(y z>+>PmXGj5}0#2|61riS-QA9{coCHxis!%|>P|?yLD4?L?pV{5JJ;xv_pXc#EzVG|L z+1u^muRj_7>Qno{a%th|(n4v*nJ<^Fyk|WU|F&xnwQt*R=66o(oi-n6yv|>$wBMv(bk1^QV+SnqKTHUt0-qk`XmTYjc|tR1Yzc(O)h1@k6<;RY)c|6 z2vW_Ec!e#}Ebs;+p7XgIU|Rp#I)08Qp9qSPM*^aVhu~kN4rXzdP5c&FqCt`*P47Gh z$u8(z%Nv#FO+r+qB=DqzmT`c0n$DWwuMt;e^)lW-E*63kiIS)$=ta^r#b@y>*x77=>6!=vd>0 z3|_hi=L+(M1dVz zkAkFPmj?mh0Fj|^$pL68ksB%Gae#tx1r63iO~L_g!${C7bs@^LoGl`%5NAOX2~y|V zaMRQMr2H3kFA4WOKEi|moj88!UF%`%W^8?EjkI#;7c-php%FnJYZ|B3P?wH_6;i`) zv*I~uDN+$gD~>E$fMXXamrvFKe=4CW)S$}G;sEId+|ZiU zN)^(lVQ2QZ_2fXMatUrzLDsdF)2uIR^{*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wB zU|S7}_sSwW<@3dxf<8>q9xx-4H0B<6FX2QHQTNIen>zi=s-ohvL#FOW%O1+DM+Ntn zWixGBP}W0hVyy9Sq6fY21VA-B*UvsY43m<@;kRxWM?}ceLU4Y`(SYR@a4-D9`lt4FmP%3)JoR- zO<{?f^@dZyj)Wl+*<#kX5;Q!jeXfYaVt1t_xrK7xO|~pT39M~@4g+pHXfYozIZ#h_K&;!4tvC%dyAdy z{GOZ64)$hZx$K^Mm;Es^B`>;f_t^|h#BsO0&*G7>xK#FI(fz#7ZXNF~&Sw*}TffbI LI5D!lFu(a9rb6^F 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