Skip to content

Commit f351923

Browse files
authored
Updated Upstream (BungeeCord) (#862)
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: 7c7cb3de Minecraft 1.21.7 support 88436c44 #3854: Fix CustomClickAction read and write implementation bdd32d5a #3808: Do not decode packets that we don't handle 5e59b6dc #3851: Remove output from tests and "base" from dialog json bccce74c #3799, #3800: Do not parse the collision and visibility strings of the Team packet 0e9e0b58 #3850: Prevent some jdk24+ memory/native access warnings
1 parent fd047f1 commit f351923

12 files changed

+64
-87
lines changed

BungeeCord-Patches/0001-POM-Changes.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From f2af2b8bab3ef918c1fc4664c5f921a77351770c Mon Sep 17 00:00:00 2001
1+
From cf1b3133971d590e1e2ef2a51bc5f1931bc6b5de Mon Sep 17 00:00:00 2001
22
From: Tux <[email protected]>
33
Date: Thu, 19 May 2016 19:33:31 +0200
44
Subject: [PATCH] POM Changes
@@ -75,7 +75,7 @@ index bc3de477..74a835d1 100644
7575
<scope>compile</scope>
7676
</dependency>
7777
diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml
78-
index b54ca5bf..061f7765 100644
78+
index 5a8b37b0..3d5f497f 100644
7979
--- a/bootstrap/pom.xml
8080
+++ b/bootstrap/pom.xml
8181
@@ -4,39 +4,40 @@
@@ -138,7 +138,7 @@ index b54ca5bf..061f7765 100644
138138
+ <Main-Class>net.md_5.bungee.Bootstrap</Main-Class>
139139
<Implementation-Version>${describe}</Implementation-Version>
140140
<Specification-Version>${maven.build.timestamp}</Specification-Version>
141-
</manifestEntries>
141+
<Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access>
142142
diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java
143143
index 6be22739..a4516ed9 100644
144144
--- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java
@@ -593,7 +593,7 @@ index 8beec32c..023ce639 100644
593593
<license>
594594
<name>BSD-3-Clause</name>
595595
diff --git a/pom.xml b/pom.xml
596-
index 6f938954..8c35ed93 100644
596+
index e5b4af03..044b45de 100644
597597
--- a/pom.xml
598598
+++ b/pom.xml
599599
@@ -3,18 +3,18 @@
@@ -987,5 +987,5 @@ index a583c5f6..de36c7fd 100644
987987
<properties>
988988
<checkstyle.skip>true</checkstyle.skip>
989989
--
990-
2.49.0
990+
2.39.5
991991

BungeeCord-Patches/0007-Fixup-ProtocolConstants.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 03e73e997dc06271e1afffa8b989125b275ee45f Mon Sep 17 00:00:00 2001
1+
From 10f8e7b785855c7d8263813519adca874d8f4a85 Mon Sep 17 00:00:00 2001
22
From: Troy Frew <[email protected]>
33
Date: Tue, 15 Nov 2016 09:07:51 -0500
44
Subject: [PATCH] Fixup ProtocolConstants
55

66

77
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
8-
index 4e40c699..1c1a09bc 100644
8+
index eae98554..f8be48b9 100644
99
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
1010
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
11-
@@ -129,6 +129,16 @@ public class ProtocolConstants
11+
@@ -131,6 +131,16 @@ public class ProtocolConstants
1212
SUPPORTED_VERSION_IDS = supportedVersionIds.build();
1313
}
1414

