From 742bb69d43b3f20c5af1a465e61d84530cd9f2b8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 07:11:16 +0100 Subject: [PATCH] Rename legacy runtime cache --- .../Scripts/Gameplay/LegacyCatalogBoundary.cs | 6 +++--- .../ServerShared/CultCache/CultCache.cs | 4 ++-- .../ServerShared/CultCache/DatabaseEntry.cs | 10 ++++----- Assets/Scripts/ServerShared/Galaxy.cs | 8 +++---- Assets/Scripts/ServerShared/ItemManager.cs | 6 +++--- docs/aetheria-perfect-machine-map.md | 21 ++++++++++--------- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs index b6046a6bf..4e17620c9 100644 --- a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs +++ b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs @@ -2,7 +2,7 @@ using System.IO; public static class LegacyCatalogBoundary { - private static CultCache _catalogCache; + private static LegacyCatalogCache _catalogCache; public static string GetStateFilePath(DirectoryInfo gameDataDirectory) { @@ -14,11 +14,11 @@ public static class LegacyCatalogBoundary return Path.Combine(gameDataDirectory.FullName, "AetherDB.msgpack"); } - public static CultCache GetCatalogCache(DirectoryInfo gameDataDirectory) + public static LegacyCatalogCache GetCatalogCache(DirectoryInfo gameDataDirectory) { if (_catalogCache != null) return _catalogCache; - _catalogCache = new CultCache(); + _catalogCache = new LegacyCatalogCache(); _catalogCache.AddBackingStore(new SingleFileMessagePackBackingStore(GetLegacyCatalogPath(gameDataDirectory))); _catalogCache.AddBackingStore(new MultiFileMessagePackBackingStore(gameDataDirectory.FullName), typeof(NameFile)); _catalogCache.PullAllBackingStores(); diff --git a/Assets/Scripts/ServerShared/CultCache/CultCache.cs b/Assets/Scripts/ServerShared/CultCache/CultCache.cs index 98ff5c164..835821f36 100644 --- a/Assets/Scripts/ServerShared/CultCache/CultCache.cs +++ b/Assets/Scripts/ServerShared/CultCache/CultCache.cs @@ -10,7 +10,7 @@ using System.Reflection; using MessagePack; using UniRx; -public class CultCache +public class LegacyCatalogCache { private readonly object addLock = new object(); @@ -27,7 +27,7 @@ public class CultCache public IEnumerable AllEntries => _entries.Values; - public CultCache() + public LegacyCatalogCache() { foreach (var type in typeof(DatabaseEntry).GetAllChildClasses()) { diff --git a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs index ef504256f..e4f06542d 100644 --- a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs +++ b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs @@ -78,21 +78,21 @@ public class DatabaseLinkBase public Guid LinkID; [IgnoreMember] - private static CultCache LegacyCatalogCache { get; set; } + private static LegacyCatalogCache CatalogCache { get; set; } protected static T ResolveLegacyCatalog(Guid linkId) where T : DatabaseEntry { - if (LegacyCatalogCache == null) + if (CatalogCache == null) throw new InvalidOperationException("Legacy DatabaseLink resolution is not bound. Open LegacyCatalogBoundary before reading legacy catalog object graphs."); - return LegacyCatalogCache.Get(linkId); + return CatalogCache.Get(linkId); } - public static void BindLegacyCatalog(CultCache cache) + public static void BindLegacyCatalog(LegacyCatalogCache cache) { if (cache == null) throw new ArgumentNullException(nameof(cache)); - LegacyCatalogCache = cache; + CatalogCache = cache; } } diff --git a/Assets/Scripts/ServerShared/Galaxy.cs b/Assets/Scripts/ServerShared/Galaxy.cs index 842c66cd9..57e3c9799 100644 --- a/Assets/Scripts/ServerShared/Galaxy.cs +++ b/Assets/Scripts/ServerShared/Galaxy.cs @@ -32,7 +32,7 @@ public class Galaxy private HashSet _containedFactions; private GalaxyZone[] _exitPath; private Dictionary _nameGenerators = new Dictionary(); - private readonly CultCache _cache; + private readonly LegacyCatalogCache _cache; public GalaxyZone[] ExitPath { @@ -48,7 +48,7 @@ public class Galaxy SectorGenerationSettings settings, SectorBackgroundSettings background, NameGeneratorSettings nameGeneratorSettings, - CultCache cache, + LegacyCatalogCache cache, Action log, Action progressCallback = null, uint seed = 0) @@ -96,7 +96,7 @@ public class Galaxy TutorialGenerationSettings settings, SectorBackgroundSettings background, NameGeneratorSettings nameGeneratorSettings, - CultCache cache, + LegacyCatalogCache cache, PlayerSettings playerSettings, DirectoryInfo narrativeDirectory, Action log, @@ -280,7 +280,7 @@ public class Galaxy } } - private void GenerateNames(CultCache cache, + private void GenerateNames(LegacyCatalogCache cache, NameGeneratorSettings nameGeneratorSettings, ref Random random, Action progressCallback = null) diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index c845d238b..6721a3c7f 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -31,7 +31,7 @@ public class ItemManager // private Guid _forceLoadZone; // public GlobalData GlobalData => _globalData ?? (_globalData = ItemData.GetAll().FirstOrDefault()); - public CultCache ItemData { get; } + public LegacyCatalogCache ItemData { get; } public GameplaySettings GameplaySettings { get; } // public double Time @@ -47,7 +47,7 @@ public class ItemManager // private readonly Dictionary Tier = new Dictionary(); - public ItemManager(CultCache itemData, GameplaySettings settings, Action logger) + public ItemManager(LegacyCatalogCache itemData, GameplaySettings settings, Action logger) { ItemData = itemData; GameplaySettings = settings; @@ -247,4 +247,4 @@ public class ItemManager int upgrades = (int) ((item.Quality - tier.Quality) / .0499f); return (tier, upgrades); } -} \ No newline at end of file +} diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 62ad4dc7b..3efa2ce15 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -13,7 +13,7 @@ authority. Aetheria should persist and replicate game state as typed CultCache documents, publish multiplayer/service state through CultMesh, and render operator/runtime interfaces from Eve CultUI surfaces. The old JSON, RethinkDB, JsonKnownTypes, -local CultCache, and legacy UI paths should be migration-only or deleted. +legacy catalog cache, and legacy UI paths should be migration-only or deleted. ## Current Mechanism @@ -32,13 +32,13 @@ local CultCache, and legacy UI paths should be migration-only or deleted. `GameData/KeyboardLayouts/*.msgpack` authority paths are disabled or deleted. The old `SavedGame`/`SavedZone` DTOs and `Galaxy` save-loader constructor are deleted. -- `LegacyCatalogBoundary` opens the legacy `CultCache` as a pull-only catalog +- `LegacyCatalogBoundary` opens `LegacyCatalogCache` as a pull-only catalog cache. Old MessagePack backing stores may hydrate in-memory domain objects for the current Unity runtime, but this path cannot push or delete legacy files. The legacy backing-store write/realtime APIs and public cache mutation methods have been deleted; only backing-store pull hydration can populate it. - `DatabaseLink.Value` can resolve legacy links only after - `LegacyCatalogBoundary` binds the read-only catalog cache. `CultCache` + `LegacyCatalogBoundary` binds the pull-only catalog cache. Legacy catalog construction no longer grabs global `DatabaseLinkBase` authority. - `Economy.Server` now starts the modern `Aetheria.State` CultMesh node and no longer owns RethinkDB/LiteNetLib state. @@ -95,8 +95,8 @@ local CultCache, and legacy UI paths should be migration-only or deleted. - Shared paths: manual gameplay edits, editor edits, server updates, file load, file save, and migration all need to converge on one typed commit primitive. - Deletion line: no new behavior should be added to `LegacyCatalogBoundary`, the - old `DatabaseEntry`, legacy `CultCache`, or MessagePack catalog paths except - bounded migration readers that emit typed `Aetheria.State` documents. + old `DatabaseEntry`, `LegacyCatalogCache`, or MessagePack catalog paths + except bounded migration readers that emit typed `Aetheria.State` documents. ## Target Authority Map @@ -113,7 +113,7 @@ local CultCache, and legacy UI paths should be migration-only or deleted. - Shared paths: gameplay input, editor edits, import/deep-load, replication, simulation ticks, and tests all call the same typed state service. - Deletion line: after catalog migration smokes pass, delete or quarantine the - remaining legacy `CultCache`/`DatabaseEntry` runtime catalog dependency and + remaining `LegacyCatalogCache`/`DatabaseEntry` runtime catalog dependency and remove old MessagePack backing store classes from live Unity source. ## Intended Change @@ -190,7 +190,8 @@ First Aetheria surfaces to publish: - Replace `ActionGameManager` cache bootstrap with the new state runtime. - Convert domain references from GUID/base-class patterns to typed record refs. - - Remove runtime dependency on old `CultCache` and `DatabaseEntry` as owners. + - Remove runtime dependency on `LegacyCatalogCache` and `DatabaseEntry` as + owners. 5. Mesh host - Replace `Economy.Server` RethinkDB and LiteNetLib database authority with a @@ -215,10 +216,10 @@ First Aetheria surfaces to publish: - Done: disable legacy local save, loadout, zone, player-settings, keyboard layout, DB inspector, and NameFile export writers. - Done: delete the old `SavedGame`/`SavedZone` runtime save DTO and loader. - - Done: stop legacy `CultCache` pull/read paths from writing entries back to + - Done: stop legacy catalog pull/read paths from writing entries back to their source backing store. - - Done: delete legacy `CultCache` backing-store write/realtime APIs. - - Done: delete public legacy `CultCache` mutation APIs. + - Done: delete legacy catalog backing-store write/realtime APIs. + - Done: delete public legacy catalog cache mutation APIs. - Remaining: delete or quarantine old cache abstractions that no longer protect an invariant once catalog migration has a typed reader.