Package ac.boar.anticheat.ack
Class PendingAckBucket
java.lang.Object
ac.boar.anticheat.ack.PendingAckBucket
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Acknowledgment ack) drain()Atomically returns the current pending list and replaces it with an empty one.booleanisEmpty()
-
Constructor Details
-
PendingAckBucket
public PendingAckBucket()
-
-
Method Details
-
add
-
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()
-