Persist faction relationships in run checkpoints

This commit is contained in:
Meta Vens 2026-06-14 12:02:47 +01:00
commit e0a39b2fce
8 changed files with 73 additions and 6 deletions

View file

@ -226,6 +226,7 @@ public static class AetheriaRuntimeCommitLogApplier
CurrentZoneEntityIndex = checkpoint.CurrentZoneEntityIndex,
DiscoveredZoneIndices = ToIntArray(checkpoint.DiscoveredZoneIndices),
ActionBarBindings = ToActionBarBindings(checkpoint.ActionBarBindings),
FactionRelationships = ToFactionRelationships(checkpoint.FactionRelationships),
UpdatedAtUtc = updatedAtUtc
};
@ -328,6 +329,19 @@ public static class AetheriaRuntimeCommitLogApplier
.ToArray();
}
private static AetheriaFactionRelationshipState[] ToFactionRelationships(
IReadOnlyList<AetheriaRuntimeFactionRelationshipCommit>? relationships)
{
return (relationships ?? Array.Empty<AetheriaRuntimeFactionRelationshipCommit>())
.Select(relationship => new AetheriaFactionRelationshipState
{
FactionKey = ReferenceKey("aetheria.corporation", relationship.CorporationLegacyId ?? ""),
Relationship = relationship.Relationship ?? "",
Standing = relationship.Standing
})
.ToArray();
}
private static CultRecordKey LoadoutKey(string name)
{
return new CultRecordKey($"global:aetheria.loadout_template.{StableToken(name)}.v1");