diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 7d4ade349..5b16574e8 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs index 00f320083..455cb0c9c 100644 --- a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs +++ b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs @@ -15,7 +15,6 @@ public static class LegacyCatalogBoundary _catalogCache = new LegacyCatalogCache(); _catalogCache.AddBackingStore(new SingleFileMessagePackBackingStore(GetLegacyCatalogPath(gameDataDirectory))); - _catalogCache.AddBackingStore(new MultiFileMessagePackBackingStore(gameDataDirectory.FullName), typeof(NameFile)); _catalogCache.PullAllBackingStores(); DatabaseLinkBase.BindLegacyCatalog(_catalogCache); return _catalogCache; diff --git a/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs b/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs index c1de594cf..e5a0127a3 100644 --- a/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs +++ b/Assets/Scripts/ServerShared/CultCache/LegacyCatalogCache.cs @@ -20,21 +20,12 @@ public class LegacyCatalogCache : ILegacyCatalogReader private readonly object addLock = new object(); private List _backingStores = new List(); - - private readonly Dictionary _storeTypes = new Dictionary(); private readonly Dictionary _entries = new Dictionary(); - public void AddBackingStore(CacheBackingStore store, params Type[] domain) + public void AddBackingStore(CacheBackingStore store) { - if (domain.Length > 0) - { - _storeTypes[store] = domain; - } - else - { - _backingStores.Add(store); - } + _backingStores.Add(store); store.EntryAdded.Subscribe(entry => { AddInternal(entry, store); @@ -44,7 +35,6 @@ public class LegacyCatalogCache : ILegacyCatalogReader public void PullAllBackingStores() { foreach(var store in _backingStores) store.PullAll(); - foreach(var store in _storeTypes.Keys) store.PullAll(); } private void AddInternal(DatabaseEntry entry, CacheBackingStore source = null) @@ -85,55 +75,6 @@ public abstract class CacheBackingStore protected Dictionary Entries = new Dictionary(); } -public abstract class MultiFileBackingStore : CacheBackingStore -{ - public DirectoryInfo DirectoryInfo { get; } - protected Dictionary _entryTypeDirectories = new Dictionary(); - - public abstract DatabaseEntry Deserialize(byte[] data); - public abstract string Extension { get; } - - public MultiFileBackingStore(string path) - { - DirectoryInfo = new DirectoryInfo(path); - foreach (var type in typeof(DatabaseEntry).GetAllChildClasses()) - { - _entryTypeDirectories[type] = new DirectoryInfo(Path.Combine(DirectoryInfo.FullName, type.Name)); - } - } - - public override void PullAll() - { - if (!DirectoryInfo.Exists) return; - - foreach (var directory in _entryTypeDirectories.Values) - { - foreach (var file in directory.EnumerateFiles($"*.{Extension}")) - { - var entry = Deserialize(File.ReadAllBytes(file.FullName)); - Entries[entry.ID] = entry; - EntryAdded.OnNext(entry); - } - } - } - -} - -public class MultiFileMessagePackBackingStore : MultiFileBackingStore -{ - public MultiFileMessagePackBackingStore(string path) : base(path) - { - RegisterResolver.Register(); - } - - public override DatabaseEntry Deserialize(byte[] data) - { - return MessagePackSerializer.Deserialize(data); - } - - public override string Extension => "msgpack"; -} - public abstract class SingleFileBackingStore : CacheBackingStore { public FileInfo FileInfo { get; } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 5ead6b335..f3848c1aa 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -45,7 +45,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `MessagePackSerializer` calls are the two legacy catalog deserializers and their resolver setup. - Local legacy catalog data remains in `GameData/AetherDB.msgpack` and - `GameData/NameFile/*.msgpack` as migration/catalog inputs. The old + `GameData/NameFile/*.msgpack` as migration inputs. The Unity runtime legacy + catalog bridge opens only `GameData/AetherDB.msgpack`; `NameFile/*.msgpack` + is no longer a runtime backing store. The old `PlayerSettings.msgpack`, `.loadout`, `.zone`, and `GameData/KeyboardLayouts/*.msgpack` authority paths are disabled or deleted. The old `SavedGame`/`SavedZone` DTOs and `Galaxy` save-loader constructor are @@ -76,8 +78,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. - The private `ActionGameManager` catalog boot helper delegates to `LegacyCatalogBoundary`, which opens `LegacyCatalogCache` as the only concrete pull-only catalog cache. Runtime consumers receive - `ILegacyCatalogReader`, so old MessagePack backing stores may hydrate - in-memory domain objects for the current Unity runtime, but this path cannot + `ILegacyCatalogReader`, so the old `AetherDB.msgpack` backing store may hydrate + in-memory item domain objects for the current Unity runtime, but this path cannot push or delete legacy files. The legacy backing-store write/realtime APIs, public cache mutation methods, enumeration methods, and global-setting lookup methods have been deleted; only backing-store pull @@ -107,7 +109,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. Sector and tutorial generation receive the package-owned typed runtime catalog. `Galaxy` projects typed corporation v2 records into temporary legacy `Faction` DTOs, including allegiance edges, for the existing simulation shape - and resolves full name arrays from `aetheria.name_file.v2` records. + and resolves full name arrays from `aetheria.name_file.v2` records. The + legacy catalog runtime no longer opens the old `GameData/NameFile/*.msgpack` + directory. `ActionGameManager` still has a private legacy catalog boot helper that feeds `ItemManager` for item/entity systems; menu/generation paths no longer receive the legacy reader directly. @@ -438,6 +442,9 @@ First Aetheria surfaces to publish: - Done: delete `ILegacyCatalogReader.GetAll` and the type/global indexes inside `LegacyCatalogCache`; the legacy cache is now only a pull-fed GUID lookup bridge. + - Done: remove `GameData/NameFile/*.msgpack` from Unity runtime legacy + catalog boot; typed name files now own runtime names, and old name files + remain migration inputs only. - Replace `ActionGameManager` cache bootstrap with the new state runtime. - Convert domain references from GUID/base-class patterns to typed record refs.