mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-11-06 18:51:21 +01:00
33 lines
1.2 KiB
Diff
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
|
|
|