mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-22 15:41:37 +01:00
dc0595653d
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: c92581d0 #3556: Deserialize arrays to single components e442c3da #3546: Add string length checks to isValidName f903c54d #3554: Bump org.apache.maven.plugins:maven-checkstyle-plugin 0d453789 #3540: Add TextComponent#fromLegacy() as an array-free alternative to #fromLegacyText() 0f5f09b6 Minecraft 23w43b support e5c80d00 Fix code formatting 9cdb2ba3 Deprecate exposed scoreboard API d0e5cf7c #3549: Bump io.netty:netty-bom from 4.1.99.Final to 4.1.100.Final c8568764 Fix writing non-compound root NBT tags
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 3cebec2175678a2c7351368beffa2b8e09fb4025 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 9a6a305b..300d90f4 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
|
|
@@ -300,10 +300,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.42.0
|
|
|