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 f9cf9ff1..57f5eebd 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 @@ -10,6 +10,7 @@ import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; import javax.crypto.Cipher; import javax.crypto.SecretKey; import lombok.Getter; @@ -128,6 +129,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Packet2Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); + this.handshake = handshake; + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + if ( handshake.getUsername().length() > 16 ) { disconnect( "Cannot have username longer than 16 characters" ); @@ -148,7 +152,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } - this.handshake = handshake; unsafe().sendPacket( PacketConstants.I_AM_BUNGEE ); unsafe().sendPacket( PacketConstants.FORGE_MOD_REQUEST ); unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index f0519739..ad26c567 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -6,8 +6,12 @@ import io.netty.channel.ChannelInboundMessageHandlerAdapter; import io.netty.handler.timeout.ReadTimeoutException; import java.io.IOException; import java.util.logging.Level; +import net.md_5.bungee.ServerConnector; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; +import net.md_5.bungee.connection.DownstreamBridge; +import net.md_5.bungee.connection.InitialHandler; +import net.md_5.bungee.connection.UpstreamBridge; /** * This class is a primitive wrapper for {@link PacketHandler} instances tied to @@ -33,7 +37,11 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter { channel = new ChannelWrapper( ctx.channel() ); handler.connected( channel ); - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + + if ( !( handler instanceof InitialHandler ) ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + } } } @@ -42,8 +50,12 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter { if ( handler != null ) { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); handler.disconnected( channel ); + + if ( !( handler instanceof InitialHandler ) ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); + } } }