mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-11-24 19:25:16 +01:00
e1553a3f25
Since Waterfall is now using Log4J for logging, these patches no longer have any effect.
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 7d3827b6b64dacf956782ac40a0897f065f05f8c 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 7ab4d042..bf450f98 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
|
|
@@ -247,10 +247,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.14.1
|
|
|