#2720: Send different log message for pings (vs login)

This commit is contained in:
Janmm14 2020-01-05 11:02:05 +11:00 committed by md_5
parent 465215686b
commit 5f29e939b0

View File

@ -295,10 +295,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection
} }
this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
if ( bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
@ -306,15 +302,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection
{ {
case 1: case 1:
// Ping // Ping
if ( bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has pinged", this );
}
thisState = State.STATUS; thisState = State.STATUS;
ch.setProtocol( Protocol.STATUS ); ch.setProtocol( Protocol.STATUS );
break; break;
case 2: case 2:
// Login // Login
if ( !bungee.getConfig().isLogPings() ) bungee.getLogger().log( Level.INFO, "{0} has connected", this );
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}
thisState = State.USERNAME; thisState = State.USERNAME;
ch.setProtocol( Protocol.LOGIN ); ch.setProtocol( Protocol.LOGIN );