Updated Upstream (BungeeCord)

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:
6f7331e8 #3138, 3140: Check for the new leak detector netty flag
1b489bcc Attempt to fix java 8 native crash
da27924a #3115, #3125: Update natives build script, switch to Cloudflare zlib
15b39887 #3133: Directly disconnect on illegal chars
f9583a76 #3129: Replace ConnectTimeoutException with a more user-friendly string.
cb738188 #3126: Use suppliers instead of reflection for native impl generation.
a8b2f526 #3123: Apply exact vanilla string length limits for tab completion
ad50fc9a #3111: Check chat for illegal chars & moved length check into the packet class
This commit is contained in:
Thomas A 2021-07-03 01:00:48 +02:00
parent 66601f7a2c
commit ee819df91f
10 changed files with 1211 additions and 349 deletions

@ -1 +1 @@
Subproject commit a25c2b325b021061936640f3fbc236ed8e4512c0
Subproject commit 6f7331e852792224ef9e22a9f96fa54400ee417f

View File

@ -1,4 +1,4 @@
From de6b5ced51ba9b31d9c26aa9aea7224434b365cc Mon Sep 17 00:00:00 2001
From 5b984fcf1ad62ff4f57218bf4e79fc4458ee6633 Mon Sep 17 00:00:00 2001
From: Daniel Naylor <git@drnaylor.co.uk>
Date: Tue, 25 Oct 2016 12:23:07 -0400
Subject: [PATCH] Add support for FML with IP Forwarding enabled
@ -67,10 +67,10 @@ index 795ba6b6..2762aede 100644
}
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 7b5ec49b..cb722d78 100644
index 5713c127..8979ac22 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -166,8 +166,12 @@ public final class UserConnection implements ProxiedPlayer
@@ -167,8 +167,12 @@ public final class UserConnection implements ProxiedPlayer
forgeClientHandler = new ForgeClientHandler( this );
@ -100,5 +100,5 @@ index 6dca2048..f5253b89 100644
* The FML 1.8 handshake token.
*/
--
2.31.1.windows.1
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From 1bdda79d53b7b37044cf10f1090df656342aabef Mon Sep 17 00:00:00 2001
From 2129b8a17d2352058ee2cb5142c99e4023d3d90c Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Thu, 19 May 2016 17:09:22 -0600
Subject: [PATCH] Allow invalid packet ids for forge servers
@ -93,10 +93,10 @@ index 2762aede..a8516462 100644
ch.write( BungeeCord.getInstance().registerChannels( user.getPendingConnection().getVersion() ) );
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index ed0a12c5..dcdf94c9 100644
index 8979ac22..d4348eb7 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -72,6 +72,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -73,6 +73,7 @@ public final class UserConnection implements ProxiedPlayer
@NonNull
private final ProxyServer bungee;
@NonNull
@ -122,5 +122,5 @@ index 93989ee9..2e6cf764 100644
{
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
--
2.32.0
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From 7ec9385c6596308ff25a88e8f9aecacce695d2a5 Mon Sep 17 00:00:00 2001
From 45185a344a8b4fbda30ac113ded14f02b03811d0 Mon Sep 17 00:00:00 2001
From: Johannes Donath <johannesd@torchmind.com>
Date: Sat, 4 Jul 2015 06:31:33 +0200
Subject: [PATCH] Add basic support for configurable tab-complete throttling
@ -73,7 +73,7 @@ index 741ebfde..91743f01 100644
+ }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index f150d8fa..49fec0d7 100644
index c21bdefa..f88831f7 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -39,6 +39,8 @@ public class UpstreamBridge extends PacketHandler
@ -85,7 +85,7 @@ index f150d8fa..49fec0d7 100644
public UpstreamBridge(ProxyServer bungee, UserConnection con)
{
this.bungee = bungee;
@@ -162,6 +164,20 @@ public class UpstreamBridge extends PacketHandler
@@ -170,6 +172,20 @@ public class UpstreamBridge extends PacketHandler
@Override
public void handle(TabCompleteRequest tabComplete) throws Exception
{
@ -107,5 +107,5 @@ index f150d8fa..49fec0d7 100644
if ( tabComplete.getCursor().startsWith( "/" ) )
--
2.24.0
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From 2137593b8852107c9195a5f0995d53fb9499f0b8 Mon Sep 17 00:00:00 2001
From 29c9763b3b26e4a32d8f8ef1a4fd57c32a66a693 Mon Sep 17 00:00:00 2001
From: Janmm14 <computerjanimaus@yahoo.de>
Date: Sat, 12 Dec 2015 23:43:30 +0100
Subject: [PATCH] Improve server list ping logging
@ -57,10 +57,10 @@ index 1f91fe92..b99856fb 100644
@Override
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index 49fec0d7..a2f36f23 100644
index f88831f7..a667623b 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -276,6 +276,6 @@ public class UpstreamBridge extends PacketHandler
@@ -284,6 +284,6 @@ public class UpstreamBridge extends PacketHandler
@Override
public String toString()
{
@ -69,5 +69,5 @@ index 49fec0d7..a2f36f23 100644
}
}
--
2.31.1.windows.1
2.30.1 (Apple Git-130)

View File

@ -1,57 +1,33 @@
From 76e7f32f689d050b70f77d3a28f41e86f242890a Mon Sep 17 00:00:00 2001
From efb082580161b889b88e5351ba25a1084ab618f1 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Tue, 25 Oct 2016 12:34:41 -0400
Subject: [PATCH] Validate that chat messages are non-blank
diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/StringUtil.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/StringUtil.java
new file mode 100644
index 00000000..940ad806
--- /dev/null
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/StringUtil.java
@@ -0,0 +1,22 @@
+package io.github.waterfallmc.waterfall;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public class StringUtil {
+ public static boolean isBlank(String str) {
+ if (str.isEmpty()) {
+ return true;
+ }
+
+ int l = str.length();
+ for (int i = 0; i < l; i++) {
+ if (!Character.isWhitespace(str.charAt(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index a2f36f23..4d7b1b23 100644
index a667623b..d93d8851 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import com.mojang.brigadier.context.StringRange;
import com.mojang.brigadier.suggestion.Suggestion;
import com.mojang.brigadier.suggestion.Suggestions;
+import io.github.waterfallmc.waterfall.StringUtil;
import io.netty.channel.Channel;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -148,6 +149,7 @@ public class UpstreamBridge extends PacketHandler
@@ -146,6 +146,7 @@ public class UpstreamBridge extends PacketHandler
@Override
public void handle(Chat chat) throws Exception
{
int maxLength = ( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_11 ) ? 256 : 100;
Preconditions.checkArgument( chat.getMessage().length() <= maxLength, "Chat message too long" ); // Mojang limit, check on updates
+ Preconditions.checkArgument(!StringUtil.isBlank(chat.getMessage()), "Chat message is empty");
+ boolean empty = true;
for ( int index = 0, length = chat.getMessage().length(); index < length; index++ )
{
char c = chat.getMessage().charAt( index );
@@ -154,8 +155,11 @@ public class UpstreamBridge extends PacketHandler
{
con.disconnect( bungee.getTranslation( "illegal_chat_characters", String.format( "\\u%04x", (int) c ) ) );
throw CancelSendSignal.INSTANCE;
+ } else if (empty && !Character.isWhitespace(c)) {
+ empty = false;
}
}
+ Preconditions.checkArgument(!empty, "Chat message is empty");
ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
--
2.24.0
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From 2c6678f66fe499d028b4478a45df4001841e9058 Mon Sep 17 00:00:00 2001
From c730e09faaa438333ef13935f08a44097f947562 Mon Sep 17 00:00:00 2001
From: Ichbinjoe <joe@ibj.io>
Date: Sat, 16 Jul 2016 20:44:01 -0400
Subject: [PATCH] Add timeout variant to connect methods
@ -75,10 +75,10 @@ index 29a4716f..3dc32801 100644
* Connects / transfers this user to the specified connection, gracefully
* closing the current one. Depending on the implementation, this method
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index b0e7e392..5e4c4518 100644
index d4348eb7..a8f4378e 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -257,9 +257,20 @@ public final class UserConnection implements ProxiedPlayer
@@ -258,9 +258,20 @@ public final class UserConnection implements ProxiedPlayer
public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason)
{
@ -99,7 +99,7 @@ index b0e7e392..5e4c4518 100644
if ( callback != null )
{
// Convert the Callback<Boolean> to be compatible with Callback<Result> from ServerConnectRequest.
@@ -353,7 +364,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -354,7 +365,7 @@ public final class UserConnection implements ProxiedPlayer
if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) )
{
sendMessage( bungee.getTranslation( "fallback_lobby" ) );
@ -107,7 +107,7 @@ index b0e7e392..5e4c4518 100644
+ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout() ); // Waterfall
} else if ( dimensionChange )
{
disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) );
disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) );
--
2.31.1
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From ad9cce2866823d6344b9682f395d9687c45e45d5 Mon Sep 17 00:00:00 2001
From 307d071abd19cfe07b7bb9f90bac7ca9b24737fd Mon Sep 17 00:00:00 2001
From: Aaron Hill <aa1ronham@gmail.com>
Date: Thu, 15 Sep 2016 22:38:37 +0200
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
@ -173,7 +173,7 @@ index 00000000..7ed2dc3a
+ }
+}
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index e677e032..f804ae3a 100644
index a8f4378e..95dc97b9 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -1,7 +1,9 @@
@ -186,7 +186,7 @@ index e677e032..f804ae3a 100644
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
@@ -124,6 +126,10 @@ public final class UserConnection implements ProxiedPlayer
@@ -125,6 +127,10 @@ public final class UserConnection implements ProxiedPlayer
private final Scoreboard serverSentScoreboard = new Scoreboard();
@Getter
private final Collection<UUID> sentBossBars = new HashSet<>();
@ -281,5 +281,5 @@ index d15044f4..bea2bbff 100644
* Sends the server mod list to the client, or stores it for sending later.
*
--
2.32.0
2.30.1 (Apple Git-130)

View File

@ -1,4 +1,4 @@
From 4c120e1cb0579c52efcbaf85f281f770efaf21aa Mon Sep 17 00:00:00 2001
From 397d497cb913737fd6190775efae10b55a48f109 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 14 Jan 2019 03:35:21 +0000
Subject: [PATCH] Provide an option to disable entity metadata rewriting
@ -123,10 +123,10 @@ index 84e93b38..a5efb0af 100644
if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 )
{
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index c3cc914d..01075a85 100644
index 95dc97b9..fc98b4b1 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -756,4 +756,10 @@ public final class UserConnection implements ProxiedPlayer
@@ -768,4 +768,10 @@ public final class UserConnection implements ProxiedPlayer
{
return serverSentScoreboard;
}
@ -234,5 +234,5 @@ index 00000000..cb81d1dd
+// Waterfall end
\ No newline at end of file
--
2.31.1.windows.1
2.30.1 (Apple Git-130)

File diff suppressed because it is too large Load Diff