From ef5fd5d1d768da26fd65cacf1a2676b509f804bf Mon Sep 17 00:00:00 2001 From: Leymooo Date: Fri, 23 Aug 2024 02:01:39 +0300 Subject: [PATCH] Do not send packets while client in configuration state. --- .../main/java/ru/leymooo/botfilter/BotFilterThread.java | 9 ++++++++- proxy/src/main/java/ru/leymooo/botfilter/Connector.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java index 0ff8233463..6205b29042 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java @@ -53,7 +53,14 @@ public static void start() ? "Too long fall check" : "Captcha not entered" ); TO_REMOVE_SET.add( entryset.getKey() ); continue; - } else if ( state == BotFilter.CheckState.CAPTCHA_ON_POSITION_FAILED || state == BotFilter.CheckState.ONLY_POSITION ) + } + + if ( !connector.isCheckStarted() ) + { + continue; + } + + if ( state == BotFilter.CheckState.CAPTCHA_ON_POSITION_FAILED || state == BotFilter.CheckState.ONLY_POSITION ) { connector.sendMessage( PacketsPosition.CHECKING_MSG ); } else diff --git a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java index 580f886094..8f9e4f379f 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java @@ -68,6 +68,8 @@ public class Connector extends MoveHandler private long lastSend = 0, totalping = 9999; private boolean markDisconnected = false; private int pluginMessagesBytes = 0; + @Getter + private boolean checkStarted; public Connector(UserConnection userConnection, BotFilter botFilter) { @@ -90,6 +92,7 @@ public Connector(UserConnection userConnection, BotFilter botFilter) public void spawn() { + checkStarted = true; this.botFilter.incrementBotCounter(); if ( !Settings.IMP.PROTECTION.ALWAYS_CHECK ) { @@ -413,10 +416,11 @@ public void sendMessage(int index) PacketUtils.messages[index].write( getChannel(), getVersion() ); } - @Override public String toString() { return "[" + name + "|" + ip + "] <-> BotFilter"; } + + }