Waterfall/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch

33 lines
1.3 KiB
Diff
Raw Normal View History

2022-02-19 16:21:14 +01:00
From b38fb97cbf65ca5dc17ae20774c3036622b54754 Mon Sep 17 00:00:00 2001
2020-12-16 11:38:57 +01:00
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
2022-02-19 16:21:14 +01:00
index b402d1d3..47440b2c 100644
2020-12-16 11:38:57 +01: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
2022-02-19 16:21:14 +01:00
@@ -464,6 +464,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
2020-12-16 11:44:19 +01:00
{
Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" );
2021-02-26 02:46:21 +01:00
2020-12-16 11:44:19 +01:00
+ // FlameCord - Finish here to avoid multiple incoming packets
2021-10-01 03:27:34 +02:00
+ thisState = State.FINISHING;
2020-12-16 11:44:19 +01:00
SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
2021-02-24 07:43:19 +01:00
// Waterfall start
2021-02-26 02:46:21 +01:00
if (sharedKey instanceof SecretKeySpec) {
2022-02-19 16:21:14 +01:00
@@ -523,6 +525,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection
2020-12-16 11:38:57 +01:00
private void finish()
{
+ // FlameCord - Finish here to avoid multiple incoming packets
2021-10-01 03:27:34 +02:00
+ thisState = State.FINISHING;
2020-12-16 11:38:57 +01:00
+
if ( isOnlineMode() )
{
// Check for multiple connections
--
2021-12-30 03:02:28 +01:00
2.32.0
2020-12-16 11:38:57 +01:00