Waterfall/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch
2021-09-30 22:27:34 -03:00

33 lines
1.4 KiB
Diff

From 7824c3357547e77f9e307d2fcdd19e1122a7bcd8 Mon Sep 17 00:00:00 2001
From: foss-mc <69294560+foss-mc@users.noreply.github.com>
Date: Wed, 16 Dec 2020 18:36:08 +0800
Subject: [PATCH] Finish early to avoid multiple incoming packets
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 6a9f1bd8e..674b3ead8 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
@@ -467,6 +467,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
{
Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" );
+ // FlameCord - Finish here to avoid multiple incoming packets
+ thisState = State.FINISHING;
SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
// Waterfall start
if (sharedKey instanceof SecretKeySpec) {
@@ -526,6 +528,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection
private void finish()
{
+ // FlameCord - Finish here to avoid multiple incoming packets
+ thisState = State.FINISHING;
+
if ( isOnlineMode() )
{
// Check for multiple connections
--
2.32.0.windows.1