namespace SVSim.BattleNode.Reliability;
///
/// Per-session inbound-emit ledger. Dedupes the client's pubSeq so we never dispatch
/// a retransmitted emit twice; ack-echo (via SIO callback) is the caller's job.
///
public sealed class InboundTracker
{
private readonly HashSet _seen = new();
/// Highest pubSeq observed so far. Reported via Gungnir for diagnostics.
public long HighWaterMark { get; private set; }
/// Record an incoming pubSeq. Returns true if the caller should dispatch the envelope, false on duplicate.
public bool Observe(long pubSeq)
{
if (pubSeq > HighWaterMark) HighWaterMark = pubSeq;
return _seen.Add(pubSeq);
}
}