25w22a Fix unicode usernames and remove restrictions in bungee

This commit is contained in:
catfoolyou
2025-05-30 08:18:21 -04:00
parent f6c573ff2c
commit 0e477da14f
16 changed files with 42206 additions and 42288 deletions

View File

@@ -122,16 +122,18 @@ public class InitialHandler extends PacketHandler implements PendingConnection {
}
String un = handshake.getUsername();
if (un.length() < 3) {
this.disconnect("Username must be at least 3 characters");
return;
System.err.println("Username is under 3 characters!");
// this.disconnect("Username must be at least 3 characters");
// return;
}
if (un.length() > 16) {
this.disconnect("Cannot have username longer than 16 characters");
return;
}
if(!un.equals(un.replaceAll("[^A-Za-z0-9\\-_]", "_").trim())) {
this.disconnect("Go fuck yourself");
return;
System.err.println("Potentially invalid unicode username detected");
// this.disconnect("Go fuck yourself");
// return;
}
if (BungeeCord.getInstance().tokenVerify.isEmpty()) {
String hostname = handshake.getHost();