From b87fff2614f90607c4af096cf454dbbd5bfdd66d Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 12 Apr 2013 12:43:17 +1000 Subject: [PATCH] Fix users being disconnected without the event q_q --- .../java/net/md_5/bungee/connection/InitialHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 fdf61746..a1086815 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 @@ -57,6 +57,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection private PacketFDEncryptionRequest request; private List loginMessages = new ArrayList<>(); private State thisState = State.HANDSHAKE; + private boolean disconnected; private enum State { @@ -184,6 +185,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { disconnect( event.getCancelReason() ); } + if ( disconnected ) + { + return; + } Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, shared ); Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, shared ); @@ -223,6 +228,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { ch.write( new PacketFFKick( reason ) ); ch.close(); + disconnected = true; } }