Bind legacy links through catalog boundary
This commit is contained in:
parent
1872b2ec0b
commit
168a8cc517
7 changed files with 26 additions and 36 deletions
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2501605fca062c84d963e811df551698
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c18f225a1e4e8bc42bce3782701c9a6b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<DatabaseEntry>();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public abstract class DatabaseEntry
|
|||
public class DatabaseLink<T> : DatabaseLinkBase where T : DatabaseEntry
|
||||
{
|
||||
[IgnoreMember]
|
||||
public T Value => Cache.Get<T>(LinkID);
|
||||
public T Value => ResolveLegacyCatalog<T>(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<T>(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<T>(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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a8fce60db4f3e614c8d19c3da4cede0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -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<T>.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<T>` 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue