From 17d5b78fdd9e5f76cf840cccd268e9dbb772c419 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 10 Feb 2020 22:39:19 +0000 Subject: [PATCH] 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: a52ea500 #2769: Guardian target beam lost on server change 17d5dd3f Add dist Maven profile to generate source and Javadoc jars 9e8ab747 Add JsonConfiguration support to bungeecord-config cdacc0b1 #2498: Add ServerConnectRequest accessor in ServerConnectEvent. b4b998b2 #2761: Add ClientConnectEvent --- BungeeCord | 2 +- BungeeCord-Patches/0001-POM-Changes.patch | 38 ++++--- .../0002-Copy-license-files-into-jar.patch | 8 +- ...-access-a-ByteBuf-s-underlying-array.patch | 6 +- .../0015-Enable-TCP_NODELAY.patch | 6 +- ...ionally-use-async-Netty-DNS-resolver.patch | 6 +- ...ogging-and-TerminalConsoleAppender-f.patch | 16 +-- ...low-plugins-to-use-SLF4J-for-logging.patch | 9 +- .../0054-ConnectionInitEvent.patch | 104 +++++++++++++----- 9 files changed, 125 insertions(+), 70 deletions(-) diff --git a/BungeeCord b/BungeeCord index a3ab2bf..a52ea50 160000 --- a/BungeeCord +++ b/BungeeCord @@ -1 +1 @@ -Subproject commit a3ab2bf58e87f7ebc9131b1b969ce918986d9cbd +Subproject commit a52ea50006ef8d1fb2388a25d4a5986f197bdb8a diff --git a/BungeeCord-Patches/0001-POM-Changes.patch b/BungeeCord-Patches/0001-POM-Changes.patch index a808f0c..165733f 100644 --- a/BungeeCord-Patches/0001-POM-Changes.patch +++ b/BungeeCord-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From 54b91cd62efdce89489199bc102a9beab569079e Mon Sep 17 00:00:00 2001 +From 9e6a4af2aa2192218a0e6535d3ba7352fe47bcb9 Mon Sep 17 00:00:00 2001 From: Tux Date: Thu, 19 May 2016 19:33:31 +0200 Subject: [PATCH] POM Changes @@ -7,7 +7,7 @@ Subject: [PATCH] POM Changes - Deploy to papermc mvn repo diff --git a/api/pom.xml b/api/pom.xml -index 5d782001..4b9e171d 100644 +index a3f6a6a9..15228459 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,42 +4,42 @@ @@ -67,10 +67,10 @@ index 5d782001..4b9e171d 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 9a11e65a..9cae021d 100644 +index 3e63a0bf..66ed2128 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml -@@ -4,38 +4,39 @@ +@@ -4,39 +4,40 @@ 4.0.0 @@ -96,6 +96,7 @@ index 9a11e65a..9cae021d 100644 true + true - 1.6 - 1.6 + @@ -121,7 +122,7 @@ index 9a11e65a..9cae021d 100644 org.apache.maven.plugins -@@ -44,7 +45,7 @@ +@@ -45,7 +46,7 @@ @@ -174,7 +175,7 @@ index 4ca669f9..0bd76ea5 100644 diff --git a/config/pom.xml b/config/pom.xml -index 4b44d27e..764fcc6b 100644 +index 95449790..4bf7237f 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -4,19 +4,19 @@ @@ -388,7 +389,7 @@ index 875e8eb1..d8ebf472 100644 jar diff --git a/module/pom.xml b/module/pom.xml -index 7c81fe86..7b05190b 100644 +index 088fc997..261c8d75 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -4,19 +4,19 @@ @@ -417,13 +418,14 @@ index 7c81fe86..7b05190b 100644 cmd-alert -@@ -28,14 +28,14 @@ +@@ -28,15 +28,15 @@ - SpigotMC + WaterfallMC true + true @@ -489,7 +491,7 @@ index f11cad04..f8b549dc 100644 diff --git a/pom.xml b/pom.xml -index 73b51d49..82872150 100644 +index 67122278..19f63586 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,25 @@ @@ -608,12 +610,11 @@ index 73b51d49..82872150 100644 org.codehaus.mojo animal-sniffer-maven-plugin -@@ -165,4 +199,87 @@ - - - -+ -+ +@@ -236,5 +270,87 @@ + + + ++ + + deployment + @@ -694,7 +695,8 @@ index 73b51d49..82872150 100644 + + + -+ ++ + diff --git a/protocol/pom.xml b/protocol/pom.xml index e11af008..4592e2b3 100644 @@ -738,7 +740,7 @@ index e11af008..4592e2b3 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index 04c5af43..b525340d 100644 +index a682d3c6..9ac3c1af 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -4,18 +4,18 @@ @@ -765,7 +767,7 @@ index 04c5af43..b525340d 100644 Proxy component of the Elastic Portal Suite -@@ -55,32 +55,32 @@ +@@ -56,32 +56,32 @@ compile diff --git a/BungeeCord-Patches/0002-Copy-license-files-into-jar.patch b/BungeeCord-Patches/0002-Copy-license-files-into-jar.patch index d18a582..4f5822f 100644 --- a/BungeeCord-Patches/0002-Copy-license-files-into-jar.patch +++ b/BungeeCord-Patches/0002-Copy-license-files-into-jar.patch @@ -1,14 +1,14 @@ -From 3692953ec62a6a392c46c1bea06cc8eea0b28644 Mon Sep 17 00:00:00 2001 +From 8fcf80f3a4a5fd0c9b8d096a996f8e90f803492a Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 18 Jul 2018 20:23:03 +0300 Subject: [PATCH] Copy license files into jar diff --git a/proxy/pom.xml b/proxy/pom.xml -index 879a82d7..03e35f42 100644 +index 9ac3c1af..1e1df054 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -104,6 +104,20 @@ +@@ -105,6 +105,20 @@ src/main/resources true @@ -30,5 +30,5 @@ index 879a82d7..03e35f42 100644 -- -2.20.1 +2.25.0 diff --git a/BungeeCord-Patches/0010-Don-t-access-a-ByteBuf-s-underlying-array.patch b/BungeeCord-Patches/0010-Don-t-access-a-ByteBuf-s-underlying-array.patch index 016c067..efb71a0 100644 --- a/BungeeCord-Patches/0010-Don-t-access-a-ByteBuf-s-underlying-array.patch +++ b/BungeeCord-Patches/0010-Don-t-access-a-ByteBuf-s-underlying-array.patch @@ -1,4 +1,4 @@ -From bb2018d11642a88b3f04ae4efe193b3e7ea8999b Mon Sep 17 00:00:00 2001 +From b2b0879209daecbd7d19e05de07a6efbd00f3ee2 Mon Sep 17 00:00:00 2001 From: Techcable Date: Tue, 3 May 2016 20:31:52 -0700 Subject: [PATCH] Don't access a ByteBuf's underlying array @@ -69,10 +69,10 @@ index 147110e4..a2f62648 100644 // changes in the packet are ignored so we need to send it manually con.unsafe().sendPacket( pluginMessage ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -index 44e28846..c5f071f2 100644 +index afc2c12a..c0f7980b 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -@@ -48,9 +48,9 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; +@@ -49,9 +49,9 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; public class PipelineUtils { diff --git a/BungeeCord-Patches/0015-Enable-TCP_NODELAY.patch b/BungeeCord-Patches/0015-Enable-TCP_NODELAY.patch index 38c50a9..c01bf4d 100644 --- a/BungeeCord-Patches/0015-Enable-TCP_NODELAY.patch +++ b/BungeeCord-Patches/0015-Enable-TCP_NODELAY.patch @@ -1,4 +1,4 @@ -From 901946ee5647bc874fab86859c58b4ea6f4a1d83 Mon Sep 17 00:00:00 2001 +From 304688eed40e4e7eaa6ba2474286972b5651b2bf Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 24 Jan 2016 15:13:29 -0700 Subject: [PATCH] Enable TCP_NODELAY. @@ -6,10 +6,10 @@ Subject: [PATCH] Enable TCP_NODELAY. This is enabled by default on CraftBukkit/Spigot >= 1.8 and may help with network performance. diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -index c5f071f2..0c91f7ed 100644 +index c0f7980b..8969a5ed 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -@@ -160,6 +160,7 @@ public class PipelineUtils +@@ -169,6 +169,7 @@ public class PipelineUtils { // IP_TOS is not supported (Windows XP / Windows Server 2003) } diff --git a/BungeeCord-Patches/0034-Optionally-use-async-Netty-DNS-resolver.patch b/BungeeCord-Patches/0034-Optionally-use-async-Netty-DNS-resolver.patch index d6eea04..b709825 100644 --- a/BungeeCord-Patches/0034-Optionally-use-async-Netty-DNS-resolver.patch +++ b/BungeeCord-Patches/0034-Optionally-use-async-Netty-DNS-resolver.patch @@ -1,4 +1,4 @@ -From 828f6d18bf3da33fe5e82ec3ede6d0c3452851ee Mon Sep 17 00:00:00 2001 +From 8d2ad56ecddfa2089184fcd4ca92635ffee13004 Mon Sep 17 00:00:00 2001 From: Tux Date: Wed, 21 Dec 2016 03:13:03 -0500 Subject: [PATCH] Optionally use async Netty DNS resolver @@ -24,10 +24,10 @@ index 749059ab..6141128b 100644 /** diff --git a/proxy/pom.xml b/proxy/pom.xml -index 66561fd9..01cb5c50 100644 +index 1e1df054..38392b64 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -41,6 +41,14 @@ +@@ -42,6 +42,14 @@ ${netty.version} compile diff --git a/BungeeCord-Patches/0037-Use-Log4j2-for-logging-and-TerminalConsoleAppender-f.patch b/BungeeCord-Patches/0037-Use-Log4j2-for-logging-and-TerminalConsoleAppender-f.patch index 0a8d395..3dcfecc 100644 --- a/BungeeCord-Patches/0037-Use-Log4j2-for-logging-and-TerminalConsoleAppender-f.patch +++ b/BungeeCord-Patches/0037-Use-Log4j2-for-logging-and-TerminalConsoleAppender-f.patch @@ -1,4 +1,4 @@ -From f8b721b6e23bc29ad538e02d117a4ddf561fba06 Mon Sep 17 00:00:00 2001 +From 211d83d5dc9d417b84fdbaf1105b984af12acc4b Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 22 Sep 2017 12:46:47 +0200 Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for @@ -6,10 +6,10 @@ Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 9cae021d..e7b76d5b 100644 +index 66ed2128..2876d8d6 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml -@@ -48,6 +48,9 @@ +@@ -49,6 +49,9 @@ net.md_5.bungee.Bootstrap ${describe} ${maven.build.timestamp} @@ -19,7 +19,7 @@ index 9cae021d..e7b76d5b 100644 -@@ -75,7 +78,17 @@ +@@ -76,7 +79,17 @@ @@ -233,7 +233,7 @@ index 00000000..93ce3b14 + + diff --git a/pom.xml b/pom.xml -index 82872150..903fd182 100644 +index 19f63586..37bdaf3d 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ @@ -245,10 +245,10 @@ index 82872150..903fd182 100644 protocol proxy diff --git a/proxy/pom.xml b/proxy/pom.xml -index 01cb5c50..52e45fe1 100644 +index 38392b64..54500dde 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -70,7 +70,7 @@ +@@ -71,7 +71,7 @@ io.github.waterfallmc @@ -257,7 +257,7 @@ index 01cb5c50..52e45fe1 100644 ${project.version} compile -@@ -104,6 +104,20 @@ +@@ -105,6 +105,20 @@ 5.1.48 runtime diff --git a/BungeeCord-Patches/0039-Allow-plugins-to-use-SLF4J-for-logging.patch b/BungeeCord-Patches/0039-Allow-plugins-to-use-SLF4J-for-logging.patch index 8197dc9..8021c3f 100644 --- a/BungeeCord-Patches/0039-Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/BungeeCord-Patches/0039-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -1,18 +1,17 @@ -From 4aecdf4068b45c1ffc7c78aaf720e30e63fce926 Mon Sep 17 00:00:00 2001 +From 0116c8f04967a0c811477029d574d2e55a5b9193 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 22 Sep 2017 13:15:09 +0200 Subject: [PATCH] Allow plugins to use SLF4J for logging diff --git a/api/pom.xml b/api/pom.xml -index 4b9e171d..2380a5fd 100644 +index 15228459..705b7279 100644 --- a/api/pom.xml +++ b/api/pom.xml -@@ -49,5 +49,12 @@ - ${netty.version} +@@ -55,5 +55,11 @@ + 1.25 compile -+ + + + org.slf4j diff --git a/BungeeCord-Patches/0054-ConnectionInitEvent.patch b/BungeeCord-Patches/0054-ConnectionInitEvent.patch index 7b55304..de8d4a1 100644 --- a/BungeeCord-Patches/0054-ConnectionInitEvent.patch +++ b/BungeeCord-Patches/0054-ConnectionInitEvent.patch @@ -1,4 +1,4 @@ -From 86125c4bf1167e2d12111686fd37ac9214a0edf1 Mon Sep 17 00:00:00 2001 +From 9d1697f260c3f6b4ae801401e7ed2d1c99d7127f Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 2 Dec 2019 11:35:17 +0000 Subject: [PATCH] ConnectionInitEvent @@ -6,14 +6,16 @@ Subject: [PATCH] ConnectionInitEvent diff --git a/api/src/main/java/io/github/waterfallmc/waterfall/event/ConnectionInitEvent.java b/api/src/main/java/io/github/waterfallmc/waterfall/event/ConnectionInitEvent.java new file mode 100644 -index 00000000..e884eac8 +index 00000000..6f6c6226 --- /dev/null +++ b/api/src/main/java/io/github/waterfallmc/waterfall/event/ConnectionInitEvent.java -@@ -0,0 +1,52 @@ +@@ -0,0 +1,56 @@ +package io.github.waterfallmc.waterfall.event; + +import net.md_5.bungee.api.Callback; ++import net.md_5.bungee.api.config.ListenerInfo; +import net.md_5.bungee.api.event.AsyncEvent; ++import net.md_5.bungee.api.event.ClientConnectEvent; +import net.md_5.bungee.api.plugin.Cancellable; + +import java.net.InetSocketAddress; @@ -24,15 +26,17 @@ index 00000000..e884eac8 +/** + * Represents a brand new connection made to the proxy, allowing for plugins to + * efficiently close a connection, useful for connection throttlers, etc ++ * @deprecated spigot added a variant of this event upstream, this class may be removed in the future + */ +@ToString -+public class ConnectionInitEvent extends AsyncEvent implements Cancellable { ++@Deprecated ++public class ConnectionInitEvent extends ClientConnectEvent implements Cancellable { + + private final SocketAddress remoteAddress; + private boolean isCancelled = false; + -+ public ConnectionInitEvent(SocketAddress remoteAddress, Callback done) { -+ super(done); ++ public ConnectionInitEvent(SocketAddress remoteAddress, ListenerInfo listener, Callback done) { ++ super(remoteAddress, listener, done); + this.remoteAddress = remoteAddress; + } + @@ -62,8 +66,63 @@ index 00000000..e884eac8 + return remoteAddress; + } +} +diff --git a/api/src/main/java/net/md_5/bungee/api/event/ClientConnectEvent.java b/api/src/main/java/net/md_5/bungee/api/event/ClientConnectEvent.java +index 50ce034c..df5ffda7 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/ClientConnectEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/ClientConnectEvent.java +@@ -1,12 +1,17 @@ + package net.md_5.bungee.api.event; + + import java.net.SocketAddress; ++ ++import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import lombok.Data; + import lombok.EqualsAndHashCode; + import lombok.ToString; ++ ++import net.md_5.bungee.api.Callback; + import net.md_5.bungee.api.config.ListenerInfo; + import net.md_5.bungee.api.plugin.Cancellable; + import net.md_5.bungee.api.plugin.Event; ++import net.md_5.bungee.api.plugin.Listener; + + /** + * Event called to represent an initial client connection. +@@ -14,10 +19,9 @@ import net.md_5.bungee.api.plugin.Event; + * Note: This event is called at an early stage of every connection, handling + * should be fast. + */ +-@Data + @ToString(callSuper = false) + @EqualsAndHashCode(callSuper = false) +-public class ClientConnectEvent extends Event implements Cancellable ++public class ClientConnectEvent extends AsyncEvent implements Cancellable// Waterfall + { + + /** +@@ -32,4 +36,20 @@ public class ClientConnectEvent extends Event implements Cancellable + * Listener that accepted the connection. + */ + private final ListenerInfo listener; ++ ++ public ClientConnectEvent(SocketAddress remoteAddress, ListenerInfo listener, Callback done) { ++ super(done); ++ socketAddress = remoteAddress; ++ this.listener = listener; ++ } ++ ++ @Override ++ public boolean isCancelled() { ++ return cancelled; ++ } ++ ++ @Override ++ public void setCancelled(boolean cancel) { ++ this.cancelled = cancel; ++ } + } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java -index 0c91f7ed..e89f3669 100644 +index 8969a5ed..4ad17d1a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java @@ -1,6 +1,7 @@ @@ -74,28 +133,23 @@ index 0c91f7ed..e89f3669 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; import io.netty.channel.ChannelException; -@@ -26,6 +27,8 @@ import io.netty.handler.codec.haproxy.HAProxyMessageDecoder; - import io.netty.handler.timeout.ReadTimeoutHandler; - import io.netty.util.AttributeKey; - import io.netty.util.internal.PlatformDependent; +@@ -64,16 +65,23 @@ public class PipelineUtils + ch.close(); + return; + } +- + ListenerInfo listener = ch.attr( LISTENER ).get(); + +- if ( BungeeCord.getInstance().getPluginManager().callEvent( new ClientConnectEvent( remoteAddress, listener ) ).isCancelled() ) +- { ++ ConnectionInitEvent connectionInitEvent = new ConnectionInitEvent(ch.remoteAddress(), listener, (result, throwable) -> { // Waterfall + -+import java.net.InetSocketAddress; - import java.net.SocketAddress; - import java.util.concurrent.ThreadFactory; - import java.util.concurrent.TimeUnit; -@@ -62,9 +65,22 @@ public class PipelineUtils ++ if (result.isCancelled()) { + ch.close(); return; } -+ ConnectionInitEvent connectionInitEvent = new ConnectionInitEvent(ch.remoteAddress(), (result, throwable) -> { // Waterfall + -+ if (result.isCancelled()) { -+ ch.close(); -+ return; -+ } -+ - ListenerInfo listener = ch.attr( LISTENER ).get(); - + try { BASE.initChannel( ch ); + } catch (Exception e) { @@ -106,7 +160,7 @@ index 0c91f7ed..e89f3669 100644 ch.pipeline().addBefore( FRAME_DECODER, LEGACY_DECODER, new LegacyDecoder() ); ch.pipeline().addAfter( FRAME_DECODER, PACKET_DECODER, new MinecraftDecoder( Protocol.HANDSHAKE, true, ProxyServer.getInstance().getProtocolVersion() ) ); ch.pipeline().addAfter( FRAME_PREPENDER, PACKET_ENCODER, new MinecraftEncoder( Protocol.HANDSHAKE, true, ProxyServer.getInstance().getProtocolVersion() ) ); -@@ -75,6 +91,9 @@ public class PipelineUtils +@@ -84,6 +92,9 @@ public class PipelineUtils { ch.pipeline().addFirst( new HAProxyMessageDecoder() ); }