Skip to content

Commit

Permalink
Do not send packets while client in configuration state.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leymooo committed Aug 22, 2024
1 parent e249b4f commit ef5fd5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion proxy/src/main/java/ru/leymooo/botfilter/Connector.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -90,6 +92,7 @@ public Connector(UserConnection userConnection, BotFilter botFilter)

public void spawn()
{
checkStarted = true;
this.botFilter.incrementBotCounter();
if ( !Settings.IMP.PROTECTION.ALWAYS_CHECK )
{
Expand Down Expand Up @@ -413,10 +416,11 @@ public void sendMessage(int index)
PacketUtils.messages[index].write( getChannel(), getVersion() );
}


@Override
public String toString()
{
return "[" + name + "|" + ip + "] <-> BotFilter";
}


}

0 comments on commit ef5fd5d

Please sign in to comment.