From 19b4c09a1618123deb391dfe2bee0c1fd84d0064 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 1 Feb 2014 10:36:10 +1100 Subject: [PATCH] Remove unused fields --- .../java/net/md_5/bungee/connection/InitialHandler.java | 9 ++------- 1 file changed, 2 insertions(+), 7 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 6d0da0559..a2bb7c573 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 @@ -33,7 +33,6 @@ import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.netty.cipher.CipherDecoder; import net.md_5.bungee.netty.cipher.CipherEncoder; import net.md_5.bungee.protocol.DefinedPacket; -import net.md_5.bungee.protocol.packet.Login; import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.EncryptionResponse; import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -59,14 +58,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Getter private final ListenerInfo listener; @Getter - private Login forgeLogin; - @Getter private Handshake handshake; @Getter private LoginRequest loginRequest; private EncryptionRequest request; private State thisState = State.HANDSHAKE; - private SecretKey sharedKey; private final Unsafe unsafe = new Unsafe() { @Override @@ -79,7 +75,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection private boolean onlineMode = BungeeCord.getInstance().config.isOnlineMode(); @Getter private InetSocketAddress virtualHost; - private byte version = -1; @Getter private String UUID; @@ -279,7 +274,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); - sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); ch.addBefore( PipelineUtils.FRAME_DECODER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) ); BungeeCipher encrypt = EncryptionUtil.getCipher( true, sharedKey ); @@ -428,7 +423,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public int getVersion() { - return ( handshake == null ) ? version : handshake.getProtocolVersion(); + return ( handshake == null ) ? -1 : handshake.getProtocolVersion(); } @Override