Waterfall/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch
2021-02-26 09:46:21 +08:00

33 lines
1.2 KiB
Diff

From 355853706ca50aba3dc231b6adee5f5e8bd58548 Mon Sep 17 00:00:00 2001
From: foss-mc <69294560+foss-mc@users.noreply.github.com>
Date: Wed, 16 Dec 2020 18:25:51 +0800
Subject: [PATCH] Don't allow name containing dot
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
index 037a305b..c6dfa00f 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
@@ -404,13 +404,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
this.loginRequest = loginRequest;
- if ( getName().contains( "." ) )
+ // FlameCord - Use name
+ final String name = getName();
+
+ if ( name.contains( "." ) )
{
disconnect( bungee.getTranslation( "name_invalid" ) );
return;
}
- if ( getName().length() > 16 )
+ if ( name.length() > 16 )
{
disconnect( bungee.getTranslation( "name_too_long" ) );
return;
--
2.20.1