diff --git a/Assets/Scripts/CultCache/Editor.meta b/Assets/Scripts/CultCache/Editor.meta deleted file mode 100644 index 20232d25a..000000000 --- a/Assets/Scripts/CultCache/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2501605fca062c84d963e811df551698 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor/SerializerTestWindow.cs.meta b/Assets/Scripts/Editor/SerializerTestWindow.cs.meta deleted file mode 100644 index 82072d9d4..000000000 --- a/Assets/Scripts/Editor/SerializerTestWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c18f225a1e4e8bc42bce3782701c9a6b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs index ee93de72c..e95aaf7f9 100644 --- a/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs +++ b/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs @@ -22,6 +22,7 @@ public static class LegacyCatalogBoundary _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/CultCache.cs b/Assets/Scripts/ServerShared/CultCache/CultCache.cs index 581a41855..9e0d297f8 100644 --- a/Assets/Scripts/ServerShared/CultCache/CultCache.cs +++ b/Assets/Scripts/ServerShared/CultCache/CultCache.cs @@ -54,8 +54,6 @@ public class CultCache public CultCache(bool readOnly = false) { ReadOnly = readOnly; - DatabaseLinkBase.Cache = this; - foreach (var type in typeof(DatabaseEntry).GetAllChildClasses()) { _types[type] = new HashSet(); diff --git a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs index ac560d6da..57ad82058 100644 --- a/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs +++ b/Assets/Scripts/ServerShared/CultCache/DatabaseEntry.cs @@ -68,7 +68,7 @@ public abstract class DatabaseEntry public class DatabaseLink : DatabaseLinkBase where T : DatabaseEntry { [IgnoreMember] - public T Value => Cache.Get(LinkID); + public T Value => ResolveLegacyCatalog(LinkID); } [MessagePackObject] @@ -78,10 +78,27 @@ public class DatabaseLinkBase public Guid LinkID; [IgnoreMember] - public static CultCache Cache; + private static CultCache LegacyCatalogCache { get; set; } + + protected static T ResolveLegacyCatalog(Guid linkId) where T : DatabaseEntry + { + if (LegacyCatalogCache == null) + throw new InvalidOperationException("Legacy DatabaseLink resolution is not bound. Open LegacyCatalogBoundary before reading legacy catalog object graphs."); + + return LegacyCatalogCache.Get(linkId); + } + + public static void BindLegacyCatalog(CultCache cache) + { + if (cache == null) throw new ArgumentNullException(nameof(cache)); + if (!cache.ReadOnly) + throw new InvalidOperationException("Legacy DatabaseLink resolution requires a read-only catalog cache."); + + LegacyCatalogCache = cache; + } } public interface ITintInspector { float3 TintColor { get; } -} \ No newline at end of file +} diff --git a/Assets/Scripts/ServerShared/CultCache/RethinkConnection.cs.meta b/Assets/Scripts/ServerShared/CultCache/RethinkConnection.cs.meta deleted file mode 100644 index c2a7c6a8f..000000000 --- a/Assets/Scripts/ServerShared/CultCache/RethinkConnection.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a8fce60db4f3e614c8d19c3da4cede0e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index f37cb189f..361b62c99 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -35,6 +35,9 @@ local CultCache, and legacy UI paths should be migration-only or deleted. - `LegacyCatalogBoundary` opens the legacy `CultCache` in read-only mode. Old MessagePack backing stores may hydrate in-memory domain objects for the current Unity runtime, but this path cannot push or delete legacy files. +- `DatabaseLink.Value` can resolve legacy links only after + `LegacyCatalogBoundary` binds the read-only catalog cache. `CultCache` + construction no longer grabs global `DatabaseLinkBase` authority. - `Economy.Server` now starts the modern `Aetheria.State` CultMesh node and no longer owns RethinkDB/LiteNetLib state. - `Aetheria.State.Import` writes a typed quarantine manifest and migration @@ -70,7 +73,8 @@ local CultCache, and legacy UI paths should be migration-only or deleted. - Owner: `Aetheria.State` owns the new typed state spine for durable state. `LegacyCatalogBoundary` is the only named owner for old MessagePack catalog - reads inside the Unity runtime until catalog migration lands. + reads and legacy `DatabaseLink` resolution inside the Unity runtime until + catalog migration lands. - Inputs: Unity gameplay code, legacy catalog files, typed state documents, and CultMesh server state. - Outputs: `Aetheria.State` emits `.cc` state and CultMesh documents. Legacy