Class PendingAckBucket

java.lang.Object
ac.boar.anticheat.ack.PendingAckBucket

public final class PendingAckBucket extends Object
Per-player bucket that accumulates acknowledgments waiting for the next outbound bedrock batch flush. Drained by BoarBatchAcknowledger on flush, which generates a single NetworkStackLatency id covering every drained ack.

Writers (emitters calling markPending) may run on any thread — the channel event loop during inbound/outbound packet handling, or the Geyser session tick thread during BoarPlayer.serverTick. The drain happens on the channel event loop. The lock keeps the compound add and the snapshot+clear atomic so an ack cannot be observed half-published.

  • Constructor Details

    • PendingAckBucket

      public PendingAckBucket()
  • Method Details

    • add

      public void add(Acknowledgment ack)
    • drain

      public List<Acknowledgment> drain()
      Atomically returns the current pending list and replaces it with an empty one. Callers own the returned list; mutate it freely.
    • isEmpty

      public boolean isEmpty()