Waterfall/BungeeCord-Patches/0019-Add-a-property-to-accept-invalid-ping-packets.patch
LinsaFTW 1efb2d439e
Updated Upstream (BungeeCord) (#844)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
d0fa62d4 Minecraft 24w06a support
464ed018 Improve cookie support during login
eda268b4 Fix 24w05b spectate packet ID
3e100752 #3612: Error when disconnecting player on PostLoginEvent
b52b1469 Add PendingConnection#isTransferred API method
94d5b0d0 Minecraft 24w05b support
c3f228f6 #3610, 3611: inverted isEmpty method on ComponentStyle
02c5c1ee #3602: Minecraft 24w04a support
c69acf72 Add JetBrains java-annotations
a1cd6943 Bump version to 1.20-R0.3-SNAPSHOT
3e2bc8e2 Release 1.20-R0.2
ad7163d2 #3600: Bump io.netty:netty-bom from 4.1.104.Final to 4.1.106.Final
2024-02-24 17:21:31 +00:00

34 lines
1.4 KiB
Diff

From 10ab9f8cff10028bd518507ce3a122897f32d202 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Sun, 7 Feb 2016 00:01:19 -0700
Subject: [PATCH] Add a property to accept invalid ping packets
This is disabled by default, as I don't wanna accept invalid packets
You can enable it by setting '-Dwaterfall.acceptInvalidPackets=true' at the command line
Fixes #23
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 4325fe23..b7dd5fe3 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
@@ -323,10 +323,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
thisState = State.PING;
}
+ private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false"));
+
@Override
public void handle(PingPacket ping) throws Exception
{
- Preconditions.checkState( thisState == State.PING, "Not expecting PING" );
+ if (!ACCEPT_INVALID_PACKETS) {
+ Preconditions.checkState(thisState == State.PING, "Not expecting PING");
+ }
unsafe.sendPacket( ping );
disconnect( "" );
}
--
2.43.0.windows.1