Skip to content

Commit

Permalink
Fix connection state crash
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Dec 20, 2023
1 parent 83450a2 commit b253bb7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/ac/grim/grimac/player/GrimPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,9 @@ public void sendTransaction() {
}

public void sendTransaction(boolean async) {
// don't send transactions in configuration phase
if (user.getDecoderState() == ConnectionState.CONFIGURATION) return;
// don't send transactions outside PLAY phase
// Sending in non-play corrupts the pipeline, don't waste bandwidth when anticheat disabled
if (user.getConnectionState() != ConnectionState.PLAY) return;
if (user.getEncoderState() != ConnectionState.PLAY) return;

// Send a packet once every 15 seconds to avoid any memory leaks
if (disableGrim && (System.nanoTime() - getPlayerClockAtLeast()) > 15e9) {
Expand Down

0 comments on commit b253bb7

Please sign in to comment.