add early whitelist kick

This commit is contained in:
Sen 2025-06-04 16:14:16 +02:00
parent 0732d9edff
commit a429447754
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
2 changed files with 9 additions and 0 deletions

View file

@ -98,6 +98,7 @@ public class Proxy {
private boolean epoll = false;
private boolean register = true;
private boolean checkCase = true;
private boolean kickOnConnect = true;
private String forwardHost = "127.0.0.1";
private int forwardPort = 25565;
private String proxyHost = "";
@ -362,6 +363,10 @@ public class Proxy {
public boolean isCheckingCase() {
return this.checkCase;
}
public boolean isKickingOnConnect() {
return this.kickOnConnect;
}
public int getMinimumPasswordLength() {
return this.minPassLength;

View file

@ -54,6 +54,10 @@ public class LoginHandler implements Handler {
this.disconnect("That username is already taken");
return;
}
else if(this.proxy.isKickingOnConnect() && !this.proxy.canRegister() && this.proxy.getUser(this.username) == null) {
this.disconnect("You are not whitelisted on this server");
return;
}
this.state = LoginState.DONE;
if(this.proxy.getCompression() >= 0) {