From f28ca3a89f2793387dc8a55a98f6dbb869ed57d6 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 02:49:50 +0200 Subject: [PATCH] CultNetBurnedSequence: a plain struct, since netstandard2.1 has no IsExternalInit The record struct in 2eb0e8d6 did not compile for the library's netstandard2.1 target. Co-Authored-By: Claude Sonnet 5.5 --- src/GameCult.Networking/CultNetDatabase.cs | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/GameCult.Networking/CultNetDatabase.cs b/src/GameCult.Networking/CultNetDatabase.cs index bcfb1ca4..97d822a5 100644 --- a/src/GameCult.Networking/CultNetDatabase.cs +++ b/src/GameCult.Networking/CultNetDatabase.cs @@ -466,7 +466,39 @@ namespace GameCult.Networking /// /// One shard-log sequence that a primary minted for a committed change and burned because it could not log it. /// - public readonly record struct CultNetBurnedSequence(string ShardId, long Sequence); + public readonly struct CultNetBurnedSequence : IEquatable + { + /// + /// Creates a burned sequence. + /// + public CultNetBurnedSequence(string shardId, long sequence) + { + ShardId = shardId; + Sequence = sequence; + } + + /// + /// Gets the shard whose log burned the sequence. + /// + public string ShardId { get; } + + /// + /// Gets the burned shard-log sequence. + /// + public long Sequence { get; } + + /// + public bool Equals(CultNetBurnedSequence other) => Sequence == other.Sequence && string.Equals(ShardId, other.ShardId, StringComparison.Ordinal); + + /// + public override bool Equals(object? obj) => obj is CultNetBurnedSequence other && Equals(other); + + /// + public override int GetHashCode() => (StringComparer.Ordinal.GetHashCode(ShardId ?? string.Empty) * 397) ^ Sequence.GetHashCode(); + + /// + public override string ToString() => $"{ShardId}:{Sequence}"; + } /// /// Raised to the writer when a shard primary committed changes and could not log them. The commits stand and the