diff --git a/proxy/src/main/java/net/md_5/bungee/EncryptionUtil.java b/proxy/src/main/java/net/md_5/bungee/EncryptionUtil.java index 9cc2140d..eb7fe4f1 100644 --- a/proxy/src/main/java/net/md_5/bungee/EncryptionUtil.java +++ b/proxy/src/main/java/net/md_5/bungee/EncryptionUtil.java @@ -40,9 +40,9 @@ public class EncryptionUtil } } - public static EncryptionRequest encryptRequest(boolean onlinemode) + public static EncryptionRequest encryptRequest() { - String hash = ( onlinemode ) ? Long.toString( random.nextLong(), 16 ) : "-"; + String hash = Long.toString( random.nextLong(), 16 ); byte[] pubKey = keys.getPublic().getEncoded(); byte[] verify = new byte[ 4 ]; random.nextBytes( verify ); 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 67234e8d..89f9d299 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 @@ -1,8 +1,6 @@ package net.md_5.bungee.connection; import com.google.common.base.Preconditions; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.URLEncoder; @@ -249,7 +247,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection // TODO: Nuuuu Mojang why u do this // unsafe().sendPacket( PacketConstants.I_AM_BUNGEE ); // unsafe().sendPacket( PacketConstants.FORGE_MOD_REQUEST ); - unsafe().sendPacket( request = EncryptionUtil.encryptRequest( this.onlineMode ) ); + if ( this.onlineMode ) + { + unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); + } else + { + finish(); + } thisState = State.ENCRYPT; }