mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-01 05:27:47 +01:00
cca83dfaf6
Upstream has released updates that appears 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: a3ab2bf5 Update checkstyle adee7bd2 Source jar does not need to fork build 7bd8a027 Always print remote IP in InitialHandler 0cf27a09 Update scriptus bf673c5d Add pretty colours to console log levels 2235a323 Optimize ColouredWriter slightly 1dee0490 Don't send/construct redundant kick messages e9ba95b9 Don't log full CorruptedFrameException d3bd7852 #2762: Work correctly with disabled timeout 3ce4132c Switch keepalive queue to ArrayDeque ce2dcaf7 #2763: Fix .DS_Store entry in .gitignore cf72c3a7 Show slow event times in milliseconds cd7a3ab2 #2758: Improve server list ping response where remote ping failed 0a4b9b49 #2752: Configurable connect and ping timeouts
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 5492c19431ddf229e50c190378ec25c5b5ab7804 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 1109a9b5..5c692ef2 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
|
|
@@ -277,10 +277,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.25.0
|
|
|