From 5f29e939b09a286cc85d07cd0cd90484cb5a99a6 Mon Sep 17 00:00:00 2001 From: Janmm14 Date: Sun, 5 Jan 2020 11:02:05 +1100 Subject: [PATCH] #2720: Send different log message for pings (vs login) --- .../net/md_5/bungee/connection/InitialHandler.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index db1ad8e6..18c9fa6f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -295,10 +295,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } 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 ) ); @@ -306,15 +302,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping + if ( bungee.getConfig().isLogPings() ) + { + bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); + } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); break; case 2: // 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; ch.setProtocol( Protocol.LOGIN );