Correctly show outdated_client and outdated_server messages

If the client protocol version is not supported, show outdated_server message only if client version is higher than highest supported protocol version, outdated_client message else.
This commit is contained in:
BlackHole 2016-05-15 18:59:41 +02:00 committed by md_5
parent 507a98f28f
commit 1250088f98

View File

@ -294,8 +294,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
ch.setProtocol( Protocol.LOGIN ); ch.setProtocol( Protocol.LOGIN );
if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) )
{
if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() )
{ {
disconnect( bungee.getTranslation( "outdated_server" ) ); disconnect( bungee.getTranslation( "outdated_server" ) );
} else
{
disconnect( bungee.getTranslation( "outdated_client" ) );
}
return; return;
} }