@@ -26,5 +26,5 @@ index 4e40c699..1c1a09bc 100644
2626
{
2727

2828
--
29-
2.50.0
29+
2.39.5
3030

BungeeCord-Patches/0016-Allow-invalid-packet-ids-for-forge-servers.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 955f3fb382d507d2e5113d8da1a38fe496f6ca77 Mon Sep 17 00:00:00 2001
1+
From 7b52a774a2fc4eafa998b5ea81cd3b23aa1e501a Mon Sep 17 00:00:00 2001
22
From: Techcable <[email protected]>
33
Date: Thu, 19 May 2016 17:09:22 -0600
44
Subject: [PATCH] Allow invalid packet ids for forge servers
@@ -43,10 +43,10 @@ index abcb53bb..0dd0fe31 100644
4343
{
4444
packet.read( in, protocol, prot.getDirection(), protocolVersion );
4545
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
46-
index 6c4e6735..d6c76a5b 100644
46+
index dd49fb1a..545f33dd 100644
4747
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
4848
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
49-
@@ -993,14 +993,23 @@ public enum Protocol
49+
@@ -1035,14 +1035,23 @@ public enum Protocol
5050
return protocol;
5151
}
5252

@@ -106,5 +106,5 @@ index 77b27c6f..26c1e1be 100644
106106
{
107107
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
108108
--
109-
2.49.0
109+
2.39.5
110110

BungeeCord-Patches/0029-Fix-potion-race-condition-on-Forge-1.8.9.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 786d670574b0fa2264e313cb849362d425b9b554 Mon Sep 17 00:00:00 2001
1+
From d085442a1209e25e7b9b2773b0d8845a21971df7 Mon Sep 17 00:00:00 2001
22
From: Aaron Hill <[email protected]>
33
Date: Thu, 15 Sep 2016 22:38:37 +0200
44
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
55

66

77
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
8-
index 86088656..aaf70d03 100644
8+
index 93e3aaed..46f568b3 100644
99
--- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
1010
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
11-
@@ -303,4 +303,14 @@ public abstract class AbstractPacketHandler
11+
@@ -298,4 +298,14 @@ public abstract class AbstractPacketHandler
1212
public void handle(BundleDelimiter bundleDelimiter) throws Exception
1313
{
1414
}
@@ -142,7 +142,7 @@ index a5ab08e3..e062987f 100644
142142
@Setter
143143
private String lastCommandTabbed;
144144
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
145-
index f794c0b2..2984b988 100644
145+
index 6b611fc3..a6d49bb7 100644
146146
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
147147
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
148148
@@ -754,6 +754,32 @@ public class DownstreamBridge extends PacketHandler
@@ -217,5 +217,5 @@ index d15044f4..087cb4b0 100644
217217
/**
218218
* Sends the server mod list to the client, or stores it for sending later.
219219
--
220-
2.49.0
220+
2.39.5
221221

BungeeCord-Patches/0033-Use-Log4j2-for-logging-and-TerminalConsoleAppender-f.patch

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
From 359e00558c32f0c6eae1e97955e6951c82f558c1 Mon Sep 17 00:00:00 2001
1+
From dd3e4f64b4c3ce1dc7b0f4e67f3c37c402b113a2 Mon Sep 17 00:00:00 2001
22
From: Minecrell <[email protected]>
33
Date: Fri, 22 Sep 2017 12:46:47 +0200
44
Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for
55
console
66

77

88
diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml
9-
index 061f7765..14a154aa 100644
9+
index 3d5f497f..45405835 100644
1010
--- a/bootstrap/pom.xml
1111
+++ b/bootstrap/pom.xml
12-
@@ -49,6 +49,9 @@
13-
<Main-Class>net.md_5.bungee.Bootstrap</Main-Class>
12+
@@ -50,6 +50,8 @@
1413
<Implementation-Version>${describe}</Implementation-Version>
1514
<Specification-Version>${maven.build.timestamp}</Specification-Version>
16-
+
15+
<Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access>
1716
+ <!-- Log4j includes custom classes for Java 9+ (#293) -->
1817
+ <Multi-Release>true</Multi-Release>
1918
</manifestEntries>
2019
</archive>
2120
</configuration>
22-
@@ -76,7 +79,17 @@
21+
@@ -77,7 +79,17 @@
2322
</excludes>
2423
</filter>
2524
</filters>
@@ -233,7 +232,7 @@ index 00000000..cfd039cd
233232
+ </Loggers>
234233
+</Configuration>
235234
diff --git a/pom.xml b/pom.xml
236-
index 8c35ed93..70bdee0c 100644
235+
index 044b45de..b51580d5 100644
237236
--- a/pom.xml
238237
+++ b/pom.xml
239238
@@ -52,13 +52,14 @@
@@ -634,5 +633,5 @@ index 6788fbe7..00000000
634633
- }
635634
-}
636635
--
637-
2.49.0
636+
2.39.5
638637

BungeeCord-Patches/0047-Speed-up-some-common-exceptions.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From bcf08b07a7659d42df94a4160ee76b0af80e93dc Mon Sep 17 00:00:00 2001
1+
From 3ad6bd3829e9b824be688526c3efbdc970316942 Mon Sep 17 00:00:00 2001
22
From: Shane Freeder <[email protected]>
33
Date: Mon, 25 Nov 2019 19:54:06 +0000
44
Subject: [PATCH] Speed up some common exceptions
@@ -59,10 +59,10 @@ index 6c0ef4df..076ddd70 100644
5959
+ // Waterfall end
6060
}
6161
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
62-
index 0ee7b0de..267ebc40 100644
62+
index 1ccca2f0..0effaf7b 100644
6363
--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
6464
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
65-
@@ -48,6 +48,9 @@ public abstract class DefinedPacket
65+
@@ -80,6 +80,9 @@ public abstract class DefinedPacket
6666
}
6767
}
6868

@@ -72,7 +72,7 @@ index 0ee7b0de..267ebc40 100644
7272
public static void writeString(String s, ByteBuf buf)
7373
{
7474
writeString( s, buf, Short.MAX_VALUE );
75-
@@ -250,13 +253,18 @@ public abstract class DefinedPacket
75+
@@ -282,13 +285,18 @@ public abstract class DefinedPacket
7676
byte in;
7777
while ( true )
7878
{
@@ -221,5 +221,5 @@ index ac99d02c..0c1ecfb8 100644
221221

222222
// Waterfall start
223223
--
224-
2.49.0
224+
2.39.5
225225

BungeeCord-Patches/0054-Additional-DoS-mitigations.patch

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 368c75dee528a0babbd8036944a9b3dea1914ce7 Mon Sep 17 00:00:00 2001
1+
From fefdea2be192142e61f626fc652155c280cf98ce Mon Sep 17 00:00:00 2001
22
From: "Five (Xer)" <[email protected]>
33
Date: Sat, 30 Jan 2021 18:04:14 +0100
44
Subject: [PATCH] Additional DoS mitigations
@@ -8,26 +8,26 @@ Courtesy of Tux and the Velocity Contributors. See:
88
https://github.com/VelocityPowered/Velocity/commit/5ceac16a821ea35572ff11412ace8929fd06e278
99

1010
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
11-
index 267ebc40..adfcc189 100644
11+
index 0effaf7b..f11e9f37 100644
1212
--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
1313
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java
14-
@@ -92,6 +92,7 @@ public abstract class DefinedPacket
14+
@@ -124,6 +124,7 @@ public abstract class DefinedPacket
1515
int len = readVarInt( buf );
1616
if ( len > maxLen * 3 )
1717
{
1818
+ if(!MinecraftDecoder.DEBUG) throw STRING_TOO_MANY_BYTES_EXCEPTION; // Waterfall start: Additional DoS mitigations
1919
throw new OverflowPacketException( "Cannot receive string longer than " + maxLen * 3 + " (got " + len + " bytes)" );
2020
}
2121

22-
@@ -100,6 +101,7 @@ public abstract class DefinedPacket
22+
@@ -132,6 +133,7 @@ public abstract class DefinedPacket
2323

2424
if ( s.length() > maxLen )
2525
{
2626
+ if(!MinecraftDecoder.DEBUG) throw STRING_TOO_LONG_EXCEPTION; // Waterfall start: Additional DoS mitigations
2727
throw new OverflowPacketException( "Cannot receive string longer than " + maxLen + " (got " + s.length() + " characters)" );
2828
}
2929

30-
@@ -602,4 +604,21 @@ public abstract class DefinedPacket
30+
@@ -634,4 +636,21 @@ public abstract class DefinedPacket
3131

3232
@Override
3333
public abstract String toString();
@@ -79,7 +79,7 @@ index 9136ac7c..15832a8c 100644
7979
throw new BadPacketException( "Packet " + protocol + ":" + prot.getDirection() + "/" + packetId + " (" + packet.getClass().getSimpleName() + ") larger than expected, extra bytes: " + in.readableBytes() );
8080
}
8181
} else
82-
@@ -73,6 +79,25 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
82+
@@ -73,6 +79,11 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
8383
out.add( new PacketWrapper( packet, slice, protocol ) );
8484
slice = null;
8585
} catch (BadPacketException | IndexOutOfBoundsException e) {
@@ -88,6 +88,18 @@ index 9136ac7c..15832a8c 100644
8888
+ throw e;
8989
+ }
9090
+ // Waterfall end
91+
final String packetTypeStr;
92+
if (packetTypeInfo instanceof Integer) {
93+
packetTypeStr = "id " + Integer.toHexString((Integer) packetTypeInfo);
94+
@@ -82,6 +93,21 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
95+
packetTypeStr = "unknown";
96+
}
97+
throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall
98+
+ // Waterfall start
99+
+ } catch (Exception e) {
100+
+ if (!DEBUG) {
101+
+ throw e;
102+
+ }
91103
+ final String packetTypeStr;
92104
+ if (packetTypeInfo instanceof Integer) {
93105
+ packetTypeStr = "id " + Integer.toHexString((Integer) packetTypeInfo);
@@ -97,18 +109,6 @@ index 9136ac7c..15832a8c 100644
97109
+ packetTypeStr = "unknown";
98110
+ }
99111
+ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall
100-
+ // Waterfall start
101-
+ } catch (Exception e) {
102-
+ if (!DEBUG) {
103-
+ throw e;
104-
+ }
105-
final String packetTypeStr;
106-
if (packetTypeInfo instanceof Integer) {
107-
packetTypeStr = "id " + Integer.toHexString((Integer) packetTypeInfo);
108-
@@ -82,6 +107,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
109-
packetTypeStr = "unknown";
110-
}
111-
throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall
112112
+ // Waterfall end
113113
} finally
114114
{
@@ -257,5 +257,5 @@ index 738f0c92..ec33d337 100644
257257
+ // Waterfall end
258258
}
259259
--
260-
2.49.0
260+
2.39.5
261261

BungeeCord-Patches/0060-Add-protocol-version-to-packet-not-found-message.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From 9c60ddc08d5a6065c44455d70b6cf5e0ea225e2a Mon Sep 17 00:00:00 2001
1+
From 11fdb7305c264c8bb5a8b2f9dfaa1533c83e80dc Mon Sep 17 00:00:00 2001
22
From: Shane Freeder <[email protected]>
33
Date: Sun, 12 Jun 2022 06:45:54 +0100
44
Subject: [PATCH] Add protocol version to packet not found message
55

66
Also avoids a double get, but, this is probably trivial
77

88
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
9-
index d6c76a5b..2bc61878 100644
9+
index 545f33dd..f3a3c713 100644
1010
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
1111
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
12-
@@ -1076,9 +1076,12 @@ public enum Protocol
12+
@@ -1130,9 +1130,12 @@ public enum Protocol
1313
{
1414
throw new BadPacketException( "Unsupported protocol version" );
1515
}
@@ -25,5 +25,5 @@ index d6c76a5b..2bc61878 100644
2525
}
2626
}
2727
--
28-
2.49.0
28+
2.39.5
2929

BungeeCord-Patches/0065-Prevent-proxy-commands-from-breaking-the-chat-chain-.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 12045a5e6c9ba7ad9b1d11ef5f45d71629a2567f Mon Sep 17 00:00:00 2001
1+
From a39cfd90ee4d1ef08c9afc90d620323db9392f9e Mon Sep 17 00:00:00 2001
22
From: Shane Freeder <[email protected]>
33
Date: Sun, 15 Oct 2023 00:36:38 +0100
44
Subject: [PATCH] Prevent proxy commands from breaking the chat chain system
55

66

77
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
8-
index aaf70d03..9c5240e5 100644
8+
index 46f568b3..48048202 100644
99
--- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
1010
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java
11-
@@ -312,5 +312,9 @@ public abstract class AbstractPacketHandler
11+
@@ -307,5 +307,9 @@ public abstract class AbstractPacketHandler
1212
public void handle(net.md_5.bungee.protocol.packet.EntityRemoveEffect removeEffect) throws Exception
1313
{
1414
}
@@ -19,10 +19,10 @@ index aaf70d03..9c5240e5 100644
1919
// Waterfall end
2020
}
2121
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
22-
index 2bc61878..7fc95fce 100644
22+
index f3a3c713..b4d980b5 100644
2323
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
2424
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
25-
@@ -635,6 +635,13 @@ public enum Protocol
25+
@@ -651,6 +651,13 @@ public enum Protocol
2626
map( ProtocolConstants.MINECRAFT_1_21_2, 0x07 ),
2727
map( ProtocolConstants.MINECRAFT_1_21_6, 0x08 )
2828
);
@@ -90,7 +90,7 @@ index f86fcd08..40df53fe 100644
9090
+ }
9191
}
9292
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
93-
index e416f753..264cb648 100644
93+
index e416f753..e905d237 100644
9494
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
9595
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
9696
@@ -200,16 +200,22 @@ public class UpstreamBridge extends PacketHandler
@@ -113,7 +113,7 @@ index e416f753..264cb648 100644
113113
+ // Waterfall start
114114
+ return handleChat(message, null);
115115
+ }
116-
+ private String handleChat(String message, @javax.annotation.Nullable ClientCommand clientCommand)
116+
+ private String handleChat(String message, ClientCommand clientCommand)
117117
+ // Waterfall end
118118
{
119119
for ( int index = 0, length = message.length(); index < length; index++ )
@@ -133,5 +133,5 @@ index e416f753..264cb648 100644
133133
throw CancelSendSignal.INSTANCE;
134134
}
135135
--
136-
2.49.0
136+
2.39.5
137137

0 commit comments

Comments
 (0)