Waterfall/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch
2021-12-29 23:02:28 -03:00

33 lines
1.3 KiB
Diff

From 7580742f7c57391982e8d50f5ece95351d494560 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 ea4f37c5..6018dccf 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
@@ -466,6 +466,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) {
@@ -525,6 +527,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