Package ac.boar.anticheat.ack
Class BatchAcknowledgmentTransport
java.lang.Object
ac.boar.anticheat.ack.BatchAcknowledgmentTransport
- All Implemented Interfaces:
BoarAcknowledgmentTransport,BoarBatchedAcknowledgmentTransport
public class BatchAcknowledgmentTransport
extends Object
implements BoarBatchedAcknowledgmentTransport
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(Acknowledgment ack) Bind the acknowledgment to the most recent in-flight ping.protected voidemitImmediate(org.cloudburstmc.protocol.bedrock.packet.NetworkStackLatencyPacket packet) booleanvoidEmit a keepalive ping with no acknowledgment to dispatch.voidstatic longnextId()booleanonPingReceived(long id) Notify the transport that an inbound NetworkStackLatency response was observed on the wire.voidonPingSent(long id, boolean ours) Notify the transport that an outbound NetworkStackLatency packet was observed on the wire.voidsend(Acknowledgment ack) Emit a fresh ping and bind the acknowledgment to it.
-
Field Details
-
player
-
-
Constructor Details
-
BatchAcknowledgmentTransport
public BatchAcknowledgmentTransport()
-
-
Method Details
-
markPending
- Specified by:
markPendingin interfaceBoarBatchedAcknowledgmentTransport
-
drainPending
- Specified by:
drainPendingin interfaceBoarBatchedAcknowledgmentTransport
-
hasPending
public boolean hasPending()- Specified by:
hasPendingin interfaceBoarBatchedAcknowledgmentTransport
-
keepalive
public void keepalive()Description copied from interface:BoarAcknowledgmentTransportEmit a keepalive ping with no acknowledgment to dispatch. Used to detect timeouts when no server-state change is pending.- Specified by:
keepalivein interfaceBoarAcknowledgmentTransport
-
send
Description copied from interface:BoarAcknowledgmentTransportEmit a fresh ping and bind the acknowledgment to it. The acknowledgment's handler runs when the client confirms this ping.- Specified by:
sendin interfaceBoarAcknowledgmentTransport
-
attach
Description copied from interface:BoarAcknowledgmentTransportBind the acknowledgment to the most recent in-flight ping. If none is pending, dispatch the acknowledgment immediately.- Specified by:
attachin interfaceBoarAcknowledgmentTransport
-
onPingSent
public void onPingSent(long id, boolean ours) Description copied from interface:BoarAcknowledgmentTransportNotify the transport that an outbound NetworkStackLatency packet was observed on the wire. Theoursflag is true if the ping originated from Boar (vs. forwarded from upstream).- Specified by:
onPingSentin interfaceBoarAcknowledgmentTransport
-
onPingReceived
public boolean onPingReceived(long id) Description copied from interface:BoarAcknowledgmentTransportNotify the transport that an inbound NetworkStackLatency response was observed on the wire. The transport dispatches any associated acknowledgments and updates its own bookkeeping. Returns true to cancel the underlying packet event (i.e. the ping was Boar's own and should not be forwarded upstream).- Specified by:
onPingReceivedin interfaceBoarAcknowledgmentTransport
-
nextId
public static long nextId() -
emitImmediate
protected void emitImmediate(org.cloudburstmc.protocol.bedrock.packet.NetworkStackLatencyPacket packet)
-