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 42137ad0..cdf00ecf 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 @@ -268,6 +268,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } + if ( getName().contains( "." ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; + } + if ( getName().length() > 16 ) { disconnect( bungee.getTranslation( "name_too_long" ) ); diff --git a/proxy/src/main/resources/messages.properties b/proxy/src/main/resources/messages.properties index c01a052b..2e613ea2 100644 --- a/proxy/src/main/resources/messages.properties +++ b/proxy/src/main/resources/messages.properties @@ -21,4 +21,5 @@ server_list=\u00a76You may connect to the following servers at this time: server_went_down=\u00a7cThe server you were previously on went down, you have been connected to the lobby total_players=Total players online: {0} name_too_long=Cannot have username longer than 16 characters +name_invalid=Username contains invalid characters. ping_cannot_connect=\u00a7c[Bungee] Can't connect to server.