Aetheria/Assets/Scripts/Gameplay/LegacyCatalogBoundary.cs

27 lines
964 B
C#
Raw Normal View History

2026-06-13 06:33:12 +01:00
using System.IO;
public static class LegacyCatalogBoundary
{
private static CultCache _catalogCache;
public static string GetStateFilePath(DirectoryInfo gameDataDirectory)
{
return Path.Combine(gameDataDirectory.FullName, "aetheria-world.cc");
}
public static string GetLegacyCatalogPath(DirectoryInfo gameDataDirectory)
{
return Path.Combine(gameDataDirectory.FullName, "AetherDB.msgpack");
}
public static CultCache GetCatalogCache(DirectoryInfo gameDataDirectory)
{
if (_catalogCache != null) return _catalogCache;
2026-06-13 06:38:33 +01:00
_catalogCache = new CultCache(readOnly: true);
2026-06-13 06:33:12 +01:00
_catalogCache.AddBackingStore(new SingleFileMessagePackBackingStore(GetLegacyCatalogPath(gameDataDirectory)));
_catalogCache.AddBackingStore(new MultiFileMessagePackBackingStore(gameDataDirectory.FullName), typeof(NameFile));
_catalogCache.PullAllBackingStores();
return _catalogCache;
}
}