#1862: Support 1.7 pings

This commit is contained in:
md_5
2016-05-15 14:52:01 +10:00
parent a12ac37cc3
commit 41621193ec
2 changed files with 26 additions and 14 deletions

View File

@@ -293,6 +293,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection
thisState = State.USERNAME;
ch.setProtocol( Protocol.LOGIN );
if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) )
{
disconnect( bungee.getTranslation( "outdated_server" ) );
return;
}
if ( bungee.getConnectionThrottle() != null && bungee.getConnectionThrottle().throttle( getAddress().getAddress() ) )
{
disconnect( bungee.getTranslation( "join_throttle_kick", TimeUnit.MILLISECONDS.toSeconds( bungee.getConfig().getThrottle() ) ) );
@@ -309,12 +315,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
this.loginRequest = loginRequest;
if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) )
{
disconnect( bungee.getTranslation( "outdated_server" ) );
return;
}
if ( getName().contains( "." ) )
{
disconnect( bungee.getTranslation( "name_invalid" ) );