Import full typed name files
This commit is contained in:
parent
87b622441e
commit
fcd704437f
157 changed files with 224 additions and 192 deletions
Binary file not shown.
|
|
@ -96,7 +96,7 @@ await node.PutMigrationLedgerAsync(new AetheriaMigrationLedger
|
|||
},
|
||||
new AetheriaMigrationCount
|
||||
{
|
||||
DocumentType = "aetheria.name_file.v1",
|
||||
DocumentType = "aetheria.name_file.v2",
|
||||
Count = parsedNameFiles.Length
|
||||
}
|
||||
],
|
||||
|
|
@ -421,7 +421,8 @@ internal static class LegacyCatalogReader
|
|||
Name = name,
|
||||
LegacyId = legacyId,
|
||||
NameCount = GetArrayLength(payload, 2),
|
||||
SampleNames = GetStringArraySample(payload, 2, 8)
|
||||
SampleNames = GetStringArraySample(payload, 2, 8),
|
||||
Names = GetStringArray(payload, 2)
|
||||
}
|
||||
: null);
|
||||
}
|
||||
|
|
@ -789,6 +790,13 @@ internal static class LegacyCatalogReader
|
|||
: [];
|
||||
}
|
||||
|
||||
private static string[] GetStringArray(IReadOnlyDictionary<int, object?> payload, int key)
|
||||
{
|
||||
return payload.TryGetValue(key, out var value) && value is object?[] array
|
||||
? array.OfType<string>().ToArray()
|
||||
: [];
|
||||
}
|
||||
|
||||
private static ShapeFacts ReadShape(IReadOnlyDictionary<int, object?> payload, int key)
|
||||
{
|
||||
if (!payload.TryGetValue(key, out var value) || value == null)
|
||||
|
|
|
|||
|
|
@ -109,9 +109,10 @@ if (catalog.GetManufacturer(manufactured) == null)
|
|||
}
|
||||
|
||||
var packageCorporation = packageCatalog.Corporations.FirstOrDefault(corporation => !string.IsNullOrWhiteSpace(corporation.GeonameFileLegacyId));
|
||||
if (packageCorporation == null || packageCatalog.GetNameFile(packageCorporation) == null)
|
||||
var packageNameFile = packageCorporation == null ? null : packageCatalog.GetNameFile(packageCorporation);
|
||||
if (packageNameFile == null || packageNameFile.Names.Count == 0 || packageNameFile.Names.Count != packageNameFile.NameCount)
|
||||
{
|
||||
throw new InvalidOperationException("Package catalog store did not read corporation/name-file links.");
|
||||
throw new InvalidOperationException("Package catalog store did not read corporation/name-file links with full names.");
|
||||
}
|
||||
|
||||
if (surface?.Schema != "gamecult.eve.surface.v1" ||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ internal static class AetheriaRuntimeCatalogSnapshotMapper
|
|||
nameFile.LegacyId,
|
||||
nameFile.Name,
|
||||
nameFile.NameCount,
|
||||
nameFile.SampleNames);
|
||||
nameFile.SampleNames,
|
||||
nameFile.Names);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ var surface = AetheriaCatalogSurfaceProjector.Build(catalog, DateTimeOffset.UtcN
|
|||
|
||||
RequireCount(ledger, "aetheria.item_definition.v1", items.Length);
|
||||
RequireCount(ledger, "aetheria.corporation.v1", corporations.Length);
|
||||
RequireCount(ledger, "aetheria.name_file.v1", nameFiles.Length);
|
||||
RequireCount(ledger, "aetheria.name_file.v2", nameFiles.Length);
|
||||
|
||||
if (items.Length == 0)
|
||||
{
|
||||
|
|
@ -40,6 +40,11 @@ if (nameFiles.Length == 0)
|
|||
throw new InvalidOperationException("Typed state has no name files.");
|
||||
}
|
||||
|
||||
if (nameFiles.Any(nameFile => nameFile.Names.Length == 0 || nameFile.Names.Length != nameFile.NameCount))
|
||||
{
|
||||
throw new InvalidOperationException("Typed name files did not import their full name arrays.");
|
||||
}
|
||||
|
||||
var pricedItems = items.Count(item => item.Price > 0);
|
||||
var manufacturedItems = items.Count(item => !string.IsNullOrWhiteSpace(item.ManufacturerLegacyId));
|
||||
var shapedItems = items.Count(item => item.ShapeWidth > 0 && item.ShapeHeight > 0 && item.OccupiedCells > 0);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using MessagePack;
|
|||
|
||||
namespace Aetheria.State.Documents;
|
||||
|
||||
[CultDocument("aetheria.name_file", "aetheria.name_file.v1")]
|
||||
[CultDocument("aetheria.name_file", "aetheria.name_file.v2")]
|
||||
[MessagePackObject]
|
||||
public sealed class AetheriaNameFile
|
||||
{
|
||||
|
|
@ -20,4 +20,7 @@ public sealed class AetheriaNameFile
|
|||
|
||||
[Key(3)]
|
||||
public string[] SampleNames { get; set; } = [];
|
||||
|
||||
[Key(4)]
|
||||
public string[] Names { get; set; } = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ edits are runtime-only until Verse owns a typed layout/settings document.
|
|||
|
||||
The old IMGUI CultCache database editor has been deleted, and `NameTools` no
|
||||
longer exports `NameFile/*.msgpack`. `AetherDB.msgpack` and existing name files
|
||||
remain legacy catalog inputs only; typed catalog migration is the next owner
|
||||
move.
|
||||
remain legacy catalog inputs only; typed catalog records are the durable owner.
|
||||
|
||||
`Aetheria.State.Import` captures the legacy catalog files into typed quarantine
|
||||
state: path, size, and SHA-256 fingerprint for `AetherDB.msgpack` plus
|
||||
|
|
@ -62,6 +61,10 @@ field from key 3, name-file and boss-hull legacy IDs, influence distance,
|
|||
allegiance count, and music bank IDs. Runtime object graphs, typed behavior
|
||||
factory construction, and simulation state remain legacy until dedicated typed
|
||||
runtime documents exist.
|
||||
Typed name-file documents are `aetheria.name_file.v2` records. They carry the
|
||||
legacy ID, display name, count, compact sample names for surfaces, and the full
|
||||
name array needed to move `Galaxy`/Markov name generation off legacy
|
||||
`NameFile.Names`.
|
||||
Legacy GUID references that are `Guid.Empty` are imported as absent references,
|
||||
not as resolvable catalog links.
|
||||
Before materializing state, the importer clears the generated `.cc`,
|
||||
|
|
@ -101,15 +104,15 @@ equipment slots, weapon groups, and stat grids without reviving
|
|||
`Aetheria.State.Verify` opens a materialized state file and checks that the
|
||||
typed migration ledger matches the actual item, corporation, and name-file
|
||||
records in the `.cc` store. It also verifies the canonical legacy-ID lookup API
|
||||
for one migrated record of each catalog kind and checks that expanded item and
|
||||
corporation catalog facts survived materialization. The verifier also exercises
|
||||
the typed catalog snapshot query surface, shape-mask invariants, and the
|
||||
typed behavior payload tree, and the published Eve catalog surface. The current
|
||||
catalog materializes 65 behavior payloads, 661 behavior fields, and 18
|
||||
behavior-side legacy-ID references. Legacy content currently includes at least
|
||||
one overhanging hardpoint; the verifier preserves the payload and checks
|
||||
hardpoint local masks rather than silently converting content repair into
|
||||
migration.
|
||||
for one migrated record of each catalog kind, checks that name-file v2 records
|
||||
carry their full name arrays, and checks that expanded item and corporation
|
||||
catalog facts survived materialization. The verifier also exercises the typed
|
||||
catalog snapshot query surface, shape-mask invariants, the typed behavior
|
||||
payload tree, and the published Eve catalog surface. The current catalog
|
||||
materializes 65 behavior payloads, 661 behavior fields, and 18 behavior-side
|
||||
legacy-ID references. Legacy content currently includes at least one overhanging
|
||||
hardpoint; the verifier preserves the payload and checks hardpoint local masks
|
||||
rather than silently converting content repair into migration.
|
||||
Use it after import when `GameData/aetheria-world.cc` changes.
|
||||
|
||||
`Aetheria.State.Unity.Smoke` opens the materialized state through the runtime
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue