2016-08-28 22:23:49 +02:00
|
|
|
From 4167f0bdc2fc9c5937241e90f1e748d9af493f21 Mon Sep 17 00:00:00 2001
|
2016-06-06 21:37:58 +02:00
|
|
|
From: Techcable <Techcable@techcable.net>
|
|
|
|
Date: Mon, 6 Jun 2016 13:36:10 -0600
|
|
|
|
Subject: [PATCH] Don't send KICK packets while in HANDSHAKE state
|
|
|
|
|
|
|
|
Use a switch statement for checking the state (best practice when you have lots of cases)
|
|
|
|
|
|
|
|
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
|
2016-08-28 22:23:49 +02:00
|
|
|
index 9d139c6..7a4c392 100644
|
2016-06-06 21:37:58 +02:00
|
|
|
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
|
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
2016-06-29 19:57:03 +02:00
|
|
|
@@ -540,10 +540,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
2016-06-06 21:37:58 +02:00
|
|
|
{
|
|
|
|
if ( !ch.isClosed() && disconnecting.compareAndSet(false, true) )
|
|
|
|
{
|
|
|
|
- if ( thisState != State.STATUS && thisState != State.PING ) {
|
|
|
|
- ch.close( new Kick( ComponentSerializer.toString( reason ) ) );
|
|
|
|
- } else {
|
|
|
|
- ch.close();
|
|
|
|
+ switch (thisState) {
|
|
|
|
+ default:
|
|
|
|
+ ch.close(new Kick(ComponentSerializer.toString(reason)));
|
|
|
|
+ break;
|
|
|
|
+ case STATUS:
|
|
|
|
+ case PING:
|
|
|
|
+ case HANDSHAKE:
|
|
|
|
+ ch.close();
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2016-08-28 22:23:49 +02:00
|
|
|
2.7.4
|
2016-06-06 21:37:58 +02:00
|
|
|
|