Block really wrong offline mode names, see #1270

This commit is contained in:
md_5 2014-11-08 10:04:59 +11:00
parent 56c372a3ce
commit 532a94382b
2 changed files with 7 additions and 0 deletions

View File

@ -268,6 +268,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection
return; return;
} }
if ( getName().contains( "." ) )
{
disconnect( bungee.getTranslation( "name_invalid" ) );
return;
}
if ( getName().length() > 16 ) if ( getName().length() > 16 )
{ {
disconnect( bungee.getTranslation( "name_too_long" ) ); disconnect( bungee.getTranslation( "name_too_long" ) );

View File

@ -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 server_went_down=\u00a7cThe server you were previously on went down, you have been connected to the lobby
total_players=Total players online: {0} total_players=Total players online: {0}
name_too_long=Cannot have username longer than 16 characters 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. ping_cannot_connect=\u00a7c[Bungee] Can't connect to server.