From 596534896f22f233d366476b60f64fcd18659cb7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 14:01:24 +0100 Subject: [PATCH] Remove legacy name file backing store --- .voidbot/state/aetheria.cc | Bin 31400 -> 31490 bytes .../Scripts/Gameplay/LegacyCatalogBoundary.cs | 1 - .../CultCache/LegacyCatalogCache.cs | 63 +----------------- docs/aetheria-perfect-machine-map.md | 15 +++-- 4 files changed, 13 insertions(+), 66 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 7d4ade3493cbde22b72925af62295f5c7f45a7cf..5b16574e81634254b9afb3102cccceaea253b848 100644 GIT binary patch delta 1326 zcmah}L2uMn5SBw4H6*B@l0pw@CjzBy#5%hP+9s*mLWn>qgn&pcs8#i1&w8I?zvsU9 zmSoFerE=m}y+1(JBDfLcGvb7D=!s(vNc@AI;9BO{>)mZ6)Qe?}$Mb#j%{TM-jrZGI zZ||?6@%g1{ZK+!K7tb%={@t6fFNW^-WA$ntlSg(3V)Z=s;qYhPe)h$1^YhN?rr@Rx zswE6h5QKzSiU<|R6orNuBNnvbI!o{}j}g{TYZl=R7Hq>7J-CQK8>vwH4}+NT z?1?a2$~!w#ssIh@U3bglF4qQ#Zo(tNAtt~@+As3Da z7)VEjY0QWwH?YG^)2>ZVW`9gCjx1EySX$!rt=c0$C|t$4&%gJl!p1?(K3F)J%~$?C zZbw%qZmt%_&FMLITax5)wpAFB{-`wM)^*%8*@CvAq*(ft6>{nA$ zb}#wV-WA8jdKYT0p8dFWZhSCcf03v9r)i-$SAUCV-PqTDwOZ?*uo3%2CjEG=$o)3$ S48-PKZuTmDJ~|Mr-+l)QKh(tl delta 1240 zcmY+Ezi%8x6vwr(69{&MD_juZML;4U`wVwEI6HDAz>Ya^m_cCXd$hCdfp!}sSNEzLulAB6k*m7o^R=CMw@Q^#Ihd_5_vYm3DjlfAV zz>;>OVz5+0%9%t8G;|AF&c41PMRcAF6b=KYtj1Bp|m9W^oM=La^>9~%4r_f zaUo_^T9`v27LzGb$Ot>nsVYk)Qk_!}vAkHig%mU9Ekcd1#JUkv8X4L(IOfiAIe@Id z?1a{_jVTsv$Qu&Y8K2cvQ+8B9Aqb5^c0U!rstD6QRL4>vyc!X5Qz)}#24pvT~C zv_%V|rzD;^!e+Sg7BX@Sx1qfHTKMO!S1-rDGJ3>T&Ad#P8%O)9$5%HmY;WIY8VpkN zb6b0+0T5w{rd8`oig81<@nSSbYIr`t@LufWM)k6 z8bK|hMzXm?QS~2UOl#+(R%r*C{ub(TbIu^kDc@+EO5E%&?e5NnseiQ^o@r&t4Ylgt zQGbV$RVQ9Ie6$y0eg5ANPs7nxfAo_ixfWJB?}mrBR;zbDyR?|x2)zRczaCzxMh8Eg zPkQ0gqc_9vhnHR;=JoxLkB*naX}UF^6zz7m`Zir#em)R>Tv(m2JDpxVO5RrAJ&Rp$ lPe;y$a8Z}@>D0MiPp2n(^4!+V>dNWQ7nf(_s?+V<{SU8cx&8nE 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.