Package ac.boar.anticheat.util
Class MovementTrace
java.lang.Object
ac.boar.anticheat.util.MovementTrace
Records what the movement prediction does on each tick.
The trace collects log lines into a buffer for the current tick. When a new tick starts,
the old buffer moves into a small history. The history keeps the last HISTORY_TICKS
ticks. Nothing is written to the log during normal play.
When the prediction fails hard enough to send a correction, dump(String) builds
one text block with the full history and the failing tick, and flush(String) writes
that block to the log. This gives the data needed to re-create the failure: the client input,
the start state, and each step of the simulation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Starts a new tick.Builds the full trace text: the reason, the retained history, and the current tick.voidWrites the trace to the log as one message.voidAdds one line to the buffer of the current tick.
-
Constructor Details
-
MovementTrace
-
-
Method Details
-
begin
public void begin()Starts a new tick. Moves the lines of the previous tick into the history, then records a snapshot of the state the prediction starts from. -
log
Adds one line to the buffer of the current tick. -
dump
Builds the full trace text: the reason, the retained history, and the current tick. Clears the history afterwards. The current tick keeps collecting lines until the nextbegin()call, so steps after the failure still get recorded. -
flush
Writes the trace to the log as one message.
-