Skip to content

Commit

Permalink
Merge pull request #1258 from SamB440/fix/connection-state-crash
Browse files Browse the repository at this point in the history
Fix connection state crash
  • Loading branch information
AoElite authored Dec 20, 2023
2 parents 83450a2 + b253bb7 commit 055e0d9
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 055e0d9

Please sign in to comment.