Hydrate only Aetheria daemon working state

This commit is contained in:
Meta Vens 2026-07-20 01:52:05 +01:00
commit b4b16867ee
9 changed files with 341 additions and 15 deletions

View file

@ -66,6 +66,9 @@ namespace GameCult.Aetheria.State.Verse
[Key(4)]
public AetheriaRuntimeTradeValueSettings TradeValueSettings { get; set; } = AetheriaRuntimeTradeValueSettings.Default;
[Key(5)]
public string NameCorpusRecordKey { get; set; } = string.Empty;
public AetheriaRuntimeCatalogItem? FindItem(string itemKey)
{
if (string.IsNullOrWhiteSpace(itemKey))
@ -138,6 +141,21 @@ namespace GameCult.Aetheria.State.Verse
}
}
[CultDocument("gamecult.aetheria.runtime_name_corpus", "gamecult.aetheria.runtime_name_corpus.v1")]
[MessagePackObject]
public sealed class AetheriaRuntimeNameCorpusSnapshot
{
public const string SchemaId = "gamecult.aetheria.runtime_name_corpus.v1";
public const string DocumentName = "aetheria.runtime_name_corpus";
[Key(0)]
[CultName]
public string CorpusId { get; set; } = DocumentName;
[Key(1)]
public IReadOnlyList<AetheriaRuntimeNameFile> NameFiles { get; set; } = Array.Empty<AetheriaRuntimeNameFile>();
}
[CultDocument("gamecult.aetheria.loadout_templates", "gamecult.aetheria.loadout_templates.v1")]
[MessagePackObject]
public sealed class AetheriaRuntimeLoadoutTemplatesDocument

View file

@ -232,13 +232,18 @@ namespace GameCult.Aetheria.State.Verse
var records = new List<PersistedRecord>();
var reader = new MessagePackReader(File.ReadAllBytes(stateFilePath));
var snapshotFields = reader.ReadArrayHeader();
if (snapshotFields > 0) reader.Skip();
var formatVersion = snapshotFields > 0 ? ReadString(ref reader) : "";
if (snapshotFields > 1) reader.Skip();
if (snapshotFields > 2)
{
var recordCount = reader.ReadArrayHeader();
for (var index = 0; index < recordCount; index++)
records.Add(ReadPersistedRecord(ref reader));
{
if (string.Equals(formatVersion, "cultcache.store.v2.directory-indexed", StringComparison.Ordinal))
reader.Skip();
else
records.Add(ReadPersistedRecord(ref reader));
}
}
var recordDirectory = stateFilePath + ".records";