Fix outdatedness

This commit is contained in:
md_5 2013-10-19 17:50:54 +11:00
parent 00854988fb
commit da5fa4bb7c

View File

@ -193,14 +193,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() )
{
disconnect( bungee.getTranslation( "outdated_server" ) );
} else if ( handshake.getProtocolVersion() < bungee.getProtocolVersion() )
{
disconnect( bungee.getTranslation( "outdated_client" ) );
}
switch ( handshake.getRequestedProtocol() ) switch ( handshake.getRequestedProtocol() )
{ {
case 1: case 1:
@ -224,6 +216,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
this.loginRequest = loginRequest; this.loginRequest = loginRequest;
if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() )
{
disconnect( bungee.getTranslation( "outdated_server" ) );
return;
} else if ( handshake.getProtocolVersion() < bungee.getProtocolVersion() )
{
disconnect( bungee.getTranslation( "outdated_client" ) );
return;
}
if ( getName().length() > 16 ) if ( getName().length() > 16 )
{ {
disconnect( "Cannot have username longer than 16 characters" ); disconnect( "Cannot have username longer than 16 characters" );