From 46c84495fd1e78303f34db70034c1e7d56291655 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 29 Aug 2020 12:12:21 +0100 Subject: [PATCH 001/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 8075dbe Updated Upstream (BungeeCord) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 056d6687..8075dbe9 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 056d6687ef3c6ce080bac254ba86b306a4d233d4 +Subproject commit 8075dbe95dbc5da9dd9fecd61263a5ce85d3c4e3 From e92af6a3c71d1e2fc30b459610354f22859b11f6 Mon Sep 17 00:00:00 2001 From: "Five (Xer)" Date: Thu, 10 Sep 2020 18:03:11 +0200 Subject: [PATCH 002/499] 1.16.3-patch --- .../0004-Travertine-1.16.3-Patch.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch diff --git a/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch b/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch new file mode 100644 index 00000000..fee863ad --- /dev/null +++ b/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch @@ -0,0 +1,31 @@ +From e8c93c149c23d9d6d57acee204780c952a3394bf Mon Sep 17 00:00:00 2001 +From: "Five (Xer)" +Date: Thu, 10 Sep 2020 17:59:48 +0200 +Subject: [PATCH] Travertine-1.16.3-Patch + + +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 +index 6f72983f..659382c0 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +@@ -33,6 +33,7 @@ public class ProtocolConstants + public static final int MINECRAFT_1_16 = 735; + public static final int MINECRAFT_1_16_1 = 736; + public static final int MINECRAFT_1_16_2 = 751; ++ public static final int MINECRAFT_1_16_3 = 753; + public static final List SUPPORTED_VERSIONS = Arrays.asList( + "1.7.x", + "1.8.x", +@@ -72,7 +73,8 @@ public class ProtocolConstants + ProtocolConstants.MINECRAFT_1_15_2, + ProtocolConstants.MINECRAFT_1_16, + ProtocolConstants.MINECRAFT_1_16_1, +- ProtocolConstants.MINECRAFT_1_16_2 ++ ProtocolConstants.MINECRAFT_1_16_2, ++ ProtocolConstants.MINECRAFT_1_16_3 + ); + + public static final boolean isBeforeOrEq(int before, int other) +-- +2.24.0 + From 55f272fc4babf07526f398ef6557e6e933cedadf Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 11 Sep 2020 00:47:38 +0100 Subject: [PATCH 003/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 5aa8f70 Updated Upstream (BungeeCord) 61700eb Preliminary 1.16.3 support (#566) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 16 +++++----- .../0004-Travertine-1.16.3-Patch.patch | 31 ------------------- 3 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch diff --git a/Waterfall b/Waterfall index 8075dbe9..5aa8f709 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 8075dbe95dbc5da9dd9fecd61263a5ce85d3c4e3 +Subproject commit 5aa8f709bbae4356c02b75120477e4002d02b9e7 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 7d50c191..4e98b8c1 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From d0c1b725cdfa4e07a4a8f9bf6bb810290f4e361e Mon Sep 17 00:00:00 2001 +From f7c69bedede5970d764bbd1e80f9849ffd63ff9e Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -462,7 +462,7 @@ index d372933d..1feee418 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index aa1b770c..6f72983f 100644 +index f33bb5c4..659382c0 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -6,6 +6,8 @@ import java.util.List; @@ -474,15 +474,15 @@ index aa1b770c..6f72983f 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -32,6 +34,7 @@ public class ProtocolConstants - public static final int MINECRAFT_1_16_1 = 736; +@@ -33,6 +35,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_16_2 = 751; + public static final int MINECRAFT_1_16_3 = 753; public static final List SUPPORTED_VERSIONS = Arrays.asList( + "1.7.x", "1.8.x", "1.9.x", "1.10.x", -@@ -43,6 +46,8 @@ public class ProtocolConstants +@@ -44,6 +47,8 @@ public class ProtocolConstants "1.16.x" ); public static final List SUPPORTED_VERSION_IDS = Arrays.asList( @@ -1512,7 +1512,7 @@ index b0125245..8c2a743a 100644 { this.compressionThreshold = compressionThreshold; 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 -index 44e6ed3f..585afa36 100644 +index 443d19bd..326de178 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1581,7 +1581,7 @@ index 44e6ed3f..585afa36 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 4b40b465..13deb6c9 100644 +index 7e6027aa..fe6ff143 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 @@ -12,6 +12,13 @@ import java.util.List; @@ -2038,5 +2038,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.27.0 +2.28.0 diff --git a/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch b/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch deleted file mode 100644 index fee863ad..00000000 --- a/Waterfall-Proxy-Patches/0004-Travertine-1.16.3-Patch.patch +++ /dev/null @@ -1,31 +0,0 @@ -From e8c93c149c23d9d6d57acee204780c952a3394bf Mon Sep 17 00:00:00 2001 -From: "Five (Xer)" -Date: Thu, 10 Sep 2020 17:59:48 +0200 -Subject: [PATCH] Travertine-1.16.3-Patch - - -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 -index 6f72983f..659382c0 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -@@ -33,6 +33,7 @@ public class ProtocolConstants - public static final int MINECRAFT_1_16 = 735; - public static final int MINECRAFT_1_16_1 = 736; - public static final int MINECRAFT_1_16_2 = 751; -+ public static final int MINECRAFT_1_16_3 = 753; - public static final List SUPPORTED_VERSIONS = Arrays.asList( - "1.7.x", - "1.8.x", -@@ -72,7 +73,8 @@ public class ProtocolConstants - ProtocolConstants.MINECRAFT_1_15_2, - ProtocolConstants.MINECRAFT_1_16, - ProtocolConstants.MINECRAFT_1_16_1, -- ProtocolConstants.MINECRAFT_1_16_2 -+ ProtocolConstants.MINECRAFT_1_16_2, -+ ProtocolConstants.MINECRAFT_1_16_3 - ); - - public static final boolean isBeforeOrEq(int before, int other) --- -2.24.0 - From 0883f3cee79b6da0d3f53231a58c51acdc56b379 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 15 Sep 2020 18:15:17 +0100 Subject: [PATCH 004/499] Updated Upstream (Waterfall) 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 Waterfall Changes: dd1fbb9 Add the ability to generate decoder traces for debugging d1d1b58 Updated Upstream (BungeeCord) 46fa4cf Rebuild patches fae68b0 Allow to disable tablist rewrite --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Waterfall b/Waterfall index 5aa8f709..dd1fbb94 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 5aa8f709bbae4356c02b75120477e4002d02b9e7 +Subproject commit dd1fbb948b867405b0273cc346959a793a5d9d48 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 4e98b8c1..bff0e17e 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From f7c69bedede5970d764bbd1e80f9849ffd63ff9e Mon Sep 17 00:00:00 2001 +From 625904bd6432d8424530b17e58f498acd862b60d Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -1512,7 +1512,7 @@ index b0125245..8c2a743a 100644 { this.compressionThreshold = compressionThreshold; 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 -index 443d19bd..326de178 100644 +index 9e180c30..d54d8539 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1523,7 +1523,7 @@ index 443d19bd..326de178 100644 import java.util.ArrayList; import java.util.HashMap; // Waterfall import java.util.List; -@@ -173,7 +174,7 @@ public class DownstreamBridge extends PacketHandler +@@ -179,7 +180,7 @@ public class DownstreamBridge extends PacketHandler switch ( objective.getAction() ) { case 0: @@ -1532,7 +1532,7 @@ index 443d19bd..326de178 100644 break; case 1: serverScoreboard.removeObjective( objective.getName() ); -@@ -183,7 +184,7 @@ public class DownstreamBridge extends PacketHandler +@@ -189,7 +190,7 @@ public class DownstreamBridge extends PacketHandler if ( oldObjective != null ) { oldObjective.setValue( objective.getValue() ); @@ -1541,7 +1541,7 @@ index 443d19bd..326de178 100644 } break; default: -@@ -280,16 +281,28 @@ public class DownstreamBridge extends PacketHandler +@@ -286,16 +287,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1669,7 +1669,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 45f4449c..77274ec4 100644 +index a5acf512..67b68a3b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap From 2872444b12c487ead30658f7c595d229b0dc94f6 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 29 Sep 2020 00:30:12 +0100 Subject: [PATCH 005/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 27e2885 Bump netty to 4.1.52.Final 9bbec04 Updated Upstream (BungeeCord) 899d687 [CI-SKIP] Add plugin developers section in README.md (#556) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index dd1fbb94..27e2885a 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit dd1fbb948b867405b0273cc346959a793a5d9d48 +Subproject commit 27e2885ab3759536fb5a16a3ff388511f3665ad8 From 06fe87ce3f85bcfadeaa80f1716a15dd12be51a8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Sun, 18 Oct 2020 16:26:58 -0300 Subject: [PATCH 006/499] Updated Source --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 14 +- .../0004-FlameCord-General-Patch.patch | 2321 ++++ .../0004-FlameCord-Initial-Patch.patch | 11109 ---------------- ...lameCord-Whitelist-servers-addresses.patch | 173 - ...0005-Made-ProxyPingEvent-cancellable.patch | 76 + ...Defaulted-timeout-from-30000-to-5000.patch | 30 - 7 files changed, 2405 insertions(+), 11320 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch delete mode 100644 Waterfall-Proxy-Patches/0004-FlameCord-Initial-Patch.patch delete mode 100644 Waterfall-Proxy-Patches/0005-FlameCord-Whitelist-servers-addresses.patch create mode 100644 Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch delete mode 100644 Waterfall-Proxy-Patches/0006-FlameCord-Defaulted-timeout-from-30000-to-5000.patch diff --git a/Waterfall b/Waterfall index 61700eb8..27e2885a 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 61700eb820cb16034a0ed94d54182e37736294e9 +Subproject commit 27e2885ab3759536fb5a16a3ff388511f3665ad8 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 90fcf0e2..156c680a 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From ece80e18ec59cfbc0b97676bf2a09b26a97375ff Mon Sep 17 00:00:00 2001 +From f3a05a0d743b35976ff51154c5b17003668c37c8 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -1512,7 +1512,7 @@ index b0125245..8c2a743a 100644 { this.compressionThreshold = compressionThreshold; 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 -index 443d19bd..326de178 100644 +index 9e180c30..d54d8539 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1523,7 +1523,7 @@ index 443d19bd..326de178 100644 import java.util.ArrayList; import java.util.HashMap; // Waterfall import java.util.List; -@@ -173,7 +174,7 @@ public class DownstreamBridge extends PacketHandler +@@ -179,7 +180,7 @@ public class DownstreamBridge extends PacketHandler switch ( objective.getAction() ) { case 0: @@ -1532,7 +1532,7 @@ index 443d19bd..326de178 100644 break; case 1: serverScoreboard.removeObjective( objective.getName() ); -@@ -183,7 +184,7 @@ public class DownstreamBridge extends PacketHandler +@@ -189,7 +190,7 @@ public class DownstreamBridge extends PacketHandler if ( oldObjective != null ) { oldObjective.setValue( objective.getValue() ); @@ -1541,7 +1541,7 @@ index 443d19bd..326de178 100644 } break; default: -@@ -280,16 +281,28 @@ public class DownstreamBridge extends PacketHandler +@@ -286,16 +287,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1581,7 +1581,7 @@ index 443d19bd..326de178 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 4b40b465..13deb6c9 100644 +index 7e6027aa..fe6ff143 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 @@ -12,6 +12,13 @@ import java.util.List; @@ -1669,7 +1669,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 45f4449c..77274ec4 100644 +index a5acf512..67b68a3b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch new file mode 100644 index 00000000..671d79bd --- /dev/null +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -0,0 +1,2321 @@ +From b5fbd45e9ba865cb9af6f9aa4f75afb140db7647 Mon Sep 17 00:00:00 2001 +From: Juan Cruz Linsalata +Date: Mon, 12 Oct 2020 15:40:53 -0300 +Subject: [PATCH] FlameCord General Patch + + +diff --git a/api/.factorypath b/api/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/api/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +index cf85ca06..8a945a99 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +@@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; + @EqualsAndHashCode(callSuper = true) + public class AsyncEvent extends Event + { +- ++ // FlameCord - Make a getter for the callback ++ @Getter + private final Callback done; + private final Map intents = new ConcurrentHashMap<>(); + private final AtomicBoolean fired = new AtomicBoolean(); +diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +index 2f7b38d9..e29b0ed3 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +@@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; + + import lombok.Data; + import lombok.EqualsAndHashCode; ++import lombok.Getter; ++import lombok.Setter; + import lombok.ToString; + import net.md_5.bungee.api.connection.PendingConnection; ++import net.md_5.bungee.api.plugin.Cancellable; + import net.md_5.bungee.api.plugin.Event; + import net.md_5.bungee.protocol.packet.Handshake; + +@@ -14,8 +17,11 @@ import net.md_5.bungee.protocol.packet.Handshake; + @Data + @ToString(callSuper = false) + @EqualsAndHashCode(callSuper = false) +-public class PlayerHandshakeEvent extends Event +-{ ++// FlameCord - Implement cancellable ++public class PlayerHandshakeEvent extends Event implements Cancellable { ++ @Getter ++ @Setter ++ private boolean cancelled = false; + + /** + * Connection attempting to login. +diff --git a/bootstrap/.factorypath b/bootstrap/.factorypath +new file mode 100644 +index 00000000..b9f2c65d +--- /dev/null ++++ b/bootstrap/.factorypath +@@ -0,0 +1,37 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/chat/.factorypath b/chat/.factorypath +new file mode 100644 +index 00000000..ed4e646c +--- /dev/null ++++ b/chat/.factorypath +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ ++ +diff --git a/config/.factorypath b/config/.factorypath +new file mode 100644 +index 00000000..6e60b565 +--- /dev/null ++++ b/config/.factorypath +@@ -0,0 +1,7 @@ ++ ++ ++ ++ ++ ++ ++ +diff --git a/event/.factorypath b/event/.factorypath +new file mode 100644 +index 00000000..f398f41e +--- /dev/null ++++ b/event/.factorypath +@@ -0,0 +1,5 @@ ++ ++ ++ ++ ++ +diff --git a/flamecord/.factorypath b/flamecord/.factorypath +new file mode 100644 +index 00000000..ed4e646c +--- /dev/null ++++ b/flamecord/.factorypath +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ ++ +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +new file mode 100644 +index 00000000..dd511dac +--- /dev/null ++++ b/flamecord/pom.xml +@@ -0,0 +1,44 @@ ++ ++ 4.0.0 ++ ++ ++ io.github.waterfallmc ++ travertine-parent ++ 1.16-R0.4-SNAPSHOT ++ ../pom.xml ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ 1.16-R0.4-SNAPSHOT ++ jar ++ ++ Travertine-FlameCord ++ FlameCord adds security essentials and new configuration options ++ ++ ++ ++ io.github.waterfallmc ++ travertine-config ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-chat ++ ${project.version} ++ compile ++ ++ ++ ++ ++ ${project.name} ++ ++ ++ true ++ ${basedir}/src/main/resources ++ ++ ++ ++ +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +new file mode 100644 +index 00000000..fd889644 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -0,0 +1,68 @@ ++package dev._2lstudios.flamecord; ++ ++import java.util.Collection; ++import java.util.logging.Logger; ++ ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; ++import dev._2lstudios.flamecord.firewall.FirewallManager; ++import lombok.Getter; ++import net.md_5.bungee.config.ConfigurationProvider; ++import net.md_5.bungee.config.YamlConfiguration; ++ ++public class FlameCord { ++ @Getter ++ private static FlameCord instance; ++ @Getter ++ private final FirewallManager firewallManager; ++ @Getter ++ private final FlameCordConfiguration flameCordConfiguration; ++ @Getter ++ private final ModulesConfiguration modulesConfiguration; ++ @Getter ++ private final MessagesConfiguration messagesConfiguration; ++ @Getter ++ private final Thread thread; ++ private boolean running = true; ++ ++ public static void renew(final Logger logger, final Collection whitelistedAddresses) { ++ if (FlameCord.instance != null) { ++ FlameCord.instance.running = false; ++ } ++ ++ final FlameCord instance = new FlameCord(logger, whitelistedAddresses); ++ ++ FlameCord.instance = instance; ++ } ++ ++ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { ++ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); ++ this.firewallManager = new FirewallManager(logger, whitelistedAddresses, ++ flameCordConfiguration.getFirewallSeconds()); ++ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); ++ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); ++ this.thread = new Thread() { ++ @Override ++ public void run() { ++ while (running) { ++ try { ++ sleep(1000L); ++ ++ if (!running) { ++ return; ++ } ++ ++ firewallManager.tick(); ++ } catch (final Exception e) { ++ // Ignored ++ } ++ } ++ } ++ }; ++ ++ this.thread.start(); ++ } ++} +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +new file mode 100644 +index 00000000..b7268e1d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -0,0 +1,81 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.HashSet; ++ ++import lombok.Getter; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class FlameCordConfiguration { ++ @Getter ++ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, ++ firewallEnabled = true; ++ @Getter ++ private int firewallSeconds = 60; ++ @Getter ++ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); ++ ++ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { ++ try { ++ final String fileName = "./flamecord.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, ++ configuration); ++ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); ++ this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); ++ this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); ++ this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); ++ ++ if (!configurationExists) { ++ configurationProvider.save(configuration, configurationFile); ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ private int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { ++ return (int) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { ++ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ ++ return arg2; ++ } else { ++ return configuration.get(arg1); ++ } ++ } ++ ++ private Collection setIfUnexistant(final String arg1, final Collection arg2, ++ final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, new ArrayList<>(arg2)); ++ ++ return arg2; ++ } else { ++ return new HashSet<>(configuration.getStringList(arg1)); ++ } ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +new file mode 100644 +index 00000000..c88077ad +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -0,0 +1,129 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.text.MessageFormat; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Logger; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class MessagesConfiguration { ++ private final Logger logger; ++ private final Map messages = new HashMap<>(); ++ ++ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { ++ this.logger = logger; ++ ++ try { ++ final String fileName = "./messages.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_kick", "[Kicked] ", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_too_long", "Cannot have username longer than 16 characters", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("successfully_summoned", "&aSuccessfully summoned player(s)", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ ++ // FlameCord ++ setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); ++ setIfUnexistant("firewall_blocked", "&e{0}&c is firewalled from the proxy, request blocked!", ++ configuration); ++ setIfUnexistant("firewall_info", ++ "&aThere are&b {0} &aaddresses firewalled!\n&aThe firewall will clear in &b{1} &aseconds!", ++ configuration); ++ setIfUnexistant("firewall_cleared", "&b{0}&a addresses had been automatically removed from the firewall!", ++ configuration); ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall&7 >&b Shows information about the Firewall!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ ++ if (!configurationExists) { ++ configurationProvider.save(configuration, configurationFile); ++ } ++ ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); ++ ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); ++ } ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ public String getTranslation(final String name, final Object... args) { ++ if (!messages.containsKey(name)) { ++ logger.warning("[FlameCord] Tried to get translation '" + name ++ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); ++ } ++ ++ return MessageFormat.format(messages.getOrDefault(name, ""), args); ++ } ++ ++ private void setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ } ++ } ++} +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +new file mode 100644 +index 00000000..e82c4844 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +@@ -0,0 +1,94 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++ ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class ModulesConfiguration { ++ // Reconnect Module ++ public boolean reconnectEnabled = false; ++ ++ // Alert Module ++ public boolean alertEnabled = true; ++ ++ // Find Module ++ public boolean findEnabled = true; ++ ++ // IP Module ++ public boolean ipEnabled = true; ++ ++ // List Module ++ public boolean listEnabled = true; ++ ++ // Perms Module ++ public boolean permsEnabled = true; ++ ++ // Reload Module ++ public boolean reloadEnabled = true; ++ ++ // Send Module ++ public boolean sendEnabled = true; ++ ++ // Server ++ public boolean serverEnabled = true; ++ ++ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { ++ try { ++ final String fileName = "./modules.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); ++ ++ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); ++ ++ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); ++ ++ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); ++ ++ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); ++ ++ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); ++ ++ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); ++ ++ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); ++ ++ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, ++ configuration); ++ ++ if (!configurationExists) { ++ configurationProvider.save(configuration, configurationFile); ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ private String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { ++ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ ++ return arg2; ++ } else { ++ return configuration.get(arg1); ++ } ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java +new file mode 100644 +index 00000000..aca06844 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java +@@ -0,0 +1,19 @@ ++package dev._2lstudios.flamecord.firewall; ++ ++import java.net.SocketAddress; ++ ++public class FirewallException extends Exception { ++ private static final long serialVersionUID = 1L; ++ ++ public FirewallException(final SocketAddress address) { ++ super("The address " + address + " is blocked from the server!"); ++ } ++ ++ public FirewallException(final String string) { ++ super(string); ++ } ++ ++ public FirewallException(final String string, final Throwable throwable) { ++ super(string, throwable); ++ } ++} +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java +new file mode 100644 +index 00000000..8a474758 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java +@@ -0,0 +1,116 @@ ++package dev._2lstudios.flamecord.firewall; ++ ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.Collection; ++import java.util.HashSet; ++import java.util.logging.Logger; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import lombok.Getter; ++ ++public class FirewallManager { ++ private final Logger logger; ++ private final Collection whitelistedAddresses; ++ private final Collection firewalled; ++ private final int defaultSeconds; ++ @Getter ++ private int seconds; ++ ++ public FirewallManager(final Logger logger, final Collection whitelistedAddresses, ++ final int defaultSeconds) { ++ this.logger = logger; ++ this.whitelistedAddresses = whitelistedAddresses; ++ this.firewalled = new HashSet<>(); ++ this.defaultSeconds = defaultSeconds; ++ this.seconds = defaultSeconds; ++ } ++ ++ public boolean isWhitelisted(final SocketAddress address) { ++ final String addressString = address.toString(); ++ ++ for (final String whitelistedAddressString : whitelistedAddresses) { ++ if (addressString.endsWith(whitelistedAddressString)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public void addFirewalled(final SocketAddress address) { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ if (!this.firewalled.contains(hostString)) { ++ this.firewalled.add(hostString); ++ logAdded(address); ++ } ++ } ++ } ++ ++ public void logAdded(final SocketAddress address) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); ++ ++ if (flameCordConfiguration.isFirewallNotify()) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_added", hostString)); ++ } ++ } ++ ++ public void logBlocked(final SocketAddress address) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); ++ ++ if (flameCordConfiguration.isFirewallNotify()) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_blocked", hostString)); ++ } ++ } ++ ++ public Collection getFirewalled() { ++ return this.firewalled; ++ } ++ ++ public boolean isFirewalled(final SocketAddress address) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ ++ return this.firewalled.contains(iNetSocketAddress.getHostString()); ++ } ++ ++ public boolean isFirewalled(final String name) { ++ final String nameLowerCase = name.toLowerCase(); ++ ++ for (final String string : FlameCord.getInstance().getFlameCordConfiguration().getFirewallNames()) { ++ if (nameLowerCase.contains(string)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public void tick() { ++ if (--seconds <= 0) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final int size = this.firewalled.size(); ++ ++ if (size > 0) { ++ if (flameCord.getFlameCordConfiguration().isFirewallNotify()) { ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_cleared", size)); ++ } ++ ++ this.firewalled.clear(); ++ } ++ ++ this.seconds = defaultSeconds; ++ } ++ } ++} +\ No newline at end of file +diff --git a/log/.factorypath b/log/.factorypath +new file mode 100644 +index 00000000..542d5259 +--- /dev/null ++++ b/log/.factorypath +@@ -0,0 +1,7 @@ ++ ++ ++ ++ ++ ++ ++ +diff --git a/log4j/.factorypath b/log4j/.factorypath +new file mode 100644 +index 00000000..f08118bd +--- /dev/null ++++ b/log4j/.factorypath +@@ -0,0 +1,18 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/cmd-alert/.factorypath b/module/cmd-alert/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/cmd-alert/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/cmd-find/.factorypath b/module/cmd-find/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/cmd-find/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/cmd-list/.factorypath b/module/cmd-list/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/cmd-list/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/cmd-send/.factorypath b/module/cmd-send/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/cmd-send/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/cmd-server/.factorypath b/module/cmd-server/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/cmd-server/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/module/reconnect-yaml/.factorypath b/module/reconnect-yaml/.factorypath +new file mode 100644 +index 00000000..29bce69c +--- /dev/null ++++ b/module/reconnect-yaml/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/native/.factorypath b/native/.factorypath +new file mode 100644 +index 00000000..3ae914e6 +--- /dev/null ++++ b/native/.factorypath +@@ -0,0 +1,9 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pom.xml b/pom.xml +index 61920717..2126cda1 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -62,6 +62,9 @@ + proxy + query + native ++ ++ flamecord ++ + + + +diff --git a/protocol/.factorypath b/protocol/.factorypath +new file mode 100644 +index 00000000..192c13a0 +--- /dev/null ++++ b/protocol/.factorypath +@@ -0,0 +1,14 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/protocol/pom.xml b/protocol/pom.xml +index ba3ffe3d..9228f72a 100644 +--- a/protocol/pom.xml ++++ b/protocol/pom.xml +@@ -64,5 +64,14 @@ + 1.3.0 + compile + ++ ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ ${project.version} ++ compile ++ ++ + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index ec932e92..0d9ed57d 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -1,5 +1,6 @@ + package net.md_5.bungee.protocol; + ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufUtil; + import io.netty.channel.ChannelHandlerContext; +@@ -39,6 +40,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; ++ ++ // FlameCord - Check size before decoding ++ if (prot == protocol.TO_SERVER) { ++ final int readableBytes = in.readableBytes(); ++ final int capacity = in.capacity(); ++ ++ if (readableBytes > 2097152) { ++ throw new DecoderException("Error decoding packet with too many readableBytes: " + readableBytes); ++ } else if (capacity > 2097152) { ++ throw new DecoderException("Error decoding packet with too big capacity: " + capacity); ++ } ++ } ++ + ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( + + Object packetTypeInfo = null; +@@ -79,7 +93,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } else { + packetTypeStr = "unknown"; + } +- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall ++ ++ // FlameCord - Toggle Dumping packet info ++ // FlameCord - Change from FastDecoderException to DecoderException ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { ++ throw new DecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall ++ } else { ++ throw new DecoderException( "Error decoding packet " + packetTypeStr, e ); ++ } + } finally + { + if ( slice != null ) +diff --git a/proxy/.factorypath b/proxy/.factorypath +new file mode 100644 +index 00000000..b9f2c65d +--- /dev/null ++++ b/proxy/.factorypath +@@ -0,0 +1,37 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/proxy/pom.xml b/proxy/pom.xml +index 4bda0d62..0018d6f8 100644 +--- a/proxy/pom.xml ++++ b/proxy/pom.xml +@@ -113,6 +113,51 @@ + runtime + + ++ ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-alert ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-find ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-list ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-send ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-server ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-reconnect-yaml ++ ${project.version} ++ compile ++ ++ + + + +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +new file mode 100644 +index 00000000..fa0b59c2 +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -0,0 +1,71 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import java.util.Collection; ++import java.util.HashSet; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import dev._2lstudios.flamecord.firewall.FirewallManager; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.config.ServerInfo; ++import net.md_5.bungee.api.plugin.Command; ++ ++public class FlameCordCommand extends Command { ++private final BungeeCord bungeeCord; ++ ++ public FlameCordCommand(final BungeeCord bungeeCord) { ++ super("flamecord"); ++ ++ this.bungeeCord = bungeeCord; ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); ++ ++ if (sender.hasPermission("flamecord.usage")) { ++ if (args.length > 0) { ++ final String arg0 = args[0]; ++ ++ switch (arg0) { ++ case "firewall": { ++ final FirewallManager firewallManager = flameCord.getFirewallManager(); ++ final int amount = firewallManager.getFirewalled().size(), ++ seconds = firewallManager.getSeconds(); ++ ++ sender.sendMessage(TextComponent.fromLegacyText( ++ messagesConfiguration.getTranslation("firewall_info", amount, seconds))); ++ break; ++ } ++ case "reload": { ++ // FlameCord - Collect ips from servers ++ final Collection whitelistedAddresses = new HashSet<>(); ++ ++ for (final ServerInfo serverInfo : bungeeCord.getServers().values()) { ++ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); ++ } ++ ++ FlameCord.renew(bungeeCord.getLogger(), whitelistedAddresses); ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); ++ break; ++ } ++ default: { ++ sender.sendMessage(TextComponent.fromLegacyText( ++ messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ break; ++ } ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); ++ } ++ } ++} +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index 527f310e..a4ef6d3b 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { + YamlConfig config = new YamlConfig(new File("waterfall.yml")); + config.load(false); // Load, but no permissions + logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); +- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); ++ // FlameCord - Make the version look better ++ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); + useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index a17ed68e..e051b9c7 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -9,6 +9,10 @@ import com.google.common.collect.Sets; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + import com.google.gson.Gson; + import com.google.gson.GsonBuilder; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.FlameCordCommand; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; +@@ -86,6 +90,12 @@ import net.md_5.bungee.conf.Configuration; + import net.md_5.bungee.conf.YamlConfig; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.module.ModuleManager; ++import net.md_5.bungee.module.cmd.alert.CommandAlert; ++import net.md_5.bungee.module.cmd.find.CommandFind; ++import net.md_5.bungee.module.cmd.list.CommandList; ++import net.md_5.bungee.module.cmd.send.CommandSend; ++import net.md_5.bungee.module.cmd.server.CommandServer; ++import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; + import net.md_5.bungee.netty.PipelineUtils; + import net.md_5.bungee.protocol.DefinedPacket; + import net.md_5.bungee.protocol.ProtocolConstants; +@@ -232,11 +242,12 @@ public class BungeeCord extends ProxyServer + // Waterfall end + + pluginManager = new PluginManager( this ); +- getPluginManager().registerCommand( null, new CommandReload() ); +- getPluginManager().registerCommand( null, new CommandEnd() ); +- getPluginManager().registerCommand( null, new CommandIP() ); +- getPluginManager().registerCommand( null, new CommandBungee() ); +- getPluginManager().registerCommand( null, new CommandPerms() ); ++ // FlameCord - We register commands in our new method ++ //getPluginManager().registerCommand( null, new CommandReload() ); ++ //getPluginManager().registerCommand( null, new CommandEnd() ); ++ //getPluginManager().registerCommand( null, new CommandIP() ); ++ //getPluginManager().registerCommand( null, new CommandBungee() ); ++ //getPluginManager().registerCommand( null, new CommandPerms() ); + + if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) + { +@@ -285,6 +296,16 @@ public class BungeeCord extends ProxyServer + pluginManager.loadPlugins(); + config.load(); + ++ // FlameCord - Renew and register modules ++ final Collection whitelistedAddresses = new HashSet<>(); ++ ++ for (final ServerInfo serverInfo : getServers().values()) { ++ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); ++ } ++ ++ FlameCord.renew(logger, whitelistedAddresses); ++ registerModules(); ++ + if ( config.isForgeSupport() ) + { + registerChannel( ForgeConstants.FML_TAG ); +@@ -546,13 +567,13 @@ public class BungeeCord extends ProxyServer + @Override + public String getName() + { +- return "Travertine"; ++ return "FlameCord"; + } + + @Override + public String getVersion() + { +- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); ++ return "0.4.3"; + } + + public void reloadMessages() +@@ -815,4 +836,56 @@ public class BungeeCord extends ProxyServer + { + return new BungeeTitle(); + } ++ ++ // FlameCord - Method to simplify module registering ++ public void registerModules() { ++ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); ++ ++ // Bungeecord Commands ++ pluginManager.registerCommand(null, new CommandEnd()); ++ pluginManager.registerCommand(null, new CommandBungee()); ++ ++ if (modulesConfiguration.reloadEnabled) { ++ pluginManager.registerCommand(null, new CommandReload()); ++ } ++ if (modulesConfiguration.ipEnabled) { ++ pluginManager.registerCommand(null, new CommandIP()); ++ } ++ if (modulesConfiguration.permsEnabled) { ++ pluginManager.registerCommand(null, new CommandPerms()); ++ } ++ ++ // Modules Commands ++ if (modulesConfiguration.alertEnabled) { ++ pluginManager.registerCommand(null, new CommandAlert()); ++ } ++ if (modulesConfiguration.findEnabled) { ++ pluginManager.registerCommand(null, new CommandFind()); ++ } ++ if (modulesConfiguration.listEnabled) { ++ pluginManager.registerCommand(null, new CommandList()); ++ } ++ if (modulesConfiguration.sendEnabled) { ++ pluginManager.registerCommand(null, new CommandSend()); ++ } ++ if (modulesConfiguration.serverEnabled) { ++ pluginManager.registerCommand(null, new CommandServer()); ++ } ++ ++ try { ++ if (modulesConfiguration.reconnectEnabled) { ++ for (ListenerInfo info : getConfig().getListeners()) { ++ if (!info.isForceDefault() && getReconnectHandler() == null) { ++ setReconnectHandler(new YamlReconnectHandler()); ++ break; ++ } ++ } ++ } ++ } catch (final Exception exception) { ++ logger.warning("Reconnect module is not able to work on FlameCord!"); ++ } ++ ++ // Flamecord - Commands (Had to make it like this because of maven limitations) ++ pluginManager.registerCommand(null, new FlameCordCommand(this)); ++ } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +index ad9a6d0c..ad8f8733 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +@@ -40,25 +40,12 @@ public class BungeeCordLauncher + return; + } + +- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) +- { +- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); +- +- Calendar deadline = Calendar.getInstance(); +- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); +- if ( buildDate.before( deadline.getTime() ) ) +- { +- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); +- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); +- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); +- System.err.println( "*** Server will start in 10 seconds ***" ); +- Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); +- } +- } ++ // FlameCord - Disable update checker + + BungeeCord bungee = new BungeeCord(); + ProxyServer.setInstance( bungee ); +- bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); ++ // FlameCord - Use bungee name ++ bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); + bungee.start(); + + if ( !options.has( "noconsole" ) ) +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index c12085e1..3cfef373 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -1,6 +1,8 @@ + package net.md_5.bungee; + + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufAllocator; + import java.net.InetSocketAddress; +@@ -34,6 +36,7 @@ import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.HandlerBoss; + import net.md_5.bungee.netty.PacketHandler; + import net.md_5.bungee.netty.PipelineUtils; ++import net.md_5.bungee.protocol.BadPacketException; + import net.md_5.bungee.protocol.DefinedPacket; + import net.md_5.bungee.protocol.MinecraftDecoder; + import net.md_5.bungee.protocol.PacketWrapper; +@@ -125,7 +128,8 @@ public class ServerConnector extends PacketHandler + newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); + + // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. +- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); ++ // FlameCord - Change replaceAll() to replace() ++ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); + + // All done. + properties = newp; +@@ -160,7 +164,13 @@ public class ServerConnector extends PacketHandler + { + if ( packet.packet == null ) + { +- throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - Toggle Dumping packet info ++ // FlameCord - Change from QuietException to BadPacketException ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { ++ throw new BadPacketException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); ++ } else { ++ throw new BadPacketException( "Unexpected packet received during server connector process!" ); ++ } + } + } + +@@ -266,7 +276,8 @@ public class ServerConnector extends PacketHandler + user.getSentBossBars().clear(); + + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- user.getServer().disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ user.getServer().disconnect(); + } else + { + // Travertine start +@@ -361,13 +372,15 @@ public class ServerConnector extends PacketHandler + user.setDimension( login.getDimension() ); + + // Remove from old servers +- user.getServer().disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ user.getServer().disconnect(); + } + + // TODO: Fix this? + if ( !user.isActive() ) + { +- server.disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ server.disconnect(); + // Silly server admins see stack trace and die + bungee.getLogger().warning( "No client connected for pending server!" ); + return; +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 8c2a743a..26c0e560 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; + import net.md_5.bungee.api.Title; + import net.md_5.bungee.api.chat.BaseComponent; + import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.config.ListenerInfo; + import net.md_5.bungee.api.config.ServerInfo; + import net.md_5.bungee.api.connection.ProxiedPlayer; + import net.md_5.bungee.api.event.PermissionCheckEvent; +@@ -65,6 +66,7 @@ import net.md_5.bungee.tab.ServerUnique; + import net.md_5.bungee.tab.TabList; + import net.md_5.bungee.util.CaseInsensitiveSet; + import net.md_5.bungee.util.ChatComponentTransformer; ++import net.md_5.bungee.util.QuietException; + + @RequiredArgsConstructor + public final class UserConnection implements ProxiedPlayer +@@ -307,7 +309,8 @@ public final class UserConnection implements ProxiedPlayer + + if ( getServer() == null && !ch.isClosing() ) + { +- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); ++ // FlameCord - Change IllegalStateException to QuietException and explain that is a plugin ++ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); + } + return; + } +@@ -386,9 +389,11 @@ public final class UserConnection implements ProxiedPlayer + .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) + .remoteAddress( target.getAddress() ); + // Windows is bugged, multi homed users will just have to live with random connecting IPs +- if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) ++ // FlameCord - Use listenerInfo ++ final ListenerInfo listenerInfo = getPendingConnection().getListener(); ++ if ( listenerInfo.isSetLocalAddress() && !PlatformDependent.isWindows() && listenerInfo.getSocketAddress() instanceof InetSocketAddress ) + { +- b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); ++ b.localAddress( listenerInfo.getHost().getHostString(), 0 ); + } + b.connect().addListener( listener ); + } +@@ -425,7 +430,8 @@ public final class UserConnection implements ProxiedPlayer + if ( server != null ) + { + server.setObsolete( true ); +- server.disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ server.disconnect(); + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +index 4e2c6129..aeda7963 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +@@ -16,6 +16,7 @@ public class CommandBungee extends Command + @Override + public void execute(CommandSender sender, String[] args) + { +- sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ // FlameCord - Use custom version message ++ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +index 85d2197a..1294495d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +@@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig + /** + * Time before users are disconnected due to no network activity. + */ +- private int timeout = 30000; ++ // FlameCord - Default timeout to 10000 ++ private int timeout = 10000; + /** + * UUID used for metrics. + */ +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +index d4fad294..7994c1c1 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +@@ -22,6 +22,7 @@ import java.util.Locale; + import java.util.Map; + import java.util.logging.Level; + import lombok.RequiredArgsConstructor; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.Util; + import net.md_5.bungee.api.ChatColor; + import net.md_5.bungee.api.ProxyServer; +@@ -227,7 +228,8 @@ public class YamlConfig implements ConfigurationAdapter + Map val = entry.getValue(); + String name = entry.getKey(); + String addr = get( "address", "localhost:25565", val ); +- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); ++ // FlameCord - Use Bungee name instead ++ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); + boolean restricted = get( "restricted", false, val ); + SocketAddress address = Util.getAddr( addr ); + ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); +@@ -253,7 +255,8 @@ public class YamlConfig implements ConfigurationAdapter + + for ( Map val : base ) + { +- String motd = get( "motd", "&1Another Bungee server", val ); ++ // FlameCord - Use Bungee name instead ++ String motd = get( "motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val ); + motd = ChatColor.translateAlternateColorCodes( '&', motd ); + + int maxPlayers = get( "max_players", 1, val ); +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 +index d54d8539..474551d3 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -285,6 +285,7 @@ public class DownstreamBridge extends PacketHandler + throw CancelSendSignal.INSTANCE; + } + ++ // FlameCord - Use elseIfs + if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) + { + // Travertine start +@@ -313,8 +314,7 @@ public class DownstreamBridge extends PacketHandler + con.unsafe().sendPacket( pluginMessage ); + throw CancelSendSignal.INSTANCE; + } +- +- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) ++ else if ( pluginMessage.getTag().equals( "BungeeCord" ) ) + { + DataInput in = pluginMessage.getStream(); + ByteArrayDataOutput out = ByteStreams.newDataOutput(); +@@ -343,7 +343,7 @@ public class DownstreamBridge extends PacketHandler + // Null out stream, important as we don't want to send to ourselves + out = null; + } +- if ( subChannel.equals( "Forward" ) ) ++ else if ( subChannel.equals( "Forward" ) ) + { + // Read data from server + String target = in.readUTF(); +@@ -388,7 +388,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "Connect" ) ) ++ else if ( subChannel.equals( "Connect" ) ) + { + ServerInfo server = bungee.getServerInfo( in.readUTF() ); + if ( server != null ) +@@ -396,7 +396,7 @@ public class DownstreamBridge extends PacketHandler + con.connect( server, ServerConnectEvent.Reason.PLUGIN_MESSAGE ); + } + } +- if ( subChannel.equals( "ConnectOther" ) ) ++ else if ( subChannel.equals( "ConnectOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +@@ -408,7 +408,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "IP" ) ) ++ else if ( subChannel.equals( "IP" ) ) + { + out.writeUTF( "IP" ); + if ( con.getSocketAddress() instanceof InetSocketAddress ) +@@ -421,7 +421,7 @@ public class DownstreamBridge extends PacketHandler + out.writeInt( 0 ); + } + } +- if ( subChannel.equals( "IPOther" ) ) ++ else if ( subChannel.equals( "IPOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +@@ -440,7 +440,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "PlayerCount" ) ) ++ else if ( subChannel.equals( "PlayerCount" ) ) + { + String target = in.readUTF(); + out.writeUTF( "PlayerCount" ); +@@ -458,7 +458,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "PlayerList" ) ) ++ else if ( subChannel.equals( "PlayerList" ) ) + { + String target = in.readUTF(); + out.writeUTF( "PlayerList" ); +@@ -476,12 +476,12 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "GetServers" ) ) ++ else if ( subChannel.equals( "GetServers" ) ) + { + out.writeUTF( "GetServers" ); + out.writeUTF( Util.csv( bungee.getServers().keySet() ) ); + } +- if ( subChannel.equals( "Message" ) ) ++ else if ( subChannel.equals( "Message" ) ) + { + String target = in.readUTF(); + String message = in.readUTF(); +@@ -500,7 +500,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "MessageRaw" ) ) ++ else if ( subChannel.equals( "MessageRaw" ) ) + { + String target = in.readUTF(); + BaseComponent[] message = ComponentSerializer.parse( in.readUTF() ); +@@ -519,17 +519,17 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "GetServer" ) ) ++ else if ( subChannel.equals( "GetServer" ) ) + { + out.writeUTF( "GetServer" ); + out.writeUTF( server.getInfo().getName() ); + } +- if ( subChannel.equals( "UUID" ) ) ++ else if ( subChannel.equals( "UUID" ) ) + { + out.writeUTF( "UUID" ); + out.writeUTF( con.getUUID() ); + } +- if ( subChannel.equals( "UUIDOther" ) ) ++ else if ( subChannel.equals( "UUIDOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +@@ -539,18 +539,21 @@ public class DownstreamBridge extends PacketHandler + out.writeUTF( player.getUUID() ); + } + } +- if ( subChannel.equals( "ServerIP" ) ) ++ else if ( subChannel.equals( "ServerIP" ) ) + { + ServerInfo info = bungee.getServerInfo( in.readUTF() ); +- if ( info != null && !info.getAddress().isUnresolved() ) ++ // FlameCord use address ++ InetSocketAddress address = info.getAddress(); ++ if ( info != null && !address.isUnresolved() ) + { + out.writeUTF( "ServerIP" ); + out.writeUTF( info.getName() ); +- out.writeUTF( info.getAddress().getAddress().getHostAddress() ); +- out.writeShort( info.getAddress().getPort() ); ++ // FlameCord - Use getHostString ++ out.writeUTF( address.getHostString() ); ++ out.writeShort( address.getPort() ); + } + } +- if ( subChannel.equals( "KickPlayer" ) ) ++ else if ( subChannel.equals( "KickPlayer" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +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 fe6ff143..138dffa0 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 +@@ -19,6 +19,8 @@ import com.google.gson.Gson; + + import com.google.gson.JsonElement; + import com.google.gson.JsonObject; ++ ++import dev._2lstudios.flamecord.FlameCord; + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -52,6 +54,7 @@ import net.md_5.bungee.netty.PacketHandler; + import net.md_5.bungee.netty.PipelineUtils; + import net.md_5.bungee.netty.cipher.CipherDecoder; + import net.md_5.bungee.netty.cipher.CipherEncoder; ++import net.md_5.bungee.protocol.BadPacketException; + import net.md_5.bungee.protocol.DefinedPacket; + import net.md_5.bungee.protocol.PacketWrapper; + import net.md_5.bungee.protocol.Protocol; +@@ -155,7 +158,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( packet.packet == null ) + { +- throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - Toggle Dumping packet info ++ // FlameCord - Change from QuietException to BadPacketException ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { ++ throw new BadPacketException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); ++ } else { ++ throw new BadPacketException( "Unexpected packet received during server login process!" ); ++ } + } + } + +@@ -197,6 +206,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + ServerPing legacy = result.getResponse(); ++ ++ // FlameCord - Close and return if legacy == null ++ if (legacy == null) { ++ ch.close(); ++ return; ++ } ++ + String kickMessage; + + if ( v1_5 ) +@@ -267,6 +283,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); + } ++ ++ // FlameCord - Close if response is null ++ // FlameCord - Return if connection is closed ++ if (pingResult.getResponse() == null) { ++ ch.close(); ++ return; ++ } else if (ch.isClosed()) { ++ return; ++ } ++ + // Travertine start + if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) + { +@@ -307,11 +333,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void handle(PingPacket ping) throws Exception + { +- if (!ACCEPT_INVALID_PACKETS) { +- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); +- } ++ // FlameCord - Never accept invalid packets ++ Preconditions.checkState(thisState == State.PING, "Not expecting PING"); + unsafe.sendPacket( ping ); +- disconnect( "" ); ++ // FlameCord - Close instead of disconnect ++ ch.close(); + } + + @Override +@@ -341,13 +367,18 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); + +- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); ++ // FlameCord - Make PlayerHandshakeEvent cancellable ++ if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ++ ch.close(); ++ return; ++ } + + switch ( handshake.getRequestedProtocol() ) + { + case 1: + // Ping +- if ( bungee.getConfig().isLogPings() ) ++ // FlameCord - Toggle for initialhandler logger ++ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); + } +@@ -356,7 +387,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + break; + case 2: + // Login +- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall ++ // FlameCord - Toggle for initialhandler logger ++ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } +@@ -386,13 +418,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); + this.loginRequest = loginRequest; + +- if ( getName().contains( "." ) ) ++ // FlameCord - Use name ++ final String name = getName(); ++ ++ if ( name.contains( "." ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; + } + +- if ( getName().length() > 16 ) ++ if ( name.length() > 16 ) + { + disconnect( bungee.getTranslation( "name_too_long" ) ); + return; +@@ -431,11 +466,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection + if ( onlineMode ) + { + unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); ++ // FlameCord - Change state to encrypt only if onlineMode is true ++ thisState = State.ENCRYPT; + } else + { + finish(); + } +- thisState = State.ENCRYPT; + } + }; + +@@ -447,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(final EncryptionResponse encryptResponse) throws Exception + { + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); ++ // FlameCord - Finish here to avoid multiple incoming packets ++ thisState = State.FINISHED; + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); +@@ -481,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + loginProfile = obj; + name = obj.getName(); +- uniqueId = Util.getUUID( obj.getId() ); ++ // FlameCord - Don't declare uuid unless it's null ++ if (uniqueId == null) { ++ uniqueId = Util.getUUID(obj.getId()); ++ } + finish(); + return; + } +@@ -499,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + private void finish() + { ++ // FlameCord - Finish here to avoid multiple incoming packets ++ thisState = State.FINISHED; ++ + if ( isOnlineMode() ) + { + // Check for multiple connections +@@ -580,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); +- +- thisState = State.FINISHED; + } + } + } ); +@@ -615,7 +657,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( canSendKickMessage() ) + { +- ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) ); ++ // FlameCord - Changed delayedClose to close ++ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); + } else + { + ch.close(); +@@ -672,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void setUniqueId(UUID uuid) + { + Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); +- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); ++ // FlameCord - Allow custom uuids even if onlineMode is true + this.uniqueId = uuid; + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +index 6cd71071..09909bd9 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +@@ -1,6 +1,8 @@ + package net.md_5.bungee.connection; + + import com.google.gson.Gson; ++ ++import dev._2lstudios.flamecord.FlameCord; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -12,6 +14,7 @@ import net.md_5.bungee.api.config.ServerInfo; + import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.PacketHandler; + import net.md_5.bungee.netty.PipelineUtils; ++import net.md_5.bungee.protocol.BadPacketException; + import net.md_5.bungee.protocol.MinecraftDecoder; + import net.md_5.bungee.protocol.MinecraftEncoder; + import net.md_5.bungee.protocol.PacketWrapper; +@@ -58,7 +61,13 @@ public class PingHandler extends PacketHandler + { + if ( packet.packet == null ) + { +- throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - Toggle dumping packet info ++ // FlameCord - Change from QuietException to BadPacketException ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { ++ throw new BadPacketException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); ++ } else { ++ throw new BadPacketException( "Unexpected packet received during ping process!" ); ++ } + } + } + +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 ad3bdee5..c05714ba 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 +@@ -92,6 +92,7 @@ public class UpstreamBridge extends PacketHandler + } + // Travertine end + } ++ // FlameCord - Remove "Quitting" reason + con.getServer().disconnect( "Quitting" ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 6dc5633f..606866a5 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -5,6 +5,8 @@ import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandler; + import io.netty.channel.ChannelHandlerContext; ++import io.netty.channel.ChannelPipeline; ++ + import java.net.SocketAddress; + import java.util.concurrent.TimeUnit; + import lombok.Getter; +@@ -37,14 +39,18 @@ public class ChannelWrapper + + public void setProtocol(Protocol protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); + } + + public void setVersion(int protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); + } + + public void write(Object packet) +@@ -80,40 +86,27 @@ public class ChannelWrapper + + if ( packet != null && ch.isActive() ) + { +- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); ++ // FlameCord - Remove the firing of exceptions on failure ++ ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.CLOSE ); + } else + { +- ch.flush(); ++ // FlameCord - Don't flush just close + ch.close(); + } + } + } + ++ // FlameCord - Deprecate and "disable" delayedClose because it doesn't have a reason to exist ++ @Deprecated + public void delayedClose(final Kick kick) + { +- if ( !closing ) +- { +- closing = true; +- +- // Minecraft client can take some time to switch protocols. +- // Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it. +- // Delay 250ms to ensure that the protocol switch (if any) has definitely taken place. +- ch.eventLoop().schedule( new Runnable() +- { +- +- @Override +- public void run() +- { +- close( kick ); +- } +- }, 250, TimeUnit.MILLISECONDS ); +- } ++ close(kick); + } + + public void addBefore(String baseName, String name, ChannelHandler handler) + { + Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); +- ch.pipeline().flush(); ++ // FlameCord - Don't flush if not necessary + ch.pipeline().addBefore( baseName, name, handler ); + } + +@@ -124,25 +117,27 @@ public class ChannelWrapper + + public void setCompressionThreshold(int compressionThreshold) + { +- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); + } + if ( compressionThreshold != -1 ) + { +- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); ++ pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); + } else + { +- ch.pipeline().remove( "compress" ); ++ pipeline.remove( "compress" ); + } + +- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) ++ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); + } + if ( compressionThreshold == -1 ) + { +- ch.pipeline().remove( "decompress" ); ++ pipeline.remove( "decompress" ); + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 989bfd87..46e338ca 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -1,6 +1,9 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.firewall.FirewallException; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInboundHandlerAdapter; + import io.netty.handler.codec.CorruptedFrameException; +@@ -9,6 +12,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; + import io.netty.handler.timeout.ReadTimeoutException; + import java.io.IOException; + import java.net.InetSocketAddress; ++import java.net.SocketAddress; + import java.util.logging.Level; + import net.md_5.bungee.api.ProxyServer; + import net.md_5.bungee.connection.CancelSendSignal; +@@ -39,12 +43,20 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception + { ++ // FlameCord - Firewall system ++ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); ++ ++ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { ++ throw new FirewallException(remoteAddress); ++ } ++ + if ( handler != null ) + { + channel = new ChannelWrapper( ctx ); + handler.connected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Added isLoggerInitialhandler boolean ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + } +@@ -56,10 +68,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + if ( handler != null ) + { +- channel.markClosed(); ++ // FlameCord - close instead of markClosed ++ channel.close(); + handler.disconnected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Added isLoggerInitialhandler boolean ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); + } +@@ -78,6 +92,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception + { ++ // FlameCord - Return if channel isn't active ++ if (!ctx.channel().isActive()) { ++ return; ++ } ++ + if ( msg instanceof HAProxyMessage ) + { + HAProxyMessage proxy = (HAProxyMessage) msg; +@@ -124,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + if ( ctx.channel().isActive() ) + { +- boolean logExceptions = !( handler instanceof PingHandler ); ++ // FlameCord - Use flamecord ++ final FlameCord flameCord = FlameCord.getInstance(); ++ // FlameCord - log exceptions based on FlameCord configuration and FirewallException ++ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions() && !(cause instanceof FirewallException); ++ ++ // FlameCord - Firewall system ++ if (cause instanceof DecoderException || cause instanceof IllegalStateException || cause instanceof BadPacketException) { ++ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); ++ ++ if (remoteAddress != null) { ++ flameCord.getFirewallManager().addFirewalled(remoteAddress); ++ } ++ } ++ ++ // FlameCord - Handle firewall exceptions ++ if (cause instanceof FirewallException) { ++ flameCord.getFirewallManager().logBlocked(ctx.channel().remoteAddress()); ++ } + + if ( logExceptions ) + { +@@ -180,8 +216,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); + } + } +- +- ctx.close(); + } ++ ++ // FlameCord - Close even if the channel isn't active ++ ctx.close(); + } + } +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 9a39f69e..008b03cb 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,10 +1,14 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.firewall.FirewallException; + import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; + import io.netty.channel.ChannelException; ++import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInitializer; + import io.netty.channel.ChannelOption; + import io.netty.channel.EventLoopGroup; +@@ -60,6 +64,11 @@ public class PipelineUtils + { + SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + ++ // FlameCord - Firewall system ++ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { ++ throw new FirewallException(remoteAddress); ++ } ++ + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) + { + ch.close(); +@@ -102,6 +111,16 @@ public class PipelineUtils + + BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); + } ++ ++ // FlameCord - Close on exception caught ++ @Override ++ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { ++ cause.printStackTrace(); ++ } ++ ++ ctx.close(); ++ } + }; + public static final Base BASE = new Base(); + private static final KickStringWriter legacyKicker = new KickStringWriter(); +diff --git a/query/.factorypath b/query/.factorypath +new file mode 100644 +index 00000000..7bec3430 +--- /dev/null ++++ b/query/.factorypath +@@ -0,0 +1,17 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index 0c1ecfb8..b3bdfd05 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler + if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) + { + bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); ++ // FlameCord - Close on incorrect magic ++ ctx.close(); + return; + } + +-- +2.27.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-Initial-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-Initial-Patch.patch deleted file mode 100644 index 4e51eaf2..00000000 --- a/Waterfall-Proxy-Patches/0004-FlameCord-Initial-Patch.patch +++ /dev/null @@ -1,11109 +0,0 @@ -From dbd1f205759879cade80260550eab994705145c3 Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata -Date: Sat, 15 Aug 2020 15:19:22 -0300 -Subject: [PATCH] FlameCord Initial Patch - - -diff --git a/api/.factorypath b/api/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/api/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/api/pom.xml b/api/pom.xml -index d3016c10..365457d6 100644 ---- a/api/pom.xml -+++ b/api/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -index cf85ca06..da5082ed 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -@@ -1,10 +1,12 @@ - package net.md_5.bungee.api.event; - --import com.google.common.base.Preconditions; - import java.util.Map; - import java.util.concurrent.ConcurrentHashMap; - import java.util.concurrent.atomic.AtomicBoolean; - import java.util.concurrent.atomic.AtomicInteger; -+ -+import com.google.common.base.Preconditions; -+ - import lombok.AccessLevel; - import lombok.Data; - import lombok.EqualsAndHashCode; -@@ -23,8 +25,7 @@ import net.md_5.bungee.api.plugin.Plugin; - @Getter(AccessLevel.NONE) - @ToString(callSuper = true) - @EqualsAndHashCode(callSuper = true) --public class AsyncEvent extends Event --{ -+public class AsyncEvent extends Event { - - private final Callback done; - private final Map intents = new ConcurrentHashMap<>(); -@@ -33,61 +34,59 @@ public class AsyncEvent extends Event - - @Override - @SuppressWarnings("unchecked") -- public void postCall() -- { -- if ( latch.get() == 0 ) -- { -- done.done( (T) this, null ); -+ public void postCall() { -+ if (latch.get() == 0) { -+ done.done((T) this, null); - } -- fired.set( true ); -+ fired.set(true); - } - - /** - * Register an intent that this plugin will continue to perform work on a - * background task, and wishes to let the event proceed once the registered - * background task has completed. Multiple intents can be registered by a -- * plugin, but the plugin must complete the same amount of intents for the -- * event to proceed. -+ * plugin, but the plugin must complete the same amount of intents for the event -+ * to proceed. - * - * @param plugin the plugin registering this intent - */ -- public void registerIntent(Plugin plugin) -- { -- Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); -+ public void registerIntent(Plugin plugin) { -+ Preconditions.checkState(!fired.get(), "Event %s has already been fired", this); - -- AtomicInteger intentCount = intents.get( plugin ); -- if ( intentCount == null ) -- { -- intents.put( plugin, new AtomicInteger( 1 ) ); -- } else -- { -+ AtomicInteger intentCount = intents.get(plugin); -+ if (intentCount == null) { -+ intents.put(plugin, new AtomicInteger(1)); -+ } else { - intentCount.incrementAndGet(); - } - latch.incrementAndGet(); - } - - /** -- * Notifies this event that this plugin has completed an intent and wishes -- * to let the event proceed once all intents have been completed. -+ * Notifies this event that this plugin has completed an intent and wishes to -+ * let the event proceed once all intents have been completed. - * - * @param plugin a plugin which has an intent registered for this event - */ - @SuppressWarnings("unchecked") -- public void completeIntent(Plugin plugin) -- { -- AtomicInteger intentCount = intents.get( plugin ); -- Preconditions.checkState( intentCount != null && intentCount.get() > 0, "Plugin %s has not registered intents for event %s", plugin, this ); -+ public void completeIntent(Plugin plugin) { -+ AtomicInteger intentCount = intents.get(plugin); -+ Preconditions.checkState(intentCount != null && intentCount.get() > 0, -+ "Plugin %s has not registered intents for event %s", plugin, this); - - intentCount.decrementAndGet(); -- if ( fired.get() ) -- { -- if ( latch.decrementAndGet() == 0 ) -- { -- done.done( (T) this, null ); -+ if (fired.get()) { -+ if (latch.decrementAndGet() == 0) { -+ done.done((T) this, null); - } -- } else -- { -+ } else { - latch.decrementAndGet(); - } - } -+ -+ // FlameCord start - Added getDone() by request -+ public Callback getDone() { -+ return this.done; -+ } -+ // FlameCord end - Added getDone() by request - } -diff --git a/bootstrap/.factorypath b/bootstrap/.factorypath -new file mode 100644 -index 00000000..c6fe9856 ---- /dev/null -+++ b/bootstrap/.factorypath -@@ -0,0 +1,37 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 078c5b1a..ec4202db 100644 ---- a/bootstrap/pom.xml -+++ b/bootstrap/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/chat/.factorypath b/chat/.factorypath -new file mode 100644 -index 00000000..ed4e646c ---- /dev/null -+++ b/chat/.factorypath -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -+ -diff --git a/chat/pom.xml b/chat/pom.xml -index 29094871..863832b5 100644 ---- a/chat/pom.xml -+++ b/chat/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/config/.factorypath b/config/.factorypath -new file mode 100644 -index 00000000..6e60b565 ---- /dev/null -+++ b/config/.factorypath -@@ -0,0 +1,7 @@ -+ -+ -+ -+ -+ -+ -+ -diff --git a/config/pom.xml b/config/pom.xml -index 18f0a14e..f6d6d160 100644 ---- a/config/pom.xml -+++ b/config/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/event/.factorypath b/event/.factorypath -new file mode 100644 -index 00000000..f398f41e ---- /dev/null -+++ b/event/.factorypath -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ -diff --git a/event/pom.xml b/event/pom.xml -index 592bef24..91e739bc 100644 ---- a/event/pom.xml -+++ b/event/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/flamecord/.factorypath b/flamecord/.factorypath -new file mode 100644 -index 00000000..f398f41e ---- /dev/null -+++ b/flamecord/.factorypath -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ -diff --git a/flamecord/pom.xml b/flamecord/pom.xml -new file mode 100644 -index 00000000..939f1c2d ---- /dev/null -+++ b/flamecord/pom.xml -@@ -0,0 +1,44 @@ -+ -+ 4.0.0 -+ -+ -+ io.github.waterfallmc -+ travertine-parent -+ 1.16-R0.4-SNAPSHOT -+ ../pom.xml -+ -+ -+ dev._2lstudios.flamecord -+ travertine-flamecord -+ 1.16-R0.4-SNAPSHOT -+ jar -+ -+ Travertine-FlameCord -+ FlameCord contains security essentials and new configuration options -+ -+ -+ -+ io.github.waterfallmc -+ travertine-config -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-chat -+ ${project.version} -+ compile -+ -+ -+ -+ -+ ${project.name} -+ -+ -+ true -+ ${basedir}/src/main/resources -+ -+ -+ -+ -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -new file mode 100644 -index 00000000..3a7f56ee ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,57 @@ -+package dev._2lstudios.flamecord; -+ -+import java.util.logging.Logger; -+ -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; -+import lombok.Getter; -+import net.md_5.bungee.config.ConfigurationProvider; -+import net.md_5.bungee.config.YamlConfiguration; -+ -+public class FlameCord { -+ @Getter -+ private static FlameCord instance; -+ @Getter -+ private final FirewallManager firewallManager; -+ @Getter -+ private final FlameCordConfiguration flameCordConfiguration; -+ @Getter -+ private final ModulesConfiguration modulesConfiguration; -+ @Getter -+ private final MessagesConfiguration messagesConfiguration; -+ private final Thread thread; -+ -+ public static void renew(final Logger logger) { -+ if (FlameCord.instance != null) { -+ FlameCord.instance.thread.interrupt(); -+ } -+ -+ FlameCord.instance = new FlameCord(logger); -+ } -+ -+ private FlameCord(final Logger logger) { -+ final ConfigurationProvider configurationProvider = YamlConfiguration.getProvider(YamlConfiguration.class); -+ -+ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); -+ this.firewallManager = new FirewallManager(logger, flameCordConfiguration.getFirewallSeconds()); -+ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); -+ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -+ this.thread = new Thread() { -+ @Override -+ public void run() { -+ try { -+ for (;;) { -+ firewallManager.tick(); -+ -+ sleep(1000L); -+ } -+ } catch (final Exception e) { -+ } -+ } -+ }; -+ -+ this.thread.start(); -+ } -+} -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -new file mode 100644 -index 00000000..b7268e1d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,81 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.Collection; -+import java.util.HashSet; -+ -+import lombok.Getter; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class FlameCordConfiguration { -+ @Getter -+ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, -+ firewallEnabled = true; -+ @Getter -+ private int firewallSeconds = 60; -+ @Getter -+ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); -+ -+ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { -+ try { -+ final String fileName = "./flamecord.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, -+ configuration); -+ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -+ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); -+ this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); -+ this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); -+ this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { -+ return (int) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { -+ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ -+ return arg2; -+ } else { -+ return configuration.get(arg1); -+ } -+ } -+ -+ private Collection setIfUnexistant(final String arg1, final Collection arg2, -+ final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, new ArrayList<>(arg2)); -+ -+ return arg2; -+ } else { -+ return new HashSet<>(configuration.getStringList(arg1)); -+ } -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -new file mode 100644 -index 00000000..c88077ad ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,129 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.text.MessageFormat; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class MessagesConfiguration { -+ private final Logger logger; -+ private final Map messages = new HashMap<>(); -+ -+ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { -+ this.logger = logger; -+ -+ try { -+ final String fileName = "./messages.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_kick", "[Kicked] ", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_too_long", "Cannot have username longer than 16 characters", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("successfully_summoned", "&aSuccessfully summoned player(s)", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ -+ // FlameCord -+ setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); -+ setIfUnexistant("firewall_blocked", "&e{0}&c is firewalled from the proxy, request blocked!", -+ configuration); -+ setIfUnexistant("firewall_info", -+ "&aThere are&b {0} &aaddresses firewalled!\n&aThe firewall will clear in &b{1} &aseconds!", -+ configuration); -+ setIfUnexistant("firewall_cleared", "&b{0}&a addresses had been automatically removed from the firewall!", -+ configuration); -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall&7 >&b Shows information about the Firewall!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public String getTranslation(final String name, final Object... args) { -+ if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name -+ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); -+ } -+ -+ return MessageFormat.format(messages.getOrDefault(name, ""), args); -+ } -+ -+ private void setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ } -+ } -+} -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -new file mode 100644 -index 00000000..e82c4844 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -@@ -0,0 +1,94 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+ -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class ModulesConfiguration { -+ // Reconnect Module -+ public boolean reconnectEnabled = false; -+ -+ // Alert Module -+ public boolean alertEnabled = true; -+ -+ // Find Module -+ public boolean findEnabled = true; -+ -+ // IP Module -+ public boolean ipEnabled = true; -+ -+ // List Module -+ public boolean listEnabled = true; -+ -+ // Perms Module -+ public boolean permsEnabled = true; -+ -+ // Reload Module -+ public boolean reloadEnabled = true; -+ -+ // Send Module -+ public boolean sendEnabled = true; -+ -+ // Server -+ public boolean serverEnabled = true; -+ -+ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { -+ try { -+ final String fileName = "./modules.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); -+ -+ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); -+ -+ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); -+ -+ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); -+ -+ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); -+ -+ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); -+ -+ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); -+ -+ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); -+ -+ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, -+ configuration); -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { -+ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ -+ return arg2; -+ } else { -+ return configuration.get(arg1); -+ } -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -new file mode 100644 -index 00000000..aca06844 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -@@ -0,0 +1,19 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.SocketAddress; -+ -+public class FirewallException extends Exception { -+ private static final long serialVersionUID = 1L; -+ -+ public FirewallException(final SocketAddress address) { -+ super("The address " + address + " is blocked from the server!"); -+ } -+ -+ public FirewallException(final String string) { -+ super(string); -+ } -+ -+ public FirewallException(final String string, final Throwable throwable) { -+ super(string, throwable); -+ } -+} -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -new file mode 100644 -index 00000000..a90c8426 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -@@ -0,0 +1,101 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.Collection; -+import java.util.HashSet; -+import java.util.logging.Logger; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import lombok.Getter; -+ -+public class FirewallManager { -+ private final Logger logger; -+ private final Collection firewalled; -+ private final int defaultSeconds; -+ @Getter -+ private int seconds; -+ -+ public FirewallManager(final Logger logger, final int defaultSeconds) { -+ this.logger = logger; -+ this.firewalled = new HashSet<>(); -+ this.defaultSeconds = defaultSeconds; -+ this.seconds = defaultSeconds; -+ } -+ -+ public void addFirewalled(final SocketAddress address) { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ if (!this.firewalled.contains(hostString)) { -+ this.firewalled.add(hostString); -+ logAdded(address); -+ } -+ } -+ } -+ -+ public void logAdded(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_added", hostString)); -+ } -+ } -+ -+ public void logBlocked(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_blocked", hostString)); -+ } -+ } -+ -+ public Collection getFirewalled() { -+ return this.firewalled; -+ } -+ -+ public boolean isFirewalled(final SocketAddress address) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ -+ return this.firewalled.contains(iNetSocketAddress.getHostString()); -+ } -+ -+ public boolean isFirewalled(final String name) { -+ final String nameLowerCase = name.toLowerCase(); -+ -+ for (final String string : FlameCord.getInstance().getFlameCordConfiguration().getFirewallNames()) { -+ if (nameLowerCase.contains(string)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public void tick() { -+ if (--seconds <= 0) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final int size = this.firewalled.size(); -+ -+ if (size > 0) { -+ if (flameCord.getFlameCordConfiguration().isFirewallNotify()) { -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_cleared", size)); -+ } -+ -+ this.firewalled.clear(); -+ } -+ -+ this.seconds = defaultSeconds; -+ } -+ } -+} -\ No newline at end of file -diff --git a/log/.factorypath b/log/.factorypath -new file mode 100644 -index 00000000..542d5259 ---- /dev/null -+++ b/log/.factorypath -@@ -0,0 +1,7 @@ -+ -+ -+ -+ -+ -+ -+ -diff --git a/log/pom.xml b/log/pom.xml -index 3ef8acf2..e0177785 100644 ---- a/log/pom.xml -+++ b/log/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/log4j/.factorypath b/log4j/.factorypath -new file mode 100644 -index 00000000..f08118bd ---- /dev/null -+++ b/log4j/.factorypath -@@ -0,0 +1,18 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/log4j/pom.xml b/log4j/pom.xml -index ca18158f..bf76e567 100644 ---- a/log4j/pom.xml -+++ b/log4j/pom.xml -@@ -1,5 +1,5 @@ -- -+ - 4.0.0 - - -diff --git a/log4j/src/main/java/io/github/waterfallmc/waterfall/log4j/Log4JLogHandler.java b/log4j/src/main/java/io/github/waterfallmc/waterfall/log4j/Log4JLogHandler.java -index 63f66d3c..721cbb5e 100644 ---- a/log4j/src/main/java/io/github/waterfallmc/waterfall/log4j/Log4JLogHandler.java -+++ b/log4j/src/main/java/io/github/waterfallmc/waterfall/log4j/Log4JLogHandler.java -@@ -16,9 +16,11 @@ import java.util.logging.LogRecord; - /** - * A {@link Handler} that forwards all log messages to the Log4J logger. - * -- *

We don't use Log4J's custom JUL LogManager currently, because it breaks -+ *

-+ * We don't use Log4J's custom JUL LogManager currently, because it breaks - * adding custom handlers to JUL loggers. Some plugins may depend on that -- * functionality...

-+ * functionality... -+ *

- */ - class Log4JLogHandler extends Handler { - -diff --git a/log4j/src/main/resources/log4j2-bungee.xml b/log4j/src/main/resources/log4j2-bungee.xml -index 6e9c09c5..42059c2a 100644 ---- a/log4j/src/main/resources/log4j2-bungee.xml -+++ b/log4j/src/main/resources/log4j2-bungee.xml -@@ -1,20 +1,21 @@ - - -+ - - - - -- -+ - -- -+ - - - - - -- -+ - -- -+ - - - -diff --git a/log4j/src/main/resources/log4j2.xml b/log4j/src/main/resources/log4j2.xml -index 3b3525f0..89352ebe 100644 ---- a/log4j/src/main/resources/log4j2.xml -+++ b/log4j/src/main/resources/log4j2.xml -@@ -3,9 +3,9 @@ - - - -- -+ - -- -+ - - - -diff --git a/module/cmd-alert/.factorypath b/module/cmd-alert/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/cmd-alert/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 83bc7a7d..f45742c6 100644 ---- a/module/cmd-alert/pom.xml -+++ b/module/cmd-alert/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/cmd-find/.factorypath b/module/cmd-find/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/cmd-find/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index 42fb0a11..b717fb3b 100644 ---- a/module/cmd-find/pom.xml -+++ b/module/cmd-find/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/cmd-list/.factorypath b/module/cmd-list/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/cmd-list/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index cc2e55f9..9f3cf2f1 100644 ---- a/module/cmd-list/pom.xml -+++ b/module/cmd-list/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/cmd-send/.factorypath b/module/cmd-send/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/cmd-send/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index af82bb2c..7b5dae7a 100644 ---- a/module/cmd-send/pom.xml -+++ b/module/cmd-send/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/cmd-server/.factorypath b/module/cmd-server/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/cmd-server/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 8d96679e..474e7eb4 100644 ---- a/module/cmd-server/pom.xml -+++ b/module/cmd-server/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/pom.xml b/module/pom.xml -index ca1f7487..51b58ada 100644 ---- a/module/pom.xml -+++ b/module/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/module/reconnect-yaml/.factorypath b/module/reconnect-yaml/.factorypath -new file mode 100644 -index 00000000..7a4b5ae4 ---- /dev/null -+++ b/module/reconnect-yaml/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index e6ee3cd8..23e319da 100644 ---- a/module/reconnect-yaml/pom.xml -+++ b/module/reconnect-yaml/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/native/.factorypath b/native/.factorypath -new file mode 100644 -index 00000000..0b31e14c ---- /dev/null -+++ b/native/.factorypath -@@ -0,0 +1,9 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/native/pom.xml b/native/pom.xml -index 28d1a02c..3aa9efa9 100644 ---- a/native/pom.xml -+++ b/native/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/pom.xml b/pom.xml -index 94e4aca2..7f0152ab 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -@@ -47,6 +46,14 @@ - - fuzzybot - -+ -+ -+ LinsaFTW -+ -+ -+ Sammwy -+ -+ - - - -@@ -62,6 +69,8 @@ - proxy - query - native -+ -+ flamecord - - - -@@ -91,7 +100,7 @@ - - - unknown -- 4.1.49.Final -+ 4.1.51.Final - 1.8 - 1.8 - UTF-8 -diff --git a/protocol/.factorypath b/protocol/.factorypath -new file mode 100644 -index 00000000..739c34b9 ---- /dev/null -+++ b/protocol/.factorypath -@@ -0,0 +1,14 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/protocol/pom.xml b/protocol/pom.xml -index ba3ffe3d..bdb8b8c8 100644 ---- a/protocol/pom.xml -+++ b/protocol/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -@@ -46,6 +45,14 @@ - ${project.version} - compile - -+ -+ -+ dev._2lstudios.flamecord -+ travertine-flamecord -+ ${project.version} -+ compile -+ -+ - - io.netty - netty-codec -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 -index 6ba7ae70..e7a5682b 100644 ---- 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,151 +11,140 @@ import java.io.IOException; - import java.util.ArrayList; - import java.util.List; - import java.util.UUID; -+ -+import com.google.common.base.Charsets; -+ -+import io.netty.buffer.ByteBuf; - import lombok.RequiredArgsConstructor; - import se.llbit.nbt.NamedTag; - import se.llbit.nbt.Tag; - - @RequiredArgsConstructor --public abstract class DefinedPacket --{ -+public abstract class DefinedPacket { - - private static final boolean PROCESS_TRACES = Boolean.getBoolean("waterfall.bad-packet-traces"); -- private static final BadPacketException OVERSIZED_VAR_INT_EXCEPTION = new BadPacketException( "VarInt too big" ); -- private static final BadPacketException NO_MORE_BYTES_EXCEPTION = new BadPacketException("No more bytes reading varint"); -- public static void writeString(String s, ByteBuf buf) -- { -- if ( s.length() > Short.MAX_VALUE ) -- { -- throw new OverflowPacketException( String.format( "Cannot send string longer than Short.MAX_VALUE (got %s characters)", s.length() ) ); -+ private static final BadPacketException OVERSIZED_VAR_INT_EXCEPTION = new BadPacketException("VarInt too big"); -+ private static final BadPacketException NO_MORE_BYTES_EXCEPTION = new BadPacketException( -+ "No more bytes reading varint"); -+ -+ public static void writeString(String s, ByteBuf buf) { -+ if (s.length() > Short.MAX_VALUE) { -+ throw new OverflowPacketException( -+ String.format("Cannot send string longer than Short.MAX_VALUE (got %s characters)", s.length())); - } - -- byte[] b = s.getBytes( Charsets.UTF_8 ); -- writeVarInt( b.length, buf ); -- buf.writeBytes( b ); -+ byte[] b = s.getBytes(Charsets.UTF_8); -+ writeVarInt(b.length, buf); -+ buf.writeBytes(b); - } - -- public static String readString(ByteBuf buf) -- { -- int len = readVarInt( buf ); -- if ( len > Short.MAX_VALUE ) -- { -- throw new OverflowPacketException( String.format( "Cannot receive string longer than Short.MAX_VALUE (got %s characters)", len ) ); -+ public static String readString(ByteBuf buf) { -+ int len = readVarInt(buf); -+ if (len > Short.MAX_VALUE) { -+ throw new OverflowPacketException( -+ String.format("Cannot receive string longer than Short.MAX_VALUE (got %s characters)", len)); - } - -- byte[] b = new byte[ len ]; -- buf.readBytes( b ); -+ byte[] b = new byte[len]; -+ buf.readBytes(b); - -- return new String( b, Charsets.UTF_8 ); -+ return new String(b, Charsets.UTF_8); - } - - // Waterfall start -- public static void writeString(String s, final int maxLength, ByteBuf buf) -- { -- if ( s.length() > maxLength ) -- { -- throw new OverflowPacketException( String.format( "Cannot send string longer than %s (got %s characters)", maxLength, s.length() ) ); -+ public static void writeString(String s, final int maxLength, ByteBuf buf) { -+ if (s.length() > maxLength) { -+ throw new OverflowPacketException( -+ String.format("Cannot send string longer than %s (got %s characters)", maxLength, s.length())); - } - -- byte[] b = s.getBytes( Charsets.UTF_8 ); -- writeVarInt( b.length, buf ); -- buf.writeBytes( b ); -+ byte[] b = s.getBytes(Charsets.UTF_8); -+ writeVarInt(b.length, buf); -+ buf.writeBytes(b); - } - -- public static String readString(ByteBuf buf, final int maxLength) -- { -- int len = readVarInt( buf ); -- if ( len > maxLength ) -- { -- throw new OverflowPacketException( String.format( "Cannot receive string longer than %s (got %s characters)", maxLength, len ) ); -+ public static String readString(ByteBuf buf, final int maxLength) { -+ int len = readVarInt(buf); -+ if (len > maxLength) { -+ throw new OverflowPacketException( -+ String.format("Cannot receive string longer than %s (got %s characters)", maxLength, len)); - } - -- byte[] b = new byte[ len ]; -- buf.readBytes( b ); -+ byte[] b = new byte[len]; -+ buf.readBytes(b); - -- return new String( b, Charsets.UTF_8 ); -+ return new String(b, Charsets.UTF_8); - } - // Waterfall end - -- public static void writeArray(byte[] b, ByteBuf buf) -- { -- if ( b.length > Short.MAX_VALUE ) -- { -- throw new OverflowPacketException( String.format( "Cannot send byte array longer than Short.MAX_VALUE (got %s bytes)", b.length ) ); -+ public static void writeArray(byte[] b, ByteBuf buf) { -+ if (b.length > Short.MAX_VALUE) { -+ throw new OverflowPacketException( -+ String.format("Cannot send byte array longer than Short.MAX_VALUE (got %s bytes)", b.length)); - } -- writeVarInt( b.length, buf ); -- buf.writeBytes( b ); -+ writeVarInt(b.length, buf); -+ buf.writeBytes(b); - } - -- public static byte[] toArray(ByteBuf buf) -- { -- byte[] ret = new byte[ buf.readableBytes() ]; -- buf.readBytes( ret ); -+ public static byte[] toArray(ByteBuf buf) { -+ byte[] ret = new byte[buf.readableBytes()]; -+ buf.readBytes(ret); - - return ret; - } - -- public static byte[] readArray(ByteBuf buf) -- { -- return readArray( buf, buf.readableBytes() ); -+ public static byte[] readArray(ByteBuf buf) { -+ return readArray(buf, buf.readableBytes()); - } - -- public static byte[] readArray(ByteBuf buf, int limit) -- { -- int len = readVarInt( buf ); -- if ( len > limit ) -- { -- throw new OverflowPacketException( String.format( "Cannot receive byte array longer than %s (got %s bytes)", limit, len ) ); -+ public static byte[] readArray(ByteBuf buf, int limit) { -+ int len = readVarInt(buf); -+ if (len > limit) { -+ throw new OverflowPacketException( -+ String.format("Cannot receive byte array longer than %s (got %s bytes)", limit, len)); - } -- byte[] ret = new byte[ len ]; -- buf.readBytes( ret ); -+ byte[] ret = new byte[len]; -+ buf.readBytes(ret); - return ret; - } - -- public static int[] readVarIntArray(ByteBuf buf) -- { -- int len = readVarInt( buf ); -- int[] ret = new int[ len ]; -+ public static int[] readVarIntArray(ByteBuf buf) { -+ int len = readVarInt(buf); -+ int[] ret = new int[len]; - -- for ( int i = 0; i < len; i++ ) -- { -- ret[i] = readVarInt( buf ); -+ for (int i = 0; i < len; i++) { -+ ret[i] = readVarInt(buf); - } - - return ret; - } - -- public static void writeStringArray(List s, ByteBuf buf) -- { -- writeVarInt( s.size(), buf ); -- for ( String str : s ) -- { -- writeString( str, buf ); -+ public static void writeStringArray(List s, ByteBuf buf) { -+ writeVarInt(s.size(), buf); -+ for (String str : s) { -+ writeString(str, buf); - } - } - -- public static List readStringArray(ByteBuf buf) -- { -- int len = readVarInt( buf ); -- List ret = new ArrayList<>( len ); -- for ( int i = 0; i < len; i++ ) -- { -- ret.add( readString( buf ) ); -+ public static List readStringArray(ByteBuf buf) { -+ int len = readVarInt(buf); -+ List ret = new ArrayList<>(len); -+ for (int i = 0; i < len; i++) { -+ ret.add(readString(buf)); - } - return ret; - } - -- public static int readVarInt(ByteBuf input) -- { -- return readVarInt( input, 5 ); -+ public static int readVarInt(ByteBuf input) { -+ return readVarInt(input, 5); - } - -- public static int readVarInt(ByteBuf input, int maxBytes) -- { -+ public static int readVarInt(ByteBuf input, int maxBytes) { - int out = 0; - int bytes = 0; - byte in; -- while ( true ) -- { -+ -+ while (true) { - // Waterfall start - if (input.readableBytes() == 0) { - throw PROCESS_TRACES ? new BadPacketException("No more bytes reading varint") : NO_MORE_BYTES_EXCEPTION; -@@ -163,15 +152,13 @@ public abstract class DefinedPacket - // Waterfall end - in = input.readByte(); - -- out |= ( in & 0x7F ) << ( bytes++ * 7 ); -+ out |= (in & 0x7F) << (bytes++ * 7); - -- if ( bytes > maxBytes ) -- { -- throw PROCESS_TRACES ? new BadPacketException( "VarInt too big" ) : OVERSIZED_VAR_INT_EXCEPTION; -+ if (bytes > maxBytes) { -+ throw PROCESS_TRACES ? new BadPacketException("VarInt too big") : OVERSIZED_VAR_INT_EXCEPTION; - } - -- if ( ( in & 0x80 ) != 0x80 ) -- { -+ if ((in & 0x80) != 0x80) { - break; - } - } -@@ -179,112 +166,91 @@ public abstract class DefinedPacket - return out; - } - -- public static void writeVarInt(int value, ByteBuf output) -- { -+ public static void writeVarInt(int value, ByteBuf output) { - int part; -- while ( true ) -- { -+ while (true) { - part = value & 0x7F; - - value >>>= 7; -- if ( value != 0 ) -- { -+ if (value != 0) { - part |= 0x80; - } - -- output.writeByte( part ); -+ output.writeByte(part); - -- if ( value == 0 ) -- { -+ if (value == 0) { - break; - } - } - } - -- public static int readVarShort(ByteBuf buf) -- { -+ public static int readVarShort(ByteBuf buf) { - int low = buf.readUnsignedShort(); - int high = 0; -- if ( ( low & 0x8000 ) != 0 ) -- { -+ if ((low & 0x8000) != 0) { - low = low & 0x7FFF; - high = buf.readUnsignedByte(); - } -- return ( ( high & 0xFF ) << 15 ) | low; -+ return ((high & 0xFF) << 15) | low; - } - -- public static void writeVarShort(ByteBuf buf, int toWrite) -- { -+ public static void writeVarShort(ByteBuf buf, int toWrite) { - int low = toWrite & 0x7FFF; -- int high = ( toWrite & 0x7F8000 ) >> 15; -- if ( high != 0 ) -- { -+ int high = (toWrite & 0x7F8000) >> 15; -+ if (high != 0) { - low = low | 0x8000; - } -- buf.writeShort( low ); -- if ( high != 0 ) -- { -- buf.writeByte( high ); -+ buf.writeShort(low); -+ if (high != 0) { -+ buf.writeByte(high); - } - } - -- public static void writeUUID(UUID value, ByteBuf output) -- { -- output.writeLong( value.getMostSignificantBits() ); -- output.writeLong( value.getLeastSignificantBits() ); -+ public static void writeUUID(UUID value, ByteBuf output) { -+ output.writeLong(value.getMostSignificantBits()); -+ output.writeLong(value.getLeastSignificantBits()); - } - -- public static UUID readUUID(ByteBuf input) -- { -- return new UUID( input.readLong(), input.readLong() ); -+ public static UUID readUUID(ByteBuf input) { -+ return new UUID(input.readLong(), input.readLong()); - } - -- public static Tag readTag(ByteBuf input) -- { -- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( input ) ) ); -- Preconditions.checkArgument( !tag.isError(), "Error reading tag: %s", tag.error() ); -+ public static Tag readTag(ByteBuf input) { -+ Tag tag = NamedTag.read(new DataInputStream(new ByteBufInputStream(input))); -+ Preconditions.checkArgument(!tag.isError(), "Error reading tag: %s", tag.error()); - return tag; - } - -- public static void writeTag(Tag tag, ByteBuf output) -- { -- try -- { -- tag.write( new DataOutputStream( new ByteBufOutputStream( output ) ) ); -- } catch ( IOException ex ) -- { -- throw new RuntimeException( "Exception writing tag", ex ); -+ public static void writeTag(Tag tag, ByteBuf output) { -+ try { -+ tag.write(new DataOutputStream(new ByteBufOutputStream(output))); -+ } catch (IOException ex) { -+ throw new RuntimeException("Exception writing tag", ex); - } - } - -- public void read(ByteBuf buf) -- { -- throw new UnsupportedOperationException( "Packet must implement read method" ); -+ public void read(ByteBuf buf) { -+ throw new UnsupportedOperationException("Packet must implement read method"); - } - -- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -- { -- read( buf ); -+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ read(buf); - } - -- public void read0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -- { -- read( buf, direction, protocolVersion ); -+ public void read0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ read(buf, direction, protocolVersion); - } - -- public void write(ByteBuf buf) -- { -- throw new UnsupportedOperationException( "Packet must implement write method" ); -+ public void write(ByteBuf buf) { -+ throw new UnsupportedOperationException("Packet must implement write method"); - } - -- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -- { -- write( buf ); -+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ write(buf); - } - -- public void write0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -- { -- write( buf, direction, protocolVersion ); -+ public void write0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ write(buf, direction, protocolVersion); - } - - public abstract void handle(AbstractPacketHandler handler) throws Exception; -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java -index 5518bf26..b70f236b 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java -@@ -1,46 +1,42 @@ - package net.md_5.bungee.protocol; - -+import java.util.List; -+ - import io.netty.buffer.ByteBuf; - import io.netty.buffer.Unpooled; - import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.ByteToMessageDecoder; --import java.util.List; - import net.md_5.bungee.protocol.packet.LegacyHandshake; - import net.md_5.bungee.protocol.packet.LegacyPing; - --public class LegacyDecoder extends ByteToMessageDecoder --{ -+public class LegacyDecoder extends ByteToMessageDecoder { - - @Override -- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception -- { -+ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { - // See check in Varint21FrameDecoder for more details -- if ( !ctx.channel().isActive() ) -- { -- in.skipBytes( in.readableBytes() ); -+ if (!ctx.channel().isActive()) { -+ in.skipBytes(in.readableBytes()); - return; - } - -- if ( !in.isReadable() ) -- { -+ if (!in.isReadable()) { - return; - } - - in.markReaderIndex(); - short packetID = in.readUnsignedByte(); - -- if ( packetID == 0xFE ) -- { -- out.add( new PacketWrapper( new LegacyPing( in.isReadable() && in.readUnsignedByte() == 0x01 ), Unpooled.EMPTY_BUFFER ) ); -+ if (packetID == 0xFE) { -+ out.add(new PacketWrapper(new LegacyPing(in.isReadable() && in.readUnsignedByte() == 0x01), -+ Unpooled.EMPTY_BUFFER)); - return; -- } else if ( packetID == 0x02 && in.isReadable() ) -- { -- in.skipBytes( in.readableBytes() ); -- out.add( new PacketWrapper( new LegacyHandshake(), Unpooled.EMPTY_BUFFER ) ); -+ } else if (packetID == 0x02 && in.isReadable()) { -+ in.skipBytes(in.readableBytes()); -+ out.add(new PacketWrapper(new LegacyHandshake(), Unpooled.EMPTY_BUFFER)); - return; - } - - in.resetReaderIndex(); -- ctx.pipeline().remove( this ); -+ ctx.pipeline().remove(this); - } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec932e92..a428099c 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -1,5 +1,8 @@ - package net.md_5.bungee.protocol; - -+import java.util.List; -+ -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufUtil; - import io.netty.channel.ChannelHandlerContext; -@@ -8,11 +11,8 @@ import io.netty.handler.codec.MessageToMessageDecoder; - import lombok.AllArgsConstructor; - import lombok.Setter; - --import java.util.List; -- - @AllArgsConstructor --public class MinecraftDecoder extends MessageToMessageDecoder --{ -+public class MinecraftDecoder extends MessageToMessageDecoder { - - @Setter - private Protocol protocol; -@@ -29,46 +29,48 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - - @Override -- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception -- { -- // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() -- // will fire any cumulated data through the pipeline, so we want to try and stop it here. -- if ( !ctx.channel().isActive() ) -- { -+ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { -+ // FlameCord - Apply astei patches -+ if (!ctx.channel().isActive()) { -+ in.skipBytes(in.readableBytes()); - return; - } - -- Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ Protocol.DirectionData prot = (server) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ -+ // FlameCord - Check size before decoding -+ if (prot == protocol.TO_SERVER && in.readableBytes() > 2097152) { -+ throw new DecoderException("Error decoding packet with too big size"); -+ } -+ - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( - - Object packetTypeInfo = null; -- try -- { -+ try { - // Waterfall start - if (in.readableBytes() == 0) { - return; - } - // Waterfall end - -- int packetId = DefinedPacket.readVarInt( in ); -+ int packetId = DefinedPacket.readVarInt(in); -+ - packetTypeInfo = packetId; - -- DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); -- if ( packet != null ) -- { -+ DefinedPacket packet = prot.createPacket(packetId, protocolVersion, supportsForge); -+ if (packet != null) { - packetTypeInfo = packet.getClass(); -- packet.read0( in, prot.getDirection(), protocolVersion ); -+ packet.read0(in, prot.getDirection(), protocolVersion); - -- if ( in.isReadable() ) -- { -- throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot.getDirection() ); -+ if (in.isReadable()) { -+ throw new BadPacketException("Did not read all bytes from packet " + packet.getClass() + " " -+ + packetId + " Protocol " + protocol + " Direction " + prot.getDirection()); - } -- } else -- { -- in.skipBytes( in.readableBytes() ); -+ } else { -+ in.skipBytes(in.readableBytes()); - } - -- out.add( new PacketWrapper( packet, slice ) ); -+ out.add(new PacketWrapper(packet, slice)); - slice = null; - } catch (BadPacketException | IndexOutOfBoundsException e) { - final String packetTypeStr; -@@ -79,11 +81,18 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } else { - packetTypeStr = "unknown"; - } -- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall -- } finally -- { -- if ( slice != null ) -- { -+ // FlameCord - Toggle dumping packet info -+ // throw new FastDecoderException("Error decoding packet " + packetTypeStr + " -+ // with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new DecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" -+ + ByteBufUtil.prettyHexDump(slice) + " Direction " + prot.getDirection(), e); -+ } else { -+ throw new DecoderException( -+ "Error decoding packet " + packetTypeStr + " Direction " + prot.getDirection(), e); -+ } -+ } finally { -+ if (slice != null) { - slice.release(); - } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -index 9aac7ca9..009af589 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -@@ -7,8 +7,7 @@ import lombok.AllArgsConstructor; - import lombok.Setter; - - @AllArgsConstructor --public class MinecraftEncoder extends MessageToByteEncoder --{ -+public class MinecraftEncoder extends MessageToByteEncoder { - - @Setter - private Protocol protocol; -@@ -17,10 +16,9 @@ public class MinecraftEncoder extends MessageToByteEncoder - private int protocolVersion; - - @Override -- protected void encode(ChannelHandlerContext ctx, DefinedPacket msg, ByteBuf out) throws Exception -- { -- Protocol.DirectionData prot = ( server ) ? protocol.TO_CLIENT : protocol.TO_SERVER; -- DefinedPacket.writeVarInt( prot.getId( msg.getClass(), protocolVersion ), out ); -- msg.write0( out, prot.getDirection(), protocolVersion ); -+ protected void encode(ChannelHandlerContext ctx, DefinedPacket msg, ByteBuf out) throws Exception { -+ Protocol.DirectionData prot = (server) ? protocol.TO_CLIENT : protocol.TO_SERVER; -+ DefinedPacket.writeVarInt(prot.getId(msg.getClass(), protocolVersion), out); -+ msg.write0(out, prot.getDirection(), protocolVersion); - } - } -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 -index 1feee418..b17d8c92 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -1,12 +1,14 @@ - package net.md_5.bungee.protocol; - -+import java.lang.reflect.Constructor; -+ - import com.google.common.base.Preconditions; - import com.google.common.collect.Iterables; -+ - import gnu.trove.map.TIntObjectMap; - import gnu.trove.map.TObjectIntMap; - import gnu.trove.map.hash.TIntObjectHashMap; - import gnu.trove.map.hash.TObjectIntHashMap; --import java.lang.reflect.Constructor; - import lombok.Data; - import lombok.Getter; - import net.md_5.bungee.protocol.packet.BossBar; -@@ -15,10 +17,10 @@ import net.md_5.bungee.protocol.packet.ClientSettings; - import net.md_5.bungee.protocol.packet.Commands; - import net.md_5.bungee.protocol.packet.EncryptionRequest; - import net.md_5.bungee.protocol.packet.EncryptionResponse; --import net.md_5.bungee.protocol.packet.EntityStatus; --import net.md_5.bungee.protocol.packet.GameState; - import net.md_5.bungee.protocol.packet.EntityEffect; - import net.md_5.bungee.protocol.packet.EntityRemoveEffect; -+import net.md_5.bungee.protocol.packet.EntityStatus; -+import net.md_5.bungee.protocol.packet.GameState; - import net.md_5.bungee.protocol.packet.Handshake; - import net.md_5.bungee.protocol.packet.KeepAlive; - import net.md_5.bungee.protocol.packet.Kick; -@@ -44,578 +46,506 @@ import net.md_5.bungee.protocol.packet.Team; - import net.md_5.bungee.protocol.packet.Title; - import net.md_5.bungee.protocol.packet.ViewDistance; - --public enum Protocol --{ -+public enum Protocol { - -- // Undef -- HANDSHAKE -- { -+ // Undef -+ HANDSHAKE { - -- { -- TO_SERVER.registerPacket( -- Handshake.class, -- Handshake::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine -- ); -- } -- }, -- // 0 -- GAME -- { -- -- { -- TO_CLIENT.registerPacket( -- KeepAlive.class, -- KeepAlive::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x21 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x20 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x1F ) -- ); -- TO_CLIENT.registerPacket( -- Login.class, -- Login::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x25 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x24 ) -- ); -- TO_CLIENT.registerPacket( -- Chat.class, -- Chat::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x0E ) -- ); -- TO_CLIENT.registerPacket( -- Respawn.class, -- Respawn::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x07 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x38 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x3A ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x3B ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x3A ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x39 ) -- ); -- TO_CLIENT.registerPacket( -- BossBar.class, -- BossBar::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_9, 0x0C ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x0D ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x0C ) -- ); -- // Waterfall start -- TO_CLIENT.registerPacket( -- EntityEffect.class, -- EntityEffect::new, // Waterfall - speed up packet construction -- map(ProtocolConstants.MINECRAFT_1_7_2, 0x1D), // Travertine -- map(ProtocolConstants.MINECRAFT_1_9, 0x4C), -- map(ProtocolConstants.MINECRAFT_1_9_4, 0x4B), -- map(ProtocolConstants.MINECRAFT_1_12, 0x4E), -- map(ProtocolConstants.MINECRAFT_1_12_1, 0x4F), -- map(ProtocolConstants.MINECRAFT_1_13, 0x53), -- map(ProtocolConstants.MINECRAFT_1_14, 0x59), -- map(ProtocolConstants.MINECRAFT_1_15, 0x5A), -- map(ProtocolConstants.MINECRAFT_1_16, 0x59) -- ); -- TO_CLIENT.registerPacket( -- EntityRemoveEffect.class, -- EntityRemoveEffect::new, // Waterfall - speed up packet construction -- map(ProtocolConstants.MINECRAFT_1_7_2, 0x1E), // Travertine -- map(ProtocolConstants.MINECRAFT_1_9, 0x31), -- map(ProtocolConstants.MINECRAFT_1_12, 0x32), -- map(ProtocolConstants.MINECRAFT_1_12_1, 0x33), -- map(ProtocolConstants.MINECRAFT_1_13, 0x36), -- map(ProtocolConstants.MINECRAFT_1_14, 0x38), -- map(ProtocolConstants.MINECRAFT_1_15, 0x39), -- map(ProtocolConstants.MINECRAFT_1_16, 0x38), -- map(ProtocolConstants.MINECRAFT_1_16_2, 0x37) -- ); -- // Waterfall end -- TO_CLIENT.registerPacket( -- PlayerListItem.class, // PlayerInfo -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x38 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x33 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x34 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x33 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x32 ) -- ); -- TO_CLIENT.registerPacket( -- TabCompleteResponse.class, -- TabCompleteResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3A ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x10 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x0F ) -- ); -- TO_CLIENT.registerPacket( -- ScoreboardObjective.class, -- ScoreboardObjective::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3B ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x45 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x49 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x4A ) -- ); -- TO_CLIENT.registerPacket( -- ScoreboardScore.class, -- ScoreboardScore::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3C ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x48 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x4C ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x4D ) -- ); -- TO_CLIENT.registerPacket( -- ScoreboardDisplay.class, -- ScoreboardDisplay::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3D ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x3E ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x42 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x43 ) -- ); -- TO_CLIENT.registerPacket( -- Team.class, -- Team::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3E ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x47 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x4B ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x4C ) -- ); -- TO_CLIENT.registerPacket( -- PluginMessage.class, -- PluginMessage::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x3F ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x19 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x18 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x17 ) -- ); -- TO_CLIENT.registerPacket( -- Kick.class, -- Kick::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x40 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x1B ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x1A ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x19 ) -- ); -- TO_CLIENT.registerPacket( -- Title.class, -- Title::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x45 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x4F ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x50 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x4F ) -- ); -- TO_CLIENT.registerPacket( -- PlayerListHeaderFooter.class, -- PlayerListHeaderFooter::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x47 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), -- map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x4A ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x4E ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x53 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x54 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x53 ) -- ); -- TO_CLIENT.registerPacket( -- EntityStatus.class, -- EntityStatus::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1A ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x1C ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x1B ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x1A ) -- ); -- TO_CLIENT.registerPacket( -- Commands.class, -- Commands::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_13, 0x11 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x12 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x11 ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x10 ) -- ); -- TO_CLIENT.registerPacket( -- GameState.class, -- GameState::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_15, 0x1F ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x1E ), -- map( ProtocolConstants.MINECRAFT_1_16_2, 0x1D ) -- ); -- TO_CLIENT.registerPacket( -- ViewDistance.class, -- ViewDistance::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_14, 0x41 ), -- map( ProtocolConstants.MINECRAFT_1_15, 0x42 ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x41 ) -- ); -- -- TO_SERVER.registerPacket( -- KeepAlive.class, -- KeepAlive::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x0F ), -- map( ProtocolConstants.MINECRAFT_1_16, 0x10 ) -- ); -- TO_SERVER.registerPacket( -- Chat.class, -- Chat::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x03 ) -- ); -- TO_SERVER.registerPacket( -- TabCompleteRequest.class, -- TabCompleteRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x14 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x05 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x06 ) -- ); -- TO_SERVER.registerPacket( -- ClientSettings.class, -- ClientSettings::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x15 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x05 ) -- ); -- TO_SERVER.registerPacket( -- PluginMessage.class, -- PluginMessage::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x17 ), // Travertine -- map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), -- map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), -- map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -- map( ProtocolConstants.MINECRAFT_1_13, 0x0A ), -- map( ProtocolConstants.MINECRAFT_1_14, 0x0B ) -- ); -- } -- }, -- // 1 -- STATUS -- { -- -- { -- TO_CLIENT.registerPacket( -- StatusResponse.class, -- StatusResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine -- ); -- TO_CLIENT.registerPacket( -- PingPacket.class, -- PingPacket::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine -- ); -- -- TO_SERVER.registerPacket( -- StatusRequest.class, -- StatusRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine -- ); -- TO_SERVER.registerPacket( -- PingPacket.class, -- PingPacket::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine -- ); -- } -- }, -- //2 -- LOGIN -- { -- -- { -- TO_CLIENT.registerPacket( -- Kick.class, -- Kick::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine -- ); -- TO_CLIENT.registerPacket( -- EncryptionRequest.class, -- EncryptionRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine -- ); -- TO_CLIENT.registerPacket( -- LoginSuccess.class, -- LoginSuccess::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ) // Travertine -- ); -- TO_CLIENT.registerPacket( -- SetCompression.class, -- SetCompression::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x03 ) // Travertine -- ); -- TO_CLIENT.registerPacket( -- LoginPayloadRequest.class, -- LoginPayloadRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_13, 0x04 ) -- ); -- -- TO_SERVER.registerPacket( -- LoginRequest.class, -- LoginRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine -- ); -- TO_SERVER.registerPacket( -- EncryptionResponse.class, -- EncryptionResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine -- ); -- TO_SERVER.registerPacket( -- LoginPayloadResponse.class, -- LoginPayloadResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_13, 0x02 ) -- ); -- } -- }; -- /*========================================================================*/ -- public static final int MAX_PACKET_ID = 0xFF; -- /*========================================================================*/ -- final DirectionData TO_SERVER = new DirectionData( this, ProtocolConstants.Direction.TO_SERVER ); -- final DirectionData TO_CLIENT = new DirectionData( this, ProtocolConstants.Direction.TO_CLIENT ); -- -- public static void main(String[] args) -- { -- for ( int version : ProtocolConstants.SUPPORTED_VERSION_IDS ) -- { -- dump( version ); -+ { -+ TO_SERVER.registerPacket(Handshake.class, Handshake::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00) // Travertine -+ ); -+ } -+ }, -+ // 0 -+ GAME { -+ -+ { -+ TO_CLIENT.registerPacket(KeepAlive.class, KeepAlive::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x1F), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x21), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x20), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x21), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x20), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x1F)); -+ TO_CLIENT.registerPacket(Login.class, Login::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x23), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x25), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x26), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x25), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x24)); -+ TO_CLIENT.registerPacket(Chat.class, Chat::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x02), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x0F), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x0E), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x0F), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x0E)); -+ TO_CLIENT.registerPacket(Respawn.class, Respawn::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x07), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x33), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x34), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x35), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x38), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x3A), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x3B), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x3A), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x39)); -+ TO_CLIENT.registerPacket(BossBar.class, BossBar::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_9, 0x0C), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x0D), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x0C)); -+ // Waterfall start -+ TO_CLIENT.registerPacket(EntityEffect.class, EntityEffect::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x1D), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x4C), -+ map(ProtocolConstants.MINECRAFT_1_9_4, 0x4B), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x4E), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x4F), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x53), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x59), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x5A), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x59)); -+ TO_CLIENT.registerPacket(EntityRemoveEffect.class, EntityRemoveEffect::new, // Waterfall - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x1E), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x31), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x32), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x33), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x36), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x38), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x39), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x38), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x37)); -+ // Waterfall end -+ TO_CLIENT.registerPacket(PlayerListItem.class, // PlayerInfo -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x38), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x2D), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x2E), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x30), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x33), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x34), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x33), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x32)); -+ TO_CLIENT.registerPacket(TabCompleteResponse.class, TabCompleteResponse::new, // Waterfall - -+ // speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3A), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x0E), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x10), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x11), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x10), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x0F)); -+ TO_CLIENT.registerPacket(ScoreboardObjective.class, ScoreboardObjective::new, // Waterfall - -+ // speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3B), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x3F), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x41), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x42), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x45), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x49), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x4A)); -+ TO_CLIENT.registerPacket(ScoreboardScore.class, ScoreboardScore::new, // Waterfall - speed up -+ // packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3C), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x42), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x44), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x45), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x48), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x4C), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x4D)); -+ TO_CLIENT.registerPacket(ScoreboardDisplay.class, ScoreboardDisplay::new, // Waterfall - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3D), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x38), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x3A), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x3B), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x3E), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x42), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x43)); -+ TO_CLIENT.registerPacket(Team.class, Team::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3E), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x41), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x43), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x44), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x47), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x4B), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x4C)); -+ TO_CLIENT.registerPacket(PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x3F), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x18), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x19), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x18), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x19), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x18), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x17)); -+ TO_CLIENT.registerPacket(Kick.class, Kick::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x40), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x1A), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x1B), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x1A), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x1B), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x1A), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x19)); -+ TO_CLIENT.registerPacket(Title.class, Title::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x45), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_12, 0x47), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x48), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x4B), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x4F), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x50), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x4F)); -+ TO_CLIENT.registerPacket(PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, // Waterfall -+ // - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x47), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x48), -+ map(ProtocolConstants.MINECRAFT_1_9_4, 0x47), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x49), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x4A), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x4E), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x53), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x54), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x53)); -+ TO_CLIENT.registerPacket(EntityStatus.class, EntityStatus::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x1A), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x1B), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x1C), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x1B), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x1C), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x1B), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x1A)); -+ TO_CLIENT.registerPacket(Commands.class, Commands::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_13, 0x11), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x12), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x11), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x10)); -+ TO_CLIENT.registerPacket(GameState.class, GameState::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_15, 0x1F), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x1E), -+ map(ProtocolConstants.MINECRAFT_1_16_2, 0x1D)); -+ TO_CLIENT.registerPacket(ViewDistance.class, ViewDistance::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_14, 0x41), -+ map(ProtocolConstants.MINECRAFT_1_15, 0x42), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x41)); -+ -+ TO_SERVER.registerPacket(KeepAlive.class, KeepAlive::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x0B), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x0C), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x0B), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x0E), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x0F), -+ map(ProtocolConstants.MINECRAFT_1_16, 0x10)); -+ TO_SERVER.registerPacket(Chat.class, Chat::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x02), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x03), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x02), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x03)); -+ TO_SERVER.registerPacket(TabCompleteRequest.class, TabCompleteRequest::new, // Waterfall - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x14), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x01), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x02), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x01), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x05), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x06)); -+ TO_SERVER.registerPacket(ClientSettings.class, ClientSettings::new, // Waterfall - speed up -+ // packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x15), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x04), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x05), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x04), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x05)); -+ TO_SERVER.registerPacket(PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x17), // Travertine -+ map(ProtocolConstants.MINECRAFT_1_9, 0x09), -+ map(ProtocolConstants.MINECRAFT_1_12, 0x0A), -+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x09), -+ map(ProtocolConstants.MINECRAFT_1_13, 0x0A), -+ map(ProtocolConstants.MINECRAFT_1_14, 0x0B)); -+ } -+ }, -+ // 1 -+ STATUS { -+ -+ { -+ TO_CLIENT.registerPacket(StatusResponse.class, StatusResponse::new, // Waterfall - speed up -+ // packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00) // Travertine -+ ); -+ TO_CLIENT.registerPacket(PingPacket.class, PingPacket::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01) // Travertine -+ ); -+ -+ TO_SERVER.registerPacket(StatusRequest.class, StatusRequest::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00) // Travertine -+ ); -+ TO_SERVER.registerPacket(PingPacket.class, PingPacket::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01) // Travertine -+ ); -+ } -+ }, -+ // 2 -+ LOGIN { -+ -+ { -+ TO_CLIENT.registerPacket(Kick.class, Kick::new, // Waterfall - speed up packet construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00) // Travertine -+ ); -+ TO_CLIENT.registerPacket(EncryptionRequest.class, EncryptionRequest::new, // Waterfall - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01) // Travertine -+ ); -+ TO_CLIENT.registerPacket(LoginSuccess.class, LoginSuccess::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x02) // Travertine -+ ); -+ TO_CLIENT.registerPacket(SetCompression.class, SetCompression::new, // Waterfall - speed up -+ // packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x03) // Travertine -+ ); -+ TO_CLIENT.registerPacket(LoginPayloadRequest.class, LoginPayloadRequest::new, // Waterfall - -+ // speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_13, 0x04)); -+ -+ TO_SERVER.registerPacket(LoginRequest.class, LoginRequest::new, // Waterfall - speed up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x00) // Travertine -+ ); -+ TO_SERVER.registerPacket(EncryptionResponse.class, EncryptionResponse::new, // Waterfall - speed -+ // up packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x01) // Travertine -+ ); -+ TO_SERVER.registerPacket(LoginPayloadResponse.class, LoginPayloadResponse::new, // Waterfall - -+ // speed up -+ // packet -+ // construction -+ map(ProtocolConstants.MINECRAFT_1_13, 0x02)); -+ } -+ }; -+ -+ /* ======================================================================== */ -+ public static final int MAX_PACKET_ID = 0xFF; -+ /* ======================================================================== */ -+ final DirectionData TO_SERVER = new DirectionData(this, ProtocolConstants.Direction.TO_SERVER); -+ final DirectionData TO_CLIENT = new DirectionData(this, ProtocolConstants.Direction.TO_CLIENT); -+ -+ public static void main(String[] args) { -+ for (int version : ProtocolConstants.SUPPORTED_VERSION_IDS) { -+ dump(version); -+ } - } -- } - -- private static void dump(int version) -- { -- for ( Protocol protocol : Protocol.values() ) -- { -- dump( version, protocol ); -+ private static void dump(int version) { -+ for (Protocol protocol : Protocol.values()) { -+ dump(version, protocol); -+ } - } -- } -- -- private static void dump(int version, Protocol protocol) -- { -- dump( version, protocol.TO_CLIENT ); -- dump( version, protocol.TO_SERVER ); -- } -- -- private static void dump(int version, DirectionData data) -- { -- for ( int id = 0; id < MAX_PACKET_ID; id++ ) -- { -- DefinedPacket packet = data.createPacket( id, version ); -- if ( packet != null ) -- { -- System.out.println( version + " " + data.protocolPhase + " " + data.direction + " " + id + " " + packet.getClass().getSimpleName() ); -- } -+ -+ private static void dump(int version, Protocol protocol) { -+ dump(version, protocol.TO_CLIENT); -+ dump(version, protocol.TO_SERVER); - } -- } -- -- @Data -- private static class ProtocolData -- { -- -- private final int protocolVersion; -- private final TObjectIntMap> packetMap = new TObjectIntHashMap<>( MAX_PACKET_ID ); -- private final java.util.function.Supplier[] packetConstructors = new java.util.function.Supplier[ MAX_PACKET_ID ]; // Waterfall - speed up packet construction -- } -- -- @Data -- private static class ProtocolMapping -- { -- -- private final int protocolVersion; -- private final int packetID; -- } -- -- // Helper method -- private static ProtocolMapping map(int protocol, int id) -- { -- return new ProtocolMapping( protocol, id ); -- } -- -- static final class DirectionData -- { -- -- private final TIntObjectMap protocols = new TIntObjectHashMap<>(); -- // -- private final Protocol protocolPhase; -- @Getter -- private final ProtocolConstants.Direction direction; -- -- public DirectionData(Protocol protocolPhase, ProtocolConstants.Direction direction) -- { -- this.protocolPhase = protocolPhase; -- this.direction = direction; -- -- for ( int protocol : ProtocolConstants.SUPPORTED_VERSION_IDS ) -- { -- protocols.put( protocol, new ProtocolData( protocol ) ); -- } -+ -+ private static void dump(int version, DirectionData data) { -+ for (int id = 0; id < MAX_PACKET_ID; id++) { -+ DefinedPacket packet = data.createPacket(id, version); -+ if (packet != null) { -+ System.out.println(version + " " + data.protocolPhase + " " + data.direction + " " + id -+ + " " + packet.getClass().getSimpleName()); -+ } -+ } - } - -- private ProtocolData getProtocolData(int version) -- { -- ProtocolData protocol = protocols.get( version ); -- if ( protocol == null && ( protocolPhase != Protocol.GAME ) ) -- { -- protocol = Iterables.getFirst( protocols.valueCollection(), null ); -- } -- return protocol; -+ @Data -+ private static class ProtocolData { -+ -+ private final int protocolVersion; -+ private final TObjectIntMap> packetMap = new TObjectIntHashMap<>( -+ MAX_PACKET_ID); -+ private final java.util.function.Supplier[] packetConstructors = new java.util.function.Supplier[MAX_PACKET_ID]; // Waterfall -+ // - -+ // speed -+ // up -+ // packet -+ // construction - } - -- public boolean hasPacket(int i, boolean supportsForge) { -- return supportsForge || i >= 0 && i <= MAX_PACKET_ID; -+ @Data -+ private static class ProtocolMapping { -+ -+ private final int protocolVersion; -+ private final int packetID; - } - -- public final DefinedPacket createPacket(int id, int version) -- { -- return createPacket(id, version, true); -+ // Helper method -+ private static ProtocolMapping map(int protocol, int id) { -+ return new ProtocolMapping(protocol, id); - } - -- public final DefinedPacket createPacket(int id, int version, boolean supportsForge) -- { -- ProtocolData protocolData = getProtocolData( version ); -- if ( protocolData == null ) -- { -- throw new BadPacketException( "Unsupported protocol version " + version ); -- } -- if ( !hasPacket(id, supportsForge) ) -- { -- if ( ProtocolConstants.isBeforeOrEq( version, ProtocolConstants.MINECRAFT_1_7_6 ) ) { -- return null; -- } else { -- throw new BadPacketException( "Packet with id " + id + " outside of range " ); -+ static final class DirectionData { -+ -+ private final TIntObjectMap protocols = new TIntObjectHashMap<>(); -+ // -+ private final Protocol protocolPhase; -+ @Getter -+ private final ProtocolConstants.Direction direction; -+ -+ public DirectionData(Protocol protocolPhase, ProtocolConstants.Direction direction) { -+ this.protocolPhase = protocolPhase; -+ this.direction = direction; -+ -+ for (int protocol : ProtocolConstants.SUPPORTED_VERSION_IDS) { -+ protocols.put(protocol, new ProtocolData(protocol)); -+ } - } -- } -- -- java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction -- try -- { -- return ( constructor == null ) ? null : constructor.get(); // Waterfall - speed up packet construction -- } catch ( Exception ex ) // Waterfall - speed up packet construction -- { -- throw new BadPacketException( "Could not construct packet with id " + id, ex ); -- } -- } - -- private

void registerPacket(Class

packetClass, java.util.function.Supplier

constructor, ProtocolMapping... mappings) // Waterfall - speed up packet construction -- { -- // Waterfall start - speed up packet construction -- /* -- try -- { -- Constructor constructor = packetClass.getDeclaredConstructor(); -- */ // Waterfall end -- -- int mappingIndex = 0; -- ProtocolMapping mapping = mappings[mappingIndex]; -- for ( int protocol : ProtocolConstants.SUPPORTED_VERSION_IDS ) -- { -- if ( protocol < mapping.protocolVersion ) -- { -- // This is a new packet, skip it till we reach the next protocol -- continue; -- } -- -- if ( mapping.protocolVersion < protocol && mappingIndex + 1 < mappings.length ) -- { -- // Mapping is non current, but the next one may be ok -- ProtocolMapping nextMapping = mappings[mappingIndex + 1]; -- if ( nextMapping.protocolVersion == protocol ) -- { -- Preconditions.checkState( nextMapping.packetID != mapping.packetID, "Duplicate packet mapping (%s, %s)", mapping.protocolVersion, nextMapping.protocolVersion ); -+ private ProtocolData getProtocolData(int version) { -+ ProtocolData protocol = protocols.get(version); -+ if (protocol == null && (protocolPhase != Protocol.GAME)) { -+ protocol = Iterables.getFirst(protocols.valueCollection(), null); -+ } -+ return protocol; -+ } - -- mapping = nextMapping; -- mappingIndex++; -+ public boolean hasPacket(int i, boolean supportsForge) { -+ return supportsForge || i >= 0 && i <= MAX_PACKET_ID; -+ } -+ -+ public final DefinedPacket createPacket(int id, int version) { -+ return createPacket(id, version, true); -+ } -+ -+ public final DefinedPacket createPacket(int id, int version, boolean supportsForge) { -+ ProtocolData protocolData = getProtocolData(version); -+ if (protocolData == null) { -+ throw new BadPacketException("Unsupported protocol version " + version); -+ } -+ if (!hasPacket(id, supportsForge)) { -+ if (ProtocolConstants.isBeforeOrEq(version, ProtocolConstants.MINECRAFT_1_7_6)) { -+ return null; -+ } else { -+ throw new BadPacketException("Packet with id " + id + " outside of range "); -+ } - } -- } - -- ProtocolData data = protocols.get( protocol ); -- data.packetMap.put( packetClass, mapping.packetID ); -- data.packetConstructors[mapping.packetID] = constructor; -+ java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall -+ // - -+ // speed -+ // up -+ // packet -+ // construction -+ try { -+ return (constructor == null) ? null : constructor.get(); // Waterfall - speed up packet -+ // construction -+ } catch (Exception ex) // Waterfall - speed up packet construction -+ { -+ throw new BadPacketException("Could not construct packet with id " + id, ex); -+ } -+ } -+ -+ private

void registerPacket(Class

packetClass, -+ java.util.function.Supplier

constructor, ProtocolMapping... mappings) // Waterfall - -+ // speed up -+ // packet -+ // construction -+ { -+ // Waterfall start - speed up packet construction -+ /* -+ * try { Constructor constructor = -+ * packetClass.getDeclaredConstructor(); -+ */ // Waterfall end -+ -+ int mappingIndex = 0; -+ ProtocolMapping mapping = mappings[mappingIndex]; -+ for (int protocol : ProtocolConstants.SUPPORTED_VERSION_IDS) { -+ if (protocol < mapping.protocolVersion) { -+ // This is a new packet, skip it till we reach the next protocol -+ continue; -+ } -+ -+ if (mapping.protocolVersion < protocol && mappingIndex + 1 < mappings.length) { -+ // Mapping is non current, but the next one may be ok -+ ProtocolMapping nextMapping = mappings[mappingIndex + 1]; -+ if (nextMapping.protocolVersion == protocol) { -+ Preconditions.checkState(nextMapping.packetID != mapping.packetID, -+ "Duplicate packet mapping (%s, %s)", -+ mapping.protocolVersion, nextMapping.protocolVersion); -+ -+ mapping = nextMapping; -+ mappingIndex++; -+ } -+ } -+ -+ ProtocolData data = protocols.get(protocol); -+ data.packetMap.put(packetClass, mapping.packetID); -+ data.packetConstructors[mapping.packetID] = constructor; -+ } -+ // Waterfall start - speed up packet construction -+ /* -+ * } catch ( NoSuchMethodException ex ) { throw new BadPacketException( -+ * "No NoArgsConstructor for packet class " + packetClass ); } -+ */ // Waterfall end - } -- // Waterfall start - speed up packet construction -- /* -- } catch ( NoSuchMethodException ex ) -- { -- throw new BadPacketException( "No NoArgsConstructor for packet class " + packetClass ); -- } -- */ // Waterfall end -- } -- // Waterfall start - speed up packet construction (backwards compat) -- private

void registerPacket(Class

packetClass, ProtocolMapping... mappings) { -- java.util.function.Supplier

packetSupplier; -- try { -- Constructor constructor = packetClass.getDeclaredConstructor(); -- packetSupplier = () -> { -- try { -- return (P) constructor.newInstance(); -- } catch (Exception e) { -- throw new RuntimeException(e); -- } -- }; -- } catch (ReflectiveOperationException e) { -- throw new BadPacketException( "No NoArgsConstructor for packet class " + packetClass ); -- } -- registerPacket(packetClass, packetSupplier, mappings); -- } -- // Waterfall end - -- final int getId(Class packet, int version) -- { -+ // Waterfall start - speed up packet construction (backwards compat) -+ private

void registerPacket(Class

packetClass, -+ ProtocolMapping... mappings) { -+ java.util.function.Supplier

packetSupplier; -+ try { -+ Constructor constructor = packetClass.getDeclaredConstructor(); -+ packetSupplier = () -> { -+ try { -+ return (P) constructor.newInstance(); -+ } catch (Exception e) { -+ throw new RuntimeException(e); -+ } -+ }; -+ } catch (ReflectiveOperationException e) { -+ throw new BadPacketException("No NoArgsConstructor for packet class " + packetClass); -+ } -+ registerPacket(packetClass, packetSupplier, mappings); -+ } -+ // Waterfall end - -- ProtocolData protocolData = getProtocolData( version ); -- if ( protocolData == null ) -- { -- throw new BadPacketException( "Unsupported protocol version" ); -- } -- Preconditions.checkArgument( protocolData.packetMap.containsKey( packet ), "Cannot get ID for packet %s in phase %s with direction %s", packet, protocolPhase, direction ); -+ final int getId(Class packet, int version) { -+ ProtocolData protocolData = getProtocolData(version); -+ if (protocolData == null) { -+ throw new BadPacketException("Unsupported protocol version"); -+ } -+ Preconditions.checkArgument(protocolData.packetMap.containsKey(packet), -+ "Cannot get ID for packet %s in phase %s with direction %s", packet, -+ protocolPhase, direction); - -- return protocolData.packetMap.get( packet ); -+ return protocolData.packetMap.get(packet); -+ } - } -- } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index a07e25b1..137242c6 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -@@ -1,64 +1,54 @@ - package net.md_5.bungee.protocol; - -+import java.util.List; -+import java.util.concurrent.atomic.AtomicLong; -+ - import io.netty.buffer.ByteBuf; --import io.netty.buffer.Unpooled; - import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.ByteToMessageDecoder; - import io.netty.handler.codec.CorruptedFrameException; --import java.util.List; --import java.util.concurrent.atomic.AtomicLong; - --public class Varint21FrameDecoder extends ByteToMessageDecoder --{ -+public class Varint21FrameDecoder extends ByteToMessageDecoder { - - private AtomicLong lastEmptyPacket = new AtomicLong(0); // Travertine - private static boolean DIRECT_WARNING; - - @Override -- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception -- { -- // If we decode an invalid packet and an exception is thrown (thus triggering a close of the connection), -- // the Netty ByteToMessageDecoder will continue to frame more packets and potentially call fireChannelRead() -- // on them, likely with more invalid packets. Therefore, check if the connection is no longer active and if so -- // sliently discard the packet. -- if ( !ctx.channel().isActive() ) -- { -- in.skipBytes( in.readableBytes() ); -+ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { -+ // FlameCord - Apply astei patches -+ if (!ctx.channel().isActive()) { -+ in.skipBytes(in.readableBytes()); - return; - } - - in.markReaderIndex(); - -- for ( int i = 0; i < 3; i++ ) // Waterfall -+ for (int i = 0; i < 3; i++) // Waterfall - { -- if ( !in.isReadable() ) -- { -+ if (!in.isReadable()) { - in.resetReaderIndex(); - return; - } - - // Waterfall start - byte read = in.readByte(); -- if ( read >= 0 ) -- { -+ if (read >= 0) { - in.resetReaderIndex(); -- int length = DefinedPacket.readVarInt( in ); -+ int length = DefinedPacket.readVarInt(in); - // Waterfall end -- if ( false && length == 0) // Waterfall - ignore -+ if (false && length == 0) // Waterfall - ignore - { - // Travertine start - vanilla 1.7 client sometimes sends empty packets. - long currentTime = System.currentTimeMillis(); - long lastEmptyPacket = this.lastEmptyPacket.getAndSet(currentTime); - -- if (currentTime - lastEmptyPacket < 50L) -- { -- throw new CorruptedFrameException( "Too many empty packets" ); -+ if (currentTime - lastEmptyPacket < 50L) { -+ throw new CorruptedFrameException("Too many empty packets"); - } - // Travertine end - } - -- if ( in.readableBytes() < length ) -- { -+ if (in.readableBytes() < length) { - in.resetReaderIndex(); - return; - // Waterfall start -@@ -70,6 +60,6 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder - } - } - -- throw new CorruptedFrameException( "length wider than 21-bit" ); -+ throw new CorruptedFrameException("length wider than 21-bit"); - } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -index d4c3df44..ee80e1e9 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -@@ -6,36 +6,29 @@ import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.MessageToByteEncoder; - - @ChannelHandler.Sharable --public class Varint21LengthFieldPrepender extends MessageToByteEncoder --{ -+public class Varint21LengthFieldPrepender extends MessageToByteEncoder { - - @Override -- protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception -- { -+ protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { - int bodyLen = msg.readableBytes(); -- int headerLen = varintSize( bodyLen ); -- out.ensureWritable( headerLen + bodyLen ); -+ int headerLen = varintSize(bodyLen); -+ out.ensureWritable(headerLen + bodyLen); - -- DefinedPacket.writeVarInt( bodyLen, out ); -- out.writeBytes( msg ); -+ DefinedPacket.writeVarInt(bodyLen, out); -+ out.writeBytes(msg); - } - -- private static int varintSize(int paramInt) -- { -- if ( ( paramInt & 0xFFFFFF80 ) == 0 ) -- { -+ private static int varintSize(int paramInt) { -+ if ((paramInt & 0xFFFFFF80) == 0) { - return 1; - } -- if ( ( paramInt & 0xFFFFC000 ) == 0 ) -- { -+ if ((paramInt & 0xFFFFC000) == 0) { - return 2; - } -- if ( ( paramInt & 0xFFE00000 ) == 0 ) -- { -+ if ((paramInt & 0xFFE00000) == 0) { - return 3; - } -- if ( ( paramInt & 0xF0000000 ) == 0 ) -- { -+ if ((paramInt & 0xF0000000) == 0) { - return 4; - } - return 5; -diff --git a/proxy/.factorypath b/proxy/.factorypath -new file mode 100644 -index 00000000..c6fe9856 ---- /dev/null -+++ b/proxy/.factorypath -@@ -0,0 +1,37 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/proxy/pom.xml b/proxy/pom.xml -index 4bda0d62..40d7f5c9 100644 ---- a/proxy/pom.xml -+++ b/proxy/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -@@ -87,6 +86,50 @@ - ${project.version} - compile - -+ -+ -+ dev._2lstudios.flamecord -+ travertine-flamecord -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-alert -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-find -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-list -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-send -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-server -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-reconnect-yaml -+ ${project.version} -+ compile -+ -+ - - net.sf.jopt-simple - jopt-simple -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index e860214f..9f008a31 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -1,12 +1,11 @@ - package io.github.waterfallmc.waterfall.conf; - --import com.google.common.base.Joiner; -+import java.io.File; -+ - import net.md_5.bungee.conf.Configuration; - import net.md_5.bungee.conf.YamlConfig; - import net.md_5.bungee.protocol.ProtocolConstants; - --import java.io.File; -- - public class WaterfallConfiguration extends Configuration { - - /** -@@ -50,7 +49,9 @@ public class WaterfallConfiguration extends Configuration { - YamlConfig config = new YamlConfig(new File("waterfall.yml")); - config.load(false); // Load, but no permissions - logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); -- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); -+ // FlameCord - Make the version look better -+ //gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); -+ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); - useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); - // Throttling options - tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..4351b1f4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -1,33 +1,10 @@ - package net.md_5.bungee; - --import com.google.common.base.Charsets; --import com.google.common.base.Preconditions; --import com.google.common.base.Predicate; --import com.google.common.collect.Iterables; --import com.google.common.collect.Lists; --import com.google.common.collect.Sets; --import com.google.common.util.concurrent.ThreadFactoryBuilder; --import com.google.gson.Gson; --import com.google.gson.GsonBuilder; --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; --import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; --import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException; --import io.netty.bootstrap.ServerBootstrap; --import io.netty.channel.Channel; --import io.netty.channel.ChannelException; --import io.netty.channel.ChannelFuture; --import io.netty.channel.ChannelFutureListener; --import io.netty.channel.ChannelOption; --import io.netty.channel.EventLoopGroup; --import io.netty.util.ResourceLeakDetector; - import java.io.File; - import java.io.FileReader; - import java.io.IOException; --import java.io.PrintStream; - import java.net.InetSocketAddress; - import java.net.SocketAddress; --import java.text.MessageFormat; - import java.util.ArrayList; - import java.util.Collection; - import java.util.Collections; -@@ -48,6 +25,33 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; - import java.util.logging.Handler; - import java.util.logging.Level; - import java.util.logging.Logger; -+ -+import com.google.common.base.Charsets; -+import com.google.common.base.Preconditions; -+import com.google.common.base.Predicate; -+import com.google.common.collect.Iterables; -+import com.google.common.collect.Lists; -+import com.google.common.collect.Sets; -+import com.google.common.util.concurrent.ThreadFactoryBuilder; -+import com.google.gson.Gson; -+import com.google.gson.GsonBuilder; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; -+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -+import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; -+import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -+import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException; -+import io.netty.bootstrap.ServerBootstrap; -+import io.netty.channel.Channel; -+import io.netty.channel.ChannelException; -+import io.netty.channel.ChannelFuture; -+import io.netty.channel.ChannelFutureListener; -+import io.netty.channel.ChannelOption; -+import io.netty.channel.EventLoopGroup; -+import io.netty.util.ResourceLeakDetector; - import lombok.Getter; - import lombok.Setter; - import lombok.Synchronized; -@@ -67,6 +71,7 @@ import net.md_5.bungee.api.config.ConfigurationAdapter; - import net.md_5.bungee.api.config.ListenerInfo; - import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.api.connection.ProxiedPlayer; -+import net.md_5.bungee.api.plugin.Command; - import net.md_5.bungee.api.plugin.Plugin; - import net.md_5.bungee.api.plugin.PluginManager; - import net.md_5.bungee.chat.ComponentSerializer; -@@ -86,6 +91,12 @@ import net.md_5.bungee.conf.Configuration; - import net.md_5.bungee.conf.YamlConfig; - import net.md_5.bungee.forge.ForgeConstants; - import net.md_5.bungee.module.ModuleManager; -+import net.md_5.bungee.module.cmd.alert.CommandAlert; -+import net.md_5.bungee.module.cmd.find.CommandFind; -+import net.md_5.bungee.module.cmd.list.CommandList; -+import net.md_5.bungee.module.cmd.send.CommandSend; -+import net.md_5.bungee.module.cmd.server.CommandServer; -+import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; - import net.md_5.bungee.netty.PipelineUtils; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.ProtocolConstants; -@@ -97,8 +108,7 @@ import net.md_5.bungee.util.CaseInsensitiveMap; - /** - * Main BungeeCord proxy class. - */ --public class BungeeCord extends ProxyServer --{ -+public class BungeeCord extends ProxyServer { - - /** - * Current operation state. -@@ -118,8 +128,9 @@ public class BungeeCord extends ProxyServer - /** - * locations.yml save thread. - */ -- private final Timer saveThread = new Timer( "Reconnect Saver" ); -- // private final Timer metricsThread = new Timer( "Metrics Thread" ); // Waterfall: Disable Metrics -+ private final Timer saveThread = new Timer("Reconnect Saver"); -+ // private final Timer metricsThread = new Timer( "Metrics Thread" ); // -+ // Waterfall: Disable Metrics - /** - * Server socket listener. - */ -@@ -133,8 +144,8 @@ public class BungeeCord extends ProxyServer - private final Map connectionsByUUID = new HashMap<>(); - private final ReadWriteLock connectionLock = new ReentrantReadWriteLock(); - /** -- * Lock to protect the shutdown process from being triggered simultaneously -- * from multiple sources. -+ * Lock to protect the shutdown process from being triggered simultaneously from -+ * multiple sources. - */ - private final ReentrantLock shutdownLock = new ReentrantLock(); - /** -@@ -150,33 +161,31 @@ public class BungeeCord extends ProxyServer - private ConfigurationAdapter configurationAdapter = new YamlConfig(); - private final Collection pluginChannels = new HashSet<>(); - @Getter -- private final File pluginsFolder = new File( "plugins" ); -+ private final File pluginsFolder = new File("plugins"); - @Getter - private final BungeeScheduler scheduler = new BungeeScheduler(); - // Waterfall start - Remove ConsoleReader for JLine 3 update - /* -- @Getter -- private final ConsoleReader consoleReader; -- */ -+ * @Getter private final ConsoleReader consoleReader; -+ */ - // Waterfall end - @Getter - private final Logger logger; -- public final Gson gson = new GsonBuilder() -- .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) -- .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) -- .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) -- .registerTypeAdapter( KeybindComponent.class, new KeybindComponentSerializer() ) -- .registerTypeAdapter( ScoreComponent.class, new ScoreComponentSerializer() ) -- .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) -- .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) -- .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ public final Gson gson = new GsonBuilder().registerTypeAdapter(BaseComponent.class, new ComponentSerializer()) -+ .registerTypeAdapter(TextComponent.class, new TextComponentSerializer()) -+ .registerTypeAdapter(TranslatableComponent.class, new TranslatableComponentSerializer()) -+ .registerTypeAdapter(KeybindComponent.class, new KeybindComponentSerializer()) -+ .registerTypeAdapter(ScoreComponent.class, new ScoreComponentSerializer()) -+ .registerTypeAdapter(SelectorComponent.class, new SelectorComponentSerializer()) -+ .registerTypeAdapter(ServerPing.PlayerInfo.class, new PlayerInfoSerializer()) -+ .registerTypeAdapter(Favicon.class, Favicon.getFaviconTypeAdapter()).create(); - // Travertine start -- public final Gson gsonLegacy = new GsonBuilder() -- .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) -- .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) -- .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) -- .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer( ProtocolConstants.MINECRAFT_1_7_2 ) ) -- .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ public final Gson gsonLegacy = new GsonBuilder().registerTypeAdapter(BaseComponent.class, new ComponentSerializer()) -+ .registerTypeAdapter(TextComponent.class, new TextComponentSerializer()) -+ .registerTypeAdapter(TranslatableComponent.class, new TranslatableComponentSerializer()) -+ .registerTypeAdapter(ServerPing.PlayerInfo.class, -+ new PlayerInfoSerializer(ProtocolConstants.MINECRAFT_1_7_2)) -+ .registerTypeAdapter(Favicon.class, Favicon.getFaviconTypeAdapter()).create(); - // Travertine end - @Getter - private ConnectionThrottle connectionThrottle; -@@ -184,241 +193,227 @@ public class BungeeCord extends ProxyServer - - { - // TODO: Proper fallback when we interface the manager -- registerChannel( "BungeeCord" ); -+ registerChannel("BungeeCord"); - } - -- public static BungeeCord getInstance() -- { -+ public static BungeeCord getInstance() { - return (BungeeCord) ProxyServer.getInstance(); - } - - @SuppressFBWarnings("DM_DEFAULT_ENCODING") -- public BungeeCord() throws IOException -- { -- // Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up. -- Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Travertine in directory with ! in path." ); -- -- try -- { -- baseBundle = ResourceBundle.getBundle( "messages" ); -- } catch ( MissingResourceException ex ) -- { -- baseBundle = ResourceBundle.getBundle( "messages", Locale.ENGLISH ); -+ public BungeeCord() throws IOException { -+ // Java uses ! to indicate a resource inside of a jar/zip/other container. -+ // Running Bungee from within a directory that has a ! will cause this to muck -+ // up. -+ Preconditions.checkState(new File(".").getAbsolutePath().indexOf('!') == -1, -+ "Cannot use Travertine in directory with ! in path."); -+ -+ try { -+ baseBundle = ResourceBundle.getBundle("messages"); -+ } catch (MissingResourceException ex) { -+ baseBundle = ResourceBundle.getBundle("messages", Locale.ENGLISH); - } - reloadMessages(); - -- // This is a workaround for quite possibly the weirdest bug I have ever encountered in my life! -- // When jansi attempts to extract its natives, by default it tries to extract a specific version, -- // using the loading class's implementation version. Normally this works completely fine, -- // however when on Windows certain characters such as - and : can trigger special behaviour. -- // Furthermore this behaviour only occurs in specific combinations due to the parsing done by jansi. -- // For example test-test works fine, but test-test-test does not! In order to avoid this all together but -- // still keep our versions the same as they were, we set the override property to the essentially garbage version -- // BungeeCord. This version is only used when extracting the libraries to their temp folder. -- System.setProperty( "library.jansi.version", "BungeeCord" ); -+ // This is a workaround for quite possibly the weirdest bug I have ever -+ // encountered in my life! -+ // When jansi attempts to extract its natives, by default it tries to extract a -+ // specific version, -+ // using the loading class's implementation version. Normally this works -+ // completely fine, -+ // however when on Windows certain characters such as - and : can trigger -+ // special behaviour. -+ // Furthermore this behaviour only occurs in specific combinations due to the -+ // parsing done by jansi. -+ // For example test-test works fine, but test-test-test does not! In order to -+ // avoid this all together but -+ // still keep our versions the same as they were, we set the override property -+ // to the essentially garbage version -+ // BungeeCord. This version is only used when extracting the libraries to their -+ // temp folder. -+ System.setProperty("library.jansi.version", "BungeeCord"); - - // Waterfall start - Use TerminalConsoleAppender and Log4J - /* -- AnsiConsole.systemInstall(); -- consoleReader = new ConsoleReader(); -- consoleReader.setExpandEvents( false ); -- consoleReader.addCompleter( new ConsoleCommandCompleter( this ) ); -- -- logger = new BungeeLogger( "BungeeCord", "proxy.log", consoleReader ); -- System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE ), true ) ); -- System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) ); -- */ -+ * AnsiConsole.systemInstall(); consoleReader = new ConsoleReader(); -+ * consoleReader.setExpandEvents( false ); consoleReader.addCompleter( new -+ * ConsoleCommandCompleter( this ) ); -+ * -+ * logger = new BungeeLogger( "BungeeCord", "proxy.log", consoleReader ); -+ * System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE -+ * ), true ) ); System.setOut( new PrintStream( new LoggingOutputStream( logger, -+ * Level.INFO ), true ) ); -+ */ - logger = io.github.waterfallmc.waterfall.log4j.WaterfallLogger.create(); - // Waterfall end - -- pluginManager = new PluginManager( this ); -- getPluginManager().registerCommand( null, new CommandReload() ); -- getPluginManager().registerCommand( null, new CommandEnd() ); -- getPluginManager().registerCommand( null, new CommandIP() ); -- getPluginManager().registerCommand( null, new CommandBungee() ); -- getPluginManager().registerCommand( null, new CommandPerms() ); -- -- if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) -- { -- if ( EncryptionUtil.nativeFactory.load() ) -- { -- logger.info( "Using mbed TLS based native cipher." ); -- } else -- { -- logger.info( "Using standard Java JCE cipher." ); -+ pluginManager = new PluginManager(this); -+ // FlameCord - Use own module system -+ // getPluginManager().registerCommand( null, new CommandReload() ); -+ // getPluginManager().registerCommand( null, new CommandEnd() ); -+ // getPluginManager().registerCommand( null, new CommandIP() ); -+ // getPluginManager().registerCommand( null, new CommandBungee() ); -+ // getPluginManager().registerCommand( null, new CommandPerms() ); -+ -+ if (!Boolean.getBoolean("net.md_5.bungee.native.disable")) { -+ if (EncryptionUtil.nativeFactory.load()) { -+ logger.info("Using mbed TLS based native cipher."); -+ } else { -+ logger.info("Using standard Java JCE cipher."); - } -- if ( CompressFactory.zlib.load() ) -- { -- logger.info( "Using zlib based native compressor." ); -- } else -- { -- logger.info( "Using standard Java compressor." ); -+ if (CompressFactory.zlib.load()) { -+ logger.info("Using zlib based native compressor."); -+ } else { -+ logger.info("Using standard Java compressor."); - } - } - } - - /** -- * Start this proxy instance by loading the configuration, plugins and -- * starting the connect thread. -+ * Start this proxy instance by loading the configuration, plugins and starting -+ * the connect thread. - * - * @throws Exception any critical errors encountered - */ - @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE") -- public void start() throws Exception -- { -- System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); // Seems to cause Bungee to stop accepting connections -- if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) -- { -- ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); // Eats performance -+ public void start() throws Exception { -+ System.setProperty("io.netty.selectorAutoRebuildThreshold", "0"); // Seems to cause Bungee to stop accepting -+ // connections -+ if (System.getProperty("io.netty.leakDetectionLevel") == null) { -+ ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Eats performance - } - -- bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); -- workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); -+ bossEventLoopGroup = PipelineUtils.newEventLoopGroup(0, -+ new ThreadFactoryBuilder().setNameFormat("Netty Boss IO Thread #%1$d").build()); -+ workerEventLoopGroup = PipelineUtils.newEventLoopGroup(0, -+ new ThreadFactoryBuilder().setNameFormat("Netty Worker IO Thread #%1$d").build()); - -- File moduleDirectory = new File( "modules" ); -- moduleManager.load( this, moduleDirectory ); -- pluginManager.detectPlugins( moduleDirectory ); -+ // FlameCord - Use own module system and reload FlameCord -+ /* -+ * File moduleDirectory = new File( "modules" ); moduleManager.load( this, -+ * moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); -+ */ -+ FlameCord.renew(logger); -+ registerModules(); - - pluginsFolder.mkdir(); -- pluginManager.detectPlugins( pluginsFolder ); -+ pluginManager.detectPlugins(pluginsFolder); - - pluginManager.loadPlugins(); - config.load(); - -- if ( config.isForgeSupport() ) -- { -- registerChannel( ForgeConstants.FML_TAG ); -- registerChannel( ForgeConstants.FML_HANDSHAKE_TAG ); -- registerChannel( ForgeConstants.FORGE_REGISTER ); -+ if (config.isForgeSupport()) { -+ registerChannel(ForgeConstants.FML_TAG); -+ registerChannel(ForgeConstants.FML_HANDSHAKE_TAG); -+ registerChannel(ForgeConstants.FORGE_REGISTER); - } - - isRunning = true; - - pluginManager.enablePlugins(); - -- if ( config.getThrottle() > 0 ) -- { -- connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); -+ if (config.getThrottle() > 0) { -+ connectionThrottle = new ConnectionThrottle(config.getThrottle(), config.getThrottleLimit()); - } - startListeners(); - -- saveThread.scheduleAtFixedRate( new TimerTask() -- { -+ saveThread.scheduleAtFixedRate(new TimerTask() { - @Override -- public void run() -- { -- if ( getReconnectHandler() != null ) -- { -+ public void run() { -+ if (getReconnectHandler() != null) { - getReconnectHandler().save(); - } - } -- }, 0, TimeUnit.MINUTES.toMillis( 5 ) ); -- //metricsThread.scheduleAtFixedRate( new Metrics(), 0, TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); // Waterfall: Disable Metrics -+ }, 0, TimeUnit.MINUTES.toMillis(5)); -+ // metricsThread.scheduleAtFixedRate( new Metrics(), 0, -+ // TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); // Waterfall: Disable -+ // Metrics - -- Runtime.getRuntime().addShutdownHook( new Thread() -- { -+ Runtime.getRuntime().addShutdownHook(new Thread() { - @Override -- public void run() -- { -- independentThreadStop( getTranslation( "restart" ), false ); -+ public void run() { -+ independentThreadStop(getTranslation("restart"), false); - } -- } ); -+ }); - } - -- public void startListeners() -- { -- for ( final ListenerInfo info : config.getListeners() ) -- { -- if ( info.isProxyProtocol() ) -- { -- getLogger().log( Level.WARNING, "Using PROXY protocol for listener {0}, please ensure this listener is adequately firewalled.", info.getSocketAddress() ); -- -- if ( connectionThrottle != null ) -- { -+ public void startListeners() { -+ for (final ListenerInfo info : config.getListeners()) { -+ if (info.isProxyProtocol()) { -+ logger.log(Level.WARNING, -+ "Using PROXY protocol for listener {0}, please ensure this listener is adequately firewalled.", -+ info.getSocketAddress()); -+ -+ if (connectionThrottle != null) { - connectionThrottle = null; -- getLogger().log( Level.WARNING, "Since PROXY protocol is in use, internal connection throttle has been disabled." ); -+ logger.log(Level.WARNING, -+ "Since PROXY protocol is in use, internal connection throttle has been disabled."); - } - } - -- ChannelFutureListener listener = new ChannelFutureListener() -- { -+ ChannelFutureListener listener = new ChannelFutureListener() { - @Override -- public void operationComplete(ChannelFuture future) throws Exception -- { -- if ( future.isSuccess() ) -- { -- listeners.add( future.channel() ); -- getLogger().log( Level.INFO, "Listening on {0}", info.getSocketAddress() ); -- } else -- { -- getLogger().log( Level.WARNING, "Could not bind to host " + info.getSocketAddress(), future.cause() ); -+ public void operationComplete(ChannelFuture future) throws Exception { -+ if (future.isSuccess()) { -+ listeners.add(future.channel()); -+ logger.log(Level.INFO, "Listening on {0}", info.getSocketAddress()); -+ } else { -+ logger.log(Level.WARNING, "Could not bind to host " + info.getSocketAddress(), future.cause()); - } - } - }; -- new ServerBootstrap() -- .channel( PipelineUtils.getServerChannel( info.getSocketAddress() ) ) -- .option( ChannelOption.SO_REUSEADDR, true ) // TODO: Move this elsewhere! -- .childAttr( PipelineUtils.LISTENER, info ) -- .childHandler( PipelineUtils.SERVER_CHILD ) -- .group( bossEventLoopGroup, workerEventLoopGroup ) -- .localAddress( info.getSocketAddress() ) -- .bind().addListener( listener ); -- -- if ( info.isQueryEnabled() ) -- { -- Preconditions.checkArgument( info.getSocketAddress() instanceof InetSocketAddress, "Can only create query listener on UDP address" ); -- -- ChannelFutureListener bindListener = new ChannelFutureListener() -- { -+ new ServerBootstrap().channel(PipelineUtils.getServerChannel(info.getSocketAddress())) -+ .option(ChannelOption.SO_REUSEADDR, true) // TODO: Move this elsewhere! -+ .childAttr(PipelineUtils.LISTENER, info).childHandler(PipelineUtils.SERVER_CHILD) -+ .group(bossEventLoopGroup, workerEventLoopGroup).localAddress(info.getSocketAddress()).bind() -+ .addListener(listener); -+ -+ if (info.isQueryEnabled()) { -+ Preconditions.checkArgument(info.getSocketAddress() instanceof InetSocketAddress, -+ "Can only create query listener on UDP address"); -+ -+ ChannelFutureListener bindListener = new ChannelFutureListener() { - @Override -- public void operationComplete(ChannelFuture future) throws Exception -- { -- if ( future.isSuccess() ) -- { -- listeners.add( future.channel() ); -- getLogger().log( Level.INFO, "Started query on {0}", future.channel().localAddress() ); -- } else -- { -- getLogger().log( Level.WARNING, "Could not bind to host " + info.getSocketAddress(), future.cause() ); -+ public void operationComplete(ChannelFuture future) throws Exception { -+ if (future.isSuccess()) { -+ listeners.add(future.channel()); -+ logger.log(Level.INFO, "Started query on {0}", future.channel().localAddress()); -+ } else { -+ logger.log(Level.WARNING, "Could not bind to host " + info.getSocketAddress(), -+ future.cause()); - } - } - }; -- new RemoteQuery( this, info ).start( PipelineUtils.getDatagramChannel(), new InetSocketAddress( info.getHost().getAddress(), info.getQueryPort() ), workerEventLoopGroup, bindListener ); -+ new RemoteQuery(this, info).start(PipelineUtils.getDatagramChannel(), -+ new InetSocketAddress(info.getHost().getAddress(), info.getQueryPort()), workerEventLoopGroup, -+ bindListener); - } - } - } - -- public void stopListeners() -- { -- for ( Channel listener : listeners ) -- { -- getLogger().log( Level.INFO, "Closing listener {0}", listener ); -- try -- { -+ public void stopListeners() { -+ for (Channel listener : listeners) { -+ logger.log(Level.INFO, "Closing listener {0}", listener); -+ try { - listener.close().syncUninterruptibly(); -- } catch ( ChannelException ex ) -- { -- getLogger().severe( "Could not close listen thread" ); -+ } catch (ChannelException ex) { -+ logger.severe("Could not close listen thread"); - } - } - listeners.clear(); - } - - @Override -- public void stop() -- { -- stop( getTranslation( "restart" ) ); -+ public void stop() { -+ stop(getTranslation("restart")); - } - - @Override -- public void stop(final String reason) -- { -- new Thread( "Shutdown Thread" ) -- { -+ public void stop(final String reason) { -+ new Thread("Shutdown Thread") { - @Override -- public void run() -- { -- independentThreadStop( reason, true ); -+ public void run() { -+ independentThreadStop(reason, true); - } - }.start(); - } -@@ -426,15 +421,14 @@ public class BungeeCord extends ProxyServer - // This must be run on a separate thread to avoid deadlock! - @SuppressFBWarnings("DM_EXIT") - @SuppressWarnings("TooBroadCatch") -- private void independentThreadStop(final String reason, boolean callSystemExit) -- { -+ private void independentThreadStop(final String reason, boolean callSystemExit) { - // Acquire the shutdown lock -- // This needs to actually block here, otherwise running 'end' and then ctrl+c will cause the thread to terminate prematurely -+ // This needs to actually block here, otherwise running 'end' and then ctrl+c -+ // will cause the thread to terminate prematurely - shutdownLock.lock(); - - // Acquired the shutdown lock -- if ( !isRunning ) -- { -+ if (!isRunning) { - // Server is already shutting down - nothing to do - shutdownLock.unlock(); - return; -@@ -442,84 +436,75 @@ public class BungeeCord extends ProxyServer - isRunning = false; - - stopListeners(); -- getLogger().info( "Closing pending connections" ); -+ getLogger().info("Closing pending connections"); - - connectionLock.readLock().lock(); -- try -- { -- getLogger().log( Level.INFO, "Disconnecting {0} connections", connections.size() ); -- for ( UserConnection user : connections.values() ) -- { -- user.disconnect( reason ); -+ try { -+ getLogger().log(Level.INFO, "Disconnecting {0} connections", connections.size()); -+ for (UserConnection user : connections.values()) { -+ user.disconnect(reason); - } -- } finally -- { -+ } finally { - connectionLock.readLock().unlock(); - } - -- try -- { -- Thread.sleep( 500 ); -- } catch ( InterruptedException ex ) -- { -+ try { -+ Thread.sleep(500); -+ } catch (InterruptedException ex) { - } - -- if ( reconnectHandler != null ) -- { -- getLogger().info( "Saving reconnect locations" ); -+ if (reconnectHandler != null) { -+ getLogger().info("Saving reconnect locations"); - reconnectHandler.save(); - reconnectHandler.close(); - } - saveThread.cancel(); -- //metricsThread.cancel(); // Waterfall: Disable Metrics -+ // metricsThread.cancel(); // Waterfall: Disable Metrics - -- getLogger().info( "Disabling plugins" ); -- for ( Plugin plugin : Lists.reverse( new ArrayList<>( pluginManager.getPlugins() ) ) ) -- { -- try -- { -+ getLogger().info("Disabling plugins"); -+ for (Plugin plugin : Lists.reverse(new ArrayList<>(pluginManager.getPlugins()))) { -+ try { - plugin.onDisable(); -- for ( Handler handler : plugin.getLogger().getHandlers() ) -- { -+ for (Handler handler : plugin.getLogger().getHandlers()) { - handler.close(); - } -- } catch ( Throwable t ) -- { -+ } catch (Throwable t) { - // Waterfall start - throw exception event - String msg = "Exception disabling plugin " + plugin.getDescription().getName(); -- getLogger().log( Level.SEVERE, msg, t ); -- pluginManager.callEvent( new ProxyExceptionEvent( new ProxyPluginEnableDisableException( msg, t, plugin) ) ); -+ getLogger().log(Level.SEVERE, msg, t); -+ pluginManager.callEvent(new ProxyExceptionEvent(new ProxyPluginEnableDisableException(msg, t, plugin))); - // Waterfall end - } -- getScheduler().cancel( plugin ); -+ getScheduler().cancel(plugin); - plugin.getExecutorService().shutdownNow(); - } - -- getLogger().info( "Closing IO threads" ); -- bossEventLoopGroup.shutdownGracefully(); -- workerEventLoopGroup.shutdownGracefully(); -- while (true) { -- try { -- bossEventLoopGroup.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); -- workerEventLoopGroup.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); -- break; -- } catch (InterruptedException ignored) {} -+ logger.info("Closing IO threads"); -+ bossEventLoopGroup.shutdownGracefully(); -+ workerEventLoopGroup.shutdownGracefully(); -+ while (true) { -+ try { -+ bossEventLoopGroup.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); -+ workerEventLoopGroup.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); -+ break; -+ } catch (InterruptedException ignored) { -+ } - } - -- getLogger().info( "Thank you and goodbye" ); -+ getLogger().info("Thank you and goodbye"); - // Need to close loggers after last message! -- for ( Handler handler : getLogger().getHandlers() ) -- { -+ for (Handler handler : getLogger().getHandlers()) { - handler.close(); - } - -- // Unlock the thread before optionally calling system exit, which might invoke this function again. -- // If that happens, the system will obtain the lock, and then see that isRunning == false and return without doing anything. -+ // Unlock the thread before optionally calling system exit, which might invoke -+ // this function again. -+ // If that happens, the system will obtain the lock, and then see that isRunning -+ // == false and return without doing anything. - shutdownLock.unlock(); - -- if ( callSystemExit ) -- { -- System.exit( 0 ); -+ if (callSystemExit) { -+ System.exit(0); - } - } - -@@ -528,291 +513,336 @@ public class BungeeCord extends ProxyServer - * - * @param packet the packet to send - */ -- public void broadcast(DefinedPacket packet) -- { -+ public void broadcast(DefinedPacket packet) { - connectionLock.readLock().lock(); -- try -- { -- for ( UserConnection con : connections.values() ) -- { -- con.unsafe().sendPacket( packet ); -+ try { -+ for (UserConnection con : connections.values()) { -+ con.unsafe().sendPacket(packet); - } -- } finally -- { -+ } finally { - connectionLock.readLock().unlock(); - } - } - - @Override -- public String getName() -- { -- return "Travertine"; -+ public String getName() { -+ // FlameCord - Use our own version name -+ return "FlameCord"; - } - - @Override -- public String getVersion() -- { -- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -- } -- -- public void reloadMessages() -- { -- File file = new File( "messages.properties" ); -- if ( file.isFile() ) -- { -- try ( FileReader rd = new FileReader( file ) ) -- { -- customBundle = new PropertyResourceBundle( rd ); -- } catch ( IOException ex ) -- { -- getLogger().log( Level.SEVERE, "Could not load custom messages.properties", ex ); -+ public String getVersion() { -+ // FlameCord - Use our own version string -+ return "0.4.2"; -+ } -+ -+ public void reloadMessages() { -+ File file = new File("messages.properties"); -+ if (file.isFile()) { -+ try (FileReader rd = new FileReader(file)) { -+ customBundle = new PropertyResourceBundle(rd); -+ } catch (IOException ex) { -+ getLogger().log(Level.SEVERE, "Could not load custom messages.properties", ex); - } - } - } - - @Override -- public String getTranslation(String name, Object... args) -- { -- String translation = ""; -- try -- { -- final String string = customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ); -- -- translation = ( args.length == 0 ) ? string : MessageFormat.format( string, args ); -- } catch ( MissingResourceException ex ) -- { -- } -- return translation; -+ public String getTranslation(String name, Object... args) { -+ // FlameCord - Use our own translation system -+ /* -+ * String translation = ""; try { final -+ * String string = customBundle != null && customBundle.containsKey(name) ? -+ * customBundle.getString(name) : baseBundle.getString(name); -+ * -+ * translation = (args.length == 0) ? string : MessageFormat.format(string, -+ * args); } catch (MissingResourceException ex) { } return translation; -+ */ -+ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); - } - - @Override - @SuppressWarnings("unchecked") -- public Collection getPlayers() -- { -+ public Collection getPlayers() { - connectionLock.readLock().lock(); -- try -- { -- return Collections.unmodifiableCollection( new HashSet( connections.values() ) ); -- } finally -- { -+ try { -+ return Collections.unmodifiableCollection(new HashSet(connections.values())); -+ } finally { - connectionLock.readLock().unlock(); - } - } - - @Override -- public int getOnlineCount() -- { -+ public int getOnlineCount() { - return connections.size(); - } - - @Override -- public ProxiedPlayer getPlayer(String name) -- { -+ public ProxiedPlayer getPlayer(String name) { - connectionLock.readLock().lock(); -- try -- { -- return connections.get( name ); -- } finally -- { -+ try { -+ return connections.get(name); -+ } finally { - connectionLock.readLock().unlock(); - } - } - -- public UserConnection getPlayerByOfflineUUID(UUID name) -- { -+ public UserConnection getPlayerByOfflineUUID(UUID name) { - connectionLock.readLock().lock(); -- try -- { -- return connectionsByOfflineUUID.get( name ); -- } finally -- { -+ try { -+ return connectionsByOfflineUUID.get(name); -+ } finally { - connectionLock.readLock().unlock(); - } - } - - @Override -- public ProxiedPlayer getPlayer(UUID uuid) -- { -+ public ProxiedPlayer getPlayer(UUID uuid) { - connectionLock.readLock().lock(); -- try -- { -- return connectionsByUUID.get( uuid ); -- } finally -- { -+ try { -+ return connectionsByUUID.get(uuid); -+ } finally { - connectionLock.readLock().unlock(); - } - } - - @Override -- public Map getServers() -- { -+ public Map getServers() { - return config.getServers(); - } - - // Waterfall start - @Override -- public Map getServersCopy() -- { -+ public Map getServersCopy() { - return config.getServersCopy(); - } - // Waterfall end - - @Override -- public ServerInfo getServerInfo(String name) -- { -- return config.getServerInfo( name ); // Waterfall -+ public ServerInfo getServerInfo(String name) { -+ return config.getServerInfo(name); // Waterfall - } - - @Override - @Synchronized("pluginChannels") -- public void registerChannel(String channel) -- { -- pluginChannels.add( channel ); -+ public void registerChannel(String channel) { -+ pluginChannels.add(channel); - } - - @Override - @Synchronized("pluginChannels") -- public void unregisterChannel(String channel) -- { -- pluginChannels.remove( channel ); -+ public void unregisterChannel(String channel) { -+ pluginChannels.remove(channel); - } - - @Override - @Synchronized("pluginChannels") -- public Collection getChannels() -- { -- return Collections.unmodifiableCollection( pluginChannels ); -+ public Collection getChannels() { -+ return Collections.unmodifiableCollection(pluginChannels); - } - -- public PluginMessage registerChannels(int protocolVersion) -- { -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) -- { -- return new PluginMessage( "minecraft:register", Util.format( Iterables.transform( pluginChannels, PluginMessage.MODERNISE ), "\00" ).getBytes( Charsets.UTF_8 ), false ); -+ public PluginMessage registerChannels(int protocolVersion) { -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) { -+ return new PluginMessage("minecraft:register", -+ Util.format(Iterables.transform(pluginChannels, PluginMessage.MODERNISE), "\00") -+ .getBytes(Charsets.UTF_8), -+ false); - } - -- return new PluginMessage( "REGISTER", Util.format( pluginChannels, "\00" ).getBytes( Charsets.UTF_8 ), false ); -+ return new PluginMessage("REGISTER", Util.format(pluginChannels, "\00").getBytes(Charsets.UTF_8), false); - } - - @Override -- public int getProtocolVersion() -- { -- return ProtocolConstants.SUPPORTED_VERSION_IDS.get( ProtocolConstants.SUPPORTED_VERSION_IDS.size() - 1 ); -+ public int getProtocolVersion() { -+ return ProtocolConstants.SUPPORTED_VERSION_IDS.get(ProtocolConstants.SUPPORTED_VERSION_IDS.size() - 1); - } - - @Override -- public String getGameVersion() -- { -+ public String getGameVersion() { - return getConfig().getGameVersion(); // Waterfall - } - - @Override -- public ServerInfo constructServerInfo(String name, InetSocketAddress address, String motd, boolean restricted) -- { -- return constructServerInfo( name, (SocketAddress) address, motd, restricted ); -+ public ServerInfo constructServerInfo(String name, InetSocketAddress address, String motd, boolean restricted) { -+ return constructServerInfo(name, (SocketAddress) address, motd, restricted); - } - - @Override -- public ServerInfo constructServerInfo(String name, SocketAddress address, String motd, boolean restricted) -- { -- return new BungeeServerInfo( name, address, motd, restricted ); -+ public ServerInfo constructServerInfo(String name, SocketAddress address, String motd, boolean restricted) { -+ return new BungeeServerInfo(name, address, motd, restricted); - } - - @Override -- public CommandSender getConsole() -- { -+ public CommandSender getConsole() { - return ConsoleCommandSender.getInstance(); - } - - @Override -- public void broadcast(String message) -- { -- broadcast( TextComponent.fromLegacyText( message ) ); -+ public void broadcast(String message) { -+ broadcast(TextComponent.fromLegacyText(message)); - } - - @Override -- public void broadcast(BaseComponent... message) -- { -- getConsole().sendMessage( BaseComponent.toLegacyText( message ) ); -- for ( ProxiedPlayer player : getPlayers() ) -- { -- player.sendMessage( message ); -+ public void broadcast(BaseComponent... message) { -+ getConsole().sendMessage(BaseComponent.toLegacyText(message)); -+ for (ProxiedPlayer player : getPlayers()) { -+ player.sendMessage(message); - } - } - - @Override -- public void broadcast(BaseComponent message) -- { -- getConsole().sendMessage( message.toLegacyText() ); -- for ( ProxiedPlayer player : getPlayers() ) -- { -- player.sendMessage( message ); -+ public void broadcast(BaseComponent message) { -+ getConsole().sendMessage(message.toLegacyText()); -+ for (ProxiedPlayer player : getPlayers()) { -+ player.sendMessage(message); - } - } - -- public void addConnection(UserConnection con) -- { -+ public void addConnection(UserConnection con) { - connectionLock.writeLock().lock(); -- try -- { -- connections.put( con.getName(), con ); -- connectionsByUUID.put( con.getUniqueId(), con ); -- connectionsByOfflineUUID.put( con.getPendingConnection().getOfflineId(), con ); -- } finally -- { -+ try { -+ connections.put(con.getName(), con); -+ connectionsByUUID.put(con.getUniqueId(), con); -+ connectionsByOfflineUUID.put(con.getPendingConnection().getOfflineId(), con); -+ } finally { - connectionLock.writeLock().unlock(); - } - } - -- public void removeConnection(UserConnection con) -- { -+ public void removeConnection(UserConnection con) { - connectionLock.writeLock().lock(); -- try -- { -+ try { - // TODO See #1218 -- if ( connections.get( con.getName() ) == con ) -- { -- connections.remove( con.getName() ); -- connectionsByUUID.remove( con.getUniqueId() ); -- connectionsByOfflineUUID.remove( con.getPendingConnection().getOfflineId() ); -+ if (connections.get(con.getName()) == con) { -+ connections.remove(con.getName()); -+ connectionsByUUID.remove(con.getUniqueId()); -+ connectionsByOfflineUUID.remove(con.getPendingConnection().getOfflineId()); - } -- } finally -- { -+ } finally { - connectionLock.writeLock().unlock(); - } - } - - @Override -- public Collection getDisabledCommands() -- { -+ public Collection getDisabledCommands() { - return config.getDisabledCommands(); - } - - @Override -- public Collection matchPlayer(final String partialName) -- { -- Preconditions.checkNotNull( partialName, "partialName" ); -+ public Collection matchPlayer(final String partialName) { -+ Preconditions.checkNotNull(partialName, "partialName"); - -- ProxiedPlayer exactMatch = getPlayer( partialName ); -- if ( exactMatch != null ) -- { -- return Collections.singleton( exactMatch ); -+ ProxiedPlayer exactMatch = getPlayer(partialName); -+ if (exactMatch != null) { -+ return Collections.singleton(exactMatch); - } - -- return Sets.newHashSet( Iterables.filter( getPlayers(), new Predicate() -- { -+ return Sets.newHashSet(Iterables.filter(getPlayers(), new Predicate() { - - @Override -- public boolean apply(ProxiedPlayer input) -- { -- return ( input == null ) ? false : input.getName().toLowerCase( Locale.ROOT ).startsWith( partialName.toLowerCase( Locale.ROOT ) ); -+ public boolean apply(ProxiedPlayer input) { -+ return (input == null) ? false -+ : input.getName().toLowerCase(Locale.ROOT).startsWith(partialName.toLowerCase(Locale.ROOT)); - } -- } ) ); -+ })); - } - - @Override -- public Title createTitle() -- { -+ public Title createTitle() { - return new BungeeTitle(); - } -+ -+ // FlameCord - Method to simplify module registering -+ public void registerModules() { -+ final PluginManager pluginManager = getPluginManager(); -+ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); -+ -+ // Bungeecord Commands -+ pluginManager.registerCommand(null, new CommandEnd()); -+ pluginManager.registerCommand(null, new CommandBungee()); -+ -+ if (modulesConfiguration.reloadEnabled) { -+ pluginManager.registerCommand(null, new CommandReload()); -+ } -+ if (modulesConfiguration.ipEnabled) { -+ pluginManager.registerCommand(null, new CommandIP()); -+ } -+ if (modulesConfiguration.permsEnabled) { -+ pluginManager.registerCommand(null, new CommandPerms()); -+ } -+ -+ // Modules Commands -+ if (modulesConfiguration.alertEnabled) { -+ pluginManager.registerCommand(null, new CommandAlert()); -+ } -+ if (modulesConfiguration.findEnabled) { -+ pluginManager.registerCommand(null, new CommandFind()); -+ } -+ if (modulesConfiguration.listEnabled) { -+ pluginManager.registerCommand(null, new CommandList()); -+ } -+ if (modulesConfiguration.sendEnabled) { -+ pluginManager.registerCommand(null, new CommandSend()); -+ } -+ if (modulesConfiguration.serverEnabled) { -+ pluginManager.registerCommand(null, new CommandServer()); -+ } -+ -+ try { -+ if (modulesConfiguration.reconnectEnabled) { -+ for (ListenerInfo info : getConfig().getListeners()) { -+ if (!info.isForceDefault() && getReconnectHandler() == null) { -+ setReconnectHandler(new YamlReconnectHandler()); -+ break; -+ } -+ } -+ } -+ } catch (final Exception exception) { -+ logger.warning("Reconnect module is not able to work on FlameCord!"); -+ } -+ -+ // Flamecord - Commands (Had to make it like this because of netty limitations) -+ pluginManager.registerCommand(null, new Command("flamecord") { -+ @Override -+ public void execute(final CommandSender sender, final String[] args) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); -+ -+ if (sender.hasPermission("flamecord.usage")) { -+ if (args.length > 0) { -+ final String arg0 = args[0]; -+ -+ switch (arg0) { -+ case "firewall": { -+ final FirewallManager firewallManager = flameCord.getFirewallManager(); -+ final int amount = firewallManager.getFirewalled().size(), -+ seconds = firewallManager.getSeconds(); -+ -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("firewall_info", amount, seconds))); -+ break; -+ } -+ case "reload": { -+ FlameCord.renew(logger); -+ sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); -+ break; -+ } -+ default: { -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("flamecord_help", getVersion()))); -+ break; -+ } -+ } -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", getVersion()))); -+ } -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); -+ } -+ } -+ }); -+ } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index ad9a6d0c..a2b585b3 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -1,80 +1,70 @@ - package net.md_5.bungee; - - import java.security.Security; --import java.text.SimpleDateFormat; - import java.util.Arrays; --import java.util.Calendar; --import java.util.Date; --import java.util.concurrent.TimeUnit; -+ - import joptsimple.OptionParser; - import joptsimple.OptionSet; --import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.ProxyServer; --import net.md_5.bungee.api.chat.ComponentBuilder; --import net.md_5.bungee.command.ConsoleCommandSender; - --public class BungeeCordLauncher --{ -+public class BungeeCordLauncher { - -- public static void main(String[] args) throws Exception -- { -- Security.setProperty( "networkaddress.cache.ttl", "30" ); -- Security.setProperty( "networkaddress.cache.negative.ttl", "10" ); -+ public static void main(String[] args) throws Exception { -+ Security.setProperty("networkaddress.cache.ttl", "30"); -+ Security.setProperty("networkaddress.cache.negative.ttl", "10"); - - OptionParser parser = new OptionParser(); - parser.allowsUnrecognizedOptions(); -- parser.acceptsAll( Arrays.asList( "help" ), "Show the help" ); -- parser.acceptsAll( Arrays.asList( "v", "version" ), "Print version and exit" ); -- parser.acceptsAll( Arrays.asList( "noconsole" ), "Disable console input" ); -+ parser.acceptsAll(Arrays.asList("help"), "Show the help"); -+ parser.acceptsAll(Arrays.asList("v", "version"), "Print version and exit"); -+ parser.acceptsAll(Arrays.asList("noconsole"), "Disable console input"); - -- OptionSet options = parser.parse( args ); -+ OptionSet options = parser.parse(args); - -- if ( options.has( "help" ) ) -- { -- parser.printHelpOn( System.out ); -+ if (options.has("help")) { -+ parser.printHelpOn(System.out); - return; - } -- if ( options.has( "version" ) ) -- { -- System.out.println( BungeeCord.class.getPackage().getImplementationVersion() ); -+ if (options.has("version")) { -+ System.out.println(BungeeCord.class.getPackage().getImplementationVersion()); - return; - } - -- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) -- { -- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); -- -- Calendar deadline = Calendar.getInstance(); -- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); -- if ( buildDate.before( deadline.getTime() ) ) -- { -- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); -- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); -- System.err.println( "*** Server will start in 10 seconds ***" ); -- Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); -- } -- } -+ // FlameCord start - Disable update checker -+ /* -+ * if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && -+ * System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) { Date -+ * buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( -+ * BungeeCord.class.getPackage().getSpecificationVersion() ); -+ * -+ * Calendar deadline = Calendar.getInstance(); deadline.add( -+ * Calendar.WEEK_OF_YEAR, -8 ); if ( buildDate.before( deadline.getTime() ) ) { -+ * System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -+ * System.err.println( -+ * "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" -+ * ); System.err.println( -+ * "*** Should this build be outdated, you will get NO support for it. ***" ); -+ * System.err.println( "*** Server will start in 10 seconds ***" ); -+ * Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); } } -+ */ - - BungeeCord bungee = new BungeeCord(); -- ProxyServer.setInstance( bungee ); -- bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); -+ ProxyServer.setInstance(bungee); -+ // FlameCord start - Renamed enabled message -+ bungee.getLogger().info("Enabled FlameCord version " + bungee.getVersion()); - bungee.start(); - -- if ( !options.has( "noconsole" ) ) -- { -+ if (!options.has("noconsole")) { - // Waterfall start - Use TerminalConsoleAppender - new io.github.waterfallmc.waterfall.console.WaterfallConsole().start(); - /* -- String line; -- while ( bungee.isRunning && ( line = bungee.getConsoleReader().readLine( ">" ) ) != null ) -- { -- if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) ) -- { -- bungee.getConsole().sendMessage( new ComponentBuilder( "Command not found" ).color( ChatColor.RED ).create() ); -- } -- } -- */ -+ * String line; while ( bungee.isRunning && ( line = -+ * bungee.getConsoleReader().readLine( ">" ) ) != null ) { if ( -+ * !bungee.getPluginManager().dispatchCommand( -+ * ConsoleCommandSender.getInstance(), line ) ) { -+ * bungee.getConsole().sendMessage( new ComponentBuilder( "Command not found" -+ * ).color( ChatColor.RED ).create() ); } } -+ */ - // Waterfall end - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java -index 7b002089..145bf328 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java -@@ -1,10 +1,5 @@ - package net.md_5.bungee; - --import com.google.common.base.Preconditions; --import io.netty.bootstrap.Bootstrap; --import io.netty.channel.ChannelFuture; --import io.netty.channel.ChannelFutureListener; --import io.netty.channel.ChannelOption; - import java.net.InetSocketAddress; - import java.net.SocketAddress; - import java.util.ArrayList; -@@ -14,6 +9,13 @@ import java.util.HashSet; - import java.util.LinkedList; - import java.util.Objects; - import java.util.Queue; -+ -+import com.google.common.base.Preconditions; -+ -+import io.netty.bootstrap.Bootstrap; -+import io.netty.channel.ChannelFuture; -+import io.netty.channel.ChannelFutureListener; -+import io.netty.channel.ChannelOption; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import lombok.Synchronized; -diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 299a216c..0ce9b03b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -+++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -@@ -12,51 +12,45 @@ import java.util.UUID; - import net.md_5.bungee.api.ServerPing; - import net.md_5.bungee.protocol.ProtocolConstants; - --public class PlayerInfoSerializer implements JsonSerializer, JsonDeserializer --{ -+public class PlayerInfoSerializer -+ implements JsonSerializer, JsonDeserializer { - - // Travertine start - private final int protocol; - -- public PlayerInfoSerializer() -- { -+ public PlayerInfoSerializer() { - this.protocol = ProtocolConstants.MINECRAFT_1_7_6; - } - -- public PlayerInfoSerializer(int protocol) -- { -+ public PlayerInfoSerializer(int protocol) { - this.protocol = protocol; - } - // Travertine end - - @Override -- public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException -- { -+ public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) -+ throws JsonParseException { - JsonObject js = json.getAsJsonObject(); -- ServerPing.PlayerInfo info = new ServerPing.PlayerInfo( js.get( "name" ).getAsString(), (UUID) null ); -- String id = js.get( "id" ).getAsString(); -- if ( ProtocolConstants.isBeforeOrEq( protocol, ProtocolConstants.MINECRAFT_1_7_2 ) || !id.contains( "-" ) ) // Travertine -+ ServerPing.PlayerInfo info = new ServerPing.PlayerInfo(js.get("name").getAsString(), (UUID) null); -+ String id = js.get("id").getAsString(); -+ if (ProtocolConstants.isBeforeOrEq(protocol, ProtocolConstants.MINECRAFT_1_7_2) || !id.contains("-")) // Travertine - { -- info.setId( id ); -- } else -- { -- info.setUniqueId( UUID.fromString( id ) ); -+ info.setId(id); -+ } else { -+ info.setUniqueId(UUID.fromString(id)); - } - return info; - } - - @Override -- public JsonElement serialize(ServerPing.PlayerInfo src, Type typeOfSrc, JsonSerializationContext context) -- { -+ public JsonElement serialize(ServerPing.PlayerInfo src, Type typeOfSrc, JsonSerializationContext context) { - JsonObject out = new JsonObject(); -- out.addProperty( "name", src.getName() ); -+ out.addProperty("name", src.getName()); - // Travertine start -- if ( ProtocolConstants.isBeforeOrEq( protocol, ProtocolConstants.MINECRAFT_1_7_2 ) ) -- { -- out.addProperty( "id", src.getId() ); -- } else -- { -- out.addProperty( "id", src.getUniqueId().toString() ); -+ if (ProtocolConstants.isBeforeOrEq(protocol, ProtocolConstants.MINECRAFT_1_7_2)) { -+ out.addProperty("id", src.getId()); -+ } else { -+ out.addProperty("id", src.getUniqueId().toString()); - } - // Travertine end - return out; -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index c12085e1..a80d56cf 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -1,15 +1,18 @@ - package net.md_5.bungee; - --import com.google.common.base.Preconditions; --import io.netty.buffer.ByteBuf; --import io.netty.buffer.ByteBufAllocator; - import java.net.InetSocketAddress; --import java.util.Locale; --import java.util.Arrays; // Waterfall - import java.nio.charset.StandardCharsets; // Travertine -+import java.util.Arrays; // Waterfall -+import java.util.Locale; - import java.util.Queue; - import java.util.Set; - import java.util.UUID; -+ -+import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import io.netty.buffer.ByteBuf; -+import io.netty.buffer.ByteBufAllocator; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.api.ChatColor; -@@ -34,6 +37,7 @@ import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.HandlerBoss; - import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.PacketWrapper; -@@ -57,8 +61,7 @@ import net.md_5.bungee.util.BufUtil; - import net.md_5.bungee.util.QuietException; - - @RequiredArgsConstructor --public class ServerConnector extends PacketHandler --{ -+public class ServerConnector extends PacketHandler { - - private final ProxyServer bungee; - private ChannelWrapper ch; -@@ -69,63 +72,58 @@ public class ServerConnector extends PacketHandler - private ForgeServerHandler handshakeHandler; - private boolean obsolete; - -- private enum State -- { -+ private enum State { - - LOGIN_SUCCESS, ENCRYPT_RESPONSE, LOGIN, FINISHED; - } - - @Override -- public void exception(Throwable t) throws Exception -- { -- if ( obsolete ) -- { -+ public void exception(Throwable t) throws Exception { -+ if (obsolete) { - return; - } - -- String message = "Exception Connecting:" + Util.exception( t ); -- if ( user.getServer() == null ) -- { -- user.disconnect( message ); -- } else -- { -- user.sendMessage( ChatColor.RED + message ); -+ String message = "Exception Connecting:" + Util.exception(t); -+ if (user.getServer() == null) { -+ user.disconnect(message); -+ } else { -+ user.sendMessage(ChatColor.RED + message); - } - } - - @Override -- public void connected(ChannelWrapper channel) throws Exception -- { -+ public void connected(ChannelWrapper channel) throws Exception { - this.ch = channel; - -- this.handshakeHandler = new ForgeServerHandler( user, ch, target ); -+ this.handshakeHandler = new ForgeServerHandler(user, ch, target); - Handshake originalHandshake = user.getPendingConnection().getHandshake(); -- Handshake copiedHandshake = new Handshake( originalHandshake.getProtocolVersion(), originalHandshake.getHost(), originalHandshake.getPort(), 2 ); -+ Handshake copiedHandshake = new Handshake(originalHandshake.getProtocolVersion(), originalHandshake.getHost(), -+ originalHandshake.getPort(), 2); - -- if ( BungeeCord.getInstance().config.isIpForward() && user.getSocketAddress() instanceof InetSocketAddress ) -- { -- String newHost = copiedHandshake.getHost() + "\00" + user.getAddress().getHostString() + "\00" + user.getUUID(); -+ if (BungeeCord.getInstance().config.isIpForward() && user.getSocketAddress() instanceof InetSocketAddress) { -+ String newHost = copiedHandshake.getHost() + "\00" + user.getAddress().getHostString() + "\00" -+ + user.getUUID(); - - LoginResult profile = user.getPendingConnection().getLoginProfile(); - - // Handle properties. - LoginResult.Property[] properties = new LoginResult.Property[0]; - -- if ( profile != null && profile.getProperties() != null && profile.getProperties().length > 0 ) -- { -+ if (profile != null && profile.getProperties() != null && profile.getProperties().length > 0) { - properties = profile.getProperties(); - } - -- if ( user.getForgeClientHandler().isFmlTokenInHandshake() ) -- { -+ if (user.getForgeClientHandler().isFmlTokenInHandshake()) { - // Get the current properties and copy them into a slightly bigger array. -- LoginResult.Property[] newp = Arrays.copyOf( properties, properties.length + 2 ); -+ LoginResult.Property[] newp = Arrays.copyOf(properties, properties.length + 2); - - // Add a new profile property that specifies that this user is a Forge user. -- newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); -+ newp[newp.length - 2] = new LoginResult.Property(ForgeConstants.FML_LOGIN_PROFILE, "true", null); - -- // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. -- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); -+ // If we do not perform the replacement, then the IP Forwarding code in Spigot -+ // et. al. will try to split on this prematurely. -+ newp[newp.length - 1] = new LoginResult.Property(ForgeConstants.EXTRA_DATA, -+ user.getExtraDataInHandshake().replaceAll("\0", "\1"), ""); - - // All done. - properties = newp; -@@ -136,57 +134,60 @@ public class ServerConnector extends PacketHandler - newHost += "\00" + BungeeCord.getInstance().gson.toJson(properties); - } - -- copiedHandshake.setHost( newHost ); -- } else if ( !user.getExtraDataInHandshake().isEmpty() ) -- { -+ copiedHandshake.setHost(newHost); -+ } else if (!user.getExtraDataInHandshake().isEmpty()) { - // Restore the extra data -- copiedHandshake.setHost( copiedHandshake.getHost() + user.getExtraDataInHandshake() ); -+ copiedHandshake.setHost(copiedHandshake.getHost() + user.getExtraDataInHandshake()); - } - -- channel.write( copiedHandshake ); -+ channel.write(copiedHandshake); - -- channel.setProtocol( Protocol.LOGIN ); -- channel.write( new LoginRequest( user.getName() ) ); -+ channel.setProtocol(Protocol.LOGIN); -+ channel.write(new LoginRequest(user.getName())); - } - - @Override -- public void disconnected(ChannelWrapper channel) throws Exception -- { -- user.getPendingConnects().remove( target ); -+ public void disconnected(ChannelWrapper channel) throws Exception { -+ user.getPendingConnects().remove(target); - } - - @Override -- public void handle(PacketWrapper packet) throws Exception -- { -- if ( packet.packet == null ) -- { -- throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); -+ public void handle(final PacketWrapper packet) throws Exception { -+ if (packet.packet == null) { -+ // FlameCord - Toggle Dumping packet info -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( -+ "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16)); -+ } else { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException("Unexpected packet received during connector process!"); -+ } - } - } - - @Override -- public void handle(LoginSuccess loginSuccess) throws Exception -- { -- Preconditions.checkState( thisState == State.LOGIN_SUCCESS, "Not expecting LOGIN_SUCCESS" ); -- ch.setProtocol( Protocol.GAME ); -+ public void handle(LoginSuccess loginSuccess) throws Exception { -+ Preconditions.checkState(thisState == State.LOGIN_SUCCESS, "Not expecting LOGIN_SUCCESS"); -+ ch.setProtocol(Protocol.GAME); - thisState = State.LOGIN; - - // Only reset the Forge client when: - // 1) The user is switching servers (so has a current server) - // 2) The handshake is complete - // 3) The user is currently on a modded server (if we are on a vanilla server, -- // we may be heading for another vanilla server, so we don't need to reset.) -+ // we may be heading for another vanilla server, so we don't need to reset.) - // - // user.getServer() gets the user's CURRENT server, not the one we are trying - // to connect to. - // - // We will reset the connection later if the current server is vanilla, and -- // we need to switch to a modded connection. However, we always need to reset the -+ // we need to switch to a modded connection. However, we always need to reset -+ // the - // connection when we have a modded server regardless of where we go - doing it - // here makes sense. -- if ( user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete() -- && user.getServer().isForgeServer() ) -- { -+ if (user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete() -+ && user.getServer().isForgeServer()) { - user.getForgeClientHandler().resetHandshake(); - } - -@@ -194,197 +195,217 @@ public class ServerConnector extends PacketHandler - } - - @Override -- public void handle(SetCompression setCompression) throws Exception -- { -- ch.setCompressionThreshold( setCompression.getThreshold() ); -+ public void handle(SetCompression setCompression) throws Exception { -+ ch.setCompressionThreshold(setCompression.getThreshold()); - } - - @Override -- public void handle(Login login) throws Exception -- { -- Preconditions.checkState( thisState == State.LOGIN, "Not expecting LOGIN" ); -+ public void handle(Login login) throws Exception { -+ Preconditions.checkState(thisState == State.LOGIN, "Not expecting LOGIN"); - -- ServerConnection server = new ServerConnection( ch, target ); -- ServerConnectedEvent event = new ServerConnectedEvent( user, server ); -+ ServerConnection server = new ServerConnection(ch, target); -+ ServerConnectedEvent event = new ServerConnectedEvent(user, server); - - if (server.isForgeServer() && user.isForgeUser()) { -- ((MinecraftDecoder) server.getCh().getHandle().pipeline().get(PipelineUtils.PACKET_DECODER)).setSupportsForge(true); -- ((MinecraftDecoder) user.getCh().getHandle().pipeline().get(PipelineUtils.PACKET_DECODER)).setSupportsForge(true); -+ ((MinecraftDecoder) server.getCh().getHandle().pipeline().get(PipelineUtils.PACKET_DECODER)) -+ .setSupportsForge(true); -+ ((MinecraftDecoder) user.getCh().getHandle().pipeline().get(PipelineUtils.PACKET_DECODER)) -+ .setSupportsForge(true); - } - -- bungee.getPluginManager().callEvent( event ); -+ bungee.getPluginManager().callEvent(event); - -- ch.write( BungeeCord.getInstance().registerChannels( user.getPendingConnection().getVersion() ) ); -+ ch.write(BungeeCord.getInstance().registerChannels(user.getPendingConnection().getVersion())); - Queue packetQueue = target.getPacketQueue(); -- synchronized ( packetQueue ) -- { -- while ( !packetQueue.isEmpty() ) -- { -- ch.write( packetQueue.poll() ); -- } -+ // FlameCord - Remove the usage of synchronized -+ // synchronized (packetQueue) { -+ while (!packetQueue.isEmpty()) { -+ ch.write(packetQueue.poll()); - } -+ // } - -- for ( PluginMessage message : user.getPendingConnection().getRelayMessages() ) -- { -- ch.write( message ); -+ for (PluginMessage message : user.getPendingConnection().getRelayMessages()) { -+ ch.write(message); - } - -- if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null ) -- { -- ch.write( user.getSettings() ); -+ if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null) { -+ ch.write(user.getSettings()); - } - -- if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla -+ if (user.getForgeClientHandler().getClientModList() == null -+ && !user.getForgeClientHandler().isHandshakeComplete()) // Vanilla - { - user.getForgeClientHandler().setHandshakeComplete(); - } - -- if ( user.getServer() == null || !( login.getDimension() instanceof Integer ) ) -- { -+ if (user.getServer() == null || !(login.getDimension() instanceof Integer)) { - // Once again, first connection -- user.setClientEntityId( login.getEntityId() ); -- user.setServerEntityId( login.getEntityId() ); -+ user.setClientEntityId(login.getEntityId()); -+ user.setServerEntityId(login.getEntityId()); - - // Set tab list size, TODO: what shall we do about packet mutability -- Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); -+ Login modLogin = new Login(login.getEntityId(), login.isHardcore(), login.getGameMode(), -+ login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), -+ login.getWorldName(), login.getSeed(), login.getDifficulty(), -+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), -+ login.getViewDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), -+ login.isFlat()); - -- user.unsafe().sendPacket( modLogin ); -+ user.unsafe().sendPacket(modLogin); - -- if ( user.getServer() != null ) -- { -- user.getServer().setObsolete( true ); -+ if (user.getServer() != null) { -+ user.getServer().setObsolete(true); - user.getTabListHandler().onServerChange(); - - user.getServerSentScoreboard().clear(); - -- for ( UUID bossbar : user.getSentBossBars() ) -- { -+ for (UUID bossbar : user.getSentBossBars()) { - // Send remove bossbar packet -- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.BossBar( bossbar, 1 ) ); -+ user.unsafe().sendPacket(new net.md_5.bungee.protocol.packet.BossBar(bossbar, 1)); - } - user.getSentBossBars().clear(); - -- user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -- user.getServer().disconnect( "Quitting" ); -- } else -- { -+ user.unsafe() -+ .sendPacket(new Respawn(login.getDimension(), login.getWorldName(), login.getSeed(), -+ login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), -+ login.getLevelType(), login.isDebug(), login.isFlat(), false)); -+ user.getServer().disconnect("Quitting"); -+ } else { - // Travertine start - String brandString = bungee.getName() + " (" + bungee.getVersion() + ")"; - -- if ( ProtocolConstants.isBeforeOrEq( user.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) -- { -- user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); -- } else -- { -+ if (ProtocolConstants.isBeforeOrEq(user.getPendingConnection().getVersion(), -+ ProtocolConstants.MINECRAFT_1_7_6)) { -+ user.unsafe().sendPacket(new PluginMessage("MC|Brand", brandString.getBytes(StandardCharsets.UTF_8), -+ handshakeHandler.isServerForge())); -+ } else { - ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); - DefinedPacket.writeString(brandString, brand); -- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ user.unsafe() -+ .sendPacket(new PluginMessage( -+ user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 -+ ? "minecraft:brand" -+ : "MC|Brand", -+ brand, handshakeHandler.isServerForge())); - brand.release(); - } - // Travertine end - } - -- user.setDimension( login.getDimension() ); -- } else -- { -- user.getServer().setObsolete( true ); -+ user.setDimension(login.getDimension()); -+ } else { -+ user.getServer().setObsolete(true); - user.getTabListHandler().onServerChange(); - - Scoreboard serverScoreboard = user.getServerSentScoreboard(); -- if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall -- for ( Objective objective : serverScoreboard.getObjectives() ) -- { -- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // Travertine - 1.7 -- } -- for ( Score score : serverScoreboard.getScores() ) -- { -- user.unsafe().sendPacket( new ScoreboardScore( score.getItemName(), (byte) 1, score.getScoreName(), score.getValue() ) ); -- } -- for ( Team team : serverScoreboard.getTeams() ) -- { -- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.Team( team.getName() ) ); -- } -+ if (!user.isDisableEntityMetadataRewrite()) { // Waterfall -+ for (Objective objective : serverScoreboard.getObjectives()) { -+ user.unsafe() -+ .sendPacket(new ScoreboardObjective(objective.getName(), objective.getValue(), -+ objective.getType() == null ? null -+ : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), -+ (byte) 1)); // Travertine - 1.7 -+ } -+ for (Score score : serverScoreboard.getScores()) { -+ user.unsafe().sendPacket( -+ new ScoreboardScore(score.getItemName(), (byte) 1, score.getScoreName(), score.getValue())); -+ } -+ for (Team team : serverScoreboard.getTeams()) { -+ user.unsafe().sendPacket(new net.md_5.bungee.protocol.packet.Team(team.getName())); -+ } - } // Waterfall - serverScoreboard.clear(); - -- for ( UUID bossbar : user.getSentBossBars() ) -- { -+ for (UUID bossbar : user.getSentBossBars()) { - // Send remove bossbar packet -- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.BossBar( bossbar, 1 ) ); -+ user.unsafe().sendPacket(new net.md_5.bungee.protocol.packet.BossBar(bossbar, 1)); - } - user.getSentBossBars().clear(); - - // Update debug info from login packet -- user.unsafe().sendPacket( new EntityStatus( user.getClientEntityId(), login.isReducedDebugInfo() ? EntityStatus.DEBUG_INFO_REDUCED : EntityStatus.DEBUG_INFO_NORMAL ) ); -+ user.unsafe().sendPacket(new EntityStatus(user.getClientEntityId(), -+ login.isReducedDebugInfo() ? EntityStatus.DEBUG_INFO_REDUCED : EntityStatus.DEBUG_INFO_NORMAL)); - // And immediate respawn -- if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_15 ) -- { -- user.unsafe().sendPacket( new GameState( GameState.IMMEDIATE_RESPAWN, login.isNormalRespawn() ? 0 : 1 ) ); -+ if (user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_15) { -+ user.unsafe().sendPacket(new GameState(GameState.IMMEDIATE_RESPAWN, login.isNormalRespawn() ? 0 : 1)); - } - -- user.setDimensionChange( true ); -- if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer -+ user.setDimensionChange(true); -+ if (!user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension()) // Waterfall - -+ // defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -+ user.unsafe().sendPacket(new Respawn((Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), -+ login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), -+ login.getLevelType(), login.isDebug(), login.isFlat(), false)); - } - -- user.setServerEntityId( login.getEntityId() ); -+ user.setServerEntityId(login.getEntityId()); - - // Waterfall start -- if ( user.isDisableEntityMetadataRewrite() ) { -+ if (user.isDisableEntityMetadataRewrite()) { - // Ensure that we maintain consistency -- user.setClientEntityId( login.getEntityId() ); -+ user.setClientEntityId(login.getEntityId()); - - // Only send if we are not in the same dimension -- if ( login.getDimension() != user.getDimension() ) // Waterfall - defer -+ if (login.getDimension() != user.getDimension()) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -+ user.unsafe().sendPacket(new Respawn((Integer) user.getDimension() >= 0 ? -1 : 0, -+ login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), -+ login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false)); - } - -- Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); -+ Login modLogin = new Login(login.getEntityId(), login.isHardcore(), login.getGameMode(), -+ login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), -+ login.getWorldName(), login.getSeed(), login.getDifficulty(), -+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), -+ login.getViewDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), -+ login.isFlat()); - user.unsafe().sendPacket(modLogin); - - // Only send if we're in the same dimension -- if ( login.getDimension() == user.getDimension() ) // Waterfall - defer -+ if (login.getDimension() == user.getDimension()) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -+ user.unsafe().sendPacket(new Respawn((Integer) login.getDimension() >= 0 ? -1 : 0, -+ login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), -+ login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false)); - } - } - // Waterfall end -- user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -- if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 ) -- { -- user.unsafe().sendPacket( new ViewDistance( login.getViewDistance() ) ); -+ user.unsafe() -+ .sendPacket(new Respawn(login.getDimension(), login.getWorldName(), login.getSeed(), -+ login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), -+ login.getLevelType(), login.isDebug(), login.isFlat(), false)); -+ if (user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14) { -+ user.unsafe().sendPacket(new ViewDistance(login.getViewDistance())); - } -- user.setDimension( login.getDimension() ); -+ user.setDimension(login.getDimension()); - - // Remove from old servers -- user.getServer().disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ user.getServer().disconnect(); - } - - // TODO: Fix this? -- if ( !user.isActive() ) -- { -- server.disconnect( "Quitting" ); -+ if (!user.isActive()) { -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - // Silly server admins see stack trace and die -- bungee.getLogger().warning( "No client connected for pending server!" ); -+ bungee.getLogger().warning("No client connected for pending server!"); - return; - } - - // Add to new server - // TODO: Move this to the connected() method of DownstreamBridge -- target.addPlayer( user ); -- user.getPendingConnects().remove( target ); -- user.setServerJoinQueue( null ); -- user.setDimensionChange( false ); -+ target.addPlayer(user); -+ user.getPendingConnects().remove(target); -+ user.setServerJoinQueue(null); -+ user.setDimensionChange(false); - -- ServerInfo from = ( user.getServer() == null ) ? null : user.getServer().getInfo(); -- user.setServer( server ); -- ch.getHandle().pipeline().get( HandlerBoss.class ).setHandler( new DownstreamBridge( bungee, user, server ) ); -+ ServerInfo from = (user.getServer() == null) ? null : user.getServer().getInfo(); -+ user.setServer(server); -+ ch.getHandle().pipeline().get(HandlerBoss.class).setHandler(new DownstreamBridge(bungee, user, server)); - -- bungee.getPluginManager().callEvent( new ServerSwitchEvent( user, from ) ); -+ bungee.getPluginManager().callEvent(new ServerSwitchEvent(user, from)); - - thisState = State.FINISHED; - -@@ -392,59 +413,49 @@ public class ServerConnector extends PacketHandler - } - - @Override -- public void handle(EncryptionRequest encryptionRequest) throws Exception -- { -- throw new QuietException( "Server is online mode!" ); -+ public void handle(EncryptionRequest encryptionRequest) throws Exception { -+ throw new QuietException("Server is online mode!"); - } - - @Override -- public void handle(Kick kick) throws Exception -- { -- ServerInfo def = user.updateAndGetNextServer( target ); -- ServerKickEvent event = new ServerKickEvent( user, target, ComponentSerializer.parse( kick.getMessage() ), def, ServerKickEvent.State.CONNECTING, ServerKickEvent.Cause.SERVER ); // Waterfall -- if ( event.getKickReason().toLowerCase( Locale.ROOT ).contains( "outdated" ) && def != null ) -- { -+ public void handle(Kick kick) throws Exception { -+ ServerInfo def = user.updateAndGetNextServer(target); -+ ServerKickEvent event = new ServerKickEvent(user, target, ComponentSerializer.parse(kick.getMessage()), def, -+ ServerKickEvent.State.CONNECTING, ServerKickEvent.Cause.SERVER); // Waterfall -+ if (event.getKickReason().toLowerCase(Locale.ROOT).contains("outdated") && def != null) { - // Pre cancel the event if we are going to try another server -- event.setCancelled( true ); -+ event.setCancelled(true); - } -- bungee.getPluginManager().callEvent( event ); -- if ( event.isCancelled() && event.getCancelServer() != null ) -- { -+ bungee.getPluginManager().callEvent(event); -+ if (event.isCancelled() && event.getCancelServer() != null) { - obsolete = true; -- user.connect( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT ); -+ user.connect(event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT); - throw CancelSendSignal.INSTANCE; - } - -- String message = bungee.getTranslation( "connect_kick", target.getName(), event.getKickReason() ); -- if ( user.isDimensionChange() ) -- { -- user.disconnect( message ); -- } else -- { -- user.sendMessage( message ); -+ String message = bungee.getTranslation("connect_kick", target.getName(), event.getKickReason()); -+ if (user.isDimensionChange()) { -+ user.disconnect(message); -+ } else { -+ user.sendMessage(message); - } - - throw CancelSendSignal.INSTANCE; - } - - @Override -- public void handle(PluginMessage pluginMessage) throws Exception -- { -- if ( BungeeCord.getInstance().config.isForgeSupport() ) -- { -- if ( pluginMessage.getTag().equals( ForgeConstants.FML_REGISTER ) ) -- { -- Set channels = ForgeUtils.readRegisteredChannels( pluginMessage ); -+ public void handle(PluginMessage pluginMessage) throws Exception { -+ if (BungeeCord.getInstance().config.isForgeSupport()) { -+ if (pluginMessage.getTag().equals(ForgeConstants.FML_REGISTER)) { -+ Set channels = ForgeUtils.readRegisteredChannels(pluginMessage); - boolean isForgeServer = false; -- for ( String channel : channels ) -- { -- if ( channel.equals( ForgeConstants.FML_HANDSHAKE_TAG ) ) -- { -+ for (String channel : channels) { -+ if (channel.equals(ForgeConstants.FML_HANDSHAKE_TAG)) { - // If we have a completed handshake and we have been asked to register a FML|HS -- // packet, let's send the reset packet now. Then, we can continue the message sending. -+ // packet, let's send the reset packet now. Then, we can continue the message -+ // sending. - // The handshake will not be complete if we reset this earlier. -- if ( user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete() ) -- { -+ if (user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete()) { - user.getForgeClientHandler().resetHandshake(); - } - -@@ -453,21 +464,19 @@ public class ServerConnector extends PacketHandler - } - } - -- if ( isForgeServer && !this.handshakeHandler.isServerForge() ) -- { -+ if (isForgeServer && !this.handshakeHandler.isServerForge()) { - // We now set the server-side handshake handler for the client to this. - handshakeHandler.setServerAsForgeServer(); -- user.setForgeServerHandler( handshakeHandler ); -+ user.setForgeServerHandler(handshakeHandler); - } - } - -- if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) -- { -- this.handshakeHandler.handle( pluginMessage ); -+ if (pluginMessage.getTag().equals(ForgeConstants.FML_HANDSHAKE_TAG) -+ || pluginMessage.getTag().equals(ForgeConstants.FORGE_REGISTER)) { -+ this.handshakeHandler.handle(pluginMessage); - - // Travertine start -- if ( user.getForgeClientHandler().checkUserOutdated() ) -- { -+ if (user.getForgeClientHandler().checkUserOutdated()) { - ch.close(); - user.getPendingConnects().remove(target); - } -@@ -478,14 +487,14 @@ public class ServerConnector extends PacketHandler - } - } - -- // We have to forward these to the user, especially with Forge as stuff might break -+ // We have to forward these to the user, especially with Forge as stuff might -+ // break - // This includes any REGISTER messages we intercepted earlier. -- user.unsafe().sendPacket( pluginMessage ); -+ user.unsafe().sendPacket(pluginMessage); - } - - @Override -- public String toString() -- { -+ public String toString() { - return "[" + user.getName() + "|" + user.getAddress() + "] <-> ServerConnector [" + target.getName() + "]"; - } - } -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 8c2a743a..f0015076 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -1,16 +1,5 @@ - package net.md_5.bungee; - --import com.google.common.base.Preconditions; --import com.google.common.collect.HashMultimap; --import com.google.common.collect.ImmutableMap; --import com.google.common.collect.Multimap; --import io.netty.bootstrap.Bootstrap; --import io.netty.channel.Channel; --import io.netty.channel.ChannelFuture; --import io.netty.channel.ChannelFutureListener; --import io.netty.channel.ChannelInitializer; --import io.netty.channel.ChannelOption; --import io.netty.util.internal.PlatformDependent; - import java.net.InetSocketAddress; - import java.net.SocketAddress; - import java.util.Collection; -@@ -23,6 +12,19 @@ import java.util.Objects; - import java.util.Queue; - import java.util.UUID; - import java.util.logging.Level; -+ -+import com.google.common.base.Preconditions; -+import com.google.common.collect.HashMultimap; -+import com.google.common.collect.ImmutableMap; -+import com.google.common.collect.Multimap; -+ -+import io.netty.bootstrap.Bootstrap; -+import io.netty.channel.Channel; -+import io.netty.channel.ChannelFuture; -+import io.netty.channel.ChannelFutureListener; -+import io.netty.channel.ChannelInitializer; -+import io.netty.channel.ChannelOption; -+import io.netty.util.internal.PlatformDependent; - import lombok.Getter; - import lombok.NonNull; - import lombok.RequiredArgsConstructor; -@@ -35,6 +37,7 @@ import net.md_5.bungee.api.SkinConfiguration; - import net.md_5.bungee.api.Title; - import net.md_5.bungee.api.chat.BaseComponent; - import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.config.ListenerInfo; - import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.api.connection.ProxiedPlayer; - import net.md_5.bungee.api.event.PermissionCheckEvent; -@@ -65,12 +68,12 @@ import net.md_5.bungee.tab.ServerUnique; - import net.md_5.bungee.tab.TabList; - import net.md_5.bungee.util.CaseInsensitiveSet; - import net.md_5.bungee.util.ChatComponentTransformer; -+import net.md_5.bungee.util.QuietException; - - @RequiredArgsConstructor --public final class UserConnection implements ProxiedPlayer --{ -+public final class UserConnection implements ProxiedPlayer { - -- /*========================================================================*/ -+ /* ======================================================================== */ - @NonNull - private final ProxyServer bungee; - @NonNull -@@ -81,7 +84,7 @@ public final class UserConnection implements ProxiedPlayer - private final String name; - @Getter - private final InitialHandler pendingConnection; -- /*========================================================================*/ -+ /* ======================================================================== */ - @Getter - @Setter - private ServerConnection server; -@@ -93,7 +96,7 @@ public final class UserConnection implements ProxiedPlayer - private boolean dimensionChange = true; - @Getter - private final Collection pendingConnects = new HashSet<>(); -- /*========================================================================*/ -+ /* ======================================================================== */ - @Getter - @Setter - private int ping = 100; -@@ -110,10 +113,10 @@ public final class UserConnection implements ProxiedPlayer - // Used for trying multiple servers in order - @Setter - private Queue serverJoinQueue; -- /*========================================================================*/ -+ /* ======================================================================== */ - private final Collection groups = new CaseInsensitiveSet(); - private final Collection permissions = new CaseInsensitiveSet(); -- /*========================================================================*/ -+ /* ======================================================================== */ - @Getter - @Setter - private int clientEntityId; -@@ -130,122 +133,104 @@ public final class UserConnection implements ProxiedPlayer - @Getter - private final Multimap potions = HashMultimap.create(); - // Waterfall end -- /*========================================================================*/ -+ /* ======================================================================== */ - @Getter - private String displayName; - @Getter - private EntityMap entityRewrite; - private Locale locale; -- /*========================================================================*/ -+ /* ======================================================================== */ - @Getter - @Setter - private ForgeClientHandler forgeClientHandler; - @Getter - @Setter - private ForgeServerHandler forgeServerHandler; -- /*========================================================================*/ -- private final Unsafe unsafe = new Unsafe() -- { -+ /* ======================================================================== */ -+ private final Unsafe unsafe = new Unsafe() { - @Override -- public void sendPacket(DefinedPacket packet) -- { -- ch.write( packet ); -+ public void sendPacket(DefinedPacket packet) { -+ ch.write(packet); - } - }; - -- public void init() -- { -- this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); -+ public void init() { -+ this.entityRewrite = EntityMap.getEntityMap(getPendingConnection().getVersion()); - - this.displayName = name; - -- tabListHandler = new ServerUnique( this ); -+ tabListHandler = new ServerUnique(this); - -- Collection g = bungee.getConfigurationAdapter().getGroups( name ); -- g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) ); -- for ( String s : g ) -- { -- addGroups( s ); -+ Collection g = bungee.getConfigurationAdapter().getGroups(name); -+ g.addAll(bungee.getConfigurationAdapter().getGroups(getUniqueId().toString())); -+ for (String s : g) { -+ addGroups(s); - } - -- forgeClientHandler = new ForgeClientHandler( this ); -+ forgeClientHandler = new ForgeClientHandler(this); - - // No-config FML handshake marker. - // Set whether the connection has a 1.8 FML marker in the handshake. -- if (this.getPendingConnection().getExtraDataInHandshake().contains( ForgeConstants.FML_HANDSHAKE_TOKEN )) -- { -- forgeClientHandler.setFmlTokenInHandshake( true ); -+ if (this.getPendingConnection().getExtraDataInHandshake().contains(ForgeConstants.FML_HANDSHAKE_TOKEN)) { -+ forgeClientHandler.setFmlTokenInHandshake(true); - } - } - -- public void sendPacket(PacketWrapper packet) -- { -- ch.write( packet ); -+ public void sendPacket(PacketWrapper packet) { -+ ch.write(packet); - } - - @Deprecated -- public boolean isActive() -- { -+ public boolean isActive() { - return !ch.isClosed(); - } - - @Override -- public void setDisplayName(String name) -- { -- Preconditions.checkNotNull( name, "displayName" ); -- Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // Travertine -+ public void setDisplayName(String name) { -+ Preconditions.checkNotNull(name, "displayName"); -+ Preconditions.checkArgument(name.length() <= 16, "Display name cannot be longer than 16 characters"); // Travertine - displayName = name; - } - - @Override -- public void connect(ServerInfo target) -- { -- connect( target, null, ServerConnectEvent.Reason.PLUGIN ); -+ public void connect(ServerInfo target) { -+ connect(target, null, ServerConnectEvent.Reason.PLUGIN); - } - - @Override -- public void connect(ServerInfo target, ServerConnectEvent.Reason reason) -- { -- connect( target, null, false, reason ); -+ public void connect(ServerInfo target, ServerConnectEvent.Reason reason) { -+ connect(target, null, false, reason); - } - - @Override -- public void connect(ServerInfo target, Callback callback) -- { -- connect( target, callback, false, ServerConnectEvent.Reason.PLUGIN ); -+ public void connect(ServerInfo target, Callback callback) { -+ connect(target, callback, false, ServerConnectEvent.Reason.PLUGIN); - } - - @Override -- public void connect(ServerInfo target, Callback callback, ServerConnectEvent.Reason reason) -- { -- connect( target, callback, false, reason ); -+ public void connect(ServerInfo target, Callback callback, ServerConnectEvent.Reason reason) { -+ connect(target, callback, false, reason); - } - - @Deprecated -- public void connectNow(ServerInfo target) -- { -- connectNow( target, ServerConnectEvent.Reason.UNKNOWN ); -+ public void connectNow(ServerInfo target) { -+ connectNow(target, ServerConnectEvent.Reason.UNKNOWN); - } - -- public void connectNow(ServerInfo target, ServerConnectEvent.Reason reason) -- { -+ public void connectNow(ServerInfo target, ServerConnectEvent.Reason reason) { - dimensionChange = true; -- connect( target, reason ); -+ connect(target, reason); - } - -- public ServerInfo updateAndGetNextServer(ServerInfo currentTarget) -- { -- if ( serverJoinQueue == null ) -- { -- serverJoinQueue = new LinkedList<>( getPendingConnection().getListener().getServerPriority() ); -+ public ServerInfo updateAndGetNextServer(ServerInfo currentTarget) { -+ if (serverJoinQueue == null) { -+ serverJoinQueue = new LinkedList<>(getPendingConnection().getListener().getServerPriority()); - } - - ServerInfo next = null; -- while ( !serverJoinQueue.isEmpty() ) -- { -- ServerInfo candidate = ProxyServer.getInstance().getServerInfo( serverJoinQueue.remove() ); -- if ( !Objects.equals( currentTarget, candidate ) ) -- { -+ while (!serverJoinQueue.isEmpty()) { -+ ServerInfo candidate = ProxyServer.getInstance().getServerInfo(serverJoinQueue.remove()); -+ if (!Objects.equals(currentTarget, candidate)) { - next = candidate; - break; - } -@@ -254,389 +239,346 @@ public final class UserConnection implements ProxiedPlayer - return next; - } - -- public void connect(ServerInfo info, final Callback callback, final boolean retry) -- { -- connect( info, callback, retry, ServerConnectEvent.Reason.PLUGIN ); -+ public void connect(ServerInfo info, final Callback callback, final boolean retry) { -+ connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN); - } - -- public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason) -- { -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, -+ ServerConnectEvent.Reason reason) { - // Waterfall start - connect(info, callback, retry, reason, bungee.getConfig().getServerConnectTimeout()); - } -+ - public void connect(ServerInfo info, final Callback callback, final boolean retry, int timeout) { - connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN, timeout); - } - -- public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout) -- { -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, -+ ServerConnectEvent.Reason reason, final int timeout) { - // Waterfall end -- Preconditions.checkNotNull( info, "info" ); -+ Preconditions.checkNotNull(info, "info"); - -- ServerConnectRequest.Builder builder = ServerConnectRequest.builder().retry( retry ).reason( reason ).target( info ); -+ ServerConnectRequest.Builder builder = ServerConnectRequest.builder().retry(retry).reason(reason).target(info); - builder.connectTimeout(timeout); // Waterfall -- if ( callback != null ) -- { -- // Convert the Callback to be compatible with Callback from ServerConnectRequest. -- builder.callback( new Callback() -- { -+ if (callback != null) { -+ // Convert the Callback to be compatible with Callback from -+ // ServerConnectRequest. -+ builder.callback(new Callback() { - @Override -- public void done(ServerConnectRequest.Result result, Throwable error) -- { -- callback.done( ( result == ServerConnectRequest.Result.SUCCESS ) ? Boolean.TRUE : Boolean.FALSE, error ); -+ public void done(ServerConnectRequest.Result result, Throwable error) { -+ callback.done((result == ServerConnectRequest.Result.SUCCESS) ? Boolean.TRUE : Boolean.FALSE, -+ error); - } -- } ); -+ }); - } - -- connect( builder.build() ); -+ connect(builder.build()); - } - - @Override -- public void connect(final ServerConnectRequest request) -- { -- Preconditions.checkNotNull( request, "request" ); -+ public void connect(final ServerConnectRequest request) { -+ Preconditions.checkNotNull(request, "request"); - - final Callback callback = request.getCallback(); -- ServerConnectEvent event = new ServerConnectEvent( this, request.getTarget(), request.getReason(), request ); -- if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) -- { -- if ( callback != null ) -- { -- callback.done( ServerConnectRequest.Result.EVENT_CANCEL, null ); -+ ServerConnectEvent event = new ServerConnectEvent(this, request.getTarget(), request.getReason(), request); -+ if (bungee.getPluginManager().callEvent(event).isCancelled()) { -+ if (callback != null) { -+ callback.done(ServerConnectRequest.Result.EVENT_CANCEL, null); - } - -- if ( getServer() == null && !ch.isClosing() ) -- { -- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); -+ if (getServer() == null && !ch.isClosing()) { -+ // FlameCord - Change IllegalStateException to QuietException -+ // throw new IllegalStateException("Cancelled ServerConnectEvent with no server -+ // or disconnect."); -+ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); - } - return; - } - - final BungeeServerInfo target = (BungeeServerInfo) event.getTarget(); // Update in case the event changed target - -- if ( getServer() != null && Objects.equals( getServer().getInfo(), target ) ) -- { -- if ( callback != null ) -- { -- callback.done( ServerConnectRequest.Result.ALREADY_CONNECTED, null ); -+ if (getServer() != null && Objects.equals(getServer().getInfo(), target)) { -+ if (callback != null) { -+ callback.done(ServerConnectRequest.Result.ALREADY_CONNECTED, null); - } - -- sendMessage( bungee.getTranslation( "already_connected" ) ); -+ sendMessage(bungee.getTranslation("already_connected")); - return; - } -- if ( pendingConnects.contains( target ) ) -- { -- if ( callback != null ) -- { -- callback.done( ServerConnectRequest.Result.ALREADY_CONNECTING, null ); -+ if (pendingConnects.contains(target)) { -+ if (callback != null) { -+ callback.done(ServerConnectRequest.Result.ALREADY_CONNECTING, null); - } - -- sendMessage( bungee.getTranslation( "already_connecting" ) ); -+ sendMessage(bungee.getTranslation("already_connecting")); - return; - } - -- pendingConnects.add( target ); -+ pendingConnects.add(target); - -- ChannelInitializer initializer = new ChannelInitializer() -- { -+ ChannelInitializer initializer = new ChannelInitializer() { - @Override -- protected void initChannel(Channel ch) throws Exception -- { -- PipelineUtils.BASE.initChannel( ch ); -- ch.pipeline().addAfter( PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, new MinecraftDecoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); -- ch.pipeline().addAfter( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, new MinecraftEncoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); -- ch.pipeline().get( HandlerBoss.class ).setHandler( new ServerConnector( bungee, UserConnection.this, target ) ); -+ protected void initChannel(Channel ch) throws Exception { -+ PipelineUtils.BASE.initChannel(ch); -+ ch.pipeline().addAfter(PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, -+ new MinecraftDecoder(Protocol.HANDSHAKE, false, getPendingConnection().getVersion())); -+ ch.pipeline().addAfter(PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, -+ new MinecraftEncoder(Protocol.HANDSHAKE, false, getPendingConnection().getVersion())); -+ ch.pipeline().get(HandlerBoss.class) -+ .setHandler(new ServerConnector(bungee, UserConnection.this, target)); - } - }; -- ChannelFutureListener listener = new ChannelFutureListener() -- { -+ ChannelFutureListener listener = new ChannelFutureListener() { - @Override - @SuppressWarnings("ThrowableResultIgnored") -- public void operationComplete(ChannelFuture future) throws Exception -- { -- if ( callback != null ) -- { -- callback.done( ( future.isSuccess() ) ? ServerConnectRequest.Result.SUCCESS : ServerConnectRequest.Result.FAIL, future.cause() ); -+ public void operationComplete(ChannelFuture future) throws Exception { -+ if (callback != null) { -+ callback.done((future.isSuccess()) ? ServerConnectRequest.Result.SUCCESS -+ : ServerConnectRequest.Result.FAIL, future.cause()); - } - -- if ( !future.isSuccess() ) -- { -+ if (!future.isSuccess()) { - future.channel().close(); -- pendingConnects.remove( target ); -- -- ServerInfo def = updateAndGetNextServer( target ); -- if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) ) -- { -- sendMessage( bungee.getTranslation( "fallback_lobby" ) ); -- connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout() ); // Waterfall -- } else if ( dimensionChange ) -- { -- disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) ); -- } else -- { -- sendMessage( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) ); -+ pendingConnects.remove(target); -+ -+ ServerInfo def = updateAndGetNextServer(target); -+ if (request.isRetry() && def != null && (getServer() == null || def != getServer().getInfo())) { -+ sendMessage(bungee.getTranslation("fallback_lobby")); -+ connect(def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout()); // Waterfall -+ } else if (dimensionChange) { -+ disconnect(bungee.getTranslation("fallback_kick", future.cause().getClass().getName())); -+ } else { -+ sendMessage(bungee.getTranslation("fallback_kick", future.cause().getClass().getName())); - } - } - } - }; -- Bootstrap b = new Bootstrap() -- .channel( PipelineUtils.getChannel( target.getAddress() ) ) -- .group( ch.getHandle().eventLoop() ) -- .handler( initializer ) -- .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) -- .remoteAddress( target.getAddress() ); -- // Windows is bugged, multi homed users will just have to live with random connecting IPs -- if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) -- { -- b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); -+ Bootstrap b = new Bootstrap().channel(PipelineUtils.getChannel(target.getAddress())) -+ .group(ch.getHandle().eventLoop()).handler(initializer) -+ .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout()) -+ .remoteAddress(target.getAddress()); -+ // Windows is bugged, multi homed users will just have to live with random -+ // connecting IPs -+ // FlameCord - Use listenerInfo -+ final ListenerInfo listenerInfo = getPendingConnection().getListener(); -+ -+ if (listenerInfo.isSetLocalAddress() && !PlatformDependent.isWindows() -+ && listenerInfo.getSocketAddress() instanceof InetSocketAddress) { -+ b.localAddress(listenerInfo.getHost().getHostString(), 0); - } -- b.connect().addListener( listener ); -+ b.connect().addListener(listener); - } - - @Override -- public void disconnect(String reason) -- { -- disconnect0( TextComponent.fromLegacyText( reason ) ); -+ public void disconnect(String reason) { -+ disconnect0(TextComponent.fromLegacyText(reason)); - } - - @Override -- public void disconnect(BaseComponent... reason) -- { -- disconnect0( reason ); -+ public void disconnect(BaseComponent... reason) { -+ disconnect0(reason); - } - - @Override -- public void disconnect(BaseComponent reason) -- { -- disconnect0( reason ); -+ public void disconnect(BaseComponent reason) { -+ disconnect0(reason); - } - -- public void disconnect0(final BaseComponent... reason) -- { -- if ( !ch.isClosing() ) -- { -- bungee.getLogger().log( Level.INFO, "[{0}] disconnected with: {1}", new Object[] -- { -- getName(), BaseComponent.toLegacyText( reason ) -- } ); -+ public void disconnect0(final BaseComponent... reason) { -+ if (!ch.isClosing()) { -+ bungee.getLogger().log(Level.INFO, "[{0}] disconnected with: {1}", -+ new Object[] { getName(), BaseComponent.toLegacyText(reason) }); - -- ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); -+ ch.close(new Kick(ComponentSerializer.toString(reason))); - -- if ( server != null ) -- { -- server.setObsolete( true ); -- server.disconnect( "Quitting" ); -+ if (server != null) { -+ server.setObsolete(true); -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - } - } - } - - @Override -- public void chat(String message) -- { -- Preconditions.checkState( server != null, "Not connected to server" ); -- server.getCh().write( new Chat( message ) ); -+ public void chat(String message) { -+ Preconditions.checkState(server != null, "Not connected to server"); -+ server.getCh().write(new Chat(message)); - } - - @Override -- public void sendMessage(String message) -- { -- sendMessage( TextComponent.fromLegacyText( message ) ); -+ public void sendMessage(String message) { -+ sendMessage(TextComponent.fromLegacyText(message)); - } - - @Override -- public void sendMessages(String... messages) -- { -- for ( String message : messages ) -- { -- sendMessage( message ); -+ public void sendMessages(String... messages) { -+ for (String message : messages) { -+ sendMessage(message); - } - } - - @Override -- public void sendMessage(BaseComponent... message) -- { -- sendMessage( ChatMessageType.SYSTEM, message ); -+ public void sendMessage(BaseComponent... message) { -+ sendMessage(ChatMessageType.SYSTEM, message); - } - - @Override -- public void sendMessage(BaseComponent message) -- { -- sendMessage( ChatMessageType.SYSTEM, message ); -+ public void sendMessage(BaseComponent message) { -+ sendMessage(ChatMessageType.SYSTEM, message); - } - -- private void sendMessage(ChatMessageType position, String message) -- { -- unsafe().sendPacket( new Chat( message, (byte) position.ordinal() ) ); -+ private void sendMessage(ChatMessageType position, String message) { -+ unsafe().sendPacket(new Chat(message, (byte) position.ordinal())); - } - - @Override -- public void sendMessage(ChatMessageType position, BaseComponent... message) -- { -+ public void sendMessage(ChatMessageType position, BaseComponent... message) { - // transform score components -- message = ChatComponentTransformer.getInstance().transform( this, true, message ); -+ message = ChatComponentTransformer.getInstance().transform(this, true, message); - -- // Action bar doesn't display the new JSON formattings, legacy works - send it using this for now -- if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // Travertine -+ // Action bar doesn't display the new JSON formattings, legacy works - send it -+ // using this for now -+ if (position == ChatMessageType.ACTION_BAR -+ && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8) // Travertine - { -- // Versions older than 1.11 cannot send the Action bar with the new JSON formattings -- // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -- if ( getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_10 ) -- { -- sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); -- } else -- { -+ // Versions older than 1.11 cannot send the Action bar with the new JSON -+ // formattings -+ // Fix by converting to a legacy message, see -+ // https://bugs.mojang.com/browse/MC-119145 -+ if (getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_10) { -+ sendMessage(position, -+ ComponentSerializer.toString(new TextComponent(BaseComponent.toLegacyText(message)))); -+ } else { - net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title(); -- title.setAction( net.md_5.bungee.protocol.packet.Title.Action.ACTIONBAR ); -- title.setText( ComponentSerializer.toString( message ) ); -- unsafe.sendPacket( title ); -+ title.setAction(net.md_5.bungee.protocol.packet.Title.Action.ACTIONBAR); -+ title.setText(ComponentSerializer.toString(message)); -+ unsafe.sendPacket(title); - } -- } else -- { -- sendMessage( position, ComponentSerializer.toString( message ) ); -+ } else { -+ sendMessage(position, ComponentSerializer.toString(message)); - } - } - - @Override -- public void sendMessage(ChatMessageType position, BaseComponent message) -- { -- message = ChatComponentTransformer.getInstance().transform( this, true, message )[0]; -+ public void sendMessage(ChatMessageType position, BaseComponent message) { -+ message = ChatComponentTransformer.getInstance().transform(this, true, message)[0]; - -- // Action bar doesn't display the new JSON formattings, legacy works - send it using this for now -- if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // Travertine -+ // Action bar doesn't display the new JSON formattings, legacy works - send it -+ // using this for now -+ if (position == ChatMessageType.ACTION_BAR -+ && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8) // Travertine - { -- sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); -- } else -- { -- sendMessage( position, ComponentSerializer.toString( message ) ); -+ sendMessage(position, ComponentSerializer.toString(new TextComponent(BaseComponent.toLegacyText(message)))); -+ } else { -+ sendMessage(position, ComponentSerializer.toString(message)); - } - } - - @Override -- public void sendData(String channel, byte[] data) -- { -- unsafe().sendPacket( new PluginMessage( channel, data, forgeClientHandler.isForgeUser() ) ); -+ public void sendData(String channel, byte[] data) { -+ unsafe().sendPacket(new PluginMessage(channel, data, forgeClientHandler.isForgeUser())); - } - - @Override -- public InetSocketAddress getAddress() -- { -+ public InetSocketAddress getAddress() { - return (InetSocketAddress) getSocketAddress(); - } - - @Override -- public SocketAddress getSocketAddress() -- { -+ public SocketAddress getSocketAddress() { - return ch.getRemoteAddress(); - } - - @Override -- public Collection getGroups() -- { -- return Collections.unmodifiableCollection( groups ); -+ public Collection getGroups() { -+ return Collections.unmodifiableCollection(groups); - } - - @Override -- public void addGroups(String... groups) -- { -- for ( String group : groups ) -- { -- this.groups.add( group ); -- for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) -- { -- setPermission( permission, true ); -+ public void addGroups(String... groups) { -+ for (String group : groups) { -+ this.groups.add(group); -+ for (String permission : bungee.getConfigurationAdapter().getPermissions(group)) { -+ setPermission(permission, true); - } - } - } - - @Override -- public void removeGroups(String... groups) -- { -- for ( String group : groups ) -- { -- this.groups.remove( group ); -- for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) -- { -- setPermission( permission, false ); -+ public void removeGroups(String... groups) { -+ for (String group : groups) { -+ this.groups.remove(group); -+ for (String permission : bungee.getConfigurationAdapter().getPermissions(group)) { -+ setPermission(permission, false); - } - } - } - - @Override -- public boolean hasPermission(String permission) -- { -- return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission(); -+ public boolean hasPermission(String permission) { -+ return bungee.getPluginManager() -+ .callEvent(new PermissionCheckEvent(this, permission, permissions.contains(permission))) -+ .hasPermission(); - } - - @Override -- public void setPermission(String permission, boolean value) -- { -- if ( value ) -- { -- permissions.add( permission ); -- } else -- { -- permissions.remove( permission ); -+ public void setPermission(String permission, boolean value) { -+ if (value) { -+ permissions.add(permission); -+ } else { -+ permissions.remove(permission); - } - } - - @Override -- public Collection getPermissions() -- { -- return Collections.unmodifiableCollection( permissions ); -+ public Collection getPermissions() { -+ return Collections.unmodifiableCollection(permissions); - } - - @Override -- public String toString() -- { -+ public String toString() { - return name; - } - - @Override -- public Unsafe unsafe() -- { -+ public Unsafe unsafe() { - return unsafe; - } - - @Override -- public String getUUID() -- { -+ public String getUUID() { - return getPendingConnection().getUUID(); - } - - @Override -- public UUID getUniqueId() -- { -+ public UUID getUniqueId() { - return getPendingConnection().getUniqueId(); - } - -- public void setSettings(ClientSettings settings) -- { -+ public void setSettings(ClientSettings settings) { - this.settings = settings; - this.locale = null; - } - - @Override -- public Locale getLocale() -- { -- return ( locale == null && settings != null ) ? locale = Locale.forLanguageTag( settings.getLocale().replace( '_', '-' ) ) : locale; -+ public Locale getLocale() { -+ return (locale == null && settings != null) -+ ? locale = Locale.forLanguageTag(settings.getLocale().replace('_', '-')) -+ : locale; - } - - @Override -- public byte getViewDistance() -- { -- return ( settings != null ) ? settings.getViewDistance() : 10; -+ public byte getViewDistance() { -+ return (settings != null) ? settings.getViewDistance() : 10; - } - - @Override -- public ProxiedPlayer.ChatMode getChatMode() -- { -- if ( settings == null ) -- { -+ public ProxiedPlayer.ChatMode getChatMode() { -+ if (settings == null) { - return ProxiedPlayer.ChatMode.SHOWN; - } - -- switch ( settings.getChatFlags() ) -- { -+ switch (settings.getChatFlags()) { - default: - case 0: - return ProxiedPlayer.ChatMode.SHOWN; -@@ -648,106 +590,93 @@ public final class UserConnection implements ProxiedPlayer - } - - @Override -- public boolean hasChatColors() -- { -+ public boolean hasChatColors() { - return settings == null || settings.isChatColours(); - } - - @Override -- public SkinConfiguration getSkinParts() -- { -- return ( settings != null ) ? new PlayerSkinConfiguration( settings.getSkinParts() ) : PlayerSkinConfiguration.SKIN_SHOW_ALL; -+ public SkinConfiguration getSkinParts() { -+ return (settings != null) ? new PlayerSkinConfiguration(settings.getSkinParts()) -+ : PlayerSkinConfiguration.SKIN_SHOW_ALL; - } - - @Override -- public ProxiedPlayer.MainHand getMainHand() -- { -- return ( settings == null || settings.getMainHand() == 1 ) ? ProxiedPlayer.MainHand.RIGHT : ProxiedPlayer.MainHand.LEFT; -+ public ProxiedPlayer.MainHand getMainHand() { -+ return (settings == null || settings.getMainHand() == 1) ? ProxiedPlayer.MainHand.RIGHT -+ : ProxiedPlayer.MainHand.LEFT; - } - - @Override -- public boolean isForgeUser() -- { -+ public boolean isForgeUser() { - return forgeClientHandler.isForgeUser(); - } - - @Override -- public Map getModList() -- { -- if ( forgeClientHandler.getClientModList() == null ) -- { -+ public Map getModList() { -+ if (forgeClientHandler.getClientModList() == null) { - // Return an empty map, rather than a null, if the client hasn't got any mods, - // or is yet to complete a handshake. - return ImmutableMap.of(); - } - -- return ImmutableMap.copyOf( forgeClientHandler.getClientModList() ); -+ return ImmutableMap.copyOf(forgeClientHandler.getClientModList()); - } - - @Override -- public void setTabHeader(BaseComponent header, BaseComponent footer) -- { -- if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine -- header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; -- footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -+ public void setTabHeader(BaseComponent header, BaseComponent footer) { -+ if (ProtocolConstants.isBeforeOrEq(pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6)) -+ return; // Travertine -+ header = ChatComponentTransformer.getInstance().transform(this, true, header)[0]; -+ footer = ChatComponentTransformer.getInstance().transform(this, true, footer)[0]; - -- unsafe().sendPacket( new PlayerListHeaderFooter( -- ComponentSerializer.toString( header ), -- ComponentSerializer.toString( footer ) -- ) ); -+ unsafe().sendPacket( -+ new PlayerListHeaderFooter(ComponentSerializer.toString(header), ComponentSerializer.toString(footer))); - } - - @Override -- public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) -- { -- if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine -- header = ChatComponentTransformer.getInstance().transform( this, true, header ); -- footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -+ public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { -+ if (ProtocolConstants.isBeforeOrEq(pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6)) -+ return; // Travertine -+ header = ChatComponentTransformer.getInstance().transform(this, true, header); -+ footer = ChatComponentTransformer.getInstance().transform(this, true, footer); - -- unsafe().sendPacket( new PlayerListHeaderFooter( -- ComponentSerializer.toString( header ), -- ComponentSerializer.toString( footer ) -- ) ); -+ unsafe().sendPacket( -+ new PlayerListHeaderFooter(ComponentSerializer.toString(header), ComponentSerializer.toString(footer))); - } - - @Override -- public void resetTabHeader() -- { -- // Mojang did not add a way to remove the header / footer completely, we can only set it to empty -- setTabHeader( (BaseComponent) null, null ); -+ public void resetTabHeader() { -+ // Mojang did not add a way to remove the header / footer completely, we can -+ // only set it to empty -+ setTabHeader((BaseComponent) null, null); - } - - @Override -- public void sendTitle(Title title) -- { -- title.send( this ); -+ public void sendTitle(Title title) { -+ title.send(this); - } - -- public String getExtraDataInHandshake() -- { -+ public String getExtraDataInHandshake() { - return this.getPendingConnection().getExtraDataInHandshake(); - } - -- public void setCompressionThreshold(int compressionThreshold) -- { -- if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine -- if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) -- { -+ public void setCompressionThreshold(int compressionThreshold) { -+ if (ProtocolConstants.isBeforeOrEq(pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6)) -+ return; // Travertine -+ if (!ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0) { - this.compressionThreshold = compressionThreshold; -- unsafe.sendPacket( new SetCompression( compressionThreshold ) ); -- ch.setCompressionThreshold( compressionThreshold ); -+ unsafe.sendPacket(new SetCompression(compressionThreshold)); -+ ch.setCompressionThreshold(compressionThreshold); - } - } - - @Override -- public boolean isConnected() -- { -+ public boolean isConnected() { - return !ch.isClosed(); - } - - @Override -- public Scoreboard getScoreboard() -- { -+ public Scoreboard getScoreboard() { - return serverSentScoreboard; - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 4e2c6129..9a8a70dd 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -@@ -3,19 +3,22 @@ package net.md_5.bungee.command; - import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.CommandSender; - import net.md_5.bungee.api.ProxyServer; -+import net.md_5.bungee.api.chat.TextComponent; - import net.md_5.bungee.api.plugin.Command; - --public class CommandBungee extends Command --{ -+public class CommandBungee extends Command { - -- public CommandBungee() -- { -- super( "bungee" ); -+ public CommandBungee() { -+ super("bungee"); - } - - @Override -- public void execute(CommandSender sender, String[] args) -- { -- sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ public void execute(CommandSender sender, String[] args) { -+ final ProxyServer proxyServer = ProxyServer.getInstance(); -+ final String name = proxyServer.getName(), version = proxyServer.getVersion(); -+ -+ sender.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', "&cRunning &f" -+ + name + "&c version &e" + version -+ + "&c by 2LS &b(@Sammwy_ and @LinsaFTW)\n&9Forked from Travertine by PaperMC and contributors."))); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index d4fad294..5454efad 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -@@ -1,7 +1,5 @@ - package net.md_5.bungee.conf; - --import com.google.common.base.Charsets; --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import java.io.File; - import java.io.FileInputStream; - import java.io.FileOutputStream; -@@ -21,7 +19,16 @@ import java.util.List; - import java.util.Locale; - import java.util.Map; - import java.util.logging.Level; -+ -+import com.google.common.base.Charsets; -+ -+import org.yaml.snakeyaml.DumperOptions; -+import org.yaml.snakeyaml.Yaml; -+import org.yaml.snakeyaml.error.YAMLException; -+ -+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import lombok.RequiredArgsConstructor; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.Util; - import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.ProxyServer; -@@ -29,22 +36,18 @@ import net.md_5.bungee.api.config.ConfigurationAdapter; - import net.md_5.bungee.api.config.ListenerInfo; - import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.util.CaseInsensitiveMap; --import org.yaml.snakeyaml.DumperOptions; --import org.yaml.snakeyaml.Yaml; --import org.yaml.snakeyaml.error.YAMLException; - --public class YamlConfig implements ConfigurationAdapter --{ -+public class YamlConfig implements ConfigurationAdapter { - - /** - * The default tab list options available for picking. - */ - @RequiredArgsConstructor -- private enum DefaultTabList -- { -+ private enum DefaultTabList { - - GLOBAL(), GLOBAL_PING(), SERVER(); - } -+ - private final Yaml yaml; - private Map config; - private final File file; -@@ -53,185 +56,155 @@ public class YamlConfig implements ConfigurationAdapter - this(new File("config.yml")); - } - -- public YamlConfig(File file) -- { -+ public YamlConfig(File file) { - this.file = file; - DumperOptions options = new DumperOptions(); -- options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK ); -- yaml = new Yaml( options ); -+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); -+ yaml = new Yaml(options); - } - - @Override -- public void load() -- { -+ public void load() { - load(true); - } - -- public void load(boolean doPermissions) -- { -- try -- { -+ public void load(boolean doPermissions) { -+ try { - file.createNewFile(); - -- try ( InputStream is = new FileInputStream( file ) ) -- { -- try -- { -- config = (Map) yaml.load( is ); -- } catch ( YAMLException ex ) -- { -- throw new RuntimeException( "Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.", ex ); -+ try (InputStream is = new FileInputStream(file)) { -+ try { -+ config = (Map) yaml.load(is); -+ } catch (YAMLException ex) { -+ throw new RuntimeException( -+ "Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.", -+ ex); - } - } - -- if ( config == null ) -- { -+ if (config == null) { - config = new CaseInsensitiveMap<>(); -- } else -- { -- config = new CaseInsensitiveMap<>( config ); -+ } else { -+ config = new CaseInsensitiveMap<>(config); - } -- } catch ( IOException ex ) -- { -- throw new RuntimeException( "Could not load configuration!", ex ); -+ } catch (IOException ex) { -+ throw new RuntimeException("Could not load configuration!", ex); - } - -- if(!doPermissions) return; // Waterfall -- Map permissions = get( "permissions", null ); -- if ( permissions == null ) -- { -- set( "permissions.default", Arrays.asList( new String[] -- { -- "bungeecord.command.server", "bungeecord.command.list" -- } ) ); -- set( "permissions.admin", Arrays.asList( new String[] -- { -- "bungeecord.command.alert", "bungeecord.command.end", "bungeecord.command.ip", "bungeecord.command.reload" -- } ) ); -+ if (!doPermissions) -+ return; // Waterfall -+ Map permissions = get("permissions", null); -+ if (permissions == null) { -+ set("permissions.default", -+ Arrays.asList(new String[] { "bungeecord.command.server", "bungeecord.command.list" })); -+ set("permissions.admin", Arrays.asList(new String[] { "bungeecord.command.alert", "bungeecord.command.end", -+ "bungeecord.command.ip", "bungeecord.command.reload" })); - } - -- Map groups = get( "groups", null ); -- if ( groups == null ) -- { -- set( "groups.md_5", Collections.singletonList( "admin" ) ); -+ Map groups = get("groups", null); -+ if (groups == null) { -+ set("groups.md_5", Collections.singletonList("admin")); - } - } - -- private T get(String path, T def) -- { -- return get( path, def, config ); -+ private T get(String path, T def) { -+ return get(path, def, config); - } - - @SuppressWarnings("unchecked") -- private T get(String path, T def, Map submap) -- { -- int index = path.indexOf( '.' ); -- if ( index == -1 ) -- { -- Object val = submap.get( path ); -- if ( val == null && def != null ) -- { -+ private T get(String path, T def, Map submap) { -+ int index = path.indexOf('.'); -+ if (index == -1) { -+ Object val = submap.get(path); -+ if (val == null && def != null) { - val = def; -- submap.put( path, def ); -+ submap.put(path, def); - save(); - } - return (T) val; -- } else -- { -- String first = path.substring( 0, index ); -- String second = path.substring( index + 1, path.length() ); -- Map sub = (Map) submap.get( first ); -- if ( sub == null ) -- { -+ } else { -+ String first = path.substring(0, index); -+ String second = path.substring(index + 1, path.length()); -+ Map sub = (Map) submap.get(first); -+ if (sub == null) { - sub = new LinkedHashMap(); -- submap.put( first, sub ); -+ submap.put(first, sub); - } -- return get( second, def, sub ); -+ return get(second, def, sub); - } - } - -- private void set(String path, Object val) -- { -- set( path, val, config ); -+ private void set(String path, Object val) { -+ set(path, val, config); - } - - @SuppressWarnings("unchecked") -- private void set(String path, Object val, Map submap) -- { -- int index = path.indexOf( '.' ); -- if ( index == -1 ) -- { -- if ( val == null ) -- { -- submap.remove( path ); -- } else -- { -- submap.put( path, val ); -+ private void set(String path, Object val, Map submap) { -+ int index = path.indexOf('.'); -+ if (index == -1) { -+ if (val == null) { -+ submap.remove(path); -+ } else { -+ submap.put(path, val); - } - save(); -- } else -- { -- String first = path.substring( 0, index ); -- String second = path.substring( index + 1, path.length() ); -- Map sub = (Map) submap.get( first ); -- if ( sub == null ) -- { -+ } else { -+ String first = path.substring(0, index); -+ String second = path.substring(index + 1, path.length()); -+ Map sub = (Map) submap.get(first); -+ if (sub == null) { - sub = new LinkedHashMap(); -- submap.put( first, sub ); -+ submap.put(first, sub); - } -- set( second, val, sub ); -+ set(second, val, sub); - } - } - -- private void save() -- { -- try -- { -- try ( Writer wr = new OutputStreamWriter( new FileOutputStream( file ), Charsets.UTF_8 ) ) -- { -- yaml.dump( config, wr ); -+ private void save() { -+ try { -+ try (Writer wr = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)) { -+ yaml.dump(config, wr); - } -- } catch ( IOException ex ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not save config", ex ); -+ } catch (IOException ex) { -+ ProxyServer.getInstance().getLogger().log(Level.WARNING, "Could not save config", ex); - } - } - - @Override -- public int getInt(String path, int def) -- { -- return get( path, def ); -+ public int getInt(String path, int def) { -+ return get(path, def); - } - - @Override -- public String getString(String path, String def) -- { -- return get( path, def ); -+ public String getString(String path, String def) { -+ return get(path, def); - } - - @Override -- public boolean getBoolean(String path, boolean def) -- { -- return get( path, def ); -+ public boolean getBoolean(String path, boolean def) { -+ return get(path, def); - } - - @Override - @SuppressWarnings("unchecked") -- public Map getServers() -- { -- Map> base = get( "servers", (Map) Collections.singletonMap( "lobby", new HashMap<>() ) ); -+ public Map getServers() { -+ Map> base = get("servers", -+ (Map) Collections.singletonMap("lobby", new HashMap<>())); - Map ret = new HashMap<>(); - -- for ( Map.Entry> entry : base.entrySet() ) -- { -+ for (Map.Entry> entry : base.entrySet()) { - Map val = entry.getValue(); - String name = entry.getKey(); -- String addr = get( "address", "localhost:25565", val ); -- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); -- boolean restricted = get( "restricted", false, val ); -- SocketAddress address = Util.getAddr( addr ); -- ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- ret.put( name, info ); -+ String addr = get("address", "localhost:25565", val); -+ // FlameCord - Use getName() instead of Travertine -+ // String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", -+ // "&1Just another Travertine - Forced Host", val ) ); -+ String motd = ChatColor.translateAlternateColorCodes('&', -+ get("motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val)); -+ boolean restricted = get("restricted", false, val); -+ SocketAddress address = Util.getAddr(addr); -+ ServerInfo info = ProxyServer.getInstance().constructServerInfo(name, address, motd, restricted); -+ ret.put(name, info); - } - - return ret; -@@ -240,67 +213,62 @@ public class YamlConfig implements ConfigurationAdapter - @Override - @SuppressWarnings("unchecked") - @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") -- public Collection getListeners() -- { -- Collection> base = get( "listeners", (Collection) Arrays.asList( new Map[] -- { -- new HashMap() -- } ) ); -+ public Collection getListeners() { -+ Collection> base = get("listeners", -+ (Collection) Arrays.asList(new Map[] { new HashMap() })); - Map forcedDef = new HashMap<>(); -- forcedDef.put( "pvp.md-5.net", "pvp" ); -+ forcedDef.put("pvp.md-5.net", "pvp"); - - Collection ret = new HashSet<>(); - -- for ( Map val : base ) -- { -- String motd = get( "motd", "&1Another Bungee server", val ); -- motd = ChatColor.translateAlternateColorCodes( '&', motd ); -- -- int maxPlayers = get( "max_players", 1, val ); -- boolean forceDefault = get( "force_default_server", false, val ); -- String host = get( "host", "0.0.0.0:25577", val ); -- int tabListSize = get( "tab_size", 60, val ); -- SocketAddress address = Util.getAddr( host ); -- Map forced = new CaseInsensitiveMap<>( get( "forced_hosts", forcedDef, val ) ); -- String tabListName = get( "tab_list", "GLOBAL_PING", val ); -- DefaultTabList value = DefaultTabList.valueOf( tabListName.toUpperCase( Locale.ROOT ) ); -- if ( value == null ) -- { -+ for (Map val : base) { -+ // FlameCord - Use getName() instead of Bungee -+ // String motd = get( "motd", "&1Another Bungee server", val ); -+ String motd = get("motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val); -+ motd = ChatColor.translateAlternateColorCodes('&', motd); -+ -+ int maxPlayers = get("max_players", 1, val); -+ boolean forceDefault = get("force_default_server", false, val); -+ String host = get("host", "0.0.0.0:25577", val); -+ int tabListSize = get("tab_size", 60, val); -+ SocketAddress address = Util.getAddr(host); -+ Map forced = new CaseInsensitiveMap<>(get("forced_hosts", forcedDef, val)); -+ String tabListName = get("tab_list", "GLOBAL_PING", val); -+ DefaultTabList value = DefaultTabList.valueOf(tabListName.toUpperCase(Locale.ROOT)); -+ if (value == null) { - value = DefaultTabList.GLOBAL_PING; - } -- boolean setLocalAddress = get( "bind_local_address", true, val ); -- boolean pingPassthrough = get( "ping_passthrough", false, val ); -+ boolean setLocalAddress = get("bind_local_address", true, val); -+ boolean pingPassthrough = get("ping_passthrough", false, val); - -- boolean query = get( "query_enabled", false, val ); -- int queryPort = get( "query_port", 25577, val ); -+ boolean query = get("query_enabled", false, val); -+ int queryPort = get("query_port", 25577, val); - -- boolean proxyProtocol = get( "proxy_protocol", false, val ); -- List serverPriority = new ArrayList<>( get( "priorities", Collections.EMPTY_LIST, val ) ); -+ boolean proxyProtocol = get("proxy_protocol", false, val); -+ List serverPriority = new ArrayList<>(get("priorities", Collections.EMPTY_LIST, val)); - - // Default server list migration - // TODO: Remove from submap -- String defaultServer = get( "default_server", null, val ); -- String fallbackServer = get( "fallback_server", null, val ); -- if ( defaultServer != null ) -- { -- serverPriority.add( defaultServer ); -- set( "default_server", null, val ); -+ String defaultServer = get("default_server", null, val); -+ String fallbackServer = get("fallback_server", null, val); -+ if (defaultServer != null) { -+ serverPriority.add(defaultServer); -+ set("default_server", null, val); - } -- if ( fallbackServer != null ) -- { -- serverPriority.add( fallbackServer ); -- set( "fallback_server", null, val ); -+ if (fallbackServer != null) { -+ serverPriority.add(fallbackServer); -+ set("fallback_server", null, val); - } - - // Add defaults if required -- if ( serverPriority.isEmpty() ) -- { -- serverPriority.add( "lobby" ); -+ if (serverPriority.isEmpty()) { -+ serverPriority.add("lobby"); - } -- set( "priorities", serverPriority, val ); -+ set("priorities", serverPriority, val); - -- ListenerInfo info = new ListenerInfo( address, motd, maxPlayers, tabListSize, serverPriority, forceDefault, forced, value.toString(), setLocalAddress, pingPassthrough, queryPort, query, proxyProtocol ); -- ret.add( info ); -+ ListenerInfo info = new ListenerInfo(address, motd, maxPlayers, tabListSize, serverPriority, forceDefault, -+ forced, value.toString(), setLocalAddress, pingPassthrough, queryPort, query, proxyProtocol); -+ ret.add(info); - } - - return ret; -@@ -308,25 +276,22 @@ public class YamlConfig implements ConfigurationAdapter - - @Override - @SuppressWarnings("unchecked") -- public Collection getGroups(String player) -- { -- Collection groups = get( "groups." + player, null ); -- Collection ret = ( groups == null ) ? new HashSet() : new HashSet<>( groups ); -- ret.add( "default" ); -+ public Collection getGroups(String player) { -+ Collection groups = get("groups." + player, null); -+ Collection ret = (groups == null) ? new HashSet() : new HashSet<>(groups); -+ ret.add("default"); - return ret; - } - - @Override -- public Collection getList(String path, Collection def) -- { -- return get( path, def ); -+ public Collection getList(String path, Collection def) { -+ return get(path, def); - } - - @Override - @SuppressWarnings("unchecked") -- public Collection getPermissions(String group) -- { -- Collection permissions = get( "permissions." + group, null ); -- return ( permissions == null ) ? Collections.EMPTY_SET : permissions; -+ public Collection getPermissions(String group) { -+ Collection permissions = get("permissions." + group, null); -+ return (permissions == null) ? Collections.EMPTY_SET : permissions; - } - } -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 -index 326de178..73a92c59 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -71,198 +71,179 @@ import net.md_5.bungee.protocol.packet.TabCompleteResponse; - import net.md_5.bungee.tab.TabList; - - @RequiredArgsConstructor --public class DownstreamBridge extends PacketHandler --{ -+public class DownstreamBridge extends PacketHandler { - - private final ProxyServer bungee; - private final UserConnection con; - private final ServerConnection server; - - @Override -- public void exception(Throwable t) throws Exception -- { -- if ( server.isObsolete() ) -- { -+ public void exception(Throwable t) throws Exception { -+ if (server.isObsolete()) { - // do not perform any actions if the user has already moved - return; - } - - // Waterfall start -- ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); -- ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), TextComponent.fromLegacyText( bungee.getTranslation( "server_went_down" ) ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.EXCEPTION ) ); -- if ( event.isCancelled() && event.getCancelServer() != null ) -- { -- server.setObsolete( true ); -- con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT ); -- } -- else -- { -- con.disconnect0( event.getKickReasonComponent() ); -+ ServerInfo def = con.updateAndGetNextServer(server.getInfo()); -+ ServerKickEvent event = bungee.getPluginManager() -+ .callEvent(new ServerKickEvent(con, server.getInfo(), -+ TextComponent.fromLegacyText(bungee.getTranslation("server_went_down")), def, -+ ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.EXCEPTION)); -+ if (event.isCancelled() && event.getCancelServer() != null) { -+ server.setObsolete(true); -+ con.connectNow(event.getCancelServer(), ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT); -+ } else { -+ con.disconnect0(event.getKickReasonComponent()); - } - // Waterfall end - } - - @Override -- public void disconnected(ChannelWrapper channel) throws Exception -- { -+ public void disconnected(ChannelWrapper channel) throws Exception { - // We lost connection to the server -- server.getInfo().removePlayer( con ); -- if ( bungee.getReconnectHandler() != null ) -- { -- bungee.getReconnectHandler().setServer( con ); -+ server.getInfo().removePlayer(con); -+ if (bungee.getReconnectHandler() != null) { -+ bungee.getReconnectHandler().setServer(con); - } - -- if ( !server.isObsolete() ) -- { -+ if (!server.isObsolete()) { - // Waterfall start -- ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); -- ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), TextComponent.fromLegacyText( bungee.getTranslation( "lost_connection" ) ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.LOST_CONNECTION ) ); -- if ( event.isCancelled() && event.getCancelServer() != null ) -- { -- server.setObsolete( true ); -- con.connectNow( event.getCancelServer() ); -- } -- else -- { -- con.disconnect0( event.getKickReasonComponent() ); -+ ServerInfo def = con.updateAndGetNextServer(server.getInfo()); -+ ServerKickEvent event = bungee.getPluginManager() -+ .callEvent(new ServerKickEvent(con, server.getInfo(), -+ TextComponent.fromLegacyText(bungee.getTranslation("lost_connection")), def, -+ ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.LOST_CONNECTION)); -+ if (event.isCancelled() && event.getCancelServer() != null) { -+ server.setObsolete(true); -+ con.connectNow(event.getCancelServer()); -+ } else { -+ con.disconnect0(event.getKickReasonComponent()); - } - // Waterfall end - } - -- ServerDisconnectEvent serverDisconnectEvent = new ServerDisconnectEvent( con, server.getInfo() ); -- bungee.getPluginManager().callEvent( serverDisconnectEvent ); -+ ServerDisconnectEvent serverDisconnectEvent = new ServerDisconnectEvent(con, server.getInfo()); -+ bungee.getPluginManager().callEvent(serverDisconnectEvent); - } - - @Override -- public boolean shouldHandle(PacketWrapper packet) throws Exception -- { -+ public boolean shouldHandle(PacketWrapper packet) throws Exception { - return !server.isObsolete(); - } - - @Override -- public void handle(PacketWrapper packet) throws Exception -- { -+ public void handle(PacketWrapper packet) throws Exception { - EntityMap rewrite = con.getEntityRewrite(); -- if ( rewrite != null ) -- { -- rewrite.rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId(), con.getPendingConnection().getVersion() ); -+ if (rewrite != null) { -+ rewrite.rewriteClientbound(packet.buf, con.getServerEntityId(), con.getClientEntityId(), -+ con.getPendingConnection().getVersion()); - } -- con.sendPacket( packet ); -+ con.sendPacket(packet); - } - - @Override -- public void handle(KeepAlive alive) throws Exception -- { -+ public void handle(KeepAlive alive) throws Exception { - int timeout = bungee.getConfig().getTimeout(); -- if ( timeout <= 0 || server.getKeepAlives().size() < timeout / 50 ) // Some people disable timeout, otherwise allow a theoretical maximum of 1 keepalive per tick -+ if (timeout <= 0 || server.getKeepAlives().size() < timeout / 50) // Some people disable timeout, otherwise -+ // allow a theoretical maximum of 1 keepalive -+ // per tick - { -- server.getKeepAlives().add( new KeepAliveData( alive.getRandomId(), System.currentTimeMillis() ) ); -+ server.getKeepAlives().add(new KeepAliveData(alive.getRandomId(), System.currentTimeMillis())); - } - } - - @Override -- public void handle(PlayerListItem playerList) throws Exception -- { -- con.getTabListHandler().onUpdate( TabList.rewrite( playerList ) ); -+ public void handle(PlayerListItem playerList) throws Exception { -+ con.getTabListHandler().onUpdate(TabList.rewrite(playerList)); - throw CancelSendSignal.INSTANCE; // Always throw because of profile rewriting - } - - @Override -- public void handle(ScoreboardObjective objective) throws Exception -- { -+ public void handle(ScoreboardObjective objective) throws Exception { - Scoreboard serverScoreboard = con.getServerSentScoreboard(); -- switch ( objective.getAction() ) -- { -+ switch (objective.getAction()) { - case 0: -- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // Travertine - 1.7 protocol support -+ serverScoreboard.addObjective(new Objective(objective.getName(), objective.getValue(), -+ objective.getType() != null ? objective.getType().toString() : null)); // Travertine - 1.7 -+ // protocol support - break; - case 1: -- serverScoreboard.removeObjective( objective.getName() ); -+ serverScoreboard.removeObjective(objective.getName()); - break; - case 2: -- Objective oldObjective = serverScoreboard.getObjective( objective.getName() ); -- if ( oldObjective != null ) -- { -- oldObjective.setValue( objective.getValue() ); -- oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // Travertine - 1.7 protocol support -+ Objective oldObjective = serverScoreboard.getObjective(objective.getName()); -+ if (oldObjective != null) { -+ oldObjective.setValue(objective.getValue()); -+ oldObjective.setType(objective.getType() != null ? objective.getType().toString() : null); // Travertine -+ // - 1.7 -+ // protocol -+ // support - } - break; - default: -- throw new IllegalArgumentException( "Unknown objective action: " + objective.getAction() ); -+ throw new IllegalArgumentException("Unknown objective action: " + objective.getAction()); - } - } - - @Override -- public void handle(ScoreboardScore score) throws Exception -- { -+ public void handle(ScoreboardScore score) throws Exception { - Scoreboard serverScoreboard = con.getServerSentScoreboard(); -- switch ( score.getAction() ) -- { -+ switch (score.getAction()) { - case 0: -- Score s = new Score( score.getItemName(), score.getScoreName(), score.getValue() ); -- serverScoreboard.removeScore( score.getItemName() ); -- serverScoreboard.addScore( s ); -+ Score s = new Score(score.getItemName(), score.getScoreName(), score.getValue()); -+ serverScoreboard.removeScore(score.getItemName()); -+ serverScoreboard.addScore(s); - break; - case 1: -- serverScoreboard.removeScore( score.getItemName() ); -+ serverScoreboard.removeScore(score.getItemName()); - break; - default: -- throw new IllegalArgumentException( "Unknown scoreboard action: " + score.getAction() ); -+ throw new IllegalArgumentException("Unknown scoreboard action: " + score.getAction()); - } - } - - @Override -- public void handle(ScoreboardDisplay displayScoreboard) throws Exception -- { -+ public void handle(ScoreboardDisplay displayScoreboard) throws Exception { - Scoreboard serverScoreboard = con.getServerSentScoreboard(); -- serverScoreboard.setName( displayScoreboard.getName() ); -- serverScoreboard.setPosition( Position.values()[displayScoreboard.getPosition()] ); -+ serverScoreboard.setName(displayScoreboard.getName()); -+ serverScoreboard.setPosition(Position.values()[displayScoreboard.getPosition()]); - } - - @Override -- public void handle(net.md_5.bungee.protocol.packet.Team team) throws Exception -- { -+ public void handle(net.md_5.bungee.protocol.packet.Team team) throws Exception { - Scoreboard serverScoreboard = con.getServerSentScoreboard(); - // Remove team and move on -- if ( team.getMode() == 1 ) -- { -- serverScoreboard.removeTeam( team.getName() ); -+ if (team.getMode() == 1) { -+ serverScoreboard.removeTeam(team.getName()); - return; - } - - // Create or get old team - Team t; -- if ( team.getMode() == 0 ) -- { -- t = new Team( team.getName() ); -- serverScoreboard.addTeam( t ); -- } else -- { -- t = serverScoreboard.getTeam( team.getName() ); -+ if (team.getMode() == 0) { -+ t = new Team(team.getName()); -+ serverScoreboard.addTeam(t); -+ } else { -+ t = serverScoreboard.getTeam(team.getName()); - } - -- if ( t != null ) -- { -- if ( team.getMode() == 0 || team.getMode() == 2 ) -- { -- t.setDisplayName( team.getDisplayName() ); -- t.setPrefix( team.getPrefix() ); -- t.setSuffix( team.getSuffix() ); -- t.setFriendlyFire( team.getFriendlyFire() ); -- t.setNameTagVisibility( team.getNameTagVisibility() ); -- t.setCollisionRule( team.getCollisionRule() ); -- t.setColor( team.getColor() ); -+ if (t != null) { -+ if (team.getMode() == 0 || team.getMode() == 2) { -+ t.setDisplayName(team.getDisplayName()); -+ t.setPrefix(team.getPrefix()); -+ t.setSuffix(team.getSuffix()); -+ t.setFriendlyFire(team.getFriendlyFire()); -+ t.setNameTagVisibility(team.getNameTagVisibility()); -+ t.setCollisionRule(team.getCollisionRule()); -+ t.setColor(team.getColor()); - } -- if ( team.getPlayers() != null ) -- { -- for ( String s : team.getPlayers() ) -- { -- if ( team.getMode() == 0 || team.getMode() == 3 ) -- { -- t.addPlayer( s ); -- } else if ( team.getMode() == 4 ) -- { -- t.removePlayer( s ); -+ if (team.getPlayers() != null) { -+ for (String s : team.getPlayers()) { -+ if (team.getMode() == 0 || team.getMode() == 3) { -+ t.addPlayer(s); -+ } else if (team.getMode() == 4) { -+ t.removePlayer(s); - } - } - } -@@ -270,149 +251,126 @@ public class DownstreamBridge extends PacketHandler - } - - @Override -- public void handle(PluginMessage pluginMessage) throws Exception -- { -- PluginMessageEvent event = new PluginMessageEvent( server, con, pluginMessage.getTag(), pluginMessage.getData().clone() ); -+ public void handle(PluginMessage pluginMessage) throws Exception { -+ PluginMessageEvent event = new PluginMessageEvent(server, con, pluginMessage.getTag(), -+ pluginMessage.getData().clone()); - -- if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) -- { -+ if (bungee.getPluginManager().callEvent(event).isCancelled()) { - throw CancelSendSignal.INSTANCE; - } - -- if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) -- { -+ if (pluginMessage.getTag() -+ .equals(con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" -+ : "MC|Brand")) { - // Travertine start -- if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -- { -- try -- { -+ if (ProtocolConstants.isAfterOrEq(con.getPendingConnection().getVersion(), -+ ProtocolConstants.MINECRAFT_1_8)) { -+ try { - ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); - String serverBrand = DefinedPacket.readString(brand); - brand.release(); - brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand); // Waterfall - pluginMessage.setData(brand); - brand.release(); -- } catch (Exception ProtocolHacksSuck) -- { -+ } catch (Exception ProtocolHacksSuck) { - return; - } -- } else -- { -- String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); -- pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // Travertine -+ } else { -+ String serverBrand = new String(pluginMessage.getData(), StandardCharsets.UTF_8); -+ pluginMessage.setData((bungee.getName() + " <- " + serverBrand).getBytes(StandardCharsets.UTF_8)); // Travertine - } - // Travertine end - // changes in the packet are ignored so we need to send it manually -- con.unsafe().sendPacket( pluginMessage ); -+ con.unsafe().sendPacket(pluginMessage); - throw CancelSendSignal.INSTANCE; - } - -- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) -- { -+ if (pluginMessage.getTag().equals("BungeeCord")) { - DataInput in = pluginMessage.getStream(); - ByteArrayDataOutput out = ByteStreams.newDataOutput(); - String subChannel = in.readUTF(); - -- if ( subChannel.equals( "ForwardToPlayer" ) ) -- { -- ProxiedPlayer target = bungee.getPlayer( in.readUTF() ); -- if ( target != null ) -- { -+ if (subChannel.equals("ForwardToPlayer")) { -+ ProxiedPlayer target = bungee.getPlayer(in.readUTF()); -+ if (target != null) { - // Read data from server - String channel = in.readUTF(); - short len = in.readShort(); -- byte[] data = new byte[ len ]; -- in.readFully( data ); -+ byte[] data = new byte[len]; -+ in.readFully(data); - - // Prepare new data to send -- out.writeUTF( channel ); -- out.writeShort( data.length ); -- out.write( data ); -+ out.writeUTF(channel); -+ out.writeShort(data.length); -+ out.write(data); - byte[] payload = out.toByteArray(); - -- target.getServer().sendData( "BungeeCord", payload ); -+ target.getServer().sendData("BungeeCord", payload); - } - - // Null out stream, important as we don't want to send to ourselves - out = null; - } -- if ( subChannel.equals( "Forward" ) ) -- { -+ if (subChannel.equals("Forward")) { - // Read data from server - String target = in.readUTF(); - String channel = in.readUTF(); - short len = in.readShort(); -- byte[] data = new byte[ len ]; -- in.readFully( data ); -+ byte[] data = new byte[len]; -+ in.readFully(data); - - // Prepare new data to send -- out.writeUTF( channel ); -- out.writeShort( data.length ); -- out.write( data ); -+ out.writeUTF(channel); -+ out.writeShort(data.length); -+ out.write(data); - byte[] payload = out.toByteArray(); - - // Null out stream, important as we don't want to send to ourselves - out = null; - -- if ( target.equals( "ALL" ) ) -- { -- for ( ServerInfo server : bungee.getServers().values() ) -- { -- if ( server != this.server.getInfo() ) -- { -- server.sendData( "BungeeCord", payload ); -+ if (target.equals("ALL")) { -+ for (ServerInfo server : bungee.getServers().values()) { -+ if (server != this.server.getInfo()) { -+ server.sendData("BungeeCord", payload); - } - } -- } else if ( target.equals( "ONLINE" ) ) -- { -- for ( ServerInfo server : bungee.getServers().values() ) -- { -- if ( server != this.server.getInfo() ) -- { -- server.sendData( "BungeeCord", payload, false ); -+ } else if (target.equals("ONLINE")) { -+ for (ServerInfo server : bungee.getServers().values()) { -+ if (server != this.server.getInfo()) { -+ server.sendData("BungeeCord", payload, false); - } - } -- } else -- { -- ServerInfo server = bungee.getServerInfo( target ); -- if ( server != null ) -- { -- server.sendData( "BungeeCord", payload ); -+ } else { -+ ServerInfo server = bungee.getServerInfo(target); -+ if (server != null) { -+ server.sendData("BungeeCord", payload); - } - } - } -- if ( subChannel.equals( "Connect" ) ) -- { -- ServerInfo server = bungee.getServerInfo( in.readUTF() ); -- if ( server != null ) -- { -- con.connect( server, ServerConnectEvent.Reason.PLUGIN_MESSAGE ); -+ if (subChannel.equals("Connect")) { -+ ServerInfo server = bungee.getServerInfo(in.readUTF()); -+ if (server != null) { -+ con.connect(server, ServerConnectEvent.Reason.PLUGIN_MESSAGE); - } - } -- if ( subChannel.equals( "ConnectOther" ) ) -- { -- ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); -- if ( player != null ) -- { -- ServerInfo server = bungee.getServerInfo( in.readUTF() ); -- if ( server != null ) -- { -- player.connect( server ); -+ if (subChannel.equals("ConnectOther")) { -+ ProxiedPlayer player = bungee.getPlayer(in.readUTF()); -+ if (player != null) { -+ ServerInfo server = bungee.getServerInfo(in.readUTF()); -+ if (server != null) { -+ player.connect(server); - } - } - } -- if ( subChannel.equals( "IP" ) ) -- { -- out.writeUTF( "IP" ); -- if ( con.getSocketAddress() instanceof InetSocketAddress ) -- { -- out.writeUTF( con.getAddress().getHostString() ); -- out.writeInt( con.getAddress().getPort() ); -- } else -- { -- out.writeUTF( "unix://" + ( (DomainSocketAddress) con.getSocketAddress() ).path() ); -- out.writeInt( 0 ); -+ if (subChannel.equals("IP")) { -+ out.writeUTF("IP"); -+ if (con.getSocketAddress() instanceof InetSocketAddress) { -+ out.writeUTF(con.getAddress().getHostString()); -+ out.writeInt(con.getAddress().getPort()); -+ } else { -+ out.writeUTF("unix://" + ((DomainSocketAddress) con.getSocketAddress()).path()); -+ out.writeInt(0); - } - } - if ( subChannel.equals( "IPOther" ) ) -@@ -437,130 +395,105 @@ public class DownstreamBridge extends PacketHandler - if ( subChannel.equals( "PlayerCount" ) ) - { - String target = in.readUTF(); -- out.writeUTF( "PlayerCount" ); -- if ( target.equals( "ALL" ) ) -- { -- out.writeUTF( "ALL" ); -- out.writeInt( bungee.getOnlineCount() ); -- } else -- { -- ServerInfo server = bungee.getServerInfo( target ); -- if ( server != null ) -- { -- out.writeUTF( server.getName() ); -- out.writeInt( server.getPlayers().size() ); -+ out.writeUTF("PlayerCount"); -+ if (target.equals("ALL")) { -+ out.writeUTF("ALL"); -+ out.writeInt(bungee.getOnlineCount()); -+ } else { -+ ServerInfo server = bungee.getServerInfo(target); -+ if (server != null) { -+ out.writeUTF(server.getName()); -+ out.writeInt(server.getPlayers().size()); - } - } - } -- if ( subChannel.equals( "PlayerList" ) ) -- { -+ if (subChannel.equals("PlayerList")) { - String target = in.readUTF(); -- out.writeUTF( "PlayerList" ); -- if ( target.equals( "ALL" ) ) -- { -- out.writeUTF( "ALL" ); -- out.writeUTF( Util.csv( bungee.getPlayers() ) ); -- } else -- { -- ServerInfo server = bungee.getServerInfo( target ); -- if ( server != null ) -- { -- out.writeUTF( server.getName() ); -- out.writeUTF( Util.csv( server.getPlayers() ) ); -+ out.writeUTF("PlayerList"); -+ if (target.equals("ALL")) { -+ out.writeUTF("ALL"); -+ out.writeUTF(Util.csv(bungee.getPlayers())); -+ } else { -+ ServerInfo server = bungee.getServerInfo(target); -+ if (server != null) { -+ out.writeUTF(server.getName()); -+ out.writeUTF(Util.csv(server.getPlayers())); - } - } - } -- if ( subChannel.equals( "GetServers" ) ) -- { -- out.writeUTF( "GetServers" ); -- out.writeUTF( Util.csv( bungee.getServers().keySet() ) ); -+ if (subChannel.equals("GetServers")) { -+ out.writeUTF("GetServers"); -+ out.writeUTF(Util.csv(bungee.getServers().keySet())); - } -- if ( subChannel.equals( "Message" ) ) -- { -+ if (subChannel.equals("Message")) { - String target = in.readUTF(); - String message = in.readUTF(); -- if ( target.equals( "ALL" ) ) -- { -- for ( ProxiedPlayer player : bungee.getPlayers() ) -- { -- player.sendMessage( message ); -+ if (target.equals("ALL")) { -+ for (ProxiedPlayer player : bungee.getPlayers()) { -+ player.sendMessage(message); - } -- } else -- { -- ProxiedPlayer player = bungee.getPlayer( target ); -- if ( player != null ) -- { -- player.sendMessage( message ); -+ } else { -+ ProxiedPlayer player = bungee.getPlayer(target); -+ if (player != null) { -+ player.sendMessage(message); - } - } - } -- if ( subChannel.equals( "MessageRaw" ) ) -- { -+ if (subChannel.equals("MessageRaw")) { - String target = in.readUTF(); -- BaseComponent[] message = ComponentSerializer.parse( in.readUTF() ); -- if ( target.equals( "ALL" ) ) -- { -- for ( ProxiedPlayer player : bungee.getPlayers() ) -- { -- player.sendMessage( message ); -+ BaseComponent[] message = ComponentSerializer.parse(in.readUTF()); -+ if (target.equals("ALL")) { -+ for (ProxiedPlayer player : bungee.getPlayers()) { -+ player.sendMessage(message); - } -- } else -- { -- ProxiedPlayer player = bungee.getPlayer( target ); -- if ( player != null ) -- { -- player.sendMessage( message ); -+ } else { -+ ProxiedPlayer player = bungee.getPlayer(target); -+ if (player != null) { -+ player.sendMessage(message); - } - } - } -- if ( subChannel.equals( "GetServer" ) ) -- { -- out.writeUTF( "GetServer" ); -- out.writeUTF( server.getInfo().getName() ); -+ if (subChannel.equals("GetServer")) { -+ out.writeUTF("GetServer"); -+ out.writeUTF(server.getInfo().getName()); - } -- if ( subChannel.equals( "UUID" ) ) -- { -- out.writeUTF( "UUID" ); -- out.writeUTF( con.getUUID() ); -+ if (subChannel.equals("UUID")) { -+ out.writeUTF("UUID"); -+ out.writeUTF(con.getUUID()); - } -- if ( subChannel.equals( "UUIDOther" ) ) -- { -- ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); -- if ( player != null ) -- { -- out.writeUTF( "UUIDOther" ); -- out.writeUTF( player.getName() ); -- out.writeUTF( player.getUUID() ); -+ if (subChannel.equals("UUIDOther")) { -+ ProxiedPlayer player = bungee.getPlayer(in.readUTF()); -+ if (player != null) { -+ out.writeUTF("UUIDOther"); -+ out.writeUTF(player.getName()); -+ out.writeUTF(player.getUUID()); - } - } -- if ( subChannel.equals( "ServerIP" ) ) -- { -- ServerInfo info = bungee.getServerInfo( in.readUTF() ); -- if ( info != null && !info.getAddress().isUnresolved() ) -- { -- out.writeUTF( "ServerIP" ); -- out.writeUTF( info.getName() ); -- out.writeUTF( info.getAddress().getAddress().getHostAddress() ); -- out.writeShort( info.getAddress().getPort() ); -+ if (subChannel.equals("ServerIP")) { -+ // FlameCord start - Changed "info.getAddress().getAddress()" to address -+ final ServerInfo info = bungee.getServerInfo(in.readUTF()); -+ final InetSocketAddress address = info.getAddress(); -+ if (info != null && !address.isUnresolved()) { -+ out.writeUTF("ServerIP"); -+ out.writeUTF(info.getName()); -+ out.writeUTF(address.getHostString()); -+ out.writeShort(address.getPort()); - } - } -- if ( subChannel.equals( "KickPlayer" ) ) -- { -- ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); -- if ( player != null ) -- { -+ if (subChannel.equals("KickPlayer")) { -+ ProxiedPlayer player = bungee.getPlayer(in.readUTF()); -+ if (player != null) { - String kickReason = in.readUTF(); -- player.disconnect( new TextComponent( kickReason ) ); -+ player.disconnect(new TextComponent(kickReason)); - } - } - -- // Check we haven't set out to null, and we have written data, if so reply back back along the BungeeCord channel -- if ( out != null ) -- { -+ // Check we haven't set out to null, and we have written data, if so reply back -+ // back along the BungeeCord channel -+ if (out != null) { - byte[] b = out.toByteArray(); -- if ( b.length != 0 ) -- { -- server.sendData( "BungeeCord", b ); -+ if (b.length != 0) { -+ server.sendData("BungeeCord", b); - } - } - -@@ -569,100 +502,89 @@ public class DownstreamBridge extends PacketHandler - } - - @Override -- public void handle(Kick kick) throws Exception -- { -- ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); -- if ( Objects.equals( server.getInfo(), def ) ) -- { -+ public void handle(Kick kick) throws Exception { -+ ServerInfo def = con.updateAndGetNextServer(server.getInfo()); -+ if (Objects.equals(server.getInfo(), def)) { - def = null; - } -- ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), ComponentSerializer.parse( kick.getMessage() ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.SERVER ) ); // Waterfall -- if ( event.isCancelled() && event.getCancelServer() != null ) -- { -- con.connectNow( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT ); -- } else -- { -- con.disconnect0( event.getKickReasonComponent() ); // TODO: Prefix our own stuff. -+ ServerKickEvent event = bungee.getPluginManager() -+ .callEvent(new ServerKickEvent(con, server.getInfo(), ComponentSerializer.parse(kick.getMessage()), def, -+ ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.SERVER)); // Waterfall -+ if (event.isCancelled() && event.getCancelServer() != null) { -+ con.connectNow(event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT); -+ } else { -+ con.disconnect0(event.getKickReasonComponent()); // TODO: Prefix our own stuff. - } -- server.setObsolete( true ); -+ server.setObsolete(true); - throw CancelSendSignal.INSTANCE; - } - - @Override -- public void handle(SetCompression setCompression) throws Exception -- { -- server.getCh().setCompressionThreshold( setCompression.getThreshold() ); -+ public void handle(SetCompression setCompression) throws Exception { -+ server.getCh().setCompressionThreshold(setCompression.getThreshold()); - } - - @Override -- public void handle(TabCompleteResponse tabCompleteResponse) throws Exception -- { -+ public void handle(TabCompleteResponse tabCompleteResponse) throws Exception { - List commands = tabCompleteResponse.getCommands(); -- if ( commands == null ) -- { -- commands = Lists.transform( tabCompleteResponse.getSuggestions().getList(), new Function() -- { -- @Override -- public String apply(Suggestion input) -- { -- return input.getText(); -- } -- } ); -+ if (commands == null) { -+ commands = Lists.transform(tabCompleteResponse.getSuggestions().getList(), -+ new Function() { -+ @Override -+ public String apply(Suggestion input) { -+ return input.getText(); -+ } -+ }); - } - -- TabCompleteResponseEvent tabCompleteResponseEvent = new TabCompleteResponseEvent( server, con, new ArrayList<>( commands ) ); -- if ( !bungee.getPluginManager().callEvent( tabCompleteResponseEvent ).isCancelled() ) -- { -+ TabCompleteResponseEvent tabCompleteResponseEvent = new TabCompleteResponseEvent(server, con, -+ new ArrayList<>(commands)); -+ if (!bungee.getPluginManager().callEvent(tabCompleteResponseEvent).isCancelled()) { - // Take action only if modified -- if ( !commands.equals( tabCompleteResponseEvent.getSuggestions() ) ) -- { -- if ( tabCompleteResponse.getCommands() != null ) -- { -+ if (!commands.equals(tabCompleteResponseEvent.getSuggestions())) { -+ if (tabCompleteResponse.getCommands() != null) { - // Classic style -- tabCompleteResponse.setCommands( tabCompleteResponseEvent.getSuggestions() ); -- } else -- { -+ tabCompleteResponse.setCommands(tabCompleteResponseEvent.getSuggestions()); -+ } else { - // Brigadier style - final StringRange range = tabCompleteResponse.getSuggestions().getRange(); -- tabCompleteResponse.setSuggestions( new Suggestions( range, Lists.transform( tabCompleteResponseEvent.getSuggestions(), new Function() -- { -- @Override -- public Suggestion apply(String input) -- { -- return new Suggestion( range, input ); -- } -- } ) ) ); -+ tabCompleteResponse.setSuggestions(new Suggestions(range, Lists -+ .transform(tabCompleteResponseEvent.getSuggestions(), new Function() { -+ @Override -+ public Suggestion apply(String input) { -+ return new Suggestion(range, input); -+ } -+ }))); - } - } - -- con.unsafe().sendPacket( tabCompleteResponse ); -+ con.unsafe().sendPacket(tabCompleteResponse); - } - - throw CancelSendSignal.INSTANCE; - } - - @Override -- public void handle(BossBar bossBar) -- { -- switch ( bossBar.getAction() ) -- { -+ public void handle(BossBar bossBar) { -+ switch (bossBar.getAction()) { - // Handle add bossbar - case 0: -- con.getSentBossBars().add( bossBar.getUuid() ); -+ con.getSentBossBars().add(bossBar.getUuid()); - break; - // Handle remove bossbar - case 1: -- con.getSentBossBars().remove( bossBar.getUuid() ); -+ con.getSentBossBars().remove(bossBar.getUuid()); - break; - } - } - - // Waterfall start - @Override -- public void handle(EntityEffect entityEffect) throws Exception -- { -- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall -- // Don't send any potions when switching between servers (which involves a handshake), which can trigger a race -+ public void handle(EntityEffect entityEffect) throws Exception { -+ if (con.isDisableEntityMetadataRewrite()) -+ return; // Waterfall -+ // Don't send any potions when switching between servers (which involves a -+ // handshake), which can trigger a race - // condition on the client. - if (this.con.getForgeClientHandler().isForgeUser() && !this.con.getForgeClientHandler().isHandshakeComplete()) { - throw CancelSendSignal.INSTANCE; -@@ -671,9 +593,9 @@ public class DownstreamBridge extends PacketHandler - } - - @Override -- public void handle(EntityRemoveEffect removeEffect) throws Exception -- { -- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall -+ public void handle(EntityRemoveEffect removeEffect) throws Exception { -+ if (con.isDisableEntityMetadataRewrite()) -+ return; // Waterfall - con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId()); - } - -@@ -686,56 +608,52 @@ public class DownstreamBridge extends PacketHandler - // Waterfall end - - @Override -- public void handle(Respawn respawn) -- { -- con.setDimension( respawn.getDimension() ); -+ public void handle(Respawn respawn) { -+ con.setDimension(respawn.getDimension()); - } - - @Override -- public void handle(Commands commands) throws Exception -- { -+ public void handle(Commands commands) throws Exception { - boolean modified = false; - - // Waterfall start - Map commandMap = new HashMap<>(); -- for ( Map.Entry commandEntry : bungee.getPluginManager().getCommands() ) { -- if ( !bungee.getDisabledCommands().contains( commandEntry.getKey() ) -- && commands.getRoot().getChild( commandEntry.getKey() ) == null -- && commandEntry.getValue().hasPermission( this.con ) ) { -+ for (Map.Entry commandEntry : bungee.getPluginManager().getCommands()) { -+ if (!bungee.getDisabledCommands().contains(commandEntry.getKey()) -+ && commands.getRoot().getChild(commandEntry.getKey()) == null -+ && commandEntry.getValue().hasPermission(this.con)) { - -- commandMap.put( commandEntry.getKey(), commandEntry.getValue() ); -+ commandMap.put(commandEntry.getKey(), commandEntry.getValue()); - } - } - -- ProxyDefineCommandsEvent event = new ProxyDefineCommandsEvent( this.server, this.con, commandMap ); -- bungee.getPluginManager().callEvent( event ); -+ ProxyDefineCommandsEvent event = new ProxyDefineCommandsEvent(this.server, this.con, commandMap); -+ bungee.getPluginManager().callEvent(event); - -- for ( Map.Entry command : event.getCommands().entrySet() ) -- { -- //noinspection ConstantConditions -- if ( true ) // Moved up -+ for (Map.Entry command : event.getCommands().entrySet()) { -+ // noinspection ConstantConditions -+ if (true) // Moved up - // Waterfall end - { -- LiteralCommandNode dummy = LiteralArgumentBuilder.literal( command.getKey() ) -- .then( RequiredArgumentBuilder.argument( "args", StringArgumentType.greedyString() ) -- .suggests( Commands.SuggestionRegistry.ASK_SERVER ) ) -+ LiteralCommandNode dummy = LiteralArgumentBuilder.literal(command.getKey()) -+ .then(RequiredArgumentBuilder.argument("args", StringArgumentType.greedyString()) -+ .suggests(Commands.SuggestionRegistry.ASK_SERVER)) - .build(); -- commands.getRoot().addChild( dummy ); -+ commands.getRoot().addChild(dummy); - - modified = true; - } - } - -- if ( modified ) -- { -- con.unsafe().sendPacket( commands ); -+ if (modified) { -+ con.unsafe().sendPacket(commands); - throw CancelSendSignal.INSTANCE; - } - } - - @Override -- public String toString() -- { -- return "[" + con.getAddress() + "|" + con.getName() + "] <-> DownstreamBridge <-> [" + server.getInfo().getName() + "]"; -+ public String toString() { -+ return "[" + con.getAddress() + "|" + con.getName() + "] <-> DownstreamBridge <-> [" -+ + server.getInfo().getName() + "]"; - } - } -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 13deb6c9..9bfd064b 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 -@@ -1,8 +1,5 @@ - package net.md_5.bungee.connection; - --import com.google.common.base.Charsets; --import com.google.common.base.Preconditions; --import com.google.gson.Gson; - import java.math.BigInteger; - import java.net.InetSocketAddress; - import java.net.SocketAddress; -@@ -11,18 +8,22 @@ import java.security.MessageDigest; - import java.util.List; - import java.util.UUID; - import java.util.logging.Level; -+ - import javax.crypto.SecretKey; - - import com.google.common.base.Charsets; - import com.google.common.base.Preconditions; - import com.google.gson.Gson; -- - import com.google.gson.JsonElement; - import com.google.gson.JsonObject; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.BungeeServerInfo; -+import net.md_5.bungee.ConnectionThrottle; - import net.md_5.bungee.EncryptionUtil; - import net.md_5.bungee.UserConnection; - import net.md_5.bungee.Util; -@@ -31,6 +32,7 @@ import net.md_5.bungee.api.Callback; - import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.Favicon; - import net.md_5.bungee.api.ServerPing; -+import net.md_5.bungee.api.ServerPing.Players; - import net.md_5.bungee.api.chat.BaseComponent; - import net.md_5.bungee.api.chat.TextComponent; - import net.md_5.bungee.api.config.ListenerInfo; -@@ -52,6 +54,7 @@ import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; - import net.md_5.bungee.netty.cipher.CipherDecoder; - import net.md_5.bungee.netty.cipher.CipherEncoder; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.Protocol; -@@ -71,13 +74,12 @@ import net.md_5.bungee.protocol.packet.StatusRequest; - import net.md_5.bungee.protocol.packet.StatusResponse; - import net.md_5.bungee.util.BoundedArrayList; - import net.md_5.bungee.util.BufUtil; --import net.md_5.bungee.util.QuietException; - - @RequiredArgsConstructor --public class InitialHandler extends PacketHandler implements PendingConnection --{ -+public class InitialHandler extends PacketHandler implements PendingConnection { - -- private static final String MOJANG_AUTH_URL = System.getProperty("waterfall.auth.url", "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=%s&serverId=%s%s"); -+ private static final String MOJANG_AUTH_URL = System.getProperty("waterfall.auth.url", -+ "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=%s&serverId=%s%s"); - - private final BungeeCord bungee; - private ChannelWrapper ch; -@@ -89,14 +91,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection - private LoginRequest loginRequest; - private EncryptionRequest request; - @Getter -- private final List relayMessages = new BoundedArrayList<>( 128 ); -+ private final List relayMessages = new BoundedArrayList<>(128); - private State thisState = State.HANDSHAKE; -- private final Unsafe unsafe = new Unsafe() -- { -+ private final Unsafe unsafe = new Unsafe() { - @Override -- public void sendPacket(DefinedPacket packet) -- { -- ch.write( packet ); -+ public void sendPacket(final DefinedPacket packet) { -+ ch.write(packet); - } - }; - @Getter -@@ -116,581 +116,565 @@ public class InitialHandler extends PacketHandler implements PendingConnection - private String extraDataInHandshake = ""; - - @Override -- public boolean shouldHandle(PacketWrapper packet) throws Exception -- { -+ public boolean shouldHandle(final PacketWrapper packet) throws Exception { - return !ch.isClosing(); - } - -- private enum State -- { -- -+ private enum State { - HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHED; - } - -- private boolean canSendKickMessage() -- { -+ private boolean canSendKickMessage() { - return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHED; - } - - @Override -- public void connected(ChannelWrapper channel) throws Exception -- { -+ public void connected(final ChannelWrapper channel) throws Exception { - this.ch = channel; - } - - @Override -- public void exception(Throwable t) throws Exception -- { -- if ( canSendKickMessage() ) -- { -- disconnect( ChatColor.RED + Util.exception( t ) ); -- } else -- { -+ public void exception(final Throwable t) throws Exception { -+ if (canSendKickMessage()) { -+ disconnect(ChatColor.RED + Util.exception(t)); -+ } else { - ch.close(); - } - } - - @Override -- public void handle(PacketWrapper packet) throws Exception -- { -- if ( packet.packet == null ) -- { -- throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); -+ public void handle(final PacketWrapper packet) throws Exception { -+ if (packet.packet == null) { -+ // FlameCord - Toggle Dumping packet info -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( -+ "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16)); -+ } else { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException("Unexpected packet received during login process!"); -+ } - } - } - - @Override -- public void handle(PluginMessage pluginMessage) throws Exception -- { -+ public void handle(final PluginMessage pluginMessage) throws Exception { - // TODO: Unregister? -- if ( PluginMessage.SHOULD_RELAY.apply( pluginMessage ) ) -- { -- relayMessages.add( pluginMessage ); -+ if (PluginMessage.SHOULD_RELAY.apply(pluginMessage)) { -+ relayMessages.add(pluginMessage); - } - } - - @Override -- public void handle(LegacyHandshake legacyHandshake) throws Exception -- { -+ public void handle(final LegacyHandshake legacyHandshake) throws Exception { - this.legacy = true; -- ch.close( bungee.getTranslation( "outdated_client", bungee.getGameVersion() ) ); -+ ch.close(bungee.getTranslation("outdated_client", bungee.getGameVersion())); - } - - @Override -- public void handle(LegacyPing ping) throws Exception -- { -+ public void handle(final LegacyPing ping) throws Exception { - this.legacy = true; - final boolean v1_5 = ping.isV1_5(); - -- ServerPing legacy = new ServerPing( new ServerPing.Protocol( bungee.getName() + " " + bungee.getGameVersion(), bungee.getProtocolVersion() ), -- new ServerPing.Players( listener.getMaxPlayers(), bungee.getOnlineCount(), null ), -- new TextComponent( TextComponent.fromLegacyText( listener.getMotd() ) ), (Favicon) null ); -+ final ServerPing legacy = new ServerPing( -+ new ServerPing.Protocol(bungee.getName() + " " + bungee.getGameVersion(), bungee.getProtocolVersion()), -+ new ServerPing.Players(listener.getMaxPlayers(), bungee.getOnlineCount(), null), -+ new TextComponent(TextComponent.fromLegacyText(listener.getMotd())), (Favicon) null); - -- Callback callback = new Callback() -- { -+ final Callback callback = new Callback() { - @Override -- public void done(ProxyPingEvent result, Throwable error) -- { -- if ( ch.isClosed() ) -- { -+ public void done(final ProxyPingEvent result, final Throwable error) { -+ if (ch.isClosed()) { - return; - } - -- ServerPing legacy = result.getResponse(); -- String kickMessage; -- -- if ( v1_5 ) -- { -- kickMessage = ChatColor.DARK_BLUE -- + "\00" + 127 -- + '\00' + legacy.getVersion().getName() -- + '\00' + getFirstLine( legacy.getDescription() ) -- + '\00' + legacy.getPlayers().getOnline() -- + '\00' + legacy.getPlayers().getMax(); -- } else -- { -- // Clients <= 1.3 don't support colored motds because the color char is used as delimiter -- kickMessage = ChatColor.stripColor( getFirstLine( legacy.getDescription() ) ) -- + '\u00a7' + legacy.getPlayers().getOnline() -- + '\u00a7' + legacy.getPlayers().getMax(); -+ final ServerPing legacy = result.getResponse(); -+ -+ // FlameCord start - Checking if legacy != null before doing anything -+ if (legacy != null) { -+ final Players players = legacy.getPlayers(); -+ -+ if (v1_5) { -+ ch.close(ChatColor.DARK_BLUE + "\00" + 127 + '\00' + legacy.getVersion().getName() + '\00' -+ + getFirstLine(legacy.getDescription()) + '\00' + players.getOnline() + '\00' -+ + players.getMax()); -+ } else { -+ // Clients <= 1.3 don't support colored motds because the color char is used as -+ // delimiter -+ ch.close(ChatColor.stripColor(getFirstLine(legacy.getDescription())) + '\u00a7' -+ + legacy.getPlayers().getOnline() + '\u00a7' + legacy.getPlayers().getMax()); -+ } -+ } else { -+ ch.close(); - } -- -- ch.close( kickMessage ); -+ // FlameCord end - Checking if legacy != null before doing anything - } - }; - -- bungee.getPluginManager().callEvent( new ProxyPingEvent( this, legacy, callback ) ); -+ bungee.getPluginManager().callEvent(new ProxyPingEvent(this, legacy, callback)); - } - -- private static String getFirstLine(String str) -- { -- int pos = str.indexOf( '\n' ); -- return pos == -1 ? str : str.substring( 0, pos ); -+ private static String getFirstLine(final String str) { -+ final int pos = str.indexOf('\n'); -+ return pos == -1 ? str : str.substring(0, pos); - } - -- private ServerPing getPingInfo(String motd, int protocol) -- { -- return new ServerPing( -- new ServerPing.Protocol( bungee.getName() + " " + bungee.getGameVersion(), protocol ), -- new ServerPing.Players( listener.getMaxPlayers(), bungee.getOnlineCount(), null ), -- motd, BungeeCord.getInstance().config.getFaviconObject() -- ); -+ private ServerPing getPingInfo(final String motd, final int protocol) { -+ return new ServerPing(new ServerPing.Protocol(bungee.getName() + " " + bungee.getGameVersion(), protocol), -+ new ServerPing.Players(listener.getMaxPlayers(), bungee.getOnlineCount(), null), motd, -+ BungeeCord.getInstance().config.getFaviconObject()); - } - - @Override -- public void handle(StatusRequest statusRequest) throws Exception -- { -- Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); -+ public void handle(final StatusRequest statusRequest) throws Exception { -+ Preconditions.checkState(thisState == State.STATUS, "Not expecting STATUS"); - -- ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); -- final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); -- final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -+ final ServerInfo forced = AbstractReconnectHandler.getForcedHost(this); -+ final String motd = (forced != null) ? forced.getMotd() : listener.getMotd(); -+ final int protocol = (ProtocolConstants.SUPPORTED_VERSION_IDS.contains(handshake.getProtocolVersion())) -+ ? handshake.getProtocolVersion() -+ : bungee.getProtocolVersion(); - -- Callback pingBack = new Callback() -- { -+ final Callback pingBack = new Callback() { - @Override -- public void done(ServerPing result, Throwable error) -- { -- if ( error != null ) -- { -- result = getPingInfo( bungee.getTranslation( "ping_cannot_connect" ), protocol ); -- bungee.getLogger().log( Level.WARNING, "Error pinging remote server", error ); -+ public void done(ServerPing result, final Throwable error) { -+ if (error != null) { -+ result = getPingInfo(bungee.getTranslation("ping_cannot_connect"), protocol); -+ bungee.getLogger().log(Level.WARNING, "Error pinging remote server", error); - } - -- Callback callback = new Callback() -- { -+ final Callback callback = new Callback() { - @Override -- public void done(ProxyPingEvent pingResult, Throwable error) -- { -- Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine -- if ( bungee.getConnectionThrottle() != null ) -- { -- bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); -+ public void done(final ProxyPingEvent pingResult, final Throwable error) { -+ // FlameCord - Use connectionThrottle variable -+ final ConnectionThrottle connectionThrottle = bungee.getConnectionThrottle(); -+ final Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 -+ ? bungee.gsonLegacy -+ : bungee.gson; // Travertine -+ -+ if (connectionThrottle != null) { -+ connectionThrottle.unthrottle(getSocketAddress()); -+ } -+ -+ // FlameCord - Close if response is null -+ // FlameCord - Return if connection is closed -+ final ServerPing response = pingResult.getResponse(); -+ if (response == null) { -+ ch.close(); -+ return; -+ } else if (ch.isClosed()) { -+ return; - } -+ - // Travertine start -- if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -- { -- // Minecraft < 1.9 doesn't send string server descriptions as chat components. Older 1.7 -- // clients even crash when encountering a chat component instead of a string. To be on the -+ if (ProtocolConstants.isBeforeOrEq(handshake.getProtocolVersion(), -+ ProtocolConstants.MINECRAFT_1_8)) { -+ // Minecraft < 1.9 doesn't send string server descriptions as chat components. -+ // Older 1.7 -+ // clients even crash when encountering a chat component instead of a string. To -+ // be on the - // safe side, always send legacy descriptions for < 1.9 clients. -- JsonElement element = gson.toJsonTree(pingResult.getResponse()); -+ final JsonElement element = gson.toJsonTree(response); - Preconditions.checkArgument(element.isJsonObject(), "Response is not a JSON object"); -- JsonObject object = element.getAsJsonObject(); -- object.addProperty("description", pingResult.getResponse().getDescription()); -+ final JsonObject object = element.getAsJsonObject(); -+ object.addProperty("description", response.getDescription()); - - unsafe.sendPacket(new StatusResponse(gson.toJson(element))); -- } else -- { -- unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); -+ } else { -+ unsafe.sendPacket(new StatusResponse(gson.toJson(response))); - } - // Travertine end - } - }; - -- bungee.getPluginManager().callEvent( new ProxyPingEvent( InitialHandler.this, result, callback ) ); -+ bungee.getPluginManager().callEvent(new ProxyPingEvent(InitialHandler.this, result, callback)); - } - }; - -- if ( forced != null && listener.isPingPassthrough() ) -- { -- ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); -- } else -- { -- pingBack.done( getPingInfo( motd, protocol ), null ); -+ if (forced != null && listener.isPingPassthrough()) { -+ ((BungeeServerInfo) forced).ping(pingBack, handshake.getProtocolVersion()); -+ } else { -+ pingBack.done(getPingInfo(motd, protocol), null); - } - - thisState = State.PING; - } - -- private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); -+ private static final boolean ACCEPT_INVALID_PACKETS = Boolean -+ .parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); - - @Override -- public void handle(PingPacket ping) throws Exception -- { -- if (!ACCEPT_INVALID_PACKETS) { -- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); -- } -- unsafe.sendPacket( ping ); -- disconnect( "" ); -+ public void handle(final PingPacket ping) throws Exception { -+ // FlameCord - Never accept invalid packets -+ // if (!ACCEPT_INVALID_PACKETS) { -+ Preconditions.checkState(thisState == State.PING, "Not expecting PING"); -+ // } -+ unsafe.sendPacket(ping); -+ // FlameCord start - Close instead of disconnect -+ // disconnect(""); -+ ch.close(); - } - - @Override -- public void handle(Handshake handshake) throws Exception -- { -- Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ public void handle(final Handshake handshake) throws Exception { -+ Preconditions.checkState(thisState == State.HANDSHAKE, "Not expecting HANDSHAKE"); - this.handshake = handshake; -- ch.setVersion( handshake.getProtocolVersion() ); -- -- // Starting with FML 1.8, a "\0FML\0" token is appended to the handshake. This interferes -- // with Bungee's IP forwarding, so we detect it, and remove it from the host string, for now. -- // We know FML appends \00FML\00. However, we need to also consider that other systems might -- // add their own data to the end of the string. So, we just take everything from the \0 character -- // and save it for later. -- if ( handshake.getHost().contains( "\0" ) ) -- { -- String[] split = handshake.getHost().split( "\0", 2 ); -- handshake.setHost( split[0] ); -+ ch.setVersion(handshake.getProtocolVersion()); -+ -+ // Starting with FML 1.8, a "\0FML\0" token is appended to the handshake. This -+ // interferes -+ // with Bungee's IP forwarding, so we detect it, and remove it from the host -+ // string, for now. -+ // We know FML appends \00FML\00. However, we need to also consider that other -+ // systems might -+ // add their own data to the end of the string. So, we just take everything from -+ // the \0 character -+ // and save it for later -+ // FlameCord start - Changed "handshake.getHost()" to host -+ String host = handshake.getHost(); -+ -+ if (host.contains("\0")) { -+ final String[] split = host.split("\0", 2); -+ handshake.setHost(host = split[0]); - extraDataInHandshake = "\0" + split[1]; - } - - // SRV records can end with a . depending on DNS / client. -- if ( handshake.getHost().endsWith( "." ) ) -- { -- handshake.setHost( handshake.getHost().substring( 0, handshake.getHost().length() - 1 ) ); -+ if (host.endsWith(".")) { -+ handshake.setHost(host = host.substring(0, host.length() - 1)); - } - -- this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); -- -- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); -+ this.virtualHost = InetSocketAddress.createUnresolved(host, handshake.getPort()); -+ // FlameCord end - Changed "handshake.getHost()" to host -+ bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)); - -- switch ( handshake.getRequestedProtocol() ) -- { -+ switch (handshake.getRequestedProtocol()) { - case 1: - // Ping -- if ( bungee.getConfig().isLogPings() ) -- { -- bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); -+ // FlameCord - Added isLoggerInitialhandler option -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() -+ && bungee.getConfig().isLogPings()) { -+ bungee.getLogger().log(Level.INFO, "{0} has pinged", this); - } - thisState = State.STATUS; -- ch.setProtocol( Protocol.STATUS ); -+ ch.setProtocol(Protocol.STATUS); - break; - case 2: - // Login -- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall -+ // FlameCord - Added isLoggerInitialhandler option -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() -+ && BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections()) // Waterfall - { -- bungee.getLogger().log( Level.INFO, "{0} has connected", this ); -+ bungee.getLogger().log(Level.INFO, "{0} has connected", this); - } - thisState = State.USERNAME; -- ch.setProtocol( Protocol.LOGIN ); -+ ch.setProtocol(Protocol.LOGIN); - -- if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) -- { -- if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -- { -- disconnect( bungee.getTranslation( "outdated_server", bungee.getGameVersion() ) ); -- } else -- { -- disconnect( bungee.getTranslation( "outdated_client", bungee.getGameVersion() ) ); -+ if (!ProtocolConstants.SUPPORTED_VERSION_IDS.contains(handshake.getProtocolVersion())) { -+ if (handshake.getProtocolVersion() > bungee.getProtocolVersion()) { -+ disconnect(bungee.getTranslation("outdated_server", bungee.getGameVersion())); -+ } else { -+ disconnect(bungee.getTranslation("outdated_client", bungee.getGameVersion())); - } - return; - } - break; - default: -- throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException("Cannot request protocol " + handshake.getRequestedProtocol()); - } - } - - @Override -- public void handle(LoginRequest loginRequest) throws Exception -- { -- Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); -+ public void handle(final LoginRequest loginRequest) throws Exception { -+ Preconditions.checkState(thisState == State.USERNAME, "Not expecting USERNAME"); - this.loginRequest = loginRequest; - -- if ( getName().contains( "." ) ) -- { -- disconnect( bungee.getTranslation( "name_invalid" ) ); -+ // FlameCord - Use getName() only once -+ final String name = getName(); -+ -+ if (FlameCord.getInstance().getFirewallManager().isFirewalled(name)) { -+ throw new FirewallException(ch.getRemoteAddress()); -+ } -+ -+ if (name.contains(".")) { -+ disconnect(bungee.getTranslation("name_invalid")); - return; - } - -- if ( getName().length() > 16 ) -- { -- disconnect( bungee.getTranslation( "name_too_long" ) ); -+ if (name.length() > 16) { -+ disconnect(bungee.getTranslation("name_too_long")); - return; - } - -- int limit = BungeeCord.getInstance().config.getPlayerLimit(); -- if ( limit > 0 && bungee.getOnlineCount() > limit ) -- { -- disconnect( bungee.getTranslation( "proxy_full" ) ); -+ final int limit = bungee.config.getPlayerLimit(); -+ if (limit > 0 && bungee.getOnlineCount() > limit) { -+ disconnect(bungee.getTranslation("proxy_full")); - return; - } - - // If offline mode and they are already on, don't allow connect - // We can just check by UUID here as names are based on UUID -- if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) -- { -- disconnect( bungee.getTranslation( "already_connected_proxy" ) ); -+ if (!isOnlineMode() && bungee.getPlayer(getUniqueId()) != null) { -+ disconnect(bungee.getTranslation("already_connected_proxy")); - return; - } - -- Callback callback = new Callback() -- { -+ final Callback callback = new Callback() { - - @Override -- public void done(PreLoginEvent result, Throwable error) -- { -- if ( result.isCancelled() ) -- { -- disconnect( result.getCancelReasonComponents() ); -+ public void done(final PreLoginEvent result, final Throwable error) { -+ if (result.isCancelled()) { -+ disconnect(result.getCancelReasonComponents()); - return; - } -- if ( ch.isClosed() ) -- { -+ if (ch.isClosed()) { - return; - } -- if ( onlineMode ) -- { -- unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); -- } else -- { -+ if (isOnlineMode()) { -+ unsafe().sendPacket(request = EncryptionUtil.encryptRequest()); -+ // FlameCord - Change state different way to fix encryption -+ thisState = State.ENCRYPT; -+ } else { - finish(); - } -- thisState = State.ENCRYPT; -+ // FlameCord - Change state different way to fix encryption -+ // thisState = State.ENCRYPT; - } - }; - - // fire pre login event -- bungee.getPluginManager().callEvent( new PreLoginEvent( InitialHandler.this, callback ) ); -+ bungee.getPluginManager().callEvent(new PreLoginEvent(InitialHandler.this, callback)); - } - - @Override -- public void handle(final EncryptionResponse encryptResponse) throws Exception -- { -- Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); -- -- SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); -- BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); -- ch.addBefore( PipelineUtils.FRAME_DECODER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) ); -- BungeeCipher encrypt = EncryptionUtil.getCipher( true, sharedKey ); -- ch.addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) ); -- -- String encName = URLEncoder.encode( InitialHandler.this.getName(), "UTF-8" ); -- -- MessageDigest sha = MessageDigest.getInstance( "SHA-1" ); -- for ( byte[] bit : new byte[][] -- { -- request.getServerId().getBytes( "ISO_8859_1" ), sharedKey.getEncoded(), EncryptionUtil.keys.getPublic().getEncoded() -- } ) -- { -- sha.update( bit ); -+ public void handle(final EncryptionResponse encryptResponse) throws Exception { -+ Preconditions.checkState(thisState == State.ENCRYPT, "Not expecting ENCRYPT"); -+ // FlameCord - Move state declaration -+ thisState = State.FINISHED; -+ -+ final SecretKey sharedKey = EncryptionUtil.getSecret(encryptResponse, request); -+ final BungeeCipher decrypt = EncryptionUtil.getCipher(false, sharedKey); -+ ch.addBefore(PipelineUtils.FRAME_DECODER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder(decrypt)); -+ final BungeeCipher encrypt = EncryptionUtil.getCipher(true, sharedKey); -+ ch.addBefore(PipelineUtils.FRAME_PREPENDER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder(encrypt)); -+ -+ final String encName = URLEncoder.encode(InitialHandler.this.getName(), "UTF-8"); -+ -+ final MessageDigest sha = MessageDigest.getInstance("SHA-1"); -+ for (final byte[] bit : new byte[][] { request.getServerId().getBytes("ISO_8859_1"), sharedKey.getEncoded(), -+ EncryptionUtil.keys.getPublic().getEncoded() }) { -+ sha.update(bit); - } -- String encodedHash = URLEncoder.encode( new BigInteger( sha.digest() ).toString( 16 ), "UTF-8" ); -+ final String encodedHash = URLEncoder.encode(new BigInteger(sha.digest()).toString(16), "UTF-8"); - -- String preventProxy = ( BungeeCord.getInstance().config.isPreventProxyConnections() && getSocketAddress() instanceof InetSocketAddress ) ? "&ip=" + URLEncoder.encode( getAddress().getAddress().getHostAddress(), "UTF-8" ) : ""; -- String authURL = String.format( MOJANG_AUTH_URL, encName, encodedHash, preventProxy ); -+ String preventProxy = (BungeeCord.getInstance().config.isPreventProxyConnections() -+ && getSocketAddress() instanceof InetSocketAddress) -+ ? "&ip=" + URLEncoder.encode(getAddress().getAddress().getHostAddress(), "UTF-8") -+ : ""; -+ String authURL = String.format(MOJANG_AUTH_URL, encName, encodedHash, preventProxy); - -- Callback handler = new Callback() -- { -+ final Callback handler = new Callback() { - @Override -- public void done(String result, Throwable error) -- { -- if ( error == null ) -- { -- LoginResult obj = BungeeCord.getInstance().gson.fromJson( result, LoginResult.class ); -- if ( obj != null && obj.getId() != null ) -- { -+ public void done(final String result, final Throwable error) { -+ if (error == null) { -+ final LoginResult obj = BungeeCord.getInstance().gson.fromJson(result, LoginResult.class); -+ if (obj != null && obj.getId() != null) { - loginProfile = obj; - name = obj.getName(); -- uniqueId = Util.getUUID( obj.getId() ); -+ // FlameCord - Don't declare uuid unless it's null -+ if (uniqueId == null) { -+ uniqueId = Util.getUUID(obj.getId()); -+ } - finish(); - return; - } -- disconnect( bungee.getTranslation( "offline_mode_player" ) ); -- } else -- { -- disconnect( bungee.getTranslation( "mojang_fail" ) ); -- bungee.getLogger().log( Level.SEVERE, "Error authenticating " + getName() + " with minecraft.net", error ); -+ disconnect(bungee.getTranslation("offline_mode_player")); -+ } else { -+ disconnect(bungee.getTranslation("mojang_fail")); -+ bungee.getLogger().log(Level.SEVERE, "Error authenticating " + getName() + " with minecraft.net", -+ error); - } - } - }; - -- HttpClient.get( authURL, ch.getHandle().eventLoop(), handler ); -+ HttpClient.get(authURL, ch.getHandle().eventLoop(), handler); - } - -- private void finish() -- { -- if ( isOnlineMode() ) -- { -+ private void finish() { -+ // FlameCord - Change state different way to fix encryption -+ thisState = State.FINISHED; -+ -+ if (isOnlineMode()) { - // Check for multiple connections - // We have to check for the old name first -- ProxiedPlayer oldName = bungee.getPlayer( getName() ); -- if ( oldName != null ) -- { -+ final ProxiedPlayer oldName = bungee.getPlayer(getName()); -+ if (oldName != null) { - // TODO See #1218 -- oldName.disconnect( bungee.getTranslation( "already_connected_proxy" ) ); -+ oldName.disconnect(bungee.getTranslation("already_connected_proxy")); - } - // And then also for their old UUID -- ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() ); -- if ( oldID != null ) -- { -+ final ProxiedPlayer oldID = bungee.getPlayer(getUniqueId()); -+ if (oldID != null) { - // TODO See #1218 -- oldID.disconnect( bungee.getTranslation( "already_connected_proxy" ) ); -+ oldID.disconnect(bungee.getTranslation("already_connected_proxy")); - } -- } else -- { -+ } else { - // In offline mode the existing user stays and we kick the new one -- ProxiedPlayer oldName = bungee.getPlayer( getName() ); -- if ( oldName != null ) -- { -+ final ProxiedPlayer oldName = bungee.getPlayer(getName()); -+ if (oldName != null) { - // TODO See #1218 -- disconnect( bungee.getTranslation( "already_connected_proxy" ) ); -+ disconnect(bungee.getTranslation("already_connected_proxy")); - return; - } - - } - -- offlineId = UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + getName() ).getBytes( Charsets.UTF_8 ) ); -- if ( uniqueId == null ) -- { -+ offlineId = UUID.nameUUIDFromBytes(("OfflinePlayer:" + getName()).getBytes(Charsets.UTF_8)); -+ if (uniqueId == null) { - uniqueId = offlineId; - } - -- Callback complete = new Callback() -- { -+ final Callback complete = new Callback() { - @Override -- public void done(LoginEvent result, Throwable error) -- { -- if ( result.isCancelled() ) -- { -- disconnect( result.getCancelReasonComponents() ); -+ public void done(final LoginEvent result, final Throwable error) { -+ if (result.isCancelled()) { -+ disconnect(result.getCancelReasonComponents()); - return; - } -- if ( ch.isClosed() ) -- { -+ if (ch.isClosed()) { - return; - } - -- ch.getHandle().eventLoop().execute( new Runnable() -- { -+ ch.getHandle().eventLoop().execute(new Runnable() { - @Override -- public void run() -- { -- if ( !ch.isClosing() ) -- { -- UserConnection userCon = new UserConnection( bungee, ch, getName(), InitialHandler.this ); -- userCon.setCompressionThreshold( BungeeCord.getInstance().config.getCompressionThreshold() ); -+ public void run() { -+ if (!ch.isClosing()) { -+ final UserConnection userCon = new UserConnection(bungee, ch, getName(), -+ InitialHandler.this); -+ userCon.setCompressionThreshold(BungeeCord.getInstance().config.getCompressionThreshold()); - userCon.init(); - -- unsafe.sendPacket( new LoginSuccess( getUniqueId(), getName() ) ); -- ch.setProtocol( Protocol.GAME ); -+ unsafe.sendPacket(new LoginSuccess(getUniqueId(), getName())); -+ ch.setProtocol(Protocol.GAME); - -- ch.getHandle().pipeline().get( HandlerBoss.class ).setHandler( new UpstreamBridge( bungee, userCon ) ); -- bungee.getPluginManager().callEvent( new PostLoginEvent( userCon ) ); -+ ch.getHandle().pipeline().get(HandlerBoss.class) -+ .setHandler(new UpstreamBridge(bungee, userCon)); -+ bungee.getPluginManager().callEvent(new PostLoginEvent(userCon)); - ServerInfo server; -- if ( bungee.getReconnectHandler() != null ) -- { -- server = bungee.getReconnectHandler().getServer( userCon ); -- } else -- { -- server = AbstractReconnectHandler.getForcedHost( InitialHandler.this ); -+ if (bungee.getReconnectHandler() != null) { -+ server = bungee.getReconnectHandler().getServer(userCon); -+ } else { -+ server = AbstractReconnectHandler.getForcedHost(InitialHandler.this); - } -- if ( server == null ) -- { -- server = bungee.getServerInfo( listener.getDefaultServer() ); -+ if (server == null) { -+ server = bungee.getServerInfo(listener.getDefaultServer()); - } - -- userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); -+ userCon.connect(server, null, true, ServerConnectEvent.Reason.JOIN_PROXY); - -- thisState = State.FINISHED; -+ // FlameCord - Move state declaration -+ // thisState = State.FINISHED; - } - } -- } ); -+ }); - } - }; - - // fire login event -- bungee.getPluginManager().callEvent( new LoginEvent( InitialHandler.this, complete, this.getLoginProfile() ) ); // Waterfall: Parse LoginResult object to new constructor of LoginEvent -+ bungee.getPluginManager().callEvent(new LoginEvent(InitialHandler.this, complete, this.getLoginProfile())); // Waterfall: -+ // Parse -+ // LoginResult -+ // object -+ // to -+ // new -+ // constructor -+ // of -+ // LoginEvent - } - - @Override -- public void handle(LoginPayloadResponse response) throws Exception -- { -- disconnect( "Unexpected custom LoginPayloadResponse" ); -+ public void handle(final LoginPayloadResponse response) throws Exception { -+ disconnect("Unexpected custom LoginPayloadResponse"); - } - - @Override -- public void disconnect(String reason) -- { -- if ( canSendKickMessage() ) -- { -- disconnect( TextComponent.fromLegacyText( reason ) ); -- } else -- { -+ public void disconnect(final String reason) { -+ if (canSendKickMessage()) { -+ disconnect(TextComponent.fromLegacyText(reason)); -+ } else { - ch.close(); - } - } - - @Override -- public void disconnect(final BaseComponent... reason) -- { -- if ( canSendKickMessage() ) -- { -- ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) ); -- } else -- { -+ public void disconnect(final BaseComponent... reason) { -+ if (canSendKickMessage()) { -+ // FlameCord start - Changed delayed close to just close -+ ch.close(new Kick(ComponentSerializer.toString(reason))); -+ } else { - ch.close(); - } - } - - @Override -- public void disconnect(BaseComponent reason) -- { -- disconnect( new BaseComponent[] -- { -- reason -- } ); -+ public void disconnect(final BaseComponent reason) { -+ disconnect(new BaseComponent[] { reason }); - } - - @Override -- public String getName() -- { -- return ( name != null ) ? name : ( loginRequest == null ) ? null : loginRequest.getData(); -+ public String getName() { -+ return (name != null) ? name : (loginRequest == null) ? null : loginRequest.getData(); - } - - @Override -- public int getVersion() -- { -- return ( handshake == null ) ? -1 : handshake.getProtocolVersion(); -+ public int getVersion() { -+ return (handshake == null) ? -1 : handshake.getProtocolVersion(); - } - - @Override -- public InetSocketAddress getAddress() -- { -+ public InetSocketAddress getAddress() { - return (InetSocketAddress) getSocketAddress(); - } - - @Override -- public SocketAddress getSocketAddress() -- { -+ public SocketAddress getSocketAddress() { - return ch.getRemoteAddress(); - } - - @Override -- public Unsafe unsafe() -- { -+ public Unsafe unsafe() { - return unsafe; - } - - @Override -- public void setOnlineMode(boolean onlineMode) -- { -- Preconditions.checkState( thisState == State.USERNAME, "Can only set online mode status whilst state is username" ); -+ public void setOnlineMode(final boolean onlineMode) { -+ Preconditions.checkState(thisState == State.USERNAME, -+ "Can only set online mode status whilst state is username"); - this.onlineMode = onlineMode; - } - - @Override -- public void setUniqueId(UUID uuid) -- { -- Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); -- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); -+ public void setUniqueId(final UUID uuid) { -+ Preconditions.checkState(thisState == State.USERNAME, "Can only set uuid while state is username"); -+ // FlameCord - Allow custom uuids -+ // Preconditions.checkState(!onlineMode, "Can only set uuid when online mode is -+ // false"); - this.uniqueId = uuid; - } - - @Override -- public String getUUID() -- { -- return io.github.waterfallmc.waterfall.utils.UUIDUtils.undash( uniqueId.toString() ); // Waterfall -+ public String getUUID() { -+ return io.github.waterfallmc.waterfall.utils.UUIDUtils.undash(uniqueId.toString()); // Waterfall - } - - @Override -- public String toString() -- { -- return "[" + getSocketAddress() + ( getName() != null ? "|" + getName() : "" ) + "] <-> InitialHandler"; -+ public String toString() { -+ return "[" + getSocketAddress() + (getName() != null ? "|" + getName() : "") + "] <-> InitialHandler"; - } - - @Override -- public boolean isConnected() -- { -+ public boolean isConnected() { - return !ch.isClosed(); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071..22c9f19a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -1,7 +1,10 @@ - package net.md_5.bungee.connection; - - import com.google.gson.Gson; -+ -+import dev._2lstudios.flamecord.FlameCord; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -+import io.netty.channel.ChannelPipeline; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.BungeeServerInfo; -@@ -12,6 +15,7 @@ import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.MinecraftEncoder; - import net.md_5.bungee.protocol.PacketWrapper; -@@ -21,11 +25,9 @@ import net.md_5.bungee.protocol.packet.Handshake; - import net.md_5.bungee.protocol.packet.StatusRequest; - import net.md_5.bungee.protocol.packet.StatusResponse; - import net.md_5.bungee.util.BufUtil; --import net.md_5.bungee.util.QuietException; - - @RequiredArgsConstructor --public class PingHandler extends PacketHandler --{ -+public class PingHandler extends PacketHandler { - - private final ServerInfo target; - private final Callback callback; -@@ -33,49 +35,54 @@ public class PingHandler extends PacketHandler - private ChannelWrapper channel; - - @Override -- public void connected(ChannelWrapper channel) throws Exception -- { -+ public void connected(ChannelWrapper channel) throws Exception { - this.channel = channel; -- MinecraftEncoder encoder = new MinecraftEncoder( Protocol.HANDSHAKE, false, protocol ); -+ final MinecraftEncoder encoder = new MinecraftEncoder(Protocol.HANDSHAKE, false, protocol); -+ final ChannelPipeline pipeline = channel.getHandle().pipeline(); - -- channel.getHandle().pipeline().addAfter( PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, new MinecraftDecoder( Protocol.STATUS, false, ProxyServer.getInstance().getProtocolVersion() ) ); -- channel.getHandle().pipeline().addAfter( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, encoder ); -+ pipeline.addAfter(PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, -+ new MinecraftDecoder(Protocol.STATUS, false, ProxyServer.getInstance().getProtocolVersion())); -+ pipeline.addAfter(PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, encoder); - -- channel.write( new Handshake( protocol, target.getAddress().getHostString(), target.getAddress().getPort(), 1 ) ); -+ channel.write(new Handshake(protocol, target.getAddress().getHostString(), target.getAddress().getPort(), 1)); - -- encoder.setProtocol( Protocol.STATUS ); -- channel.write( new StatusRequest() ); -+ encoder.setProtocol(Protocol.STATUS); -+ channel.write(new StatusRequest()); - } - - @Override -- public void exception(Throwable t) throws Exception -- { -- callback.done( null, t ); -+ public void exception(Throwable t) throws Exception { -+ callback.done(null, t); - } - - @Override -- public void handle(PacketWrapper packet) throws Exception -- { -- if ( packet.packet == null ) -- { -- throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); -+ public void handle(PacketWrapper packet) throws Exception { -+ if (packet.packet == null) { -+ // FlameCord - Toggle Dumping packet info -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( -+ "Unexpected packet received during server ping process!\n" + BufUtil.dump(packet.buf, 16)); -+ } else { -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException("Unexpected packet received during ping process!"); -+ } - } - } - - @Override - @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") -- public void handle(StatusResponse statusResponse) throws Exception -- { -- Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine -- ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class ); -- ( (BungeeServerInfo) target ).cachePing( serverPing ); -- callback.done( serverPing, null ); -+ public void handle(StatusResponse statusResponse) throws Exception { -+ Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy -+ : BungeeCord.getInstance().gson; // Travertine -+ ServerPing serverPing = gson.fromJson(statusResponse.getResponse(), ServerPing.class); -+ ((BungeeServerInfo) target).cachePing(serverPing); -+ callback.done(serverPing, null); - channel.close(); - } - - @Override -- public String toString() -- { -+ public String toString() { - return "[Ping Handler] -> " + target.getName(); - } - } -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 ad3bdee5..5f83df32 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 -@@ -34,151 +34,131 @@ import net.md_5.bungee.protocol.packet.PluginMessage; - import net.md_5.bungee.protocol.packet.TabCompleteRequest; - import net.md_5.bungee.protocol.packet.TabCompleteResponse; - --public class UpstreamBridge extends PacketHandler --{ -+public class UpstreamBridge extends PacketHandler { - - private final ProxyServer bungee; - private final UserConnection con; - - private long lastTabCompletion = -1; - -- public UpstreamBridge(ProxyServer bungee, UserConnection con) -- { -+ public UpstreamBridge(ProxyServer bungee, UserConnection con) { - this.bungee = bungee; - this.con = con; - -- BungeeCord.getInstance().addConnection( con ); -+ BungeeCord.getInstance().addConnection(con); - con.getTabListHandler().onConnect(); -- con.unsafe().sendPacket( BungeeCord.getInstance().registerChannels( con.getPendingConnection().getVersion() ) ); -+ con.unsafe().sendPacket(BungeeCord.getInstance().registerChannels(con.getPendingConnection().getVersion())); - } - - @Override -- public void exception(Throwable t) throws Exception -- { -- con.disconnect( Util.exception( t ) ); -+ public void exception(Throwable t) throws Exception { -+ con.disconnect(Util.exception(t)); - } - - @Override -- public void disconnected(ChannelWrapper channel) throws Exception -- { -+ public void disconnected(ChannelWrapper channel) throws Exception { - // We lost connection to the client -- PlayerDisconnectEvent event = new PlayerDisconnectEvent( con ); -- bungee.getPluginManager().callEvent( event ); -+ PlayerDisconnectEvent event = new PlayerDisconnectEvent(con); -+ bungee.getPluginManager().callEvent(event); - con.getTabListHandler().onDisconnect(); -- BungeeCord.getInstance().removeConnection( con ); -+ BungeeCord.getInstance().removeConnection(con); - -- if ( con.getServer() != null ) -- { -+ if (con.getServer() != null) { - // Manually remove from everyone's tab list - // since the packet from the server arrives - // too late - // TODO: This should only done with server_unique -- // tab list (which is the only one supported -- // currently) -+ // tab list (which is the only one supported -+ // currently) - PlayerListItem packet = new PlayerListItem(); -- packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); -+ packet.setAction(PlayerListItem.Action.REMOVE_PLAYER); - PlayerListItem.Item item = new PlayerListItem.Item(); -- item.setUuid( con.getUniqueId() ); -- packet.setItems( new PlayerListItem.Item[] -- { -- item -- } ); -- for ( ProxiedPlayer player : con.getServer().getInfo().getPlayers() ) -- { -+ item.setUuid(con.getUniqueId()); -+ packet.setItems(new PlayerListItem.Item[] { item }); -+ for (ProxiedPlayer player : con.getServer().getInfo().getPlayers()) { - // Travertine start -- if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -- { -- player.unsafe().sendPacket( packet ); -+ if (ProtocolConstants.isAfterOrEq(player.getPendingConnection().getVersion(), -+ ProtocolConstants.MINECRAFT_1_8)) { -+ player.unsafe().sendPacket(packet); - } - // Travertine end - } -- con.getServer().disconnect( "Quitting" ); -+ -+ // FlameCord - Remove "Quitting" reason -+ con.getServer().disconnect(); - } - } - - @Override -- public void writabilityChanged(ChannelWrapper channel) throws Exception -- { -- if ( con.getServer() != null ) -- { -+ public void writabilityChanged(ChannelWrapper channel) throws Exception { -+ if (con.getServer() != null) { - Channel server = con.getServer().getCh().getHandle(); -- if ( channel.getHandle().isWritable() ) -- { -- server.config().setAutoRead( true ); -- } else -- { -- server.config().setAutoRead( false ); -+ if (channel.getHandle().isWritable()) { -+ server.config().setAutoRead(true); -+ } else { -+ server.config().setAutoRead(false); - } - } - } - - @Override -- public boolean shouldHandle(PacketWrapper packet) throws Exception -- { -+ public boolean shouldHandle(PacketWrapper packet) throws Exception { - return con.getServer() != null || packet.packet instanceof PluginMessage; - } - - @Override -- public void handle(PacketWrapper packet) throws Exception -- { -- if ( con.getServer() != null ) -- { -+ public void handle(PacketWrapper packet) throws Exception { -+ if (con.getServer() != null) { - EntityMap rewrite = con.getEntityRewrite(); -- if ( rewrite != null ) -- { -- rewrite.rewriteServerbound( packet.buf, con.getClientEntityId(), con.getServerEntityId(), con.getPendingConnection().getVersion() ); -+ if (rewrite != null) { -+ rewrite.rewriteServerbound(packet.buf, con.getClientEntityId(), con.getServerEntityId(), -+ con.getPendingConnection().getVersion()); - } -- con.getServer().getCh().write( packet ); -+ con.getServer().getCh().write(packet); - } - } - - @Override -- public void handle(KeepAlive alive) throws Exception -- { -+ public void handle(KeepAlive alive) throws Exception { - KeepAliveData keepAliveData = con.getServer().getKeepAlives().peek(); -- -- if ( keepAliveData != null && alive.getRandomId() == keepAliveData.getId() ) -- { -- Preconditions.checkState( keepAliveData == con.getServer().getKeepAlives().poll(), "keepalive queue mismatch" ); -- int newPing = (int) ( System.currentTimeMillis() - keepAliveData.getTime() ); -- con.getTabListHandler().onPingChange( newPing ); -- con.setPing( newPing ); -- } else -- { -+ if (keepAliveData != null && alive.getRandomId() == keepAliveData.getId()) { -+ Preconditions.checkState(keepAliveData == con.getServer().getKeepAlives().poll(), -+ "keepalive queue mismatch"); -+ int newPing = (int) (System.currentTimeMillis() - keepAliveData.getTime()); -+ con.getTabListHandler().onPingChange(newPing); -+ con.setPing(newPing); -+ } else { - throw CancelSendSignal.INSTANCE; - } - } - - @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 -+ 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"); - -- ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() ); -- if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) -- { -- chat.setMessage( chatEvent.getMessage() ); -- if ( !chatEvent.isCommand() || !bungee.getPluginManager().dispatchCommand( con, chat.getMessage().substring( 1 ) ) ) -- { -- con.getServer().unsafe().sendPacket( chat ); -+ ChatEvent chatEvent = new ChatEvent(con, con.getServer(), chat.getMessage()); -+ if (!bungee.getPluginManager().callEvent(chatEvent).isCancelled()) { -+ chat.setMessage(chatEvent.getMessage()); -+ if (!chatEvent.isCommand() -+ || !bungee.getPluginManager().dispatchCommand(con, chat.getMessage().substring(1))) { -+ con.getServer().unsafe().sendPacket(chat); - } - } - throw CancelSendSignal.INSTANCE; - } - - @Override -- public void handle(TabCompleteRequest tabComplete) throws Exception -- { -+ public void handle(TabCompleteRequest tabComplete) throws Exception { - // Waterfall start - tab limiter -- if ( bungee.getConfig().getTabThrottle() > 0 && -- ( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 -- && !bungee.getConfig().isDisableModernTabLimiter())) -- { -+ if (bungee.getConfig().getTabThrottle() > 0 -+ && (con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 -+ && !bungee.getConfig().isDisableModernTabLimiter())) { - long now = System.currentTimeMillis(); -- if ( lastTabCompletion > 0 && (now - lastTabCompletion) <= bungee.getConfig().getTabThrottle() ) -- { -+ if (lastTabCompletion > 0 && (now - lastTabCompletion) <= bungee.getConfig().getTabThrottle()) { - throw CancelSendSignal.INSTANCE; - } - lastTabCompletion = now; -@@ -187,102 +167,93 @@ public class UpstreamBridge extends PacketHandler - // Waterfall end - tab limiter - List suggestions = new ArrayList<>(); - -- if ( tabComplete.getCursor().startsWith( "/" ) ) -- { -- bungee.getPluginManager().dispatchCommand( con, tabComplete.getCursor().substring( 1 ), suggestions ); -+ if (tabComplete.getCursor().startsWith("/")) { -+ bungee.getPluginManager().dispatchCommand(con, tabComplete.getCursor().substring(1), suggestions); - } - -- TabCompleteEvent tabCompleteEvent = new TabCompleteEvent( con, con.getServer(), tabComplete.getCursor(), suggestions ); -- bungee.getPluginManager().callEvent( tabCompleteEvent ); -+ TabCompleteEvent tabCompleteEvent = new TabCompleteEvent(con, con.getServer(), tabComplete.getCursor(), -+ suggestions); -+ bungee.getPluginManager().callEvent(tabCompleteEvent); - -- if ( tabCompleteEvent.isCancelled() ) -- { -+ if (tabCompleteEvent.isCancelled()) { - throw CancelSendSignal.INSTANCE; - } - - List results = tabCompleteEvent.getSuggestions(); -- if ( !results.isEmpty() ) -- { -- // Unclear how to handle 1.13 commands at this point. Because we don't inject into the command packets we are unlikely to get this far unless -+ if (!results.isEmpty()) { -+ // Unclear how to handle 1.13 commands at this point. Because we don't inject -+ // into the command packets we are unlikely to get this far unless - // Bungee plugins are adding results for commands they don't own anyway -- if ( con.getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_13 ) -- { -- con.unsafe().sendPacket( new TabCompleteResponse( results ) ); -- } else -- { -- int start = tabComplete.getCursor().lastIndexOf( ' ' ) + 1; -+ if (con.getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_13) { -+ con.unsafe().sendPacket(new TabCompleteResponse(results)); -+ } else { -+ int start = tabComplete.getCursor().lastIndexOf(' ') + 1; - int end = tabComplete.getCursor().length(); -- StringRange range = StringRange.between( start, end ); -+ StringRange range = StringRange.between(start, end); - - List brigadier = new LinkedList<>(); -- for ( String s : results ) -- { -- brigadier.add( new Suggestion( range, s ) ); -+ for (String s : results) { -+ brigadier.add(new Suggestion(range, s)); - } - -- con.unsafe().sendPacket( new TabCompleteResponse( tabComplete.getTransactionId(), new Suggestions( range, brigadier ) ) ); -+ con.unsafe().sendPacket( -+ new TabCompleteResponse(tabComplete.getTransactionId(), new Suggestions(range, brigadier))); - } - throw CancelSendSignal.INSTANCE; - } - } - - @Override -- public void handle(ClientSettings settings) throws Exception -- { -- con.setSettings( settings ); -+ public void handle(ClientSettings settings) throws Exception { -+ con.setSettings(settings); - -- SettingsChangedEvent settingsEvent = new SettingsChangedEvent( con ); -- bungee.getPluginManager().callEvent( settingsEvent ); -+ SettingsChangedEvent settingsEvent = new SettingsChangedEvent(con); -+ bungee.getPluginManager().callEvent(settingsEvent); - } - - @Override -- public void handle(PluginMessage pluginMessage) throws Exception -- { -- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) -- { -+ public void handle(PluginMessage pluginMessage) throws Exception { -+ if (pluginMessage.getTag().equals("BungeeCord")) { - throw CancelSendSignal.INSTANCE; - } - -- if ( BungeeCord.getInstance().config.isForgeSupport() ) -- { -+ if (BungeeCord.getInstance().config.isForgeSupport()) { - // Hack around Forge race conditions -- if ( pluginMessage.getTag().equals( "FML" ) && pluginMessage.getStream().readUnsignedByte() == 1 ) -- { -+ if (pluginMessage.getTag().equals("FML") && pluginMessage.getStream().readUnsignedByte() == 1) { - throw CancelSendSignal.INSTANCE; - } - - // We handle forge handshake messages if forge support is enabled. -- if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) ) -- { -+ if (pluginMessage.getTag().equals(ForgeConstants.FML_HANDSHAKE_TAG)) { - // Let our forge client handler deal with this packet. -- con.getForgeClientHandler().handle( pluginMessage ); -+ con.getForgeClientHandler().handle(pluginMessage); - throw CancelSendSignal.INSTANCE; - } - -- if ( con.getServer() != null && !con.getServer().isForgeServer() && pluginMessage.getData().length > Short.MAX_VALUE ) -- { -- // Drop the packet if the server is not a Forge server and the message was > 32kiB (as suggested by @jk-5) -- // Do this AFTER the mod list, so we get that even if the intial server isn't modded. -+ if (con.getServer() != null && !con.getServer().isForgeServer() -+ && pluginMessage.getData().length > Short.MAX_VALUE) { -+ // Drop the packet if the server is not a Forge server and the message was > -+ // 32kiB (as suggested by @jk-5) -+ // Do this AFTER the mod list, so we get that even if the intial server isn't -+ // modded. - throw CancelSendSignal.INSTANCE; - } - } - -- PluginMessageEvent event = new PluginMessageEvent( con, con.getServer(), pluginMessage.getTag(), pluginMessage.getData().clone() ); -- if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) -- { -+ PluginMessageEvent event = new PluginMessageEvent(con, con.getServer(), pluginMessage.getTag(), -+ pluginMessage.getData().clone()); -+ if (bungee.getPluginManager().callEvent(event).isCancelled()) { - throw CancelSendSignal.INSTANCE; - } - - // TODO: Unregister as well? -- if ( PluginMessage.SHOULD_RELAY.apply( pluginMessage ) ) -- { -- con.getPendingConnection().getRelayMessages().add( pluginMessage ); -+ if (PluginMessage.SHOULD_RELAY.apply(pluginMessage)) { -+ con.getPendingConnection().getRelayMessages().add(pluginMessage); - } - } - - @Override -- public String toString() -- { -+ public String toString() { - return "[" + con.getAddress() + "|" + con.getName() + "] -> UpstreamBridge"; - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpClient.java b/proxy/src/main/java/net/md_5/bungee/http/HttpClient.java -index 37337429..1cdf979c 100644 ---- a/proxy/src/main/java/net/md_5/bungee/http/HttpClient.java -+++ b/proxy/src/main/java/net/md_5/bungee/http/HttpClient.java -@@ -23,33 +23,30 @@ import net.md_5.bungee.api.Callback; - import net.md_5.bungee.netty.PipelineUtils; - - @NoArgsConstructor(access = AccessLevel.PRIVATE) --public class HttpClient --{ -+public class HttpClient { - - public static final int TIMEOUT = 5000; -- private static final Cache addressCache = CacheBuilder.newBuilder().expireAfterWrite( 1, TimeUnit.MINUTES ).build(); -+ private static final Cache addressCache = CacheBuilder.newBuilder() -+ .expireAfterWrite(1, TimeUnit.MINUTES).build(); - // Waterfall Start - optionally use async resolver from Netty -- private static final io.netty.resolver.dns.DnsAddressResolverGroup dnsResolverGroup = -- new io.netty.resolver.dns.DnsAddressResolverGroup(PipelineUtils.getDatagramChannel(), io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider.INSTANCE); -+ private static final io.netty.resolver.dns.DnsAddressResolverGroup dnsResolverGroup = new io.netty.resolver.dns.DnsAddressResolverGroup( -+ PipelineUtils.getDatagramChannel(), io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider.INSTANCE); - // Waterfall End - - @SuppressWarnings("UnusedAssignment") -- public static void get(String url, EventLoop eventLoop, final Callback callback) -- { -- Preconditions.checkNotNull( url, "url" ); -- Preconditions.checkNotNull( eventLoop, "eventLoop" ); -- Preconditions.checkNotNull( callback, "callBack" ); -+ public static void get(String url, EventLoop eventLoop, final Callback callback) { -+ Preconditions.checkNotNull(url, "url"); -+ Preconditions.checkNotNull(eventLoop, "eventLoop"); -+ Preconditions.checkNotNull(callback, "callBack"); - -- final URI uri = URI.create( url ); -+ final URI uri = URI.create(url); - -- Preconditions.checkNotNull( uri.getScheme(), "scheme" ); -- Preconditions.checkNotNull( uri.getHost(), "host" ); -- boolean ssl = uri.getScheme().equals( "https" ); -+ Preconditions.checkNotNull(uri.getScheme(), "scheme"); -+ Preconditions.checkNotNull(uri.getHost(), "host"); -+ boolean ssl = uri.getScheme().equals("https"); - int port = uri.getPort(); -- if ( port == -1 ) -- { -- switch ( uri.getScheme() ) -- { -+ if (port == -1) { -+ switch (uri.getScheme()) { - case "http": - port = 80; - break; -@@ -57,81 +54,82 @@ public class HttpClient - port = 443; - break; - default: -- throw new IllegalArgumentException( "Unknown scheme " + uri.getScheme() ); -+ throw new IllegalArgumentException("Unknown scheme " + uri.getScheme()); - } - } - - // Waterfall Start - Move address creation to implementation method -- //InetAddress inetHost = addressCache.getIfPresent( uri.getHost() ); -- //if ( inetHost == null ) -- //{ -- // try -- // { -- // inetHost = InetAddress.getByName( uri.getHost() ); -- // } catch ( UnknownHostException ex ) -- // { -- // callback.done( null, ex ); -- // return; -- // } -- // addressCache.put( uri.getHost(), inetHost ); -- //} -+ // InetAddress inetHost = addressCache.getIfPresent( uri.getHost() ); -+ // if ( inetHost == null ) -+ // { -+ // try -+ // { -+ // inetHost = InetAddress.getByName( uri.getHost() ); -+ // } catch ( UnknownHostException ex ) -+ // { -+ // callback.done( null, ex ); -+ // return; -+ // } -+ // addressCache.put( uri.getHost(), inetHost ); -+ // } - // Waterfall End - -- ChannelFutureListener future = new ChannelFutureListener() -- { -+ ChannelFutureListener future = new ChannelFutureListener() { - @Override -- public void operationComplete(ChannelFuture future) throws Exception -- { -- if ( future.isSuccess() ) -- { -- String path = uri.getRawPath() + ( ( uri.getRawQuery() == null ) ? "" : "?" + uri.getRawQuery() ); -+ public void operationComplete(ChannelFuture future) throws Exception { -+ if (future.isSuccess()) { -+ String path = uri.getRawPath() + ((uri.getRawQuery() == null) ? "" : "?" + uri.getRawQuery()); - -- HttpRequest request = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, path ); -- request.headers().set( HttpHeaderNames.HOST, uri.getHost() ); -+ HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, path); -+ request.headers().set(HttpHeaderNames.HOST, uri.getHost()); - -- future.channel().writeAndFlush( request ); -- } else -- { -- addressCache.invalidate( uri.getHost() ); -- callback.done( null, future.cause() ); -+ future.channel().writeAndFlush(request); -+ } else { -+ addressCache.invalidate(uri.getHost()); -+ callback.done(null, future.cause()); - } - } - }; - -- - // Waterfall Start - Optionally use Netty's async DNS Resolver - if (net.md_5.bungee.api.ProxyServer.getInstance().getConfig().isUseNettyDnsResolver()) { - getWithNettyResolver(eventLoop, uri, port, future, callback, ssl); - } else { - getWithDefaultResolver(eventLoop, uri, port, future, callback, ssl); - } -- //new Bootstrap().channel( PipelineUtils.getChannel() ).group( eventLoop ).handler( new HttpInitializer( callback, ssl, uri.getHost(), port ) ). -- // option( ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT ).remoteAddress( inetHost, port ).connect().addListener( future ); -+ // new Bootstrap().channel( PipelineUtils.getChannel() ).group( eventLoop -+ // ).handler( new HttpInitializer( callback, ssl, uri.getHost(), port ) ). -+ // option( ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT ).remoteAddress( -+ // inetHost, port ).connect().addListener( future ); - } - -- private static void getWithNettyResolver(EventLoop eventLoop, URI uri, int port, ChannelFutureListener future, Callback callback, boolean ssl) { -+ private static void getWithNettyResolver(EventLoop eventLoop, URI uri, int port, ChannelFutureListener future, -+ Callback callback, boolean ssl) { - java.net.InetSocketAddress address = java.net.InetSocketAddress.createUnresolved(uri.getHost(), port); -- new Bootstrap().channel( PipelineUtils.getChannel( null ) ).group( eventLoop ).handler( new HttpInitializer( callback, ssl, uri.getHost(), port ) ). -- option( ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT ).resolver(dnsResolverGroup).remoteAddress( address ).connect().addListener( future ); -+ new Bootstrap().channel(PipelineUtils.getChannel(null)).group(eventLoop) -+ .handler(new HttpInitializer(callback, ssl, uri.getHost(), port)) -+ .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT).resolver(dnsResolverGroup).remoteAddress(address) -+ .connect().addListener(future); - } - -- private static void getWithDefaultResolver(EventLoop eventLoop, URI uri, int port, ChannelFutureListener future, Callback callback, boolean ssl) { -- // This is identical to the Bungee implementation of #get other than the absence of the ChannelFutureListener creation -- InetAddress inetHost = addressCache.getIfPresent( uri.getHost() ); -- if ( inetHost == null ) -- { -- try -- { -- inetHost = InetAddress.getByName( uri.getHost() ); -- } catch ( UnknownHostException ex ) -- { -- callback.done( null, ex ); -+ private static void getWithDefaultResolver(EventLoop eventLoop, URI uri, int port, ChannelFutureListener future, -+ Callback callback, boolean ssl) { -+ // This is identical to the Bungee implementation of #get other than the absence -+ // of the ChannelFutureListener creation -+ InetAddress inetHost = addressCache.getIfPresent(uri.getHost()); -+ if (inetHost == null) { -+ try { -+ inetHost = InetAddress.getByName(uri.getHost()); -+ } catch (UnknownHostException ex) { -+ callback.done(null, ex); - return; - } -- addressCache.put( uri.getHost(), inetHost ); -+ addressCache.put(uri.getHost(), inetHost); - } -- new Bootstrap().channel( PipelineUtils.getChannel( null ) ).group( eventLoop ).handler( new HttpInitializer( callback, ssl, uri.getHost(), port ) ). -- option( ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT ).remoteAddress( inetHost, port ).connect().addListener( future ); -+ new Bootstrap().channel(PipelineUtils.getChannel(null)).group(eventLoop) -+ .handler(new HttpInitializer(callback, ssl, uri.getHost(), port)) -+ .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT).remoteAddress(inetHost, port).connect() -+ .addListener(future); - } - // Waterfall End - } -diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index b91981e6..f877c11d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -@@ -12,63 +12,50 @@ import lombok.RequiredArgsConstructor; - import net.md_5.bungee.api.Callback; - - @RequiredArgsConstructor --public class HttpHandler extends SimpleChannelInboundHandler --{ -+public class HttpHandler extends SimpleChannelInboundHandler { - - private final Callback callback; - private final StringBuilder buffer = new StringBuilder(640); - - @Override -- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception -- { -- try -- { -- callback.done( null, cause ); -- } finally -- { -- ctx.channel().close(); -+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { -+ try { -+ callback.done(null, cause); -+ } finally { -+ ctx.close(); - } - } - - @Override -- protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception -- { -- if ( msg instanceof HttpResponse ) -- { -+ protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception { -+ if (msg instanceof HttpResponse) { - HttpResponse response = (HttpResponse) msg; - int responseCode = response.status().code(); - -- if ( responseCode == HttpResponseStatus.NO_CONTENT.code() ) -- { -- done( ctx ); -+ if (responseCode == HttpResponseStatus.NO_CONTENT.code()) { -+ done(ctx); - return; - } - -- if ( responseCode != HttpResponseStatus.OK.code() ) -- { -- throw new IllegalStateException( "Expected HTTP response 200 OK, got " + response.status() ); -+ if (responseCode != HttpResponseStatus.OK.code()) { -+ throw new IllegalStateException("Expected HTTP response 200 OK, got " + response.status()); - } - } -- if ( msg instanceof HttpContent ) -- { -+ if (msg instanceof HttpContent) { - HttpContent content = (HttpContent) msg; -- buffer.append( content.content().toString( Charset.forName( "UTF-8" ) ) ); -+ buffer.append(content.content().toString(Charset.forName("UTF-8"))); - -- if ( msg instanceof LastHttpContent ) -- { -- done( ctx ); -+ if (msg instanceof LastHttpContent) { -+ done(ctx); - } - } - } - -- private void done(ChannelHandlerContext ctx) -- { -- try -- { -- callback.done( buffer.toString(), null ); -- } finally -- { -- ctx.channel().close(); -+ private void done(ChannelHandlerContext ctx) { -+ try { -+ callback.done(buffer.toString(), null); -+ } finally { -+ ctx.close(); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java -index 8c5cc949..de83bb2c 100644 ---- a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java -+++ b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java -@@ -21,131 +21,109 @@ import net.md_5.bungee.util.CaseInsensitiveMap; - import org.yaml.snakeyaml.DumperOptions; - import org.yaml.snakeyaml.Yaml; - --public class ModuleManager --{ -+public class ModuleManager { - - private final Map knownSources = new HashMap<>(); - -- public ModuleManager() -- { -- knownSources.put( "jenkins", new JenkinsModuleSource() ); -+ public ModuleManager() { -+ knownSources.put("jenkins", new JenkinsModuleSource()); - } - -- @SuppressFBWarnings( -- { -- "SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT" -- }) -- public void load(ProxyServer proxy, File moduleDirectory) throws Exception -- { -+ @SuppressFBWarnings({ "SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT" }) -+ public void load(ProxyServer proxy, File moduleDirectory) throws Exception { - moduleDirectory.mkdir(); - -- ModuleVersion bungeeVersion = ModuleVersion.parse( proxy.getVersion() ); -- if ( bungeeVersion == null ) -- { -- proxy.getLogger().warning( "Couldn't detect bungee version. Custom build?" ); // Waterfall - Use logger -+ ModuleVersion bungeeVersion = ModuleVersion.parse(proxy.getVersion()); -+ if (bungeeVersion == null) { -+ proxy.getLogger().warning("Couldn't detect bungee version. Custom build?"); // Waterfall - Use logger - return; - } - - List modules = new ArrayList<>(); -- File configFile = new File( "modules.yml" ); -+ File configFile = new File("modules.yml"); - // Start Yaml - DumperOptions options = new DumperOptions(); -- options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK ); -- Yaml yaml = new Yaml( options ); -+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); -+ Yaml yaml = new Yaml(options); - - Map config; - - configFile.createNewFile(); -- try ( InputStream is = new FileInputStream( configFile ) ) -- { -- config = (Map) yaml.load( is ); -+ try (InputStream is = new FileInputStream(configFile)) { -+ config = (Map) yaml.load(is); - } - -- if ( config == null ) -- { -+ if (config == null) { - config = new CaseInsensitiveMap<>(); -- } else -- { -- config = new CaseInsensitiveMap<>( config ); -+ } else { -+ config = new CaseInsensitiveMap<>(config); - } - // End yaml - - List defaults = new ArrayList<>(); -- Object readModules = config.get( "modules" ); -- if ( readModules != null ) -- { -- defaults.addAll( (Collection) readModules ); -+ Object readModules = config.get("modules"); -+ if (readModules != null) { -+ defaults.addAll((Collection) readModules); - } -- int version = ( config.containsKey( "version" ) ) ? (int) config.get( "version" ) : 0; -- switch ( version ) -- { -+ int version = (config.containsKey("version")) ? (int) config.get("version") : 0; -+ switch (version) { - case 0: -- defaults.add( "jenkins://cmd_alert" ); -- defaults.add( "jenkins://cmd_find" ); -- defaults.add( "jenkins://cmd_list" ); -- defaults.add( "jenkins://cmd_send" ); -- defaults.add( "jenkins://cmd_server" ); -+ defaults.add("jenkins://cmd_alert"); -+ defaults.add("jenkins://cmd_find"); -+ defaults.add("jenkins://cmd_list"); -+ defaults.add("jenkins://cmd_send"); -+ defaults.add("jenkins://cmd_server"); - case 1: -- defaults.add( "jenkins://reconnect_yaml" ); -+ defaults.add("jenkins://reconnect_yaml"); - } -- config.put( "modules", defaults ); -- config.put( "version", 2 ); -+ config.put("modules", defaults); -+ config.put("version", 2); - -- try ( FileWriter wr = new FileWriter( configFile ) ) -- { -- yaml.dump( config, wr ); -+ try (FileWriter wr = new FileWriter(configFile)) { -+ yaml.dump(config, wr); - } - -- for ( String s : (List) config.get( "modules" ) ) -- { -- URI uri = new URI( s ); -+ for (String s : (List) config.get("modules")) { -+ URI uri = new URI(s); - -- ModuleSource source = knownSources.get( uri.getScheme() ); -- if ( source == null ) -- { -- System.out.println( "Unknown module source: " + s ); -+ ModuleSource source = knownSources.get(uri.getScheme()); -+ if (source == null) { -+ System.out.println("Unknown module source: " + s); - continue; - } - String name = uri.getAuthority(); -- if ( name == null ) -- { -- System.out.println( "Unknown module host: " + s ); -+ if (name == null) { -+ System.out.println("Unknown module host: " + s); - continue; - } - -- ModuleSpec spec = new ModuleSpec( name, new File( moduleDirectory, name + ".jar" ), source ); -- modules.add( spec ); -- System.out.println( "Discovered module: " + spec ); -+ ModuleSpec spec = new ModuleSpec(name, new File(moduleDirectory, name + ".jar"), source); -+ modules.add(spec); -+ System.out.println("Discovered module: " + spec); - } - -- for ( ModuleSpec module : modules ) -- { -- ModuleVersion moduleVersion = ( module.getFile().exists() ) ? getVersion( module.getFile() ) : null; -+ for (ModuleSpec module : modules) { -+ ModuleVersion moduleVersion = (module.getFile().exists()) ? getVersion(module.getFile()) : null; - -- if ( !bungeeVersion.equals( moduleVersion ) ) -- { -- System.out.println( "Attempting to update plugin from " + moduleVersion + " to " + bungeeVersion ); -- module.getProvider().retrieve( module, bungeeVersion ); -+ if (!bungeeVersion.equals(moduleVersion)) { -+ System.out.println("Attempting to update plugin from " + moduleVersion + " to " + bungeeVersion); -+ module.getProvider().retrieve(module, bungeeVersion); - } - } - } - - @SuppressFBWarnings("REC_CATCH_EXCEPTION") -- private ModuleVersion getVersion(File file) -- { -- try ( JarFile jar = new JarFile( file ) ) -- { -- JarEntry pdf = jar.getJarEntry( "plugin.yml" ); -- Preconditions.checkNotNull( pdf, "Plugin must have a plugin.yml" ); -- -- try ( InputStream in = jar.getInputStream( pdf ) ) -- { -- PluginDescription desc = new Yaml().loadAs( in, PluginDescription.class ); -- return ModuleVersion.parse( desc.getVersion() ); -+ private ModuleVersion getVersion(File file) { -+ try (JarFile jar = new JarFile(file)) { -+ JarEntry pdf = jar.getJarEntry("plugin.yml"); -+ Preconditions.checkNotNull(pdf, "Plugin must have a plugin.yml"); -+ -+ try (InputStream in = jar.getInputStream(pdf)) { -+ PluginDescription desc = new Yaml().loadAs(in, PluginDescription.class); -+ return ModuleVersion.parse(desc.getVersion()); - } -- } catch ( Exception ex ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not check module from file " + file, ex ); -+ } catch (Exception ex) { -+ ProxyServer.getInstance().getLogger().log(Level.WARNING, "Could not check module from file " + file, ex); - } - - return null; -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..b2e84bd6 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -5,6 +5,8 @@ import io.netty.channel.Channel; - import io.netty.channel.ChannelFutureListener; - import io.netty.channel.ChannelHandler; - import io.netty.channel.ChannelHandlerContext; -+import io.netty.channel.ChannelPipeline; -+ - import java.net.SocketAddress; - import java.util.concurrent.TimeUnit; - import lombok.Getter; -@@ -17,8 +19,7 @@ import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.Protocol; - import net.md_5.bungee.protocol.packet.Kick; - --public class ChannelWrapper --{ -+public class ChannelWrapper { - - private final Channel ch; - @Getter -@@ -29,120 +30,110 @@ public class ChannelWrapper - @Getter - private volatile boolean closing; - -- public ChannelWrapper(ChannelHandlerContext ctx) -- { -+ public ChannelWrapper(ChannelHandlerContext ctx) { - this.ch = ctx.channel(); -- this.remoteAddress = ( this.ch.remoteAddress() == null ) ? this.ch.parent().localAddress() : this.ch.remoteAddress(); -+ this.remoteAddress = (this.ch.remoteAddress() == null) ? this.ch.parent().localAddress() -+ : this.ch.remoteAddress(); - } - -- public void setProtocol(Protocol protocol) -- { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); -+ public void setProtocol(Protocol protocol) { -+ // FlameCord - Create pipeline object to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ -+ pipeline.get(MinecraftDecoder.class).setProtocol(protocol); -+ pipeline.get(MinecraftEncoder.class).setProtocol(protocol); - } - -- public void setVersion(int protocol) -- { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); -+ public void setVersion(int protocol) { -+ // FlameCord - Create pipeline object to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ -+ pipeline.get(MinecraftDecoder.class).setProtocolVersion(protocol); -+ pipeline.get(MinecraftEncoder.class).setProtocolVersion(protocol); - } - -- public void write(Object packet) -- { -- if ( !closed ) -- { -- if ( packet instanceof PacketWrapper ) -- { -- ( (PacketWrapper) packet ).setReleased( true ); -- ch.writeAndFlush( ( (PacketWrapper) packet ).buf, ch.voidPromise() ); -- } else -- { -- ch.writeAndFlush( packet, ch.voidPromise() ); -+ public void write(Object packet) { -+ if (!closed) { -+ if (packet instanceof PacketWrapper) { -+ ((PacketWrapper) packet).setReleased(true); -+ ch.writeAndFlush(((PacketWrapper) packet).buf, ch.voidPromise()); -+ } else { -+ ch.writeAndFlush(packet, ch.voidPromise()); - } - } - } - -- public void markClosed() -- { -+ public void markClosed() { - closed = closing = true; - } - -- public void close() -- { -- close( null ); -+ public void close() { -+ close(null); - } - -- public void close(Object packet) -- { -- if ( !closed ) -- { -+ public void close(Object packet) { -+ if (!closed) { - closed = closing = true; - -- if ( packet != null && ch.isActive() ) -- { -- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); -- } else -- { -- ch.flush(); -+ if (packet != null && ch.isActive()) { -+ // FlameCord - Remove "ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE" listener -+ ch.writeAndFlush(packet).addListeners(ChannelFutureListener.CLOSE); -+ } else { -+ // FlameCord - Disable flushing as it's not really necessary -+ // ch.flush(); - ch.close(); - } - } - } - -- public void delayedClose(final Kick kick) -- { -- if ( !closing ) -- { -- closing = true; -- -- // Minecraft client can take some time to switch protocols. -- // Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it. -- // Delay 250ms to ensure that the protocol switch (if any) has definitely taken place. -- ch.eventLoop().schedule( new Runnable() -- { -- -- @Override -- public void run() -- { -- close( kick ); -- } -- }, 250, TimeUnit.MILLISECONDS ); -- } -+ public void delayedClose(final Kick kick) { -+ // FlameCord - "Disable" delayed close -+ close(kick); -+ /* -+ * if (!closing) { closing = true; -+ * -+ * // Minecraft client can take some time to switch protocols. // Sending the -+ * wrong disconnect packet whilst a protocol switch is in progress // will crash -+ * it. // Delay 250ms to ensure that the protocol switch (if any) has definitely -+ * taken // place. ch.eventLoop().schedule(new Runnable() { -+ * -+ * @Override public void run() { close(kick); } }, 250, TimeUnit.MILLISECONDS); -+ * } -+ */ - } - -- public void addBefore(String baseName, String name, ChannelHandler handler) -- { -- Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); -- ch.pipeline().flush(); -- ch.pipeline().addBefore( baseName, name, handler ); -+ public void addBefore(String baseName, String name, ChannelHandler handler) { -+ // FlameCord - Create pipeline object to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ -+ Preconditions.checkState(ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop"); -+ // FlameCord - Dont flush if not necessary -+ // pipeline.flush(); -+ pipeline.addBefore(baseName, name, handler); - } - -- public Channel getHandle() -- { -+ public Channel getHandle() { - return ch; - } - -- public void setCompressionThreshold(int compressionThreshold) -- { -- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) -- { -- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); -+ public void setCompressionThreshold(int compressionThreshold) { -+ // FlameCord - Create pipeline object to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ -+ if (pipeline.get(PacketCompressor.class) == null && compressionThreshold != -1) { -+ addBefore(PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor()); - } -- if ( compressionThreshold != -1 ) -- { -- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); -- } else -- { -- ch.pipeline().remove( "compress" ); -+ if (compressionThreshold != -1) { -+ pipeline.get(PacketCompressor.class).setThreshold(compressionThreshold); -+ } else { -+ pipeline.remove("compress"); - } - -- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) -- { -- addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); -+ if (pipeline.get(PacketDecompressor.class) == null && compressionThreshold != -1) { -+ addBefore(PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold)); - } -- if ( compressionThreshold == -1 ) -- { -- ch.pipeline().remove( "decompress" ); -+ if (compressionThreshold == -1) { -+ pipeline.remove("decompress"); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 989bfd87..23a2028b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -1,15 +1,22 @@ - package net.md_5.bungee.netty; - -+import java.io.IOException; -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.logging.Level; -+import java.util.logging.Logger; -+ - import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; -+import io.netty.channel.Channel; - import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInboundHandlerAdapter; - import io.netty.handler.codec.CorruptedFrameException; - import io.netty.handler.codec.DecoderException; - import io.netty.handler.codec.haproxy.HAProxyMessage; - import io.netty.handler.timeout.ReadTimeoutException; --import java.io.IOException; --import java.net.InetSocketAddress; --import java.util.logging.Level; - import net.md_5.bungee.api.ProxyServer; - import net.md_5.bungee.connection.CancelSendSignal; - import net.md_5.bungee.connection.InitialHandler; -@@ -24,160 +31,171 @@ import net.md_5.bungee.util.QuietException; - * channels to maintain simple states, and only call the required, adapted - * methods when the channel is connected. - */ --public class HandlerBoss extends ChannelInboundHandlerAdapter --{ -+public class HandlerBoss extends ChannelInboundHandlerAdapter { - - private ChannelWrapper channel; - private PacketHandler handler; - -- public void setHandler(PacketHandler handler) -- { -- Preconditions.checkArgument( handler != null, "handler" ); -+ public void setHandler(final PacketHandler handler) { -+ Preconditions.checkArgument(handler != null, "handler"); - this.handler = handler; - } - - @Override -- public void channelActive(ChannelHandlerContext ctx) throws Exception -- { -- if ( handler != null ) -- { -- channel = new ChannelWrapper( ctx ); -- handler.connected( channel ); -- -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -- { -- ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); -+ public void channelActive(final ChannelHandlerContext ctx) throws Exception { -+ // FlameCord start - Firewall system -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); -+ } -+ // FlameCord end - Firewall system -+ -+ if (handler != null) { -+ channel = new ChannelWrapper(ctx); -+ handler.connected(channel); -+ // FlameCord - Added isLoggerInitialhandler option -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() -+ && !(handler instanceof InitialHandler || handler instanceof PingHandler)) { -+ ProxyServer.getInstance().getLogger().log(Level.INFO, "{0} has connected", handler); - } - } - } - - @Override -- public void channelInactive(ChannelHandlerContext ctx) throws Exception -- { -- if ( handler != null ) -- { -+ public void channelInactive(final ChannelHandlerContext ctx) throws Exception { -+ if (handler != null) { - channel.markClosed(); -- handler.disconnected( channel ); -- -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -- { -- ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); -+ handler.disconnected(channel); -+ // FlameCord - Added isLoggerInitialhandler option -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() -+ && !(handler instanceof InitialHandler || handler instanceof PingHandler)) { -+ ProxyServer.getInstance().getLogger().log(Level.INFO, "{0} has disconnected", handler); - } - } - } - - @Override -- public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception -- { -- if ( handler != null ) -- { -- handler.writabilityChanged( channel ); -+ public void channelWritabilityChanged(final ChannelHandlerContext ctx) throws Exception { -+ if (handler != null) { -+ handler.writabilityChanged(channel); - } - } - - @Override -- public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception -- { -- if ( msg instanceof HAProxyMessage ) -- { -- HAProxyMessage proxy = (HAProxyMessage) msg; -- InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); -- -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -- { -- channel.getRemoteAddress(), newAddress -- } ); -- -- channel.setRemoteAddress( newAddress ); -+ public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception { -+ // FlameCord - Apply astei patches -+ if (!ctx.channel().isActive()) { -+ return; -+ } -+ -+ // FlameCord start - Firewall system -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); -+ } -+ // FlameCord end - Firewall system -+ -+ if (msg instanceof HAProxyMessage) { -+ final HAProxyMessage proxy = (HAProxyMessage) msg; -+ final InetSocketAddress newAddress = new InetSocketAddress(proxy.sourceAddress(), proxy.sourcePort()); -+ -+ ProxyServer.getInstance().getLogger().log(Level.FINE, "Set remote address via PROXY {0} -> {1}", -+ new Object[] { channel.getRemoteAddress(), newAddress }); -+ -+ channel.setRemoteAddress(newAddress); - return; - } - -- if ( handler != null ) -- { -- PacketWrapper packet = (PacketWrapper) msg; -- boolean sendPacket = handler.shouldHandle( packet ); -- try -- { -- if ( sendPacket && packet.packet != null ) -- { -- try -- { -- packet.packet.handle( handler ); -- } catch ( CancelSendSignal ex ) -- { -+ if (handler != null) { -+ final PacketWrapper packet = (PacketWrapper) msg; -+ -+ try { -+ boolean sendPacket = handler.shouldHandle(packet); -+ -+ if (sendPacket && packet.packet != null) { -+ try { -+ packet.packet.handle(handler); -+ } catch (final CancelSendSignal ex) { - sendPacket = false; - } - } -- if ( sendPacket ) -- { -- handler.handle( packet ); -+ if (sendPacket) { -+ handler.handle(packet); - } -- } finally -- { -+ } finally { - packet.trySingleRelease(); - } - } - } - - @Override -- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception -- { -- if ( ctx.channel().isActive() ) -- { -- boolean logExceptions = !( handler instanceof PingHandler ); -- -- if ( logExceptions ) -- { -- if ( cause instanceof ReadTimeoutException ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - read timed out", handler ); -- } else if ( cause instanceof DecoderException ) -- { -- if ( cause instanceof CorruptedFrameException ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - corrupted frame: {1}", new Object[] -- { -- handler, cause.getMessage() -- } ); -- } else if ( cause.getCause() instanceof BadPacketException ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - bad packet ID, are mods in use!? {1}", new Object[] -- { -- handler, cause.getCause().getMessage() -- } ); -- } else if ( cause.getCause() instanceof OverflowPacketException ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - overflow in packet detected! {1}", new Object[] -- { -- handler, cause.getCause().getMessage() -- } ); -+ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -+ final Channel channel = ctx.channel(); -+ -+ if (channel.isActive()) { -+ // FlameCord - Changed "ProxyServer.getInstance().getLogger()" to logger -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final Logger logger = ProxyServer.getInstance().getLogger(); -+ // FlameCord - Log exceptions based on configuration value -+ final boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); -+ -+ // FlameCord - Firewall system -+ if (cause instanceof DecoderException || cause instanceof IllegalStateException -+ || cause instanceof BadPacketException) { -+ final SocketAddress remoteAddress = channel.remoteAddress(); -+ -+ if (remoteAddress != null) { -+ final Throwable causeCause = cause.getCause(); -+ -+ if (causeCause == null || !causeCause.getMessage().contains("TO_CLIENT")) { -+ flameCord.getFirewallManager().addFirewalled(remoteAddress); - } -- } else if ( cause instanceof IOException || ( cause instanceof IllegalStateException && handler instanceof InitialHandler ) ) -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - {1}: {2}", new Object[] -- { -- handler, cause.getClass().getSimpleName(), cause.getMessage() -- } ); -- } else if ( cause instanceof QuietException ) -- { -- ProxyServer.getInstance().getLogger().log( Level.SEVERE, "{0} - encountered exception: {1}", new Object[] -- { -- handler, cause -- } ); -- } else -- { -- ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - encountered exception", cause ); - } - } - -- if ( handler != null ) -- { -- try -- { -- handler.exception( cause ); -- } catch ( Exception ex ) -- { -- ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); -+ if (logExceptions) { -+ if (cause instanceof ReadTimeoutException) { -+ logger.log(Level.WARNING, "{0} - read timed out", handler); -+ } else if (cause instanceof DecoderException) { -+ final Throwable causeCause = cause.getCause(); -+ -+ if (cause instanceof CorruptedFrameException) { -+ logger.log(Level.WARNING, "{0} - corrupted frame: {1}", -+ new Object[] { handler, cause.getMessage() }); -+ } else if (causeCause instanceof BadPacketException) { -+ logger.log(Level.WARNING, "{0} - bad packet ID, are mods in use!? {1}", -+ new Object[] { handler, causeCause.getMessage() }); -+ } else if (causeCause instanceof OverflowPacketException) { -+ logger.log(Level.WARNING, "{0} - overflow in packet detected! {1}", -+ new Object[] { handler, causeCause.getMessage() }); -+ } -+ } else if (cause instanceof IOException -+ || (cause instanceof IllegalStateException && handler instanceof InitialHandler)) { -+ logger.log(Level.WARNING, "{0} - {1}: {2}", -+ new Object[] { handler, cause.getClass().getSimpleName(), cause.getMessage() }); -+ } else if (cause instanceof QuietException) { -+ logger.log(Level.SEVERE, "{0} - encountered exception: {1}", new Object[] { handler, cause }); -+ // FlameCord - Check that cause is not FirewallException (We will handle it -+ // later) -+ } else if (!(cause instanceof FirewallException)) { -+ logger.log(Level.SEVERE, handler + " - encountered exception", cause); -+ } -+ } -+ -+ // FlameCord - Handle FirewallException -+ if (cause instanceof FirewallException) { -+ flameCord.getFirewallManager().logBlocked(channel.remoteAddress()); -+ } -+ -+ if (handler != null) { -+ try { -+ handler.exception(cause); -+ } catch (final Exception ex) { -+ if (logExceptions) { -+ logger.log(Level.SEVERE, handler + " - exception processing exception", ex); -+ } - } - } - -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 9a39f69e..5bbd0434 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,10 +1,19 @@ - package net.md_5.bungee.netty; - -+import java.net.SocketAddress; -+import java.util.concurrent.ThreadFactory; -+import java.util.concurrent.TimeUnit; -+import java.util.logging.Level; -+ - import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; - import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; - import io.netty.buffer.PooledByteBufAllocator; - import io.netty.channel.Channel; - import io.netty.channel.ChannelException; -+import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInitializer; - import io.netty.channel.ChannelOption; - import io.netty.channel.EventLoopGroup; -@@ -27,12 +36,9 @@ import io.netty.handler.codec.haproxy.HAProxyMessageDecoder; - import io.netty.handler.timeout.ReadTimeoutHandler; - import io.netty.util.AttributeKey; - import io.netty.util.internal.PlatformDependent; --import java.net.SocketAddress; --import java.util.concurrent.ThreadFactory; --import java.util.concurrent.TimeUnit; --import java.util.logging.Level; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.BungeeServerInfo; -+import net.md_5.bungee.ConnectionThrottle; - import net.md_5.bungee.UserConnection; - import net.md_5.bungee.Util; - import net.md_5.bungee.api.ProxyServer; -@@ -47,61 +53,76 @@ import net.md_5.bungee.protocol.Protocol; - import net.md_5.bungee.protocol.Varint21FrameDecoder; - import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; - --public class PipelineUtils --{ -+public class PipelineUtils { - - public static final AttributeKey LISTENER = AttributeKey.newInstance("ListerInfo"); - public static final AttributeKey USER = AttributeKey.newInstance("User"); - public static final AttributeKey TARGET = AttributeKey.newInstance("Target"); -- public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() -- { -+ public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() { - @Override -- protected void initChannel(Channel ch) throws Exception -- { -- SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); -+ protected void initChannel(final Channel ch) throws Exception { -+ final SocketAddress remoteAddress = (ch.remoteAddress() == null) ? ch.parent().localAddress() -+ : ch.remoteAddress(); - -- if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) -- { -- ch.close(); -- return; -+ // FlameCord start - Firewall system -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); - } -- ListenerInfo listener = ch.attr( LISTENER ).get(); -+ // FlameCord end - Firewall system -+ // FlameCord - Use connectionThrottle -+ final ConnectionThrottle connectionThrottle = BungeeCord.getInstance().getConnectionThrottle(); - -- if ( BungeeCord.getInstance().getPluginManager().callEvent( new ClientConnectEvent( remoteAddress, listener ) ).isCancelled() ) -- { -+ if (connectionThrottle != null && connectionThrottle.throttle(remoteAddress)) { - ch.close(); - return; - } -+ final ListenerInfo listener = ch.attr(LISTENER).get(); - -- ConnectionInitEvent connectionInitEvent = new ConnectionInitEvent(ch.remoteAddress(), listener, (result, throwable) -> { // Waterfall -- -- if (result.isCancelled()) { -+ if (BungeeCord.getInstance().getPluginManager().callEvent(new ClientConnectEvent(remoteAddress, listener)) -+ .isCancelled()) { - ch.close(); - return; - } - -- -- try { -- BASE.initChannel( ch ); -- } catch (Exception e) { -- e.printStackTrace(); -- ch.close(); -- return; -- } -- 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() ) ); -- ch.pipeline().addBefore( FRAME_PREPENDER, LEGACY_KICKER, legacyKicker ); -- ch.pipeline().get( HandlerBoss.class ).setHandler( new InitialHandler( BungeeCord.getInstance(), listener ) ); -- -- if ( listener.isProxyProtocol() ) -- { -- ch.pipeline().addFirst( new HAProxyMessageDecoder() ); -- } -- }); // Waterfall -+ final ConnectionInitEvent connectionInitEvent = new ConnectionInitEvent(ch.remoteAddress(), listener, -+ (result, throwable) -> { // Waterfall -+ -+ if (result.isCancelled()) { -+ ch.close(); -+ return; -+ } -+ -+ try { -+ BASE.initChannel(ch); -+ } catch (final Exception e) { -+ e.printStackTrace(); -+ ch.close(); -+ return; -+ } -+ // FlameCord - Use protocolVersion -+ final int protocolVersion = ProxyServer.getInstance().getProtocolVersion(); -+ ch.pipeline().addBefore(FRAME_DECODER, LEGACY_DECODER, new LegacyDecoder()); -+ ch.pipeline().addAfter(FRAME_DECODER, PACKET_DECODER, -+ new MinecraftDecoder(Protocol.HANDSHAKE, true, protocolVersion)); -+ ch.pipeline().addAfter(FRAME_PREPENDER, PACKET_ENCODER, -+ new MinecraftEncoder(Protocol.HANDSHAKE, true, protocolVersion)); -+ ch.pipeline().addBefore(FRAME_PREPENDER, LEGACY_KICKER, legacyKicker); -+ ch.pipeline().get(HandlerBoss.class) -+ .setHandler(new InitialHandler(BungeeCord.getInstance(), listener)); -+ -+ if (listener.isProxyProtocol()) { -+ ch.pipeline().addFirst(new HAProxyMessageDecoder()); -+ } -+ }); // Waterfall - - BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); - } -+ -+ // FlameCord - Catch exceptions -+ @Override -+ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -+ ctx.close(); -+ } - }; - public static final Base BASE = new Base(); - private static final KickStringWriter legacyKicker = new KickStringWriter(); -@@ -119,32 +140,26 @@ public class PipelineUtils - - private static boolean epoll; - -- static -- { -- if ( !PlatformDependent.isWindows() && Boolean.parseBoolean( System.getProperty( "bungee.epoll", "true" ) ) ) -- { -- ProxyServer.getInstance().getLogger().info( "Not on Windows, attempting to use enhanced EpollEventLoop" ); -- -- if ( epoll = Epoll.isAvailable() ) -- { -- ProxyServer.getInstance().getLogger().info( "Epoll is working, utilising it!" ); -- } else -- { -- ProxyServer.getInstance().getLogger().log( Level.WARNING, "Epoll is not working, falling back to NIO: {0}", Util.exception( Epoll.unavailabilityCause() ) ); -+ static { -+ if (!PlatformDependent.isWindows() && Boolean.parseBoolean(System.getProperty("bungee.epoll", "true"))) { -+ ProxyServer.getInstance().getLogger().info("Not on Windows, attempting to use enhanced EpollEventLoop"); -+ -+ if (epoll = Epoll.isAvailable()) { -+ ProxyServer.getInstance().getLogger().info("Epoll is working, utilising it!"); -+ } else { -+ ProxyServer.getInstance().getLogger().log(Level.WARNING, -+ "Epoll is not working, falling back to NIO: {0}", Util.exception(Epoll.unavailabilityCause())); - } - } - } - -- public static EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) -- { -- return epoll ? new EpollEventLoopGroup( threads, factory ) : new NioEventLoopGroup( threads, factory ); -+ public static EventLoopGroup newEventLoopGroup(final int threads, final ThreadFactory factory) { -+ return epoll ? new EpollEventLoopGroup(threads, factory) : new NioEventLoopGroup(threads, factory); - } - -- public static Class getServerChannel(SocketAddress address) -- { -- if ( address instanceof DomainSocketAddress ) -- { -- Preconditions.checkState( epoll, "Epoll required to have UNIX sockets" ); -+ public static Class getServerChannel(final SocketAddress address) { -+ if (address instanceof DomainSocketAddress) { -+ Preconditions.checkState(epoll, "Epoll required to have UNIX sockets"); - - return EpollServerDomainSocketChannel.class; - } -@@ -152,11 +167,9 @@ public class PipelineUtils - return epoll ? EpollServerSocketChannel.class : NioServerSocketChannel.class; - } - -- public static Class getChannel(SocketAddress address) -- { -- if ( address instanceof DomainSocketAddress ) -- { -- Preconditions.checkState( epoll, "Epoll required to have UNIX sockets" ); -+ public static Class getChannel(final SocketAddress address) { -+ if (address instanceof DomainSocketAddress) { -+ Preconditions.checkState(epoll, "Epoll required to have UNIX sockets"); - - return EpollDomainSocketChannel.class; - } -@@ -164,37 +177,32 @@ public class PipelineUtils - return epoll ? EpollSocketChannel.class : NioSocketChannel.class; - } - -- public static Class getDatagramChannel() -- { -+ public static Class getDatagramChannel() { - return epoll ? EpollDatagramChannel.class : NioDatagramChannel.class; - } - -- private static final int LOW_MARK = Integer.getInteger( "net.md_5.bungee.low_mark", 2 << 18 ); // 0.5 mb -- private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb -- private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK ); -- -- public static final class Base extends ChannelInitializer -- { -+ private static final int LOW_MARK = Integer.getInteger("net.md_5.bungee.low_mark", 2 << 18); // 0.5 mb -+ private static final int HIGH_MARK = Integer.getInteger("net.md_5.bungee.high_mark", 2 << 20); // 2 mb -+ private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark(LOW_MARK, HIGH_MARK); - -+ public static final class Base extends ChannelInitializer { - @Override -- public void initChannel(Channel ch) throws Exception -- { -- try -- { -- ch.config().setOption( ChannelOption.IP_TOS, 0x18 ); -- } catch ( ChannelException ex ) -- { -+ public void initChannel(final Channel ch) throws Exception { -+ try { -+ ch.config().setOption(ChannelOption.IP_TOS, 0x18); -+ } catch (final ChannelException ex) { - // IP_TOS is not supported (Windows XP / Windows Server 2003) - } -- ch.config().setOption( ChannelOption.TCP_NODELAY, true ); -- ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); -- ch.config().setWriteBufferWaterMark( MARK ); -+ ch.config().setOption(ChannelOption.TCP_NODELAY, true); -+ ch.config().setAllocator(PooledByteBufAllocator.DEFAULT); -+ ch.config().setWriteBufferWaterMark(MARK); - -- ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); -- ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); -- ch.pipeline().addLast( FRAME_PREPENDER, framePrepender ); -+ ch.pipeline().addLast(TIMEOUT_HANDLER, -+ new ReadTimeoutHandler(BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS)); -+ ch.pipeline().addLast(FRAME_DECODER, new Varint21FrameDecoder()); -+ ch.pipeline().addLast(FRAME_PREPENDER, framePrepender); - -- ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); -+ ch.pipeline().addLast(BOSS_HANDLER, new HandlerBoss()); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java -index fd0dabcf..c0e28d91 100644 ---- a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java -+++ b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java -@@ -16,98 +16,83 @@ import net.md_5.bungee.api.plugin.Plugin; - import net.md_5.bungee.api.scheduler.ScheduledTask; - import net.md_5.bungee.api.scheduler.TaskScheduler; - --public class BungeeScheduler implements TaskScheduler --{ -+public class BungeeScheduler implements TaskScheduler { - - private final Object lock = new Object(); - private final AtomicInteger taskCounter = new AtomicInteger(); -- private final TIntObjectMap tasks = TCollections.synchronizedMap( new TIntObjectHashMap() ); -- private final Multimap tasksByPlugin = Multimaps.synchronizedMultimap( HashMultimap.create() ); -+ private final TIntObjectMap tasks = TCollections.synchronizedMap(new TIntObjectHashMap()); -+ private final Multimap tasksByPlugin = Multimaps -+ .synchronizedMultimap(HashMultimap.create()); - // -- private final Unsafe unsafe = new Unsafe() -- { -+ private final Unsafe unsafe = new Unsafe() { - - @Override -- public ExecutorService getExecutorService(Plugin plugin) -- { -+ public ExecutorService getExecutorService(Plugin plugin) { - return plugin.getExecutorService(); - } - }; - - @Override -- public void cancel(int id) -- { -- BungeeTask task = tasks.get( id ); -- Preconditions.checkArgument( task != null, "No task with id %s", id ); -+ public void cancel(int id) { -+ BungeeTask task = tasks.get(id); -+ Preconditions.checkArgument(task != null, "No task with id %s", id); - - task.cancel(); - } - -- void cancel0(BungeeTask task) -- { -- synchronized ( lock ) -- { -- tasks.remove( task.getId() ); -- tasksByPlugin.values().remove( task ); -+ void cancel0(BungeeTask task) { -+ synchronized (lock) { -+ tasks.remove(task.getId()); -+ tasksByPlugin.values().remove(task); - } - } - - @Override -- public void cancel(ScheduledTask task) -- { -+ public void cancel(ScheduledTask task) { - task.cancel(); - } - - @Override -- public int cancel(Plugin plugin) -- { -+ public int cancel(Plugin plugin) { - Set toRemove = new HashSet<>(); -- synchronized ( lock ) -- { -- for ( ScheduledTask task : tasksByPlugin.get( plugin ) ) -- { -- toRemove.add( task ); -+ synchronized (lock) { -+ for (ScheduledTask task : tasksByPlugin.get(plugin)) { -+ toRemove.add(task); - } - } -- for ( ScheduledTask task : toRemove ) -- { -- cancel( task ); -+ for (ScheduledTask task : toRemove) { -+ cancel(task); - } - return toRemove.size(); - } - - @Override -- public ScheduledTask runAsync(Plugin owner, Runnable task) -- { -- return schedule( owner, task, 0, TimeUnit.MILLISECONDS ); -+ public ScheduledTask runAsync(Plugin owner, Runnable task) { -+ return schedule(owner, task, 0, TimeUnit.MILLISECONDS); - } - - @Override -- public ScheduledTask schedule(Plugin owner, Runnable task, long delay, TimeUnit unit) -- { -- return schedule( owner, task, delay, 0, unit ); -+ public ScheduledTask schedule(Plugin owner, Runnable task, long delay, TimeUnit unit) { -+ return schedule(owner, task, delay, 0, unit); - } - - @Override -- public ScheduledTask schedule(Plugin owner, Runnable task, long delay, long period, TimeUnit unit) -- { -- Preconditions.checkNotNull( owner, "owner" ); -- Preconditions.checkNotNull( task, "task" ); -- BungeeTask prepared = new BungeeTask( this, taskCounter.getAndIncrement(), owner, task, delay, period, unit ); -+ public ScheduledTask schedule(Plugin owner, Runnable task, long delay, long period, TimeUnit unit) { -+ Preconditions.checkNotNull(owner, "owner"); -+ Preconditions.checkNotNull(task, "task"); -+ BungeeTask prepared = new BungeeTask(this, taskCounter.getAndIncrement(), owner, task, delay, period, unit); - -- synchronized ( lock ) -- { -- tasks.put( prepared.getId(), prepared ); -- tasksByPlugin.put( owner, prepared ); -+ synchronized (lock) { -+ tasks.put(prepared.getId(), prepared); -+ tasksByPlugin.put(owner, prepared); - } - -- owner.getExecutorService().execute( prepared ); -+ owner.getExecutorService().execute(prepared); - return prepared; - } - - @Override -- public Unsafe unsafe() -- { -+ public Unsafe unsafe() { - return unsafe; - } - } -diff --git a/proxy/src/test/java/net/md_5/bungee/scheduler/SchedulerTest.java b/proxy/src/test/java/net/md_5/bungee/scheduler/SchedulerTest.java -index 25ac3729..b2e1d809 100644 ---- a/proxy/src/test/java/net/md_5/bungee/scheduler/SchedulerTest.java -+++ b/proxy/src/test/java/net/md_5/bungee/scheduler/SchedulerTest.java -@@ -9,78 +9,69 @@ import net.md_5.bungee.api.scheduler.TaskScheduler; - import org.junit.Assert; - import org.junit.Test; - --public class SchedulerTest --{ -+public class SchedulerTest { - - @Test -- public void testRun() throws InterruptedException -- { -+ public void testRun() throws InterruptedException { - TaskScheduler scheduler = new BungeeScheduler(); - -- final CountDownLatch latch = new CountDownLatch( 1 ); -+ final CountDownLatch latch = new CountDownLatch(1); - -- scheduler.runAsync( DummyPlugin.INSTANCE, new Runnable() -- { -+ scheduler.runAsync(DummyPlugin.INSTANCE, new Runnable() { - - @Override -- public void run() -- { -+ public void run() { - latch.countDown(); - } -- } ); -+ }); - -- latch.await( 5, TimeUnit.SECONDS ); -+ latch.await(5, TimeUnit.SECONDS); - -- Assert.assertEquals( 0, latch.getCount() ); -+ Assert.assertEquals(0, latch.getCount()); - } - - @Test -- public void testCancel() throws InterruptedException -- { -+ public void testCancel() throws InterruptedException { - TaskScheduler scheduler = new BungeeScheduler(); - AtomicBoolean b = new AtomicBoolean(); - -- ScheduledTask task = setup( scheduler, b ); -- scheduler.cancel( task.getId() ); -- Thread.sleep( 250 ); -- Assert.assertFalse( b.get() ); -+ ScheduledTask task = setup(scheduler, b); -+ scheduler.cancel(task.getId()); -+ Thread.sleep(250); -+ Assert.assertFalse(b.get()); - -- task = setup( scheduler, b ); -- scheduler.cancel( task ); -- Thread.sleep( 250 ); -- Assert.assertFalse( b.get() ); -+ task = setup(scheduler, b); -+ scheduler.cancel(task); -+ Thread.sleep(250); -+ Assert.assertFalse(b.get()); - -- task = setup( scheduler, b ); -- scheduler.cancel( task.getOwner() ); -- Thread.sleep( 250 ); -- Assert.assertFalse( b.get() ); -+ task = setup(scheduler, b); -+ scheduler.cancel(task.getOwner()); -+ Thread.sleep(250); -+ Assert.assertFalse(b.get()); - } - - @Test -- public void testScheduleAndRepeat() throws InterruptedException -- { -+ public void testScheduleAndRepeat() throws InterruptedException { - TaskScheduler scheduler = new BungeeScheduler(); - AtomicBoolean b = new AtomicBoolean(); - -- setup( scheduler, b ); -- Thread.sleep( 250 ); -- Assert.assertTrue( b.get() ); -+ setup(scheduler, b); -+ Thread.sleep(250); -+ Assert.assertTrue(b.get()); - -- b.set( false ); -- Thread.sleep( 250 ); -- Assert.assertTrue( b.get() ); -+ b.set(false); -+ Thread.sleep(250); -+ Assert.assertTrue(b.get()); - } - -- private ScheduledTask setup(TaskScheduler scheduler, final AtomicBoolean hasRun) -- { -- return scheduler.schedule( DummyPlugin.INSTANCE, new Runnable() -- { -+ private ScheduledTask setup(TaskScheduler scheduler, final AtomicBoolean hasRun) { -+ return scheduler.schedule(DummyPlugin.INSTANCE, new Runnable() { - - @Override -- public void run() -- { -- hasRun.set( true ); -+ public void run() { -+ hasRun.set(true); - } -- }, 100, 100, TimeUnit.MILLISECONDS ); -+ }, 100, 100, TimeUnit.MILLISECONDS); - } - } -diff --git a/query/.factorypath b/query/.factorypath -new file mode 100644 -index 00000000..ec9b7ffd ---- /dev/null -+++ b/query/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/query/pom.xml b/query/pom.xml -index 0f2ea00b..d52240f5 100644 ---- a/query/pom.xml -+++ b/query/pom.xml -@@ -1,6 +1,5 @@ -- -- -+ - 4.0.0 - - -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..1e8169d0 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -24,161 +24,146 @@ import net.md_5.bungee.api.config.ListenerInfo; - import net.md_5.bungee.api.connection.ProxiedPlayer; - - @RequiredArgsConstructor --public class QueryHandler extends SimpleChannelInboundHandler --{ -+public class QueryHandler extends SimpleChannelInboundHandler { - - private final ProxyServer bungee; - private final ListenerInfo listener; -- /*========================================================================*/ -+ /* ======================================================================== */ - private final Random random = new Random(); -- private final Cache sessions = CacheBuilder.newBuilder().expireAfterWrite( 30, TimeUnit.SECONDS ).build(); -- private static io.github.waterfallmc.waterfall.utils.FastException cachedNoSessionException = new io.github.waterfallmc.waterfall.utils.FastException("No Session!"); -+ private final Cache sessions = CacheBuilder.newBuilder() -+ .expireAfterWrite(30, TimeUnit.SECONDS).build(); -+ private static io.github.waterfallmc.waterfall.utils.FastException cachedNoSessionException = new io.github.waterfallmc.waterfall.utils.FastException( -+ "No Session!"); - -- private void writeShort(ByteBuf buf, int s) -- { -- buf.writeShortLE( s ); -+ private void writeShort(ByteBuf buf, int s) { -+ buf.writeShortLE(s); - } - -- private void writeNumber(ByteBuf buf, int i) -- { -- writeString( buf, Integer.toString( i ) ); -+ private void writeNumber(ByteBuf buf, int i) { -+ writeString(buf, Integer.toString(i)); - } - -- private void writeString(ByteBuf buf, String s) -- { -- for ( char c : s.toCharArray() ) -- { -- buf.writeByte( c ); -+ private void writeString(ByteBuf buf, String s) { -+ for (char c : s.toCharArray()) { -+ buf.writeByte(c); - } -- buf.writeByte( 0x00 ); -+ buf.writeByte(0x00); - } - - @Override -- protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception -- { -- try -- { -- handleMessage( ctx, msg ); -- } catch ( Throwable t ) -- { -- bungee.getLogger().log( Level.WARNING, "Error whilst handling query packet from " + msg.sender(), t ); -+ protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception { -+ try { -+ handleMessage(ctx, msg); -+ } catch (Throwable t) { -+ bungee.getLogger().log(Level.WARNING, "Error whilst handling query packet from " + msg.sender(), t); - } - } - -- private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg) -- { -+ private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg) { - ByteBuf in = msg.content(); -- if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) -- { -- bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); -+ if (in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD) { -+ // FlameCord - Close on Incorrect Magic -+ bungee.getLogger().log(Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender()); -+ ctx.close(); - return; - } - - ByteBuf out = ctx.alloc().buffer(); -- AddressedEnvelope response = new DatagramPacket( out, msg.sender() ); -+ AddressedEnvelope response = new DatagramPacket(out, msg.sender()); - - byte type = in.readByte(); - int sessionId = in.readInt(); - -- if ( type == 0x09 ) -- { -- out.writeByte( 0x09 ); -- out.writeInt( sessionId ); -+ if (type == 0x09) { -+ out.writeByte(0x09); -+ out.writeInt(sessionId); - - int challengeToken = random.nextInt(); -- sessions.put( msg.sender().getAddress(), new QuerySession( challengeToken, System.currentTimeMillis() ) ); -+ sessions.put(msg.sender().getAddress(), new QuerySession(challengeToken, System.currentTimeMillis())); - -- writeNumber( out, challengeToken ); -+ writeNumber(out, challengeToken); - } - -- if ( type == 0x00 ) -- { -+ if (type == 0x00) { - int challengeToken = in.readInt(); -- QuerySession session = sessions.getIfPresent( msg.sender().getAddress() ); -- if ( session == null || session.getToken() != challengeToken ) -- { -+ QuerySession session = sessions.getIfPresent(msg.sender().getAddress()); -+ if (session == null || session.getToken() != challengeToken) { - throw cachedNoSessionException; // Waterfall - } - - // Waterfall start -- List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); -+ List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName) -+ .collect(Collectors.toList()); - -- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", -- bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), -- listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); -+ ProxyQueryEvent event = new ProxyQueryEvent(listener, -+ new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", bungee.getOnlineCount(), -+ listener.getMaxPlayers(), listener.getHost().getPort(), listener.getHost().getHostString(), -+ "MINECRAFT", players, bungee.getGameVersion())); - QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); - // Waterfall end - -- out.writeByte( 0x00 ); -- out.writeInt( sessionId ); -+ out.writeByte(0x00); -+ out.writeInt(sessionId); - -- if ( in.readableBytes() == 0 ) -- { -+ if (in.readableBytes() == 0) { - // Short response - // Waterfall start -- writeString( out, result.getMotd() ); // MOTD -- writeString( out, result.getGameType() ); // Game Type -- writeString( out, result.getWorldName() ); // World Name -- writeNumber( out, result.getOnlinePlayers() ); // Online Count -- writeNumber( out, result.getMaxPlayers() ); // Max Players -- writeShort( out, result.getPort() ); // Port -- writeString( out, result.getAddress() ); // IP -+ writeString(out, result.getMotd()); // MOTD -+ writeString(out, result.getGameType()); // Game Type -+ writeString(out, result.getWorldName()); // World Name -+ writeNumber(out, result.getOnlinePlayers()); // Online Count -+ writeNumber(out, result.getMaxPlayers()); // Max Players -+ writeShort(out, result.getPort()); // Port -+ writeString(out, result.getAddress()); // IP - // Waterfall end -- } else if ( in.readableBytes() == 4 ) -- { -+ } else if (in.readableBytes() == 4) { - // Long Response -- out.writeBytes( new byte[] -- { -- 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 -- } ); -+ out.writeBytes(new byte[] { 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 }); - Map data = new LinkedHashMap<>(); - - // Waterfall start -- data.put( "hostname", result.getMotd() ); -- data.put( "gametype", result.getGameType() ); -+ data.put("hostname", result.getMotd()); -+ data.put("gametype", result.getGameType()); - // Start Extra Info -- data.put( "game_id", result.getGameId() ); -- data.put( "version", result.getVersion() ); -- data.put( "plugins", "" ); // TODO: Allow population? -+ data.put("game_id", result.getGameId()); -+ data.put("version", result.getVersion()); -+ data.put("plugins", ""); // TODO: Allow population? - // End Extra Info -- data.put( "map", result.getWorldName() ); -- data.put( "numplayers", Integer.toString( result.getOnlinePlayers() ) ); -- data.put( "maxplayers", Integer.toString( result.getMaxPlayers() ) ); -- data.put( "hostport", Integer.toString( result.getPort() ) ); -- data.put( "hostip", result.getAddress() ); -+ data.put("map", result.getWorldName()); -+ data.put("numplayers", Integer.toString(result.getOnlinePlayers())); -+ data.put("maxplayers", Integer.toString(result.getMaxPlayers())); -+ data.put("hostport", Integer.toString(result.getPort())); -+ data.put("hostip", result.getAddress()); - // Waterfall end - -- for ( Map.Entry entry : data.entrySet() ) -- { -- writeString( out, entry.getKey() ); -- writeString( out, entry.getValue() ); -+ for (Map.Entry entry : data.entrySet()) { -+ writeString(out, entry.getKey()); -+ writeString(out, entry.getValue()); - } -- out.writeByte( 0x00 ); // Null -+ out.writeByte(0x00); // Null - - // Padding -- writeString( out, "\01player_\00" ); -+ writeString(out, "\01player_\00"); - // Player List - result.getPlayers().stream().forEach(p -> writeString(out, p)); // Waterfall -- out.writeByte( 0x00 ); // Null -- } else -- { -+ out.writeByte(0x00); // Null -+ } else { - // Error! -- throw new IllegalStateException( "Invalid data request packet" ); -+ throw new IllegalStateException("Invalid data request packet"); - } - } - -- ctx.writeAndFlush( response ); -+ ctx.writeAndFlush(response); - } - - @Override -- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception -- { -- bungee.getLogger().log( Level.WARNING, "Error whilst handling query packet from " + ctx.channel().remoteAddress(), cause ); -+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { -+ bungee.getLogger().log(Level.WARNING, -+ "Error whilst handling query packet from " + ctx.channel().remoteAddress(), cause); - } - - @Data -- private static class QuerySession -- { -+ private static class QuerySession { - - private final int token; - private final long time; --- -2.27.0.windows.1 - diff --git a/Waterfall-Proxy-Patches/0005-FlameCord-Whitelist-servers-addresses.patch b/Waterfall-Proxy-Patches/0005-FlameCord-Whitelist-servers-addresses.patch deleted file mode 100644 index 3d928d20..00000000 --- a/Waterfall-Proxy-Patches/0005-FlameCord-Whitelist-servers-addresses.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 548ab6001046830731ac6246fcd2160df7b07f5e Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata -Date: Thu, 3 Sep 2020 18:37:43 -0300 -Subject: [PATCH] FlameCord Whitelist servers addresses - - -diff --git a/flamecord/.factorypath b/flamecord/.factorypath -index f398f41e..ed4e646c 100644 ---- a/flamecord/.factorypath -+++ b/flamecord/.factorypath -@@ -1,4 +1,5 @@ - -+ - - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 3a7f56ee..29c1573a 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -1,5 +1,6 @@ - package dev._2lstudios.flamecord; - -+import java.util.Collection; - import java.util.logging.Logger; - - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -@@ -21,21 +22,25 @@ public class FlameCord { - private final ModulesConfiguration modulesConfiguration; - @Getter - private final MessagesConfiguration messagesConfiguration; -+ @Getter - private final Thread thread; - -- public static void renew(final Logger logger) { -+ public static void renew(final Logger logger, final Collection whitelistedAddresses) { - if (FlameCord.instance != null) { - FlameCord.instance.thread.interrupt(); - } - -- FlameCord.instance = new FlameCord(logger); -+ final FlameCord instance = new FlameCord(logger, whitelistedAddresses); -+ -+ FlameCord.instance = instance; - } - -- private FlameCord(final Logger logger) { -- final ConfigurationProvider configurationProvider = YamlConfiguration.getProvider(YamlConfiguration.class); -+ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { -+ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); -- this.firewallManager = new FirewallManager(logger, flameCordConfiguration.getFirewallSeconds()); -+ this.firewallManager = new FirewallManager(logger, whitelistedAddresses, -+ flameCordConfiguration.getFirewallSeconds()); - this.modulesConfiguration = new ModulesConfiguration(configurationProvider); - this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); - this.thread = new Thread() { -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -index a90c8426..8a474758 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -@@ -12,20 +12,35 @@ import lombok.Getter; - - public class FirewallManager { - private final Logger logger; -+ private final Collection whitelistedAddresses; - private final Collection firewalled; - private final int defaultSeconds; - @Getter - private int seconds; - -- public FirewallManager(final Logger logger, final int defaultSeconds) { -+ public FirewallManager(final Logger logger, final Collection whitelistedAddresses, -+ final int defaultSeconds) { - this.logger = logger; -+ this.whitelistedAddresses = whitelistedAddresses; - this.firewalled = new HashSet<>(); - this.defaultSeconds = defaultSeconds; - this.seconds = defaultSeconds; - } - -+ public boolean isWhitelisted(final SocketAddress address) { -+ final String addressString = address.toString(); -+ -+ for (final String whitelistedAddressString : whitelistedAddresses) { -+ if (addressString.endsWith(whitelistedAddressString)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ - public void addFirewalled(final SocketAddress address) { -- if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled()) { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { - final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; - final String hostString = iNetSocketAddress.getHostString(); - -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4351b1f4..1ed2ffaf 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -288,19 +288,30 @@ public class BungeeCord extends ProxyServer { - workerEventLoopGroup = PipelineUtils.newEventLoopGroup(0, - new ThreadFactoryBuilder().setNameFormat("Netty Worker IO Thread #%1$d").build()); - -+ // FlameCord - Load config before -+ config.load(); -+ - // FlameCord - Use own module system and reload FlameCord - /* - * File moduleDirectory = new File( "modules" ); moduleManager.load( this, - * moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); - */ -- FlameCord.renew(logger); -+ // FlameCord - Collect ips from servers -+ final Collection whitelistedAddresses = new HashSet<>(); -+ -+ for (final ServerInfo serverInfo : getServers().values()) { -+ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); -+ } -+ -+ FlameCord.renew(logger, whitelistedAddresses); - registerModules(); - - pluginsFolder.mkdir(); - pluginManager.detectPlugins(pluginsFolder); - - pluginManager.loadPlugins(); -- config.load(); -+ // FlameCord - Load config before -+ // config.load(); - - if (config.isForgeSupport()) { - registerChannel(ForgeConstants.FML_TAG); -@@ -823,7 +834,14 @@ public class BungeeCord extends ProxyServer { - break; - } - case "reload": { -- FlameCord.renew(logger); -+ // FlameCord - Collect ips from servers -+ final Collection whitelistedAddresses = new HashSet<>(); -+ -+ for (final ServerInfo serverInfo : getServers().values()) { -+ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); -+ } -+ -+ FlameCord.renew(logger, whitelistedAddresses); - sender.sendMessage(TextComponent - .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); - break; -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 23a2028b..8e92f5e8 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -147,11 +147,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { - final SocketAddress remoteAddress = channel.remoteAddress(); - - if (remoteAddress != null) { -- final Throwable causeCause = cause.getCause(); -- -- if (causeCause == null || !causeCause.getMessage().contains("TO_CLIENT")) { -- flameCord.getFirewallManager().addFirewalled(remoteAddress); -- } -+ flameCord.getFirewallManager().addFirewalled(remoteAddress); - } - } - --- -2.27.0.windows.1 - diff --git a/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch new file mode 100644 index 00000000..d4ac9db0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch @@ -0,0 +1,76 @@ +From 8dee9ecddb83e174e6878cf4ec5a35f0d02701a7 Mon Sep 17 00:00:00 2001 +From: Juan Cruz Linsalata +Date: Sun, 18 Oct 2020 16:24:25 -0300 +Subject: [PATCH] Made proxyping cancellable + + +diff --git a/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java b/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java +index 4baa06a9..05bccaca 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java +@@ -2,10 +2,13 @@ package net.md_5.bungee.api.event; + + import lombok.Data; + import lombok.EqualsAndHashCode; ++import lombok.Getter; ++import lombok.Setter; + import lombok.ToString; + import net.md_5.bungee.api.Callback; + import net.md_5.bungee.api.ServerPing; + import net.md_5.bungee.api.connection.PendingConnection; ++import net.md_5.bungee.api.plugin.Cancellable; + + /** + * Called when the proxy is pinged with packet 0xFE from the server list. +@@ -13,9 +16,12 @@ import net.md_5.bungee.api.connection.PendingConnection; + @Data + @ToString(callSuper = false) + @EqualsAndHashCode(callSuper = false) +-public class ProxyPingEvent extends AsyncEvent ++// FlameCord - Make ProxyPingEvent cancellable ++public class ProxyPingEvent extends AsyncEvent implements Cancellable + { +- ++ @Getter ++ @Setter ++ private boolean cancelled = false; + /** + * The connection asking for a ping response. + */ +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 138dffa0..dfc5ed93 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 +@@ -278,21 +278,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void done(ProxyPingEvent pingResult, Throwable error) + { +- Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine +- if ( bungee.getConnectionThrottle() != null ) +- { +- bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); +- } +- +- // FlameCord - Close if response is null ++ // FlameCord - Return and close if response is null or cancelled + // FlameCord - Return if connection is closed +- if (pingResult.getResponse() == null) { ++ if (pingResult.getResponse() == null || pingResult.isCancelled()) { + ch.close(); + return; + } else if (ch.isClosed()) { + return; + } + ++ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine ++ if ( bungee.getConnectionThrottle() != null ) ++ { ++ bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); ++ } ++ + // Travertine start + if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) + { +-- +2.27.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-Defaulted-timeout-from-30000-to-5000.patch b/Waterfall-Proxy-Patches/0006-FlameCord-Defaulted-timeout-from-30000-to-5000.patch deleted file mode 100644 index 639a8bac..00000000 --- a/Waterfall-Proxy-Patches/0006-FlameCord-Defaulted-timeout-from-30000-to-5000.patch +++ /dev/null @@ -1,30 +0,0 @@ -From efe1b091836279bb375f6770fb8d98c4e5c1c4ed Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata -Date: Thu, 3 Sep 2020 19:36:44 -0300 -Subject: [PATCH] FlameCord Defaulted timeout from 30000 to 5000 - - -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197a..a984370e 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -@@ -29,13 +29,12 @@ import net.md_5.bungee.util.CaseInsensitiveSet; - * Core configuration for the proxy. - */ - @Getter --public abstract class Configuration implements ProxyConfig --{ -- -+public abstract class Configuration implements ProxyConfig { -+ // FlameCord - Default from 30000 to 5000 - /** - * Time before users are disconnected due to no network activity. - */ -- private int timeout = 30000; -+ private int timeout = 5000; - /** - * UUID used for metrics. - */ --- -2.27.0.windows.1 - From f1ceaf1b870a26b9d640048a2e01e4a9914f563e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 19 Oct 2020 16:09:38 -0300 Subject: [PATCH 007/499] Updated Source --- .../0001-POM-Changes.patch | 4 +- ...erences-from-Waterfall-to-Travertine.patch | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 2 +- .../0004-FlameCord-General-Patch.patch | 415 +----------------- ...0005-Made-ProxyPingEvent-cancellable.patch | 76 ---- 5 files changed, 26 insertions(+), 473 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index 8b0ecc5b..d260ddc7 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From ab9f785419e209fb06cf97efc4aeab8e90be4de3 Mon Sep 17 00:00:00 2001 +From a47f601dd57ecdb47c6584049af9cd60170217fb Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -452,7 +452,7 @@ index ec465dd3..28d1a02c 100644 diff --git a/pom.xml b/pom.xml -index 3ca7ca91..94e4aca2 100644 +index 3ddd74d4..61920717 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index cbe2f012..1239e25e 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,4 +1,4 @@ -From d36304d0c88848a71aa77ea70e9b44e0b1ea506c Mon Sep 17 00:00:00 2001 +From c5297e2d5a213b4952fad9ac5cd20431ef495957 Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 156c680a..342fb74d 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From f3a05a0d743b35976ff51154c5b17003668c37c8 Mon Sep 17 00:00:00 2001 +From 91636d5561c027666b7742e8a4f46c164e05d86e Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index 671d79bd..79980e80 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -1,32 +1,9 @@ -From b5fbd45e9ba865cb9af6f9aa4f75afb140db7647 Mon Sep 17 00:00:00 2001 +From de242ae5cc0aa9b3b86285cb38eee3a372c6312f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch -diff --git a/api/.factorypath b/api/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/api/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java index cf85ca06..8a945a99 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java @@ -71,97 +48,6 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. -diff --git a/bootstrap/.factorypath b/bootstrap/.factorypath -new file mode 100644 -index 00000000..b9f2c65d ---- /dev/null -+++ b/bootstrap/.factorypath -@@ -0,0 +1,37 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/chat/.factorypath b/chat/.factorypath -new file mode 100644 -index 00000000..ed4e646c ---- /dev/null -+++ b/chat/.factorypath -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -+ -diff --git a/config/.factorypath b/config/.factorypath -new file mode 100644 -index 00000000..6e60b565 ---- /dev/null -+++ b/config/.factorypath -@@ -0,0 +1,7 @@ -+ -+ -+ -+ -+ -+ -+ -diff --git a/event/.factorypath b/event/.factorypath -new file mode 100644 -index 00000000..f398f41e ---- /dev/null -+++ b/event/.factorypath -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ -diff --git a/flamecord/.factorypath b/flamecord/.factorypath -new file mode 100644 -index 00000000..ed4e646c ---- /dev/null -+++ b/flamecord/.factorypath -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -+ diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 index 00000000..dd511dac @@ -759,196 +645,6 @@ index 00000000..8a474758 + } +} \ No newline at end of file -diff --git a/log/.factorypath b/log/.factorypath -new file mode 100644 -index 00000000..542d5259 ---- /dev/null -+++ b/log/.factorypath -@@ -0,0 +1,7 @@ -+ -+ -+ -+ -+ -+ -+ -diff --git a/log4j/.factorypath b/log4j/.factorypath -new file mode 100644 -index 00000000..f08118bd ---- /dev/null -+++ b/log4j/.factorypath -@@ -0,0 +1,18 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-alert/.factorypath b/module/cmd-alert/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/cmd-alert/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-find/.factorypath b/module/cmd-find/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/cmd-find/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-list/.factorypath b/module/cmd-list/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/cmd-list/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-send/.factorypath b/module/cmd-send/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/cmd-send/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/cmd-server/.factorypath b/module/cmd-server/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/cmd-server/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/module/reconnect-yaml/.factorypath b/module/reconnect-yaml/.factorypath -new file mode 100644 -index 00000000..29bce69c ---- /dev/null -+++ b/module/reconnect-yaml/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/native/.factorypath b/native/.factorypath -new file mode 100644 -index 00000000..3ae914e6 ---- /dev/null -+++ b/native/.factorypath -@@ -0,0 +1,9 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/pom.xml b/pom.xml index 61920717..2126cda1 100644 --- a/pom.xml @@ -963,26 +659,6 @@ index 61920717..2126cda1 100644 -diff --git a/protocol/.factorypath b/protocol/.factorypath -new file mode 100644 -index 00000000..192c13a0 ---- /dev/null -+++ b/protocol/.factorypath -@@ -0,0 +1,14 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/protocol/pom.xml b/protocol/pom.xml index ba3ffe3d..9228f72a 100644 --- a/protocol/pom.xml @@ -1049,49 +725,6 @@ index ec932e92..0d9ed57d 100644 } finally { if ( slice != null ) -diff --git a/proxy/.factorypath b/proxy/.factorypath -new file mode 100644 -index 00000000..b9f2c65d ---- /dev/null -+++ b/proxy/.factorypath -@@ -0,0 +1,37 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/proxy/pom.xml b/proxy/pom.xml index 4bda0d62..0018d6f8 100644 --- a/proxy/pom.xml @@ -1240,7 +873,7 @@ index 527f310e..a4ef6d3b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..e051b9c7 100644 +index a17ed68e..d52a8878 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -1318,7 +951,26 @@ index a17ed68e..e051b9c7 100644 } public void reloadMessages() -@@ -815,4 +836,56 @@ public class BungeeCord extends ProxyServer +@@ -573,16 +594,8 @@ public class BungeeCord extends ProxyServer + @Override + public String getTranslation(String name, Object... args) + { +- String translation = ""; +- try +- { +- final String string = customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ); +- +- translation = ( args.length == 0 ) ? string : MessageFormat.format( string, args ); +- } catch ( MissingResourceException ex ) +- { +- } +- return translation; ++ // FlameCord - Use own translation system ++ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); + } + + @Override +@@ -815,4 +828,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -2280,29 +1932,6 @@ index 9a39f69e..008b03cb 100644 }; public static final Base BASE = new Base(); private static final KickStringWriter legacyKicker = new KickStringWriter(); -diff --git a/query/.factorypath b/query/.factorypath -new file mode 100644 -index 00000000..7bec3430 ---- /dev/null -+++ b/query/.factorypath -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index 0c1ecfb8..b3bdfd05 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java diff --git a/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch deleted file mode 100644 index d4ac9db0..00000000 --- a/Waterfall-Proxy-Patches/0005-Made-ProxyPingEvent-cancellable.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 8dee9ecddb83e174e6878cf4ec5a35f0d02701a7 Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata -Date: Sun, 18 Oct 2020 16:24:25 -0300 -Subject: [PATCH] Made proxyping cancellable - - -diff --git a/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java b/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java -index 4baa06a9..05bccaca 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java -@@ -2,10 +2,13 @@ package net.md_5.bungee.api.event; - - import lombok.Data; - import lombok.EqualsAndHashCode; -+import lombok.Getter; -+import lombok.Setter; - import lombok.ToString; - import net.md_5.bungee.api.Callback; - import net.md_5.bungee.api.ServerPing; - import net.md_5.bungee.api.connection.PendingConnection; -+import net.md_5.bungee.api.plugin.Cancellable; - - /** - * Called when the proxy is pinged with packet 0xFE from the server list. -@@ -13,9 +16,12 @@ import net.md_5.bungee.api.connection.PendingConnection; - @Data - @ToString(callSuper = false) - @EqualsAndHashCode(callSuper = false) --public class ProxyPingEvent extends AsyncEvent -+// FlameCord - Make ProxyPingEvent cancellable -+public class ProxyPingEvent extends AsyncEvent implements Cancellable - { -- -+ @Getter -+ @Setter -+ private boolean cancelled = false; - /** - * The connection asking for a ping response. - */ -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 138dffa0..dfc5ed93 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 -@@ -278,21 +278,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void done(ProxyPingEvent pingResult, Throwable error) - { -- Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine -- if ( bungee.getConnectionThrottle() != null ) -- { -- bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); -- } -- -- // FlameCord - Close if response is null -+ // FlameCord - Return and close if response is null or cancelled - // FlameCord - Return if connection is closed -- if (pingResult.getResponse() == null) { -+ if (pingResult.getResponse() == null || pingResult.isCancelled()) { - ch.close(); - return; - } else if (ch.isClosed()) { - return; - } - -+ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine -+ if ( bungee.getConnectionThrottle() != null ) -+ { -+ bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); -+ } -+ - // Travertine start - if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) - { --- -2.27.0.windows.1 - From f7a991bda947486b3c68c991e7ae9f1d17bb2ca4 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 19 Oct 2020 21:11:39 -0300 Subject: [PATCH 008/499] Bump version number --- Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index 79980e80..d8c2f22e 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -947,7 +947,7 @@ index a17ed68e..d52a8878 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.3"; ++ return "0.4.4"; } public void reloadMessages() From 7d6503519c756d2c9a610eebe9c984353bd003d0 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Oct 2020 20:00:41 -0300 Subject: [PATCH 009/499] Updated Source --- .../0001-POM-Changes.patch | 2 +- ...erences-from-Waterfall-to-Travertine.patch | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 2 +- .../0004-FlameCord-General-Patch.patch | 25 ++++++++++++++----- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index d260ddc7..1fa1d008 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From a47f601dd57ecdb47c6584049af9cd60170217fb Mon Sep 17 00:00:00 2001 +From 79314f3f9562434dc995c3f78d5957280f74ffdf Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index 1239e25e..5687ce68 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,4 +1,4 @@ -From c5297e2d5a213b4952fad9ac5cd20431ef495957 Mon Sep 17 00:00:00 2001 +From 233bdfc84602018866f1734a59acd7283cff9637 Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 342fb74d..72f9e2e3 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 91636d5561c027666b7742e8a4f46c164e05d86e Mon Sep 17 00:00:00 2001 +From 8ef6e7401671f8b6f331b4adc1e53641de80b844 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index d8c2f22e..94f8a4b9 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From de242ae5cc0aa9b3b86285cb38eee3a372c6312f Mon Sep 17 00:00:00 2001 +From 6535669389c557bd88a9da0845802f41501eab75 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -873,7 +873,7 @@ index 527f310e..a4ef6d3b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..d52a8878 100644 +index a17ed68e..9f8511fa 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -918,7 +918,20 @@ index a17ed68e..d52a8878 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -285,6 +296,16 @@ public class BungeeCord extends ProxyServer +@@ -275,9 +286,10 @@ public class BungeeCord extends ProxyServer + bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); + workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); + +- File moduleDirectory = new File( "modules" ); ++ // FlameCord - Use own module system ++ /* File moduleDirectory = new File( "modules" ); + moduleManager.load( this, moduleDirectory ); +- pluginManager.detectPlugins( moduleDirectory ); ++ pluginManager.detectPlugins( moduleDirectory ); */ + + pluginsFolder.mkdir(); + pluginManager.detectPlugins( pluginsFolder ); +@@ -285,6 +297,16 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -935,7 +948,7 @@ index a17ed68e..d52a8878 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -546,13 +567,13 @@ public class BungeeCord extends ProxyServer +@@ -546,13 +568,13 @@ public class BungeeCord extends ProxyServer @Override public String getName() { @@ -951,7 +964,7 @@ index a17ed68e..d52a8878 100644 } public void reloadMessages() -@@ -573,16 +594,8 @@ public class BungeeCord extends ProxyServer +@@ -573,16 +595,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { @@ -970,7 +983,7 @@ index a17ed68e..d52a8878 100644 } @Override -@@ -815,4 +828,56 @@ public class BungeeCord extends ProxyServer +@@ -815,4 +829,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } From e24d6b22894670d06a25dc7cd0a3612bc2f42392 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 2 Nov 2020 20:01:49 +0000 Subject: [PATCH 010/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 72503bf Preliminary 1.16.4 protocol support a2d39ae Updated Upstream (BungeeCord) (#574) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 50 ++++++++----------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/Waterfall b/Waterfall index 27e2885a..72503bfa 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 27e2885ab3759536fb5a16a3ff388511f3665ad8 +Subproject commit 72503bfab4967978c8cdc62d56bf6dc9c3164d6b diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index bff0e17e..7dd1d3ba 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 625904bd6432d8424530b17e58f498acd862b60d Mon Sep 17 00:00:00 2001 +From 26a4a525e697ec23dde6a9009cabc122362988d5 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -462,7 +462,7 @@ index d372933d..1feee418 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index f33bb5c4..659382c0 100644 +index 30b4d059..e0400383 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -6,6 +6,8 @@ import java.util.List; @@ -474,15 +474,15 @@ index f33bb5c4..659382c0 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -33,6 +35,7 @@ public class ProtocolConstants - public static final int MINECRAFT_1_16_2 = 751; +@@ -34,6 +36,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_16_3 = 753; + public static final int MINECRAFT_1_16_4 = 754; // Waterfall public static final List SUPPORTED_VERSIONS = Arrays.asList( + "1.7.x", "1.8.x", "1.9.x", "1.10.x", -@@ -44,6 +47,8 @@ public class ProtocolConstants +@@ -45,6 +48,8 @@ public class ProtocolConstants "1.16.x" ); public static final List SUPPORTED_VERSION_IDS = Arrays.asList( @@ -526,7 +526,7 @@ index c0d37142..a07e25b1 100644 if ( in.readableBytes() < length ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index d2a4dea6..ac47302b 100644 +index 828a5dbe..195ec088 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -1,5 +1,6 @@ @@ -535,20 +535,20 @@ index d2a4dea6..ac47302b 100644 +import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; import io.netty.buffer.ByteBuf; import java.util.UUID; - import lombok.AllArgsConstructor; -@@ -14,7 +15,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; + import lombok.Data; +@@ -12,7 +13,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; + @Data @NoArgsConstructor - @AllArgsConstructor @EqualsAndHashCode(callSuper = false) -public class Chat extends DefinedPacket +public class Chat extends MultiVersionPacketV17 { private static final UUID EMPTY_UUID = new UUID( 0L, 0L ); -@@ -32,6 +33,14 @@ public class Chat extends DefinedPacket - this( message, position, EMPTY_UUID ); +@@ -36,6 +37,13 @@ public class Chat extends DefinedPacket + this.position = position; + this.sender = sender == null ? EMPTY_UUID : sender; } - + // Travertine start + @Override + public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) @@ -556,11 +556,10 @@ index d2a4dea6..ac47302b 100644 + message = readString( buf ); + } + // Travertine end -+ + @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -51,6 +60,14 @@ public class Chat extends DefinedPacket +@@ -56,6 +64,14 @@ public class Chat extends DefinedPacket } } @@ -1457,7 +1456,7 @@ index b486f2aa..c12085e1 100644 throw CancelSendSignal.INSTANCE; } 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 b0125245..8c2a743a 100644 +index 7ec119ea..986a9d05 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer @@ -1468,7 +1467,7 @@ index b0125245..8c2a743a 100644 displayName = name; } -@@ -474,7 +475,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -497,7 +498,8 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1478,16 +1477,7 @@ index b0125245..8c2a743a 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -500,7 +502,7 @@ public final class UserConnection implements ProxiedPlayer - message = ChatComponentTransformer.getInstance().transform( this, true, message )[0]; - - // Action bar doesn't display the new JSON formattings, legacy works - send it using this for now -- if ( position == ChatMessageType.ACTION_BAR ) -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // Travertine - { - sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); - } else -@@ -685,6 +687,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -693,6 +695,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1495,7 +1485,7 @@ index b0125245..8c2a743a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -697,6 +700,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -705,6 +708,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1503,7 +1493,7 @@ index b0125245..8c2a743a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -726,6 +730,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -734,6 +738,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1669,7 +1659,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a5acf512..67b68a3b 100644 +index 84c20c68..fa8fbf9d 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap From 6095e426485aa6ae24ba3bd33425448b35a7ff1a Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 7 Nov 2020 16:43:03 -0300 Subject: [PATCH 011/499] Updated Source --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 53 ++++++++----------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/Waterfall b/Waterfall index 27e2885a..72503bfa 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 27e2885ab3759536fb5a16a3ff388511f3665ad8 +Subproject commit 72503bfab4967978c8cdc62d56bf6dc9c3164d6b diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 72f9e2e3..f9cf8a5e 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 8ef6e7401671f8b6f331b4adc1e53641de80b844 Mon Sep 17 00:00:00 2001 +From 26a4a525e697ec23dde6a9009cabc122362988d5 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -462,7 +462,7 @@ index d372933d..1feee418 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index f33bb5c4..659382c0 100644 +index 30b4d059..e0400383 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -6,6 +6,8 @@ import java.util.List; @@ -474,15 +474,15 @@ index f33bb5c4..659382c0 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -33,6 +35,7 @@ public class ProtocolConstants - public static final int MINECRAFT_1_16_2 = 751; +@@ -34,6 +36,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_16_3 = 753; + public static final int MINECRAFT_1_16_4 = 754; // Waterfall public static final List SUPPORTED_VERSIONS = Arrays.asList( + "1.7.x", "1.8.x", "1.9.x", "1.10.x", -@@ -44,6 +47,8 @@ public class ProtocolConstants +@@ -45,6 +48,8 @@ public class ProtocolConstants "1.16.x" ); public static final List SUPPORTED_VERSION_IDS = Arrays.asList( @@ -526,7 +526,7 @@ index c0d37142..a07e25b1 100644 if ( in.readableBytes() < length ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index d2a4dea6..ac47302b 100644 +index 828a5dbe..195ec088 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -1,5 +1,6 @@ @@ -535,20 +535,20 @@ index d2a4dea6..ac47302b 100644 +import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; import io.netty.buffer.ByteBuf; import java.util.UUID; - import lombok.AllArgsConstructor; -@@ -14,7 +15,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; + import lombok.Data; +@@ -12,7 +13,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; + @Data @NoArgsConstructor - @AllArgsConstructor @EqualsAndHashCode(callSuper = false) -public class Chat extends DefinedPacket +public class Chat extends MultiVersionPacketV17 { private static final UUID EMPTY_UUID = new UUID( 0L, 0L ); -@@ -32,6 +33,14 @@ public class Chat extends DefinedPacket - this( message, position, EMPTY_UUID ); +@@ -36,6 +37,13 @@ public class Chat extends DefinedPacket + this.position = position; + this.sender = sender == null ? EMPTY_UUID : sender; } - + // Travertine start + @Override + public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) @@ -556,11 +556,10 @@ index d2a4dea6..ac47302b 100644 + message = readString( buf ); + } + // Travertine end -+ + @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -51,6 +60,14 @@ public class Chat extends DefinedPacket +@@ -56,6 +64,14 @@ public class Chat extends DefinedPacket } } @@ -1457,7 +1456,7 @@ index b486f2aa..c12085e1 100644 throw CancelSendSignal.INSTANCE; } 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 b0125245..8c2a743a 100644 +index 7ec119ea..986a9d05 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer @@ -1468,7 +1467,7 @@ index b0125245..8c2a743a 100644 displayName = name; } -@@ -474,7 +475,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -497,7 +498,8 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1478,16 +1477,7 @@ index b0125245..8c2a743a 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -500,7 +502,7 @@ public final class UserConnection implements ProxiedPlayer - message = ChatComponentTransformer.getInstance().transform( this, true, message )[0]; - - // Action bar doesn't display the new JSON formattings, legacy works - send it using this for now -- if ( position == ChatMessageType.ACTION_BAR ) -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // Travertine - { - sendMessage( position, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); - } else -@@ -685,6 +687,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -693,6 +695,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1495,7 +1485,7 @@ index b0125245..8c2a743a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -697,6 +700,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -705,6 +708,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1503,7 +1493,7 @@ index b0125245..8c2a743a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -726,6 +730,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -734,6 +738,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1669,7 +1659,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a5acf512..67b68a3b 100644 +index 84c20c68..fa8fbf9d 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap @@ -2038,5 +2028,4 @@ index daf12f74..e33861ab 100644 @Override -- -2.27.0.windows.1 - +2.28.0 From a83f88c125154e92d74ed7641cffbf2e6e6c3af1 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 7 Nov 2020 17:31:48 -0300 Subject: [PATCH 012/499] Bump version number --- Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index 94f8a4b9..93a71e21 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -960,7 +960,7 @@ index a17ed68e..9f8511fa 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.4"; ++ return "0.4.5"; } public void reloadMessages() From 1866a16c0f04e408330844b8a1ae4905ae64cbc2 Mon Sep 17 00:00:00 2001 From: Olivia Date: Sun, 22 Nov 2020 22:48:18 -0600 Subject: [PATCH 013/499] Updated Upstream (Waterfall) (#145) 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 Waterfall Changes: 85f0a0c Capture some script failure states better 7bf2352 Updated Upstream (BungeeCord) c617bbf Updated Upstream (BungeeCord) (#579) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall b/Waterfall index 72503bfa..85f0a0c6 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 72503bfab4967978c8cdc62d56bf6dc9c3164d6b +Subproject commit 85f0a0c69a5d1ffbf759ae5553a3b09d1f520eda diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 7dd1d3ba..4a8a6fed 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 26a4a525e697ec23dde6a9009cabc122362988d5 Mon Sep 17 00:00:00 2001 +From f9955fcb4091c2ede107ebc8a1c09848e933e839 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -462,7 +462,7 @@ index d372933d..1feee418 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index 30b4d059..e0400383 100644 +index 2202c4d3..6600185b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -6,6 +6,8 @@ import java.util.List; @@ -476,7 +476,7 @@ index 30b4d059..e0400383 100644 public static final int MINECRAFT_1_9_1 = 108; @@ -34,6 +36,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_16_3 = 753; - public static final int MINECRAFT_1_16_4 = 754; // Waterfall + public static final int MINECRAFT_1_16_4 = 754; public static final List SUPPORTED_VERSIONS = Arrays.asList( + "1.7.x", "1.8.x", @@ -1659,7 +1659,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 84c20c68..fa8fbf9d 100644 +index db93d883..a3a12e19 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap @@ -2028,5 +2028,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.28.0 +2.29.2 From 629df465cbcabad99fafb2e929589b18963ced5d Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 2 Dec 2020 19:13:52 +0000 Subject: [PATCH 014/499] Updated Upstream (Waterfall) 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 Waterfall Changes: e6b1b10 Brrrrr --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 25 ++++++++----------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Waterfall b/Waterfall index 85f0a0c6..e6b1b105 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 85f0a0c69a5d1ffbf759ae5553a3b09d1f520eda +Subproject commit e6b1b105d08a0dddb0b78a99ce893c918683b9c7 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 4a8a6fed..735ee73d 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From f9955fcb4091c2ede107ebc8a1c09848e933e839 Mon Sep 17 00:00:00 2001 +From 682bb544387936931880d662162b2fe107a4289b Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -1571,24 +1571,19 @@ index 9e180c30..d54d8539 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 7e6027aa..fe6ff143 100644 +index b7ecd828..3b82219d 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 -@@ -12,6 +12,13 @@ import java.util.List; - import java.util.UUID; - import java.util.logging.Level; - import javax.crypto.SecretKey; -+ -+import com.google.common.base.Charsets; -+import com.google.common.base.Preconditions; -+import com.google.gson.Gson; -+ +@@ -3,6 +3,8 @@ package net.md_5.bungee.connection; + import com.google.common.base.Charsets; + import com.google.common.base.Preconditions; + import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -@@ -255,12 +262,28 @@ public class InitialHandler extends PacketHandler implements PendingConnection + import java.math.BigInteger; + import java.net.InetSocketAddress; + import java.net.SocketAddress; +@@ -257,12 +259,28 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { From 9d447e31c26c518e76d8e06ff6769cac2930a2f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Dec 2020 02:41:37 -0300 Subject: [PATCH 015/499] Updated Source --- .../0003-1.7.x-Protocol-Patch.patch | 5 +-- .../0004-FlameCord-General-Patch.patch | 33 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index f9cf8a5e..fb0fed91 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 26a4a525e697ec23dde6a9009cabc122362988d5 Mon Sep 17 00:00:00 2001 +From b6b69ea63842698a6908a856501862117321908f Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -2028,4 +2028,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.28.0 +2.27.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index 93a71e21..a9e1c128 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 6535669389c557bd88a9da0845802f41501eab75 Mon Sep 17 00:00:00 2001 +From 13ed2a8b62e2b6be02f4aa865d0b7b669755bdbb Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -498,10 +498,10 @@ index 00000000..e82c4844 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java new file mode 100644 -index 00000000..aca06844 +index 00000000..6a661898 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,30 @@ +package dev._2lstudios.flamecord.firewall; + +import java.net.SocketAddress; @@ -520,6 +520,17 @@ index 00000000..aca06844 + public FirewallException(final String string, final Throwable throwable) { + super(string, throwable); + } ++ ++ @Override ++ public synchronized Throwable initCause(final Throwable cause) ++ { ++ return this; ++ } ++ ++ @Override ++ public synchronized Throwable fillInStackTrace() { ++ return this; ++ } +} \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java @@ -646,7 +657,7 @@ index 00000000..8a474758 +} \ No newline at end of file diff --git a/pom.xml b/pom.xml -index 61920717..2126cda1 100644 +index 1b773cc5..099e78d1 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,9 @@ @@ -679,7 +690,7 @@ index ba3ffe3d..9228f72a 100644 diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec932e92..0d9ed57d 100644 +index ec932e92..1ea85e18 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -700,9 +711,9 @@ index ec932e92..0d9ed57d 100644 + final int capacity = in.capacity(); + + if (readableBytes > 2097152) { -+ throw new DecoderException("Error decoding packet with too many readableBytes: " + readableBytes); ++ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); + } else if (capacity > 2097152) { -+ throw new DecoderException("Error decoding packet with too big capacity: " + capacity); ++ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); + } + } + @@ -718,9 +729,9 @@ index ec932e92..0d9ed57d 100644 + // FlameCord - Toggle Dumping packet info + // FlameCord - Change from FastDecoderException to DecoderException + if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new DecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall ++ throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall + } else { -+ throw new DecoderException( "Error decoding packet " + packetTypeStr, e ); ++ throw new FastDecoderException( "Error decoding packet " + packetTypeStr, e ); + } } finally { @@ -873,7 +884,7 @@ index 527f310e..a4ef6d3b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..9f8511fa 100644 +index a17ed68e..64249a00 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -1148,7 +1159,7 @@ index c12085e1..3cfef373 100644 bungee.getLogger().warning( "No client connected for pending server!" ); return; 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 8c2a743a..26c0e560 100644 +index 986a9d05..7c4c8f8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; From c624403c8a742953b8b7658d823e8d03e9858980 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+LinsaFTW@users.noreply.github.com> Date: Wed, 16 Dec 2020 02:46:52 -0300 Subject: [PATCH 016/499] Bump version number --- Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch index a9e1c128..4f64c798 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch @@ -971,7 +971,7 @@ index a17ed68e..64249a00 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.5"; ++ return "0.4.6"; } public void reloadMessages() From 0544b6209c8c91a6b2b4cd6a90edb784e587fb3f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:44 +0800 Subject: [PATCH 017/499] Split Patches --- ...ake-PlayerHandshakeEvent-cancellable.patch | 56 ++ .../0005-Make-a-getter-for-the-callback.patch | 23 + .../0006-FlameCord-POM-Changes.patch | 148 +++++ ...sable-update-checker-Use-bungee-name.patch | 74 +++ .../0008-Change-replaceAll-to-replace.patch | 23 + .../0009-Remove-Quitting-reason.patch | 67 ++ .../0010-Close-connections.patch | 73 ++ .../0011-Use-elseIfs.patch | 139 ++++ .../0012-Packet-Checks.patch | 33 + Waterfall-Proxy-Patches/0013-Rebrand.patch | 56 ++ .../0014-Default-timeout-to-10000.patch | 23 + ...tch => 0015-FlameCord-General-Patch.patch} | 622 +----------------- 12 files changed, 735 insertions(+), 602 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch create mode 100644 Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch create mode 100644 Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch create mode 100644 Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch create mode 100644 Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch create mode 100644 Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch create mode 100644 Waterfall-Proxy-Patches/0010-Close-connections.patch create mode 100644 Waterfall-Proxy-Patches/0011-Use-elseIfs.patch create mode 100644 Waterfall-Proxy-Patches/0012-Packet-Checks.patch create mode 100644 Waterfall-Proxy-Patches/0013-Rebrand.patch create mode 100644 Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch rename Waterfall-Proxy-Patches/{0004-FlameCord-General-Patch.patch => 0015-FlameCord-General-Patch.patch} (69%) diff --git a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch new file mode 100644 index 00000000..f936faab --- /dev/null +++ b/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch @@ -0,0 +1,56 @@ +From 9a7e67bef272c161ca784e54492e95e50140f384 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:57:23 +0800 +Subject: [PATCH] Make PlayerHandshakeEvent cancellable + + +diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +index 2f7b38d9..e29b0ed3 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +@@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; + + import lombok.Data; + import lombok.EqualsAndHashCode; ++import lombok.Getter; ++import lombok.Setter; + import lombok.ToString; + import net.md_5.bungee.api.connection.PendingConnection; ++import net.md_5.bungee.api.plugin.Cancellable; + import net.md_5.bungee.api.plugin.Event; + import net.md_5.bungee.protocol.packet.Handshake; + +@@ -14,8 +17,11 @@ import net.md_5.bungee.protocol.packet.Handshake; + @Data + @ToString(callSuper = false) + @EqualsAndHashCode(callSuper = false) +-public class PlayerHandshakeEvent extends Event +-{ ++// FlameCord - Implement cancellable ++public class PlayerHandshakeEvent extends Event implements Cancellable { ++ @Getter ++ @Setter ++ private boolean cancelled = false; + + /** + * Connection attempting to login. +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 fe6ff143..c2ec12b4 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 +@@ -341,7 +341,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); + +- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); ++ // FlameCord - Make PlayerHandshakeEvent cancellable ++ if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ++ ch.close(); ++ return; ++ } + + switch ( handshake.getRequestedProtocol() ) + { +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch new file mode 100644 index 00000000..a9189cd3 --- /dev/null +++ b/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch @@ -0,0 +1,23 @@ +From dc79f49dd3b926c3f156f66dd6996fcfd00a47b3 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:58:18 +0800 +Subject: [PATCH] Make a getter for the callback + + +diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +index cf85ca06..8a945a99 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +@@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; + @EqualsAndHashCode(callSuper = true) + public class AsyncEvent extends Event + { +- ++ // FlameCord - Make a getter for the callback ++ @Getter + private final Callback done; + private final Map intents = new ConcurrentHashMap<>(); + private final AtomicBoolean fired = new AtomicBoolean(); +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch new file mode 100644 index 00000000..8368c1b0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -0,0 +1,148 @@ +From 01363a40e321d368c0b686792a491cf892c1bf47 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:59:15 +0800 +Subject: [PATCH] FlameCord POM Changes + + +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +new file mode 100644 +index 00000000..dd511dac +--- /dev/null ++++ b/flamecord/pom.xml +@@ -0,0 +1,44 @@ ++ ++ 4.0.0 ++ ++ ++ io.github.waterfallmc ++ travertine-parent ++ 1.16-R0.4-SNAPSHOT ++ ../pom.xml ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ 1.16-R0.4-SNAPSHOT ++ jar ++ ++ Travertine-FlameCord ++ FlameCord adds security essentials and new configuration options ++ ++ ++ ++ io.github.waterfallmc ++ travertine-config ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-chat ++ ${project.version} ++ compile ++ ++ ++ ++ ++ ${project.name} ++ ++ ++ true ++ ${basedir}/src/main/resources ++ ++ ++ ++ +diff --git a/pom.xml b/pom.xml +index 1b773cc5..099e78d1 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -62,6 +62,9 @@ + proxy + query + native ++ ++ flamecord ++ + + + +diff --git a/protocol/pom.xml b/protocol/pom.xml +index ba3ffe3d..9228f72a 100644 +--- a/protocol/pom.xml ++++ b/protocol/pom.xml +@@ -64,5 +64,14 @@ + 1.3.0 + compile + ++ ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ ${project.version} ++ compile ++ ++ + + +diff --git a/proxy/pom.xml b/proxy/pom.xml +index 4bda0d62..0018d6f8 100644 +--- a/proxy/pom.xml ++++ b/proxy/pom.xml +@@ -113,6 +113,51 @@ + runtime + + ++ ++ ++ ++ dev._2lstudios ++ travertine-flamecord ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-alert ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-find ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-list ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-send ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-cmd-server ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ travertine-module-reconnect-yaml ++ ${project.version} ++ compile ++ ++ + + + +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch new file mode 100644 index 00000000..0fa35556 --- /dev/null +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -0,0 +1,74 @@ +From a931b0886161c8af9c8478dce3786c5de61b987e Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:00:49 +0800 +Subject: [PATCH] Disable update checker & Use bungee name + + +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +index ad9a6d0c..ad8f8733 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +@@ -40,25 +40,12 @@ public class BungeeCordLauncher + return; + } + +- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) +- { +- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); +- +- Calendar deadline = Calendar.getInstance(); +- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); +- if ( buildDate.before( deadline.getTime() ) ) +- { +- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); +- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); +- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); +- System.err.println( "*** Server will start in 10 seconds ***" ); +- Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); +- } +- } ++ // FlameCord - Disable update checker + + BungeeCord bungee = new BungeeCord(); + ProxyServer.setInstance( bungee ); +- bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); ++ // FlameCord - Use bungee name ++ bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); + bungee.start(); + + if ( !options.has( "noconsole" ) ) +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +index d4fad294..7994c1c1 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +@@ -22,6 +22,7 @@ import java.util.Locale; + import java.util.Map; + import java.util.logging.Level; + import lombok.RequiredArgsConstructor; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.Util; + import net.md_5.bungee.api.ChatColor; + import net.md_5.bungee.api.ProxyServer; +@@ -227,7 +228,8 @@ public class YamlConfig implements ConfigurationAdapter + Map val = entry.getValue(); + String name = entry.getKey(); + String addr = get( "address", "localhost:25565", val ); +- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); ++ // FlameCord - Use Bungee name instead ++ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); + boolean restricted = get( "restricted", false, val ); + SocketAddress address = Util.getAddr( addr ); + ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); +@@ -253,7 +255,8 @@ public class YamlConfig implements ConfigurationAdapter + + for ( Map val : base ) + { +- String motd = get( "motd", "&1Another Bungee server", val ); ++ // FlameCord - Use Bungee name instead ++ String motd = get( "motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val ); + motd = ChatColor.translateAlternateColorCodes( '&', motd ); + + int maxPlayers = get( "max_players", 1, val ); +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch new file mode 100644 index 00000000..c47df910 --- /dev/null +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -0,0 +1,23 @@ +From dca58a6a7ae25120b8aeccbe4f3ecf2c7fbef6a0 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:01:37 +0800 +Subject: [PATCH] Change replaceAll() to replace() + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index c12085e1..44f257ae 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -125,7 +125,8 @@ public class ServerConnector extends PacketHandler + newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); + + // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. +- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); ++ // FlameCord - Change replaceAll() to replace() ++ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); + + // All done. + properties = newp; +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch new file mode 100644 index 00000000..4b00e813 --- /dev/null +++ b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch @@ -0,0 +1,67 @@ +From 80ace46853567b268136b98cab869eb2dd495846 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:03:12 +0800 +Subject: [PATCH] Remove "Quitting" reason + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 44f257ae..e90237ac 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -267,7 +267,8 @@ public class ServerConnector extends PacketHandler + user.getSentBossBars().clear(); + + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- user.getServer().disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ user.getServer().disconnect(); + } else + { + // Travertine start +@@ -362,13 +363,15 @@ public class ServerConnector extends PacketHandler + user.setDimension( login.getDimension() ); + + // Remove from old servers +- user.getServer().disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ user.getServer().disconnect(); + } + + // TODO: Fix this? + if ( !user.isActive() ) + { +- server.disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ server.disconnect(); + // Silly server admins see stack trace and die + bungee.getLogger().warning( "No client connected for pending server!" ); + return; +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 986a9d05..6cc520c9 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -425,7 +425,8 @@ public final class UserConnection implements ProxiedPlayer + if ( server != null ) + { + server.setObsolete( true ); +- server.disconnect( "Quitting" ); ++ // FlameCord - Remove "Quitting" reason ++ server.disconnect(); + } + } + } +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 ad3bdee5..c05714ba 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 +@@ -92,6 +92,7 @@ public class UpstreamBridge extends PacketHandler + } + // Travertine end + } ++ // FlameCord - Remove "Quitting" reason + con.getServer().disconnect( "Quitting" ); + } + } +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0010-Close-connections.patch b/Waterfall-Proxy-Patches/0010-Close-connections.patch new file mode 100644 index 00000000..cdfb344b --- /dev/null +++ b/Waterfall-Proxy-Patches/0010-Close-connections.patch @@ -0,0 +1,73 @@ +From f352e9224c1610b6047cc001a0555f4b940ff71d Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:06:17 +0800 +Subject: [PATCH] Close connections + + +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 c2ec12b4..3e7f6d00 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 +@@ -197,6 +197,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + ServerPing legacy = result.getResponse(); ++ ++ // FlameCord - Close and return if legacy == null ++ if (legacy == null) { ++ ch.close(); ++ return; ++ } ++ + String kickMessage; + + if ( v1_5 ) +@@ -267,6 +274,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); + } ++ ++ // FlameCord - Close if response is null ++ // FlameCord - Return if connection is closed ++ if (pingResult.getResponse() == null) { ++ ch.close(); ++ return; ++ } else if (ch.isClosed()) { ++ return; ++ } ++ + // Travertine start + if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) + { +@@ -307,11 +324,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void handle(PingPacket ping) throws Exception + { +- if (!ACCEPT_INVALID_PACKETS) { +- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); +- } ++ // FlameCord - Never accept invalid packets ++ Preconditions.checkState(thisState == State.PING, "Not expecting PING"); + unsafe.sendPacket( ping ); +- disconnect( "" ); ++ // FlameCord - Close instead of disconnect ++ ch.close(); + } + + @Override +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index 0c1ecfb8..b3bdfd05 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler + if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) + { + bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); ++ // FlameCord - Close on incorrect magic ++ ctx.close(); + return; + } + +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch new file mode 100644 index 00000000..311d0041 --- /dev/null +++ b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch @@ -0,0 +1,139 @@ +From 40440185e64d394ef7bda875820891ebea847ca8 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:07:26 +0800 +Subject: [PATCH] Use elseIfs + + +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 +index d54d8539..1be39af0 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -285,6 +285,7 @@ public class DownstreamBridge extends PacketHandler + throw CancelSendSignal.INSTANCE; + } + ++ // FlameCord - Use elseIfs + if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) + { + // Travertine start +@@ -313,8 +314,7 @@ public class DownstreamBridge extends PacketHandler + con.unsafe().sendPacket( pluginMessage ); + throw CancelSendSignal.INSTANCE; + } +- +- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) ++ else if ( pluginMessage.getTag().equals( "BungeeCord" ) ) + { + DataInput in = pluginMessage.getStream(); + ByteArrayDataOutput out = ByteStreams.newDataOutput(); +@@ -343,7 +343,7 @@ public class DownstreamBridge extends PacketHandler + // Null out stream, important as we don't want to send to ourselves + out = null; + } +- if ( subChannel.equals( "Forward" ) ) ++ else if ( subChannel.equals( "Forward" ) ) + { + // Read data from server + String target = in.readUTF(); +@@ -388,7 +388,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "Connect" ) ) ++ else if ( subChannel.equals( "Connect" ) ) + { + ServerInfo server = bungee.getServerInfo( in.readUTF() ); + if ( server != null ) +@@ -396,7 +396,7 @@ public class DownstreamBridge extends PacketHandler + con.connect( server, ServerConnectEvent.Reason.PLUGIN_MESSAGE ); + } + } +- if ( subChannel.equals( "ConnectOther" ) ) ++ else if ( subChannel.equals( "ConnectOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +@@ -408,7 +408,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "IP" ) ) ++ else if ( subChannel.equals( "IP" ) ) + { + out.writeUTF( "IP" ); + if ( con.getSocketAddress() instanceof InetSocketAddress ) +@@ -421,7 +421,7 @@ public class DownstreamBridge extends PacketHandler + out.writeInt( 0 ); + } + } +- if ( subChannel.equals( "IPOther" ) ) ++ else if ( subChannel.equals( "IPOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +@@ -440,7 +440,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "PlayerCount" ) ) ++ else if ( subChannel.equals( "PlayerCount" ) ) + { + String target = in.readUTF(); + out.writeUTF( "PlayerCount" ); +@@ -458,7 +458,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "PlayerList" ) ) ++ else if ( subChannel.equals( "PlayerList" ) ) + { + String target = in.readUTF(); + out.writeUTF( "PlayerList" ); +@@ -476,12 +476,12 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "GetServers" ) ) ++ else if ( subChannel.equals( "GetServers" ) ) + { + out.writeUTF( "GetServers" ); + out.writeUTF( Util.csv( bungee.getServers().keySet() ) ); + } +- if ( subChannel.equals( "Message" ) ) ++ else if ( subChannel.equals( "Message" ) ) + { + String target = in.readUTF(); + String message = in.readUTF(); +@@ -500,7 +500,7 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "MessageRaw" ) ) ++ else if ( subChannel.equals( "MessageRaw" ) ) + { + String target = in.readUTF(); + BaseComponent[] message = ComponentSerializer.parse( in.readUTF() ); +@@ -519,17 +519,17 @@ public class DownstreamBridge extends PacketHandler + } + } + } +- if ( subChannel.equals( "GetServer" ) ) ++ else if ( subChannel.equals( "GetServer" ) ) + { + out.writeUTF( "GetServer" ); + out.writeUTF( server.getInfo().getName() ); + } +- if ( subChannel.equals( "UUID" ) ) ++ else if ( subChannel.equals( "UUID" ) ) + { + out.writeUTF( "UUID" ); + out.writeUTF( con.getUUID() ); + } +- if ( subChannel.equals( "UUIDOther" ) ) ++ else if ( subChannel.equals( "UUIDOther" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch new file mode 100644 index 00000000..42c37c1e --- /dev/null +++ b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch @@ -0,0 +1,33 @@ +From ce3a53d84ba7dbe3a0f50817ccad80ae41176309 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:10:30 +0800 +Subject: [PATCH] Packet Checks + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index ec932e92..f1f34626 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -39,6 +39,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; ++ ++ // FlameCord - Check size before decoding ++ if (prot == protocol.TO_SERVER) { ++ final int readableBytes = in.readableBytes(); ++ final int capacity = in.capacity(); ++ ++ if (readableBytes > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); ++ } else if (capacity > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); ++ } ++ } ++ + ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( + + Object packetTypeInfo = null; +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0013-Rebrand.patch b/Waterfall-Proxy-Patches/0013-Rebrand.patch new file mode 100644 index 00000000..0789be6d --- /dev/null +++ b/Waterfall-Proxy-Patches/0013-Rebrand.patch @@ -0,0 +1,56 @@ +From d4213ec9e7529f96c403a2a6af8f24b6e5aa2242 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:11:48 +0800 +Subject: [PATCH] Rebrand + + +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index 527f310e..a4ef6d3b 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { + YamlConfig config = new YamlConfig(new File("waterfall.yml")); + config.load(false); // Load, but no permissions + logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); +- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); ++ // FlameCord - Make the version look better ++ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); + useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index a17ed68e..3e4ebfc5 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -546,13 +546,13 @@ public class BungeeCord extends ProxyServer + @Override + public String getName() + { +- return "Travertine"; ++ return "FlameCord"; + } + + @Override + public String getVersion() + { +- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); ++ return "0.4.6"; + } + + public void reloadMessages() +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +index 4e2c6129..aeda7963 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +@@ -16,6 +16,7 @@ public class CommandBungee extends Command + @Override + public void execute(CommandSender sender, String[] args) + { +- sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ // FlameCord - Use custom version message ++ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); + } + } +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch new file mode 100644 index 00000000..7f7912ae --- /dev/null +++ b/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch @@ -0,0 +1,23 @@ +From b8e427d68694e1af04e005b78f4c58e161c8ee35 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:14:02 +0800 +Subject: [PATCH] Default timeout to 10000 + + +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +index 85d2197a..1294495d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +@@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig + /** + * Time before users are disconnected due to no network activity. + */ +- private int timeout = 30000; ++ // FlameCord - Default timeout to 10000 ++ private int timeout = 10000; + /** + * UUID used for metrics. + */ +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch similarity index 69% rename from Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch index 4f64c798..f84c150d 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch @@ -1,103 +1,9 @@ -From 13ed2a8b62e2b6be02f4aa865d0b7b669755bdbb Mon Sep 17 00:00:00 2001 +From 1c6e0cad8181bf4807db81ddbbab9935245d593d Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch -diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -index cf85ca06..8a945a99 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -@@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; - @EqualsAndHashCode(callSuper = true) - public class AsyncEvent extends Event - { -- -+ // FlameCord - Make a getter for the callback -+ @Getter - private final Callback done; - private final Map intents = new ConcurrentHashMap<>(); - private final AtomicBoolean fired = new AtomicBoolean(); -diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9..e29b0ed3 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -@@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; - - import lombok.Data; - import lombok.EqualsAndHashCode; -+import lombok.Getter; -+import lombok.Setter; - import lombok.ToString; - import net.md_5.bungee.api.connection.PendingConnection; -+import net.md_5.bungee.api.plugin.Cancellable; - import net.md_5.bungee.api.plugin.Event; - import net.md_5.bungee.protocol.packet.Handshake; - -@@ -14,8 +17,11 @@ import net.md_5.bungee.protocol.packet.Handshake; - @Data - @ToString(callSuper = false) - @EqualsAndHashCode(callSuper = false) --public class PlayerHandshakeEvent extends Event --{ -+// FlameCord - Implement cancellable -+public class PlayerHandshakeEvent extends Event implements Cancellable { -+ @Getter -+ @Setter -+ private boolean cancelled = false; - - /** - * Connection attempting to login. -diff --git a/flamecord/pom.xml b/flamecord/pom.xml -new file mode 100644 -index 00000000..dd511dac ---- /dev/null -+++ b/flamecord/pom.xml -@@ -0,0 +1,44 @@ -+ -+ 4.0.0 -+ -+ -+ io.github.waterfallmc -+ travertine-parent -+ 1.16-R0.4-SNAPSHOT -+ ../pom.xml -+ -+ -+ dev._2lstudios -+ travertine-flamecord -+ 1.16-R0.4-SNAPSHOT -+ jar -+ -+ Travertine-FlameCord -+ FlameCord adds security essentials and new configuration options -+ -+ -+ -+ io.github.waterfallmc -+ travertine-config -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-chat -+ ${project.version} -+ compile -+ -+ -+ -+ -+ ${project.name} -+ -+ -+ true -+ ${basedir}/src/main/resources -+ -+ -+ -+ diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 index 00000000..fd889644 @@ -656,41 +562,8 @@ index 00000000..8a474758 + } +} \ No newline at end of file -diff --git a/pom.xml b/pom.xml -index 1b773cc5..099e78d1 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -62,6 +62,9 @@ - proxy - query - native -+ -+ flamecord -+ - - - -diff --git a/protocol/pom.xml b/protocol/pom.xml -index ba3ffe3d..9228f72a 100644 ---- a/protocol/pom.xml -+++ b/protocol/pom.xml -@@ -64,5 +64,14 @@ - 1.3.0 - compile - -+ -+ -+ -+ dev._2lstudios -+ travertine-flamecord -+ ${project.version} -+ compile -+ -+ - - diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec932e92..1ea85e18 100644 +index f1f34626..1ea85e18 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -700,27 +573,7 @@ index ec932e92..1ea85e18 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -39,6 +40,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - - Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ -+ // FlameCord - Check size before decoding -+ if (prot == protocol.TO_SERVER) { -+ final int readableBytes = in.readableBytes(); -+ final int capacity = in.capacity(); -+ -+ if (readableBytes > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); -+ } else if (capacity > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); -+ } -+ } -+ - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( - - Object packetTypeInfo = null; -@@ -79,7 +93,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -92,7 +93,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } @@ -736,62 +589,6 @@ index ec932e92..1ea85e18 100644 } finally { if ( slice != null ) -diff --git a/proxy/pom.xml b/proxy/pom.xml -index 4bda0d62..0018d6f8 100644 ---- a/proxy/pom.xml -+++ b/proxy/pom.xml -@@ -113,6 +113,51 @@ - runtime - - -+ -+ -+ -+ dev._2lstudios -+ travertine-flamecord -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-alert -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-find -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-list -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-send -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-cmd-server -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ travertine-module-reconnect-yaml -+ ${project.version} -+ compile -+ -+ - - - diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 index 00000000..fa0b59c2 @@ -869,22 +666,8 @@ index 00000000..fa0b59c2 + } + } +} -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 527f310e..a4ef6d3b 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { - YamlConfig config = new YamlConfig(new File("waterfall.yml")); - config.load(false); // Load, but no permissions - logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); -- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); -+ // FlameCord - Make the version look better -+ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); - useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); - // Throttling options - tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..64249a00 100644 +index 3e4ebfc5..316790ee 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -959,22 +742,6 @@ index a17ed68e..64249a00 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -546,13 +568,13 @@ public class BungeeCord extends ProxyServer - @Override - public String getName() - { -- return "Travertine"; -+ return "FlameCord"; - } - - @Override - public String getVersion() - { -- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.6"; - } - - public void reloadMessages() @@ -573,16 +595,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) @@ -1051,41 +818,8 @@ index a17ed68e..64249a00 100644 + pluginManager.registerCommand(null, new FlameCordCommand(this)); + } } -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index ad9a6d0c..ad8f8733 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -40,25 +40,12 @@ public class BungeeCordLauncher - return; - } - -- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) -- { -- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); -- -- Calendar deadline = Calendar.getInstance(); -- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); -- if ( buildDate.before( deadline.getTime() ) ) -- { -- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); -- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); -- System.err.println( "*** Server will start in 10 seconds ***" ); -- Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); -- } -- } -+ // FlameCord - Disable update checker - - BungeeCord bungee = new BungeeCord(); - ProxyServer.setInstance( bungee ); -- bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); -+ // FlameCord - Use bungee name -+ bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); - bungee.start(); - - if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index c12085e1..3cfef373 100644 +index e90237ac..3cfef373 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -1105,17 +839,7 @@ index c12085e1..3cfef373 100644 import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.MinecraftDecoder; import net.md_5.bungee.protocol.PacketWrapper; -@@ -125,7 +128,8 @@ public class ServerConnector extends PacketHandler - newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); - - // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. -- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); -+ // FlameCord - Change replaceAll() to replace() -+ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); - - // All done. - properties = newp; -@@ -160,7 +164,13 @@ public class ServerConnector extends PacketHandler +@@ -161,7 +164,13 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -1130,36 +854,8 @@ index c12085e1..3cfef373 100644 } } -@@ -266,7 +276,8 @@ public class ServerConnector extends PacketHandler - user.getSentBossBars().clear(); - - user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -- user.getServer().disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ user.getServer().disconnect(); - } else - { - // Travertine start -@@ -361,13 +372,15 @@ public class ServerConnector extends PacketHandler - user.setDimension( login.getDimension() ); - - // Remove from old servers -- user.getServer().disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ user.getServer().disconnect(); - } - - // TODO: Fix this? - if ( !user.isActive() ) - { -- server.disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - // Silly server admins see stack trace and die - bungee.getLogger().warning( "No client connected for pending server!" ); - return; 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 986a9d05..7c4c8f8a 100644 +index 6cc520c9..7c4c8f8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -1202,205 +898,10 @@ index 986a9d05..7c4c8f8a 100644 } b.connect().addListener( listener ); } -@@ -425,7 +430,8 @@ public final class UserConnection implements ProxiedPlayer - if ( server != null ) - { - server.setObsolete( true ); -- server.disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 4e2c6129..aeda7963 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -@@ -16,6 +16,7 @@ public class CommandBungee extends Command - @Override - public void execute(CommandSender sender, String[] args) - { -- sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ // FlameCord - Use custom version message -+ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197a..1294495d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -@@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig - /** - * Time before users are disconnected due to no network activity. - */ -- private int timeout = 30000; -+ // FlameCord - Default timeout to 10000 -+ private int timeout = 10000; - /** - * UUID used for metrics. - */ -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index d4fad294..7994c1c1 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -@@ -22,6 +22,7 @@ import java.util.Locale; - import java.util.Map; - import java.util.logging.Level; - import lombok.RequiredArgsConstructor; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.Util; - import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.ProxyServer; -@@ -227,7 +228,8 @@ public class YamlConfig implements ConfigurationAdapter - Map val = entry.getValue(); - String name = entry.getKey(); - String addr = get( "address", "localhost:25565", val ); -- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); -+ // FlameCord - Use Bungee name instead -+ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); - boolean restricted = get( "restricted", false, val ); - SocketAddress address = Util.getAddr( addr ); - ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -@@ -253,7 +255,8 @@ public class YamlConfig implements ConfigurationAdapter - - for ( Map val : base ) - { -- String motd = get( "motd", "&1Another Bungee server", val ); -+ // FlameCord - Use Bungee name instead -+ String motd = get( "motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val ); - motd = ChatColor.translateAlternateColorCodes( '&', motd ); - - int maxPlayers = get( "max_players", 1, val ); 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 -index d54d8539..474551d3 100644 +index 1be39af0..474551d3 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -285,6 +285,7 @@ public class DownstreamBridge extends PacketHandler - throw CancelSendSignal.INSTANCE; - } - -+ // FlameCord - Use elseIfs - if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) - { - // Travertine start -@@ -313,8 +314,7 @@ public class DownstreamBridge extends PacketHandler - con.unsafe().sendPacket( pluginMessage ); - throw CancelSendSignal.INSTANCE; - } -- -- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) -+ else if ( pluginMessage.getTag().equals( "BungeeCord" ) ) - { - DataInput in = pluginMessage.getStream(); - ByteArrayDataOutput out = ByteStreams.newDataOutput(); -@@ -343,7 +343,7 @@ public class DownstreamBridge extends PacketHandler - // Null out stream, important as we don't want to send to ourselves - out = null; - } -- if ( subChannel.equals( "Forward" ) ) -+ else if ( subChannel.equals( "Forward" ) ) - { - // Read data from server - String target = in.readUTF(); -@@ -388,7 +388,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "Connect" ) ) -+ else if ( subChannel.equals( "Connect" ) ) - { - ServerInfo server = bungee.getServerInfo( in.readUTF() ); - if ( server != null ) -@@ -396,7 +396,7 @@ public class DownstreamBridge extends PacketHandler - con.connect( server, ServerConnectEvent.Reason.PLUGIN_MESSAGE ); - } - } -- if ( subChannel.equals( "ConnectOther" ) ) -+ else if ( subChannel.equals( "ConnectOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) -@@ -408,7 +408,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "IP" ) ) -+ else if ( subChannel.equals( "IP" ) ) - { - out.writeUTF( "IP" ); - if ( con.getSocketAddress() instanceof InetSocketAddress ) -@@ -421,7 +421,7 @@ public class DownstreamBridge extends PacketHandler - out.writeInt( 0 ); - } - } -- if ( subChannel.equals( "IPOther" ) ) -+ else if ( subChannel.equals( "IPOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) -@@ -440,7 +440,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "PlayerCount" ) ) -+ else if ( subChannel.equals( "PlayerCount" ) ) - { - String target = in.readUTF(); - out.writeUTF( "PlayerCount" ); -@@ -458,7 +458,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "PlayerList" ) ) -+ else if ( subChannel.equals( "PlayerList" ) ) - { - String target = in.readUTF(); - out.writeUTF( "PlayerList" ); -@@ -476,12 +476,12 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "GetServers" ) ) -+ else if ( subChannel.equals( "GetServers" ) ) - { - out.writeUTF( "GetServers" ); - out.writeUTF( Util.csv( bungee.getServers().keySet() ) ); - } -- if ( subChannel.equals( "Message" ) ) -+ else if ( subChannel.equals( "Message" ) ) - { - String target = in.readUTF(); - String message = in.readUTF(); -@@ -500,7 +500,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "MessageRaw" ) ) -+ else if ( subChannel.equals( "MessageRaw" ) ) - { - String target = in.readUTF(); - BaseComponent[] message = ComponentSerializer.parse( in.readUTF() ); -@@ -519,17 +519,17 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "GetServer" ) ) -+ else if ( subChannel.equals( "GetServer" ) ) - { - out.writeUTF( "GetServer" ); - out.writeUTF( server.getInfo().getName() ); - } -- if ( subChannel.equals( "UUID" ) ) -+ else if ( subChannel.equals( "UUID" ) ) - { - out.writeUTF( "UUID" ); - out.writeUTF( con.getUUID() ); - } -- if ( subChannel.equals( "UUIDOther" ) ) -+ else if ( subChannel.equals( "UUIDOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) @@ -539,18 +539,21 @@ public class DownstreamBridge extends PacketHandler out.writeUTF( player.getUUID() ); } @@ -1429,7 +930,7 @@ index d54d8539..474551d3 100644 ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); if ( player != null ) 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 fe6ff143..138dffa0 100644 +index 3e7f6d00..138dffa0 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 @@ -19,6 +19,8 @@ import com.google.gson.Gson; @@ -1464,65 +965,7 @@ index fe6ff143..138dffa0 100644 } } -@@ -197,6 +206,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - - ServerPing legacy = result.getResponse(); -+ -+ // FlameCord - Close and return if legacy == null -+ if (legacy == null) { -+ ch.close(); -+ return; -+ } -+ - String kickMessage; - - if ( v1_5 ) -@@ -267,6 +283,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); - } -+ -+ // FlameCord - Close if response is null -+ // FlameCord - Return if connection is closed -+ if (pingResult.getResponse() == null) { -+ ch.close(); -+ return; -+ } else if (ch.isClosed()) { -+ return; -+ } -+ - // Travertine start - if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) - { -@@ -307,11 +333,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void handle(PingPacket ping) throws Exception - { -- if (!ACCEPT_INVALID_PACKETS) { -- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); -- } -+ // FlameCord - Never accept invalid packets -+ Preconditions.checkState(thisState == State.PING, "Not expecting PING"); - unsafe.sendPacket( ping ); -- disconnect( "" ); -+ // FlameCord - Close instead of disconnect -+ ch.close(); - } - - @Override -@@ -341,13 +367,18 @@ public class InitialHandler extends PacketHandler implements PendingConnection - - this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); - -- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); -+ // FlameCord - Make PlayerHandshakeEvent cancellable -+ if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { -+ ch.close(); -+ return; -+ } - - switch ( handshake.getRequestedProtocol() ) +@@ -368,7 +377,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -1532,7 +975,7 @@ index fe6ff143..138dffa0 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -356,7 +387,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -377,7 +387,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -1542,7 +985,7 @@ index fe6ff143..138dffa0 100644 { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } -@@ -386,13 +418,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -407,13 +418,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; @@ -1561,7 +1004,7 @@ index fe6ff143..138dffa0 100644 { disconnect( bungee.getTranslation( "name_too_long" ) ); return; -@@ -431,11 +466,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -452,11 +466,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); @@ -1575,7 +1018,7 @@ index fe6ff143..138dffa0 100644 } }; -@@ -447,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -468,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(final EncryptionResponse encryptResponse) throws Exception { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -1584,7 +1027,7 @@ index fe6ff143..138dffa0 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); -@@ -481,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -502,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -1596,7 +1039,7 @@ index fe6ff143..138dffa0 100644 finish(); return; } -@@ -499,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -520,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -1606,7 +1049,7 @@ index fe6ff143..138dffa0 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -580,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -601,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); @@ -1615,7 +1058,7 @@ index fe6ff143..138dffa0 100644 } } } ); -@@ -615,7 +657,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -636,7 +657,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -1625,7 +1068,7 @@ index fe6ff143..138dffa0 100644 } else { ch.close(); -@@ -672,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -693,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -1670,18 +1113,6 @@ index 6cd71071..09909bd9 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 ad3bdee5..c05714ba 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 -@@ -92,6 +92,7 @@ public class UpstreamBridge extends PacketHandler - } - // Travertine end - } -+ // FlameCord - Remove "Quitting" reason - con.getServer().disconnect( "Quitting" ); - } - } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java index 6dc5633f..606866a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1956,19 +1387,6 @@ index 9a39f69e..008b03cb 100644 }; public static final Base BASE = new Base(); private static final KickStringWriter legacyKicker = new KickStringWriter(); -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b3bdfd05 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler - if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) - { - bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); -+ // FlameCord - Close on incorrect magic -+ ctx.close(); - return; - } - -- -2.27.0.windows.1 +2.20.1 From e22cd73a9fe776c0f7f5aa2b9254812c35557884 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:39 +0800 Subject: [PATCH 018/499] more --- ...ctions-Don-t-flush-if-not-necessary.patch} | 68 ++++++- .../0011-Use-elseIfs.patch | 22 ++- .../0015-use-address-getHostString.patch | 32 ++++ ...o-encrypt-only-if-onlineMode-is-true.patch | 27 +++ ...0017-Don-t-allow-name-containing-dot.patch | 32 ++++ ...18-Use-pipeline-to-reduce-redundancy.patch | 45 +++++ ...tch => 0019-FlameCord-General-Patch.patch} | 172 +----------------- 7 files changed, 230 insertions(+), 168 deletions(-) rename Waterfall-Proxy-Patches/{0010-Close-connections.patch => 0010-Close-connections-Don-t-flush-if-not-necessary.patch} (53%) create mode 100644 Waterfall-Proxy-Patches/0015-use-address-getHostString.patch create mode 100644 Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch create mode 100644 Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch create mode 100644 Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch rename Waterfall-Proxy-Patches/{0015-FlameCord-General-Patch.patch => 0019-FlameCord-General-Patch.patch} (88%) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 53% rename from Waterfall-Proxy-Patches/0010-Close-connections.patch rename to Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index cdfb344b..39b0aff0 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From f352e9224c1610b6047cc001a0555f4b940ff71d Mon Sep 17 00:00:00 2001 +From 180b59e0e41ddd48732dfb46c729b47c4469875b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 -Subject: [PATCH] Close connections +Subject: [PATCH] Close connections & Don't flush if not necessary 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 c2ec12b4..3e7f6d00 100644 +index c2ec12b4..1be9ae77 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 @@ -197,6 +197,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -55,6 +55,68 @@ index c2ec12b4..3e7f6d00 100644 } @Override +@@ -619,7 +636,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( canSendKickMessage() ) + { +- ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) ); ++ // FlameCord - Changed delayedClose to close ++ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); + } else + { + ch.close(); +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 6dc5633f..5c05f2b9 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -80,40 +80,27 @@ public class ChannelWrapper + + if ( packet != null && ch.isActive() ) + { +- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); ++ // FlameCord - Remove the firing of exceptions on failure ++ ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.CLOSE ); + } else + { +- ch.flush(); ++ // FlameCord - Don't flush just close + ch.close(); + } + } + } + ++ // FlameCord - Deprecate and "disable" delayedClose because it doesn't have a reason to exist ++ @Deprecated + public void delayedClose(final Kick kick) + { +- if ( !closing ) +- { +- closing = true; +- +- // Minecraft client can take some time to switch protocols. +- // Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it. +- // Delay 250ms to ensure that the protocol switch (if any) has definitely taken place. +- ch.eventLoop().schedule( new Runnable() +- { +- +- @Override +- public void run() +- { +- close( kick ); +- } +- }, 250, TimeUnit.MILLISECONDS ); +- } ++ close(kick); + } + + public void addBefore(String baseName, String name, ChannelHandler handler) + { + Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); +- ch.pipeline().flush(); ++ // FlameCord - Don't flush if not necessary + ch.pipeline().addBefore( baseName, name, handler ); + } + diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index 0c1ecfb8..b3bdfd05 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java diff --git a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch index 311d0041..bb96181b 100644 --- a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch +++ b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch @@ -1,11 +1,11 @@ -From 40440185e64d394ef7bda875820891ebea847ca8 Mon Sep 17 00:00:00 2001 +From 8483549f243a6d8aad3574fc2d6235c3326e2740 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:07:26 +0800 Subject: [PATCH] Use elseIfs 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 -index d54d8539..1be39af0 100644 +index d54d8539..0dd2884d 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -285,6 +285,7 @@ public class DownstreamBridge extends PacketHandler @@ -134,6 +134,24 @@ index d54d8539..1be39af0 100644 { ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); if ( player != null ) +@@ -539,7 +539,7 @@ public class DownstreamBridge extends PacketHandler + out.writeUTF( player.getUUID() ); + } + } +- if ( subChannel.equals( "ServerIP" ) ) ++ else if ( subChannel.equals( "ServerIP" ) ) + { + ServerInfo info = bungee.getServerInfo( in.readUTF() ); + if ( info != null && !info.getAddress().isUnresolved() ) +@@ -550,7 +550,7 @@ public class DownstreamBridge extends PacketHandler + out.writeShort( info.getAddress().getPort() ); + } + } +- if ( subChannel.equals( "KickPlayer" ) ) ++ else if ( subChannel.equals( "KickPlayer" ) ) + { + ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); + if ( player != null ) -- 2.20.1 diff --git a/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch b/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch new file mode 100644 index 00000000..ec2fe065 --- /dev/null +++ b/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch @@ -0,0 +1,32 @@ +From 7fc05a47e12839eb256a9141ab122886ca788522 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:24:42 +0800 +Subject: [PATCH] use address & getHostString + + +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 +index 0dd2884d..474551d3 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -542,12 +542,15 @@ public class DownstreamBridge extends PacketHandler + else if ( subChannel.equals( "ServerIP" ) ) + { + ServerInfo info = bungee.getServerInfo( in.readUTF() ); +- if ( info != null && !info.getAddress().isUnresolved() ) ++ // FlameCord use address ++ InetSocketAddress address = info.getAddress(); ++ if ( info != null && !address.isUnresolved() ) + { + out.writeUTF( "ServerIP" ); + out.writeUTF( info.getName() ); +- out.writeUTF( info.getAddress().getAddress().getHostAddress() ); +- out.writeShort( info.getAddress().getPort() ); ++ // FlameCord - Use getHostString ++ out.writeUTF( address.getHostString() ); ++ out.writeShort( address.getPort() ); + } + } + else if ( subChannel.equals( "KickPlayer" ) ) +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch new file mode 100644 index 00000000..56c1ac12 --- /dev/null +++ b/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -0,0 +1,27 @@ +From 1fa924e0e980d172556ff43ee97caee5211c53a0 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:25:03 +0800 +Subject: [PATCH] Change state to encrypt only if onlineMode is true + + +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 1be9ae77..93486904 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 +@@ -452,11 +452,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection + if ( onlineMode ) + { + unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); ++ // FlameCord - Change state to encrypt only if onlineMode is true ++ thisState = State.ENCRYPT; + } else + { + finish(); + } +- thisState = State.ENCRYPT; + } + }; + +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch new file mode 100644 index 00000000..07178391 --- /dev/null +++ b/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch @@ -0,0 +1,32 @@ +From 69632ee3a5f3963b39c933c2dba4d0c3ecf05f6c Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:25:51 +0800 +Subject: [PATCH] Don't allow name containing dot + + +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 93486904..1f5492fb 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 +@@ -407,13 +407,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); + this.loginRequest = loginRequest; + +- if ( getName().contains( "." ) ) ++ // FlameCord - Use name ++ final String name = getName(); ++ ++ if ( name.contains( "." ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; + } + +- if ( getName().length() > 16 ) ++ if ( name.length() > 16 ) + { + disconnect( bungee.getTranslation( "name_too_long" ) ); + return; +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch new file mode 100644 index 00000000..f4f97598 --- /dev/null +++ b/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch @@ -0,0 +1,45 @@ +From d89f2f435ff551a128625efd7f1d30758aa479b8 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:30:07 +0800 +Subject: [PATCH] Use pipeline to reduce redundancy + + +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 5c05f2b9..f9493ff0 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -5,6 +5,8 @@ import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandler; + import io.netty.channel.ChannelHandlerContext; ++import io.netty.channel.ChannelPipeline; ++ + import java.net.SocketAddress; + import java.util.concurrent.TimeUnit; + import lombok.Getter; +@@ -37,14 +39,18 @@ public class ChannelWrapper + + public void setProtocol(Protocol protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); + } + + public void setVersion(int protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); + } + + public void write(Object packet) +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch similarity index 88% rename from Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index f84c150d..4c4da2eb 100644 --- a/Waterfall-Proxy-Patches/0015-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 1c6e0cad8181bf4807db81ddbbab9935245d593d Mon Sep 17 00:00:00 2001 +From aef48f2c46615cf285d05112a25300ee47475d81 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -898,39 +898,8 @@ index 6cc520c9..7c4c8f8a 100644 } b.connect().addListener( listener ); } -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 -index 1be39af0..474551d3 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -539,18 +539,21 @@ public class DownstreamBridge extends PacketHandler - out.writeUTF( player.getUUID() ); - } - } -- if ( subChannel.equals( "ServerIP" ) ) -+ else if ( subChannel.equals( "ServerIP" ) ) - { - ServerInfo info = bungee.getServerInfo( in.readUTF() ); -- if ( info != null && !info.getAddress().isUnresolved() ) -+ // FlameCord use address -+ InetSocketAddress address = info.getAddress(); -+ if ( info != null && !address.isUnresolved() ) - { - out.writeUTF( "ServerIP" ); - out.writeUTF( info.getName() ); -- out.writeUTF( info.getAddress().getAddress().getHostAddress() ); -- out.writeShort( info.getAddress().getPort() ); -+ // FlameCord - Use getHostString -+ out.writeUTF( address.getHostString() ); -+ out.writeShort( address.getPort() ); - } - } -- if ( subChannel.equals( "KickPlayer" ) ) -+ else if ( subChannel.equals( "KickPlayer" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) 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 3e7f6d00..138dffa0 100644 +index 1f5492fb..138dffa0 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 @@ -19,6 +19,8 @@ import com.google.gson.Gson; @@ -985,40 +954,7 @@ index 3e7f6d00..138dffa0 100644 { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } -@@ -407,13 +418,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection - Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); - this.loginRequest = loginRequest; - -- if ( getName().contains( "." ) ) -+ // FlameCord - Use name -+ final String name = getName(); -+ -+ if ( name.contains( "." ) ) - { - disconnect( bungee.getTranslation( "name_invalid" ) ); - return; - } - -- if ( getName().length() > 16 ) -+ if ( name.length() > 16 ) - { - disconnect( bungee.getTranslation( "name_too_long" ) ); - return; -@@ -452,11 +466,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection - if ( onlineMode ) - { - unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); -+ // FlameCord - Change state to encrypt only if onlineMode is true -+ thisState = State.ENCRYPT; - } else - { - finish(); - } -- thisState = State.ENCRYPT; - } - }; - -@@ -468,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -472,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(final EncryptionResponse encryptResponse) throws Exception { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -1027,7 +963,7 @@ index 3e7f6d00..138dffa0 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); -@@ -502,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -506,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -1039,7 +975,7 @@ index 3e7f6d00..138dffa0 100644 finish(); return; } -@@ -520,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -1049,7 +985,7 @@ index 3e7f6d00..138dffa0 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -601,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -605,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); @@ -1058,17 +994,7 @@ index 3e7f6d00..138dffa0 100644 } } } ); -@@ -636,7 +657,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - if ( canSendKickMessage() ) - { -- ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) ); -+ // FlameCord - Changed delayedClose to close -+ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); - } else - { - ch.close(); -@@ -693,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -698,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -1114,90 +1040,10 @@ index 6cd71071..09909bd9 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..606866a5 100644 +index f9493ff0..606866a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -5,6 +5,8 @@ import io.netty.channel.Channel; - import io.netty.channel.ChannelFutureListener; - import io.netty.channel.ChannelHandler; - import io.netty.channel.ChannelHandlerContext; -+import io.netty.channel.ChannelPipeline; -+ - import java.net.SocketAddress; - import java.util.concurrent.TimeUnit; - import lombok.Getter; -@@ -37,14 +39,18 @@ public class ChannelWrapper - - public void setProtocol(Protocol protocol) - { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); -+ pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); - } - - public void setVersion(int protocol) - { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -+ pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); - } - - public void write(Object packet) -@@ -80,40 +86,27 @@ public class ChannelWrapper - - if ( packet != null && ch.isActive() ) - { -- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); -+ // FlameCord - Remove the firing of exceptions on failure -+ ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.CLOSE ); - } else - { -- ch.flush(); -+ // FlameCord - Don't flush just close - ch.close(); - } - } - } - -+ // FlameCord - Deprecate and "disable" delayedClose because it doesn't have a reason to exist -+ @Deprecated - public void delayedClose(final Kick kick) - { -- if ( !closing ) -- { -- closing = true; -- -- // Minecraft client can take some time to switch protocols. -- // Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it. -- // Delay 250ms to ensure that the protocol switch (if any) has definitely taken place. -- ch.eventLoop().schedule( new Runnable() -- { -- -- @Override -- public void run() -- { -- close( kick ); -- } -- }, 250, TimeUnit.MILLISECONDS ); -- } -+ close(kick); - } - - public void addBefore(String baseName, String name, ChannelHandler handler) - { - Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); -- ch.pipeline().flush(); -+ // FlameCord - Don't flush if not necessary - ch.pipeline().addBefore( baseName, name, handler ); - } - -@@ -124,25 +117,27 @@ public class ChannelWrapper +@@ -117,25 +117,27 @@ public class ChannelWrapper public void setCompressionThreshold(int compressionThreshold) { From 531d2531dbe418db2c6334e4c4d1707975229c6b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:38:57 +0800 Subject: [PATCH 019/499] more --- ...ections-Don-t-flush-if-not-necessary.patch | 47 ++++++- ...18-Use-pipeline-to-reduce-redundancy.patch | 37 +++++- ...tom-uuids-even-if-onlineMode-is-true.patch | 22 ++++ ...y-to-avoid-multiple-incoming-packets.patch | 32 +++++ ...tch => 0021-FlameCord-General-Patch.patch} | 121 +++--------------- 5 files changed, 151 insertions(+), 108 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch create mode 100644 Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch rename Waterfall-Proxy-Patches/{0019-FlameCord-General-Patch.patch => 0021-FlameCord-General-Patch.patch} (92%) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 39b0aff0..7dc2a392 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 180b59e0e41ddd48732dfb46c729b47c4469875b Mon Sep 17 00:00:00 2001 +From 27a82ea70541b4167033f519d91a7117145530cf Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -117,6 +117,51 @@ index 6dc5633f..5c05f2b9 100644 ch.pipeline().addBefore( baseName, name, handler ); } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 989bfd87..1351d5d5 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -56,7 +56,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + if ( handler != null ) + { +- channel.markClosed(); ++ // FlameCord - close instead of markClosed ++ channel.close(); + handler.disconnected( channel ); + + if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) +@@ -180,8 +181,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); + } + } +- +- ctx.close(); + } ++ ++ // FlameCord - Close even if the channel isn't active ++ ctx.close(); + } + } +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 9a39f69e..7e407136 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 +@@ -102,6 +102,14 @@ public class PipelineUtils + + BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); + } ++ ++ // FlameCord - Close on exception caught ++ @Override ++ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ++ cause.printStackTrace(); ++ ++ ctx.close(); ++ } + }; + public static final Base BASE = new Base(); + private static final KickStringWriter legacyKicker = new KickStringWriter(); diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index 0c1ecfb8..b3bdfd05 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java diff --git a/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch index f4f97598..c8cfdf29 100644 --- a/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From d89f2f435ff551a128625efd7f1d30758aa479b8 Mon Sep 17 00:00:00 2001 +From 9c45d17f7e322b01c8a5a55d21b7cb1d65345056 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 5c05f2b9..f9493ff0 100644 +index 5c05f2b9..606866a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -40,6 +40,39 @@ index 5c05f2b9..f9493ff0 100644 } public void write(Object packet) +@@ -111,25 +117,27 @@ public class ChannelWrapper + + public void setCompressionThreshold(int compressionThreshold) + { +- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); + } + if ( compressionThreshold != -1 ) + { +- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); ++ pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); + } else + { +- ch.pipeline().remove( "compress" ); ++ pipeline.remove( "compress" ); + } + +- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) ++ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); + } + if ( compressionThreshold == -1 ) + { +- ch.pipeline().remove( "decompress" ); ++ pipeline.remove( "decompress" ); + } + } + } -- 2.20.1 diff --git a/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch new file mode 100644 index 00000000..f9e419e1 --- /dev/null +++ b/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -0,0 +1,22 @@ +From ce563b65a254311d942f69311fa5e675cbedd48e Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:35:33 +0800 +Subject: [PATCH] Allow custom uuids even if onlineMode is true + + +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 1f5492fb..b71d25dc 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 +@@ -698,7 +698,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void setUniqueId(UUID uuid) + { + Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); +- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); ++ // FlameCord - Allow custom uuids even if onlineMode is true + this.uniqueId = uuid; + } + +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch new file mode 100644 index 00000000..e4f64a69 --- /dev/null +++ b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -0,0 +1,32 @@ +From 057f0c8645075d20539e813e8932e344ba6fa2c8 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:36:08 +0800 +Subject: [PATCH] Finish early to avoid multiple incoming packets + + +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 b71d25dc..eecdc3bd 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 +@@ -524,6 +524,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + private void finish() + { ++ // FlameCord - Finish here to avoid multiple incoming packets ++ thisState = State.FINISHED; ++ + if ( isOnlineMode() ) + { + // Check for multiple connections +@@ -605,8 +608,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); +- +- thisState = State.FINISHED; + } + } + } ); +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch similarity index 92% rename from Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch index 4c4da2eb..c5821f5b 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From aef48f2c46615cf285d05112a25300ee47475d81 Mon Sep 17 00:00:00 2001 +From a8c8e973a1767d1e5c01ebd8306f240c7de00ad0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -899,7 +899,7 @@ index 6cc520c9..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 1f5492fb..138dffa0 100644 +index eecdc3bd..138dffa0 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 @@ -19,6 +19,8 @@ import com.google.gson.Gson; @@ -975,34 +975,6 @@ index 1f5492fb..138dffa0 100644 finish(); return; } -@@ -524,6 +540,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - - private void finish() - { -+ // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHED; -+ - if ( isOnlineMode() ) - { - // Check for multiple connections -@@ -605,8 +624,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - - userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); -- -- thisState = State.FINISHED; - } - } - } ); -@@ -698,7 +715,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void setUniqueId(UUID uuid) - { - Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); -- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); -+ // FlameCord - Allow custom uuids even if onlineMode is true - this.uniqueId = uuid; - } - diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java index 6cd71071..09909bd9 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1039,45 +1011,8 @@ index 6cd71071..09909bd9 100644 } } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index f9493ff0..606866a5 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -117,25 +117,27 @@ public class ChannelWrapper - - public void setCompressionThreshold(int compressionThreshold) - { -- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) - { - addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); - } - if ( compressionThreshold != -1 ) - { -- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); -+ pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); - } else - { -- ch.pipeline().remove( "compress" ); -+ pipeline.remove( "compress" ); - } - -- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) -+ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) - { - addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); - } - if ( compressionThreshold == -1 ) - { -- ch.pipeline().remove( "decompress" ); -+ pipeline.remove( "decompress" ); - } - } - } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 989bfd87..46e338ca 100644 +index 1351d5d5..46e338ca 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,9 @@ @@ -1120,13 +1055,8 @@ index 989bfd87..46e338ca 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); } -@@ -56,10 +68,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - if ( handler != null ) - { -- channel.markClosed(); -+ // FlameCord - close instead of markClosed -+ channel.close(); +@@ -60,7 +72,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.close(); handler.disconnected( channel ); - if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) @@ -1135,7 +1065,7 @@ index 989bfd87..46e338ca 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -78,6 +92,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -79,6 +92,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { @@ -1147,7 +1077,7 @@ index 989bfd87..46e338ca 100644 if ( msg instanceof HAProxyMessage ) { HAProxyMessage proxy = (HAProxyMessage) msg; -@@ -124,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -125,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { if ( ctx.channel().isActive() ) { @@ -1173,20 +1103,8 @@ index 989bfd87..46e338ca 100644 if ( logExceptions ) { -@@ -180,8 +216,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); - } - } -- -- ctx.close(); - } -+ -+ // FlameCord - Close even if the channel isn't active -+ ctx.close(); - } - } 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 9a39f69e..008b03cb 100644 +index 7e407136..84302b32 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,10 +1,14 @@ @@ -1216,23 +1134,16 @@ index 9a39f69e..008b03cb 100644 if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) { ch.close(); -@@ -102,6 +111,16 @@ public class PipelineUtils - - BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); - } -+ -+ // FlameCord - Close on exception caught -+ @Override -+ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { +@@ -106,7 +115,9 @@ public class PipelineUtils + // FlameCord - Close on exception caught + @Override + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { + if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { -+ cause.printStackTrace(); + cause.printStackTrace(); + } -+ -+ ctx.close(); -+ } - }; - public static final Base BASE = new Base(); - private static final KickStringWriter legacyKicker = new KickStringWriter(); + + ctx.close(); + } -- 2.20.1 From 79fc7fea6fd382eb1244e3cc68c5c2fee566e51f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:44:19 +0800 Subject: [PATCH 020/499] more --- .../0012-Packet-Checks.patch | 18 +++++- ...y-to-avoid-multiple-incoming-packets.patch | 17 ++++-- ...ateException-to-QuietException-and-e.patch | 24 ++++++++ ...-Don-t-declare-uuid-unless-it-s-null.patch | 25 +++++++++ ...tch => 0023-FlameCord-General-Patch.patch} | 55 ++----------------- 5 files changed, 85 insertions(+), 54 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch create mode 100644 Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch rename Waterfall-Proxy-Patches/{0021-FlameCord-General-Patch.patch => 0023-FlameCord-General-Patch.patch} (95%) diff --git a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch index 42c37c1e..22bf1a3f 100644 --- a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch @@ -1,4 +1,4 @@ -From ce3a53d84ba7dbe3a0f50817ccad80ae41176309 Mon Sep 17 00:00:00 2001 +From 7ff984d41446f889b790be1376acae78cddc2fe8 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks @@ -28,6 +28,22 @@ index ec932e92..f1f34626 100644 ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( Object packetTypeInfo = null; +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 1351d5d5..d68cc2ce 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -79,6 +79,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception + { ++ // FlameCord - Return if channel isn't active ++ if (!ctx.channel().isActive()) { ++ return; ++ } ++ + if ( msg instanceof HAProxyMessage ) + { + HAProxyMessage proxy = (HAProxyMessage) msg; -- 2.20.1 diff --git a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch index e4f64a69..e0a00c2b 100644 --- a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,14 +1,23 @@ -From 057f0c8645075d20539e813e8932e344ba6fa2c8 Mon Sep 17 00:00:00 2001 +From 68c2b0ea3b16f7b571ff8c576f54042f4402e251 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 b71d25dc..eecdc3bd 100644 +index b71d25dc..61f80012 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 -@@ -524,6 +524,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -472,6 +472,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(final EncryptionResponse encryptResponse) throws Exception + { + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); ++ // FlameCord - Finish here to avoid multiple incoming packets ++ thisState = State.FINISHED; + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); +@@ -524,6 +526,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -18,7 +27,7 @@ index b71d25dc..eecdc3bd 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -605,8 +608,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -605,8 +610,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); diff --git a/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch new file mode 100644 index 00000000..48ff57c7 --- /dev/null +++ b/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch @@ -0,0 +1,24 @@ +From 8918151068bb611b3d455693ccea42387cbd3719 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:40:55 +0800 +Subject: [PATCH] Change IllegalStateException to QuietException and explain + that is a plugin + + +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 6cc520c9..159119c1 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -307,7 +307,8 @@ public final class UserConnection implements ProxiedPlayer + + if ( getServer() == null && !ch.isClosing() ) + { +- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); ++ // FlameCord - Change IllegalStateException to QuietException and explain that is a plugin ++ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); + } + return; + } +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch new file mode 100644 index 00000000..30771724 --- /dev/null +++ b/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch @@ -0,0 +1,25 @@ +From 67efa4ede50e4b1fbf0d5dc8528b8543424a289b Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:43:17 +0800 +Subject: [PATCH] Don't declare uuid unless it's null + + +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 61f80012..502e0ae1 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 +@@ -508,7 +508,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + loginProfile = obj; + name = obj.getName(); +- uniqueId = Util.getUUID( obj.getId() ); ++ // FlameCord - Don't declare uuid unless it's null ++ if (uniqueId == null) { ++ uniqueId = Util.getUUID(obj.getId()); ++ } + finish(); + return; + } +-- +2.20.1 + diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch similarity index 95% rename from Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index c5821f5b..f10e3ee8 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From a8c8e973a1767d1e5c01ebd8306f240c7de00ad0 Mon Sep 17 00:00:00 2001 +From 2f459340f4f410e9f98660dd03f4d56900a45e44 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -855,7 +855,7 @@ index e90237ac..3cfef373 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 6cc520c9..7c4c8f8a 100644 +index 159119c1..7c4c8f8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -874,17 +874,7 @@ index 6cc520c9..7c4c8f8a 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -307,7 +309,8 @@ public final class UserConnection implements ProxiedPlayer - - if ( getServer() == null && !ch.isClosing() ) - { -- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); -+ // FlameCord - Change IllegalStateException to QuietException and explain that is a plugin -+ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); - } - return; - } -@@ -386,9 +389,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -387,9 +389,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -899,7 +889,7 @@ index 6cc520c9..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 eecdc3bd..138dffa0 100644 +index 502e0ae1..138dffa0 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 @@ -19,6 +19,8 @@ import com.google.gson.Gson; @@ -954,27 +944,6 @@ index eecdc3bd..138dffa0 100644 { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } -@@ -472,6 +483,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(final EncryptionResponse encryptResponse) throws Exception - { - Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); -+ // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHED; - - SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); - BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); -@@ -506,7 +519,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - loginProfile = obj; - name = obj.getName(); -- uniqueId = Util.getUUID( obj.getId() ); -+ // FlameCord - Don't declare uuid unless it's null -+ if (uniqueId == null) { -+ uniqueId = Util.getUUID(obj.getId()); -+ } - finish(); - return; - } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java index 6cd71071..09909bd9 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1012,7 +981,7 @@ index 6cd71071..09909bd9 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 1351d5d5..46e338ca 100644 +index d68cc2ce..46e338ca 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,9 @@ @@ -1065,19 +1034,7 @@ index 1351d5d5..46e338ca 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -79,6 +92,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception - { -+ // FlameCord - Return if channel isn't active -+ if (!ctx.channel().isActive()) { -+ return; -+ } -+ - if ( msg instanceof HAProxyMessage ) - { - HAProxyMessage proxy = (HAProxyMessage) msg; -@@ -125,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -130,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { if ( ctx.channel().isActive() ) { From 71e24ab6a13970177a4766f2be28997ce61feb9b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 19:49:20 +0800 Subject: [PATCH 021/499] move a import to the right place --- ...connections-Don-t-flush-if-not-necessary.patch | 14 +++++++++++--- .../0023-FlameCord-General-Patch.patch | 15 +++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 7dc2a392..e47612a3 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 27a82ea70541b4167033f519d91a7117145530cf Mon Sep 17 00:00:00 2001 +From e2a93fffc50d08cc1d1a97d5c8b713add74feb69 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -144,10 +144,18 @@ index 989bfd87..1351d5d5 100644 } } 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 9a39f69e..7e407136 100644 +index 9a39f69e..a54da9c3 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 -@@ -102,6 +102,14 @@ public class PipelineUtils +@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; + import io.netty.channel.ChannelException; ++import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInitializer; + import io.netty.channel.ChannelOption; + import io.netty.channel.EventLoopGroup; +@@ -102,6 +103,14 @@ public class PipelineUtils BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); } diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index f10e3ee8..5ee466fe 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 2f459340f4f410e9f98660dd03f4d56900a45e44 Mon Sep 17 00:00:00 2001 +From 83dd5ab49ce6fcada7fb212a33db9c674fd66e63 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -1061,10 +1061,10 @@ index d68cc2ce..46e338ca 100644 if ( logExceptions ) { 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 7e407136..84302b32 100644 +index a54da9c3..84302b32 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,10 +1,14 @@ +@@ -1,6 +1,9 @@ package net.md_5.bungee.netty; import com.google.common.base.Preconditions; @@ -1074,12 +1074,7 @@ index 7e407136..84302b32 100644 import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; - import io.netty.channel.ChannelException; -+import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInitializer; - import io.netty.channel.ChannelOption; - import io.netty.channel.EventLoopGroup; -@@ -60,6 +64,11 @@ public class PipelineUtils +@@ -61,6 +64,11 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); @@ -1091,7 +1086,7 @@ index 7e407136..84302b32 100644 if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) { ch.close(); -@@ -106,7 +115,9 @@ public class PipelineUtils +@@ -107,7 +115,9 @@ public class PipelineUtils // FlameCord - Close on exception caught @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { From bad1151110aaf14e52499ecbe6c0405b885f18aa Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 30 Dec 2020 00:15:56 +0000 Subject: [PATCH 022/499] Updated Upstream (Waterfall) 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 Waterfall Changes: a112cfe Fetch modules from the API endpoint --- Waterfall | 2 +- .../0001-POM-Changes.patch | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Waterfall b/Waterfall index e6b1b105..a112cfe9 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit e6b1b105d08a0dddb0b78a99ce893c918683b9c7 +Subproject commit a112cfe996753861d51f72b684f728bc674228ef diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index 76b60153..d64980b2 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From f830225f2c26d8807de43f16843b5132f5c48c30 Mon Sep 17 00:00:00 2001 +From cd812233e8e74d5c0a7b753df0076a2a9baab06a Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index 87b279b8..d3016c10 100644 +index 10db38b7..1a378da2 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -58,7 +58,7 @@ index 87b279b8..d3016c10 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index a43db907..078c5b1a 100644 +index 0a890393..85b98651 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,18 +5,18 @@ @@ -129,7 +129,7 @@ index 8523d99a..29094871 100644 diff --git a/config/pom.xml b/config/pom.xml -index 5f4f2b33..18f0a14e 100644 +index 099a4643..babab703 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -5,18 +5,18 @@ @@ -452,7 +452,7 @@ index ec465dd3..28d1a02c 100644 diff --git a/pom.xml b/pom.xml -index 3ca7ca91..94e4aca2 100644 +index fd03c640..1b773cc5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -602,18 +602,18 @@ index f0c36550..4bda0d62 100644 compile diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -index 9b20d0df..2637b9e2 100644 +index 338c30d3..c0499252 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java +++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -@@ -18,7 +18,7 @@ public class JenkinsModuleSource implements ModuleSource - System.out.println( "Attempting to Jenkins download module " + module.getName() + " v" + version.getBuild() ); - try +@@ -20,7 +20,7 @@ public class JenkinsModuleSource implements ModuleSource { -- URL website = new URL( "https://papermc.io/ci/job/Waterfall/" + version.getBuild() + "/artifact/Waterfall-Proxy/module/" + module.getName().replace( '_', '-' ) + "/target/" + module.getName() + ".jar" ); -+ URL website = new URL( "https://papermc.io/ci/job/Travertine/" + version.getBuild() + "/artifact/Travertine-Proxy/module/" + module.getName().replace( '_', '-' ) + "/target/" + module.getName() + ".jar" ); - URLConnection con = website.openConnection(); - // 15 second timeout at various stages - con.setConnectTimeout( 15000 ); + final String url = String.format( + "https://papermc.io/api/v2/projects/%1$s/versions/%2$s/builds/%3$s/downloads/%4$s-%2$s-%3$s.jar", +- "waterfall", ++ "travertine", // Travertine + net.md_5.bungee.api.ProxyServer.getInstance().getVersion().split(":")[2].split("-")[0], + version.getBuild(), + module.getName() diff --git a/query/pom.xml b/query/pom.xml index 1c845a6d..0f2ea00b 100644 --- a/query/pom.xml @@ -651,5 +651,5 @@ index 1c845a6d..0f2ea00b 100644 compile -- -2.25.1 +2.29.2 From 35af3c4c5923fd57fa623e70f84d1a3fd6f9b6b0 Mon Sep 17 00:00:00 2001 From: Aurora <21148213+aurorasmiles@users.noreply.github.com> Date: Wed, 6 Jan 2021 15:21:41 +0100 Subject: [PATCH 023/499] [CI-SKIP] Remove jenkins references (#148) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dfb5e9f3..58fc3b96 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Travertine [![Build Status](https://papermc.io/ci/job/Travertine/badge/icon)](https://papermc.io/ci/job/Travertine/) +Travertine ========= Travertine is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. @@ -23,7 +23,7 @@ Travertine will track upstream Waterfall and merge changes as needed. ## How to (Server Admins) -Download a copy of Travertine.jar from our buildserver here: [Travertine](https://papermc.io/ci/job/Travertine/) +Download a copy of Travertine.jar from our homepage here: [Travertine](https://papermc.io/downloads#Travertine) Travertine requires **Java 8** or above. From a6ec94205cec2a83e1f6acd98203dfc009cef4e6 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 11 Jan 2021 16:37:55 +0000 Subject: [PATCH 024/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 281e731 Remove remaining CI references caea6e6 Remove Jenkins references (#591) --- Waterfall | 2 +- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 11 +++-------- ...-references-from-Waterfall-to-Travertine.patch | 15 +++------------ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Waterfall b/Waterfall index a112cfe9..281e7310 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit a112cfe996753861d51f72b684f728bc674228ef +Subproject commit 281e7310b8999ef9cbaaf3ba348bfa50f9d531f9 diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index d64980b2..d70e4766 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From cd812233e8e74d5c0a7b753df0076a2a9baab06a Mon Sep 17 00:00:00 2001 +From dde9291ad00dd3ac85eef03195cf32dab89ec5f3 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -452,7 +452,7 @@ index ec465dd3..28d1a02c 100644 diff --git a/pom.xml b/pom.xml -index fd03c640..1b773cc5 100644 +index d2bed7b5..10911a08 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -480,7 +480,7 @@ index fd03c640..1b773cc5 100644 2015 WaterfallMC -@@ -65,17 +65,17 @@ +@@ -65,13 +65,13 @@ @@ -496,11 +496,6 @@ index fd03c640..1b773cc5 100644 - https://github.com/PaperMC/Waterfall/issues + https://github.com/PaperMC/Travertine/issues - - jenkins -- https://papermc.io/ci/job/Waterfall/ -+ https://papermc.io/ci/job/Travertine/ - diff --git a/protocol/pom.xml b/protocol/pom.xml diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index 59b77e88..d43aae40 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,4 +1,4 @@ -From 0017e5e4bc7a1c73963e5555d1acec8cd023e850 Mon Sep 17 00:00:00 2001 +From 137ac0179db533a6f030c034a467af2f129848ea Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine @@ -53,18 +53,9 @@ index 2938f2f1..f7f1e7cc 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index dc2c584d..ad9a6d0c 100644 +index e830198d..cc05b1fc 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -49,7 +49,7 @@ public class BungeeCordLauncher - if ( buildDate.before( deadline.getTime() ) ) - { - System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Waterfall/ ***" ); -+ System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); - System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); - System.err.println( "*** Server will start in 10 seconds ***" ); - Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); @@ -58,7 +58,7 @@ public class BungeeCordLauncher BungeeCord bungee = new BungeeCord(); @@ -114,5 +105,5 @@ index 65121ba2..d4fad294 100644 SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- -2.27.0 +2.29.2 From 19326faf3b014a9fcc146335d44cd8c883f625fc Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 21 Jan 2021 11:20:41 +0000 Subject: [PATCH 025/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 3bac1f3 Limit login request data to 16 bytes (#597) e585e7c Exchange Spigot IRC with Esper (#592) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 281e7310..3bac1f36 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 281e7310b8999ef9cbaaf3ba348bfa50f9d531f9 +Subproject commit 3bac1f36312d771acbe3908940deb5341b4f00f8 From 4323ca94dcb4bf4038108322edf29e30819450d2 Mon Sep 17 00:00:00 2001 From: "FivePB (Xer)" Date: Fri, 29 Jan 2021 11:44:37 +0100 Subject: [PATCH 026/499] Updated Upstream (Waterfall) (#151) 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 Waterfall Changes: b3e5814 Updated Upstream (BungeeCord) (#601) 3bac1f3 Limit login request data to 16 bytes (#597) --- Waterfall | 2 +- .../0001-POM-Changes.patch | 116 +++++++++--------- .../0003-1.7.x-Protocol-Patch.patch | 10 +- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/Waterfall b/Waterfall index 3bac1f36..b3e58141 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 3bac1f36312d771acbe3908940deb5341b4f00f8 +Subproject commit b3e581412f97006061ed33e3069cf0f9cfb460fc diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index d70e4766..ed90d0d7 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From dde9291ad00dd3ac85eef03195cf32dab89ec5f3 Mon Sep 17 00:00:00 2001 +From 676a3f5461fa6f63942a92a5c3eba35f4c0b1084 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index 10db38b7..1a378da2 100644 +index c2b55587..1cd99ed3 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -14,14 +14,14 @@ index 10db38b7..1a378da2 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-api + travertine-api - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-API @@ -58,7 +58,7 @@ index 10db38b7..1a378da2 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 0a890393..85b98651 100644 +index c51531eb..b7f932d4 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,18 +5,18 @@ @@ -67,14 +67,14 @@ index 0a890393..85b98651 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-bootstrap + travertine-bootstrap - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Bootstrap @@ -102,7 +102,7 @@ index 0a890393..85b98651 100644 org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml -index 8523d99a..29094871 100644 +index 85309233..5cc62141 100644 --- a/chat/pom.xml +++ b/chat/pom.xml @@ -5,18 +5,18 @@ @@ -111,14 +111,14 @@ index 8523d99a..29094871 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-chat + travertine-chat - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Chat @@ -129,7 +129,7 @@ index 8523d99a..29094871 100644 diff --git a/config/pom.xml b/config/pom.xml -index 099a4643..babab703 100644 +index 38db2292..7cdcbd8b 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -5,18 +5,18 @@ @@ -138,14 +138,14 @@ index 099a4643..babab703 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-config + travertine-config - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Config @@ -156,7 +156,7 @@ index 099a4643..babab703 100644 diff --git a/event/pom.xml b/event/pom.xml -index f4f7fdb0..592bef24 100644 +index 82a411b0..b1a990c9 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -5,16 +5,16 @@ @@ -165,14 +165,14 @@ index f4f7fdb0..592bef24 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-event + travertine-event - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Event @@ -181,7 +181,7 @@ index f4f7fdb0..592bef24 100644 + Generic java event dispatching API intended for use with Travertine. diff --git a/log/pom.xml b/log/pom.xml -index 93bd4bcc..3ef8acf2 100644 +index 646dbfae..00f7b9c9 100644 --- a/log/pom.xml +++ b/log/pom.xml @@ -5,18 +5,18 @@ @@ -190,14 +190,14 @@ index 93bd4bcc..3ef8acf2 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log + travertine-log - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Log @@ -217,7 +217,7 @@ index 93bd4bcc..3ef8acf2 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 1cd12d6a..ca18158f 100644 +index 8baf329b..060a8ec7 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -4,18 +4,18 @@ @@ -226,14 +226,14 @@ index 1cd12d6a..ca18158f 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log4j + travertine-log4j - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Log @@ -269,7 +269,7 @@ index 1cd12d6a..ca18158f 100644 diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 8eea364f..83bc7a7d 100644 +index 472314c2..8eb06572 100644 --- a/module/cmd-alert/pom.xml +++ b/module/cmd-alert/pom.xml @@ -5,13 +5,13 @@ @@ -278,18 +278,18 @@ index 8eea364f..83bc7a7d 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-alert + travertine-module-cmd-alert - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index 9a2eb779..42fb0a11 100644 +index de8faee0..09e2835a 100644 --- a/module/cmd-find/pom.xml +++ b/module/cmd-find/pom.xml @@ -5,13 +5,13 @@ @@ -298,18 +298,18 @@ index 9a2eb779..42fb0a11 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-find + travertine-module-cmd-find - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index 57b0cdd8..cc2e55f9 100644 +index 0cab9a7a..5d1ff042 100644 --- a/module/cmd-list/pom.xml +++ b/module/cmd-list/pom.xml @@ -5,13 +5,13 @@ @@ -318,18 +318,18 @@ index 57b0cdd8..cc2e55f9 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-list + travertine-module-cmd-list - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index 990c0a6d..af82bb2c 100644 +index 240c9548..1f6a7c68 100644 --- a/module/cmd-send/pom.xml +++ b/module/cmd-send/pom.xml @@ -5,13 +5,13 @@ @@ -338,18 +338,18 @@ index 990c0a6d..af82bb2c 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-send + travertine-module-cmd-send - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 1b4e0455..8d96679e 100644 +index 4c13d517..c353e829 100644 --- a/module/cmd-server/pom.xml +++ b/module/cmd-server/pom.xml @@ -5,13 +5,13 @@ @@ -358,18 +358,18 @@ index 1b4e0455..8d96679e 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-server + travertine-module-cmd-server - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/module/pom.xml b/module/pom.xml -index 0b9fc4aa..ca1f7487 100644 +index c9849b6c..ca0a9c87 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -5,18 +5,18 @@ @@ -378,14 +378,14 @@ index 0b9fc4aa..ca1f7487 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT pom - Waterfall Modules @@ -405,7 +405,7 @@ index 0b9fc4aa..ca1f7487 100644 compile diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index 0d3a3b70..e6ee3cd8 100644 +index 45910b0e..d1a2d86c 100644 --- a/module/reconnect-yaml/pom.xml +++ b/module/reconnect-yaml/pom.xml @@ -5,13 +5,13 @@ @@ -414,18 +414,18 @@ index 0d3a3b70..e6ee3cd8 100644 io.github.waterfallmc - waterfall-module + travertine-module - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-reconnect-yaml + travertine-module-reconnect-yaml - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar diff --git a/native/pom.xml b/native/pom.xml -index ec465dd3..28d1a02c 100644 +index db15febb..a2efb5e5 100644 --- a/native/pom.xml +++ b/native/pom.xml @@ -5,18 +5,18 @@ @@ -434,14 +434,14 @@ index ec465dd3..28d1a02c 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-native + travertine-native - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Native @@ -452,7 +452,7 @@ index ec465dd3..28d1a02c 100644 diff --git a/pom.xml b/pom.xml -index d2bed7b5..10911a08 100644 +index fa4dd98d..7757ce6f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -468,7 +468,7 @@ index d2bed7b5..10911a08 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT pom - Waterfall-Parent @@ -499,7 +499,7 @@ index d2bed7b5..10911a08 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 8571f378..ba3ffe3d 100644 +index 402266ca..993cbca9 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -5,18 +5,18 @@ @@ -508,14 +508,14 @@ index 8571f378..ba3ffe3d 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-protocol + travertine-protocol - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Protocol @@ -535,7 +535,7 @@ index 8571f378..ba3ffe3d 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index f0c36550..4bda0d62 100644 +index 7a872a54..330697bc 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -544,14 +544,14 @@ index f0c36550..4bda0d62 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-proxy + travertine-proxy - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Proxy @@ -610,7 +610,7 @@ index 338c30d3..c0499252 100644 version.getBuild(), module.getName() diff --git a/query/pom.xml b/query/pom.xml -index 1c845a6d..0f2ea00b 100644 +index 8ce88f4a..813696e4 100644 --- a/query/pom.xml +++ b/query/pom.xml @@ -5,18 +5,18 @@ @@ -619,14 +619,14 @@ index 1c845a6d..0f2ea00b 100644 io.github.waterfallmc - waterfall-parent + travertine-parent - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-query + travertine-query - 1.16-R0.4-SNAPSHOT + 1.16-R0.5-SNAPSHOT jar - Waterfall-Query @@ -646,5 +646,5 @@ index 1c845a6d..0f2ea00b 100644 compile -- -2.29.2 +2.30.0 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 735ee73d..5fd6cea1 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 682bb544387936931880d662162b2fe107a4289b Mon Sep 17 00:00:00 2001 +From 1b4ffe1cf8b23ba201de65722526f2bca18bb7fd Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -101,10 +101,10 @@ index 00000000..90064112 + } +} 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 -index f6e4859f..6ba7ae70 100644 +index d10cf2ed..09ebe3d8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -267,6 +267,11 @@ public abstract class DefinedPacket +@@ -264,6 +264,11 @@ public abstract class DefinedPacket read( buf ); } @@ -116,7 +116,7 @@ index f6e4859f..6ba7ae70 100644 public void write(ByteBuf buf) { throw new UnsupportedOperationException( "Packet must implement write method" ); -@@ -277,6 +282,11 @@ public abstract class DefinedPacket +@@ -274,6 +279,11 @@ public abstract class DefinedPacket write( buf ); } @@ -2023,5 +2023,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.29.2 +2.30.0 From bd883ace262cbe1ab6d7d498622fbe773b7fb27d Mon Sep 17 00:00:00 2001 From: "FivePB (Xer)" Date: Sun, 31 Jan 2021 23:22:35 +0100 Subject: [PATCH 027/499] Updated Upstream (Waterfall) (#152) 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 Waterfall Changes: 2c5c954 Additional DoS Mitigations for the login sequence (#603) b3e5814 Updated Upstream (BungeeCord) (#601) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 29 +++++-------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/Waterfall b/Waterfall index b3e58141..2c5c9541 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit b3e581412f97006061ed33e3069cf0f9cfb460fc +Subproject commit 2c5c9541c95282ad60a68b14d6f2ac40babef64d diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 5fd6cea1..92e9562a 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 1b4ffe1cf8b23ba201de65722526f2bca18bb7fd Mon Sep 17 00:00:00 2001 +From 645dd7b625e6cda74114262e66edec565f7fda58 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -101,10 +101,10 @@ index 00000000..90064112 + } +} 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 -index d10cf2ed..09ebe3d8 100644 +index 31a95495..93d17f6b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -264,6 +264,11 @@ public abstract class DefinedPacket +@@ -266,6 +266,11 @@ public abstract class DefinedPacket read( buf ); } @@ -116,7 +116,7 @@ index d10cf2ed..09ebe3d8 100644 public void write(ByteBuf buf) { throw new UnsupportedOperationException( "Packet must implement write method" ); -@@ -274,6 +279,11 @@ public abstract class DefinedPacket +@@ -276,6 +281,11 @@ public abstract class DefinedPacket write( buf ); } @@ -129,26 +129,13 @@ index d10cf2ed..09ebe3d8 100644 @Override diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 1a647f2b..ec932e92 100644 +index ac9f114d..2caadfed 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -5,10 +5,11 @@ import io.netty.buffer.ByteBufUtil; - import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.DecoderException; - import io.netty.handler.codec.MessageToMessageDecoder; --import java.util.List; - import lombok.AllArgsConstructor; - import lombok.Setter; - -+import java.util.List; -+ - @AllArgsConstructor - public class MinecraftDecoder extends MessageToMessageDecoder - { -@@ -56,7 +57,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - if ( packet != null ) +@@ -57,7 +57,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder { packetTypeInfo = packet.getClass(); + doLengthSanityChecks(in, packet, prot.getDirection(), packetId); // Waterfall: Additional DoS mitigations - packet.read( in, prot.getDirection(), protocolVersion ); + packet.read0( in, prot.getDirection(), protocolVersion ); @@ -695,7 +682,7 @@ index a29524ca..8d9f4ccb 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 388f6cdb..7f124322 100644 +index 53575ce0..1a41da75 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -1,5 +1,6 @@ From d56200761b940f66722ce8c74ba20d9e95ba6117 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 22 Feb 2021 16:50:30 +0000 Subject: [PATCH 028/499] Updated Upstream (Waterfall) 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 Waterfall Changes: bc3e393 Updated Upstream (BungeeCord) 565c857 Add support for hex color codes in console (#612) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 2c5c9541..bc3e393b 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 2c5c9541c95282ad60a68b14d6f2ac40babef64d +Subproject commit bc3e393b1419a2f0a350a746e8595deecc934d86 From 77b89f5fb32d76b24ba9b499cf5be8efb8fc8f36 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 23 Feb 2021 16:48:29 +0000 Subject: [PATCH 029/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 9a1d6a1 Port Log4J converter fixes from Paper (#614) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index bc3e393b..9a1d6a17 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit bc3e393b1419a2f0a350a746e8595deecc934d86 +Subproject commit 9a1d6a1711e2ab0615dd0440705a033b7c121675 From 8c3c544142a96df4a269b998870622fef61538f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Feb 2021 03:43:19 -0300 Subject: [PATCH 030/499] Fix Patches 6/7/20 --- Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch | 4 ++-- .../0007-Disable-update-checker-Use-bungee-name.patch | 2 +- ...0020-Finish-early-to-avoid-multiple-incoming-packets.patch | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch index 8368c1b0..8bb6d691 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -17,13 +17,13 @@ index 00000000..dd511dac + + io.github.waterfallmc + travertine-parent -+ 1.16-R0.4-SNAPSHOT ++ 1.16-R0.5-SNAPSHOT + ../pom.xml + + + dev._2lstudios + travertine-flamecord -+ 1.16-R0.4-SNAPSHOT ++ 1.16-R0.5-SNAPSHOT + jar + + Travertine-FlameCord diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index 0fa35556..ffbdc513 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -21,7 +21,7 @@ index ad9a6d0c..ad8f8733 100644 - if ( buildDate.before( deadline.getTime() ) ) - { - System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -- System.err.println( "*** Please check for a new build from https://papermc.io/ci/job/Travertine/ ***" ); +- System.err.println( "*** Please check for a new build from https://papermc.io/downloads ***" ); - System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); - System.err.println( "*** Server will start in 10 seconds ***" ); - Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); diff --git a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch index e0a00c2b..f42f2392 100644 --- a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -12,11 +12,11 @@ index b71d25dc..61f80012 100644 public void handle(final EncryptionResponse encryptResponse) throws Exception { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); + + // FlameCord - Finish here to avoid multiple incoming packets + thisState = State.FINISHED; - SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); - BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); + // Waterfall start @@ -524,6 +526,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() From 17a46f263e9abb71b7e5efd51914c3965d27e959 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Fri, 26 Feb 2021 09:46:21 +0800 Subject: [PATCH 031/499] Upstream Update --- ...ake-PlayerHandshakeEvent-cancellable.patch | 6 ++--- ...ections-Don-t-flush-if-not-necessary.patch | 12 +++++----- .../0012-Packet-Checks.patch | 6 ++--- ...o-encrypt-only-if-onlineMode-is-true.patch | 6 ++--- ...0017-Don-t-allow-name-containing-dot.patch | 6 ++--- ...tom-uuids-even-if-onlineMode-is-true.patch | 6 ++--- ...y-to-avoid-multiple-incoming-packets.patch | 14 +++++------ ...-Don-t-declare-uuid-unless-it-s-null.patch | 6 ++--- .../0023-FlameCord-General-Patch.patch | 24 +++++++++---------- 9 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch index f936faab..1137cae6 100644 --- a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From 9a7e67bef272c161ca784e54492e95e50140f384 Mon Sep 17 00:00:00 2001 +From 52968afed745e49517f2eefa5aae6be6a36aa714 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 fe6ff143..c2ec12b4 100644 +index 3b82219d..5407c20a 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 -@@ -341,7 +341,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -338,7 +338,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index e47612a3..f1738d6f 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From e2a93fffc50d08cc1d1a97d5c8b713add74feb69 Mon Sep 17 00:00:00 2001 +From 9c750441ab21769e9fc5ee37e7642a5de7f2dcd3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 c2ec12b4..1be9ae77 100644 +index 5407c20a..e9937428 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 -@@ -197,6 +197,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -194,6 +194,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index c2ec12b4..1be9ae77 100644 String kickMessage; if ( v1_5 ) -@@ -267,6 +274,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -264,6 +271,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection { bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); } @@ -39,7 +39,7 @@ index c2ec12b4..1be9ae77 100644 // Travertine start if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) { -@@ -307,11 +324,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -304,11 +321,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -55,7 +55,7 @@ index c2ec12b4..1be9ae77 100644 } @Override -@@ -619,7 +636,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -624,7 +641,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch index 22bf1a3f..8f1ae031 100644 --- a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0012-Packet-Checks.patch @@ -1,14 +1,14 @@ -From 7ff984d41446f889b790be1376acae78cddc2fe8 Mon Sep 17 00:00:00 2001 +From 8ead27c615cb3fcc53cabf3399c65347d4fd6994 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec932e92..f1f34626 100644 +index 2caadfed..d4729244 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -39,6 +39,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder } Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; diff --git a/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index 56c1ac12..0182585a 100644 --- a/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 1fa924e0e980d172556ff43ee97caee5211c53a0 Mon Sep 17 00:00:00 2001 +From 501c340474b980137994535738a1ac736b6d0e6a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 1be9ae77..93486904 100644 +index e9937428..037a305b 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 -@@ -452,11 +452,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -449,11 +449,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); diff --git a/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch index 07178391..f6eb912a 100644 --- a/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch @@ -1,14 +1,14 @@ -From 69632ee3a5f3963b39c933c2dba4d0c3ecf05f6c Mon Sep 17 00:00:00 2001 +From 355853706ca50aba3dc231b6adee5f5e8bd58548 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot 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 93486904..1f5492fb 100644 +index 037a305b..c6dfa00f 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 -@@ -407,13 +407,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -404,13 +404,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; diff --git a/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch index f9e419e1..697736e2 100644 --- a/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From ce563b65a254311d942f69311fa5e675cbedd48e Mon Sep 17 00:00:00 2001 +From 461651e8a304ff9f57adac8d9c975b2a7e6ce1ea Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 1f5492fb..b71d25dc 100644 +index c6dfa00f..3c67494f 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 -@@ -698,7 +698,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -703,7 +703,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch index f42f2392..0cbf6042 100644 --- a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,23 +1,23 @@ -From 68c2b0ea3b16f7b571ff8c576f54042f4402e251 Mon Sep 17 00:00:00 2001 +From e57213dfb0ed9e6ebb122cb95d08a2e7592c4c60 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 b71d25dc..61f80012 100644 +index 3c67494f..f7ed1f46 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 -@@ -472,6 +472,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(final EncryptionResponse encryptResponse) throws Exception +@@ -470,6 +470,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); - + + // FlameCord - Finish here to avoid multiple incoming packets + thisState = State.FINISHED; SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start -@@ -524,6 +526,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + if (sharedKey instanceof SecretKeySpec) { +@@ -529,6 +531,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -27,7 +27,7 @@ index b71d25dc..61f80012 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -605,8 +610,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -610,8 +615,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); diff --git a/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch index 30771724..a732d6ff 100644 --- a/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 67efa4ede50e4b1fbf0d5dc8528b8543424a289b Mon Sep 17 00:00:00 2001 +From 1d113c7643f8d333cd70d8e6ddd64e78c1ab73be Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 61f80012..502e0ae1 100644 +index f7ed1f46..e7542b1c 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 -@@ -508,7 +508,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -513,7 +513,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 5ee466fe..23f93825 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 83dd5ab49ce6fcada7fb212a33db9c674fd66e63 Mon Sep 17 00:00:00 2001 +From ed57b22b9bae1cabd74f9dd91ebe83389d6223ee Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -563,7 +563,7 @@ index 00000000..8a474758 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index f1f34626..1ea85e18 100644 +index d4729244..dd089abd 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -573,7 +573,7 @@ index f1f34626..1ea85e18 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -92,7 +93,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -102,7 +103,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } @@ -889,19 +889,19 @@ index 159119c1..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 502e0ae1..138dffa0 100644 +index e7542b1c..47a9c74d 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 -@@ -19,6 +19,8 @@ import com.google.gson.Gson; +@@ -16,6 +16,8 @@ import java.util.logging.Level; + import javax.crypto.SecretKey; + import javax.crypto.spec.SecretKeySpec; - import com.google.gson.JsonElement; - import com.google.gson.JsonObject; -+ +import dev._2lstudios.flamecord.FlameCord; ++ import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -52,6 +54,7 @@ import net.md_5.bungee.netty.PacketHandler; +@@ -49,6 +51,7 @@ import net.md_5.bungee.netty.PacketHandler; import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.netty.cipher.CipherDecoder; import net.md_5.bungee.netty.cipher.CipherEncoder; @@ -909,7 +909,7 @@ index 502e0ae1..138dffa0 100644 import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.PacketWrapper; import net.md_5.bungee.protocol.Protocol; -@@ -155,7 +158,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -152,7 +155,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -924,7 +924,7 @@ index 502e0ae1..138dffa0 100644 } } -@@ -368,7 +377,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -365,7 +374,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -934,7 +934,7 @@ index 502e0ae1..138dffa0 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -377,7 +387,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -374,7 +384,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login From fe43b76d7cac4b1d6179b6901fdc5bb93dac0f03 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 28 Feb 2021 19:17:17 +0000 Subject: [PATCH 032/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 57c175c bump log4j version --- Waterfall | 2 +- .../0001-POM-Changes.patch | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Waterfall b/Waterfall index 9a1d6a17..57c175ce 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9a1d6a1711e2ab0615dd0440705a033b7c121675 +Subproject commit 57c175ce7f38b36d89d540425423ac3af156119f diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index ed90d0d7..c3c52493 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 676a3f5461fa6f63942a92a5c3eba35f4c0b1084 Mon Sep 17 00:00:00 2001 +From c5ebed82ea418dd7281481f4971080bdc70629e5 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index c2b55587..1cd99ed3 100644 +index c2b55587d..1cd99ed30 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -58,7 +58,7 @@ index c2b55587..1cd99ed3 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index c51531eb..b7f932d4 100644 +index 37c0880cd..139b7ac12 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,18 +5,18 @@ @@ -102,7 +102,7 @@ index c51531eb..b7f932d4 100644 org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml -index 85309233..5cc62141 100644 +index 853092339..5cc621414 100644 --- a/chat/pom.xml +++ b/chat/pom.xml @@ -5,18 +5,18 @@ @@ -129,7 +129,7 @@ index 85309233..5cc62141 100644 diff --git a/config/pom.xml b/config/pom.xml -index 38db2292..7cdcbd8b 100644 +index 38db2292d..7cdcbd8b3 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -5,18 +5,18 @@ @@ -156,7 +156,7 @@ index 38db2292..7cdcbd8b 100644 diff --git a/event/pom.xml b/event/pom.xml -index 82a411b0..b1a990c9 100644 +index 82a411b08..b1a990c93 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -5,16 +5,16 @@ @@ -181,7 +181,7 @@ index 82a411b0..b1a990c9 100644 + Generic java event dispatching API intended for use with Travertine. diff --git a/log/pom.xml b/log/pom.xml -index 646dbfae..00f7b9c9 100644 +index 646dbfae5..00f7b9c92 100644 --- a/log/pom.xml +++ b/log/pom.xml @@ -5,18 +5,18 @@ @@ -217,7 +217,7 @@ index 646dbfae..00f7b9c9 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 8baf329b..060a8ec7 100644 +index 51187fd15..9fe7044f9 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -4,18 +4,18 @@ @@ -242,7 +242,7 @@ index 8baf329b..060a8ec7 100644 + Simplistic and performant Log4j2 based logger and console API designed for use with Travertine and Minecraft related applications. - 2.12.0 + 2.14.0 @@ -50,5 +50,24 @@ 3.4.2 runtime @@ -269,7 +269,7 @@ index 8baf329b..060a8ec7 100644 diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 472314c2..8eb06572 100644 +index 472314c2f..8eb065721 100644 --- a/module/cmd-alert/pom.xml +++ b/module/cmd-alert/pom.xml @@ -5,13 +5,13 @@ @@ -289,7 +289,7 @@ index 472314c2..8eb06572 100644 jar diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index de8faee0..09e2835a 100644 +index de8faee02..09e2835aa 100644 --- a/module/cmd-find/pom.xml +++ b/module/cmd-find/pom.xml @@ -5,13 +5,13 @@ @@ -309,7 +309,7 @@ index de8faee0..09e2835a 100644 jar diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index 0cab9a7a..5d1ff042 100644 +index 0cab9a7ab..5d1ff0424 100644 --- a/module/cmd-list/pom.xml +++ b/module/cmd-list/pom.xml @@ -5,13 +5,13 @@ @@ -329,7 +329,7 @@ index 0cab9a7a..5d1ff042 100644 jar diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index 240c9548..1f6a7c68 100644 +index 240c95487..1f6a7c681 100644 --- a/module/cmd-send/pom.xml +++ b/module/cmd-send/pom.xml @@ -5,13 +5,13 @@ @@ -349,7 +349,7 @@ index 240c9548..1f6a7c68 100644 jar diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 4c13d517..c353e829 100644 +index 4c13d5177..c353e8293 100644 --- a/module/cmd-server/pom.xml +++ b/module/cmd-server/pom.xml @@ -5,13 +5,13 @@ @@ -369,7 +369,7 @@ index 4c13d517..c353e829 100644 jar diff --git a/module/pom.xml b/module/pom.xml -index c9849b6c..ca0a9c87 100644 +index c9849b6c1..ca0a9c87d 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -5,18 +5,18 @@ @@ -405,7 +405,7 @@ index c9849b6c..ca0a9c87 100644 compile diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index 45910b0e..d1a2d86c 100644 +index 45910b0e7..d1a2d86c8 100644 --- a/module/reconnect-yaml/pom.xml +++ b/module/reconnect-yaml/pom.xml @@ -5,13 +5,13 @@ @@ -425,7 +425,7 @@ index 45910b0e..d1a2d86c 100644 jar diff --git a/native/pom.xml b/native/pom.xml -index db15febb..a2efb5e5 100644 +index db15febbc..a2efb5e52 100644 --- a/native/pom.xml +++ b/native/pom.xml @@ -5,18 +5,18 @@ @@ -452,7 +452,7 @@ index db15febb..a2efb5e5 100644 diff --git a/pom.xml b/pom.xml -index fa4dd98d..7757ce6f 100644 +index bfec1abc2..0183f7148 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -499,7 +499,7 @@ index fa4dd98d..7757ce6f 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 402266ca..993cbca9 100644 +index 402266ca1..993cbca95 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -5,18 +5,18 @@ @@ -535,7 +535,7 @@ index 402266ca..993cbca9 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index 7a872a54..330697bc 100644 +index 7a872a549..330697bc7 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -597,7 +597,7 @@ index 7a872a54..330697bc 100644 compile diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -index 338c30d3..c0499252 100644 +index 338c30d35..c04992523 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java +++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java @@ -20,7 +20,7 @@ public class JenkinsModuleSource implements ModuleSource @@ -610,7 +610,7 @@ index 338c30d3..c0499252 100644 version.getBuild(), module.getName() diff --git a/query/pom.xml b/query/pom.xml -index 8ce88f4a..813696e4 100644 +index 8ce88f4a4..813696e45 100644 --- a/query/pom.xml +++ b/query/pom.xml @@ -5,18 +5,18 @@ @@ -646,5 +646,5 @@ index 8ce88f4a..813696e4 100644 compile -- -2.30.0 +2.30.1 From b027175a20619e25e8f2bd9a1552c83aa76f89bf Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Sat, 20 Mar 2021 13:31:50 -0300 Subject: [PATCH 033/499] Added Memory leak fixes --- .../0024-Fix-ByteBuf-memory-leaks.patch | 433 ++++++++++++++++++ 1 file changed, 433 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch new file mode 100644 index 00000000..9e9fae73 --- /dev/null +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -0,0 +1,433 @@ +From 70c35798c174ad82481c381369bb613f26e200e7 Mon Sep 17 00:00:00 2001 +From: LinsaFTW +Date: Sat, 20 Mar 2021 12:36:25 -0300 +Subject: [PATCH] Fix ByteBuf memory leaks + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 3cfef373..5b32cec7 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -289,9 +289,15 @@ public class ServerConnector extends PacketHandler + } else + { + ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString(brandString, brand); +- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); +- brand.release(); ++ ++ try ++ { ++ DefinedPacket.writeString(brandString, brand); ++ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); ++ } finally ++ { ++ brand.release(); ++ } + } + // Travertine end + } +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 +index 474551d3..8716d0c8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -294,12 +294,21 @@ public class DownstreamBridge extends PacketHandler + try + { + ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); +- String serverBrand = DefinedPacket.readString(brand); +- brand.release(); +- brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall +- pluginMessage.setData(brand); +- brand.release(); ++ String serverBrand = null; ++ ++ try { ++ serverBrand = DefinedPacket.readString(brand); ++ } finally { ++ brand.release(); ++ } ++ ++ try { ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData(brand); ++ } finally { ++ brand.release(); ++ } + } catch (Exception ProtocolHacksSuck) + { + return; +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index a3a12e19..214a1fd0 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -143,11 +143,17 @@ public abstract class EntityMap + if ( readId == oldId || readId == newId ) + { + ByteBuf data = packet.copy(); +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- data.release(); ++ ++ try ++ { ++ packet.readerIndex( offset ); ++ packet.writerIndex( offset ); ++ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); ++ packet.writeBytes( data ); ++ } finally ++ { ++ data.release(); ++ } + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +index 6755fe84..21871d14 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +@@ -39,19 +39,27 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 + && profile.getProperties().length >= 1 ) + { + ByteBuf rest = packet.copy(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeString( player.getUniqueId().toString(), packet ); +- DefinedPacket.writeString( username, packet ); +- DefinedPacket.writeVarInt( profile.getProperties().length, packet ); +- for ( LoginResult.Property property : profile.getProperties() ) ++ ++ try ++ { ++ packet.readerIndex( readerIndex ); ++ packet.writerIndex( readerIndex + packetIdLength + idLength ); ++ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); ++ DefinedPacket.writeString( username, packet ); ++ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); ++ ++ for ( LoginResult.Property property : profile.getProperties() ) ++ { ++ DefinedPacket.writeString( property.getName(), packet ); ++ DefinedPacket.writeString( property.getValue(), packet ); ++ DefinedPacket.writeString( property.getSignature(), packet ); ++ } ++ ++ packet.writeBytes( rest ); ++ } finally + { +- DefinedPacket.writeString( property.getName(), packet ); +- DefinedPacket.writeString( property.getValue(), packet ); +- DefinedPacket.writeString( property.getSignature(), packet ); ++ rest.release(); + } +- packet.writeBytes( rest ); +- rest.release(); + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index cefa0206..2cd5740c 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -38,15 +38,27 @@ public class ForgeUtils + { + Map modTags = new HashMap<>(); + ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- byte discriminator = payload.readByte(); +- if ( discriminator == 2 ) // ModList ++ ++ try + { +- ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ byte discriminator = payload.readByte(); ++ if ( discriminator == 2 ) // ModList + { +- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ ByteBuf buffer = payload.slice(); ++ ++ try { ++ int modCount = DefinedPacket.readVarInt( buffer, 2 ); ++ for ( int i = 0; i < modCount; i++ ) ++ { ++ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ } ++ } finally ++ { ++ buffer.release(); ++ } + } ++ } finally { ++ payload.release(); + } + return modTags; + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 46e338ca..048ac826 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -100,23 +100,32 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + if ( msg instanceof HAProxyMessage ) + { + HAProxyMessage proxy = (HAProxyMessage) msg; +- InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); + +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ try + { +- channel.getRemoteAddress(), newAddress +- } ); ++ InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); ++ ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); + +- channel.setRemoteAddress( newAddress ); ++ channel.setRemoteAddress( newAddress ); ++ } finally ++ { ++ proxy.release(); ++ } + return; + } + + if ( handler != null ) + { + PacketWrapper packet = (PacketWrapper) msg; +- boolean sendPacket = handler.shouldHandle( packet ); ++ + try + { ++ boolean sendPacket = handler.shouldHandle( packet ); ++ + if ( sendPacket && packet.packet != null ) + { + try +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index b3bdfd05..0c5d8488 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -67,109 +67,125 @@ public class QueryHandler extends SimpleChannelInboundHandler + + private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg) + { ++ AddressedEnvelope response = null; + ByteBuf in = msg.content(); +- if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) +- { +- bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); +- // FlameCord - Close on incorrect magic +- ctx.close(); +- return; +- } +- +- ByteBuf out = ctx.alloc().buffer(); +- AddressedEnvelope response = new DatagramPacket( out, msg.sender() ); +- +- byte type = in.readByte(); +- int sessionId = in.readInt(); +- +- if ( type == 0x09 ) +- { +- out.writeByte( 0x09 ); +- out.writeInt( sessionId ); +- +- int challengeToken = random.nextInt(); +- sessions.put( msg.sender().getAddress(), new QuerySession( challengeToken, System.currentTimeMillis() ) ); + +- writeNumber( out, challengeToken ); +- } +- +- if ( type == 0x00 ) +- { +- int challengeToken = in.readInt(); +- QuerySession session = sessions.getIfPresent( msg.sender().getAddress() ); +- if ( session == null || session.getToken() != challengeToken ) ++ try { ++ if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) + { +- throw cachedNoSessionException; // Waterfall ++ bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); ++ // FlameCord - Close on incorrect magic ++ ctx.close(); ++ return; + } + +- // Waterfall start +- List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); ++ ByteBuf out = ctx.alloc().buffer(); + +- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", +- bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), +- listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); +- QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); +- // Waterfall end ++ try { ++ response = new DatagramPacket( out, msg.sender() ); + +- out.writeByte( 0x00 ); +- out.writeInt( sessionId ); ++ byte type = in.readByte(); ++ int sessionId = in.readInt(); + +- if ( in.readableBytes() == 0 ) +- { +- // Short response +- // Waterfall start +- writeString( out, result.getMotd() ); // MOTD +- writeString( out, result.getGameType() ); // Game Type +- writeString( out, result.getWorldName() ); // World Name +- writeNumber( out, result.getOnlinePlayers() ); // Online Count +- writeNumber( out, result.getMaxPlayers() ); // Max Players +- writeShort( out, result.getPort() ); // Port +- writeString( out, result.getAddress() ); // IP +- // Waterfall end +- } else if ( in.readableBytes() == 4 ) +- { +- // Long Response +- out.writeBytes( new byte[] ++ if ( type == 0x09 ) + { +- 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 +- } ); +- Map data = new LinkedHashMap<>(); +- +- // Waterfall start +- data.put( "hostname", result.getMotd() ); +- data.put( "gametype", result.getGameType() ); +- // Start Extra Info +- data.put( "game_id", result.getGameId() ); +- data.put( "version", result.getVersion() ); +- data.put( "plugins", "" ); // TODO: Allow population? +- // End Extra Info +- data.put( "map", result.getWorldName() ); +- data.put( "numplayers", Integer.toString( result.getOnlinePlayers() ) ); +- data.put( "maxplayers", Integer.toString( result.getMaxPlayers() ) ); +- data.put( "hostport", Integer.toString( result.getPort() ) ); +- data.put( "hostip", result.getAddress() ); +- // Waterfall end +- +- for ( Map.Entry entry : data.entrySet() ) ++ out.writeByte( 0x09 ); ++ out.writeInt( sessionId ); ++ ++ int challengeToken = random.nextInt(); ++ sessions.put( msg.sender().getAddress(), new QuerySession( challengeToken, System.currentTimeMillis() ) ); ++ ++ writeNumber( out, challengeToken ); ++ } ++ ++ if ( type == 0x00 ) + { +- writeString( out, entry.getKey() ); +- writeString( out, entry.getValue() ); ++ int challengeToken = in.readInt(); ++ QuerySession session = sessions.getIfPresent( msg.sender().getAddress() ); ++ if ( session == null || session.getToken() != challengeToken ) ++ { ++ throw cachedNoSessionException; // Waterfall ++ } ++ ++ // Waterfall start ++ List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); ++ ++ ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", ++ bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), ++ listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); ++ QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); ++ // Waterfall end ++ ++ out.writeByte( 0x00 ); ++ out.writeInt( sessionId ); ++ ++ if ( in.readableBytes() == 0 ) ++ { ++ // Short response ++ // Waterfall start ++ writeString( out, result.getMotd() ); // MOTD ++ writeString( out, result.getGameType() ); // Game Type ++ writeString( out, result.getWorldName() ); // World Name ++ writeNumber( out, result.getOnlinePlayers() ); // Online Count ++ writeNumber( out, result.getMaxPlayers() ); // Max Players ++ writeShort( out, result.getPort() ); // Port ++ writeString( out, result.getAddress() ); // IP ++ // Waterfall end ++ } else if ( in.readableBytes() == 4 ) ++ { ++ // Long Response ++ out.writeBytes( new byte[] ++ { ++ 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 ++ } ); ++ Map data = new LinkedHashMap<>(); ++ ++ // Waterfall start ++ data.put( "hostname", result.getMotd() ); ++ data.put( "gametype", result.getGameType() ); ++ // Start Extra Info ++ data.put( "game_id", result.getGameId() ); ++ data.put( "version", result.getVersion() ); ++ data.put( "plugins", "" ); // TODO: Allow population? ++ // End Extra Info ++ data.put( "map", result.getWorldName() ); ++ data.put( "numplayers", Integer.toString( result.getOnlinePlayers() ) ); ++ data.put( "maxplayers", Integer.toString( result.getMaxPlayers() ) ); ++ data.put( "hostport", Integer.toString( result.getPort() ) ); ++ data.put( "hostip", result.getAddress() ); ++ // Waterfall end ++ ++ for ( Map.Entry entry : data.entrySet() ) ++ { ++ writeString( out, entry.getKey() ); ++ writeString( out, entry.getValue() ); ++ } ++ out.writeByte( 0x00 ); // Null ++ ++ // Padding ++ writeString( out, "\01player_\00" ); ++ // Player List ++ result.getPlayers().stream().forEach(p -> writeString(out, p)); // Waterfall ++ out.writeByte( 0x00 ); // Null ++ } else ++ { ++ // Error! ++ throw new IllegalStateException( "Invalid data request packet" ); ++ } + } +- out.writeByte( 0x00 ); // Null +- +- // Padding +- writeString( out, "\01player_\00" ); +- // Player List +- result.getPlayers().stream().forEach(p -> writeString(out, p)); // Waterfall +- out.writeByte( 0x00 ); // Null +- } else ++ } finally + { +- // Error! +- throw new IllegalStateException( "Invalid data request packet" ); ++ out.release(); + } ++ } finally ++ { ++ in.release(); + } + +- ctx.writeAndFlush( response ); ++ if (response != null) ++ { ++ ctx.writeAndFlush( response ); ++ } + } + + @Override +-- +2.31.0.windows.1 + From 96201bd378d7b68981ac7702cf0de4245f8b7b31 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Sat, 20 Mar 2021 19:09:32 -0300 Subject: [PATCH 034/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 9a1d6a17..4ef9babb 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9a1d6a1711e2ab0615dd0440705a033b7c121675 +Subproject commit 4ef9babb31f4cee622b51e273cd401c931dbfe79 From 46b2c91ed701219ed74f117a4afd853355671878 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+LinsaFTW@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:28:28 -0300 Subject: [PATCH 035/499] Upgrade version number --- Waterfall-Proxy-Patches/0013-Rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-Rebrand.patch b/Waterfall-Proxy-Patches/0013-Rebrand.patch index 0789be6d..f037ed53 100644 --- a/Waterfall-Proxy-Patches/0013-Rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-Rebrand.patch @@ -34,7 +34,7 @@ index a17ed68e..3e4ebfc5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.6"; ++ return "0.4.7"; } public void reloadMessages() From 7f9be0ff473ebce5e60d98b4f65bf0bac0c6b164 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Sat, 20 Mar 2021 20:16:25 -0300 Subject: [PATCH 036/499] Updated POM changes --- .../0001-POM-Changes.patch | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index ed90d0d7..9c035dae 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 676a3f5461fa6f63942a92a5c3eba35f4c0b1084 Mon Sep 17 00:00:00 2001 +From c5ebed82ea418dd7281481f4971080bdc70629e5 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index c2b55587..1cd99ed3 100644 +index c2b55587d..1cd99ed30 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -58,7 +58,7 @@ index c2b55587..1cd99ed3 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index c51531eb..b7f932d4 100644 +index 37c0880cd..139b7ac12 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,18 +5,18 @@ @@ -102,7 +102,7 @@ index c51531eb..b7f932d4 100644 org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml -index 85309233..5cc62141 100644 +index 853092339..5cc621414 100644 --- a/chat/pom.xml +++ b/chat/pom.xml @@ -5,18 +5,18 @@ @@ -129,7 +129,7 @@ index 85309233..5cc62141 100644 diff --git a/config/pom.xml b/config/pom.xml -index 38db2292..7cdcbd8b 100644 +index 38db2292d..7cdcbd8b3 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -5,18 +5,18 @@ @@ -156,7 +156,7 @@ index 38db2292..7cdcbd8b 100644 diff --git a/event/pom.xml b/event/pom.xml -index 82a411b0..b1a990c9 100644 +index 82a411b08..b1a990c93 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -5,16 +5,16 @@ @@ -181,7 +181,7 @@ index 82a411b0..b1a990c9 100644 + Generic java event dispatching API intended for use with Travertine. diff --git a/log/pom.xml b/log/pom.xml -index 646dbfae..00f7b9c9 100644 +index 646dbfae5..00f7b9c92 100644 --- a/log/pom.xml +++ b/log/pom.xml @@ -5,18 +5,18 @@ @@ -217,7 +217,7 @@ index 646dbfae..00f7b9c9 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 8baf329b..060a8ec7 100644 +index 51187fd15..9fe7044f9 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -4,18 +4,18 @@ @@ -242,7 +242,7 @@ index 8baf329b..060a8ec7 100644 + Simplistic and performant Log4j2 based logger and console API designed for use with Travertine and Minecraft related applications. - 2.12.0 + 2.14.0 @@ -50,5 +50,24 @@ 3.4.2 runtime @@ -269,7 +269,7 @@ index 8baf329b..060a8ec7 100644 diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 472314c2..8eb06572 100644 +index 472314c2f..8eb065721 100644 --- a/module/cmd-alert/pom.xml +++ b/module/cmd-alert/pom.xml @@ -5,13 +5,13 @@ @@ -289,7 +289,7 @@ index 472314c2..8eb06572 100644 jar diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index de8faee0..09e2835a 100644 +index de8faee02..09e2835aa 100644 --- a/module/cmd-find/pom.xml +++ b/module/cmd-find/pom.xml @@ -5,13 +5,13 @@ @@ -309,7 +309,7 @@ index de8faee0..09e2835a 100644 jar diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index 0cab9a7a..5d1ff042 100644 +index 0cab9a7ab..5d1ff0424 100644 --- a/module/cmd-list/pom.xml +++ b/module/cmd-list/pom.xml @@ -5,13 +5,13 @@ @@ -329,7 +329,7 @@ index 0cab9a7a..5d1ff042 100644 jar diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index 240c9548..1f6a7c68 100644 +index 240c95487..1f6a7c681 100644 --- a/module/cmd-send/pom.xml +++ b/module/cmd-send/pom.xml @@ -5,13 +5,13 @@ @@ -349,7 +349,7 @@ index 240c9548..1f6a7c68 100644 jar diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 4c13d517..c353e829 100644 +index 4c13d5177..c353e8293 100644 --- a/module/cmd-server/pom.xml +++ b/module/cmd-server/pom.xml @@ -5,13 +5,13 @@ @@ -369,7 +369,7 @@ index 4c13d517..c353e829 100644 jar diff --git a/module/pom.xml b/module/pom.xml -index c9849b6c..ca0a9c87 100644 +index c9849b6c1..ca0a9c87d 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -5,18 +5,18 @@ @@ -405,7 +405,7 @@ index c9849b6c..ca0a9c87 100644 compile diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index 45910b0e..d1a2d86c 100644 +index 45910b0e7..d1a2d86c8 100644 --- a/module/reconnect-yaml/pom.xml +++ b/module/reconnect-yaml/pom.xml @@ -5,13 +5,13 @@ @@ -425,7 +425,7 @@ index 45910b0e..d1a2d86c 100644 jar diff --git a/native/pom.xml b/native/pom.xml -index db15febb..a2efb5e5 100644 +index db15febbc..a2efb5e52 100644 --- a/native/pom.xml +++ b/native/pom.xml @@ -5,18 +5,18 @@ @@ -452,7 +452,7 @@ index db15febb..a2efb5e5 100644 diff --git a/pom.xml b/pom.xml -index fa4dd98d..7757ce6f 100644 +index bfec1abc2..0183f7148 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -499,7 +499,7 @@ index fa4dd98d..7757ce6f 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 402266ca..993cbca9 100644 +index 402266ca1..993cbca95 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -5,18 +5,18 @@ @@ -535,7 +535,7 @@ index 402266ca..993cbca9 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index 7a872a54..330697bc 100644 +index 7a872a549..330697bc7 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -597,7 +597,7 @@ index 7a872a54..330697bc 100644 compile diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -index 338c30d3..c0499252 100644 +index 338c30d35..c04992523 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java +++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java @@ -20,7 +20,7 @@ public class JenkinsModuleSource implements ModuleSource @@ -610,7 +610,7 @@ index 338c30d3..c0499252 100644 version.getBuild(), module.getName() diff --git a/query/pom.xml b/query/pom.xml -index 8ce88f4a..813696e4 100644 +index 8ce88f4a4..813696e45 100644 --- a/query/pom.xml +++ b/query/pom.xml @@ -5,18 +5,18 @@ @@ -646,5 +646,4 @@ index 8ce88f4a..813696e4 100644 compile -- -2.30.0 - +2.30.1 From 296c62b808252885f882f311093e6cc0c450b313 Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Fri, 9 Apr 2021 02:56:21 +0900 Subject: [PATCH 037/499] Updated Upstream (Waterfall) (#155) 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 Waterfall Changes: cb25ad5 Updated Upstream (BungeeCord) 4ef9bab Updated Upstream (BungeeCord) 07617c8 Fix further issues with rgb text pattern matching (#615) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Waterfall b/Waterfall index 57c175ce..cb25ad54 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 57c175ce7f38b36d89d540425423ac3af156119f +Subproject commit cb25ad54090277d5d175193352947e692daa269b diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 92e9562a..66cc500f 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 645dd7b625e6cda74114262e66edec565f7fda58 Mon Sep 17 00:00:00 2001 +From 891ed926bf9e31d97a3c1b166c55666d32531d37 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -1382,7 +1382,7 @@ index 491cf1a1..299a216c 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index b486f2aa..c12085e1 100644 +index 2d9c0cda..a4c25575 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBufAllocator; @@ -1393,7 +1393,7 @@ index b486f2aa..c12085e1 100644 import java.util.Queue; import java.util.Set; import java.util.UUID; -@@ -268,10 +269,20 @@ public class ServerConnector extends PacketHandler +@@ -270,10 +271,20 @@ public class ServerConnector extends PacketHandler user.getServer().disconnect( "Quitting" ); } else { @@ -1418,7 +1418,7 @@ index b486f2aa..c12085e1 100644 } user.setDimension( login.getDimension() ); -@@ -284,7 +295,7 @@ public class ServerConnector extends PacketHandler +@@ -286,7 +297,7 @@ public class ServerConnector extends PacketHandler if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall for ( Objective objective : serverScoreboard.getObjectives() ) { @@ -1427,7 +1427,7 @@ index b486f2aa..c12085e1 100644 } for ( Score score : serverScoreboard.getScores() ) { -@@ -454,6 +465,14 @@ public class ServerConnector extends PacketHandler +@@ -456,6 +467,14 @@ public class ServerConnector extends PacketHandler { this.handshakeHandler.handle( pluginMessage ); @@ -2010,5 +2010,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.30.0 +2.25.1 From 54ed4e86312a06f147f300b74599982fc26a7ebd Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Thu, 8 Apr 2021 15:55:49 -0300 Subject: [PATCH 038/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 4ef9babb..cb25ad54 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 4ef9babb31f4cee622b51e273cd401c931dbfe79 +Subproject commit cb25ad54090277d5d175193352947e692daa269b From 3dca451dcb1d1a25fcc9574112910887a7b34b67 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Thu, 8 Apr 2021 16:14:05 -0300 Subject: [PATCH 039/499] Renamed Travertine -> FlameCord --- travertine => flamecord | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename travertine => flamecord (100%) mode change 100755 => 100644 diff --git a/travertine b/flamecord old mode 100755 new mode 100644 similarity index 100% rename from travertine rename to flamecord From 8275df5b4bb5cd45d6add2d85a980d0f614b4074 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Apr 2021 22:14:31 +0100 Subject: [PATCH 040/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 8455800 Updated Upstream (BungeeCord) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index cb25ad54..84558002 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit cb25ad54090277d5d175193352947e692daa269b +Subproject commit 845580021b932f07ea5882f08db76e548ac99c18 From 51c4e52e4e388ac573dddd6a55d566ed6f0d87d9 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 12 Apr 2021 07:38:28 +0100 Subject: [PATCH 041/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 4960583 Add native macos DNS resolver --- Waterfall | 2 +- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Waterfall b/Waterfall index 84558002..49605839 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 845580021b932f07ea5882f08db76e548ac99c18 +Subproject commit 49605839bc79aa176429f3b965e3f988d840e154 diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index c3c52493..1e108a88 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From c5ebed82ea418dd7281481f4971080bdc70629e5 Mon Sep 17 00:00:00 2001 +From ac5a18e97dbbc5cb69352de75f38895c60433503 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index c2b55587d..1cd99ed30 100644 +index ca1ed8811..adec9d39f 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -452,7 +452,7 @@ index db15febbc..a2efb5e52 100644 diff --git a/pom.xml b/pom.xml -index bfec1abc2..0183f7148 100644 +index 56bb4a7aa..b3ee7b0cd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -535,7 +535,7 @@ index 402266ca1..993cbca95 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index 7a872a549..330697bc7 100644 +index ca1fc13b9..d67d1a5d3 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -559,7 +559,7 @@ index 7a872a549..330697bc7 100644 Proxy component of the Elastic Portal Suite -@@ -59,31 +59,31 @@ +@@ -65,31 +65,31 @@ io.github.waterfallmc @@ -646,5 +646,5 @@ index 8ce88f4a4..813696e45 100644 compile -- -2.30.1 +2.31.0 From 6f04399d90ff5eba034731fabc9c063b1c1f9809 Mon Sep 17 00:00:00 2001 From: Permisos <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:41:41 -0300 Subject: [PATCH 042/499] Patches. --- 0025-Check-if-packetID-is-invalid.patch | 25 +++++++++++++++++++ ...necraftDecoder-if-ByteBuf-is-readabl.patch | 21 ++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 0025-Check-if-packetID-is-invalid.patch create mode 100644 0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch diff --git a/0025-Check-if-packetID-is-invalid.patch b/0025-Check-if-packetID-is-invalid.patch new file mode 100644 index 00000000..6569d947 --- /dev/null +++ b/0025-Check-if-packetID-is-invalid.patch @@ -0,0 +1,25 @@ +From e4a35d4d710e5781cb384e3ad08309f43c0f4b44 Mon Sep 17 00:00:00 2001 +From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> +Date: Thu, 15 Apr 2021 08:34:57 -0300 +Subject: [PATCH] Check if packetID is invalid. + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index dd089abd..b3de7a7b 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -65,7 +65,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder + + int packetId = DefinedPacket.readVarInt( in ); + packetTypeInfo = packetId; +- ++ // FlameCord Start - Check if packetId is invalid. ++ if (packetId < 0 || packetId > 255) ++ throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); ++ // Flamecord End + DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); + if ( packet != null ) + { +-- +2.29.2.windows.3 + diff --git a/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch b/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch new file mode 100644 index 00000000..a5b6c94b --- /dev/null +++ b/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch @@ -0,0 +1,21 @@ +From 47c853f657b01df7a8202cd2a17bb7bfc8f8bc7c Mon Sep 17 00:00:00 2001 +From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> +Date: Thu, 15 Apr 2021 08:38:32 -0300 +Subject: [PATCH] Skip bytes in MinecraftDecoder if ByteBuf is readable. + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index b3de7a7b..5d9be1ba 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -83,6 +83,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + throw PACKET_NOT_READ_TO_END; + } + // Waterfall end ++ in.skipBytes(in.readableBytes()); // Flamecord - Skip bytes. + throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot.getDirection() ); + } + } else +-- +2.29.2.windows.3 + From c7fc74f69bbedd5696d0c3d9666140a821bbc6ba Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 15 Apr 2021 16:40:47 +0100 Subject: [PATCH 043/499] Fix compilation in paths with spaces (Fixes #154) --- scripts/applyPatches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 7118f73a..fad21742 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -65,7 +65,7 @@ basedir=$basedir/Waterfall pushd Waterfall applyPatch BungeeCord Waterfall-Proxy HEAD popd -basedir=$(dirname $basedir) +basedir=$(dirname "$basedir") # Apply travertine patches applyPatch Waterfall/Waterfall-Proxy Travertine-Proxy HEAD From dc33fa190e0ea2e27c6943f739c081ceddff226e Mon Sep 17 00:00:00 2001 From: Permisos <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:12:33 -0300 Subject: [PATCH 044/499] Fix. --- 0025-Check-if-packetID-is-invalid.patch | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 0025-Check-if-packetID-is-invalid.patch diff --git a/0025-Check-if-packetID-is-invalid.patch b/0025-Check-if-packetID-is-invalid.patch deleted file mode 100644 index 6569d947..00000000 --- a/0025-Check-if-packetID-is-invalid.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e4a35d4d710e5781cb384e3ad08309f43c0f4b44 Mon Sep 17 00:00:00 2001 -From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> -Date: Thu, 15 Apr 2021 08:34:57 -0300 -Subject: [PATCH] Check if packetID is invalid. - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index dd089abd..b3de7a7b 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -65,7 +65,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder - - int packetId = DefinedPacket.readVarInt( in ); - packetTypeInfo = packetId; -- -+ // FlameCord Start - Check if packetId is invalid. -+ if (packetId < 0 || packetId > 255) -+ throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); -+ // Flamecord End - DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); - if ( packet != null ) - { --- -2.29.2.windows.3 - From 6a20b1da977e0865f2fb618b14380052ea817243 Mon Sep 17 00:00:00 2001 From: Permisos <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:12:43 -0300 Subject: [PATCH 045/499] Fix. --- ...necraftDecoder-if-ByteBuf-is-readabl.patch | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch diff --git a/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch b/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch deleted file mode 100644 index a5b6c94b..00000000 --- a/0026-Skip-bytes-in-MinecraftDecoder-if-ByteBuf-is-readabl.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 47c853f657b01df7a8202cd2a17bb7bfc8f8bc7c Mon Sep 17 00:00:00 2001 -From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> -Date: Thu, 15 Apr 2021 08:38:32 -0300 -Subject: [PATCH] Skip bytes in MinecraftDecoder if ByteBuf is readable. - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index b3de7a7b..5d9be1ba 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -83,6 +83,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - throw PACKET_NOT_READ_TO_END; - } - // Waterfall end -+ in.skipBytes(in.readableBytes()); // Flamecord - Skip bytes. - throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot.getDirection() ); - } - } else --- -2.29.2.windows.3 - From cf60bfba66079e935545af3e80eaf97945c56711 Mon Sep 17 00:00:00 2001 From: Permisos <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:13:14 -0300 Subject: [PATCH 046/499] Patches Fixed. --- .../0025-Check-if-packetID-is-invalid.patch | 25 +++++++++++++++ ...n-PACKET_NOT_READ_TO_END-and-changed.patch | 31 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch create mode 100644 Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch diff --git a/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch new file mode 100644 index 00000000..6569d947 --- /dev/null +++ b/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch @@ -0,0 +1,25 @@ +From e4a35d4d710e5781cb384e3ad08309f43c0f4b44 Mon Sep 17 00:00:00 2001 +From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> +Date: Thu, 15 Apr 2021 08:34:57 -0300 +Subject: [PATCH] Check if packetID is invalid. + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index dd089abd..b3de7a7b 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -65,7 +65,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder + + int packetId = DefinedPacket.readVarInt( in ); + packetTypeInfo = packetId; +- ++ // FlameCord Start - Check if packetId is invalid. ++ if (packetId < 0 || packetId > 255) ++ throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); ++ // Flamecord End + DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); + if ( packet != null ) + { +-- +2.29.2.windows.3 + diff --git a/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch b/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch new file mode 100644 index 00000000..af8925c7 --- /dev/null +++ b/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch @@ -0,0 +1,31 @@ +From fe675f579c624b8639741339676713bea14dfc8d Mon Sep 17 00:00:00 2001 +From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> +Date: Thu, 15 Apr 2021 14:11:24 -0300 +Subject: [PATCH] Add skip bytes on PACKET_NOT_READ_TO_END and changed 255 to + MAX_PACKET_ID + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index b3de7a7b..9b7934b8 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -66,7 +66,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + int packetId = DefinedPacket.readVarInt( in ); + packetTypeInfo = packetId; + // FlameCord Start - Check if packetId is invalid. +- if (packetId < 0 || packetId > 255) ++ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) + throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); + // Flamecord End + DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); +@@ -83,6 +83,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + throw PACKET_NOT_READ_TO_END; + } + // Waterfall end ++ in.skipBytes(in.readableBytes()); // Flamecord - Skip bytes. + throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot.getDirection() ); + } + } else +-- +2.29.2.windows.3 + From fef5bcbbe15e76b717b1509fd59f6319f8fccf5f Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Thu, 15 Apr 2021 14:28:01 -0300 Subject: [PATCH 047/499] Fixed patch 0025 --- .../0025-Check-if-packetID-is-invalid.patch | 2 +- ...n-PACKET_NOT_READ_TO_END-and-changed.patch | 31 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch diff --git a/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch index 6569d947..3d2795b5 100644 --- a/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch @@ -14,7 +14,7 @@ index dd089abd..b3de7a7b 100644 packetTypeInfo = packetId; - + // FlameCord Start - Check if packetId is invalid. -+ if (packetId < 0 || packetId > 255) ++ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) + throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); + // Flamecord End DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); diff --git a/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch b/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch deleted file mode 100644 index af8925c7..00000000 --- a/Waterfall-Proxy-Patches/0026-Add-skip-bytes-on-PACKET_NOT_READ_TO_END-and-changed.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fe675f579c624b8639741339676713bea14dfc8d Mon Sep 17 00:00:00 2001 -From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> -Date: Thu, 15 Apr 2021 14:11:24 -0300 -Subject: [PATCH] Add skip bytes on PACKET_NOT_READ_TO_END and changed 255 to - MAX_PACKET_ID - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index b3de7a7b..9b7934b8 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -66,7 +66,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - int packetId = DefinedPacket.readVarInt( in ); - packetTypeInfo = packetId; - // FlameCord Start - Check if packetId is invalid. -- if (packetId < 0 || packetId > 255) -+ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) - throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); - // Flamecord End - DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); -@@ -83,6 +83,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - throw PACKET_NOT_READ_TO_END; - } - // Waterfall end -+ in.skipBytes(in.readableBytes()); // Flamecord - Skip bytes. - throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot.getDirection() ); - } - } else --- -2.29.2.windows.3 - From 2a1d806e5fb7f2cb86f45ebf00a68f5cbe7c7fbf Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 16 Apr 2021 16:21:23 +0100 Subject: [PATCH 048/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 6702e0f Put ReadTimeoutHandler after frame decoder. c19c477 Only ignore empty packets from the server (Fixes #467) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 49605839..6702e0f6 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 49605839bc79aa176429f3b965e3f988d840e154 +Subproject commit 6702e0f69b2fa32c1046d277ade2107e22ba9134 From 9f67dca820b675f2dc208f182011aee72bf7f06d Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 23 Apr 2021 14:54:48 -0300 Subject: [PATCH 049/499] Fixed query bugs --- .../0024-Fix-ByteBuf-memory-leaks.patch | 220 +----------------- 1 file changed, 1 insertion(+), 219 deletions(-) diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch index 9e9fae73..fd379186 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -210,224 +210,6 @@ index 46e338ca..048ac826 100644 if ( sendPacket && packet.packet != null ) { try -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b3bdfd05..0c5d8488 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -67,109 +67,125 @@ public class QueryHandler extends SimpleChannelInboundHandler - - private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg) - { -+ AddressedEnvelope response = null; - ByteBuf in = msg.content(); -- if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) -- { -- bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); -- // FlameCord - Close on incorrect magic -- ctx.close(); -- return; -- } -- -- ByteBuf out = ctx.alloc().buffer(); -- AddressedEnvelope response = new DatagramPacket( out, msg.sender() ); -- -- byte type = in.readByte(); -- int sessionId = in.readInt(); -- -- if ( type == 0x09 ) -- { -- out.writeByte( 0x09 ); -- out.writeInt( sessionId ); -- -- int challengeToken = random.nextInt(); -- sessions.put( msg.sender().getAddress(), new QuerySession( challengeToken, System.currentTimeMillis() ) ); - -- writeNumber( out, challengeToken ); -- } -- -- if ( type == 0x00 ) -- { -- int challengeToken = in.readInt(); -- QuerySession session = sessions.getIfPresent( msg.sender().getAddress() ); -- if ( session == null || session.getToken() != challengeToken ) -+ try { -+ if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) - { -- throw cachedNoSessionException; // Waterfall -+ bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); -+ // FlameCord - Close on incorrect magic -+ ctx.close(); -+ return; - } - -- // Waterfall start -- List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); -+ ByteBuf out = ctx.alloc().buffer(); - -- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", -- bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), -- listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); -- QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); -- // Waterfall end -+ try { -+ response = new DatagramPacket( out, msg.sender() ); - -- out.writeByte( 0x00 ); -- out.writeInt( sessionId ); -+ byte type = in.readByte(); -+ int sessionId = in.readInt(); - -- if ( in.readableBytes() == 0 ) -- { -- // Short response -- // Waterfall start -- writeString( out, result.getMotd() ); // MOTD -- writeString( out, result.getGameType() ); // Game Type -- writeString( out, result.getWorldName() ); // World Name -- writeNumber( out, result.getOnlinePlayers() ); // Online Count -- writeNumber( out, result.getMaxPlayers() ); // Max Players -- writeShort( out, result.getPort() ); // Port -- writeString( out, result.getAddress() ); // IP -- // Waterfall end -- } else if ( in.readableBytes() == 4 ) -- { -- // Long Response -- out.writeBytes( new byte[] -+ if ( type == 0x09 ) - { -- 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 -- } ); -- Map data = new LinkedHashMap<>(); -- -- // Waterfall start -- data.put( "hostname", result.getMotd() ); -- data.put( "gametype", result.getGameType() ); -- // Start Extra Info -- data.put( "game_id", result.getGameId() ); -- data.put( "version", result.getVersion() ); -- data.put( "plugins", "" ); // TODO: Allow population? -- // End Extra Info -- data.put( "map", result.getWorldName() ); -- data.put( "numplayers", Integer.toString( result.getOnlinePlayers() ) ); -- data.put( "maxplayers", Integer.toString( result.getMaxPlayers() ) ); -- data.put( "hostport", Integer.toString( result.getPort() ) ); -- data.put( "hostip", result.getAddress() ); -- // Waterfall end -- -- for ( Map.Entry entry : data.entrySet() ) -+ out.writeByte( 0x09 ); -+ out.writeInt( sessionId ); -+ -+ int challengeToken = random.nextInt(); -+ sessions.put( msg.sender().getAddress(), new QuerySession( challengeToken, System.currentTimeMillis() ) ); -+ -+ writeNumber( out, challengeToken ); -+ } -+ -+ if ( type == 0x00 ) - { -- writeString( out, entry.getKey() ); -- writeString( out, entry.getValue() ); -+ int challengeToken = in.readInt(); -+ QuerySession session = sessions.getIfPresent( msg.sender().getAddress() ); -+ if ( session == null || session.getToken() != challengeToken ) -+ { -+ throw cachedNoSessionException; // Waterfall -+ } -+ -+ // Waterfall start -+ List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); -+ -+ ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", -+ bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), -+ listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); -+ QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); -+ // Waterfall end -+ -+ out.writeByte( 0x00 ); -+ out.writeInt( sessionId ); -+ -+ if ( in.readableBytes() == 0 ) -+ { -+ // Short response -+ // Waterfall start -+ writeString( out, result.getMotd() ); // MOTD -+ writeString( out, result.getGameType() ); // Game Type -+ writeString( out, result.getWorldName() ); // World Name -+ writeNumber( out, result.getOnlinePlayers() ); // Online Count -+ writeNumber( out, result.getMaxPlayers() ); // Max Players -+ writeShort( out, result.getPort() ); // Port -+ writeString( out, result.getAddress() ); // IP -+ // Waterfall end -+ } else if ( in.readableBytes() == 4 ) -+ { -+ // Long Response -+ out.writeBytes( new byte[] -+ { -+ 0x73, 0x70, 0x6C, 0x69, 0x74, 0x6E, 0x75, 0x6D, 0x00, (byte) 0x80, 0x00 -+ } ); -+ Map data = new LinkedHashMap<>(); -+ -+ // Waterfall start -+ data.put( "hostname", result.getMotd() ); -+ data.put( "gametype", result.getGameType() ); -+ // Start Extra Info -+ data.put( "game_id", result.getGameId() ); -+ data.put( "version", result.getVersion() ); -+ data.put( "plugins", "" ); // TODO: Allow population? -+ // End Extra Info -+ data.put( "map", result.getWorldName() ); -+ data.put( "numplayers", Integer.toString( result.getOnlinePlayers() ) ); -+ data.put( "maxplayers", Integer.toString( result.getMaxPlayers() ) ); -+ data.put( "hostport", Integer.toString( result.getPort() ) ); -+ data.put( "hostip", result.getAddress() ); -+ // Waterfall end -+ -+ for ( Map.Entry entry : data.entrySet() ) -+ { -+ writeString( out, entry.getKey() ); -+ writeString( out, entry.getValue() ); -+ } -+ out.writeByte( 0x00 ); // Null -+ -+ // Padding -+ writeString( out, "\01player_\00" ); -+ // Player List -+ result.getPlayers().stream().forEach(p -> writeString(out, p)); // Waterfall -+ out.writeByte( 0x00 ); // Null -+ } else -+ { -+ // Error! -+ throw new IllegalStateException( "Invalid data request packet" ); -+ } - } -- out.writeByte( 0x00 ); // Null -- -- // Padding -- writeString( out, "\01player_\00" ); -- // Player List -- result.getPlayers().stream().forEach(p -> writeString(out, p)); // Waterfall -- out.writeByte( 0x00 ); // Null -- } else -+ } finally - { -- // Error! -- throw new IllegalStateException( "Invalid data request packet" ); -+ out.release(); - } -+ } finally -+ { -+ in.release(); - } - -- ctx.writeAndFlush( response ); -+ if (response != null) -+ { -+ ctx.writeAndFlush( response ); -+ } - } - - @Override --- +-- 2.31.0.windows.1 From 1e8179875166f6126d9974256af46771be954f69 Mon Sep 17 00:00:00 2001 From: ad1tya2 <74638765+ad1tya2@users.noreply.github.com> Date: Sun, 25 Apr 2021 18:51:38 +0530 Subject: [PATCH 050/499] Update Waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 6702e0f6..e782e77e 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 6702e0f69b2fa32c1046d277ade2107e22ba9134 +Subproject commit e782e77edf184ddea7ce5e7c33bcac567fc8b0d5 From a4341cc52b25f300b32bf2f33ae4ade225acf86d Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 29 Apr 2021 17:29:05 -0300 Subject: [PATCH 051/499] Bump version number --- Waterfall-Proxy-Patches/0013-Rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-Rebrand.patch b/Waterfall-Proxy-Patches/0013-Rebrand.patch index f037ed53..eff57151 100644 --- a/Waterfall-Proxy-Patches/0013-Rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-Rebrand.patch @@ -34,7 +34,7 @@ index a17ed68e..3e4ebfc5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.7"; ++ return "0.4.8"; } public void reloadMessages() From 4ce6d99ef16c371af209808d29a839c4a7420c7e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 30 Apr 2021 00:53:22 +0100 Subject: [PATCH 052/499] Updated Upstream (Waterfall) 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 Waterfall Changes: bf21a39 Don't register entity effect packets for 1.9+ f188d4c Updated Upstream (BungeeCord) (#634) e782e77 Set Netty pooled buffer size to 4MB d43773a server is the client and not server is the server (Fixes #631) --- Waterfall | 2 +- ...erences-from-Waterfall-to-Travertine.patch | 20 +-- .../0003-1.7.x-Protocol-Patch.patch | 128 +++++++++--------- 3 files changed, 73 insertions(+), 77 deletions(-) diff --git a/Waterfall b/Waterfall index 6702e0f6..bf21a394 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 6702e0f69b2fa32c1046d277ade2107e22ba9134 +Subproject commit bf21a394fa1b222043bfbc3366ae934c1cfea698 diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index d43aae40..52576e4c 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,11 +1,11 @@ -From 137ac0179db533a6f030c034a467af2f129848ea Mon Sep 17 00:00:00 2001 +From a0cb842ba495bb4bcbfe26563d873642d5a065b5 Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -index a4516ed9..1f63a2c2 100644 +index a4516ed96..1f63a2c27 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -7,7 +7,7 @@ public class Bootstrap @@ -18,7 +18,7 @@ index a4516ed9..1f63a2c2 100644 return; } diff --git a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -index d703d6d2..d8dcdc1e 100644 +index d703d6d24..d8dcdc1e3 100644 --- a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java +++ b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java @@ -12,7 +12,7 @@ public class LogDispatcher extends Thread @@ -31,7 +31,7 @@ index d703d6d2..d8dcdc1e 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2938f2f1..f7f1e7cc 100644 +index 2938f2f15..f7f1e7ccd 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer @@ -53,10 +53,10 @@ index 2938f2f1..f7f1e7cc 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index e830198d..cc05b1fc 100644 +index 771b37258..6a5193feb 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -58,7 +58,7 @@ public class BungeeCordLauncher +@@ -71,7 +71,7 @@ public class BungeeCordLauncher BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); @@ -66,7 +66,7 @@ index e830198d..cc05b1fc 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index b26035cf..4e2c6129 100644 +index b26035cf9..4e2c6129c 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,6 @@ public class CommandBungee extends Command @@ -78,7 +78,7 @@ index b26035cf..4e2c6129 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -index 720d0c3b..dca7601b 100644 +index 720d0c3b5..dca7601b0 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -23,7 +23,7 @@ public class CommandReload extends Command @@ -92,7 +92,7 @@ index 720d0c3b..dca7601b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 65121ba2..d4fad294 100644 +index 65121ba24..d4fad294c 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -227,7 +227,7 @@ public class YamlConfig implements ConfigurationAdapter @@ -105,5 +105,5 @@ index 65121ba2..d4fad294 100644 SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- -2.29.2 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 66cc500f..4beed3ea 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 891ed926bf9e31d97a3c1b166c55666d32531d37 Mon Sep 17 00:00:00 2001 +From bc92a3b1a1f14ed5b31b8baa82e17b4ede1d8bdf Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -6,7 +6,7 @@ Subject: [PATCH] 1.7.x Protocol Patch diff --git a/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java b/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java new file mode 100644 -index 00000000..90064112 +index 000000000..90064112e --- /dev/null +++ b/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java @@ -0,0 +1,90 @@ @@ -101,7 +101,7 @@ index 00000000..90064112 + } +} 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 -index 31a95495..93d17f6b 100644 +index 31a954950..93d17f6b5 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -266,6 +266,11 @@ public abstract class DefinedPacket @@ -129,7 +129,7 @@ index 31a95495..93d17f6b 100644 @Override diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ac9f114d..2caadfed 100644 +index 01d35f41a..52f602763 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -57,7 +57,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -142,7 +142,7 @@ index ac9f114d..2caadfed 100644 if ( in.isReadable() ) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -index d4b03843..9aac7ca9 100644 +index d4b038434..9aac7ca9f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java @@ -21,6 +21,6 @@ public class MinecraftEncoder extends MessageToByteEncoder @@ -154,7 +154,7 @@ index d4b03843..9aac7ca9 100644 } } 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 -index d372933d..1feee418 100644 +index 0dffc8d23..ff671706d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -55,7 +55,7 @@ public enum Protocol @@ -202,25 +202,21 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -118,7 +118,7 @@ public enum Protocol +@@ -118,20 +118,19 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, // Waterfall - speed up packet construction - map(ProtocolConstants.MINECRAFT_1_8, 0x1D), + map(ProtocolConstants.MINECRAFT_1_7_2, 0x1D), // Travertine - map(ProtocolConstants.MINECRAFT_1_9, 0x4C), - map(ProtocolConstants.MINECRAFT_1_9_4, 0x4B), - map(ProtocolConstants.MINECRAFT_1_12, 0x4E), -@@ -131,7 +131,7 @@ public enum Protocol + map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + ); TO_CLIENT.registerPacket( EntityRemoveEffect.class, EntityRemoveEffect::new, // Waterfall - speed up packet construction - map(ProtocolConstants.MINECRAFT_1_8, 0x1E), + map(ProtocolConstants.MINECRAFT_1_7_2, 0x1E), // Travertine - map(ProtocolConstants.MINECRAFT_1_9, 0x31), - map(ProtocolConstants.MINECRAFT_1_12, 0x32), - map(ProtocolConstants.MINECRAFT_1_12_1, 0x33), -@@ -144,8 +144,7 @@ public enum Protocol + map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + ); // Waterfall end TO_CLIENT.registerPacket( PlayerListItem.class, // PlayerInfo @@ -230,7 +226,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -157,7 +156,7 @@ public enum Protocol +@@ -143,7 +142,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, // Waterfall - speed up packet construction @@ -239,7 +235,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -167,7 +166,7 @@ public enum Protocol +@@ -153,7 +152,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, // Waterfall - speed up packet construction @@ -248,7 +244,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -178,7 +177,7 @@ public enum Protocol +@@ -164,7 +163,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, // Waterfall - speed up packet construction @@ -257,7 +253,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -189,7 +188,7 @@ public enum Protocol +@@ -175,7 +174,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, // Waterfall - speed up packet construction @@ -266,7 +262,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -200,7 +199,7 @@ public enum Protocol +@@ -186,7 +185,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, // Waterfall - speed up packet construction @@ -275,7 +271,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -211,7 +210,7 @@ public enum Protocol +@@ -197,7 +196,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet construction @@ -284,7 +280,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -222,7 +221,7 @@ public enum Protocol +@@ -208,7 +207,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, // Waterfall - speed up packet construction @@ -293,7 +289,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -233,7 +232,7 @@ public enum Protocol +@@ -219,7 +218,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, // Waterfall - speed up packet construction @@ -302,7 +298,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -244,7 +243,7 @@ public enum Protocol +@@ -230,7 +229,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, // Waterfall - speed up packet construction @@ -311,7 +307,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -257,7 +256,7 @@ public enum Protocol +@@ -243,7 +242,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, // Waterfall - speed up packet construction @@ -320,7 +316,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -291,7 +290,7 @@ public enum Protocol +@@ -277,7 +276,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, // Waterfall - speed up packet construction @@ -329,7 +325,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -302,7 +301,7 @@ public enum Protocol +@@ -288,7 +287,7 @@ public enum Protocol TO_SERVER.registerPacket( Chat.class, Chat::new, // Waterfall - speed up packet construction @@ -338,7 +334,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -311,7 +310,7 @@ public enum Protocol +@@ -297,7 +296,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, // Waterfall - speed up packet construction @@ -347,7 +343,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -321,7 +320,7 @@ public enum Protocol +@@ -307,7 +306,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, // Waterfall - speed up packet construction @@ -356,7 +352,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -330,7 +329,7 @@ public enum Protocol +@@ -316,7 +315,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet construction @@ -365,7 +361,7 @@ index d372933d..1feee418 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -347,23 +346,23 @@ public enum Protocol +@@ -333,23 +332,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, // Waterfall - speed up packet construction @@ -393,7 +389,7 @@ index d372933d..1feee418 100644 ); } }, -@@ -375,22 +374,22 @@ public enum Protocol +@@ -361,22 +360,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, // Waterfall - speed up packet construction @@ -420,7 +416,7 @@ index d372933d..1feee418 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -401,12 +400,12 @@ public enum Protocol +@@ -387,12 +386,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, // Waterfall - speed up packet construction @@ -435,7 +431,7 @@ index d372933d..1feee418 100644 ); TO_SERVER.registerPacket( LoginPayloadResponse.class, -@@ -526,7 +525,11 @@ public enum Protocol +@@ -512,7 +511,11 @@ public enum Protocol } if ( !hasPacket(id, supportsForge) ) { @@ -449,7 +445,7 @@ index d372933d..1feee418 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index 2202c4d3..6600185b 100644 +index 2202c4d3d..6600185b5 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -6,6 +6,8 @@ import java.util.List; @@ -479,7 +475,7 @@ index 2202c4d3..6600185b 100644 ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d37142..a07e25b1 100644 +index c0d371426..a07e25b1f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -6,10 +6,12 @@ import io.netty.channel.ChannelHandlerContext; @@ -513,7 +509,7 @@ index c0d37142..a07e25b1 100644 if ( in.readableBytes() < length ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index 828a5dbe..195ec088 100644 +index 828a5dbe6..195ec0886 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -1,5 +1,6 @@ @@ -562,7 +558,7 @@ index 828a5dbe..195ec088 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 9daf7a73..b7640fcb 100644 +index 9daf7a737..b7640fcbf 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -1,5 +1,7 @@ @@ -623,7 +619,7 @@ index 9daf7a73..b7640fcb 100644 public void handle(AbstractPacketHandler handler) throws Exception { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca..8d9f4ccb 100644 +index a29524ca8..8d9f4ccb3 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java @@ -1,25 +1,35 @@ @@ -682,7 +678,7 @@ index a29524ca..8d9f4ccb 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 53575ce0..1a41da75 100644 +index 53575ce0e..1a41da75a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -1,5 +1,6 @@ @@ -732,7 +728,7 @@ index 53575ce0..1a41da75 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9..07fc21b6 100644 +index d11a9ea9d..07fc21b65 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java @@ -1,18 +1,19 @@ @@ -788,7 +784,7 @@ index d11a9ea9..07fc21b6 100644 public void write(ByteBuf buf) { writeVarInt(this.entityId, buf); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3a..9f8d56fc 100644 +index 7ed2dc3ab..9f8d56fc7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java @@ -1,18 +1,18 @@ @@ -841,7 +837,7 @@ index 7ed2dc3a..9f8d56fc 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc41..0c2eb022 100644 +index b004bc416..0c2eb022f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java @@ -1,5 +1,6 @@ @@ -887,7 +883,7 @@ index b004bc41..0c2eb022 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 551bd104..ac8751f6 100644 +index 551bd1046..ac8751f6e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java @@ -23,6 +23,11 @@ public class LoginSuccess extends DefinedPacket @@ -930,7 +926,7 @@ index 551bd104..ac8751f6 100644 + // Travertine end } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 92bacc7c..c919f961 100644 +index 92bacc7cd..c919f961a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java @@ -1,5 +1,7 @@ @@ -986,7 +982,7 @@ index 92bacc7c..c919f961 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 17e12655..c49c5a56 100644 +index 17e12655d..c49c5a567 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -3,6 +3,8 @@ package net.md_5.bungee.protocol.packet; @@ -1040,7 +1036,7 @@ index 17e12655..c49c5a56 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d5..fe290fa3 100644 +index 3c7905d54..fe290fa3c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -1,5 +1,6 @@ @@ -1094,7 +1090,7 @@ index 3c7905d5..fe290fa3 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86..74066702 100644 +index 0b27fc86b..74066702c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java @@ -1,5 +1,6 @@ @@ -1156,7 +1152,7 @@ index 0b27fc86..74066702 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 3e4ea192..421805e6 100644 +index 3e4ea1928..421805e6e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java @@ -1,5 +1,6 @@ @@ -1205,7 +1201,7 @@ index 3e4ea192..421805e6 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6a..415a4bcd 100644 +index a5555f6af..415a4bcde 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java @@ -1,5 +1,6 @@ @@ -1288,7 +1284,7 @@ index a5555f6a..415a4bcd 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index f7f1e7cc..a17ed68e 100644 +index f7f1e7ccd..a17ed68ec 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1307,7 +1303,7 @@ index f7f1e7cc..a17ed68e 100644 private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 494213db..1d89acf5 100644 +index 494213db8..1d89acf5b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java @@ -5,6 +5,7 @@ import net.md_5.bungee.api.chat.BaseComponent; @@ -1327,7 +1323,7 @@ index 494213db..1d89acf5 100644 sendPacket( player, reset ); sendPacket( player, times ); diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a1..299a216c 100644 +index 491cf1a16..299a216cd 100644 --- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java @@ -10,17 +10,32 @@ import com.google.gson.JsonSerializer; @@ -1382,7 +1378,7 @@ index 491cf1a1..299a216c 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 2d9c0cda..a4c25575 100644 +index 2d9c0cda5..a4c255757 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBufAllocator; @@ -1443,7 +1439,7 @@ index 2d9c0cda..a4c25575 100644 throw CancelSendSignal.INSTANCE; } 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 7ec119ea..986a9d05 100644 +index 7ec119ea0..986a9d052 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer @@ -1489,7 +1485,7 @@ index 7ec119ea..986a9d05 100644 { this.compressionThreshold = compressionThreshold; 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 -index 9e180c30..d54d8539 100644 +index 9e180c30c..d54d8539b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1558,7 +1554,7 @@ index 9e180c30..d54d8539 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 b7ecd828..3b82219d 100644 +index b7ecd828e..3b82219d1 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 @@ -3,6 +3,8 @@ package net.md_5.bungee.connection; @@ -1602,7 +1598,7 @@ index b7ecd828..3b82219d 100644 }; diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd..6cd71071 100644 +index 6df3f3dd9..6cd71071e 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; @@ -1623,7 +1619,7 @@ index 6df3f3dd..6cd71071 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 4d7b1b23..ad3bdee5 100644 +index 4d7b1b23e..ad3bdee56 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 @@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler @@ -1641,7 +1637,7 @@ index 4d7b1b23..ad3bdee5 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index db93d883..a3a12e19 100644 +index db93d8835..a3a12e19b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap @@ -1657,7 +1653,7 @@ index db93d883..a3a12e19 100644 case ProtocolConstants.MINECRAFT_1_9: diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java new file mode 100644 -index 00000000..65c1a9ec +index 000000000..65c1a9ec8 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java @@ -0,0 +1,102 @@ @@ -1765,7 +1761,7 @@ index 00000000..65c1a9ec +// Travertine end diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java new file mode 100644 -index 00000000..6755fe84 +index 000000000..6755fe845 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -0,0 +1,62 @@ @@ -1832,7 +1828,7 @@ index 00000000..6755fe84 +} +// Travertine end diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff..f61de127 100644 +index bea2bbff9..f61de1278 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -8,6 +8,7 @@ import lombok.Getter; @@ -1880,7 +1876,7 @@ index bea2bbff..f61de127 100644 + } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8..e3c1b9b9 100644 +index 5e02f8c8a..e3c1b9b95 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java @@ -3,6 +3,7 @@ package net.md_5.bungee.forge; @@ -1915,7 +1911,7 @@ index 5e02f8c8..e3c1b9b9 100644 return WAITINGSERVERDATA; diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index daf12f74..e33861ab 100644 +index daf12f74e..e33861abb 100644 --- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java @@ -4,12 +4,14 @@ import java.util.Collection; @@ -2010,5 +2006,5 @@ index daf12f74..e33861ab 100644 @Override -- -2.25.1 +2.31.1 From 135c7b55a7d6415d9271056c85cac1426e32c329 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 10:40:43 -0300 Subject: [PATCH 053/499] Bump version number --- Waterfall-Proxy-Patches/0013-Rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-Rebrand.patch b/Waterfall-Proxy-Patches/0013-Rebrand.patch index eff57151..7793532d 100644 --- a/Waterfall-Proxy-Patches/0013-Rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-Rebrand.patch @@ -34,7 +34,7 @@ index a17ed68e..3e4ebfc5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.8"; ++ return "0.4.9"; } public void reloadMessages() From 3931f4bfac5c4061dfd4bcb3119162d9e95d5e96 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 30 Apr 2021 19:01:28 -0300 Subject: [PATCH 054/499] Fix patch 0024 --- .../0024-Fix-ByteBuf-memory-leaks.patch | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch index fd379186..f0856e09 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -167,49 +167,6 @@ index cefa0206..2cd5740c 100644 } return modTags; } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 46e338ca..048ac826 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -100,23 +100,32 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - if ( msg instanceof HAProxyMessage ) - { - HAProxyMessage proxy = (HAProxyMessage) msg; -- InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); - -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ try - { -- channel.getRemoteAddress(), newAddress -- } ); -+ InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); -+ -+ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ { -+ channel.getRemoteAddress(), newAddress -+ } ); - -- channel.setRemoteAddress( newAddress ); -+ channel.setRemoteAddress( newAddress ); -+ } finally -+ { -+ proxy.release(); -+ } - return; - } - - if ( handler != null ) - { - PacketWrapper packet = (PacketWrapper) msg; -- boolean sendPacket = handler.shouldHandle( packet ); -+ - try - { -+ boolean sendPacket = handler.shouldHandle( packet ); -+ - if ( sendPacket && packet.packet != null ) - { - try -- 2.31.0.windows.1 From c5dc9c093c7b199426aafc66e05cd7bd840c4957 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 30 Apr 2021 19:26:03 -0300 Subject: [PATCH 055/499] Split Firewall System --- .../0023-FlameCord-General-Patch.patch | 284 ++------------- .../0026-Firewall-System.patch | 337 ++++++++++++++++++ 2 files changed, 357 insertions(+), 264 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0026-Firewall-System.patch diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 23f93825..2d6e4d60 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From ed57b22b9bae1cabd74f9dd91ebe83389d6223ee Mon Sep 17 00:00:00 2001 +From 274f6347ded5b72104c30c9663912270b1c1b116 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,10 +6,10 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..fd889644 +index 00000000..8957c79a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,68 @@ +@@ -0,0 +1,42 @@ +package dev._2lstudios.flamecord; + +import java.util.Collection; @@ -18,7 +18,6 @@ index 00000000..fd889644 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; +import dev._2lstudios.flamecord.configuration.MessagesConfiguration; +import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; +import lombok.Getter; +import net.md_5.bungee.config.ConfigurationProvider; +import net.md_5.bungee.config.YamlConfiguration; @@ -27,15 +26,12 @@ index 00000000..fd889644 + @Getter + private static FlameCord instance; + @Getter -+ private final FirewallManager firewallManager; -+ @Getter + private final FlameCordConfiguration flameCordConfiguration; + @Getter + private final ModulesConfiguration modulesConfiguration; + @Getter + private final MessagesConfiguration messagesConfiguration; + @Getter -+ private final Thread thread; + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { @@ -52,30 +48,8 @@ index 00000000..fd889644 + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); -+ this.firewallManager = new FirewallManager(logger, whitelistedAddresses, -+ flameCordConfiguration.getFirewallSeconds()); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -+ this.thread = new Thread() { -+ @Override -+ public void run() { -+ while (running) { -+ try { -+ sleep(1000L); -+ -+ if (!running) { -+ return; -+ } -+ -+ firewallManager.tick(); -+ } catch (final Exception e) { -+ // Ignored -+ } -+ } -+ } -+ }; -+ -+ this.thread.start(); + } +} \ No newline at end of file @@ -402,168 +376,8 @@ index 00000000..e82c4844 + } + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -new file mode 100644 -index 00000000..6a661898 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -@@ -0,0 +1,30 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.SocketAddress; -+ -+public class FirewallException extends Exception { -+ private static final long serialVersionUID = 1L; -+ -+ public FirewallException(final SocketAddress address) { -+ super("The address " + address + " is blocked from the server!"); -+ } -+ -+ public FirewallException(final String string) { -+ super(string); -+ } -+ -+ public FirewallException(final String string, final Throwable throwable) { -+ super(string, throwable); -+ } -+ -+ @Override -+ public synchronized Throwable initCause(final Throwable cause) -+ { -+ return this; -+ } -+ -+ @Override -+ public synchronized Throwable fillInStackTrace() { -+ return this; -+ } -+} -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -new file mode 100644 -index 00000000..8a474758 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -@@ -0,0 +1,116 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.Collection; -+import java.util.HashSet; -+import java.util.logging.Logger; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import lombok.Getter; -+ -+public class FirewallManager { -+ private final Logger logger; -+ private final Collection whitelistedAddresses; -+ private final Collection firewalled; -+ private final int defaultSeconds; -+ @Getter -+ private int seconds; -+ -+ public FirewallManager(final Logger logger, final Collection whitelistedAddresses, -+ final int defaultSeconds) { -+ this.logger = logger; -+ this.whitelistedAddresses = whitelistedAddresses; -+ this.firewalled = new HashSet<>(); -+ this.defaultSeconds = defaultSeconds; -+ this.seconds = defaultSeconds; -+ } -+ -+ public boolean isWhitelisted(final SocketAddress address) { -+ final String addressString = address.toString(); -+ -+ for (final String whitelistedAddressString : whitelistedAddresses) { -+ if (addressString.endsWith(whitelistedAddressString)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public void addFirewalled(final SocketAddress address) { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ if (!this.firewalled.contains(hostString)) { -+ this.firewalled.add(hostString); -+ logAdded(address); -+ } -+ } -+ } -+ -+ public void logAdded(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_added", hostString)); -+ } -+ } -+ -+ public void logBlocked(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_blocked", hostString)); -+ } -+ } -+ -+ public Collection getFirewalled() { -+ return this.firewalled; -+ } -+ -+ public boolean isFirewalled(final SocketAddress address) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ -+ return this.firewalled.contains(iNetSocketAddress.getHostString()); -+ } -+ -+ public boolean isFirewalled(final String name) { -+ final String nameLowerCase = name.toLowerCase(); -+ -+ for (final String string : FlameCord.getInstance().getFlameCordConfiguration().getFirewallNames()) { -+ if (nameLowerCase.contains(string)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public void tick() { -+ if (--seconds <= 0) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final int size = this.firewalled.size(); -+ -+ if (size > 0) { -+ if (flameCord.getFlameCordConfiguration().isFirewallNotify()) { -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_cleared", size)); -+ } -+ -+ this.firewalled.clear(); -+ } -+ -+ this.seconds = defaultSeconds; -+ } -+ } -+} -\ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index d4729244..dd089abd 100644 +index bb39d31b..5b6f1fd5 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -591,10 +405,10 @@ index d4729244..dd089abd 100644 if ( slice != null ) diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 00000000..fa0b59c2 +index 00000000..bf6f8538 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -0,0 +1,71 @@ +@@ -0,0 +1,61 @@ +package dev._2lstudios.flamecord.commands; + +import java.util.Collection; @@ -602,7 +416,6 @@ index 00000000..fa0b59c2 + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; +import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.chat.TextComponent; @@ -628,15 +441,6 @@ index 00000000..fa0b59c2 + final String arg0 = args[0]; + + switch (arg0) { -+ case "firewall": { -+ final FirewallManager firewallManager = flameCord.getFirewallManager(); -+ final int amount = firewallManager.getFirewalled().size(), -+ seconds = firewallManager.getSeconds(); -+ -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("firewall_info", amount, seconds))); -+ break; -+ } + case "reload": { + // FlameCord - Collect ips from servers + final Collection whitelistedAddresses = new HashSet<>(); @@ -667,7 +471,7 @@ index 00000000..fa0b59c2 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e4ebfc5..316790ee 100644 +index 5d385706..83d3e9ed 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -819,7 +623,7 @@ index 3e4ebfc5..316790ee 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index e90237ac..3cfef373 100644 +index 7b99c466..af242603 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -839,7 +643,7 @@ index e90237ac..3cfef373 100644 import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.MinecraftDecoder; import net.md_5.bungee.protocol.PacketWrapper; -@@ -161,7 +164,13 @@ public class ServerConnector extends PacketHandler +@@ -163,7 +166,13 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -981,40 +785,19 @@ index 6cd71071..09909bd9 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index d68cc2ce..46e338ca 100644 +index b8e50855..d3a89e79 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -1,6 +1,9 @@ +@@ -1,6 +1,8 @@ package net.md_5.bungee.netty; import com.google.common.base.Preconditions; + +import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; -@@ -9,6 +12,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; - import io.netty.handler.timeout.ReadTimeoutException; - import java.io.IOException; - import java.net.InetSocketAddress; -+import java.net.SocketAddress; - import java.util.logging.Level; - import net.md_5.bungee.api.ProxyServer; - import net.md_5.bungee.connection.CancelSendSignal; -@@ -39,12 +43,20 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception - { -+ // FlameCord - Firewall system -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); -+ } -+ - if ( handler != null ) - { +@@ -44,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel = new ChannelWrapper( ctx ); handler.connected( channel ); @@ -1024,7 +807,7 @@ index d68cc2ce..46e338ca 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); } -@@ -60,7 +72,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -60,7 +63,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel.close(); handler.disconnected( channel ); @@ -1034,59 +817,32 @@ index d68cc2ce..46e338ca 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -130,7 +143,24 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -136,7 +140,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { if ( ctx.channel().isActive() ) { - boolean logExceptions = !( handler instanceof PingHandler ); + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); -+ // FlameCord - log exceptions based on FlameCord configuration and FirewallException -+ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions() && !(cause instanceof FirewallException); -+ -+ // FlameCord - Firewall system -+ if (cause instanceof DecoderException || cause instanceof IllegalStateException || cause instanceof BadPacketException) { -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null) { -+ flameCord.getFirewallManager().addFirewalled(remoteAddress); -+ } -+ } -+ -+ // FlameCord - Handle firewall exceptions -+ if (cause instanceof FirewallException) { -+ flameCord.getFirewallManager().logBlocked(ctx.channel().remoteAddress()); -+ } ++ // FlameCord - Log exceptions based on FlameCord ++ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); if ( logExceptions ) { 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 a54da9c3..84302b32 100644 +index 4996a7b4..1680ce96 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,9 @@ +@@ -1,6 +1,8 @@ package net.md_5.bungee.netty; import com.google.common.base.Preconditions; + +import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -@@ -61,6 +64,11 @@ public class PipelineUtils - { - SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); - -+ // FlameCord - Firewall system -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); -+ } -+ - if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) - { - ch.close(); -@@ -107,7 +115,9 @@ public class PipelineUtils +@@ -107,7 +109,9 @@ public class PipelineUtils // FlameCord - Close on exception caught @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { @@ -1097,5 +853,5 @@ index a54da9c3..84302b32 100644 ctx.close(); } -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch new file mode 100644 index 00000000..7d68a4e0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -0,0 +1,337 @@ +From b18c16e3bb5a0e71261a854327ec7966b6af279e Mon Sep 17 00:00:00 2001 +From: linsaftw +Date: Fri, 30 Apr 2021 19:23:36 -0300 +Subject: [PATCH] Firewall System + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index 8957c79a..fd889644 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -6,6 +6,7 @@ import java.util.logging.Logger; + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; ++import dev._2lstudios.flamecord.firewall.FirewallManager; + import lombok.Getter; + import net.md_5.bungee.config.ConfigurationProvider; + import net.md_5.bungee.config.YamlConfiguration; +@@ -14,12 +15,15 @@ public class FlameCord { + @Getter + private static FlameCord instance; + @Getter ++ private final FirewallManager firewallManager; ++ @Getter + private final FlameCordConfiguration flameCordConfiguration; + @Getter + private final ModulesConfiguration modulesConfiguration; + @Getter + private final MessagesConfiguration messagesConfiguration; + @Getter ++ private final Thread thread; + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { +@@ -36,7 +40,29 @@ public class FlameCord { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); ++ this.firewallManager = new FirewallManager(logger, whitelistedAddresses, ++ flameCordConfiguration.getFirewallSeconds()); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); ++ this.thread = new Thread() { ++ @Override ++ public void run() { ++ while (running) { ++ try { ++ sleep(1000L); ++ ++ if (!running) { ++ return; ++ } ++ ++ firewallManager.tick(); ++ } catch (final Exception e) { ++ // Ignored ++ } ++ } ++ } ++ }; ++ ++ this.thread.start(); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java +new file mode 100644 +index 00000000..6a661898 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java +@@ -0,0 +1,30 @@ ++package dev._2lstudios.flamecord.firewall; ++ ++import java.net.SocketAddress; ++ ++public class FirewallException extends Exception { ++ private static final long serialVersionUID = 1L; ++ ++ public FirewallException(final SocketAddress address) { ++ super("The address " + address + " is blocked from the server!"); ++ } ++ ++ public FirewallException(final String string) { ++ super(string); ++ } ++ ++ public FirewallException(final String string, final Throwable throwable) { ++ super(string, throwable); ++ } ++ ++ @Override ++ public synchronized Throwable initCause(final Throwable cause) ++ { ++ return this; ++ } ++ ++ @Override ++ public synchronized Throwable fillInStackTrace() { ++ return this; ++ } ++} +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java +new file mode 100644 +index 00000000..8a474758 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java +@@ -0,0 +1,116 @@ ++package dev._2lstudios.flamecord.firewall; ++ ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.Collection; ++import java.util.HashSet; ++import java.util.logging.Logger; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import lombok.Getter; ++ ++public class FirewallManager { ++ private final Logger logger; ++ private final Collection whitelistedAddresses; ++ private final Collection firewalled; ++ private final int defaultSeconds; ++ @Getter ++ private int seconds; ++ ++ public FirewallManager(final Logger logger, final Collection whitelistedAddresses, ++ final int defaultSeconds) { ++ this.logger = logger; ++ this.whitelistedAddresses = whitelistedAddresses; ++ this.firewalled = new HashSet<>(); ++ this.defaultSeconds = defaultSeconds; ++ this.seconds = defaultSeconds; ++ } ++ ++ public boolean isWhitelisted(final SocketAddress address) { ++ final String addressString = address.toString(); ++ ++ for (final String whitelistedAddressString : whitelistedAddresses) { ++ if (addressString.endsWith(whitelistedAddressString)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public void addFirewalled(final SocketAddress address) { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ if (!this.firewalled.contains(hostString)) { ++ this.firewalled.add(hostString); ++ logAdded(address); ++ } ++ } ++ } ++ ++ public void logAdded(final SocketAddress address) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); ++ ++ if (flameCordConfiguration.isFirewallNotify()) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_added", hostString)); ++ } ++ } ++ ++ public void logBlocked(final SocketAddress address) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); ++ ++ if (flameCordConfiguration.isFirewallNotify()) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String hostString = iNetSocketAddress.getHostString(); ++ ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_blocked", hostString)); ++ } ++ } ++ ++ public Collection getFirewalled() { ++ return this.firewalled; ++ } ++ ++ public boolean isFirewalled(final SocketAddress address) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ ++ return this.firewalled.contains(iNetSocketAddress.getHostString()); ++ } ++ ++ public boolean isFirewalled(final String name) { ++ final String nameLowerCase = name.toLowerCase(); ++ ++ for (final String string : FlameCord.getInstance().getFlameCordConfiguration().getFirewallNames()) { ++ if (nameLowerCase.contains(string)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public void tick() { ++ if (--seconds <= 0) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final int size = this.firewalled.size(); ++ ++ if (size > 0) { ++ if (flameCord.getFlameCordConfiguration().isFirewallNotify()) { ++ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_cleared", size)); ++ } ++ ++ this.firewalled.clear(); ++ } ++ ++ this.seconds = defaultSeconds; ++ } ++ } ++} +\ No newline at end of file +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +index bf6f8538..fa0b59c2 100644 +--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -5,6 +5,7 @@ import java.util.HashSet; + + import dev._2lstudios.flamecord.FlameCord; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import dev._2lstudios.flamecord.firewall.FirewallManager; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; +@@ -30,6 +31,15 @@ private final BungeeCord bungeeCord; + final String arg0 = args[0]; + + switch (arg0) { ++ case "firewall": { ++ final FirewallManager firewallManager = flameCord.getFirewallManager(); ++ final int amount = firewallManager.getFirewalled().size(), ++ seconds = firewallManager.getSeconds(); ++ ++ sender.sendMessage(TextComponent.fromLegacyText( ++ messagesConfiguration.getTranslation("firewall_info", amount, seconds))); ++ break; ++ } + case "reload": { + // FlameCord - Collect ips from servers + final Collection whitelistedAddresses = new HashSet<>(); +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index d3a89e79..e56b4c68 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -3,6 +3,7 @@ package net.md_5.bungee.netty; + import com.google.common.base.Preconditions; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.firewall.FirewallException; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInboundHandlerAdapter; + import io.netty.handler.codec.CorruptedFrameException; +@@ -11,6 +12,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; + import io.netty.handler.timeout.ReadTimeoutException; + import java.io.IOException; + import java.net.InetSocketAddress; ++import java.net.SocketAddress; + import java.util.logging.Level; + import net.md_5.bungee.api.ProxyServer; + import net.md_5.bungee.connection.CancelSendSignal; +@@ -41,6 +43,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception + { ++ // FlameCord - Firewall system ++ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); ++ ++ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { ++ throw new FirewallException(remoteAddress); ++ } ++ + if ( handler != null ) + { + channel = new ChannelWrapper( ctx ); +@@ -143,7 +152,21 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); + // FlameCord - Log exceptions based on FlameCord +- boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); ++ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions() && !(cause instanceof FirewallException); ++ ++ // FlameCord - Firewall system ++ if (cause instanceof DecoderException || cause instanceof IllegalStateException || cause instanceof BadPacketException) { ++ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); ++ ++ if (remoteAddress != null) { ++ flameCord.getFirewallManager().addFirewalled(remoteAddress); ++ } ++ } ++ ++ // FlameCord - Handle firewall exceptions ++ if (cause instanceof FirewallException) { ++ flameCord.getFirewallManager().logBlocked(ctx.channel().remoteAddress()); ++ } + + if ( logExceptions ) + { +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 1680ce96..5ddc84a3 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 +@@ -3,6 +3,7 @@ package net.md_5.bungee.netty; + import com.google.common.base.Preconditions; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.firewall.FirewallException; + import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; +@@ -63,6 +64,11 @@ public class PipelineUtils + { + SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + ++ // FlameCord - Firewall system ++ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { ++ throw new FirewallException(remoteAddress); ++ } ++ + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) + { + ch.close(); +-- +2.31.1 + From 784e14bd22880ea9e8570c5c3dc5ae8bef418c15 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 30 Apr 2021 19:32:57 -0300 Subject: [PATCH 056/499] Fix author email/name --- Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch | 2 +- Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 2d6e4d60..1cf8c199 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,5 +1,5 @@ From 274f6347ded5b72104c30c9663912270b1c1b116 Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata +From: linsaftw Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch index f0856e09..fee5671b 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -1,5 +1,5 @@ From 70c35798c174ad82481c381369bb613f26e200e7 Mon Sep 17 00:00:00 2001 -From: LinsaFTW +From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks From a93d1293a465a89fe73a5f8e4f9f129d95643df2 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 19:41:58 -0300 Subject: [PATCH 057/499] Split more firewall system --- .../0023-FlameCord-General-Patch.patch | 33 +++--------- .../0026-Firewall-System.patch | 54 ++++++++++++++++++- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 1cf8c199..17271244 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,5 +1,5 @@ -From 274f6347ded5b72104c30c9663912270b1c1b116 Mon Sep 17 00:00:00 2001 -From: linsaftw +From 167e8a9506af076d4af164489583c3a7957d16af Mon Sep 17 00:00:00 2001 +From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -55,10 +55,10 @@ index 00000000..8957c79a \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 00000000..b7268e1d +index 00000000..650cb302 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,81 @@ +@@ -0,0 +1,72 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -74,12 +74,7 @@ index 00000000..b7268e1d + +public class FlameCordConfiguration { + @Getter -+ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, -+ firewallEnabled = true; -+ @Getter -+ private int firewallSeconds = 60; -+ @Getter -+ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); ++ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false; + + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { @@ -98,10 +93,6 @@ index 00000000..b7268e1d + configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); -+ this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); -+ this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); -+ this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); + + if (!configurationExists) { + configurationProvider.save(configuration, configurationFile); @@ -142,10 +133,10 @@ index 00000000..b7268e1d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..c88077ad +index 00000000..ebfaa761 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,129 @@ +@@ -0,0 +1,121 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -230,17 +221,9 @@ index 00000000..c88077ad + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + + // FlameCord -+ setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); -+ setIfUnexistant("firewall_blocked", "&e{0}&c is firewalled from the proxy, request blocked!", -+ configuration); -+ setIfUnexistant("firewall_info", -+ "&aThere are&b {0} &aaddresses firewalled!\n&aThe firewall will clear in &b{1} &aseconds!", -+ configuration); -+ setIfUnexistant("firewall_cleared", "&b{0}&a addresses had been automatically removed from the firewall!", -+ configuration); + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall&7 >&b Shows information about the Firewall!\n&e /flamecord help&7 >&b Shows this message!", ++ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 7d68a4e0..7bd62f85 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From b18c16e3bb5a0e71261a854327ec7966b6af279e Mon Sep 17 00:00:00 2001 +From 59870243f92af6df6734c1860ee0038b2205b1ec Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 30 Apr 2021 19:23:36 -0300 Subject: [PATCH] Firewall System @@ -63,6 +63,58 @@ index 8957c79a..fd889644 100644 } } \ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 650cb302..b7268e1d 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -13,7 +13,12 @@ import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { + @Getter +- private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false; ++ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, ++ firewallEnabled = true; ++ @Getter ++ private int firewallSeconds = 60; ++ @Getter ++ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); + + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { +@@ -32,6 +37,10 @@ public class FlameCordConfiguration { + configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); ++ this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); ++ this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); ++ this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); + + if (!configurationExists) { + configurationProvider.save(configuration, configurationFile); +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index ebfaa761..c88077ad 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -82,9 +82,17 @@ public class MessagesConfiguration { + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + + // FlameCord ++ setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); ++ setIfUnexistant("firewall_blocked", "&e{0}&c is firewalled from the proxy, request blocked!", ++ configuration); ++ setIfUnexistant("firewall_info", ++ "&aThere are&b {0} &aaddresses firewalled!\n&aThe firewall will clear in &b{1} &aseconds!", ++ configuration); ++ setIfUnexistant("firewall_cleared", "&b{0}&a addresses had been automatically removed from the firewall!", ++ configuration); + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", +- "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", ++ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall&7 >&b Shows information about the Firewall!\n&e /flamecord help&7 >&b Shows this message!", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java new file mode 100644 index 00000000..6a661898 From cb818c0ceb9b527d5de7d12c9b35c070d3c5dadd Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 19:58:48 -0300 Subject: [PATCH 058/499] Check firewall only once --- .../0026-Firewall-System.patch | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 7bd62f85..93f5a006 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From 59870243f92af6df6734c1860ee0038b2205b1ec Mon Sep 17 00:00:00 2001 +From e6ce50df78087e26000d0d99f2f5a51b7334b93c Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 30 Apr 2021 19:23:36 -0300 Subject: [PATCH] Firewall System @@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index d3a89e79..e56b4c68 100644 +index d3a89e79..60c9ddcd 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -323,21 +323,7 @@ index d3a89e79..e56b4c68 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -41,6 +43,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception - { -+ // FlameCord - Firewall system -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); -+ } -+ - if ( handler != null ) - { - channel = new ChannelWrapper( ctx ); -@@ -143,7 +152,21 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -143,7 +145,21 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter // FlameCord - Use flamecord final FlameCord flameCord = FlameCord.getInstance(); // FlameCord - Log exceptions based on FlameCord From fd686d3b350defa7b287a6b2b2a92bb930620b59 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:46:05 -0300 Subject: [PATCH 059/499] Remove logger dump option --- .../0023-FlameCord-General-Patch.patch | 50 ++++++------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 17271244..fd5c12da 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 167e8a9506af076d4af164489583c3a7957d16af Mon Sep 17 00:00:00 2001 +From 1d3bfc78ceef4d1ab011e0ec2923a3133f22133c Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -360,7 +360,7 @@ index 00000000..e82c4844 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b..5b6f1fd5 100644 +index bb39d31b..3318b1de 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -370,19 +370,14 @@ index bb39d31b..5b6f1fd5 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -102,7 +103,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -102,7 +103,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } - throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall + -+ // FlameCord - Toggle Dumping packet info + // FlameCord - Change from FastDecoderException to DecoderException -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall -+ } else { -+ throw new FastDecoderException( "Error decoding packet " + packetTypeStr, e ); -+ } ++ throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall } finally { if ( slice != null ) @@ -606,7 +601,7 @@ index 5d385706..83d3e9ed 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7b99c466..af242603 100644 +index 7b99c466..2c94ef55 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -626,18 +621,13 @@ index 7b99c466..af242603 100644 import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.MinecraftDecoder; import net.md_5.bungee.protocol.PacketWrapper; -@@ -163,7 +166,13 @@ public class ServerConnector extends PacketHandler +@@ -163,7 +166,8 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Toggle Dumping packet info + // FlameCord - Change from QuietException to BadPacketException -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new BadPacketException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); -+ } else { -+ throw new BadPacketException( "Unexpected packet received during server connector process!" ); -+ } ++ throw new BadPacketException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); } } @@ -676,7 +666,7 @@ index 159119c1..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 e7542b1c..47a9c74d 100644 +index e7542b1c..64861313 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 @@ -16,6 +16,8 @@ import java.util.logging.Level; @@ -696,22 +686,17 @@ index e7542b1c..47a9c74d 100644 import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.PacketWrapper; import net.md_5.bungee.protocol.Protocol; -@@ -152,7 +155,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -152,7 +155,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Toggle Dumping packet info + // FlameCord - Change from QuietException to BadPacketException -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new BadPacketException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); -+ } else { -+ throw new BadPacketException( "Unexpected packet received during server login process!" ); -+ } ++ throw new BadPacketException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } -@@ -365,7 +374,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -365,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -721,7 +706,7 @@ index e7542b1c..47a9c74d 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -374,7 +384,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -374,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -732,7 +717,7 @@ index e7542b1c..47a9c74d 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071..09909bd9 100644 +index 6cd71071..24195ed1 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,8 @@ @@ -752,18 +737,13 @@ index 6cd71071..09909bd9 100644 import net.md_5.bungee.protocol.MinecraftDecoder; import net.md_5.bungee.protocol.MinecraftEncoder; import net.md_5.bungee.protocol.PacketWrapper; -@@ -58,7 +61,13 @@ public class PingHandler extends PacketHandler +@@ -58,7 +61,8 @@ public class PingHandler extends PacketHandler { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Toggle dumping packet info + // FlameCord - Change from QuietException to BadPacketException -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerDump()) { -+ throw new BadPacketException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); -+ } else { -+ throw new BadPacketException( "Unexpected packet received during ping process!" ); -+ } ++ throw new BadPacketException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); } } From 135369e4b4a3eb06e61d23ae0e14a6ca54f61567 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:59:29 -0300 Subject: [PATCH 060/499] Update logger order --- .../0023-FlameCord-General-Patch.patch | 22 ++++++++++-------- .../0026-Firewall-System.patch | 23 ++++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index fd5c12da..491b5311 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 1d3bfc78ceef4d1ab011e0ec2923a3133f22133c Mon Sep 17 00:00:00 2001 +From b13fd1a5fea303546f2c3ae160889d8cf7c88667 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -748,7 +748,7 @@ index 6cd71071..24195ed1 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index b8e50855..d3a89e79 100644 +index b8e50855..e4208b59 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -780,20 +780,21 @@ index b8e50855..d3a89e79 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -136,7 +140,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - if ( ctx.channel().isActive() ) +@@ -138,6 +142,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { -- boolean logExceptions = !( handler instanceof PingHandler ); + boolean logExceptions = !( handler instanceof PingHandler ); + + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); ++ + // FlameCord - Log exceptions based on FlameCord -+ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); - ++ logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); ++ if ( logExceptions ) { + if ( cause instanceof ReadTimeoutException ) 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 4996a7b4..1680ce96 100644 +index 4996a7b4..d9d00fa5 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,8 @@ @@ -809,8 +810,9 @@ index 4996a7b4..1680ce96 100644 // FlameCord - Close on exception caught @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { +- cause.printStackTrace(); + if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { - cause.printStackTrace(); ++ cause.printStackTrace(); + } ctx.close(); diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 93f5a006..3ed2c2ee 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,6 +1,6 @@ -From e6ce50df78087e26000d0d99f2f5a51b7334b93c Mon Sep 17 00:00:00 2001 -From: linsaftw -Date: Fri, 30 Apr 2021 19:23:36 -0300 +From 9e823cf6478f0b35c293a90ca846f00ba51142da Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index d3a89e79..60c9ddcd 100644 +index e4208b59..3b5bb7db 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -323,12 +323,12 @@ index d3a89e79..60c9ddcd 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -143,7 +145,21 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - // FlameCord - Use flamecord - final FlameCord flameCord = FlameCord.getInstance(); +@@ -148,6 +150,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter // FlameCord - Log exceptions based on FlameCord -- boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); -+ boolean logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions() && !(cause instanceof FirewallException); + logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); + ++ // FlameCord - Don't log firewall exceptions ++ logExceptions = cause instanceof FirewallException ? false : logExceptions; + + // FlameCord - Firewall system + if (cause instanceof DecoderException || cause instanceof IllegalStateException || cause instanceof BadPacketException) { @@ -343,11 +343,12 @@ index d3a89e79..60c9ddcd 100644 + if (cause instanceof FirewallException) { + flameCord.getFirewallManager().logBlocked(ctx.channel().remoteAddress()); + } - ++ if ( logExceptions ) { + if ( cause instanceof ReadTimeoutException ) 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 1680ce96..5ddc84a3 100644 +index d9d00fa5..fa6ab3e9 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 @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; From 09e30b5744e5332cd4f22f0e73e5b12247d547d4 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:47:36 -0300 Subject: [PATCH 061/499] Partly splitted logger options --- .../0023-FlameCord-General-Patch.patch | 64 +-------- .../0026-Firewall-System.patch | 12 +- .../0027-FlameCord-logger-options.patch | 122 ++++++++++++++++++ 3 files changed, 133 insertions(+), 65 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 491b5311..168fe2b8 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From b13fd1a5fea303546f2c3ae160889d8cf7c88667 Mon Sep 17 00:00:00 2001 +From a60eb8a4096cfa24f46b4747774218fdb36751f0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -666,7 +666,7 @@ index 159119c1..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 e7542b1c..64861313 100644 +index e7542b1c..18bab507 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 @@ -16,6 +16,8 @@ import java.util.logging.Level; @@ -696,26 +696,6 @@ index e7542b1c..64861313 100644 } } -@@ -365,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - case 1: - // Ping -- if ( bungee.getConfig().isLogPings() ) -+ // FlameCord - Toggle for initialhandler logger -+ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); - } -@@ -374,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - break; - case 2: - // Login -- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall -+ // FlameCord - Toggle for initialhandler logger -+ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall - { - bungee.getLogger().log( Level.INFO, "{0} has connected", this ); - } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java index 6cd71071..24195ed1 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -748,7 +728,7 @@ index 6cd71071..24195ed1 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index b8e50855..e4208b59 100644 +index b8e50855..f0b25b53 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -760,41 +740,18 @@ index b8e50855..e4208b59 100644 import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; -@@ -44,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel = new ChannelWrapper( ctx ); - handler.connected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Added isLoggerInitialhandler boolean -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); - } -@@ -60,7 +63,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel.close(); - handler.disconnected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Added isLoggerInitialhandler boolean -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); - } -@@ -138,6 +142,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -138,6 +140,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); -+ -+ // FlameCord - Log exceptions based on FlameCord -+ logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); + if ( logExceptions ) { if ( cause instanceof ReadTimeoutException ) 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 4996a7b4..d9d00fa5 100644 +index 4996a7b4..1d86aa63 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,8 @@ @@ -806,17 +763,6 @@ index 4996a7b4..d9d00fa5 100644 import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -@@ -107,7 +109,9 @@ public class PipelineUtils - // FlameCord - Close on exception caught - @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -- cause.printStackTrace(); -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { -+ cause.printStackTrace(); -+ } - - ctx.close(); - } -- 2.31.1 diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 3ed2c2ee..6fb649f3 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From 9e823cf6478f0b35c293a90ca846f00ba51142da Mon Sep 17 00:00:00 2001 +From 905138c1dee4cee34aec8e308afd4e596bd211d7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index e4208b59..3b5bb7db 100644 +index f0b25b53..3deb8b9a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -323,9 +323,9 @@ index e4208b59..3b5bb7db 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -148,6 +150,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - // FlameCord - Log exceptions based on FlameCord - logExceptions = flameCord.getFlameCordConfiguration().isLoggerExceptions(); +@@ -143,6 +145,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; @@ -348,7 +348,7 @@ index e4208b59..3b5bb7db 100644 { if ( cause instanceof ReadTimeoutException ) 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 d9d00fa5..fa6ab3e9 100644 +index 1d86aa63..81987ca3 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 @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch new file mode 100644 index 00000000..55fafa01 --- /dev/null +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -0,0 +1,122 @@ +From e874ac159c2697f62a3f00f878ed9140da9ae3a5 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 30 Apr 2021 23:42:15 -0300 +Subject: [PATCH] FlameCord logger options + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index b7268e1d..ea641bcf 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -16,6 +16,8 @@ public class FlameCordConfiguration { + private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, + firewallEnabled = true; + @Getter ++ private boolean loggerHaProxy = false; ++ @Getter + private int firewallSeconds = 60; + @Getter + private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); +@@ -37,6 +39,7 @@ public class FlameCordConfiguration { + configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); + this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); + this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); +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 18bab507..86869e5b 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 +@@ -369,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + case 1: + // Ping +- if ( bungee.getConfig().isLogPings() ) ++ // FlameCord - Option to log initialhandler ++ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); + } +@@ -378,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + break; + case 2: + // Login +- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall ++ // FlameCord - Option to log initialhandler ++ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 3deb8b9a..29d9f5fa 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel = new ChannelWrapper( ctx ); + handler.connected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + } +@@ -64,7 +65,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.close(); + handler.disconnected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); + } +@@ -95,10 +97,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); + +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] +- { +- channel.getRemoteAddress(), newAddress +- } ); ++ // FlameCord - Option to log haproxy ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) { ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); ++ } + + channel.setRemoteAddress( newAddress ); + } finally +@@ -142,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); + ++ // FlameCord - Option to log exceptions ++ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; ++ + // FlameCord - Use flamecord + final FlameCord flameCord = FlameCord.getInstance(); + +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 81987ca3..8808a989 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 +@@ -115,7 +115,10 @@ public class PipelineUtils + // FlameCord - Close on exception caught + @Override + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { +- cause.printStackTrace(); ++ // FlameCord - Option to log exceptions ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { ++ cause.printStackTrace(); ++ } + + ctx.close(); + } +-- +2.31.1 + From 9009c39b3c4d86ef4ee1b1a6a47fc36e12ee7a16 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:48:48 -0300 Subject: [PATCH 062/499] Rebuild patches --- .../0006-FlameCord-POM-Changes.patch | 14 +++++++------- ...07-Disable-update-checker-Use-bungee-name.patch | 8 ++++---- .../0008-Change-replaceAll-to-replace.patch | 8 ++++---- .../0009-Remove-Quitting-reason.patch | 10 +++++----- ...-connections-Don-t-flush-if-not-necessary.patch | 10 +++++----- .../0024-Fix-ByteBuf-memory-leaks.patch | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch index 8bb6d691..26d56804 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 01363a40e321d368c0b686792a491cf892c1bf47 Mon Sep 17 00:00:00 2001 +From e7fc466ed3d7145d113719892953cbcabd6c4b6a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..dd511dac +index 00000000..ca88559e --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -55,7 +55,7 @@ index 00000000..dd511dac + + diff --git a/pom.xml b/pom.xml -index 1b773cc5..099e78d1 100644 +index b3ee7b0c..3efafa0a 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,9 @@ @@ -69,7 +69,7 @@ index 1b773cc5..099e78d1 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index ba3ffe3d..9228f72a 100644 +index 993cbca9..3867501a 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -64,5 +64,14 @@ @@ -88,10 +88,10 @@ index ba3ffe3d..9228f72a 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 4bda0d62..0018d6f8 100644 +index d67d1a5d..3fb14feb 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -113,6 +113,51 @@ +@@ -143,6 +143,51 @@ runtime @@ -144,5 +144,5 @@ index 4bda0d62..0018d6f8 100644 -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index ffbdc513..bf97eaa6 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -1,14 +1,14 @@ -From a931b0886161c8af9c8478dce3786c5de61b987e Mon Sep 17 00:00:00 2001 +From a8a33b052d445c78560370674f7b287e77396721 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index ad9a6d0c..ad8f8733 100644 +index 6a5193fe..e82073d4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -40,25 +40,12 @@ public class BungeeCordLauncher +@@ -53,25 +53,12 @@ public class BungeeCordLauncher return; } @@ -70,5 +70,5 @@ index d4fad294..7994c1c1 100644 int maxPlayers = get( "max_players", 1, val ); -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch index c47df910..e2b1c1fa 100644 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -1,14 +1,14 @@ -From dca58a6a7ae25120b8aeccbe4f3ecf2c7fbef6a0 Mon Sep 17 00:00:00 2001 +From e67e9ed998a04f1aacd313d5ca3a9dd3755a942a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index c12085e1..44f257ae 100644 +index a4c25575..00749538 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -125,7 +125,8 @@ public class ServerConnector extends PacketHandler +@@ -127,7 +127,8 @@ public class ServerConnector extends PacketHandler newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. @@ -19,5 +19,5 @@ index c12085e1..44f257ae 100644 // All done. properties = newp; -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch index 4b00e813..1434e57f 100644 --- a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch +++ b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch @@ -1,14 +1,14 @@ -From 80ace46853567b268136b98cab869eb2dd495846 Mon Sep 17 00:00:00 2001 +From 311cd787abe702b9ed4179effa2aa9fd1bc9c53f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:03:12 +0800 Subject: [PATCH] Remove "Quitting" reason diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 44f257ae..e90237ac 100644 +index 00749538..7b99c466 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -267,7 +267,8 @@ public class ServerConnector extends PacketHandler +@@ -269,7 +269,8 @@ public class ServerConnector extends PacketHandler user.getSentBossBars().clear(); user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); @@ -18,7 +18,7 @@ index 44f257ae..e90237ac 100644 } else { // Travertine start -@@ -362,13 +363,15 @@ public class ServerConnector extends PacketHandler +@@ -364,13 +365,15 @@ public class ServerConnector extends PacketHandler user.setDimension( login.getDimension() ); // Remove from old servers @@ -63,5 +63,5 @@ index ad3bdee5..c05714ba 100644 } } -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index f1738d6f..8ea1dec5 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 9c750441ab21769e9fc5ee37e7642a5de7f2dcd3 Mon Sep 17 00:00:00 2001 +From cdf91cda29d5b69410c130012de20dba5d7da506 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -118,7 +118,7 @@ index 6dc5633f..5c05f2b9 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 989bfd87..1351d5d5 100644 +index 270545f2..b0825e51 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -56,7 +56,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -131,7 +131,7 @@ index 989bfd87..1351d5d5 100644 handler.disconnected( channel ); if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -@@ -180,8 +181,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -186,8 +187,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); } } @@ -144,7 +144,7 @@ index 989bfd87..1351d5d5 100644 } } 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 9a39f69e..a54da9c3 100644 +index 96704d5e..4996a7b4 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -184,5 +184,5 @@ index 0c1ecfb8..b3bdfd05 100644 } -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch index fee5671b..fecfb739 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 70c35798c174ad82481c381369bb613f26e200e7 Mon Sep 17 00:00:00 2001 +From 3a3b9229d496e28f0194ccffdf5bb3b0cf4079ea Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3cfef373..5b32cec7 100644 +index 2c94ef55..3646cb95 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -289,9 +289,15 @@ public class ServerConnector extends PacketHandler +@@ -286,9 +286,15 @@ public class ServerConnector extends PacketHandler } else { ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); @@ -167,6 +167,6 @@ index cefa0206..2cd5740c 100644 } return modTags; } --- -2.31.0.windows.1 +-- +2.31.1 From f2671f0f5d64a9b8e158983eed94da0bc96e83d7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:55:15 -0300 Subject: [PATCH 063/499] Cleanup Firewall patch --- .../0026-Firewall-System.patch | 19 ++++++++++--------- .../0027-FlameCord-logger-options.patch | 10 +++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 6fb649f3..9d39a899 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From 905138c1dee4cee34aec8e308afd4e596bd211d7 Mon Sep 17 00:00:00 2001 +From ca9f27058c584094c899099636c5459df82b7290 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index f0b25b53..3deb8b9a 100644 +index f0b25b53..5de0414e 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -323,10 +323,12 @@ index f0b25b53..3deb8b9a 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -143,6 +145,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - // FlameCord - Use flamecord - final FlameCord flameCord = FlameCord.getInstance(); +@@ -140,8 +142,22 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); +- // FlameCord - Use flamecord +- final FlameCord flameCord = FlameCord.getInstance(); + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; + @@ -335,18 +337,17 @@ index f0b25b53..3deb8b9a 100644 + final SocketAddress remoteAddress = ctx.channel().remoteAddress(); + + if (remoteAddress != null) { -+ flameCord.getFirewallManager().addFirewalled(remoteAddress); ++ FlameCord.getInstance().getFirewallManager().addFirewalled(remoteAddress); + } + } + + // FlameCord - Handle firewall exceptions + if (cause instanceof FirewallException) { -+ flameCord.getFirewallManager().logBlocked(ctx.channel().remoteAddress()); ++ FlameCord.getInstance().getFirewallManager().logBlocked(ctx.channel().remoteAddress()); + } -+ + if ( logExceptions ) { - if ( cause instanceof ReadTimeoutException ) 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 1d86aa63..81987ca3 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch index 55fafa01..0967fec3 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -1,6 +1,6 @@ -From e874ac159c2697f62a3f00f878ed9140da9ae3a5 Mon Sep 17 00:00:00 2001 +From 83d77a25bc63fe25486d0171e7fae3ddc1aa1ab2 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 30 Apr 2021 23:42:15 -0300 +Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -50,7 +50,7 @@ index 18bab507..86869e5b 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 3deb8b9a..29d9f5fa 100644 +index 5de0414e..9f70323e 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -98,8 +98,8 @@ index 3deb8b9a..29d9f5fa 100644 + // FlameCord - Option to log exceptions + logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; + - // FlameCord - Use flamecord - final FlameCord flameCord = FlameCord.getInstance(); + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; 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 81987ca3..8808a989 100644 From ebe244c9ec8776f7342972cce32600b7b11322f8 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 00:28:00 -0300 Subject: [PATCH 064/499] Cleanup patches --- .../0023-FlameCord-General-Patch.patch | 38 +++++++------------ .../0026-Firewall-System.patch | 25 ++++++------ 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 168fe2b8..cf3d0719 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From a60eb8a4096cfa24f46b4747774218fdb36751f0 Mon Sep 17 00:00:00 2001 +From 805001ea20a26c3bcff5c81828685cf77b010758 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..8957c79a +index 000000000..8957c79ac --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,42 @@ @@ -55,7 +55,7 @@ index 00000000..8957c79a \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 00000000..650cb302 +index 000000000..650cb3028 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,72 @@ @@ -133,7 +133,7 @@ index 00000000..650cb302 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..ebfaa761 +index 000000000..ebfaa761c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -0,0 +1,121 @@ @@ -261,7 +261,7 @@ index 00000000..ebfaa761 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 00000000..e82c4844 +index 000000000..e82c4844b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,94 @@ @@ -360,7 +360,7 @@ index 00000000..e82c4844 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b..3318b1de 100644 +index bb39d31b8..3318b1de3 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -383,7 +383,7 @@ index bb39d31b..3318b1de 100644 if ( slice != null ) diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 00000000..bf6f8538 +index 000000000..bf6f85386 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,61 @@ @@ -449,7 +449,7 @@ index 00000000..bf6f8538 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 5d385706..83d3e9ed 100644 +index 5d3857060..83d3e9edd 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -601,7 +601,7 @@ index 5d385706..83d3e9ed 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7b99c466..2c94ef55 100644 +index 7b99c466d..2c94ef554 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -632,7 +632,7 @@ index 7b99c466..2c94ef55 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 159119c1..7c4c8f8a 100644 +index 159119c13..7c4c8f8a0 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -666,7 +666,7 @@ index 159119c1..7c4c8f8a 100644 b.connect().addListener( listener ); } 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 e7542b1c..18bab507 100644 +index e7542b1c1..18bab507a 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 @@ -16,6 +16,8 @@ import java.util.logging.Level; @@ -697,7 +697,7 @@ index e7542b1c..18bab507 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071..24195ed1 100644 +index 6cd71071e..24195ed1b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,8 @@ @@ -728,7 +728,7 @@ index 6cd71071..24195ed1 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index b8e50855..f0b25b53 100644 +index b8e508552..7f18b5646 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -740,18 +740,8 @@ index b8e50855..f0b25b53 100644 import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; -@@ -138,6 +140,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - boolean logExceptions = !( handler instanceof PingHandler ); - -+ // FlameCord - Use flamecord -+ final FlameCord flameCord = FlameCord.getInstance(); -+ - if ( logExceptions ) - { - if ( cause instanceof ReadTimeoutException ) 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 4996a7b4..1d86aa63 100644 +index 4996a7b44..1d86aa63c 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,8 @@ diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 9d39a899..15ffd71e 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,11 +1,11 @@ -From ca9f27058c584094c899099636c5459df82b7290 Mon Sep 17 00:00:00 2001 +From a9337cf77d233e0f7429c899ffd374c9d8b73641 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79a..fd889644 100644 +index 8957c79ac..fd889644f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -6,6 +6,7 @@ import java.util.logging.Logger; @@ -64,7 +64,7 @@ index 8957c79a..fd889644 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 650cb302..b7268e1d 100644 +index 650cb3028..b7268e1d3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -13,7 +13,12 @@ import net.md_5.bungee.config.ConfigurationProvider; @@ -93,7 +93,7 @@ index 650cb302..b7268e1d 100644 if (!configurationExists) { configurationProvider.save(configuration, configurationFile); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ebfaa761..c88077ad 100644 +index ebfaa761c..c88077ade 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -82,9 +82,17 @@ public class MessagesConfiguration { @@ -117,7 +117,7 @@ index ebfaa761..c88077ad 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java new file mode 100644 -index 00000000..6a661898 +index 000000000..6a661898d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java @@ -0,0 +1,30 @@ @@ -154,7 +154,7 @@ index 00000000..6a661898 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java new file mode 100644 -index 00000000..8a474758 +index 000000000..8a4747588 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java @@ -0,0 +1,116 @@ @@ -276,7 +276,7 @@ index 00000000..8a474758 +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index bf6f8538..fa0b59c2 100644 +index bf6f85386..fa0b59c27 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -5,6 +5,7 @@ import java.util.HashSet; @@ -304,7 +304,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index f0b25b53..5de0414e 100644 +index 7f18b5646..5de0414ec 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -323,12 +323,10 @@ index f0b25b53..5de0414e 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -140,8 +142,22 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -140,6 +142,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); -- // FlameCord - Use flamecord -- final FlameCord flameCord = FlameCord.getInstance(); + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; + @@ -345,11 +343,12 @@ index f0b25b53..5de0414e 100644 + if (cause instanceof FirewallException) { + FlameCord.getInstance().getFirewallManager().logBlocked(ctx.channel().remoteAddress()); + } - ++ if ( logExceptions ) { + if ( cause instanceof ReadTimeoutException ) 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 1d86aa63..81987ca3 100644 +index 1d86aa63c..81987ca39 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 @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; From 1f25a5d27379744bc02824d86b54890ca0b4543a Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 10:24:17 -0300 Subject: [PATCH 065/499] Finish splitting logger patch --- .../0023-FlameCord-General-Patch.patch | 14 ++---- .../0026-Firewall-System.patch | 29 ++++++------ .../0027-FlameCord-logger-options.patch | 44 ++++++++++++------- 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index cf3d0719..236af2e4 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 805001ea20a26c3bcff5c81828685cf77b010758 Mon Sep 17 00:00:00 2001 +From b59b64610c3cafc27f28602efd104477760cde45 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -55,10 +55,10 @@ index 000000000..8957c79ac \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..650cb3028 +index 000000000..81ded2243 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,72 @@ +@@ -0,0 +1,64 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -73,9 +73,6 @@ index 000000000..650cb3028 +import net.md_5.bungee.config.ConfigurationProvider; + +public class FlameCordConfiguration { -+ @Getter -+ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false; -+ + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { + final String fileName = "./flamecord.yml"; @@ -89,11 +86,6 @@ index 000000000..650cb3028 + configuration = configurationProvider.load(configurationFile); + } + -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, -+ configuration); -+ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -+ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ + if (!configurationExists) { + configurationProvider.save(configuration, configurationFile); + } diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 15ffd71e..fe3264eb 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From a9337cf77d233e0f7429c899ffd374c9d8b73641 Mon Sep 17 00:00:00 2001 +From fd88f8b5de095c410ee19136015eb2624e416ec4 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -64,34 +64,37 @@ index 8957c79ac..fd889644f 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 650cb3028..b7268e1d3 100644 +index 81ded2243..8bb61ac11 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -13,7 +13,12 @@ import net.md_5.bungee.config.ConfigurationProvider; +@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration { - @Getter -- private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false; -+ private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, -+ firewallEnabled = true; ++ @Getter ++ private boolean firewallNotify = true; ++ @Getter ++ private boolean firewallEnabled = true; + @Getter + private int firewallSeconds = 60; + @Getter + private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); - ++ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { try { -@@ -32,6 +37,10 @@ public class FlameCordConfiguration { - configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); - this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); + final String fileName = "./flamecord.yml"; +@@ -25,6 +34,11 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + + this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); + this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); + this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); + this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); - ++ if (!configurationExists) { configurationProvider.save(configuration, configurationFile); + } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java index ebfaa761c..c88077ade 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch index 0967fec3..0d641738 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -1,32 +1,44 @@ -From 83d77a25bc63fe25486d0171e7fae3ddc1aa1ab2 Mon Sep 17 00:00:00 2001 +From 4e2cb9724d144d7d0257716b50984d7fd164535d Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b7268e1d..ea641bcf 100644 +index 8bb61ac11..8822c6d33 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,8 @@ public class FlameCordConfiguration { - private boolean loggerInitialhandler = false, loggerExceptions = false, loggerDump = false, firewallNotify = true, - firewallEnabled = true; - @Getter -+ private boolean loggerHaProxy = false; +@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ @Getter ++ private boolean loggerInitialhandler = false; ++ @Getter ++ private boolean loggerExceptions = false; ++ @Getter ++ private boolean loggerDump = false; + @Getter - private int firewallSeconds = 60; ++ private boolean loggerHaProxy = false; ++ + @Getter + private boolean firewallNotify = true; @Getter - private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); -@@ -37,6 +39,7 @@ public class FlameCordConfiguration { - configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); - this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); +@@ -34,6 +43,12 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, ++ configuration); ++ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 18bab507..86869e5b 100644 +index 18bab507a..86869e5b4 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 @@ -369,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -50,7 +62,7 @@ index 18bab507..86869e5b 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 5de0414e..9f70323e 100644 +index 5de0414ec..9f70323ee 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -102,7 +114,7 @@ index 5de0414e..9f70323e 100644 logExceptions = cause instanceof FirewallException ? false : logExceptions; 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 81987ca3..8808a989 100644 +index 81987ca39..8808a989c 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 @@ -115,7 +115,10 @@ public class PipelineUtils From 9697ae9cf3fa6eae0369542493f3c69cefcd749a Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 10:24:43 -0300 Subject: [PATCH 066/499] Renamed patch 0027 --- .../0027-FlameCord-replace-logger.patch | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch b/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch new file mode 100644 index 00000000..0d641738 --- /dev/null +++ b/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch @@ -0,0 +1,134 @@ +From 4e2cb9724d144d7d0257716b50984d7fd164535d Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 30 Apr 2021 23:51:51 -0300 +Subject: [PATCH] FlameCord logger options + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 8bb61ac11..8822c6d33 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ @Getter ++ private boolean loggerInitialhandler = false; ++ @Getter ++ private boolean loggerExceptions = false; ++ @Getter ++ private boolean loggerDump = false; ++ @Getter ++ private boolean loggerHaProxy = false; ++ + @Getter + private boolean firewallNotify = true; + @Getter +@@ -34,6 +43,12 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, ++ configuration); ++ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ + this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); + this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); + this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); +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 18bab507a..86869e5b4 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 +@@ -369,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + case 1: + // Ping +- if ( bungee.getConfig().isLogPings() ) ++ // FlameCord - Option to log initialhandler ++ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); + } +@@ -378,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + break; + case 2: + // Login +- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall ++ // FlameCord - Option to log initialhandler ++ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 5de0414ec..9f70323ee 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel = new ChannelWrapper( ctx ); + handler.connected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + } +@@ -64,7 +65,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.close(); + handler.disconnected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); + } +@@ -95,10 +97,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); + +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] +- { +- channel.getRemoteAddress(), newAddress +- } ); ++ // FlameCord - Option to log haproxy ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) { ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); ++ } + + channel.setRemoteAddress( newAddress ); + } finally +@@ -142,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); + ++ // FlameCord - Option to log exceptions ++ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; ++ + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; + +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 81987ca39..8808a989c 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 +@@ -115,7 +115,10 @@ public class PipelineUtils + // FlameCord - Close on exception caught + @Override + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { +- cause.printStackTrace(); ++ // FlameCord - Option to log exceptions ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { ++ cause.printStackTrace(); ++ } + + ctx.close(); + } +-- +2.31.1 + From 26e652081698291f372d3a6611f1d3d8aa3991c9 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Sat, 1 May 2021 10:27:47 -0300 Subject: [PATCH 067/499] Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..5b3b2b0b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: ['https://paypal.me/LinsaFTW'] From 5f2d4e8b6da3d2b90e58243f8d492d18a5f4529f Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 10:58:52 -0300 Subject: [PATCH 068/499] Revert exception changes --- .../0023-FlameCord-General-Patch.patch | 49 ++----- .../0024-Fix-ByteBuf-memory-leaks.patch | 14 +- .../0027-FlameCord-logger-options.patch | 8 +- .../0027-FlameCord-replace-logger.patch | 134 ------------------ 4 files changed, 21 insertions(+), 184 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 236af2e4..63c1d796 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From b59b64610c3cafc27f28602efd104477760cde45 Mon Sep 17 00:00:00 2001 +From 38e24dcc8b058115653bc7bf79cd81a75a058b92 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -593,7 +593,7 @@ index 5d3857060..83d3e9edd 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7b99c466d..2c94ef554 100644 +index 7b99c466d..522bd93da 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -605,21 +605,12 @@ index 7b99c466d..2c94ef554 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -34,6 +36,7 @@ import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.HandlerBoss; - import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.PacketWrapper; -@@ -163,7 +166,8 @@ public class ServerConnector extends PacketHandler +@@ -163,7 +165,7 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); ++ throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); } } @@ -658,7 +649,7 @@ index 159119c13..7c4c8f8a0 100644 b.connect().addListener( listener ); } 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 e7542b1c1..18bab507a 100644 +index e7542b1c1..deee607dc 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 @@ -16,6 +16,8 @@ import java.util.logging.Level; @@ -670,38 +661,28 @@ index e7542b1c1..18bab507a 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -49,6 +51,7 @@ import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; - import net.md_5.bungee.netty.cipher.CipherDecoder; - import net.md_5.bungee.netty.cipher.CipherEncoder; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.Protocol; -@@ -152,7 +155,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -152,7 +154,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); ++ throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071e..24195ed1b 100644 +index 6cd71071e..cf73d1f0a 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -1,6 +1,8 @@ +@@ -1,6 +1,7 @@ package net.md_5.bungee.connection; import com.google.gson.Gson; + -+import dev._2lstudios.flamecord.FlameCord; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -12,6 +14,7 @@ import net.md_5.bungee.api.config.ServerInfo; +@@ -12,6 +13,7 @@ import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.netty.ChannelWrapper; import net.md_5.bungee.netty.PacketHandler; import net.md_5.bungee.netty.PipelineUtils; @@ -709,16 +690,6 @@ index 6cd71071e..24195ed1b 100644 import net.md_5.bungee.protocol.MinecraftDecoder; import net.md_5.bungee.protocol.MinecraftEncoder; import net.md_5.bungee.protocol.PacketWrapper; -@@ -58,7 +61,8 @@ public class PingHandler extends PacketHandler - { - if ( packet.packet == null ) - { -- throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - Change from QuietException to BadPacketException -+ throw new BadPacketException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); - } - } - diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index b8e508552..7f18b5646 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch index fecfb739..a005b0b1 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 3a3b9229d496e28f0194ccffdf5bb3b0cf4079ea Mon Sep 17 00:00:00 2001 +From be41c59b3d676632710f10a1c88d655e12cbf48c Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 2c94ef55..3646cb95 100644 +index 522bd93da..494375cd6 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -286,9 +286,15 @@ public class ServerConnector extends PacketHandler +@@ -284,9 +284,15 @@ public class ServerConnector extends PacketHandler } else { ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); @@ -28,7 +28,7 @@ index 2c94ef55..3646cb95 100644 // Travertine end } 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 -index 474551d3..8716d0c8 100644 +index 474551d3e..8716d0c85 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -294,12 +294,21 @@ public class DownstreamBridge extends PacketHandler @@ -60,7 +60,7 @@ index 474551d3..8716d0c8 100644 { return; diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a3a12e19..214a1fd0 100644 +index a3a12e19b..214a1fd04 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -143,11 +143,17 @@ public abstract class EntityMap @@ -87,7 +87,7 @@ index a3a12e19..214a1fd0 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -index 6755fe84..21871d14 100644 +index 6755fe845..21871d14a 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -39,19 +39,27 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 @@ -130,7 +130,7 @@ index 6755fe84..21871d14 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206..2cd5740c 100644 +index cefa0206e..2cd5740ca 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -38,15 +38,27 @@ public class ForgeUtils diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch index 0d641738..6620ca6a 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 4e2cb9724d144d7d0257716b50984d7fd164535d Mon Sep 17 00:00:00 2001 +From 461598fbaeb1eb72a065b1b5a5c518682600c824 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -38,10 +38,10 @@ index 8bb61ac11..8822c6d33 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 18bab507a..86869e5b4 100644 +index deee607dc..3182f0144 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 -@@ -369,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -367,7 +367,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index 18bab507a..86869e5b4 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -378,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -376,7 +377,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch b/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch deleted file mode 100644 index 0d641738..00000000 --- a/Waterfall-Proxy-Patches/0027-FlameCord-replace-logger.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 4e2cb9724d144d7d0257716b50984d7fd164535d Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 30 Apr 2021 23:51:51 -0300 -Subject: [PATCH] FlameCord logger options - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac11..8822c6d33 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration { -+ @Getter -+ private boolean loggerInitialhandler = false; -+ @Getter -+ private boolean loggerExceptions = false; -+ @Getter -+ private boolean loggerDump = false; -+ @Getter -+ private boolean loggerHaProxy = false; -+ - @Getter - private boolean firewallNotify = true; - @Getter -@@ -34,6 +43,12 @@ public class FlameCordConfiguration { - configuration = configurationProvider.load(configurationFile); - } - -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, -+ configuration); -+ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -+ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ - this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); - this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); - this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); -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 18bab507a..86869e5b4 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 -@@ -369,7 +369,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - case 1: - // Ping -- if ( bungee.getConfig().isLogPings() ) -+ // FlameCord - Option to log initialhandler -+ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); - } -@@ -378,7 +379,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - break; - case 2: - // Login -- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall -+ // FlameCord - Option to log initialhandler -+ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall - { - bungee.getLogger().log( Level.INFO, "{0} has connected", this ); - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 5de0414ec..9f70323ee 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel = new ChannelWrapper( ctx ); - handler.connected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Option to log initialhandler -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); - } -@@ -64,7 +65,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel.close(); - handler.disconnected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Option to log initialhandler -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); - } -@@ -95,10 +97,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); - -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -- { -- channel.getRemoteAddress(), newAddress -- } ); -+ // FlameCord - Option to log haproxy -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) { -+ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ { -+ channel.getRemoteAddress(), newAddress -+ } ); -+ } - - channel.setRemoteAddress( newAddress ); - } finally -@@ -142,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - boolean logExceptions = !( handler instanceof PingHandler ); - -+ // FlameCord - Option to log exceptions -+ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; -+ - // FlameCord - Don't log firewall exceptions - logExceptions = cause instanceof FirewallException ? false : logExceptions; - -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 81987ca39..8808a989c 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 -@@ -115,7 +115,10 @@ public class PipelineUtils - // FlameCord - Close on exception caught - @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -- cause.printStackTrace(); -+ // FlameCord - Option to log exceptions -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { -+ cause.printStackTrace(); -+ } - - ctx.close(); - } --- -2.31.1 - From e85c84543d27a37ffafb4e20ca6d51425772e92b Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 11:17:29 -0300 Subject: [PATCH 069/499] Change how firewall works --- .../0023-FlameCord-General-Patch.patch | 12 +--- .../0026-Firewall-System.patch | 62 ++++++++++++++++++- .../0027-FlameCord-logger-options.patch | 8 +-- 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 63c1d796..ce79e3ca 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 38e24dcc8b058115653bc7bf79cd81a75a058b92 Mon Sep 17 00:00:00 2001 +From 7d558615b4ce5eae94afe9f013368dd7b232c27e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -671,7 +671,7 @@ index e7542b1c1..deee607dc 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071e..cf73d1f0a 100644 +index 6cd71071e..423af854f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -682,14 +682,6 @@ index 6cd71071e..cf73d1f0a 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -12,6 +13,7 @@ import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.netty.PipelineUtils; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.MinecraftEncoder; - import net.md_5.bungee.protocol.PacketWrapper; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index b8e508552..7f18b5646 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index fe3264eb..14e4f657 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From fd88f8b5de095c410ee19136015eb2624e416ec4 Mon Sep 17 00:00:00 2001 +From c0464d9c47b4a3e21a614e3965052889755536f7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -306,6 +306,66 @@ index bf6f85386..fa0b59c27 100644 case "reload": { // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 494375cd6..aedfece35 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -165,6 +165,9 @@ public class ServerConnector extends PacketHandler + { + if ( packet.packet == null ) + { ++ // FlameCord - Firewall on unexpected packet ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); ++ + throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); + } + } +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 deee607dc..3720825af 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 +@@ -154,6 +154,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( packet.packet == null ) + { ++ // FlameCord - Firewall on unexpected packet ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); ++ + throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); + } + } +@@ -396,6 +399,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + break; + default: ++ // FlameCord - Firewall on unexpected packet ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); ++ + throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +index 423af854f..70917b0b0 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +@@ -2,6 +2,7 @@ package net.md_5.bungee.connection; + + import com.google.gson.Gson; + ++import dev._2lstudios.flamecord.FlameCord; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -59,6 +60,9 @@ public class PingHandler extends PacketHandler + { + if ( packet.packet == null ) + { ++ // FlameCord - Firewall on unexpected packet ++ FlameCord.getInstance().getFirewallManager().addFirewalled(channel.getRemoteAddress()); ++ + throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); + } + } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index 7f18b5646..5de0414ec 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch index 6620ca6a..62b207f4 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 461598fbaeb1eb72a065b1b5a5c518682600c824 Mon Sep 17 00:00:00 2001 +From ee009b46b1b0adc6269aea1698e9ded4bdda943d Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -38,10 +38,10 @@ index 8bb61ac11..8822c6d33 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 deee607dc..3182f0144 100644 +index 3720825af..03c5aa07a 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 -@@ -367,7 +367,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index deee607dc..3182f0144 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -376,7 +377,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -379,7 +380,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login From e459175cd8942450caf7fc486455ada07c7f54b4 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 11:25:34 -0300 Subject: [PATCH 070/499] Firewall more --- .../0026-Firewall-System.patch | 80 +++++++++++++++---- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 14e4f657..2c68ae42 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From c0464d9c47b4a3e21a614e3965052889755536f7 Mon Sep 17 00:00:00 2001 +From f460649d5c2ea74ae2ceaf9b177f63b01c9298bf Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -157,10 +157,10 @@ index 000000000..6a661898d \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java new file mode 100644 -index 000000000..8a4747588 +index 000000000..dfb5c6d30 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -@@ -0,0 +1,116 @@ +@@ -0,0 +1,120 @@ +package dev._2lstudios.flamecord.firewall; + +import java.net.InetSocketAddress; @@ -203,6 +203,10 @@ index 000000000..8a4747588 + } + + public void addFirewalled(final SocketAddress address) { ++ if (address == null) { ++ return; ++ } ++ + if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { + final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; + final String hostString = iNetSocketAddress.getHostString(); @@ -278,6 +282,30 @@ index 000000000..8a4747588 + } +} \ No newline at end of file +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index d36f98656..0815cac25 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -45,6 +45,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder + final int readableBytes = in.readableBytes(); + final int capacity = in.capacity(); + ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ + if (readableBytes > 2097152) { + throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); + } else if (capacity > 2097152) { +@@ -107,6 +110,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder + packetTypeStr = "unknown"; + } + ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ + // FlameCord - Change from FastDecoderException to DecoderException + throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall + } finally diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java index bf6f85386..fa0b59c27 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -367,7 +395,7 @@ index 423af854f..70917b0b0 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 7f18b5646..5de0414ec 100644 +index 7f18b5646..81785523b 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -3,6 +3,7 @@ package net.md_5.bungee.netty; @@ -386,22 +414,13 @@ index 7f18b5646..5de0414ec 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -140,6 +142,23 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -140,6 +142,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); + // FlameCord - Don't log firewall exceptions + logExceptions = cause instanceof FirewallException ? false : logExceptions; + -+ // FlameCord - Firewall system -+ if (cause instanceof DecoderException || cause instanceof IllegalStateException || cause instanceof BadPacketException) { -+ final SocketAddress remoteAddress = ctx.channel().remoteAddress(); -+ -+ if (remoteAddress != null) { -+ FlameCord.getInstance().getFirewallManager().addFirewalled(remoteAddress); -+ } -+ } -+ + // FlameCord - Handle firewall exceptions + if (cause instanceof FirewallException) { + FlameCord.getInstance().getFirewallManager().logBlocked(ctx.channel().remoteAddress()); @@ -434,6 +453,39 @@ index 1d86aa63c..81987ca39 100644 if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) { ch.close(); +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index b3bdfd05e..49d53f177 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -2,6 +2,8 @@ package net.md_5.bungee.query; + + import com.google.common.cache.Cache; + import com.google.common.cache.CacheBuilder; ++ ++import dev._2lstudios.flamecord.FlameCord; + import io.github.waterfallmc.waterfall.QueryResult; + import io.github.waterfallmc.waterfall.event.ProxyQueryEvent; + import io.netty.buffer.ByteBuf; +@@ -70,6 +72,9 @@ public class QueryHandler extends SimpleChannelInboundHandler + ByteBuf in = msg.content(); + if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) + { ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ + bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); + // FlameCord - Close on incorrect magic + ctx.close(); +@@ -164,6 +169,9 @@ public class QueryHandler extends SimpleChannelInboundHandler + out.writeByte( 0x00 ); // Null + } else + { ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ + // Error! + throw new IllegalStateException( "Invalid data request packet" ); + } -- 2.31.1 From 3df8f40933cdacd817604d485f91af579459cb9b Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 11:36:56 -0300 Subject: [PATCH 071/499] Fixed up stuff --- Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch | 7 +++---- Waterfall-Proxy-Patches/0026-Firewall-System.patch | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index ce79e3ca..5f3342ad 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 7d558615b4ce5eae94afe9f013368dd7b232c27e Mon Sep 17 00:00:00 2001 +From 683075f7987cdd69042088d383509914a1f148e9 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -352,7 +352,7 @@ index 000000000..e82c4844b + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b8..3318b1de3 100644 +index bb39d31b8..b77ce763f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -362,13 +362,12 @@ index bb39d31b8..3318b1de3 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -102,7 +103,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -102,7 +103,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } - throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall + -+ // FlameCord - Change from FastDecoderException to DecoderException + throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall } finally { diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index 2c68ae42..fbf47549 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From f460649d5c2ea74ae2ceaf9b177f63b01c9298bf Mon Sep 17 00:00:00 2001 +From d37775fda46da249687d21328d25146e32db17e8 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -283,7 +283,7 @@ index 000000000..dfb5c6d30 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index d36f98656..0815cac25 100644 +index e08cb47dc..4aa3660d2 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -45,6 +45,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -303,9 +303,9 @@ index d36f98656..0815cac25 100644 + // FlameCord - Firewall system + FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); + - // FlameCord - Change from FastDecoderException to DecoderException throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall } finally + { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java index bf6f85386..fa0b59c27 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java From 8003de7e56d274cb37d08d332f238c0ec610cef9 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 11:43:08 -0300 Subject: [PATCH 072/499] Fix more stuff --- .../0023-FlameCord-General-Patch.patch | 10 ++++------ Waterfall-Proxy-Patches/0026-Firewall-System.patch | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 5f3342ad..20161f53 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 683075f7987cdd69042088d383509914a1f148e9 Mon Sep 17 00:00:00 2001 +From 93913f1b0c1df49b257894947944ad9ef4e46425 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -352,7 +352,7 @@ index 000000000..e82c4844b + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b8..b77ce763f 100644 +index bb39d31b8..62052d7f7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -362,16 +362,14 @@ index bb39d31b8..b77ce763f 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -102,7 +103,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -102,6 +103,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } -- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall + -+ throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall + throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall } finally { - if ( slice != null ) diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 index 000000000..bf6f85386 diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index fbf47549..e01dc43d 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From d37775fda46da249687d21328d25146e32db17e8 Mon Sep 17 00:00:00 2001 +From c366cae9359b1f027225fd6c2a4365b162857c01 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -283,7 +283,7 @@ index 000000000..dfb5c6d30 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index e08cb47dc..4aa3660d2 100644 +index 79a78b318..744f6dc1c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -45,6 +45,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -303,7 +303,7 @@ index e08cb47dc..4aa3660d2 100644 + // FlameCord - Firewall system + FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); + - throw new FastDecoderException( "Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e ); // Waterfall + throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall } finally { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java From 719dfa7ee49c4f9b3b870be65c9a5e5303bb541b Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 11:46:41 -0300 Subject: [PATCH 073/499] Remove unnecesary space --- .../0023-FlameCord-General-Patch.patch | 12 ++---------- Waterfall-Proxy-Patches/0026-Firewall-System.patch | 10 +++++----- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 20161f53..65565c6a 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 93913f1b0c1df49b257894947944ad9ef4e46425 Mon Sep 17 00:00:00 2001 +From 55134b87570446f86306234e3868d73785efe804 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -352,7 +352,7 @@ index 000000000..e82c4844b + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b8..62052d7f7 100644 +index bb39d31b8..28edad1a7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -362,14 +362,6 @@ index bb39d31b8..62052d7f7 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; -@@ -102,6 +103,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } else { - packetTypeStr = "unknown"; - } -+ - throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall - } finally - { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 index 000000000..bf6f85386 diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index e01dc43d..ec849c85 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,4 +1,4 @@ -From c366cae9359b1f027225fd6c2a4365b162857c01 Mon Sep 17 00:00:00 2001 +From 9dd65918d56668166b82233f084c25bdb974f05c Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -283,7 +283,7 @@ index 000000000..dfb5c6d30 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 79a78b318..744f6dc1c 100644 +index 107855b83..e8942767c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -45,6 +45,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -296,13 +296,13 @@ index 79a78b318..744f6dc1c 100644 if (readableBytes > 2097152) { throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); } else if (capacity > 2097152) { -@@ -107,6 +110,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -106,6 +109,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } else { packetTypeStr = "unknown"; } - ++ + // FlameCord - Firewall system + FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall } finally { From 5a71278434bef6f40ed2c37a19855f27b818c158 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 1 May 2021 13:00:30 -0300 Subject: [PATCH 074/499] Improve Firewall handling --- .../0026-Firewall-System.patch | 121 +++++------------- .../0027-FlameCord-logger-options.patch | 26 ++-- 2 files changed, 43 insertions(+), 104 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0026-Firewall-System.patch index ec849c85..ba8232df 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0026-Firewall-System.patch @@ -1,11 +1,11 @@ -From 9dd65918d56668166b82233f084c25bdb974f05c Mon Sep 17 00:00:00 2001 +From 8ed0fb5643c225133bedd5b8336e736be07d0b48 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79ac..fd889644f 100644 +index 8957c79a..fd889644 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -6,6 +6,7 @@ import java.util.logging.Logger; @@ -64,7 +64,7 @@ index 8957c79ac..fd889644f 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded2243..8bb61ac11 100644 +index 81ded224..8bb61ac1 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -96,7 +96,7 @@ index 81ded2243..8bb61ac11 100644 configurationProvider.save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ebfaa761c..c88077ade 100644 +index ebfaa761..c88077ad 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -82,9 +82,17 @@ public class MessagesConfiguration { @@ -118,46 +118,9 @@ index ebfaa761c..c88077ade 100644 configuration); setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -new file mode 100644 -index 000000000..6a661898d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallException.java -@@ -0,0 +1,30 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.SocketAddress; -+ -+public class FirewallException extends Exception { -+ private static final long serialVersionUID = 1L; -+ -+ public FirewallException(final SocketAddress address) { -+ super("The address " + address + " is blocked from the server!"); -+ } -+ -+ public FirewallException(final String string) { -+ super(string); -+ } -+ -+ public FirewallException(final String string, final Throwable throwable) { -+ super(string, throwable); -+ } -+ -+ @Override -+ public synchronized Throwable initCause(final Throwable cause) -+ { -+ return this; -+ } -+ -+ @Override -+ public synchronized Throwable fillInStackTrace() { -+ return this; -+ } -+} -\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java new file mode 100644 -index 000000000..dfb5c6d30 +index 00000000..dfb5c6d3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java @@ -0,0 +1,120 @@ @@ -283,20 +246,25 @@ index 000000000..dfb5c6d30 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 107855b83..e8942767c 100644 +index 107855b8..27a027e0 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -45,6 +45,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder - final int readableBytes = in.readableBytes(); +@@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder final int capacity = in.capacity(); -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ if (readableBytes > 2097152) { ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); } else if (capacity > 2097152) { -@@ -106,6 +109,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder ++ // FlameCord - Firewall system ++ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); ++ + throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); + } + } +@@ -106,6 +112,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } @@ -307,7 +275,7 @@ index 107855b83..e8942767c 100644 } finally { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index bf6f85386..fa0b59c27 100644 +index bf6f8538..fa0b59c2 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -5,6 +5,7 @@ import java.util.HashSet; @@ -335,7 +303,7 @@ index bf6f85386..fa0b59c27 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 494375cd6..aedfece35 100644 +index 494375cd..aedfece3 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -165,6 +165,9 @@ public class ServerConnector extends PacketHandler @@ -349,7 +317,7 @@ index 494375cd6..aedfece35 100644 } } 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 deee607dc..3720825af 100644 +index deee607d..3720825a 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 @@ -154,6 +154,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -373,7 +341,7 @@ index deee607dc..3720825af 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 423af854f..70917b0b0 100644 +index 423af854..70917b0b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -2,6 +2,7 @@ package net.md_5.bungee.connection; @@ -395,18 +363,10 @@ index 423af854f..70917b0b0 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 7f18b5646..81785523b 100644 +index 7f18b564..616651ba 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -3,6 +3,7 @@ package net.md_5.bungee.netty; - import com.google.common.base.Preconditions; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; - import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInboundHandlerAdapter; - import io.netty.handler.codec.CorruptedFrameException; -@@ -11,6 +12,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; +@@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; import io.netty.handler.timeout.ReadTimeoutException; import java.io.IOException; import java.net.InetSocketAddress; @@ -414,47 +374,26 @@ index 7f18b5646..81785523b 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; -@@ -140,6 +142,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - boolean logExceptions = !( handler instanceof PingHandler ); - -+ // FlameCord - Don't log firewall exceptions -+ logExceptions = cause instanceof FirewallException ? false : logExceptions; -+ -+ // FlameCord - Handle firewall exceptions -+ if (cause instanceof FirewallException) { -+ FlameCord.getInstance().getFirewallManager().logBlocked(ctx.channel().remoteAddress()); -+ } -+ - if ( logExceptions ) - { - if ( cause instanceof ReadTimeoutException ) 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 1d86aa63c..81987ca39 100644 +index 1d86aa63..915c162f 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 -@@ -3,6 +3,7 @@ package net.md_5.bungee.netty; - import com.google.common.base.Preconditions; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.firewall.FirewallException; - import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; - import io.netty.buffer.PooledByteBufAllocator; - import io.netty.channel.Channel; -@@ -63,6 +64,11 @@ public class PipelineUtils +@@ -63,6 +63,13 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + // FlameCord - Firewall system -+ if (remoteAddress != null && FlameCord.getInstance().getFirewallManager().isFirewalled(remoteAddress)) { -+ throw new FirewallException(remoteAddress); ++ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( remoteAddress ) ) { ++ FlameCord.getInstance().getFirewallManager().logBlocked( remoteAddress ); ++ ch.close(); ++ return; + } + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) { ch.close(); diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b3bdfd05e..49d53f177 100644 +index b3bdfd05..49d53f17 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -2,6 +2,8 @@ package net.md_5.bungee.query; diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch index 62b207f4..c797e3f7 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From ee009b46b1b0adc6269aea1698e9ded4bdda943d Mon Sep 17 00:00:00 2001 +From a16eb2112438585594f672a6a310a3a7594374a5 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac11..8822c6d33 100644 +index 8bb61ac1..8822c6d3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -38,7 +38,7 @@ index 8bb61ac11..8822c6d33 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 3720825af..03c5aa07a 100644 +index 3720825a..03c5aa07 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 @@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -62,10 +62,10 @@ index 3720825af..03c5aa07a 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 5de0414ec..9f70323ee 100644 +index 616651ba..7bf30b23 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -48,7 +48,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel = new ChannelWrapper( ctx ); handler.connected( channel ); @@ -75,7 +75,7 @@ index 5de0414ec..9f70323ee 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); } -@@ -64,7 +65,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -63,7 +64,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel.close(); handler.disconnected( channel ); @@ -85,7 +85,7 @@ index 5de0414ec..9f70323ee 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -95,10 +97,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -94,10 +96,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); @@ -103,21 +103,21 @@ index 5de0414ec..9f70323ee 100644 channel.setRemoteAddress( newAddress ); } finally -@@ -142,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -141,6 +146,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); + // FlameCord - Option to log exceptions + logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; + - // FlameCord - Don't log firewall exceptions - logExceptions = cause instanceof FirewallException ? false : logExceptions; - + if ( logExceptions ) + { + if ( cause instanceof ReadTimeoutException ) 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 81987ca39..8808a989c 100644 +index 915c162f..a6722b41 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 -@@ -115,7 +115,10 @@ public class PipelineUtils +@@ -116,7 +116,10 @@ public class PipelineUtils // FlameCord - Close on exception caught @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { From 7a3cc7852f3501d7d94ba40ce811d77e03c23ec1 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:41:28 -0300 Subject: [PATCH 075/499] Split flamecord message config --- .../0023-FlameCord-General-Patch.patch | 199 +++------------ ...0024-FlameCord-message-configuration.patch | 234 ++++++++++++++++++ ...ch => 0025-Fix-ByteBuf-memory-leaks.patch} | 12 +- ...> 0026-Check-if-packetID-is-invalid.patch} | 6 +- ...ystem.patch => 0027-Firewall-System.patch} | 2 +- ...ch => 0028-FlameCord-logger-options.patch} | 2 +- 6 files changed, 273 insertions(+), 182 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch rename Waterfall-Proxy-Patches/{0024-Fix-ByteBuf-memory-leaks.patch => 0025-Fix-ByteBuf-memory-leaks.patch} (97%) rename Waterfall-Proxy-Patches/{0025-Check-if-packetID-is-invalid.patch => 0026-Check-if-packetID-is-invalid.patch} (90%) rename Waterfall-Proxy-Patches/{0026-Firewall-System.patch => 0027-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0027-FlameCord-logger-options.patch => 0028-FlameCord-logger-options.patch} (99%) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 65565c6a..6a6bd99a 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 55134b87570446f86306234e3868d73785efe804 Mon Sep 17 00:00:00 2001 +From 83cf5e25ec01e1fd7b0b05c3c7ef041d86f75727 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,17 +6,16 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 000000000..8957c79ac +index 00000000..2e317533 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,38 @@ +package dev._2lstudios.flamecord; + +import java.util.Collection; +import java.util.logging.Logger; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; +import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +import lombok.Getter; +import net.md_5.bungee.config.ConfigurationProvider; @@ -30,8 +29,6 @@ index 000000000..8957c79ac + @Getter + private final ModulesConfiguration modulesConfiguration; + @Getter -+ private final MessagesConfiguration messagesConfiguration; -+ @Getter + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { @@ -49,13 +46,12 @@ index 000000000..8957c79ac + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); -+ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); + } +} \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..81ded2243 +index 00000000..81ded224 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,64 @@ @@ -123,137 +119,9 @@ index 000000000..81ded2243 + } + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -new file mode 100644 -index 000000000..ebfaa761c ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,121 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.text.MessageFormat; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class MessagesConfiguration { -+ private final Logger logger; -+ private final Map messages = new HashMap<>(); -+ -+ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { -+ this.logger = logger; -+ -+ try { -+ final String fileName = "./messages.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_kick", "[Kicked] ", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_too_long", "Cannot have username longer than 16 characters", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("successfully_summoned", "&aSuccessfully summoned player(s)", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ -+ // FlameCord -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public String getTranslation(final String name, final Object... args) { -+ if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name -+ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); -+ } -+ -+ return MessageFormat.format(messages.getOrDefault(name, ""), args); -+ } -+ -+ private void setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ } -+ } -+} -\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 000000000..e82c4844b +index 00000000..e82c4844 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,94 @@ @@ -352,7 +220,7 @@ index 000000000..e82c4844b + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b8..28edad1a7 100644 +index bb39d31b..28edad1a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -364,17 +232,16 @@ index bb39d31b8..28edad1a7 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 000000000..bf6f85386 +index 00000000..a323598e --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -0,0 +1,61 @@ +@@ -0,0 +1,58 @@ +package dev._2lstudios.flamecord.commands; + +import java.util.Collection; +import java.util.HashSet; + +import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; +import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.chat.TextComponent; @@ -393,7 +260,6 @@ index 000000000..bf6f85386 + @Override + public void execute(final CommandSender sender, final String[] args) { + final FlameCord flameCord = FlameCord.getInstance(); -+ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); + + if (sender.hasPermission("flamecord.usage")) { + if (args.length > 0) { @@ -410,27 +276,26 @@ index 000000000..bf6f85386 + + FlameCord.renew(bungeeCord.getLogger(), whitelistedAddresses); + sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); ++ .fromLegacyText("flamecord_reload")); + break; + } + default: { -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); + break; + } + } + } else { + sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ .fromLegacyText("flamecord_help")); + } + } else { + sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); ++ .fromLegacyText("flamecord_nopermission")); + } + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 5d3857060..83d3e9edd 100644 +index 5d385706..ed3e3e12 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,10 @@ import com.google.common.collect.Sets; @@ -505,26 +370,18 @@ index 5d3857060..83d3e9edd 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -573,16 +595,8 @@ public class BungeeCord extends ProxyServer - @Override - public String getTranslation(String name, Object... args) - { -- String translation = ""; -- try -- { +@@ -576,9 +598,7 @@ public class BungeeCord extends ProxyServer + String translation = ""; + try + { - final String string = customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ); - - translation = ( args.length == 0 ) ? string : MessageFormat.format( string, args ); -- } catch ( MissingResourceException ex ) -- { -- } -- return translation; -+ // FlameCord - Use own translation system -+ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); - } - - @Override -@@ -815,4 +829,56 @@ public class BungeeCord extends ProxyServer ++ translation = MessageFormat.format( customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ), args ); + } catch ( MissingResourceException ex ) + { + } +@@ -815,4 +835,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -582,7 +439,7 @@ index 5d3857060..83d3e9edd 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7b99c466d..522bd93da 100644 +index 7b99c466..522bd93d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -604,7 +461,7 @@ index 7b99c466d..522bd93da 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 159119c13..7c4c8f8a0 100644 +index 159119c1..7c4c8f8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -638,7 +495,7 @@ index 159119c13..7c4c8f8a0 100644 b.connect().addListener( listener ); } 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 e7542b1c1..deee607dc 100644 +index e7542b1c..deee607d 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 @@ -16,6 +16,8 @@ import java.util.logging.Level; @@ -660,7 +517,7 @@ index e7542b1c1..deee607dc 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071e..423af854f 100644 +index 6cd71071..423af854 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -672,7 +529,7 @@ index 6cd71071e..423af854f 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index b8e508552..7f18b5646 100644 +index b8e50855..7f18b564 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -685,7 +542,7 @@ index b8e508552..7f18b5646 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 4996a7b44..1d86aa63c 100644 +index 4996a7b4..1d86aa63 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,8 @@ diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch new file mode 100644 index 00000000..c37b2620 --- /dev/null +++ b/Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch @@ -0,0 +1,234 @@ +From b981e4156166237c90d6df9aa7dfda64c136ee36 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 1 May 2021 13:40:39 -0300 +Subject: [PATCH] FlameCord message configuration + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index 2e317533..8957c79a 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.logging.Logger; + + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import lombok.Getter; + import net.md_5.bungee.config.ConfigurationProvider; +@@ -17,6 +18,8 @@ public class FlameCord { + @Getter + private final ModulesConfiguration modulesConfiguration; + @Getter ++ private final MessagesConfiguration messagesConfiguration; ++ @Getter + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { +@@ -34,5 +37,6 @@ public class FlameCord { + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); ++ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +new file mode 100644 +index 00000000..ebfaa761 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -0,0 +1,121 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.text.MessageFormat; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Logger; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class MessagesConfiguration { ++ private final Logger logger; ++ private final Map messages = new HashMap<>(); ++ ++ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { ++ this.logger = logger; ++ ++ try { ++ final String fileName = "./messages.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_kick", "[Kicked] ", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_too_long", "Cannot have username longer than 16 characters", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("successfully_summoned", "&aSuccessfully summoned player(s)", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ ++ // FlameCord ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ ++ if (!configurationExists) { ++ configurationProvider.save(configuration, configurationFile); ++ } ++ ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); ++ ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); ++ } ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ public String getTranslation(final String name, final Object... args) { ++ if (!messages.containsKey(name)) { ++ logger.warning("[FlameCord] Tried to get translation '" + name ++ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); ++ } ++ ++ return MessageFormat.format(messages.getOrDefault(name, ""), args); ++ } ++ ++ private void setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ } ++ } ++} +\ No newline at end of file +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +index a323598e..bf6f8538 100644 +--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.HashSet; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; +@@ -22,6 +23,7 @@ private final BungeeCord bungeeCord; + @Override + public void execute(final CommandSender sender, final String[] args) { + final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); + + if (sender.hasPermission("flamecord.usage")) { + if (args.length > 0) { +@@ -38,21 +40,22 @@ private final BungeeCord bungeeCord; + + FlameCord.renew(bungeeCord.getLogger(), whitelistedAddresses); + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_reload")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); + break; + } + default: { +- sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); ++ sender.sendMessage(TextComponent.fromLegacyText( ++ messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + break; + } + } + } else { + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_help")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + } + } else { + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_nopermission")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index ed3e3e12..83d3e9ed 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -595,14 +595,8 @@ public class BungeeCord extends ProxyServer + @Override + public String getTranslation(String name, Object... args) + { +- String translation = ""; +- try +- { +- translation = MessageFormat.format( customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ), args ); +- } catch ( MissingResourceException ex ) +- { +- } +- return translation; ++ // FlameCord - Use own translation system ++ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); + } + + @Override +-- +2.31.1 + diff --git a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch index a005b0b1..c26f1d18 100644 --- a/Waterfall-Proxy-Patches/0024-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch @@ -1,11 +1,11 @@ -From be41c59b3d676632710f10a1c88d655e12cbf48c Mon Sep 17 00:00:00 2001 +From 72f7c8263253c704f24a8cc7634a9760b7aa9717 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 522bd93da..494375cd6 100644 +index 522bd93d..494375cd 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -284,9 +284,15 @@ public class ServerConnector extends PacketHandler @@ -28,7 +28,7 @@ index 522bd93da..494375cd6 100644 // Travertine end } 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 -index 474551d3e..8716d0c85 100644 +index 474551d3..8716d0c8 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -294,12 +294,21 @@ public class DownstreamBridge extends PacketHandler @@ -60,7 +60,7 @@ index 474551d3e..8716d0c85 100644 { return; diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a3a12e19b..214a1fd04 100644 +index a3a12e19..214a1fd0 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -143,11 +143,17 @@ public abstract class EntityMap @@ -87,7 +87,7 @@ index a3a12e19b..214a1fd04 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -index 6755fe845..21871d14a 100644 +index 6755fe84..21871d14 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -39,19 +39,27 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 @@ -130,7 +130,7 @@ index 6755fe845..21871d14a 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206e..2cd5740ca 100644 +index cefa0206..2cd5740c 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -38,15 +38,27 @@ public class ForgeUtils diff --git a/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch similarity index 90% rename from Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch index 3d2795b5..65d17630 100644 --- a/Waterfall-Proxy-Patches/0025-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch @@ -1,11 +1,11 @@ -From e4a35d4d710e5781cb384e3ad08309f43c0f4b44 Mon Sep 17 00:00:00 2001 +From 47605cd0eafb06be49ce04bccfe2005790ac560d Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index dd089abd..b3de7a7b 100644 +index 28edad1a..107855b8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -65,7 +65,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -21,5 +21,5 @@ index dd089abd..b3de7a7b 100644 if ( packet != null ) { -- -2.29.2.windows.3 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0026-Firewall-System.patch b/Waterfall-Proxy-Patches/0027-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0026-Firewall-System.patch rename to Waterfall-Proxy-Patches/0027-Firewall-System.patch index ba8232df..eb70881f 100644 --- a/Waterfall-Proxy-Patches/0026-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0027-Firewall-System.patch @@ -1,4 +1,4 @@ -From 8ed0fb5643c225133bedd5b8336e736be07d0b48 Mon Sep 17 00:00:00 2001 +From c88d6b641bccb2dd9d22425723c59c64e17c6b4e Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch similarity index 99% rename from Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch index c797e3f7..8373e0b5 100644 --- a/Waterfall-Proxy-Patches/0027-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From a16eb2112438585594f672a6a310a3a7594374a5 Mon Sep 17 00:00:00 2001 +From bf23394fd07a8dddff698836be75d8744cb35e94 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options From 6fe03a789f1b28f3709ccef12076da5cbd1fe964 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:19:47 -0300 Subject: [PATCH 076/499] Split module system --- .../0023-FlameCord-General-Patch.patch | 194 +-------------- .../0024-FlameCord-module-system.patch | 228 ++++++++++++++++++ ...025-FlameCord-message-configuration.patch} | 2 +- ...ch => 0026-Fix-ByteBuf-memory-leaks.patch} | 2 +- ...> 0027-Check-if-packetID-is-invalid.patch} | 2 +- ...ystem.patch => 0028-Firewall-System.patch} | 2 +- ...ch => 0029-FlameCord-logger-options.patch} | 2 +- 7 files changed, 242 insertions(+), 190 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch rename Waterfall-Proxy-Patches/{0024-FlameCord-message-configuration.patch => 0025-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0025-Fix-ByteBuf-memory-leaks.patch => 0026-Fix-ByteBuf-memory-leaks.patch} (99%) rename Waterfall-Proxy-Patches/{0026-Check-if-packetID-is-invalid.patch => 0027-Check-if-packetID-is-invalid.patch} (94%) rename Waterfall-Proxy-Patches/{0027-Firewall-System.patch => 0028-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0028-FlameCord-logger-options.patch => 0029-FlameCord-logger-options.patch} (99%) diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 6a6bd99a..01d04b39 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 83cf5e25ec01e1fd7b0b05c3c7ef041d86f75727 Mon Sep 17 00:00:00 2001 +From c9bb2cb6c47e65758d3ee91dbca7df360198b89e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,17 +6,16 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..2e317533 +index 00000000..252612a3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,38 @@ +@@ -0,0 +1,34 @@ +package dev._2lstudios.flamecord; + +import java.util.Collection; +import java.util.logging.Logger; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +import lombok.Getter; +import net.md_5.bungee.config.ConfigurationProvider; +import net.md_5.bungee.config.YamlConfiguration; @@ -27,8 +26,6 @@ index 00000000..2e317533 + @Getter + private final FlameCordConfiguration flameCordConfiguration; + @Getter -+ private final ModulesConfiguration modulesConfiguration; -+ @Getter + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { @@ -45,7 +42,6 @@ index 00000000..2e317533 + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); -+ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + } +} \ No newline at end of file @@ -119,106 +115,6 @@ index 00000000..81ded224 + } + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -new file mode 100644 -index 00000000..e82c4844 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -@@ -0,0 +1,94 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+ -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class ModulesConfiguration { -+ // Reconnect Module -+ public boolean reconnectEnabled = false; -+ -+ // Alert Module -+ public boolean alertEnabled = true; -+ -+ // Find Module -+ public boolean findEnabled = true; -+ -+ // IP Module -+ public boolean ipEnabled = true; -+ -+ // List Module -+ public boolean listEnabled = true; -+ -+ // Perms Module -+ public boolean permsEnabled = true; -+ -+ // Reload Module -+ public boolean reloadEnabled = true; -+ -+ // Send Module -+ public boolean sendEnabled = true; -+ -+ // Server -+ public boolean serverEnabled = true; -+ -+ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { -+ try { -+ final String fileName = "./modules.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); -+ -+ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); -+ -+ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); -+ -+ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); -+ -+ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); -+ -+ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); -+ -+ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); -+ -+ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); -+ -+ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, -+ configuration); -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { -+ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ -+ return arg2; -+ } else { -+ return configuration.get(arg1); -+ } -+ } -+} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java index bb39d31b..28edad1a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -295,21 +191,20 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 5d385706..ed3e3e12 100644 +index 5d385706..301763f1 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -9,6 +9,10 @@ import com.google.common.collect.Sets; +@@ -9,6 +9,9 @@ import com.google.common.collect.Sets; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.gson.Gson; import com.google.gson.GsonBuilder; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.commands.FlameCordCommand; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -86,6 +90,12 @@ import net.md_5.bungee.conf.Configuration; +@@ -86,6 +89,12 @@ import net.md_5.bungee.conf.Configuration; import net.md_5.bungee.conf.YamlConfig; import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.module.ModuleManager; @@ -322,7 +217,7 @@ index 5d385706..ed3e3e12 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -232,11 +242,12 @@ public class BungeeCord extends ProxyServer +@@ -232,11 +241,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -340,20 +235,7 @@ index 5d385706..ed3e3e12 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -275,9 +286,10 @@ public class BungeeCord extends ProxyServer - bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); - workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); - -- File moduleDirectory = new File( "modules" ); -+ // FlameCord - Use own module system -+ /* File moduleDirectory = new File( "modules" ); - moduleManager.load( this, moduleDirectory ); -- pluginManager.detectPlugins( moduleDirectory ); -+ pluginManager.detectPlugins( moduleDirectory ); */ - - pluginsFolder.mkdir(); - pluginManager.detectPlugins( pluginsFolder ); -@@ -285,6 +297,16 @@ public class BungeeCord extends ProxyServer +@@ -285,6 +295,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -365,12 +247,11 @@ index 5d385706..ed3e3e12 100644 + } + + FlameCord.renew(logger, whitelistedAddresses); -+ registerModules(); + if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -576,9 +598,7 @@ public class BungeeCord extends ProxyServer +@@ -576,9 +595,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -381,63 +262,6 @@ index 5d385706..ed3e3e12 100644 } catch ( MissingResourceException ex ) { } -@@ -815,4 +835,56 @@ public class BungeeCord extends ProxyServer - { - return new BungeeTitle(); - } -+ -+ // FlameCord - Method to simplify module registering -+ public void registerModules() { -+ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); -+ -+ // Bungeecord Commands -+ pluginManager.registerCommand(null, new CommandEnd()); -+ pluginManager.registerCommand(null, new CommandBungee()); -+ -+ if (modulesConfiguration.reloadEnabled) { -+ pluginManager.registerCommand(null, new CommandReload()); -+ } -+ if (modulesConfiguration.ipEnabled) { -+ pluginManager.registerCommand(null, new CommandIP()); -+ } -+ if (modulesConfiguration.permsEnabled) { -+ pluginManager.registerCommand(null, new CommandPerms()); -+ } -+ -+ // Modules Commands -+ if (modulesConfiguration.alertEnabled) { -+ pluginManager.registerCommand(null, new CommandAlert()); -+ } -+ if (modulesConfiguration.findEnabled) { -+ pluginManager.registerCommand(null, new CommandFind()); -+ } -+ if (modulesConfiguration.listEnabled) { -+ pluginManager.registerCommand(null, new CommandList()); -+ } -+ if (modulesConfiguration.sendEnabled) { -+ pluginManager.registerCommand(null, new CommandSend()); -+ } -+ if (modulesConfiguration.serverEnabled) { -+ pluginManager.registerCommand(null, new CommandServer()); -+ } -+ -+ try { -+ if (modulesConfiguration.reconnectEnabled) { -+ for (ListenerInfo info : getConfig().getListeners()) { -+ if (!info.isForceDefault() && getReconnectHandler() == null) { -+ setReconnectHandler(new YamlReconnectHandler()); -+ break; -+ } -+ } -+ } -+ } catch (final Exception exception) { -+ logger.warning("Reconnect module is not able to work on FlameCord!"); -+ } -+ -+ // Flamecord - Commands (Had to make it like this because of maven limitations) -+ pluginManager.registerCommand(null, new FlameCordCommand(this)); -+ } - } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 7b99c466..522bd93d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch new file mode 100644 index 00000000..330a52bd --- /dev/null +++ b/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch @@ -0,0 +1,228 @@ +From e91832380cb724413372a27c547468be2bf74a26 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 1 May 2021 14:17:48 -0300 +Subject: [PATCH] FlameCord module system + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index 252612a3..2e317533 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.logging.Logger; + + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import lombok.Getter; + import net.md_5.bungee.config.ConfigurationProvider; + import net.md_5.bungee.config.YamlConfiguration; +@@ -14,6 +15,8 @@ public class FlameCord { + @Getter + private final FlameCordConfiguration flameCordConfiguration; + @Getter ++ private final ModulesConfiguration modulesConfiguration; ++ @Getter + private boolean running = true; + + public static void renew(final Logger logger, final Collection whitelistedAddresses) { +@@ -30,5 +33,6 @@ public class FlameCord { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); ++ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +new file mode 100644 +index 00000000..e82c4844 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +@@ -0,0 +1,94 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++ ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class ModulesConfiguration { ++ // Reconnect Module ++ public boolean reconnectEnabled = false; ++ ++ // Alert Module ++ public boolean alertEnabled = true; ++ ++ // Find Module ++ public boolean findEnabled = true; ++ ++ // IP Module ++ public boolean ipEnabled = true; ++ ++ // List Module ++ public boolean listEnabled = true; ++ ++ // Perms Module ++ public boolean permsEnabled = true; ++ ++ // Reload Module ++ public boolean reloadEnabled = true; ++ ++ // Send Module ++ public boolean sendEnabled = true; ++ ++ // Server ++ public boolean serverEnabled = true; ++ ++ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { ++ try { ++ final String fileName = "./modules.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); ++ ++ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); ++ ++ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); ++ ++ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); ++ ++ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); ++ ++ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); ++ ++ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); ++ ++ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); ++ ++ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, ++ configuration); ++ ++ if (!configurationExists) { ++ configurationProvider.save(configuration, configurationFile); ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ private String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { ++ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ ++ return arg2; ++ } else { ++ return configuration.get(arg1); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 301763f1..ed3e3e12 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; + import dev._2lstudios.flamecord.commands.FlameCordCommand; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; +@@ -285,9 +286,10 @@ public class BungeeCord extends ProxyServer + bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); + workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); + +- File moduleDirectory = new File( "modules" ); ++ // FlameCord - Use own module system ++ /* File moduleDirectory = new File( "modules" ); + moduleManager.load( this, moduleDirectory ); +- pluginManager.detectPlugins( moduleDirectory ); ++ pluginManager.detectPlugins( moduleDirectory ); */ + + pluginsFolder.mkdir(); + pluginManager.detectPlugins( pluginsFolder ); +@@ -303,6 +305,7 @@ public class BungeeCord extends ProxyServer + } + + FlameCord.renew(logger, whitelistedAddresses); ++ registerModules(); + + if ( config.isForgeSupport() ) + { +@@ -832,4 +835,56 @@ public class BungeeCord extends ProxyServer + { + return new BungeeTitle(); + } ++ ++ // FlameCord - Method to simplify module registering ++ public void registerModules() { ++ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); ++ ++ // Bungeecord Commands ++ pluginManager.registerCommand(null, new CommandEnd()); ++ pluginManager.registerCommand(null, new CommandBungee()); ++ ++ if (modulesConfiguration.reloadEnabled) { ++ pluginManager.registerCommand(null, new CommandReload()); ++ } ++ if (modulesConfiguration.ipEnabled) { ++ pluginManager.registerCommand(null, new CommandIP()); ++ } ++ if (modulesConfiguration.permsEnabled) { ++ pluginManager.registerCommand(null, new CommandPerms()); ++ } ++ ++ // Modules Commands ++ if (modulesConfiguration.alertEnabled) { ++ pluginManager.registerCommand(null, new CommandAlert()); ++ } ++ if (modulesConfiguration.findEnabled) { ++ pluginManager.registerCommand(null, new CommandFind()); ++ } ++ if (modulesConfiguration.listEnabled) { ++ pluginManager.registerCommand(null, new CommandList()); ++ } ++ if (modulesConfiguration.sendEnabled) { ++ pluginManager.registerCommand(null, new CommandSend()); ++ } ++ if (modulesConfiguration.serverEnabled) { ++ pluginManager.registerCommand(null, new CommandServer()); ++ } ++ ++ try { ++ if (modulesConfiguration.reconnectEnabled) { ++ for (ListenerInfo info : getConfig().getListeners()) { ++ if (!info.isForceDefault() && getReconnectHandler() == null) { ++ setReconnectHandler(new YamlReconnectHandler()); ++ break; ++ } ++ } ++ } ++ } catch (final Exception exception) { ++ logger.warning("Reconnect module is not able to work on FlameCord!"); ++ } ++ ++ // Flamecord - Commands (Had to make it like this because of maven limitations) ++ pluginManager.registerCommand(null, new FlameCordCommand(this)); ++ } + } +-- +2.31.1 + diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch index c37b2620..8920bbc1 100644 --- a/Waterfall-Proxy-Patches/0024-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From b981e4156166237c90d6df9aa7dfda64c136ee36 Mon Sep 17 00:00:00 2001 +From 3e0122018b5350b1d9c1ee5c56f319c06c05e730 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch similarity index 99% rename from Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch index c26f1d18..4cefa663 100644 --- a/Waterfall-Proxy-Patches/0025-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 72f7c8263253c704f24a8cc7634a9760b7aa9717 Mon Sep 17 00:00:00 2001 +From 5580b156711771e38a5a3a3557581d7358abeea6 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch similarity index 94% rename from Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch index 65d17630..4c1b7e6a 100644 --- a/Waterfall-Proxy-Patches/0026-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch @@ -1,4 +1,4 @@ -From 47605cd0eafb06be49ce04bccfe2005790ac560d Mon Sep 17 00:00:00 2001 +From caf54c0422f8edbbe6e62015c473d5e1f45a4b08 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/Waterfall-Proxy-Patches/0027-Firewall-System.patch b/Waterfall-Proxy-Patches/0028-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0027-Firewall-System.patch rename to Waterfall-Proxy-Patches/0028-Firewall-System.patch index eb70881f..fabd29b5 100644 --- a/Waterfall-Proxy-Patches/0027-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0028-Firewall-System.patch @@ -1,4 +1,4 @@ -From c88d6b641bccb2dd9d22425723c59c64e17c6b4e Mon Sep 17 00:00:00 2001 +From 32ba01b3d68286a1255b014f833d0db41ef2ef2a Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch similarity index 99% rename from Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch index 8373e0b5..e84d6b86 100644 --- a/Waterfall-Proxy-Patches/0028-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From bf23394fd07a8dddff698836be75d8744cb35e94 Mon Sep 17 00:00:00 2001 +From 59dcb230fde16df56f6a30ea041a4c20fb2d2794 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options From 944d63b6407117183f9246975ab0db22aa2a8c1e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 1 May 2021 20:05:16 +0100 Subject: [PATCH 077/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 8fdb6be Updated Upstream (BungeeCord) (#637) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index bf21a394..8fdb6be7 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit bf21a394fa1b222043bfbc3366ae934c1cfea698 +Subproject commit 8fdb6be79589080b3ebe1f6587892de9625ac55f From f00cd3d807fff6b91e39bdd8419eef9d66fdeb2b Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 16:42:07 -0300 Subject: [PATCH 078/499] Use FastDecoderException for patch 0027 --- .../0027-Check-if-packetID-is-invalid.patch | 10 ++++++---- Waterfall-Proxy-Patches/0028-Firewall-System.patch | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch index 4c1b7e6a..27c57e67 100644 --- a/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch @@ -1,21 +1,23 @@ -From caf54c0422f8edbbe6e62015c473d5e1f45a4b08 Mon Sep 17 00:00:00 2001 +From eea04c872972cf457d2ffc61fda629c4ad7c21d0 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 28edad1a..107855b8 100644 +index 28edad1a..f0761a4f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -65,7 +65,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder int packetId = DefinedPacket.readVarInt( in ); packetTypeInfo = packetId; - + // FlameCord Start - Check if packetId is invalid. + if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) -+ throw new BadPacketException("[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId); ++ { ++ throw new FastDecoderException( "[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId ); ++ } + // Flamecord End DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); if ( packet != null ) diff --git a/Waterfall-Proxy-Patches/0028-Firewall-System.patch b/Waterfall-Proxy-Patches/0028-Firewall-System.patch index fabd29b5..a588199f 100644 --- a/Waterfall-Proxy-Patches/0028-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0028-Firewall-System.patch @@ -1,4 +1,4 @@ -From 32ba01b3d68286a1255b014f833d0db41ef2ef2a Mon Sep 17 00:00:00 2001 +From d1d73f437bc7e61be80eed98c4d8485f53b38a02 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -246,7 +246,7 @@ index 00000000..dfb5c6d3 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 107855b8..27a027e0 100644 +index f0761a4f..31873afc 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -264,7 +264,7 @@ index 107855b8..27a027e0 100644 throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); } } -@@ -106,6 +112,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -108,6 +114,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } From 0242a628e0fa21520febdfec7d2c4afa0b431deb Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 16:44:47 -0300 Subject: [PATCH 079/499] Bump version number --- .../{0013-Rebrand.patch => 0013-FlameCord-rebrand.patch} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename Waterfall-Proxy-Patches/{0013-Rebrand.patch => 0013-FlameCord-rebrand.patch} (98%) diff --git a/Waterfall-Proxy-Patches/0013-Rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch similarity index 98% rename from Waterfall-Proxy-Patches/0013-Rebrand.patch rename to Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch index 7793532d..0c23ff87 100644 --- a/Waterfall-Proxy-Patches/0013-Rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch @@ -1,7 +1,7 @@ From d4213ec9e7529f96c403a2a6af8f24b6e5aa2242 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:11:48 +0800 -Subject: [PATCH] Rebrand +Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -34,7 +34,7 @@ index a17ed68e..3e4ebfc5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.4.9"; ++ return "0.5.0"; } public void reloadMessages() From bc4a8ac3446c8ef5a4d16ba8819aa0084ef28c51 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:43:28 -0300 Subject: [PATCH 080/499] Fix possible leaks --- .../0030-Always-release-packet.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0030-Always-release-packet.patch diff --git a/Waterfall-Proxy-Patches/0030-Always-release-packet.patch b/Waterfall-Proxy-Patches/0030-Always-release-packet.patch new file mode 100644 index 00000000..a10c5ac0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0030-Always-release-packet.patch @@ -0,0 +1,46 @@ +From e00ed4d4e69f192d801c294b96a5bac11c21a344 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 1 May 2021 23:28:19 -0300 +Subject: [PATCH] Always release packet + + +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 7bf30b23..21bd5a17 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -112,12 +112,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + return; + } + +- if ( handler != null ) ++ PacketWrapper packet = (PacketWrapper) msg; ++ ++ ++ try + { +- PacketWrapper packet = (PacketWrapper) msg; +- boolean sendPacket = handler.shouldHandle( packet ); +- try ++ if ( handler != null ) + { ++ boolean sendPacket = handler.shouldHandle( packet ); + if ( sendPacket && packet.packet != null ) + { + try +@@ -132,10 +134,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + handler.handle( packet ); + } +- } finally +- { +- packet.trySingleRelease(); + } ++ } finally ++ { ++ packet.trySingleRelease(); + } + } + +-- +2.31.1 + From 1e0c94c4e55d0b126ac030fe1d287d7adc58227f Mon Sep 17 00:00:00 2001 From: 4drian3d <68704415+4drian3d@users.noreply.github.com> Date: Sun, 2 May 2021 11:34:23 -0500 Subject: [PATCH 081/499] Added process for workflows in Github Actions --- .github/workflows/flamecord-build.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/flamecord-build.yml diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml new file mode 100644 index 00000000..70d98f6f --- /dev/null +++ b/.github/workflows/flamecord-build.yml @@ -0,0 +1,32 @@ +name: Flamecord Maven Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11, 16] + + steps: + - uses: actions/checkout@v2 + - name: Setup JAVA ${{ matrix.java }} + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'adopt' + architecture: x64 + + - name: Build Flamecord + run: | + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + scripts/build.sh --jar + + - name: Upload Flamecord + uses: actions/upload-artifact@v2 + with: + name: Flamecord-JDK${{ matrix.java }} + path: Travertine-Proxy/bootstrap/target/Travertine.jar \ No newline at end of file From 69395de89d35fd71b27df945f9c837dcdb2d6b2c Mon Sep 17 00:00:00 2001 From: 4drian3d <68704415+4drian3d@users.noreply.github.com> Date: Sun, 2 May 2021 16:46:11 -0500 Subject: [PATCH 082/499] Cache Maven packages for faster builds --- .github/workflows/flamecord-build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 70d98f6f..739247a2 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -19,6 +19,13 @@ jobs: distribution: 'adopt' architecture: x64 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build Flamecord run: | git config --global user.email "you@example.com" @@ -29,4 +36,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: Flamecord-JDK${{ matrix.java }} - path: Travertine-Proxy/bootstrap/target/Travertine.jar \ No newline at end of file + path: Travertine-Proxy/bootstrap/target/Travertine.jar From 1d12a54ec16a80dc018eb3d5a37fe83fdf0ae995 Mon Sep 17 00:00:00 2001 From: 4drian3d <68704415+4drian3d@users.noreply.github.com> Date: Sun, 2 May 2021 22:32:11 -0500 Subject: [PATCH 083/499] Added Comments --- .github/workflows/flamecord-build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 739247a2..985299ee 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -1,4 +1,9 @@ -name: Flamecord Maven Build +#This workflow will perform a compilation test +#on each pull request or push to the branch master +#to check its correct compilation and will deliver +#an artifact to check if the change is working properly. + +name: FlameCord Maven Build on: [push, pull_request] @@ -6,6 +11,9 @@ jobs: build: runs-on: ubuntu-latest + #The corresponding tests are performed in the versions + #marked as Long Term Support by Java and in its + #latest version up to the moment. strategy: matrix: java: [8, 11, 16] @@ -19,6 +27,7 @@ jobs: distribution: 'adopt' architecture: x64 + #The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven packages uses: actions/cache@v2 with: @@ -32,6 +41,7 @@ jobs: git config --global user.name "Your Name" scripts/build.sh --jar + #An artifact is generated in a compressed file according to each JDK build version. - name: Upload Flamecord uses: actions/upload-artifact@v2 with: From d3240473f573c1fdd56f5d85bd08e911868481d9 Mon Sep 17 00:00:00 2001 From: 4drian3d <68704415+4drian3d@users.noreply.github.com> Date: Sat, 8 May 2021 10:46:44 -0500 Subject: [PATCH 084/499] Changes --- .github/workflows/flamecord-build.yml | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 985299ee..27a0c35b 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -1,8 +1,7 @@ -#This workflow will perform a compilation test -#on each pull request or push to the branch master -#to check its correct compilation and will deliver -#an artifact to check if the change is working properly. - +# This workflow will perform a compilation test +# on each pull request or push to the branch master +# to check its correct compilation and will deliver +# an artifact to check if the change is working properly. name: FlameCord Maven Build on: [push, pull_request] @@ -11,15 +10,17 @@ jobs: build: runs-on: ubuntu-latest - #The corresponding tests are performed in the versions - #marked as Long Term Support by Java and in its - #latest version up to the moment. + # The corresponding tests are performed in the versions + # marked as Long Term Support by Oracle and in its + # latest version up to the moment. strategy: matrix: java: [8, 11, 16] steps: - - uses: actions/checkout@v2 + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Setup JAVA ${{ matrix.java }} uses: actions/setup-java@v2 with: @@ -27,23 +28,23 @@ jobs: distribution: 'adopt' architecture: x64 - #The corresponding dependencies are stored in the cache to speed up the test. - - name: Cache Maven packages - uses: actions/cache@v2 + # The corresponding dependencies are stored in the cache to speed up the test. + - name: Cache Maven Packages + uses: actions/cache@v2.1.5 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build Flamecord + - name: Build FlameCord run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar - #An artifact is generated in a compressed file according to each JDK build version. - - name: Upload Flamecord - uses: actions/upload-artifact@v2 + # An artifact is generated in a compressed file according to each JDK build version. + - name: Upload FlameCord + uses: actions/upload-artifact@v2.2.3 with: - name: Flamecord-JDK${{ matrix.java }} + name: FlameCord-JDK${{ matrix.java }} path: Travertine-Proxy/bootstrap/target/Travertine.jar From 9279d02f841ee11824eef40b6aa6cbed2e6b8bf4 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 12 May 2021 16:41:35 +0100 Subject: [PATCH 085/499] Updated Upstream (Waterfall) 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 Waterfall Changes: eb03f06 Updated Upstream (BungeeCord) --- Waterfall | 2 +- .../0003-1.7.x-Protocol-Patch.patch | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Waterfall b/Waterfall index 8fdb6be7..eb03f062 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 8fdb6be79589080b3ebe1f6587892de9625ac55f +Subproject commit eb03f0627de7b37b4d9b6f7f796ccb5e8d4fdd0a diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 4beed3ea..995746e6 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From bc92a3b1a1f14ed5b31b8baa82e17b4ede1d8bdf Mon Sep 17 00:00:00 2001 +From 6f9d46148349b909fe4a49f5d65ca6d9f287e6cf Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -1439,10 +1439,10 @@ index 2d9c0cda5..a4c255757 100644 throw CancelSendSignal.INSTANCE; } 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 7ec119ea0..986a9d052 100644 +index 01075a85e..96df01757 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -196,6 +196,7 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkNotNull( name, "displayName" ); @@ -1450,7 +1450,7 @@ index 7ec119ea0..986a9d052 100644 displayName = name; } -@@ -497,7 +498,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -500,7 +501,8 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1460,7 +1460,7 @@ index 7ec119ea0..986a9d052 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -693,6 +695,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -696,6 +698,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1468,7 +1468,7 @@ index 7ec119ea0..986a9d052 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -705,6 +708,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -708,6 +711,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1476,7 +1476,7 @@ index 7ec119ea0..986a9d052 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -734,6 +738,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -737,6 +741,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1637,7 +1637,7 @@ index 4d7b1b23e..ad3bdee56 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index db93d8835..a3a12e19b 100644 +index db5210d16..cd0bc5a9b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap From f88913c872b6be85345232d68d7a0887752d2af0 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:09:11 +0530 Subject: [PATCH 086/499] Added an api method to unload plugins from proxy --- ...dded-an-api-method-to-unload-Plugins.patch | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch diff --git a/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch new file mode 100644 index 00000000..2283ca27 --- /dev/null +++ b/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch @@ -0,0 +1,85 @@ +From dd467f1949a6dfc2c69626bbf4e5c681e7840da8 Mon Sep 17 00:00:00 2001 +From: abhiram +Date: Thu, 13 May 2021 01:05:03 +0530 +Subject: [PATCH] Added an api method to unload Plugins + + +diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +index 90031156..3ece27c8 100644 +--- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java ++++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +@@ -25,6 +25,7 @@ import java.util.Set; + import java.util.Stack; + import java.util.jar.JarEntry; + import java.util.jar.JarFile; ++import java.util.logging.Handler; + import java.util.logging.Level; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; // Waterfall + import io.github.waterfallmc.waterfall.exception.ProxyCommandException; // Waterfall +@@ -63,6 +64,7 @@ public final class PluginManager + private Map toLoad = new HashMap<>(); + private final Multimap commandsByPlugin = ArrayListMultimap.create(); + private final Multimap listenersByPlugin = ArrayListMultimap.create(); ++ private final HashMap pluginloaders = new HashMap<>(); + + @SuppressWarnings("unchecked") + public PluginManager(ProxyServer proxy) +@@ -291,6 +293,45 @@ public final class PluginManager + return plugins.get( name ); + } + ++ ++ /** ++ * This will Unload the given plugin ++ * ++ * @param plugin to unload ++ */ ++ // FlameCord start - Adds a method to unload plugin from proxy ++ public void unloadPlugin(Plugin plugin) ++ { ++ plugin.onDisable(); ++ this.unregisterListeners(plugin); ++ this.unregisterCommands(plugin); ++ this.proxy.getScheduler().cancel(plugin); ++ ++ for ( Handler handler : plugin.getLogger().getHandlers()) ++ { ++ handler.close(); ++ } ++ ++ try ++ { ++ pluginloaders.get(plugin.getDescription().getName()).close(); ++ }catch (Exception exception) ++ { ++ exception.printStackTrace(); ++ } ++ ++ if(this.plugins.containsKey(plugin.getDescription().getName())) ++ { ++ this.plugins.remove(plugin.getDescription().getName()); ++ } ++ ++ if(this.pluginloaders.containsKey(plugin.getDescription().getName())) ++ { ++ this.pluginloaders.remove(plugin.getDescription().getName()); ++ } ++ } ++ // FlameCord end ++ + public void loadPlugins() + { + Map pluginStatuses = new HashMap<>(); +@@ -395,6 +436,9 @@ public final class PluginManager + Plugin clazz = (Plugin) main.getDeclaredConstructor().newInstance(); + + plugins.put( plugin.getName(), clazz ); ++ // FlameCord start - cache url classloaders to unload plugins ++ pluginloaders.put(plugin.getName(),loader); ++ // FlameCord end + clazz.onLoad(); + ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] + { +-- +2.26.2.windows.1 + From a6216436126addda7a62bb0a9d743a0081f0e97d Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 15 May 2021 02:51:16 +0100 Subject: [PATCH 087/499] Updated Upstream (Waterfall) 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 Waterfall Changes: fea7ec3 Updated Upstream (BungeeCord) --- Waterfall | 2 +- .../0001-POM-Changes.patch | 10 +- ...erences-from-Waterfall-to-Travertine.patch | 6 +- .../0003-1.7.x-Protocol-Patch.patch | 118 ++++++++---------- 4 files changed, 64 insertions(+), 72 deletions(-) diff --git a/Waterfall b/Waterfall index eb03f062..fea7ec35 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit eb03f0627de7b37b4d9b6f7f796ccb5e8d4fdd0a +Subproject commit fea7ec356dba6c6ac28819ff11be604af6eb484e diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index 1e108a88..a5195e94 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From ac5a18e97dbbc5cb69352de75f38895c60433503 Mon Sep 17 00:00:00 2001 +From 011203cba62c5509e045a31445b71ba1e580b8d6 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -452,7 +452,7 @@ index db15febbc..a2efb5e52 100644 diff --git a/pom.xml b/pom.xml -index 56bb4a7aa..b3ee7b0cd 100644 +index 02480a208..f61cdf375 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -480,7 +480,7 @@ index 56bb4a7aa..b3ee7b0cd 100644 2015 WaterfallMC -@@ -65,13 +65,13 @@ +@@ -66,13 +66,13 @@ @@ -535,7 +535,7 @@ index 402266ca1..993cbca95 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index ca1fc13b9..d67d1a5d3 100644 +index 602b9a93f..e2ce69e43 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -646,5 +646,5 @@ index 8ce88f4a4..813696e45 100644 compile -- -2.31.0 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index 52576e4c..1542f2c1 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,4 +1,4 @@ -From a0cb842ba495bb4bcbfe26563d873642d5a065b5 Mon Sep 17 00:00:00 2001 +From ef7431f941bfb199bc715598d33928cfa6acd98c Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine @@ -31,7 +31,7 @@ index d703d6d24..d8dcdc1e3 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2938f2f15..f7f1e7ccd 100644 +index c09f5b4c3..97de4271c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer @@ -43,7 +43,7 @@ index 2938f2f15..f7f1e7ccd 100644 try { -@@ -538,7 +538,7 @@ public class BungeeCord extends ProxyServer +@@ -539,7 +539,7 @@ public class BungeeCord extends ProxyServer @Override public String getName() { diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 995746e6..8139e913 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 6f9d46148349b909fe4a49f5d65ca6d9f287e6cf Mon Sep 17 00:00:00 2001 +From 149ae54e143d770bc04b5cc1c358210abf77160f Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -154,10 +154,10 @@ index d4b038434..9aac7ca9f 100644 } } 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 -index 0dffc8d23..ff671706d 100644 +index d2a11a826..2cc0f825b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -55,7 +55,7 @@ public enum Protocol +@@ -58,7 +58,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, // Waterfall - speed up packet construction @@ -166,7 +166,7 @@ index 0dffc8d23..ff671706d 100644 ); } }, -@@ -67,7 +67,7 @@ public enum Protocol +@@ -70,7 +70,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, // Waterfall - speed up packet construction @@ -175,7 +175,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -78,7 +78,7 @@ public enum Protocol +@@ -82,7 +82,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, // Waterfall - speed up packet construction @@ -184,7 +184,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -88,7 +88,7 @@ public enum Protocol +@@ -93,7 +93,7 @@ public enum Protocol TO_CLIENT.registerPacket( Chat.class, Chat::new, // Waterfall - speed up packet construction @@ -193,7 +193,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -97,7 +97,7 @@ public enum Protocol +@@ -103,7 +103,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, // Waterfall - speed up packet construction @@ -202,7 +202,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -118,20 +118,19 @@ public enum Protocol +@@ -126,20 +126,19 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, // Waterfall - speed up packet construction @@ -226,7 +226,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -143,7 +142,7 @@ public enum Protocol +@@ -152,7 +151,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, // Waterfall - speed up packet construction @@ -235,7 +235,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -153,7 +152,7 @@ public enum Protocol +@@ -163,7 +162,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, // Waterfall - speed up packet construction @@ -244,7 +244,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -164,7 +163,7 @@ public enum Protocol +@@ -175,7 +174,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, // Waterfall - speed up packet construction @@ -253,7 +253,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -175,7 +174,7 @@ public enum Protocol +@@ -187,7 +186,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, // Waterfall - speed up packet construction @@ -262,7 +262,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -186,7 +185,7 @@ public enum Protocol +@@ -199,7 +198,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, // Waterfall - speed up packet construction @@ -271,7 +271,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -197,7 +196,7 @@ public enum Protocol +@@ -211,7 +210,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet construction @@ -280,7 +280,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -208,7 +207,7 @@ public enum Protocol +@@ -223,7 +222,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, // Waterfall - speed up packet construction @@ -289,7 +289,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -219,7 +218,7 @@ public enum Protocol +@@ -235,7 +234,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, // Waterfall - speed up packet construction @@ -298,7 +298,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -230,7 +229,7 @@ public enum Protocol +@@ -257,7 +256,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, // Waterfall - speed up packet construction @@ -307,7 +307,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -243,7 +242,7 @@ public enum Protocol +@@ -271,7 +270,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, // Waterfall - speed up packet construction @@ -316,7 +316,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -277,7 +276,7 @@ public enum Protocol +@@ -309,7 +308,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, // Waterfall - speed up packet construction @@ -325,7 +325,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -288,7 +287,7 @@ public enum Protocol +@@ -321,7 +320,7 @@ public enum Protocol TO_SERVER.registerPacket( Chat.class, Chat::new, // Waterfall - speed up packet construction @@ -334,7 +334,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -297,7 +296,7 @@ public enum Protocol +@@ -330,7 +329,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, // Waterfall - speed up packet construction @@ -343,7 +343,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -307,7 +306,7 @@ public enum Protocol +@@ -340,7 +339,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, // Waterfall - speed up packet construction @@ -352,7 +352,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -316,7 +315,7 @@ public enum Protocol +@@ -349,7 +348,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, // Waterfall - speed up packet construction @@ -361,7 +361,7 @@ index 0dffc8d23..ff671706d 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -333,23 +332,23 @@ public enum Protocol +@@ -367,23 +366,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, // Waterfall - speed up packet construction @@ -389,7 +389,7 @@ index 0dffc8d23..ff671706d 100644 ); } }, -@@ -361,22 +360,22 @@ public enum Protocol +@@ -395,22 +394,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, // Waterfall - speed up packet construction @@ -416,7 +416,7 @@ index 0dffc8d23..ff671706d 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -387,12 +386,12 @@ public enum Protocol +@@ -421,12 +420,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, // Waterfall - speed up packet construction @@ -431,7 +431,7 @@ index 0dffc8d23..ff671706d 100644 ); TO_SERVER.registerPacket( LoginPayloadResponse.class, -@@ -512,7 +511,11 @@ public enum Protocol +@@ -546,7 +545,11 @@ public enum Protocol } if ( !hasPacket(id, supportsForge) ) { @@ -445,35 +445,35 @@ index 0dffc8d23..ff671706d 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index 2202c4d3d..6600185b5 100644 +index 391443ca9..6cc77635b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -@@ -6,6 +6,8 @@ import java.util.List; - public class ProtocolConstants +@@ -7,6 +7,8 @@ public class ProtocolConstants { + private static final boolean SNAPSHOT_SUPPORT = Boolean.getBoolean( "net.md_5.bungee.protocol.snapshot" ); + public static final int MINECRAFT_1_7_2 = 4; + public static final int MINECRAFT_1_7_6 = 5; public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -34,6 +36,7 @@ public class ProtocolConstants - public static final int MINECRAFT_1_16_3 = 753; - public static final int MINECRAFT_1_16_4 = 754; - public static final List SUPPORTED_VERSIONS = Arrays.asList( -+ "1.7.x", - "1.8.x", - "1.9.x", - "1.10.x", -@@ -45,6 +48,8 @@ public class ProtocolConstants - "1.16.x" - ); - public static final List SUPPORTED_VERSION_IDS = Arrays.asList( -+ ProtocolConstants.MINECRAFT_1_7_2, -+ ProtocolConstants.MINECRAFT_1_7_6, - ProtocolConstants.MINECRAFT_1_8, - ProtocolConstants.MINECRAFT_1_9, - ProtocolConstants.MINECRAFT_1_9_1, +@@ -41,6 +43,7 @@ public class ProtocolConstants + static + { + ImmutableList.Builder supportedVersions = ImmutableList.builder().add( ++ "1.7.x", + "1.8.x", + "1.9.x", + "1.10.x", +@@ -52,6 +55,8 @@ public class ProtocolConstants + "1.16.x" + ); + ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( ++ ProtocolConstants.MINECRAFT_1_7_2, ++ ProtocolConstants.MINECRAFT_1_7_6, + ProtocolConstants.MINECRAFT_1_8, + ProtocolConstants.MINECRAFT_1_9, + ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java index c0d371426..a07e25b1f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -558,7 +558,7 @@ index 828a5dbe6..195ec0886 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 9daf7a737..b7640fcbf 100644 +index 886cb9168..e453d36c9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -1,5 +1,7 @@ @@ -578,9 +578,9 @@ index 9daf7a737..b7640fcbf 100644 { private String locale; -@@ -24,6 +26,19 @@ public class ClientSettings extends DefinedPacket - private byte skinParts; +@@ -25,6 +27,19 @@ public class ClientSettings extends DefinedPacket private int mainHand; + private boolean disableTextFiltering; + // Travertine start + @Override @@ -598,7 +598,7 @@ index 9daf7a737..b7640fcbf 100644 @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -@@ -58,6 +73,19 @@ public class ClientSettings extends DefinedPacket +@@ -67,6 +82,19 @@ public class ClientSettings extends DefinedPacket } } @@ -1284,7 +1284,7 @@ index a5555f6af..415a4bcde 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index f7f1e7ccd..a17ed68ec 100644 +index 97de4271c..3b0dff080 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1303,18 +1303,10 @@ index f7f1e7ccd..a17ed68ec 100644 private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 494213db8..1d89acf5b 100644 +index 1d377a655..6c7d4abb4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -@@ -5,6 +5,7 @@ import net.md_5.bungee.api.chat.BaseComponent; - import net.md_5.bungee.api.connection.ProxiedPlayer; - import net.md_5.bungee.chat.ComponentSerializer; - import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.Title.Action; - - public class BungeeTitle implements Title -@@ -151,6 +152,7 @@ public class BungeeTitle implements Title +@@ -183,6 +183,7 @@ public class BungeeTitle implements Title @Override public Title send(ProxiedPlayer player) { @@ -1637,7 +1629,7 @@ index 4d7b1b23e..ad3bdee56 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index db5210d16..cd0bc5a9b 100644 +index 13456b341..44066317a 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,10 @@ public abstract class EntityMap From fb971d4bfa6f64c1baaf2bd91b8fd18bd72f3375 Mon Sep 17 00:00:00 2001 From: abhiram Date: Sat, 15 May 2021 14:03:36 +0530 Subject: [PATCH 088/499] Format Code to Bungee's Code Style --- ...2-Format-Code-to-Bungee-s-code-style.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch diff --git a/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch b/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch new file mode 100644 index 00000000..dabf9800 --- /dev/null +++ b/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch @@ -0,0 +1,63 @@ +From 97a8cb2fb8c5b348efd614bb4fd952c0c42caac0 Mon Sep 17 00:00:00 2001 +From: abhiram +Date: Sat, 15 May 2021 13:58:21 +0530 +Subject: [PATCH] Format Code to Bungee's code style + + +diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +index 3ece27c8..a190dfae 100644 +--- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java ++++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +@@ -303,31 +303,31 @@ public final class PluginManager + public void unloadPlugin(Plugin plugin) + { + plugin.onDisable(); +- this.unregisterListeners(plugin); +- this.unregisterCommands(plugin); +- this.proxy.getScheduler().cancel(plugin); ++ this.unregisterListeners( plugin ); ++ this.unregisterCommands( plugin ); ++ this.proxy.getScheduler().cancel( plugin ); + +- for ( Handler handler : plugin.getLogger().getHandlers()) ++ for ( Handler handler : plugin.getLogger().getHandlers() ) + { + handler.close(); + } + + try + { +- pluginloaders.get(plugin.getDescription().getName()).close(); ++ pluginloaders.get( plugin.getDescription().getName() ).close(); + }catch (Exception exception) + { + exception.printStackTrace(); + } + +- if(this.plugins.containsKey(plugin.getDescription().getName())) ++ if( this.plugins.containsKey( plugin.getDescription().getName() ) ) + { +- this.plugins.remove(plugin.getDescription().getName()); ++ this.plugins.remove( plugin.getDescription().getName() ); + } + +- if(this.pluginloaders.containsKey(plugin.getDescription().getName())) ++ if( this.pluginloaders.containsKey( plugin.getDescription().getName() ) ) + { +- this.pluginloaders.remove(plugin.getDescription().getName()); ++ this.pluginloaders.remove( plugin.getDescription().getName() ); + } + } + // FlameCord end +@@ -437,7 +437,7 @@ public final class PluginManager + + plugins.put( plugin.getName(), clazz ); + // FlameCord start - cache url classloaders to unload plugins +- pluginloaders.put(plugin.getName(),loader); ++ pluginloaders.put( plugin.getName(),loader ); + // FlameCord end + clazz.onLoad(); + ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] +-- +2.26.2.windows.1 + From f48afa62bdb610d931336e0dc506d347256488b7 Mon Sep 17 00:00:00 2001 From: abhiram Date: Sat, 15 May 2021 15:40:44 +0530 Subject: [PATCH 089/499] Add changes in single patch file --- ...dded-an-api-method-to-unload-Plugins.patch | 25 ++++---- ...2-Format-Code-to-Bungee-s-code-style.patch | 63 ------------------- 2 files changed, 13 insertions(+), 75 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch diff --git a/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch index 2283ca27..5a12408e 100644 --- a/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch @@ -1,11 +1,12 @@ -From dd467f1949a6dfc2c69626bbf4e5c681e7840da8 Mon Sep 17 00:00:00 2001 +From 14c353d7490b306ac6b9caee45b8d8eec824c128 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins +Format Code to Bungee's code style diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156..3ece27c8 100644 +index 90031156..a190dfae 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -25,6 +25,7 @@ import java.util.Set; @@ -38,31 +39,31 @@ index 90031156..3ece27c8 100644 + public void unloadPlugin(Plugin plugin) + { + plugin.onDisable(); -+ this.unregisterListeners(plugin); -+ this.unregisterCommands(plugin); -+ this.proxy.getScheduler().cancel(plugin); ++ this.unregisterListeners( plugin ); ++ this.unregisterCommands( plugin ); ++ this.proxy.getScheduler().cancel( plugin ); + -+ for ( Handler handler : plugin.getLogger().getHandlers()) ++ for ( Handler handler : plugin.getLogger().getHandlers() ) + { + handler.close(); + } + + try + { -+ pluginloaders.get(plugin.getDescription().getName()).close(); ++ pluginloaders.get( plugin.getDescription().getName() ).close(); + }catch (Exception exception) + { + exception.printStackTrace(); + } + -+ if(this.plugins.containsKey(plugin.getDescription().getName())) ++ if( this.plugins.containsKey( plugin.getDescription().getName() ) ) + { -+ this.plugins.remove(plugin.getDescription().getName()); ++ this.plugins.remove( plugin.getDescription().getName() ); + } + -+ if(this.pluginloaders.containsKey(plugin.getDescription().getName())) ++ if( this.pluginloaders.containsKey( plugin.getDescription().getName() ) ) + { -+ this.pluginloaders.remove(plugin.getDescription().getName()); ++ this.pluginloaders.remove( plugin.getDescription().getName() ); + } + } + // FlameCord end @@ -75,7 +76,7 @@ index 90031156..3ece27c8 100644 plugins.put( plugin.getName(), clazz ); + // FlameCord start - cache url classloaders to unload plugins -+ pluginloaders.put(plugin.getName(),loader); ++ pluginloaders.put( plugin.getName(),loader ); + // FlameCord end clazz.onLoad(); ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] diff --git a/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch b/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch deleted file mode 100644 index dabf9800..00000000 --- a/Waterfall-Proxy-Patches/0032-Format-Code-to-Bungee-s-code-style.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 97a8cb2fb8c5b348efd614bb4fd952c0c42caac0 Mon Sep 17 00:00:00 2001 -From: abhiram -Date: Sat, 15 May 2021 13:58:21 +0530 -Subject: [PATCH] Format Code to Bungee's code style - - -diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 3ece27c8..a190dfae 100644 ---- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -+++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -@@ -303,31 +303,31 @@ public final class PluginManager - public void unloadPlugin(Plugin plugin) - { - plugin.onDisable(); -- this.unregisterListeners(plugin); -- this.unregisterCommands(plugin); -- this.proxy.getScheduler().cancel(plugin); -+ this.unregisterListeners( plugin ); -+ this.unregisterCommands( plugin ); -+ this.proxy.getScheduler().cancel( plugin ); - -- for ( Handler handler : plugin.getLogger().getHandlers()) -+ for ( Handler handler : plugin.getLogger().getHandlers() ) - { - handler.close(); - } - - try - { -- pluginloaders.get(plugin.getDescription().getName()).close(); -+ pluginloaders.get( plugin.getDescription().getName() ).close(); - }catch (Exception exception) - { - exception.printStackTrace(); - } - -- if(this.plugins.containsKey(plugin.getDescription().getName())) -+ if( this.plugins.containsKey( plugin.getDescription().getName() ) ) - { -- this.plugins.remove(plugin.getDescription().getName()); -+ this.plugins.remove( plugin.getDescription().getName() ); - } - -- if(this.pluginloaders.containsKey(plugin.getDescription().getName())) -+ if( this.pluginloaders.containsKey( plugin.getDescription().getName() ) ) - { -- this.pluginloaders.remove(plugin.getDescription().getName()); -+ this.pluginloaders.remove( plugin.getDescription().getName() ); - } - } - // FlameCord end -@@ -437,7 +437,7 @@ public final class PluginManager - - plugins.put( plugin.getName(), clazz ); - // FlameCord start - cache url classloaders to unload plugins -- pluginloaders.put(plugin.getName(),loader); -+ pluginloaders.put( plugin.getName(),loader ); - // FlameCord end - clazz.onLoad(); - ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] --- -2.26.2.windows.1 - From ca4c46bfb69433e4474ac5c0a7bdaf886a899867 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 18 May 2021 03:29:06 +0100 Subject: [PATCH 090/499] Updated Upstream (Waterfall) 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 Waterfall Changes: ab89372 Updated Upstream (BungeeCord) (#641) 72dbe47 Updated Upstream (BungeeCord) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index fea7ec35..ab893721 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit fea7ec356dba6c6ac28819ff11be604af6eb484e +Subproject commit ab893721bd3b6e12ee9c8cf31532079d4730583a From bd55a2027758c86554bbb578bde3e0e9453e87e6 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 18 May 2021 22:04:15 +0200 Subject: [PATCH 091/499] Fix patch 0006 --- Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch index 26d56804..92940b50 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -58,9 +58,9 @@ diff --git a/pom.xml b/pom.xml index b3ee7b0c..3efafa0a 100644 --- a/pom.xml +++ b/pom.xml -@@ -62,6 +62,9 @@ - proxy +@@ -63,6 +63,9 @@ query + native + + flamecord From 8de7440302329bfc69092199754726e332157445 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 18:56:07 -0300 Subject: [PATCH 092/499] Added new DoS preventions --- .../0006-FlameCord-POM-Changes.patch | 8 +- .../0009-Remove-Quitting-reason.patch | 6 +- .../0013-FlameCord-rebrand.patch | 8 +- ...ateException-to-QuietException-and-e.patch | 8 +- .../0023-FlameCord-General-Patch.patch | 14 +-- .../0024-FlameCord-module-system.patch | 10 +- ...0025-FlameCord-message-configuration.patch | 6 +- .../0026-Fix-ByteBuf-memory-leaks.patch | 6 +- .../0032-Apply-buffer-limits.patch | 99 +++++++++++++++++++ .../0033-Limit-String-read.patch | 28 ++++++ 10 files changed, 160 insertions(+), 33 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch create mode 100644 Waterfall-Proxy-Patches/0033-Limit-String-read.patch diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch index 92940b50..f0a13814 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From e7fc466ed3d7145d113719892953cbcabd6c4b6a Mon Sep 17 00:00:00 2001 +From 2d04ddc88508fef44e738bad09a805d84b86201a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -55,7 +55,7 @@ index 00000000..ca88559e + + diff --git a/pom.xml b/pom.xml -index b3ee7b0c..3efafa0a 100644 +index aa57fe03..23153179 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,9 @@ @@ -88,10 +88,10 @@ index 993cbca9..3867501a 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index d67d1a5d..3fb14feb 100644 +index 5dfc6f51..8fb07275 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -143,6 +143,51 @@ +@@ -150,6 +150,51 @@ runtime diff --git a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch index 1434e57f..d6bf9cfd 100644 --- a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch +++ b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch @@ -1,4 +1,4 @@ -From 311cd787abe702b9ed4179effa2aa9fd1bc9c53f Mon Sep 17 00:00:00 2001 +From 13fb2edfae12310bd656afc2a67208c856de6b1b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:03:12 +0800 Subject: [PATCH] Remove "Quitting" reason @@ -37,10 +37,10 @@ index 00749538..7b99c466 100644 bungee.getLogger().warning( "No client connected for pending server!" ); return; 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 986a9d05..6cc520c9 100644 +index 96df0175..fc1798fb 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -425,7 +425,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -428,7 +428,8 @@ public final class UserConnection implements ProxiedPlayer if ( server != null ) { server.setObsolete( true ); diff --git a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch index 0c23ff87..37f3604b 100644 --- a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From d4213ec9e7529f96c403a2a6af8f24b6e5aa2242 Mon Sep 17 00:00:00 2001 +From af418e4ac240fa80ec84bf88b6089e0b494b2204 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:11:48 +0800 Subject: [PATCH] FlameCord rebrand @@ -19,10 +19,10 @@ index 527f310e..a4ef6d3b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a17ed68e..3e4ebfc5 100644 +index 3b0dff08..41d752a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -546,13 +546,13 @@ public class BungeeCord extends ProxyServer +@@ -547,13 +547,13 @@ public class BungeeCord extends ProxyServer @Override public String getName() { @@ -52,5 +52,5 @@ index 4e2c6129..aeda7963 100644 } } -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch index 48ff57c7..dec99640 100644 --- a/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 8918151068bb611b3d455693ccea42387cbd3719 Mon Sep 17 00:00:00 2001 +From d17df93a12dd7fc3bdda514ccfdd96041f8a9e88 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 6cc520c9..159119c1 100644 +index fc1798fb..db3d9c86 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -307,7 +307,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -310,7 +310,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { @@ -20,5 +20,5 @@ index 6cc520c9..159119c1 100644 return; } -- -2.20.1 +2.31.1 diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch index 01d04b39..fa5fa300 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From c9bb2cb6c47e65758d3ee91dbca7df360198b89e Mon Sep 17 00:00:00 2001 +From 05af8ef64d93e186b1568e60596935c70b260259 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 5d385706..301763f1 100644 +index 41d752a5..61c2e52a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; @@ -217,7 +217,7 @@ index 5d385706..301763f1 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -232,11 +241,12 @@ public class BungeeCord extends ProxyServer +@@ -233,11 +242,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -235,7 +235,7 @@ index 5d385706..301763f1 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -285,6 +295,15 @@ public class BungeeCord extends ProxyServer +@@ -286,6 +296,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -251,7 +251,7 @@ index 5d385706..301763f1 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -576,9 +595,7 @@ public class BungeeCord extends ProxyServer +@@ -577,9 +596,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -285,7 +285,7 @@ index 7b99c466..522bd93d 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 159119c1..7c4c8f8a 100644 +index db3d9c86..bc365e8b 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -304,7 +304,7 @@ index 159119c1..7c4c8f8a 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -387,9 +389,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -390,9 +392,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch index 330a52bd..7df216b3 100644 --- a/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From e91832380cb724413372a27c547468be2bf74a26 Mon Sep 17 00:00:00 2001 +From 2b17b5973a9618e4f4939c801d47e34a43c26477 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 301763f1..ed3e3e12 100644 +index 61c2e52a..a862f0a2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; @@ -145,7 +145,7 @@ index 301763f1..ed3e3e12 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -285,9 +286,10 @@ public class BungeeCord extends ProxyServer +@@ -286,9 +287,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -158,7 +158,7 @@ index 301763f1..ed3e3e12 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -303,6 +305,7 @@ public class BungeeCord extends ProxyServer +@@ -304,6 +306,7 @@ public class BungeeCord extends ProxyServer } FlameCord.renew(logger, whitelistedAddresses); @@ -166,7 +166,7 @@ index 301763f1..ed3e3e12 100644 if ( config.isForgeSupport() ) { -@@ -832,4 +835,56 @@ public class BungeeCord extends ProxyServer +@@ -833,4 +836,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch index 8920bbc1..f15c0278 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 3e0122018b5350b1d9c1ee5c56f319c06c05e730 Mon Sep 17 00:00:00 2001 +From b2c9244be507307e1f490b2dfb53f8021d81fd85 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -209,10 +209,10 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ed3e3e12..83d3e9ed 100644 +index a862f0a2..fb19d5dc 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -595,14 +595,8 @@ public class BungeeCord extends ProxyServer +@@ -596,14 +596,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { diff --git a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch index 4cefa663..f9c38ba7 100644 --- a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 5580b156711771e38a5a3a3557581d7358abeea6 Mon Sep 17 00:00:00 2001 +From 5bfb9c26b611a8268bfc97fd869d1a410f812adc Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks @@ -60,10 +60,10 @@ index 474551d3..8716d0c8 100644 { return; diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a3a12e19..214a1fd0 100644 +index 44066317..e4b97490 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -143,11 +143,17 @@ public abstract class EntityMap +@@ -145,11 +145,17 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); diff --git a/Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch b/Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch new file mode 100644 index 00000000..c74af6a6 --- /dev/null +++ b/Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch @@ -0,0 +1,99 @@ +From 9b03768079f2ac841fa87e3e10d3808b7bc3cae3 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 19 May 2021 12:56:29 -0300 +Subject: [PATCH] Apply buffer limits + + +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index fb19d5dc..7c5af95b 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -378,6 +378,9 @@ public class BungeeCord extends ProxyServer + } + } + }; ++ ++ int bufferSize = 65536; // FlameCord ++ + new ServerBootstrap() + .channel( PipelineUtils.getServerChannel( info.getSocketAddress() ) ) + .option( ChannelOption.SO_REUSEADDR, true ) // TODO: Move this elsewhere! +@@ -385,6 +388,8 @@ public class BungeeCord extends ProxyServer + .childHandler( PipelineUtils.SERVER_CHILD ) + .group( bossEventLoopGroup, workerEventLoopGroup ) + .localAddress( info.getSocketAddress() ) ++ .childOption(ChannelOption.SO_RCVBUF, bufferSize) // FlameCord ++ .childOption(ChannelOption.SO_SNDBUF, bufferSize) // FlameCord + .bind().addListener( listener ); + + if ( info.isQueryEnabled() ) +diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java +index 37657c4c..ba31471e 100644 +--- a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java ++++ b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java +@@ -2,6 +2,7 @@ package net.md_5.bungee.http; + + import io.netty.channel.Channel; + import io.netty.channel.ChannelInitializer; ++import io.netty.channel.ChannelOption; + import io.netty.handler.codec.http.HttpClientCodec; + import io.netty.handler.ssl.SslContextBuilder; + import io.netty.handler.ssl.SslHandler; +@@ -23,6 +24,11 @@ public class HttpInitializer extends ChannelInitializer + @Override + protected void initChannel(Channel ch) throws Exception + { ++ int bufferSize = 65536; // FlameCord ++ ++ ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord ++ ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord ++ + ch.pipeline().addLast( "timeout", new ReadTimeoutHandler( HttpClient.TIMEOUT, TimeUnit.MILLISECONDS ) ); + if ( ssl ) + { +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 a6722b41..5de2e6ef 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 +@@ -207,6 +207,11 @@ public class PipelineUtils + { + // IP_TOS is not supported (Windows XP / Windows Server 2003) + } ++ ++ int bufferSize = 65536; // FlameCord ++ ++ ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord ++ ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord + ch.config().setOption( ChannelOption.TCP_NODELAY, true ); + ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); + ch.config().setWriteBufferWaterMark( MARK ); +diff --git a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java +index 8becc26a..8304685c 100644 +--- a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java ++++ b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java +@@ -1,5 +1,6 @@ + package net.md_5.bungee.query; + ++import io.netty.channel.ChannelOption; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; +@@ -18,11 +19,15 @@ public class RemoteQuery + + public void start(Class channel, InetSocketAddress address, EventLoopGroup eventLoop, ChannelFutureListener future) + { ++ int bufferSize = 65536; // FlameCord ++ + new Bootstrap() + .channel( channel ) + .group( eventLoop ) + .handler( new QueryHandler( bungee, listener ) ) + .localAddress( address ) ++ .option(ChannelOption.SO_RCVBUF, bufferSize) // FlameCord ++ .option(ChannelOption.SO_SNDBUF, bufferSize) // FlameCord + .bind().addListener( future ); + } + } +-- +2.31.1 + diff --git a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch new file mode 100644 index 00000000..b4e893aa --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch @@ -0,0 +1,28 @@ +From d3c5c858620aaeb2d94ce29c15fa87cb39156e51 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 19 May 2021 15:40:41 -0300 +Subject: [PATCH] Limit String read + + +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 +index 93d17f6b..dfcba274 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +@@ -36,12 +36,13 @@ public abstract class DefinedPacket + + public static String readString(ByteBuf buf) + { +- return readString( buf, Short.MAX_VALUE ); ++ return readString( buf, 1024 ); // FlameCord + } + + public static String readString(ByteBuf buf, int maxLen) + { + int len = readVarInt( buf ); ++ + if ( len > maxLen * 4 ) + { + if(!MinecraftDecoder.DEBUG) throw STRING_TOO_MANY_BYTES_EXCEPTION; // Waterfall start: Additional DoS mitigations +-- +2.31.1 + From d8d039611b7a7952546d4ed7978633798f4e503f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 19:29:10 -0300 Subject: [PATCH 093/499] Bump version number --- Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch index 37f3604b..836e2722 100644 --- a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch @@ -34,7 +34,7 @@ index 3b0dff08..41d752a5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.0"; ++ return "0.5.1"; } public void reloadMessages() From f99092c028ff04dada4d677cdfe8b5b1c54af788 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 22:38:23 -0300 Subject: [PATCH 094/499] Fix Forge support --- .../0026-Fix-ByteBuf-memory-leaks.patch | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch index f9c38ba7..d78eba44 100644 --- a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 5bfb9c26b611a8268bfc97fd869d1a410f812adc Mon Sep 17 00:00:00 2001 +From 70d54b4ecbdca409826513d00c0a4d53d6603a11 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks @@ -130,10 +130,10 @@ index 6755fe84..21871d14 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206..2cd5740c 100644 +index cefa0206..cede3994 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -@@ -38,15 +38,27 @@ public class ForgeUtils +@@ -38,15 +38,22 @@ public class ForgeUtils { Map modTags = new HashMap<>(); ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); @@ -151,15 +151,10 @@ index cefa0206..2cd5740c 100644 - modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); + ByteBuf buffer = payload.slice(); + -+ try { -+ int modCount = DefinedPacket.readVarInt( buffer, 2 ); -+ for ( int i = 0; i < modCount; i++ ) -+ { -+ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ } -+ } finally ++ int modCount = DefinedPacket.readVarInt( buffer, 2 ); ++ for ( int i = 0; i < modCount; i++ ) + { -+ buffer.release(); ++ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); + } } + } finally { From 2a39c779c636338e514fd548aa5afa9fb6622a85 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 22:39:11 -0300 Subject: [PATCH 095/499] Bump version number --- Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch index 836e2722..478c4d28 100644 --- a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch @@ -34,7 +34,7 @@ index 3b0dff08..41d752a5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.1"; ++ return "0.5.2"; } public void reloadMessages() From fda6c89c35449e5a817bae4e1439c32abc1e0d67 Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Wed, 19 May 2021 21:09:18 -0500 Subject: [PATCH 096/499] Updated CONTRIBUTING.md --- CONTRIBUTING.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6418a141..6791932d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,33 +1,33 @@ -Contributing to Travertine +Contributing to FlameCord ========================== WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. ## Understanding Patches -Patches to Travertine are very simple, but center around the directory 'Travertine-Proxy' +Patches to FlameCord are very simple, but center around the directory 'Travertine-Proxy' Assuming you already have forked the repository: 1. Pull the latest changes from the main repository -2. Type `./travertine p` in git bash to apply the changes from upstream +2. Type `./flamecord p` in git bash to apply the changes from upstream 3. cd into `Travertine-Proxy` for proxy changes This directory is not a git repository in the traditional sense: - Every single commit in Travertine-Proxy is a patch. -- 'origin/master' points to a directory similar to Travertine-Proxy but for Travertine -- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that Travertine, Waterfall, and Bungeecord don't +- 'origin/master' points to a directory similar to Travertine-Proxy but for FlameCord +- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, Travertine, Waterfall, and Bungeecord don't - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update Travertine ## Adding Patches -Adding patches to Travertine is very simple: +Adding patches to FlameCord is very simple: 1. Modify `Travertine-Proxy` with the appropriate changes 2. Type `git add .` to add your changes 3. Run `git commit` with the desired patch message -4. Run `./travertine rb` in the main directory to convert your commit into a new patch +4. Run `./flamecord rb` in the main directory to convert your commit into a new patch 5. PR your patches back to this repository -Your commit will be converted into a patch that you can then PR into Travertine +Your commit will be converted into a patch that you can then PR into FlameCord ## Modifying Patches Modifying previous patches is a bit more complex: @@ -47,7 +47,7 @@ This method works by temporarily resetting HEAD to the desired commit to edit us - **MAKE SURE TO ADD `--amend`** or else a new patch will be created. - You can also modify the commit message here. 7. Type `git rebase --continue` to finish rebasing. -8. Type `./travertine rb` in the main directory. +8. Type `./flamecord rb` in the main directory. - This will modify the appropriate patches based on your commits. 9. PR your modifications back to this project. @@ -58,27 +58,27 @@ If you are simply editing a more recent commit or your change is small, simply m 2. Make a temporary commit. You don't need to make a message for this. 3. Type `git rebase -i upstream/upstream`, move (cut) your temporary commit and move it under the line of the patch you wish to modify. 4. Change the `pick` with `f` (fixup) or `s` (squash) if you need to edit the commit message -5. Type `./travertine rb` in the main directory. +5. Type `./flamecord rb` in the main directory. - This will modify the appropriate patches based on your commits. 6. PR your modifications to github ## PR Policy -We'll accept changes that make sense. You should be able to justify their existence, along with any maintenance costs that come with them. Remember, these changes will affect everyone who runs Travertine, not just you and your server. +We'll accept changes that make sense. You should be able to justify their existence, along with any maintenance costs that come with them. Remember, these changes will affect everyone who runs FlameCord, not just you and your server. While we will fix minor formatting issues, you should stick to the guide below when making and submitting changes. ## Formatting -All modifications to non-Travertine files should be marked -- Multi line changes start with `// Travertine start` and end with `// Travertine end` -- You can put a messages with a change if it isn't obvious, like this: `// Travertine start - reason +All modifications to non-FlameCord files should be marked +- Multi line changes start with `// FlameCord start` and end with `// FlameCord end` +- You can put a messages with a change if it isn't obvious, like this: `// FlameCord start - reason - Should generally be about the reason the change was made, what it was before, or what the change is - - Multi-line messages should start with `// Travertine start` and use `/* Multi line message here */` for the message itself -- Single line changes should have `// Travertine` or `// Travertine - reason` + - Multi-line messages should start with `// FlameCord start` and use `/* Multi line message here */` for the message itself +- Single line changes should have `// FlameCord` or `// FlameCord - reason` - For example: ````java -return getConfig().getNotStupid(); // Travertine - was return getConfig().getStupid(); +return getConfig().getNotStupid(); // FlameCord - was return getConfig().getStupid(); -// Travertine start +// FlameCord start // con.disconnect( bungee.getTranslation( "lost_connection" ) ); ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), TextComponent.fromLegacyText( bungee.getTranslation( "lost_connection" ) ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.LOST_CONNECTION ) ); @@ -91,7 +91,7 @@ else { con.disconnect0( event.getKickReasonComponent() ); } -// Travertine end +// FlameCord end ```` - We generally follow usual java style, or what is programmed into most IDEs and formatters by default - This is also known as oracle style From 0074fa032f0bf9eef2a4dbe5c8a7bef90675301c Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Wed, 19 May 2021 21:26:05 -0500 Subject: [PATCH 097/499] Added comment in README with compilation step --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0d6f693e..ffa800c9 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ FlameCord is a patch for Travertine to fix possible exploits and add useful func FlameCord is compiled like Travertine does; Please follow the CONTRIBUTING.md file. If you need help you can always contact us on Discord. +To compile FlameCord you need the same requirements as Travertine, and run the command `./flamecord b` to get the corresponding jar. + Travertine [![Build Status](https://papermc.io/ci/job/Travertine/badge/icon)](https://papermc.io/ci/job/Travertine/) From 3394b2e9d66c70ad401a23658f25396674ba6c8c Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 21 May 2021 00:24:43 -0300 Subject: [PATCH 098/499] Increased string limit --- Waterfall-Proxy-Patches/0033-Limit-String-read.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch index b4e893aa..6f6b83b6 100644 --- a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch +++ b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch @@ -1,11 +1,11 @@ -From d3c5c858620aaeb2d94ce29c15fa87cb39156e51 Mon Sep 17 00:00:00 2001 +From 01ec864075a0abd0084167e9e72e632f254de58f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 15:40:41 -0300 Subject: [PATCH] Limit String read 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 -index 93d17f6b..dfcba274 100644 +index 93d17f6b..dd663e1d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -36,12 +36,13 @@ public abstract class DefinedPacket @@ -13,7 +13,7 @@ index 93d17f6b..dfcba274 100644 public static String readString(ByteBuf buf) { - return readString( buf, Short.MAX_VALUE ); -+ return readString( buf, 1024 ); // FlameCord ++ return readString( buf, 4096 ); // FlameCord } public static String readString(ByteBuf buf, int maxLen) From 2008eced272d43246b76c2cbe6bf5858ddfdc41c Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 21 May 2021 09:09:56 +0100 Subject: [PATCH 099/499] Updated Upstream (Waterfall) 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 Waterfall Changes: 5d64a21 Updated Upstream (BungeeCord) f7c7b48 Updated Upstream (BungeeCord) (#643) --- Waterfall | 2 +- ...ame-references-from-Waterfall-to-Travertine.patch | 6 +++--- .../0003-1.7.x-Protocol-Patch.patch | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Waterfall b/Waterfall index ab893721..5d64a217 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit ab893721bd3b6e12ee9c8cf31532079d4730583a +Subproject commit 5d64a21724a931a651b21191b8785ed65bbca489 diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch index 1542f2c1..bc8a74a7 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch @@ -1,4 +1,4 @@ -From ef7431f941bfb199bc715598d33928cfa6acd98c Mon Sep 17 00:00:00 2001 +From a5f023bb3c21941eaf45f1c8946b719d0752590e Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to Travertine @@ -53,10 +53,10 @@ index c09f5b4c3..97de4271c 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 771b37258..6a5193feb 100644 +index 356805285..1c2628d31 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -71,7 +71,7 @@ public class BungeeCordLauncher +@@ -76,7 +76,7 @@ public class BungeeCordLauncher BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch index 8139e913..df8872c6 100644 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch @@ -1,4 +1,4 @@ -From 149ae54e143d770bc04b5cc1c358210abf77160f Mon Sep 17 00:00:00 2001 +From 6e2a427f8fc248bd661af13272a4922a2e0ba94d Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 10:31:04 -0500 Subject: [PATCH] 1.7.x Protocol Patch @@ -445,7 +445,7 @@ index d2a11a826..2cc0f825b 100644 java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction 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 -index 391443ca9..6cc77635b 100644 +index 8c3a78d60..4f447bbf4 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,8 @@ public class ProtocolConstants @@ -509,7 +509,7 @@ index c0d371426..a07e25b1f 100644 if ( in.readableBytes() < length ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index 828a5dbe6..195ec0886 100644 +index c387802dd..1b1d263ce 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -1,5 +1,6 @@ @@ -542,7 +542,7 @@ index 828a5dbe6..195ec0886 100644 @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -@@ -56,6 +64,14 @@ public class Chat extends DefinedPacket +@@ -57,6 +65,14 @@ public class Chat extends DefinedPacket } } @@ -558,7 +558,7 @@ index 828a5dbe6..195ec0886 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 886cb9168..e453d36c9 100644 +index 29440533f..c7b2e310d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -1,5 +1,7 @@ @@ -1152,7 +1152,7 @@ index 0b27fc86b..74066702c 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 3e4ea1928..421805e6e 100644 +index 88d631cd0..ac8672470 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java @@ -1,5 +1,6 @@ From 5a5c67d099b51e09371f7c2b8250c11278f39947 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 21 May 2021 15:29:42 -0300 Subject: [PATCH 100/499] Bump version number --- Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch index 478c4d28..7aa44f7b 100644 --- a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch @@ -34,7 +34,7 @@ index 3b0dff08..41d752a5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.2"; ++ return "0.5.3"; } public void reloadMessages() From 23fef3dc13639aa704fc2b1538bccdd2103d46c9 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 21 May 2021 15:30:04 -0300 Subject: [PATCH 101/499] Decrease string read limit --- Waterfall-Proxy-Patches/0033-Limit-String-read.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch index 6f6b83b6..7b723219 100644 --- a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch +++ b/Waterfall-Proxy-Patches/0033-Limit-String-read.patch @@ -13,7 +13,7 @@ index 93d17f6b..dd663e1d 100644 public static String readString(ByteBuf buf) { - return readString( buf, Short.MAX_VALUE ); -+ return readString( buf, 4096 ); // FlameCord ++ return readString( buf, 2048 ); // FlameCord } public static String readString(ByteBuf buf, int maxLen) From c17245bee5fb78e74230e0630317cb716a41e174 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 21 May 2021 15:30:40 -0300 Subject: [PATCH 102/499] Rename default timeout comment --- Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch index 7f7912ae..2c9182cd 100644 --- a/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch +++ b/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch @@ -13,7 +13,7 @@ index 85d2197a..1294495d 100644 * Time before users are disconnected due to no network activity. */ - private int timeout = 30000; -+ // FlameCord - Default timeout to 10000 ++ // FlameCord - Modify default timeout + private int timeout = 10000; /** * UUID used for metrics. From 638a231ef69f3ed61f20b044fb009d74ff28b62b Mon Sep 17 00:00:00 2001 From: Kamillaova <54859825+Kamillaova@users.noreply.github.com> Date: Fri, 21 May 2021 22:21:04 +0300 Subject: [PATCH 103/499] Make flamecord file executable --- flamecord | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 flamecord diff --git a/flamecord b/flamecord old mode 100644 new mode 100755 From d938cf93af00b360e45bf815117630a0547d17a7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:13:15 -0300 Subject: [PATCH 104/499] remove 1.7 protocol patch --- .../0003-1.7.x-Protocol-Patch.patch | 2002 ----------------- 1 file changed, 2002 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch diff --git a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch b/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch deleted file mode 100644 index df8872c6..00000000 --- a/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch +++ /dev/null @@ -1,2002 +0,0 @@ -From 6e2a427f8fc248bd661af13272a4922a2e0ba94d Mon Sep 17 00:00:00 2001 -From: Troy Frew -Date: Tue, 15 Nov 2016 10:31:04 -0500 -Subject: [PATCH] 1.7.x Protocol Patch - - -diff --git a/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java b/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java -new file mode 100644 -index 000000000..90064112e ---- /dev/null -+++ b/protocol/src/main/java/io/github/waterfallmc/travertine/protocol/MultiVersionPacketV17.java -@@ -0,0 +1,90 @@ -+package io.github.waterfallmc.travertine.protocol; -+ -+import com.google.common.base.Preconditions; -+import io.netty.buffer.ByteBuf; -+ -+import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; -+ -+public abstract class MultiVersionPacketV17 extends DefinedPacket -+{ -+ -+ protected void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ v17Read( buf ); -+ } -+ -+ @Override -+ public void read0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ switch ( protocolVersion ) -+ { -+ case ProtocolConstants.MINECRAFT_1_7_2: -+ case ProtocolConstants.MINECRAFT_1_7_6: -+ v17Read(buf, direction, protocolVersion); -+ break; -+ default: -+ read(buf, direction, protocolVersion); -+ break; -+ } -+ } -+ -+ protected void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ v17Write( buf ); -+ } -+ -+ @Override -+ public void write0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ switch ( protocolVersion ) -+ { -+ case ProtocolConstants.MINECRAFT_1_7_2: -+ case ProtocolConstants.MINECRAFT_1_7_6: -+ v17Write(buf, direction, protocolVersion); -+ break; -+ default: -+ write(buf, direction, protocolVersion); -+ break; -+ } -+ } -+ protected void v17Read(ByteBuf buf) -+ { -+ throw new UnsupportedOperationException( "Packet must implement read method" ); -+ } -+ -+ protected void v17Write(ByteBuf buf) -+ { -+ throw new UnsupportedOperationException( "Packet must implement write method" ); -+ } -+ -+ public static void v17writeArray(byte[] b, ByteBuf buf, boolean allowExtended) -+ { -+ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit -+ if ( allowExtended ) -+ { -+ Preconditions.checkArgument( b.length <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot send array longer than 2097050 (got %s bytes)", b.length ); -+ } else -+ { -+ Preconditions.checkArgument( b.length <= Short.MAX_VALUE, "Cannot send array longer than Short.MAX_VALUE (got %s bytes)", b.length ); -+ } -+ // Write a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) -+ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. -+ writeVarShort( buf, b.length ); -+ buf.writeBytes( b ); -+ } -+ -+ public static byte[] v17readArray(ByteBuf buf) -+ { -+ // Read in a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) -+ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. -+ int len = readVarShort( buf ); -+ -+ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit -+ Preconditions.checkArgument( len <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot receive array longer than 2097050 (got %s bytes)", len ); -+ -+ byte[] ret = new byte[ len ]; -+ buf.readBytes( ret ); -+ return ret; -+ } -+} -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 -index 31a954950..93d17f6b5 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -266,6 +266,11 @@ public abstract class DefinedPacket - read( buf ); - } - -+ public void read0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ read( buf, direction, protocolVersion ); -+ } -+ - public void write(ByteBuf buf) - { - throw new UnsupportedOperationException( "Packet must implement write method" ); -@@ -276,6 +281,11 @@ public abstract class DefinedPacket - write( buf ); - } - -+ public void write0(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ write( buf, direction, protocolVersion ); -+ } -+ - public abstract void handle(AbstractPacketHandler handler) throws Exception; - - @Override -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 01d35f41a..52f602763 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -57,7 +57,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - { - packetTypeInfo = packet.getClass(); - doLengthSanityChecks(in, packet, prot.getDirection(), packetId); // Waterfall: Additional DoS mitigations -- packet.read( in, prot.getDirection(), protocolVersion ); -+ packet.read0( in, prot.getDirection(), protocolVersion ); - - if ( in.isReadable() ) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -index d4b038434..9aac7ca9f 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftEncoder.java -@@ -21,6 +21,6 @@ public class MinecraftEncoder extends MessageToByteEncoder - { - Protocol.DirectionData prot = ( server ) ? protocol.TO_CLIENT : protocol.TO_SERVER; - DefinedPacket.writeVarInt( prot.getId( msg.getClass(), protocolVersion ), out ); -- msg.write( out, prot.getDirection(), protocolVersion ); -+ msg.write0( out, prot.getDirection(), protocolVersion ); - } - } -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 -index d2a11a826..2cc0f825b 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -58,7 +58,7 @@ public enum Protocol - TO_SERVER.registerPacket( - Handshake.class, - Handshake::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine - ); - } - }, -@@ -70,7 +70,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - KeepAlive.class, - KeepAlive::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), - map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), - map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -82,7 +82,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Login.class, - Login::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), - map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -93,7 +93,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Chat.class, - Chat::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), - map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), - map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -103,7 +103,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Respawn.class, - Respawn::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x07 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x07 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -126,20 +126,19 @@ public enum Protocol - TO_CLIENT.registerPacket( - EntityEffect.class, - EntityEffect::new, // Waterfall - speed up packet construction -- map(ProtocolConstants.MINECRAFT_1_8, 0x1D), -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x1D), // Travertine - map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) - ); - TO_CLIENT.registerPacket( - EntityRemoveEffect.class, - EntityRemoveEffect::new, // Waterfall - speed up packet construction -- map(ProtocolConstants.MINECRAFT_1_8, 0x1E), -+ map(ProtocolConstants.MINECRAFT_1_7_2, 0x1E), // Travertine - map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) - ); - // Waterfall end - TO_CLIENT.registerPacket( - PlayerListItem.class, // PlayerInfo -- PlayerListItem::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x38 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x38 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), - map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -152,7 +151,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - TabCompleteResponse.class, - TabCompleteResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3A ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3A ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), - map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), - map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -163,7 +162,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardObjective.class, - ScoreboardObjective::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3B ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3B ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), - map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -175,7 +174,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardScore.class, - ScoreboardScore::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3C ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3C ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -187,7 +186,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardDisplay.class, - ScoreboardDisplay::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3D ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3D ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -199,7 +198,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Team.class, - Team::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3E ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3E ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -211,7 +210,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - PluginMessage.class, - PluginMessage::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x3F ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3F ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), - map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -223,7 +222,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Kick.class, - Kick::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x40 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x40 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), - map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), - map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -235,7 +234,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Title.class, - Title::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x45 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x45 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -257,7 +256,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - PlayerListHeaderFooter.class, - PlayerListHeaderFooter::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x47 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x47 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), - map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -271,7 +270,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - EntityStatus.class, - EntityStatus::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x1A ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1A ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), - map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), - map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -309,7 +308,7 @@ public enum Protocol - TO_SERVER.registerPacket( - KeepAlive.class, - KeepAlive::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), - map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -321,7 +320,7 @@ public enum Protocol - TO_SERVER.registerPacket( - Chat.class, - Chat::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -330,7 +329,7 @@ public enum Protocol - TO_SERVER.registerPacket( - TabCompleteRequest.class, - TabCompleteRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x14 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x14 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -340,7 +339,7 @@ public enum Protocol - TO_SERVER.registerPacket( - ClientSettings.class, - ClientSettings::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x15 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x15 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -349,7 +348,7 @@ public enum Protocol - TO_SERVER.registerPacket( - PluginMessage.class, - PluginMessage::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x17 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x17 ), // Travertine - map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -367,23 +366,23 @@ public enum Protocol - TO_CLIENT.registerPacket( - StatusResponse.class, - StatusResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine - ); - TO_CLIENT.registerPacket( - PingPacket.class, - PingPacket::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine - ); - - TO_SERVER.registerPacket( - StatusRequest.class, - StatusRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine - ); - TO_SERVER.registerPacket( - PingPacket.class, - PingPacket::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine - ); - } - }, -@@ -395,22 +394,22 @@ public enum Protocol - TO_CLIENT.registerPacket( - Kick.class, - Kick::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine - ); - TO_CLIENT.registerPacket( - EncryptionRequest.class, - EncryptionRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine - ); - TO_CLIENT.registerPacket( - LoginSuccess.class, - LoginSuccess::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ) // Travertine - ); - TO_CLIENT.registerPacket( - SetCompression.class, - SetCompression::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x03 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x03 ) // Travertine - ); - TO_CLIENT.registerPacket( - LoginPayloadRequest.class, -@@ -421,12 +420,12 @@ public enum Protocol - TO_SERVER.registerPacket( - LoginRequest.class, - LoginRequest::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // Travertine - ); - TO_SERVER.registerPacket( - EncryptionResponse.class, - EncryptionResponse::new, // Waterfall - speed up packet construction -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // Travertine - ); - TO_SERVER.registerPacket( - LoginPayloadResponse.class, -@@ -546,7 +545,11 @@ public enum Protocol - } - if ( !hasPacket(id, supportsForge) ) - { -- throw new BadPacketException( "Packet with id " + id + " outside of range " ); -+ if ( ProtocolConstants.isBeforeOrEq( version, ProtocolConstants.MINECRAFT_1_7_6 ) ) { -+ return null; -+ } else { -+ throw new BadPacketException( "Packet with id " + id + " outside of range " ); -+ } - } - - java.util.function.Supplier constructor = protocolData.packetConstructors[id]; // Waterfall - speed up packet construction -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 -index 8c3a78d60..4f447bbf4 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -@@ -7,6 +7,8 @@ public class ProtocolConstants - { - - private static final boolean SNAPSHOT_SUPPORT = Boolean.getBoolean( "net.md_5.bungee.protocol.snapshot" ); -+ public static final int MINECRAFT_1_7_2 = 4; -+ public static final int MINECRAFT_1_7_6 = 5; - public static final int MINECRAFT_1_8 = 47; - public static final int MINECRAFT_1_9 = 107; - public static final int MINECRAFT_1_9_1 = 108; -@@ -41,6 +43,7 @@ public class ProtocolConstants - static - { - ImmutableList.Builder supportedVersions = ImmutableList.builder().add( -+ "1.7.x", - "1.8.x", - "1.9.x", - "1.10.x", -@@ -52,6 +55,8 @@ public class ProtocolConstants - "1.16.x" - ); - ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( -+ ProtocolConstants.MINECRAFT_1_7_2, -+ ProtocolConstants.MINECRAFT_1_7_6, - ProtocolConstants.MINECRAFT_1_8, - ProtocolConstants.MINECRAFT_1_9, - ProtocolConstants.MINECRAFT_1_9_1, -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d371426..a07e25b1f 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -@@ -6,10 +6,12 @@ import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.ByteToMessageDecoder; - import io.netty.handler.codec.CorruptedFrameException; - import java.util.List; -+import java.util.concurrent.atomic.AtomicLong; - - public class Varint21FrameDecoder extends ByteToMessageDecoder - { - -+ private AtomicLong lastEmptyPacket = new AtomicLong(0); // Travertine - private static boolean DIRECT_WARNING; - - @Override -@@ -44,7 +46,15 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder - // Waterfall end - if ( false && length == 0) // Waterfall - ignore - { -- throw new CorruptedFrameException( "Empty Packet!" ); -+ // Travertine start - vanilla 1.7 client sometimes sends empty packets. -+ long currentTime = System.currentTimeMillis(); -+ long lastEmptyPacket = this.lastEmptyPacket.getAndSet(currentTime); -+ -+ if (currentTime - lastEmptyPacket < 50L) -+ { -+ throw new CorruptedFrameException( "Too many empty packets" ); -+ } -+ // Travertine end - } - - if ( in.readableBytes() < length ) -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index c387802dd..1b1d263ce 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import java.util.UUID; - import lombok.Data; -@@ -12,7 +13,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @Data - @NoArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class Chat extends DefinedPacket -+public class Chat extends MultiVersionPacketV17 - { - - private static final UUID EMPTY_UUID = new UUID( 0L, 0L ); -@@ -36,6 +37,13 @@ public class Chat extends DefinedPacket - this.position = position; - this.sender = sender == null ? EMPTY_UUID : sender; - } -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ message = readString( buf ); -+ } -+ // Travertine end - - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -@@ -57,6 +65,14 @@ public class Chat extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( message, buf ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 29440533f..c7b2e310d 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -@@ -1,5 +1,7 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; -+import net.md_5.bungee.protocol.DefinedPacket; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; -@@ -13,7 +15,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class ClientSettings extends DefinedPacket -+public class ClientSettings extends MultiVersionPacketV17 - { - - private String locale; -@@ -25,6 +27,19 @@ public class ClientSettings extends DefinedPacket - private int mainHand; - private boolean disableTextFiltering; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ locale = readString( buf ); -+ viewDistance = buf.readByte(); -+ chatFlags = buf.readUnsignedByte(); -+ chatColours = buf.readBoolean(); -+ skinParts = buf.readByte(); -+ difficulty = buf.readByte(); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -67,6 +82,19 @@ public class ClientSettings extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( locale, buf ); -+ buf.writeByte( viewDistance ); -+ buf.writeByte( chatFlags ); -+ buf.writeBoolean( chatColours ); -+ buf.writeByte( skinParts ); -+ buf.writeByte( difficulty ); -+ } -+ // Travertine end -+ - @Override - public void handle(AbstractPacketHandler handler) throws Exception - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca8..8d9f4ccb3 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -@@ -1,25 +1,35 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; - import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; --import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class EncryptionRequest extends DefinedPacket -+public class EncryptionRequest extends MultiVersionPacketV17 - { - - private String serverId; - private byte[] publicKey; - private byte[] verifyToken; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ serverId = readString( buf ); -+ publicKey = v17readArray( buf ); -+ verifyToken = v17readArray( buf ); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -28,6 +38,16 @@ public class EncryptionRequest extends DefinedPacket - verifyToken = readArray( buf ); - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( serverId, buf ); -+ v17writeArray( publicKey, buf, false ); -+ v17writeArray( verifyToken, buf, false ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 53575ce0e..1a41da75a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; -@@ -13,12 +14,21 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class EncryptionResponse extends DefinedPacket -+public class EncryptionResponse extends MultiVersionPacketV17 - { - - private byte[] sharedSecret; - private byte[] verifyToken; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ sharedSecret = v17readArray( buf ); -+ verifyToken = v17readArray( buf ); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -26,6 +36,15 @@ public class EncryptionResponse extends DefinedPacket - verifyToken = readArray( buf, 128 ); - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ v17writeArray( sharedSecret, buf, false ); -+ v17writeArray( verifyToken, buf, false ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9d..07fc21b65 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -@@ -1,18 +1,19 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; - import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; --import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class EntityEffect extends DefinedPacket { -+public class EntityEffect extends MultiVersionPacketV17 { - - private int entityId; - private int effectId; -@@ -20,6 +21,14 @@ public class EntityEffect extends DefinedPacket { - private int duration; - private boolean hideParticles; - -+ @Override -+ protected void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ this.entityId = buf.readInt(); -+ this.effectId = buf.readUnsignedByte(); -+ this.amplifier = buf.readUnsignedByte(); -+ this.duration = buf.readShort(); -+ } -+ - @Override - public void read(ByteBuf buf) { - this.entityId = readVarInt(buf); -@@ -29,6 +38,14 @@ public class EntityEffect extends DefinedPacket { - this.hideParticles = buf.readBoolean(); - } - -+ @Override -+ protected void v17Write(ByteBuf buf) { -+ buf.writeInt(effectId); -+ buf.writeByte(effectId); -+ buf.writeByte(amplifier); -+ buf.writeShort(duration); -+ } -+ - @Override - public void write(ByteBuf buf) { - writeVarInt(this.entityId, buf); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3ab..9f8d56fc7 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -@@ -1,18 +1,18 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; - import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; --import net.md_5.bungee.protocol.DefinedPacket; - - @Data - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class EntityRemoveEffect extends DefinedPacket { -+public class EntityRemoveEffect extends MultiVersionPacketV17 { - - private int entityId; - private int effectId; -@@ -23,9 +23,15 @@ public class EntityRemoveEffect extends DefinedPacket { - this.effectId = buf.readUnsignedByte(); - } - -+ @Override -+ protected void v17Read(ByteBuf buf) { -+ this.entityId = buf.readInt(); -+ this.effectId = buf.readUnsignedByte(); -+ } -+ - @Override - public void write(ByteBuf buf) { -- writeVarInt(this.entityId, buf); -+ writeVarInt(entityId, buf); - buf.writeByte(effectId); - } - -@@ -33,4 +39,10 @@ public class EntityRemoveEffect extends DefinedPacket { - public void handle(AbstractPacketHandler handler) throws Exception { - handler.handle(this); - } -+ -+ @Override -+ protected void v17Write(ByteBuf buf) { -+ buf.writeInt(entityId); -+ buf.writeByte(effectId); -+ } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc416..0c2eb022f 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; -@@ -13,17 +14,33 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class KeepAlive extends DefinedPacket -+public class KeepAlive extends MultiVersionPacketV17 - { - - private long randomId; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ randomId = buf.readInt(); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { - randomId = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) ? buf.readLong() : readVarInt( buf ); - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ buf.writeInt((int) randomId); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 551bd1046..ac8751f6e 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -@@ -23,6 +23,11 @@ public class LoginSuccess extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // Travertine start -+ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { -+ uuid = readUndashedUUID( buf ); -+ } else -+ // Travertine end - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) - { - uuid = readUUID( buf ); -@@ -36,6 +41,11 @@ public class LoginSuccess extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // Travertine start -+ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { -+ writeUndashedUUID( uuid.toString(), buf ); -+ } else -+ // Travertine end - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) - { - writeUUID( uuid, buf ); -@@ -51,4 +61,14 @@ public class LoginSuccess extends DefinedPacket - { - handler.handle( this ); - } -+ -+ // Travertine start -+ private static UUID readUndashedUUID(ByteBuf buf) { -+ return UUID.fromString( new StringBuilder( readString( buf ) ).insert( 20, '-' ).insert( 16, '-' ).insert( 12, '-' ).insert( 8, '-' ).toString() ); -+ } -+ -+ private static void writeUndashedUUID(String uuid, ByteBuf buf) { -+ writeString( new StringBuilder( 32 ).append( uuid, 0, 8 ).append( uuid, 9, 13 ).append( uuid, 14, 18 ).append( uuid, 19, 23 ).append( uuid, 24, 36 ).toString(), buf ); -+ } -+ // Travertine end - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 92bacc7cd..c919f961a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -@@ -1,5 +1,7 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; -+import net.md_5.bungee.protocol.DefinedPacket; - import io.netty.buffer.ByteBuf; - import java.util.UUID; - import lombok.Data; -@@ -12,12 +14,24 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @Data - @NoArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class PlayerListItem extends DefinedPacket -+public class PlayerListItem extends MultiVersionPacketV17 - { - - private Action action; - private Item[] items; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ items = new Item[ 1 ]; -+ Item item = items[ 0 ] = new Item(); -+ item.displayName = item.username = readString( buf ); -+ action = !buf.readBoolean() ? Action.REMOVE_PLAYER : Action.ADD_PLAYER; -+ item.ping = buf.readShort(); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -72,6 +86,17 @@ public class PlayerListItem extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ Item item = items[0]; // Only one at a time -+ writeString( item.displayName, buf ); // TODO: Server unique only! -+ buf.writeBoolean( action != Action.REMOVE_PLAYER ); -+ buf.writeShort( item.ping ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 17e12655d..c49c5a567 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -@@ -3,6 +3,8 @@ package net.md_5.bungee.protocol.packet; - import com.google.common.base.Function; - import com.google.common.base.Preconditions; - import com.google.common.base.Predicate; -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; -+import io.netty.buffer.ByteBufUtil; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufUtil; // Waterfall - import java.io.ByteArrayInputStream; -@@ -21,7 +23,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class PluginMessage extends DefinedPacket -+public class PluginMessage extends MultiVersionPacketV17 - { - - public static final Function MODERNISE = new Function() -@@ -79,6 +81,15 @@ public class PluginMessage extends DefinedPacket - */ - private boolean allowExtendedPacket = false; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ tag = readString( buf ); -+ data = v17readArray( buf ); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -89,6 +100,15 @@ public class PluginMessage extends DefinedPacket - buf.readBytes( data ); - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( tag, buf ); -+ v17writeArray( data, buf, allowExtendedPacket ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d54..fe290fa3c 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import java.util.Locale; - import lombok.AllArgsConstructor; -@@ -14,7 +15,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class ScoreboardObjective extends DefinedPacket -+public class ScoreboardObjective extends MultiVersionPacketV17 - { - - private String name; -@@ -25,6 +26,16 @@ public class ScoreboardObjective extends DefinedPacket - */ - private byte action; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ name = readString( buf ); -+ value = readString( buf ); -+ action = buf.readByte(); -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -43,6 +54,16 @@ public class ScoreboardObjective extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( name, buf ); -+ writeString( value, buf ); -+ buf.writeByte( action ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86b..74066702c 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; -@@ -13,7 +14,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class ScoreboardScore extends DefinedPacket -+public class ScoreboardScore extends MultiVersionPacketV17 - { - - private String itemName; -@@ -24,6 +25,20 @@ public class ScoreboardScore extends DefinedPacket - private String scoreName; - private int value; - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ itemName = readString( buf ); -+ action = buf.readByte(); -+ if ( action != 1 ) -+ { -+ scoreName = readString( buf ); -+ value = buf.readInt(); -+ } -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -36,6 +51,20 @@ public class ScoreboardScore extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( itemName, buf ); -+ buf.writeByte( action ); -+ if ( action != 1 ) -+ { -+ writeString( scoreName, buf ); -+ buf.writeInt( value ); -+ } -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 88d631cd0..ac8672470 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.Data; - import lombok.EqualsAndHashCode; -@@ -11,7 +12,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @Data - @NoArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class TabCompleteRequest extends DefinedPacket -+public class TabCompleteRequest extends MultiVersionPacketV17 - { - - private int transactionId; -@@ -33,6 +34,13 @@ public class TabCompleteRequest extends DefinedPacket - this.hasPositon = hasPosition; - this.position = position; - } -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ cursor = readString( buf ); -+ } -+ // Travertine end - - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -@@ -57,6 +65,14 @@ public class TabCompleteRequest extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( cursor, buf ); -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..415a4bcde 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol.packet; - -+import io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17; - import io.netty.buffer.ByteBuf; - import lombok.AllArgsConstructor; - import lombok.Data; -@@ -13,7 +14,7 @@ import net.md_5.bungee.protocol.ProtocolConstants; - @NoArgsConstructor - @AllArgsConstructor - @EqualsAndHashCode(callSuper = false) --public class Team extends DefinedPacket -+public class Team extends MultiVersionPacketV17 - { - - private String name; -@@ -41,6 +42,31 @@ public class Team extends DefinedPacket - this.mode = 1; - } - -+ // Travertine start -+ @Override -+ public void v17Read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ name = readString( buf ); -+ mode = buf.readByte(); -+ if ( mode == 0 || mode == 2 ) -+ { -+ displayName = readString( buf ); -+ prefix = readString( buf ); -+ suffix = readString( buf ); -+ friendlyFire = buf.readByte(); -+ } -+ if ( mode == 0 || mode == 3 || mode == 4 ) -+ { -+ int len = buf.readShort(); -+ players = new String[ len ]; -+ for ( int i = 0; i < len; i++ ) -+ { -+ players[i] = readString( buf ); -+ } -+ } -+ } -+ // Travertine end -+ - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -@@ -78,6 +104,30 @@ public class Team extends DefinedPacket - } - } - -+ // Travertine start -+ @Override -+ public void v17Write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( name, buf ); -+ buf.writeByte( mode ); -+ if ( mode == 0 || mode == 2 ) -+ { -+ writeString( displayName, buf ); -+ writeString( prefix, buf ); -+ writeString( suffix, buf ); -+ buf.writeByte( friendlyFire ); -+ } -+ if ( mode == 0 || mode == 3 || mode == 4 ) -+ { -+ buf.writeShort( players.length ); -+ for ( String player : players ) -+ { -+ writeString( player, buf ); -+ } -+ } -+ } -+ // Travertine end -+ - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 97de4271c..3b0dff080 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer - .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) - .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) - .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ // Travertine start -+ public final Gson gsonLegacy = new GsonBuilder() -+ .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) -+ .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) -+ .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) -+ .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer( ProtocolConstants.MINECRAFT_1_7_2 ) ) -+ .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ // Travertine end - @Getter - private ConnectionThrottle connectionThrottle; - private final ModuleManager moduleManager = new ModuleManager(); -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 1d377a655..6c7d4abb4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -@@ -183,6 +183,7 @@ public class BungeeTitle implements Title - @Override - public Title send(ProxiedPlayer player) - { -+ if ( ProtocolConstants.isBeforeOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return this; - sendPacket( player, clear ); - sendPacket( player, reset ); - sendPacket( player, times ); -diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a16..299a216cd 100644 ---- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -+++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -@@ -10,17 +10,32 @@ import com.google.gson.JsonSerializer; - import java.lang.reflect.Type; - import java.util.UUID; - import net.md_5.bungee.api.ServerPing; -+import net.md_5.bungee.protocol.ProtocolConstants; - - public class PlayerInfoSerializer implements JsonSerializer, JsonDeserializer - { - -+ // Travertine start -+ private final int protocol; -+ -+ public PlayerInfoSerializer() -+ { -+ this.protocol = ProtocolConstants.MINECRAFT_1_7_6; -+ } -+ -+ public PlayerInfoSerializer(int protocol) -+ { -+ this.protocol = protocol; -+ } -+ // Travertine end -+ - @Override - public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException - { - JsonObject js = json.getAsJsonObject(); - ServerPing.PlayerInfo info = new ServerPing.PlayerInfo( js.get( "name" ).getAsString(), (UUID) null ); - String id = js.get( "id" ).getAsString(); -- if ( !id.contains( "-" ) ) -+ if ( ProtocolConstants.isBeforeOrEq( protocol, ProtocolConstants.MINECRAFT_1_7_2 ) || !id.contains( "-" ) ) // Travertine - { - info.setId( id ); - } else -@@ -35,7 +50,15 @@ public class PlayerInfoSerializer implements JsonSerializer= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -- brand.release(); -+ // Travertine start -+ String brandString = bungee.getName() + " (" + bungee.getVersion() + ")"; -+ -+ if ( ProtocolConstants.isBeforeOrEq( user.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); -+ } else -+ { -+ ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString(brandString, brand); -+ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ brand.release(); -+ } -+ // Travertine end - } - - user.setDimension( login.getDimension() ); -@@ -286,7 +297,7 @@ public class ServerConnector extends PacketHandler - if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall - for ( Objective objective : serverScoreboard.getObjectives() ) - { -- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); -+ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // Travertine - 1.7 - } - for ( Score score : serverScoreboard.getScores() ) - { -@@ -456,6 +467,14 @@ public class ServerConnector extends PacketHandler - { - this.handshakeHandler.handle( pluginMessage ); - -+ // Travertine start -+ if ( user.getForgeClientHandler().checkUserOutdated() ) -+ { -+ ch.close(); -+ user.getPendingConnects().remove(target); -+ } -+ // Travertine end -+ - // We send the message as part of the handler, so don't send it here. - throw CancelSendSignal.INSTANCE; - } -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 01075a85e..96df01757 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -196,6 +196,7 @@ public final class UserConnection implements ProxiedPlayer - public void setDisplayName(String name) - { - Preconditions.checkNotNull( name, "displayName" ); -+ Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // Travertine - displayName = name; - } - -@@ -500,7 +501,8 @@ public final class UserConnection implements ProxiedPlayer - // transform score components - message = ChatComponentTransformer.getInstance().transform( this, true, message ); - -- if ( position == ChatMessageType.ACTION_BAR ) -+ // Action bar doesn't display the new JSON formattings, legacy works - send it using this for now -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // Travertine - { - // Versions older than 1.11 cannot send the Action bar with the new JSON formattings - // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -696,6 +698,7 @@ public final class UserConnection implements ProxiedPlayer - @Override - public void setTabHeader(BaseComponent header, BaseComponent footer) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine - header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; - footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; - -@@ -708,6 +711,7 @@ public final class UserConnection implements ProxiedPlayer - @Override - public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine - header = ChatComponentTransformer.getInstance().transform( this, true, header ); - footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); - -@@ -737,6 +741,7 @@ public final class UserConnection implements ProxiedPlayer - - public void setCompressionThreshold(int compressionThreshold) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // Travertine - if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) - { - this.compressionThreshold = compressionThreshold; -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 -index 9e180c30c..d54d8539b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; - import io.netty.channel.unix.DomainSocketAddress; - import java.io.DataInput; - import java.net.InetSocketAddress; -+import java.nio.charset.StandardCharsets; // Waterfall - import java.util.ArrayList; - import java.util.HashMap; // Waterfall - import java.util.List; -@@ -179,7 +180,7 @@ public class DownstreamBridge extends PacketHandler - switch ( objective.getAction() ) - { - case 0: -- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType().toString() ) ); -+ serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // Travertine - 1.7 protocol support - break; - case 1: - serverScoreboard.removeObjective( objective.getName() ); -@@ -189,7 +190,7 @@ public class DownstreamBridge extends PacketHandler - if ( oldObjective != null ) - { - oldObjective.setValue( objective.getValue() ); -- oldObjective.setType( objective.getType().toString() ); -+ oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // Travertine - 1.7 protocol support - } - break; - default: -@@ -286,16 +287,28 @@ public class DownstreamBridge extends PacketHandler - - if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) - { -- ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- String serverBrand = DefinedPacket.readString( brand ); -- brand.release(); -- -- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); -- -- brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -- pluginMessage.setData( brand ); -- brand.release(); -+ // Travertine start -+ if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ try -+ { -+ ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); -+ String serverBrand = DefinedPacket.readString(brand); -+ brand.release(); -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData(brand); -+ brand.release(); -+ } catch (Exception ProtocolHacksSuck) -+ { -+ return; -+ } -+ } else -+ { -+ String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); -+ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // Travertine -+ } -+ // Travertine end - // changes in the packet are ignored so we need to send it manually - con.unsafe().sendPacket( pluginMessage ); - throw CancelSendSignal.INSTANCE; -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 b7ecd828e..3b82219d1 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 -@@ -3,6 +3,8 @@ package net.md_5.bungee.connection; - import com.google.common.base.Charsets; - import com.google.common.base.Preconditions; - import com.google.gson.Gson; -+import com.google.gson.JsonElement; -+import com.google.gson.JsonObject; - import java.math.BigInteger; - import java.net.InetSocketAddress; - import java.net.SocketAddress; -@@ -257,12 +259,28 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void done(ProxyPingEvent pingResult, Throwable error) - { -- Gson gson = BungeeCord.getInstance().gson; -- unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); -+ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine - if ( bungee.getConnectionThrottle() != null ) - { - bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); - } -+ // Travertine start -+ if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ // Minecraft < 1.9 doesn't send string server descriptions as chat components. Older 1.7 -+ // clients even crash when encountering a chat component instead of a string. To be on the -+ // safe side, always send legacy descriptions for < 1.9 clients. -+ JsonElement element = gson.toJsonTree(pingResult.getResponse()); -+ Preconditions.checkArgument(element.isJsonObject(), "Response is not a JSON object"); -+ JsonObject object = element.getAsJsonObject(); -+ object.addProperty("description", pingResult.getResponse().getDescription()); -+ -+ unsafe.sendPacket(new StatusResponse(gson.toJson(element))); -+ } else -+ { -+ unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); -+ } -+ // Travertine end - } - }; - -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd9..6cd71071e 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.MinecraftEncoder; - import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.Protocol; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.Handshake; - import net.md_5.bungee.protocol.packet.StatusRequest; - import net.md_5.bungee.protocol.packet.StatusResponse; -@@ -65,7 +66,7 @@ public class PingHandler extends PacketHandler - @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") - public void handle(StatusResponse statusResponse) throws Exception - { -- Gson gson = BungeeCord.getInstance().gson; -+ Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // Travertine - ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class ); - ( (BungeeServerInfo) target ).cachePing( serverPing ); - callback.done( serverPing, null ); -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 4d7b1b23e..ad3bdee56 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 -@@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler - } ); - for ( ProxiedPlayer player : con.getServer().getInfo().getPlayers() ) - { -- player.unsafe().sendPacket( packet ); -+ // Travertine start -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( packet ); -+ } -+ // Travertine end - } - con.getServer().disconnect( "Quitting" ); - } -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 13456b341..44066317a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -35,6 +35,10 @@ public abstract class EntityMap - // Waterfall end - switch ( version ) - { -+ case ProtocolConstants.MINECRAFT_1_7_2: -+ return EntityMap_1_7_2.INSTANCE; -+ case ProtocolConstants.MINECRAFT_1_7_6: -+ return EntityMap_1_7_6.INSTANCE; - case ProtocolConstants.MINECRAFT_1_8: - return EntityMap_1_8.INSTANCE; - case ProtocolConstants.MINECRAFT_1_9: -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -new file mode 100644 -index 000000000..65c1a9ec8 ---- /dev/null -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -@@ -0,0 +1,102 @@ -+// Travertine start -+package net.md_5.bungee.entitymap; -+ -+import io.netty.buffer.ByteBuf; -+import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; -+ -+class EntityMap_1_7_2 extends EntityMap -+{ -+ -+ static final EntityMap INSTANCE = new EntityMap_1_7_2(); -+ -+ EntityMap_1_7_2() -+ { -+ addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment -+ addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed -+ addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation -+ addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player -+ addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item -+ addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object -+ addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob -+ addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting -+ addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb -+ addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity -+ addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity -+ addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move -+ addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look -+ addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move -+ addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport -+ addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look -+ addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status -+ addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity -+ addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata -+ addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect -+ addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect -+ addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties -+ addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation -+ addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity -+ -+ addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity -+ addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation -+ addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action -+ } -+ -+ @Override -+ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -+ { -+ super.rewriteClientbound( packet, oldId, newId ); -+ -+ //Special cases -+ int readerIndex = packet.readerIndex(); -+ int packetId = DefinedPacket.readVarInt( packet ); -+ int packetIdLength = packet.readerIndex() - readerIndex; -+ if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) -+ { -+ rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -+ } else if ( packetId == 0x13 /* Destroy Entities */ ) -+ { -+ int count = packet.getByte( packetIdLength ); -+ for ( int i = 0; i < count; i++ ) -+ { -+ rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); -+ } -+ } else if ( packetId == 0x0E /* Spawn Object */ ) -+ { -+ DefinedPacket.readVarInt( packet ); -+ int type = packet.readUnsignedByte(); -+ -+ if ( type == 60 || type == 90 ) -+ { -+ packet.skipBytes( 14 ); -+ int position = packet.readerIndex(); -+ int readId = packet.readInt(); -+ int changedId = -1; -+ if ( readId == oldId ) -+ { -+ packet.setInt( position, newId ); -+ changedId = newId; -+ } else if ( readId == newId ) -+ { -+ packet.setInt( position, oldId ); -+ changedId = oldId; -+ } -+ if ( changedId != -1 ) -+ { -+ if ( changedId == 0 && readId != 0 ) -+ { // Trim off the extra data -+ packet.readerIndex( readerIndex ); -+ packet.writerIndex( packet.readableBytes() - 6 ); -+ } else if ( changedId != 0 && readId == 0 ) -+ { // Add on the extra data -+ packet.readerIndex( readerIndex ); -+ packet.capacity( packet.readableBytes() + 6 ); -+ packet.writerIndex( packet.readableBytes() + 6 ); -+ } -+ } -+ } -+ } -+ packet.readerIndex( readerIndex ); -+ } -+} -+// Travertine end -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -new file mode 100644 -index 000000000..6755fe845 ---- /dev/null -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -@@ -0,0 +1,62 @@ -+// Travertine start -+package net.md_5.bungee.entitymap; -+ -+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -+import io.netty.buffer.ByteBuf; -+import net.md_5.bungee.BungeeCord; -+import net.md_5.bungee.UserConnection; -+import net.md_5.bungee.connection.LoginResult; -+import net.md_5.bungee.protocol.DefinedPacket; -+ -+class EntityMap_1_7_6 extends EntityMap_1_7_2 -+{ -+ -+ static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); -+ -+ @Override -+ @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -+ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -+ { -+ super.rewriteClientbound( packet, oldId, newId ); -+ -+ int readerIndex = packet.readerIndex(); -+ int packetId = DefinedPacket.readVarInt( packet ); -+ int packetIdLength = packet.readerIndex() - readerIndex; -+ if ( packetId == 0x0C /* Spawn Player */ ) -+ { -+ DefinedPacket.readVarInt( packet ); -+ int idLength = packet.readerIndex() - readerIndex - packetIdLength; -+ String uuid = DefinedPacket.readString( packet ); -+ String username = DefinedPacket.readString( packet ); -+ int props = DefinedPacket.readVarInt( packet ); -+ if ( props == 0 ) -+ { -+ UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); -+ if ( player != null ) -+ { -+ LoginResult profile = player.getPendingConnection().getLoginProfile(); -+ if ( profile != null && profile.getProperties() != null -+ && profile.getProperties().length >= 1 ) -+ { -+ ByteBuf rest = packet.copy(); -+ packet.readerIndex( readerIndex ); -+ packet.writerIndex( readerIndex + packetIdLength + idLength ); -+ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -+ DefinedPacket.writeString( username, packet ); -+ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -+ for ( LoginResult.Property property : profile.getProperties() ) -+ { -+ DefinedPacket.writeString( property.getName(), packet ); -+ DefinedPacket.writeString( property.getValue(), packet ); -+ DefinedPacket.writeString( property.getSignature(), packet ); -+ } -+ packet.writeBytes( rest ); -+ rest.release(); -+ } -+ } -+ } -+ } -+ packet.readerIndex( readerIndex ); -+ } -+} -+// Travertine end -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff9..f61de1278 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -@@ -8,6 +8,7 @@ import lombok.Getter; - import lombok.NonNull; - import lombok.RequiredArgsConstructor; - import lombok.Setter; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.UserConnection; - import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.EntityRemoveEffect; -@@ -23,6 +24,12 @@ public class ForgeClientHandler - @NonNull - private final UserConnection con; - -+ // Travertine start -+ @Getter -+ @Setter(AccessLevel.PACKAGE) -+ private boolean forgeOutdated = false; -+ // Travertine end -+ - /** - * The users' mod list. - */ -@@ -175,4 +182,22 @@ public class ForgeClientHandler - { - return fmlTokenInHandshake || clientModList != null; - } -+ -+ // Travertine start -+ /** -+ * Checks to see if a user is using an outdated FML build, and takes -+ * appropriate action on the User side. This should only be called during a -+ * server connection, by the ServerConnector -+ * -+ * @return true if the user's FML build is outdated, otherwise -+ * false -+ */ -+ public boolean checkUserOutdated() { -+ if (forgeOutdated) { -+ con.disconnect( BungeeCord.getInstance().getTranslation("connect_kick_outdated_forge") ); -+ } -+ return forgeOutdated; -+ } -+ // Travertine end -+ - } -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8a..e3c1b9b95 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -@@ -3,6 +3,7 @@ package net.md_5.bungee.forge; - import java.util.Map; - import net.md_5.bungee.ServerConnector; - import net.md_5.bungee.UserConnection; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.PluginMessage; - - /** -@@ -84,6 +85,22 @@ enum ForgeClientHandshakeState implements IForgeClientPacketHandler clientModList = ForgeUtils.readModList( message ); - con.getForgeClientHandler().setClientModList( clientModList ); -+ // Travertine start -+ // If the user is below 1.8, we need to check the version of FML - it's not always an OK version. -+ if ( ProtocolConstants.isBeforeOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ // Get the version from the mod list. -+ int buildNumber = ForgeUtils.getFmlBuildNumber( clientModList ); -+ -+ // If we get 0, we're probably using a testing build, so let it though. Otherwise, check the build number. -+ if ( buildNumber < ForgeConstants.FML_MIN_BUILD_VERSION && buildNumber != 0 ) -+ { -+ // Mark the user as an old Forge user. This will then cause any Forge ServerConnectors to cancel any -+ // connections to it. -+ con.getForgeClientHandler().setForgeOutdated( true ); -+ } -+ } -+ // Travertine end - } - - return WAITINGSERVERDATA; -diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index daf12f74e..e33861abb 100644 ---- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -+++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -@@ -4,12 +4,14 @@ import java.util.Collection; - import java.util.HashSet; - import java.util.UUID; - import net.md_5.bungee.api.connection.ProxiedPlayer; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.PlayerListItem; - - public class ServerUnique extends TabList - { - - private final Collection uuids = new HashSet<>(); -+ private final Collection usernames = new HashSet<>(); // Travertine - Support for <=1.7.9 - - public ServerUnique(ProxiedPlayer player) - { -@@ -23,10 +25,26 @@ public class ServerUnique extends TabList - { - if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) - { -- uuids.add( item.getUuid() ); -+ // Travertine start -+ if ( item.getUuid() != null ) -+ { -+ uuids.add( item.getUuid() ); -+ } else -+ { -+ usernames.add( item.getUsername() ); -+ } -+ // Travertine end - } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) - { -- uuids.remove( item.getUuid() ); -+ // Travertine start -+ if ( item.getUuid() != null ) -+ { -+ uuids.remove( item.getUuid() ); -+ } else -+ { -+ usernames.remove( item.getUsername() ); -+ } -+ // Travertine end - } - } - player.unsafe().sendPacket( playerListItem ); -@@ -43,16 +61,44 @@ public class ServerUnique extends TabList - { - PlayerListItem packet = new PlayerListItem(); - packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); -- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; -+ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // Travertine - int i = 0; - for ( UUID uuid : uuids ) - { - PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); - item.setUuid( uuid ); - } -+ // Travertine start -+ for ( String username : usernames ) -+ { -+ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); -+ item.setUsername( username ); -+ item.setDisplayName( username ); -+ } -+ // Travertine end - packet.setItems( items ); -- player.unsafe().sendPacket( packet ); -+ // Travertine start -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( packet ); -+ } else -+ { -+ // Split up the packet -+ for ( PlayerListItem.Item item : packet.getItems() ) -+ { -+ PlayerListItem p2 = new PlayerListItem(); -+ p2.setAction( packet.getAction() ); -+ -+ p2.setItems( new PlayerListItem.Item[] -+ { -+ item -+ } ); -+ player.unsafe().sendPacket( p2 ); -+ } -+ } -+ // Travertine end - uuids.clear(); -+ usernames.clear(); // Travertine - } - - @Override --- -2.31.1 - From 4d5e2ac55bec3933f689ecba37a260e74e481978 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:13:53 -0300 Subject: [PATCH 105/499] update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 78a508e3..88e5a161 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ Travertine-Proxy .idea/ out/ +.project +.settings \ No newline at end of file From ad91d4e7f4fdc3d9418caf229b63a2a9c373c75c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:17:03 -0300 Subject: [PATCH 106/499] update Waterfall -> FlameCord rename methods --- .../0001-POM-Changes.patch | 168 +++++++++--------- ...erences-from-Waterfall-to-FlameCord.patch} | 20 +-- .../0013-FlameCord-rebrand.patch | 56 ------ 3 files changed, 94 insertions(+), 150 deletions(-) rename Waterfall-Proxy-Patches/{0002-Rename-references-from-Waterfall-to-Travertine.patch => 0002-Rename-references-from-Waterfall-to-FlameCord.patch} (88%) delete mode 100644 Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index a5195e94..aa309ad8 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -13,47 +13,47 @@ index ca1ed8811..adec9d39f 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-api -+ travertine-api ++ flamecord-api 1.16-R0.5-SNAPSHOT jar - Waterfall-API -+ Travertine-API ++ FlameCord-API API implemented by the Elastic Portal Suite io.github.waterfallmc - waterfall-chat -+ travertine-chat ++ flamecord-chat ${project.version} compile io.github.waterfallmc - waterfall-config -+ travertine-config ++ flamecord-config ${project.version} compile io.github.waterfallmc - waterfall-event -+ travertine-event ++ flamecord-event ${project.version} compile io.github.waterfallmc - waterfall-protocol -+ travertine-protocol ++ flamecord-protocol ${project.version} compile @@ -66,21 +66,21 @@ index 37c0880cd..139b7ac12 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-bootstrap -+ travertine-bootstrap ++ flamecord-bootstrap 1.16-R0.5-SNAPSHOT jar - Waterfall-Bootstrap - Java 1.6 loader for Waterfall -+ Travertine-Bootstrap -+ Java 1.6 loader for Travertine ++ FlameCord-Bootstrap ++ Java 1.6 loader for FlameCord true @@ -89,7 +89,7 @@ index 37c0880cd..139b7ac12 100644 io.github.waterfallmc - waterfall-proxy -+ travertine-proxy ++ flamecord-proxy ${project.version} compile @@ -97,7 +97,7 @@ index 37c0880cd..139b7ac12 100644 - Waterfall -+ Travertine ++ FlameCord org.apache.maven.plugins @@ -110,21 +110,21 @@ index 853092339..5cc621414 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-chat -+ travertine-chat ++ flamecord-chat 1.16-R0.5-SNAPSHOT jar - Waterfall-Chat - Minecraft JSON chat API intended for use with Waterfall -+ Travertine-Chat -+ Minecraft JSON chat API intended for use with Travertine ++ FlameCord-Chat ++ Minecraft JSON chat API intended for use with FlameCord @@ -137,21 +137,21 @@ index 38db2292d..7cdcbd8b3 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-config -+ travertine-config ++ flamecord-config 1.16-R0.5-SNAPSHOT jar - Waterfall-Config - Generic java configuration API intended for use with Waterfall -+ Travertine-Config -+ Generic java configuration API intended for use with Travertine ++ FlameCord-Config ++ Generic java configuration API intended for use with FlameCord @@ -164,21 +164,21 @@ index 82a411b08..b1a990c93 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-event -+ travertine-event ++ flamecord-event 1.16-R0.5-SNAPSHOT jar - Waterfall-Event - Generic java event dispatching API intended for use with Waterfall. -+ Travertine-Event -+ Generic java event dispatching API intended for use with Travertine. ++ FlameCord-Event ++ Generic java event dispatching API intended for use with FlameCord. diff --git a/log/pom.xml b/log/pom.xml index 646dbfae5..00f7b9c92 100644 @@ -189,21 +189,21 @@ index 646dbfae5..00f7b9c92 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log -+ travertine-log ++ flamecord-log 1.16-R0.5-SNAPSHOT jar - Waterfall-Log - Simplistic and performant java.util.Logger based logger and console API designed for use with Waterfall and Minecraft related applications. -+ Travertine-Log -+ Simplistic and performant java.util.Logger based logger and console API designed for use with Travertine and Minecraft related applications. ++ FlameCord-Log ++ Simplistic and performant java.util.Logger based logger and console API designed for use with FlameCord and Minecraft related applications. @@ -212,7 +212,7 @@ index 646dbfae5..00f7b9c92 100644 io.github.waterfallmc - waterfall-chat -+ travertine-chat ++ flamecord-chat ${project.version} compile @@ -225,21 +225,21 @@ index 51187fd15..9fe7044f9 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log4j -+ travertine-log4j ++ flamecord-log4j 1.16-R0.5-SNAPSHOT jar - Waterfall-Log - Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. -+ Travertine-Log -+ Simplistic and performant Log4j2 based logger and console API designed for use with Travertine and Minecraft related applications. ++ FlameCord-Log ++ Simplistic and performant Log4j2 based logger and console API designed for use with FlameCord and Minecraft related applications. 2.14.0 @@ -262,7 +262,7 @@ index 51187fd15..9fe7044f9 100644 + + + io.github.waterfallmc -+ travertine-chat ++ flamecord-chat + ${project.version} + compile + @@ -277,14 +277,14 @@ index 472314c2f..8eb065721 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-alert -+ travertine-module-cmd-alert ++ flamecord-module-cmd-alert 1.16-R0.5-SNAPSHOT jar @@ -297,14 +297,14 @@ index de8faee02..09e2835aa 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-find -+ travertine-module-cmd-find ++ flamecord-module-cmd-find 1.16-R0.5-SNAPSHOT jar @@ -317,14 +317,14 @@ index 0cab9a7ab..5d1ff0424 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-list -+ travertine-module-cmd-list ++ flamecord-module-cmd-list 1.16-R0.5-SNAPSHOT jar @@ -337,14 +337,14 @@ index 240c95487..1f6a7c681 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-send -+ travertine-module-cmd-send ++ flamecord-module-cmd-send 1.16-R0.5-SNAPSHOT jar @@ -357,14 +357,14 @@ index 4c13d5177..c353e8293 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-server -+ travertine-module-cmd-server ++ flamecord-module-cmd-server 1.16-R0.5-SNAPSHOT jar @@ -377,21 +377,21 @@ index c9849b6c1..ca0a9c87d 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT pom - Waterfall Modules - Parent project for all Waterfall modules. -+ Travertine Modules -+ Parent project for all Travertine modules. ++ FlameCord Modules ++ Parent project for all FlameCord modules. cmd-alert @@ -400,7 +400,7 @@ index c9849b6c1..ca0a9c87d 100644 io.github.waterfallmc - waterfall-api -+ travertine-api ++ flamecord-api ${project.version} compile @@ -413,14 +413,14 @@ index 45910b0e7..d1a2d86c8 100644 io.github.waterfallmc - waterfall-module -+ travertine-module ++ flamecord-module 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-reconnect-yaml -+ travertine-module-reconnect-yaml ++ flamecord-module-reconnect-yaml 1.16-R0.5-SNAPSHOT jar @@ -433,21 +433,21 @@ index db15febbc..a2efb5e52 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-native -+ travertine-native ++ flamecord-native 1.16-R0.5-SNAPSHOT jar - Waterfall-Native - Optional native code to speed up and enhance Waterfall functionality. -+ Travertine-Native -+ Optional native code to speed up and enhance Travertine functionality. ++ FlameCord-Native ++ Optional native code to speed up and enhance FlameCord functionality. @@ -460,23 +460,23 @@ index 02480a208..f61cdf375 100644 io.github.waterfallmc - waterfall-super -+ travertine-super ++ flamecord-super dev-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT pom - Waterfall-Parent - Parent project for all Waterfall modules. - https://github.com/WaterfallMC/Waterfall -+ Travertine-Parent -+ Parent project for all Travertine modules. -+ https://github.com/PaperMC/Travertine ++ FlameCord-Parent ++ Parent project for all FlameCord modules. ++ https://github.com/PaperMC/FlameCord 2015 WaterfallMC @@ -487,14 +487,14 @@ index 02480a208..f61cdf375 100644 - scm:git:git@github.com:com:WaterfallMC/Waterfall.git - scm:git:git@github.com:WaterfallMC/Waterfall.git - git@github.com:WaterfallMC/Waterfall.git -+ scm:git:git@github.com:com:PaperMC/Travertine.git -+ scm:git:git@github.com:PaperMC/Travertine.git -+ git@github.com:PaperMC/Travertine.git ++ scm:git:git@github.com:com:PaperMC/FlameCord.git ++ scm:git:git@github.com:PaperMC/FlameCord.git ++ git@github.com:PaperMC/FlameCord.git GitHub - https://github.com/PaperMC/Waterfall/issues -+ https://github.com/PaperMC/Travertine/issues ++ https://github.com/PaperMC/FlameCord/issues @@ -507,21 +507,21 @@ index 402266ca1..993cbca95 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-protocol -+ travertine-protocol ++ flamecord-protocol 1.16-R0.5-SNAPSHOT jar - Waterfall-Protocol - Minimal implementation of the Minecraft protocol for use in Waterfall -+ Travertine-Protocol -+ Minimal implementation of the Minecraft protocol for use in Travertine ++ FlameCord-Protocol ++ Minimal implementation of the Minecraft protocol for use in FlameCord @@ -530,7 +530,7 @@ index 402266ca1..993cbca95 100644 io.github.waterfallmc - waterfall-chat -+ travertine-chat ++ flamecord-chat ${project.version} compile @@ -543,19 +543,19 @@ index 602b9a93f..e2ce69e43 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-proxy -+ travertine-proxy ++ flamecord-proxy 1.16-R0.5-SNAPSHOT jar - Waterfall-Proxy -+ Travertine-Proxy ++ FlameCord-Proxy Proxy component of the Elastic Portal Suite @@ -564,35 +564,35 @@ index 602b9a93f..e2ce69e43 100644 io.github.waterfallmc - waterfall-api -+ travertine-api ++ flamecord-api ${project.version} compile io.github.waterfallmc - waterfall-log4j -+ travertine-log4j ++ flamecord-log4j ${project.version} compile io.github.waterfallmc - waterfall-native -+ travertine-native ++ flamecord-native ${project.version} compile io.github.waterfallmc - waterfall-protocol -+ travertine-protocol ++ flamecord-protocol ${project.version} compile io.github.waterfallmc - waterfall-query -+ travertine-query ++ flamecord-query ${project.version} compile @@ -605,7 +605,7 @@ index 338c30d35..c04992523 100644 final String url = String.format( "https://papermc.io/api/v2/projects/%1$s/versions/%2$s/builds/%3$s/downloads/%4$s-%2$s-%3$s.jar", - "waterfall", -+ "travertine", // Travertine ++ "flamecord", // FlameCord net.md_5.bungee.api.ProxyServer.getInstance().getVersion().split(":")[2].split("-")[0], version.getBuild(), module.getName() @@ -618,21 +618,21 @@ index 8ce88f4a4..813696e45 100644 io.github.waterfallmc - waterfall-parent -+ travertine-parent ++ flamecord-parent 1.16-R0.5-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-query -+ travertine-query ++ flamecord-query 1.16-R0.5-SNAPSHOT jar - Waterfall-Query - Minecraft query implementation based on the Waterfall API. -+ Travertine-Query -+ Minecraft query implementation based on the Travertine API. ++ FlameCord-Query ++ Minecraft query implementation based on the FlameCord API. @@ -641,7 +641,7 @@ index 8ce88f4a4..813696e45 100644 io.github.waterfallmc - waterfall-api -+ travertine-api ++ flamecord-api ${project.version} compile diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch similarity index 88% rename from Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch rename to Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index bc8a74a7..43775c05 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-Travertine.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,7 +1,7 @@ From a5f023bb3c21941eaf45f1c8946b719d0752590e Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 -Subject: [PATCH] Rename references from Waterfall to Travertine +Subject: [PATCH] Rename references from Waterfall to FlameCord diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -13,7 +13,7 @@ index a4516ed96..1f63a2c27 100644 if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 ) { - System.err.println( "*** ERROR *** Waterfall requires Java 8 or above to function! Please download and install it!" ); -+ System.err.println( "*** ERROR *** Travertine requires Java 8 or above to function! Please download and install it!" ); ++ System.err.println( "*** ERROR *** FlameCord requires Java 8 or above to function! Please download and install it!" ); System.out.println( "You can check your Java version with the command: java -version" ); return; } @@ -26,7 +26,7 @@ index d703d6d24..d8dcdc1e3 100644 public LogDispatcher(BungeeLogger logger) { - super( "Waterfall Logger Thread" ); -+ super( "Travertine Logger Thread" ); ++ super( "FlameCord Logger Thread" ); this.logger = logger; } @@ -39,7 +39,7 @@ index c09f5b4c3..97de4271c 100644 { // Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up. - Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Waterfall in directory with ! in path." ); -+ Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Travertine in directory with ! in path." ); ++ Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use FlameCord in directory with ! in path." ); try { @@ -48,7 +48,7 @@ index c09f5b4c3..97de4271c 100644 public String getName() { - return "Waterfall"; -+ return "Travertine"; ++ return "FlameCord"; } @Override @@ -61,7 +61,7 @@ index 356805285..1c2628d31 100644 BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); - bungee.getLogger().info( "Enabled Waterfall version " + bungee.getVersion() ); -+ bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); ++ bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); bungee.start(); if ( !options.has( "noconsole" ) ) @@ -74,7 +74,7 @@ index b26035cf9..4e2c6129c 100644 public void execute(CommandSender sender, String[] args) { - sender.sendMessage( ChatColor.BLUE + "This server is running Waterfall version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -87,8 +87,8 @@ index 720d0c3b5..dca7601b0 100644 - sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "Waterfall has been reloaded." - + " This is NOT advisable and you will not be supported with any issues that arise! Please restart Waterfall ASAP." ); -+ sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "Travertine has been reloaded." -+ + " This is NOT advisable and you will not be supported with any issues that arise! Please restart Travertine ASAP." ); ++ sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "FlameCord has been reloaded." ++ + " This is NOT advisable and you will not be supported with any issues that arise! Please restart FlameCord ASAP." ); } } diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -100,7 +100,7 @@ index 65121ba24..d4fad294c 100644 String name = entry.getKey(); String addr = get( "address", "localhost:25565", val ); - String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Waterfall - Forced Host", val ) ); -+ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); ++ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); boolean restricted = get( "restricted", false, val ); SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); diff --git a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch deleted file mode 100644 index 7aa44f7b..00000000 --- a/Waterfall-Proxy-Patches/0013-FlameCord-rebrand.patch +++ /dev/null @@ -1,56 +0,0 @@ -From af418e4ac240fa80ec84bf88b6089e0b494b2204 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:11:48 +0800 -Subject: [PATCH] FlameCord rebrand - - -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 527f310e..a4ef6d3b 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { - YamlConfig config = new YamlConfig(new File("waterfall.yml")); - config.load(false); // Load, but no permissions - logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); -- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); -+ // FlameCord - Make the version look better -+ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); - useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); - // Throttling options - tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3b0dff08..41d752a5 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -547,13 +547,13 @@ public class BungeeCord extends ProxyServer - @Override - public String getName() - { -- return "Travertine"; -+ return "FlameCord"; - } - - @Override - public String getVersion() - { -- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.3"; - } - - public void reloadMessages() -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 4e2c6129..aeda7963 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -@@ -16,6 +16,7 @@ public class CommandBungee extends Command - @Override - public void execute(CommandSender sender, String[] args) - { -- sender.sendMessage( ChatColor.BLUE + "This server is running Travertine version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ // FlameCord - Use custom version message -+ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); - } - } --- -2.31.1 - From 95cc0d0d54e150eb4afa34f5726514dce5ae0862 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:20:28 -0300 Subject: [PATCH 107/499] rename Travertine -> FlameCord --- flamecord | 4 ++-- scripts/applyPatches.sh | 2 +- scripts/build.sh | 2 +- scripts/edit.sh | 2 +- scripts/rebuildPatches.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flamecord b/flamecord index 88cf4ecc..744b8f56 100755 --- a/flamecord +++ b/flamecord @@ -20,7 +20,7 @@ case "$1" in scripts/wigglePatch.py ;; *) - echo "Travertine build tool command. This provides a variety of commands to control the Travertine" + echo "FlameCord build tool command. This provides a variety of commands to control the FlameCord" echo "build. View below for details of the available commands." echo "" echo "Commands:" @@ -28,7 +28,7 @@ case "$1" in echo " * p, patch | Applies all the patches to BungeeCord" echo " * m, up, merge | Utility to aid in merging upstream" echo " * b, build | Builds the project" - echo " | The bootstrap artifact can be found in Travertine-Proxy/bootstrap/target/" + echo " | The bootstrap artifact can be found in FlameCord-Proxy/bootstrap/target/" echo " * e, edit | Runs git rebase -i for Waterfall, allowing patches to be easily modified" echo " * w, wiggle | Helps to apply patches that fail to using default Git." ;; diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index fad21742..e0c0e1e7 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -68,6 +68,6 @@ popd basedir=$(dirname "$basedir") # Apply travertine patches -applyPatch Waterfall/Waterfall-Proxy Travertine-Proxy HEAD +applyPatch Waterfall/Waterfall-Proxy FlameCord-Proxy HEAD enableCommitSigningIfNeeded diff --git a/scripts/build.sh b/scripts/build.sh index 683134a5..1533f786 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,6 +2,6 @@ git submodule update --recursive --init && ./scripts/applyPatches.sh if [ "$1" == "--jar" ]; then - pushd Travertine-Proxy + pushd FlameCord-Proxy mvn clean package fi diff --git a/scripts/edit.sh b/scripts/edit.sh index dda5dd08..cde4c617 100755 --- a/scripts/edit.sh +++ b/scripts/edit.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -pushd Travertine-Proxy +pushd FlameCord-Proxy git rebase --interactive upstream/upstream popd diff --git a/scripts/rebuildPatches.sh b/scripts/rebuildPatches.sh index 95353841..901cadb0 100755 --- a/scripts/rebuildPatches.sh +++ b/scripts/rebuildPatches.sh @@ -57,5 +57,5 @@ function savePatches { echo " Patches saved for $what to $what_name-Patches/" } -savePatches "Waterfall/Waterfall-Proxy" "Travertine-Proxy" +savePatches "Waterfall/Waterfall-Proxy" "FlameCord-Proxy" ) From 68d0e61f4fedd2cba4bb050bf62a5ac240a77cd5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:21:53 -0300 Subject: [PATCH 108/499] update FlameCord pom changes --- .../0006-FlameCord-POM-Changes.patch | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch index f0a13814..c08c0672 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch @@ -16,29 +16,29 @@ index 00000000..ca88559e + + + io.github.waterfallmc -+ travertine-parent ++ flamecord-parent + 1.16-R0.5-SNAPSHOT + ../pom.xml + + + dev._2lstudios -+ travertine-flamecord ++ flamecord-flamecord + 1.16-R0.5-SNAPSHOT + jar + -+ Travertine-FlameCord ++ FlameCord-FlameCord + FlameCord adds security essentials and new configuration options + + + + io.github.waterfallmc -+ travertine-config ++ flamecord-config + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-chat ++ flamecord-chat + ${project.version} + compile + @@ -80,7 +80,7 @@ index 993cbca9..3867501a 100644 + + + dev._2lstudios -+ travertine-flamecord ++ flamecord-flamecord + ${project.version} + compile + @@ -99,43 +99,43 @@ index 5dfc6f51..8fb07275 100644 + + + dev._2lstudios -+ travertine-flamecord ++ flamecord-flamecord + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-cmd-alert ++ flamecord-module-cmd-alert + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-cmd-find ++ flamecord-module-cmd-find + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-cmd-list ++ flamecord-module-cmd-list + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-cmd-send ++ flamecord-module-cmd-send + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-cmd-server ++ flamecord-module-cmd-server + ${project.version} + compile + + + io.github.waterfallmc -+ travertine-module-reconnect-yaml ++ flamecord-module-reconnect-yaml + ${project.version} + compile + From e703520dd2285ece47345a3c3564f691578c6363 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:23:21 -0300 Subject: [PATCH 109/499] rename Travertine -> FlameCord --- .github/workflows/flamecord-build.yml | 2 +- .gitignore | 2 +- CONTRIBUTING.md | 14 ++++----- README.md | 30 +++++++++---------- ...sable-update-checker-Use-bungee-name.patch | 4 +-- .../0009-Remove-Quitting-reason.patch | 4 +-- ...ections-Don-t-flush-if-not-necessary.patch | 2 +- .../0011-Use-elseIfs.patch | 2 +- .../0026-Fix-ByteBuf-memory-leaks.patch | 2 +- pom.xml | 10 +++---- scripts/applyPatches.sh | 2 +- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 27a0c35b..b37fcfc9 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -47,4 +47,4 @@ jobs: uses: actions/upload-artifact@v2.2.3 with: name: FlameCord-JDK${{ matrix.java }} - path: Travertine-Proxy/bootstrap/target/Travertine.jar + path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/.gitignore b/.gitignore index 88e5a161..e9b9b106 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -Travertine-Proxy +FlameCord-Proxy # intellij *.iml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6791932d..ab30dc72 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,25 +3,25 @@ Contributing to FlameCord WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. ## Understanding Patches -Patches to FlameCord are very simple, but center around the directory 'Travertine-Proxy' +Patches to FlameCord are very simple, but center around the directory 'FlameCord-Proxy' Assuming you already have forked the repository: 1. Pull the latest changes from the main repository 2. Type `./flamecord p` in git bash to apply the changes from upstream -3. cd into `Travertine-Proxy` for proxy changes +3. cd into `FlameCord-Proxy` for proxy changes This directory is not a git repository in the traditional sense: -- Every single commit in Travertine-Proxy is a patch. -- 'origin/master' points to a directory similar to Travertine-Proxy but for FlameCord -- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, Travertine, Waterfall, and Bungeecord don't - - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update Travertine +- Every single commit in FlameCord-Proxy is a patch. +- 'origin/master' points to a directory similar to FlameCord-Proxy but for FlameCord +- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, FlameCord, Waterfall, and Bungeecord don't + - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update FlameCord ## Adding Patches Adding patches to FlameCord is very simple: -1. Modify `Travertine-Proxy` with the appropriate changes +1. Modify `FlameCord-Proxy` with the appropriate changes 2. Type `git add .` to add your changes 3. Run `git commit` with the desired patch message 4. Run `./flamecord rb` in the main directory to convert your commit into a new patch diff --git a/README.md b/README.md index ffa800c9..6b239628 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ FlameCord ======= -FlameCord is a patch for Travertine to fix possible exploits and add useful functionalities. +FlameCord is a patch for FlameCord to fix possible exploits and add useful functionalities. -FlameCord is compiled like Travertine does; Please follow the CONTRIBUTING.md file. If you need help you can always contact us on Discord. +FlameCord is compiled like FlameCord does; Please follow the CONTRIBUTING.md file. If you need help you can always contact us on Discord. -To compile FlameCord you need the same requirements as Travertine, and run the command `./flamecord b` to get the corresponding jar. +To compile FlameCord you need the same requirements as FlameCord, and run the command `./flamecord b` to get the corresponding jar. -Travertine [![Build Status](https://papermc.io/ci/job/Travertine/badge/icon)](https://papermc.io/ci/job/Travertine/) +FlameCord [![Build Status](https://papermc.io/ci/job/FlameCord/badge/icon)](https://papermc.io/ci/job/FlameCord/) ======= -Travertine is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. +FlameCord is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. Waterfall focuses on three main areas: @@ -20,29 +20,29 @@ Waterfall focuses on three main areas: * **Features**: Waterfall aims to include more features than canonical BungeeCord. * **Scalability**: Waterfall should be able to handle a large number of concurrent players, given a reasonably modern CPU, memory, and good network connection. -Travertine focuses on one main area: +FlameCord focuses on one main area: -* **Additional Client Version Support**: Travertine aims to support client versions older then what is supported in upstream. This includes 1.7 support. Additionally Travertine may release Snapshot and PRE Client support patches as time permits. +* **Additional Client Version Support**: FlameCord aims to support client versions older then what is supported in upstream. This includes 1.7 support. Additionally FlameCord may release Snapshot and PRE Client support patches as time permits. ## Why fork Waterfall? -Travertine has a goal of adding additional protocol versions. +FlameCord has a goal of adding additional protocol versions. -Travertine was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. +FlameCord was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. -Travertine will track upstream Waterfall and merge changes as needed. +FlameCord will track upstream Waterfall and merge changes as needed. ## How to (Server Admins) -Download a copy of Travertine.jar from our homepage here: [Travertine](https://papermc.io/downloads#Travertine) +Download a copy of FlameCord.jar from our homepage here: [FlameCord](https://papermc.io/downloads#FlameCord) -Travertine requires **Java 8** or above. +FlameCord requires **Java 8** or above. ## How To (Compiling from source) -To compile Travertine, you need JDK8, git, bash, maven, and an internet connection. +To compile FlameCord, you need JDK8, git, bash, maven, and an internet connection. -Clone this repo, run `./travertine b` from *bash*, get jar from `Travertine-Proxy/bootstrap/target` +Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` ## Join us @@ -54,4 +54,4 @@ Special Thanks To ----------------- ![YourKit-Logo](https://yourkit.com/images/yklogo.png) -[YourKit](https://yourkit.com/), makers of the outstanding Java profiler, supports open source projects of all kinds with their full-featured [Java](https://yourkit.com/features/) and [.NET](https://yourkit.com/dotnet/features/) application profilers. We thank them for granting Travertine an OSS license so that we can make our software the best it can be. +[YourKit](https://yourkit.com/), makers of the outstanding Java profiler, supports open source projects of all kinds with their full-featured [Java](https://yourkit.com/features/) and [.NET](https://yourkit.com/dotnet/features/) application profilers. We thank them for granting FlameCord an OSS license so that we can make our software the best it can be. diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index bf97eaa6..514e23e8 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -31,7 +31,7 @@ index 6a5193fe..e82073d4 100644 BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); -- bungee.getLogger().info( "Enabled Travertine version " + bungee.getVersion() ); +- bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); + // FlameCord - Use bungee name + bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); bungee.start(); @@ -53,7 +53,7 @@ index d4fad294..7994c1c1 100644 Map val = entry.getValue(); String name = entry.getKey(); String addr = get( "address", "localhost:25565", val ); -- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Travertine - Forced Host", val ) ); +- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); + // FlameCord - Use Bungee name instead + String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); boolean restricted = get( "restricted", false, val ); diff --git a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch index d6bf9cfd..61de150b 100644 --- a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch +++ b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch @@ -17,7 +17,7 @@ index 00749538..7b99c466 100644 + user.getServer().disconnect(); } else { - // Travertine start + // FlameCord start @@ -364,13 +365,15 @@ public class ServerConnector extends PacketHandler user.setDimension( login.getDimension() ); @@ -56,7 +56,7 @@ index ad3bdee5..c05714ba 100644 +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -92,6 +92,7 @@ public class UpstreamBridge extends PacketHandler } - // Travertine end + // FlameCord end } + // FlameCord - Remove "Quitting" reason con.getServer().disconnect( "Quitting" ); diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 8ea1dec5..d8c35abd 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -36,7 +36,7 @@ index 5407c20a..e9937428 100644 + return; + } + - // Travertine start + // FlameCord start if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) { @@ -304,11 +321,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch index bb96181b..0a2757a8 100644 --- a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch +++ b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch @@ -15,7 +15,7 @@ index d54d8539..0dd2884d 100644 + // FlameCord - Use elseIfs if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { - // Travertine start + // FlameCord start @@ -313,8 +314,7 @@ public class DownstreamBridge extends PacketHandler con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; diff --git a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch index d78eba44..ca12aa0f 100644 --- a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch @@ -25,7 +25,7 @@ index 522bd93d..494375cd 100644 + brand.release(); + } } - // Travertine end + // FlameCord end } 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 index 474551d3..8716d0c8 100644 diff --git a/pom.xml b/pom.xml index 442e1dd9..8b9c2e01 100644 --- a/pom.xml +++ b/pom.xml @@ -3,16 +3,16 @@ 4.0.0 io.github.waterfallmc - travertine-super + flamecord-super dev-SNAPSHOT pom - Travertine-Super - Super project for Travertine. - https://github.com/WaterfallMC/Travertine + FlameCord-Super + Super project for FlameCord. + https://github.com/WaterfallMC/FlameCord - Travertine-Proxy + FlameCord-Proxy diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index e0c0e1e7..b8b42a5e 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -67,7 +67,7 @@ applyPatch BungeeCord Waterfall-Proxy HEAD popd basedir=$(dirname "$basedir") -# Apply travertine patches +# Apply flamecord patches applyPatch Waterfall/Waterfall-Proxy FlameCord-Proxy HEAD enableCommitSigningIfNeeded From b21b19a9e059a1e20f6b1b0cd2f91d87fb17c487 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:27:45 -0300 Subject: [PATCH 110/499] reorder patches --- ...ke-PlayerHandshakeEvent-cancellable.patch} | 8 +++---- ...0004-Make-a-getter-for-the-callback.patch} | 4 ++-- ...patch => 0005-FlameCord-POM-Changes.patch} | 12 +++++----- ...able-update-checker-Use-bungee-name.patch} | 10 ++++---- .../0007-Change-replaceAll-to-replace.patch | 23 +++++++++++++++++++ 5 files changed, 40 insertions(+), 17 deletions(-) rename Waterfall-Proxy-Patches/{0004-Make-PlayerHandshakeEvent-cancellable.patch => 0003-Make-PlayerHandshakeEvent-cancellable.patch} (92%) rename Waterfall-Proxy-Patches/{0005-Make-a-getter-for-the-callback.patch => 0004-Make-a-getter-for-the-callback.patch} (91%) rename Waterfall-Proxy-Patches/{0006-FlameCord-POM-Changes.patch => 0005-FlameCord-POM-Changes.patch} (96%) rename Waterfall-Proxy-Patches/{0007-Disable-update-checker-Use-bungee-name.patch => 0006-Disable-update-checker-Use-bungee-name.patch} (95%) create mode 100644 Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch diff --git a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0003-Make-PlayerHandshakeEvent-cancellable.patch similarity index 92% rename from Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch rename to Waterfall-Proxy-Patches/0003-Make-PlayerHandshakeEvent-cancellable.patch index 1137cae6..5d321fdd 100644 --- a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0003-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From 52968afed745e49517f2eefa5aae6be6a36aa714 Mon Sep 17 00:00:00 2001 +From f83c723e3637308caaeb936b9549827f53f36cc9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 3b82219d..5407c20a 100644 +index b7ecd828..49ba34db 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 -@@ -338,7 +338,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -320,7 +320,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index 3b82219d..5407c20a 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0004-Make-a-getter-for-the-callback.patch similarity index 91% rename from Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch rename to Waterfall-Proxy-Patches/0004-Make-a-getter-for-the-callback.patch index a9189cd3..3ac19527 100644 --- a/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch +++ b/Waterfall-Proxy-Patches/0004-Make-a-getter-for-the-callback.patch @@ -1,4 +1,4 @@ -From dc79f49dd3b926c3f156f66dd6996fcfd00a47b3 Mon Sep 17 00:00:00 2001 +From d6e3943dcc28a4e9a6639fafbeab0526010cdadb Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:58:18 +0800 Subject: [PATCH] Make a getter for the callback @@ -19,5 +19,5 @@ index cf85ca06..8a945a99 100644 private final Map intents = new ConcurrentHashMap<>(); private final AtomicBoolean fired = new AtomicBoolean(); -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0005-FlameCord-POM-Changes.patch similarity index 96% rename from Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch rename to Waterfall-Proxy-Patches/0005-FlameCord-POM-Changes.patch index c08c0672..7b67e218 100644 --- a/Waterfall-Proxy-Patches/0006-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0005-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 2d04ddc88508fef44e738bad09a805d84b86201a Mon Sep 17 00:00:00 2001 +From 390c73f1736afb9ea786fcfa142b671f087aeb1f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..ca88559e +index 00000000..5f618ddf --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -55,7 +55,7 @@ index 00000000..ca88559e + + diff --git a/pom.xml b/pom.xml -index aa57fe03..23153179 100644 +index b1052b2b..c46258f2 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,9 @@ @@ -69,7 +69,7 @@ index aa57fe03..23153179 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 993cbca9..3867501a 100644 +index 044be0c3..6fa1ade1 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -64,5 +64,14 @@ @@ -88,7 +88,7 @@ index 993cbca9..3867501a 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 5dfc6f51..8fb07275 100644 +index d3750214..05255a29 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -150,6 +150,51 @@ @@ -144,5 +144,5 @@ index 5dfc6f51..8fb07275 100644 -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch similarity index 95% rename from Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch rename to Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch index 514e23e8..3b4b5e44 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch @@ -1,14 +1,14 @@ -From a8a33b052d445c78560370674f7b287e77396721 Mon Sep 17 00:00:00 2001 +From acb48a3f1ccc1ec0047025c71ca77d6c70eac9b7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 6a5193fe..e82073d4 100644 +index 713bbbef..96db5e5e 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -53,25 +53,12 @@ public class BungeeCordLauncher +@@ -58,25 +58,12 @@ public class BungeeCordLauncher return; } @@ -38,7 +38,7 @@ index 6a5193fe..e82073d4 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index d4fad294..7994c1c1 100644 +index d5b3e6f8..7994c1c1 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -22,6 +22,7 @@ import java.util.Locale; @@ -70,5 +70,5 @@ index d4fad294..7994c1c1 100644 int maxPlayers = get( "max_players", 1, val ); -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch new file mode 100644 index 00000000..a1018bd5 --- /dev/null +++ b/Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch @@ -0,0 +1,23 @@ +From 91cb9c13a57df9a21e2e2894a3365d36e2e54d08 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:01:37 +0800 +Subject: [PATCH] Change replaceAll() to replace() + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 2d9c0cda..af73283e 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -126,7 +126,8 @@ public class ServerConnector extends PacketHandler + newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); + + // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. +- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); ++ // FlameCord - Change replaceAll() to replace() ++ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); + + // All done. + properties = newp; +-- +2.31.1.windows.1 + From e0bbf325bf9f90d8f83acea77001711b0b16e8ec Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:33:42 -0300 Subject: [PATCH 111/499] reorder patches --- ...ameCord-POM-Changes.patch => 0003-FlameCord-POM-Changes.patch} | 0 ...ble.patch => 0004-Make-PlayerHandshakeEvent-cancellable.patch} | 0 ...e-callback.patch => 0005-Make-a-getter-for-the-callback.patch} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Waterfall-Proxy-Patches/{0005-FlameCord-POM-Changes.patch => 0003-FlameCord-POM-Changes.patch} (100%) rename Waterfall-Proxy-Patches/{0003-Make-PlayerHandshakeEvent-cancellable.patch => 0004-Make-PlayerHandshakeEvent-cancellable.patch} (100%) rename Waterfall-Proxy-Patches/{0004-Make-a-getter-for-the-callback.patch => 0005-Make-a-getter-for-the-callback.patch} (100%) diff --git a/Waterfall-Proxy-Patches/0005-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0003-FlameCord-POM-Changes.patch similarity index 100% rename from Waterfall-Proxy-Patches/0005-FlameCord-POM-Changes.patch rename to Waterfall-Proxy-Patches/0003-FlameCord-POM-Changes.patch diff --git a/Waterfall-Proxy-Patches/0003-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch similarity index 100% rename from Waterfall-Proxy-Patches/0003-Make-PlayerHandshakeEvent-cancellable.patch rename to Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch diff --git a/Waterfall-Proxy-Patches/0004-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch similarity index 100% rename from Waterfall-Proxy-Patches/0004-Make-a-getter-for-the-callback.patch rename to Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch From 8f040d2762f3206a710c2685a70fa35adc8ca130 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:35:13 -0300 Subject: [PATCH 112/499] reorder patches --- ...ameCord-POM-Changes.patch => 0002-FlameCord-POM-Changes.patch} | 0 ...h => 0003-Rename-references-from-Waterfall-to-FlameCord.patch} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Waterfall-Proxy-Patches/{0003-FlameCord-POM-Changes.patch => 0002-FlameCord-POM-Changes.patch} (100%) rename Waterfall-Proxy-Patches/{0002-Rename-references-from-Waterfall-to-FlameCord.patch => 0003-Rename-references-from-Waterfall-to-FlameCord.patch} (100%) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch similarity index 100% rename from Waterfall-Proxy-Patches/0003-FlameCord-POM-Changes.patch rename to Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch similarity index 100% rename from Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch rename to Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch From 860e0505e2ff32679360e19ff76ef5032b6c5a7e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:54:26 -0300 Subject: [PATCH 113/499] remove duplicated patch --- .../0008-Change-replaceAll-to-replace.patch | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch deleted file mode 100644 index e2b1c1fa..00000000 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ /dev/null @@ -1,23 +0,0 @@ -From e67e9ed998a04f1aacd313d5ca3a9dd3755a942a Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:01:37 +0800 -Subject: [PATCH] Change replaceAll() to replace() - - -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a4c25575..00749538 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -127,7 +127,8 @@ public class ServerConnector extends PacketHandler - newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); - - // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. -- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); -+ // FlameCord - Change replaceAll() to replace() -+ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); - - // All done. - properties = newp; --- -2.31.1 - From 5b8548ce64c39d84a4fe6ee21bb472f8c4b704de Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 20:00:05 -0300 Subject: [PATCH 114/499] remove remove quitting reason patch --- .../0009-Remove-Quitting-reason.patch | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch diff --git a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch b/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch deleted file mode 100644 index 61de150b..00000000 --- a/Waterfall-Proxy-Patches/0009-Remove-Quitting-reason.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 13fb2edfae12310bd656afc2a67208c856de6b1b Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:03:12 +0800 -Subject: [PATCH] Remove "Quitting" reason - - -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 00749538..7b99c466 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -269,7 +269,8 @@ public class ServerConnector extends PacketHandler - user.getSentBossBars().clear(); - - user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); -- user.getServer().disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ user.getServer().disconnect(); - } else - { - // FlameCord start -@@ -364,13 +365,15 @@ public class ServerConnector extends PacketHandler - user.setDimension( login.getDimension() ); - - // Remove from old servers -- user.getServer().disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ user.getServer().disconnect(); - } - - // TODO: Fix this? - if ( !user.isActive() ) - { -- server.disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - // Silly server admins see stack trace and die - bungee.getLogger().warning( "No client connected for pending server!" ); - return; -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 96df0175..fc1798fb 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -428,7 +428,8 @@ public final class UserConnection implements ProxiedPlayer - if ( server != null ) - { - server.setObsolete( true ); -- server.disconnect( "Quitting" ); -+ // FlameCord - Remove "Quitting" reason -+ server.disconnect(); - } - } - } -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 ad3bdee5..c05714ba 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 -@@ -92,6 +92,7 @@ public class UpstreamBridge extends PacketHandler - } - // FlameCord end - } -+ // FlameCord - Remove "Quitting" reason - con.getServer().disconnect( "Quitting" ); - } - } --- -2.31.1 - From 213e226efd872c7a877b1e07a017fbd18329e6ab Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 20:33:36 -0300 Subject: [PATCH 115/499] rebuild patches --- ...ctions-Don-t-flush-if-not-necessary.patch} | 73 ++++---- ...-Checks.patch => 0009-Packet-Checks.patch} | 10 +- ...ch => 0010-Default-timeout-to-10000.patch} | 6 +- ...-encrypt-only-if-onlineMode-is-true.patch} | 8 +- .../0011-Use-elseIfs.patch | 157 ---------------- ...012-Don-t-allow-name-containing-dot.patch} | 8 +- ...3-Use-pipeline-to-reduce-redundancy.patch} | 4 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 8 +- ...-to-avoid-multiple-incoming-packets.patch} | 12 +- .../0015-use-address-getHostString.patch | 32 ---- ...teException-to-QuietException-and-e.patch} | 8 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 8 +- ...tch => 0018-FlameCord-General-Patch.patch} | 34 ++-- ...tch => 0019-FlameCord-module-system.patch} | 12 +- ...020-FlameCord-message-configuration.patch} | 8 +- .../0021-Fix-ByteBuf-memory-leaks.patch | 127 +++++++++++++ ...> 0022-Check-if-packetID-is-invalid.patch} | 6 +- ...ystem.patch => 0023-Firewall-System.patch} | 24 +-- ...ch => 0024-FlameCord-logger-options.patch} | 48 +++-- ...patch => 0025-Always-release-packet.patch} | 10 +- ...ded-an-api-method-to-unload-Plugins.patch} | 4 +- .../0026-Fix-ByteBuf-memory-leaks.patch | 167 ------------------ ...s.patch => 0027-Apply-buffer-limits.patch} | 12 +- ...ead.patch => 0028-Limit-String-read.patch} | 6 +- 24 files changed, 281 insertions(+), 511 deletions(-) rename Waterfall-Proxy-Patches/{0010-Close-connections-Don-t-flush-if-not-necessary.patch => 0008-Close-connections-Don-t-flush-if-not-necessary.patch} (76%) rename Waterfall-Proxy-Patches/{0012-Packet-Checks.patch => 0009-Packet-Checks.patch} (90%) rename Waterfall-Proxy-Patches/{0014-Default-timeout-to-10000.patch => 0010-Default-timeout-to-10000.patch} (86%) rename Waterfall-Proxy-Patches/{0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch => 0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch} (84%) delete mode 100644 Waterfall-Proxy-Patches/0011-Use-elseIfs.patch rename Waterfall-Proxy-Patches/{0017-Don-t-allow-name-containing-dot.patch => 0012-Don-t-allow-name-containing-dot.patch} (85%) rename Waterfall-Proxy-Patches/{0018-Use-pipeline-to-reduce-redundancy.patch => 0013-Use-pipeline-to-reduce-redundancy.patch} (97%) rename Waterfall-Proxy-Patches/{0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (83%) rename Waterfall-Proxy-Patches/{0020-Finish-early-to-avoid-multiple-incoming-packets.patch => 0015-Finish-early-to-avoid-multiple-incoming-packets.patch} (82%) delete mode 100644 Waterfall-Proxy-Patches/0015-use-address-getHostString.patch rename Waterfall-Proxy-Patches/{0021-Change-IllegalStateException-to-QuietException-and-e.patch => 0016-Change-IllegalStateException-to-QuietException-and-e.patch} (83%) rename Waterfall-Proxy-Patches/{0022-Don-t-declare-uuid-unless-it-s-null.patch => 0017-Don-t-declare-uuid-unless-it-s-null.patch} (84%) rename Waterfall-Proxy-Patches/{0023-FlameCord-General-Patch.patch => 0018-FlameCord-General-Patch.patch} (95%) rename Waterfall-Proxy-Patches/{0024-FlameCord-module-system.patch => 0019-FlameCord-module-system.patch} (96%) rename Waterfall-Proxy-Patches/{0025-FlameCord-message-configuration.patch => 0020-FlameCord-message-configuration.patch} (98%) create mode 100644 Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch rename Waterfall-Proxy-Patches/{0027-Check-if-packetID-is-invalid.patch => 0022-Check-if-packetID-is-invalid.patch} (91%) rename Waterfall-Proxy-Patches/{0028-Firewall-System.patch => 0023-Firewall-System.patch} (97%) rename Waterfall-Proxy-Patches/{0029-FlameCord-logger-options.patch => 0024-FlameCord-logger-options.patch} (83%) rename Waterfall-Proxy-Patches/{0030-Always-release-packet.patch => 0025-Always-release-packet.patch} (83%) rename Waterfall-Proxy-Patches/{0031-Added-an-api-method-to-unload-Plugins.patch => 0026-Added-an-api-method-to-unload-Plugins.patch} (97%) delete mode 100644 Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch rename Waterfall-Proxy-Patches/{0032-Apply-buffer-limits.patch => 0027-Apply-buffer-limits.patch} (94%) rename Waterfall-Proxy-Patches/{0033-Limit-String-read.patch => 0028-Limit-String-read.patch} (89%) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 76% rename from Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch rename to Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch index d8c35abd..fb6e3948 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From cdf91cda29d5b69410c130012de20dba5d7da506 Mon Sep 17 00:00:00 2001 +From f1b1c7e6c185bc7a13cf6125dc2672b9a53e12e1 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 5407c20a..e9937428 100644 +index 49ba34db..6e148782 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 -@@ -194,6 +194,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -192,6 +192,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,11 +22,10 @@ index 5407c20a..e9937428 100644 String kickMessage; if ( v1_5 ) -@@ -264,6 +271,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); - } -+ +@@ -257,6 +264,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void done(ProxyPingEvent pingResult, Throwable error) + { + // FlameCord - Close if response is null + // FlameCord - Return if connection is closed + if (pingResult.getResponse() == null) { @@ -36,10 +35,10 @@ index 5407c20a..e9937428 100644 + return; + } + - // FlameCord start - if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) - { -@@ -304,11 +321,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Gson gson = BungeeCord.getInstance().gson; + unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); + if ( bungee.getConnectionThrottle() != null ) +@@ -286,11 +302,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -47,15 +46,17 @@ index 5407c20a..e9937428 100644 - Preconditions.checkState(thisState == State.PING, "Not expecting PING"); - } + // FlameCord - Never accept invalid packets -+ Preconditions.checkState(thisState == State.PING, "Not expecting PING"); ++ Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); ++ unsafe.sendPacket( ping ); - disconnect( "" ); ++ + // FlameCord - Close instead of disconnect + ch.close(); } @Override -@@ -624,7 +641,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -606,7 +624,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -117,34 +118,8 @@ index 6dc5633f..5c05f2b9 100644 ch.pipeline().addBefore( baseName, name, handler ); } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 270545f2..b0825e51 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -56,7 +56,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - if ( handler != null ) - { -- channel.markClosed(); -+ // FlameCord - close instead of markClosed -+ channel.close(); - handler.disconnected( channel ); - - if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -@@ -186,8 +187,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - ProxyServer.getInstance().getLogger().log( Level.SEVERE, handler + " - exception processing exception", ex ); - } - } -- -- ctx.close(); - } -+ -+ // FlameCord - Close even if the channel isn't active -+ ctx.close(); - } - } 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 96704d5e..4996a7b4 100644 +index 96704d5e..654203ab 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -170,6 +145,20 @@ index 96704d5e..4996a7b4 100644 }; public static final Base BASE = new Base(); private static final KickStringWriter legacyKicker = new KickStringWriter(); +@@ -196,5 +205,13 @@ public class PipelineUtils + + ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); + } ++ ++ // FlameCord - Close on exception caught ++ @Override ++ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ++ cause.printStackTrace(); ++ ++ ctx.close(); ++ } + } + } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index 0c1ecfb8..b3bdfd05 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -184,5 +173,5 @@ index 0c1ecfb8..b3bdfd05 100644 } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch b/Waterfall-Proxy-Patches/0009-Packet-Checks.patch similarity index 90% rename from Waterfall-Proxy-Patches/0012-Packet-Checks.patch rename to Waterfall-Proxy-Patches/0009-Packet-Checks.patch index 8f1ae031..1fa6617f 100644 --- a/Waterfall-Proxy-Patches/0012-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0009-Packet-Checks.patch @@ -1,11 +1,11 @@ -From 8ead27c615cb3fcc53cabf3399c65347d4fd6994 Mon Sep 17 00:00:00 2001 +From f61307367e3fb2e33ef946df1b28973645f3eba8 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 2caadfed..d4729244 100644 +index 01d35f41..ec07ae6f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -29,10 +29,10 @@ index 2caadfed..d4729244 100644 Object packetTypeInfo = null; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 1351d5d5..d68cc2ce 100644 +index 270545f2..3bbc1510 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -79,6 +79,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -78,6 +78,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { @@ -45,5 +45,5 @@ index 1351d5d5..d68cc2ce 100644 { HAProxyMessage proxy = (HAProxyMessage) msg; -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch similarity index 86% rename from Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch rename to Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch index 2c9182cd..cc794ed3 100644 --- a/Waterfall-Proxy-Patches/0014-Default-timeout-to-10000.patch +++ b/Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch @@ -1,11 +1,11 @@ -From b8e427d68694e1af04e005b78f4c58e161c8ee35 Mon Sep 17 00:00:00 2001 +From 7ecd3743ff93e43b827419fd1705b75aa9cf2e8c Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 Subject: [PATCH] Default timeout to 10000 diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197a..1294495d 100644 +index 85d2197a..c41930ae 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig @@ -19,5 +19,5 @@ index 85d2197a..1294495d 100644 * UUID used for metrics. */ -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch similarity index 84% rename from Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index 0182585a..c921f253 100644 --- a/Waterfall-Proxy-Patches/0016-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 501c340474b980137994535738a1ac736b6d0e6a Mon Sep 17 00:00:00 2001 +From 19fd8591a6237ca960a1533236c4fd352a621a9d Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 e9937428..037a305b 100644 +index 6e148782..e23cf604 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 -@@ -449,11 +449,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -432,11 +432,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); @@ -23,5 +23,5 @@ index e9937428..037a305b 100644 }; -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch b/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch deleted file mode 100644 index 0a2757a8..00000000 --- a/Waterfall-Proxy-Patches/0011-Use-elseIfs.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 8483549f243a6d8aad3574fc2d6235c3326e2740 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:07:26 +0800 -Subject: [PATCH] Use elseIfs - - -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 -index d54d8539..0dd2884d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -285,6 +285,7 @@ public class DownstreamBridge extends PacketHandler - throw CancelSendSignal.INSTANCE; - } - -+ // FlameCord - Use elseIfs - if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) - { - // FlameCord start -@@ -313,8 +314,7 @@ public class DownstreamBridge extends PacketHandler - con.unsafe().sendPacket( pluginMessage ); - throw CancelSendSignal.INSTANCE; - } -- -- if ( pluginMessage.getTag().equals( "BungeeCord" ) ) -+ else if ( pluginMessage.getTag().equals( "BungeeCord" ) ) - { - DataInput in = pluginMessage.getStream(); - ByteArrayDataOutput out = ByteStreams.newDataOutput(); -@@ -343,7 +343,7 @@ public class DownstreamBridge extends PacketHandler - // Null out stream, important as we don't want to send to ourselves - out = null; - } -- if ( subChannel.equals( "Forward" ) ) -+ else if ( subChannel.equals( "Forward" ) ) - { - // Read data from server - String target = in.readUTF(); -@@ -388,7 +388,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "Connect" ) ) -+ else if ( subChannel.equals( "Connect" ) ) - { - ServerInfo server = bungee.getServerInfo( in.readUTF() ); - if ( server != null ) -@@ -396,7 +396,7 @@ public class DownstreamBridge extends PacketHandler - con.connect( server, ServerConnectEvent.Reason.PLUGIN_MESSAGE ); - } - } -- if ( subChannel.equals( "ConnectOther" ) ) -+ else if ( subChannel.equals( "ConnectOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) -@@ -408,7 +408,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "IP" ) ) -+ else if ( subChannel.equals( "IP" ) ) - { - out.writeUTF( "IP" ); - if ( con.getSocketAddress() instanceof InetSocketAddress ) -@@ -421,7 +421,7 @@ public class DownstreamBridge extends PacketHandler - out.writeInt( 0 ); - } - } -- if ( subChannel.equals( "IPOther" ) ) -+ else if ( subChannel.equals( "IPOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) -@@ -440,7 +440,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "PlayerCount" ) ) -+ else if ( subChannel.equals( "PlayerCount" ) ) - { - String target = in.readUTF(); - out.writeUTF( "PlayerCount" ); -@@ -458,7 +458,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "PlayerList" ) ) -+ else if ( subChannel.equals( "PlayerList" ) ) - { - String target = in.readUTF(); - out.writeUTF( "PlayerList" ); -@@ -476,12 +476,12 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "GetServers" ) ) -+ else if ( subChannel.equals( "GetServers" ) ) - { - out.writeUTF( "GetServers" ); - out.writeUTF( Util.csv( bungee.getServers().keySet() ) ); - } -- if ( subChannel.equals( "Message" ) ) -+ else if ( subChannel.equals( "Message" ) ) - { - String target = in.readUTF(); - String message = in.readUTF(); -@@ -500,7 +500,7 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "MessageRaw" ) ) -+ else if ( subChannel.equals( "MessageRaw" ) ) - { - String target = in.readUTF(); - BaseComponent[] message = ComponentSerializer.parse( in.readUTF() ); -@@ -519,17 +519,17 @@ public class DownstreamBridge extends PacketHandler - } - } - } -- if ( subChannel.equals( "GetServer" ) ) -+ else if ( subChannel.equals( "GetServer" ) ) - { - out.writeUTF( "GetServer" ); - out.writeUTF( server.getInfo().getName() ); - } -- if ( subChannel.equals( "UUID" ) ) -+ else if ( subChannel.equals( "UUID" ) ) - { - out.writeUTF( "UUID" ); - out.writeUTF( con.getUUID() ); - } -- if ( subChannel.equals( "UUIDOther" ) ) -+ else if ( subChannel.equals( "UUIDOther" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) -@@ -539,7 +539,7 @@ public class DownstreamBridge extends PacketHandler - out.writeUTF( player.getUUID() ); - } - } -- if ( subChannel.equals( "ServerIP" ) ) -+ else if ( subChannel.equals( "ServerIP" ) ) - { - ServerInfo info = bungee.getServerInfo( in.readUTF() ); - if ( info != null && !info.getAddress().isUnresolved() ) -@@ -550,7 +550,7 @@ public class DownstreamBridge extends PacketHandler - out.writeShort( info.getAddress().getPort() ); - } - } -- if ( subChannel.equals( "KickPlayer" ) ) -+ else if ( subChannel.equals( "KickPlayer" ) ) - { - ProxiedPlayer player = bungee.getPlayer( in.readUTF() ); - if ( player != null ) --- -2.20.1 - diff --git a/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch similarity index 85% rename from Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch index f6eb912a..24159684 100644 --- a/Waterfall-Proxy-Patches/0017-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch @@ -1,14 +1,14 @@ -From 355853706ca50aba3dc231b6adee5f5e8bd58548 Mon Sep 17 00:00:00 2001 +From e6b04ac9bcc7a544cf3291b159c9498f94cc9029 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot 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 037a305b..c6dfa00f 100644 +index e23cf604..b4067b1e 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 -@@ -404,13 +404,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -387,13 +387,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; @@ -28,5 +28,5 @@ index 037a305b..c6dfa00f 100644 disconnect( bungee.getTranslation( "name_too_long" ) ); return; -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch similarity index 97% rename from Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch index c8cfdf29..625a300c 100644 --- a/Waterfall-Proxy-Patches/0018-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch @@ -1,4 +1,4 @@ -From 9c45d17f7e322b01c8a5a55d21b7cb1d65345056 Mon Sep 17 00:00:00 2001 +From 77d2ccf13e5f767020d6dac546bdbaf275afc8a3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy @@ -74,5 +74,5 @@ index 5c05f2b9..606866a5 100644 } } -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 83% rename from Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 697736e2..fb39b888 100644 --- a/Waterfall-Proxy-Patches/0019-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 461651e8a304ff9f57adac8d9c975b2a7e6ce1ea Mon Sep 17 00:00:00 2001 +From b5157be241a3611c3fefc0a4bc297325e83951de Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 c6dfa00f..3c67494f 100644 +index b4067b1e..3120abdb 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 -@@ -703,7 +703,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -686,7 +686,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index c6dfa00f..3c67494f 100644 } -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch similarity index 82% rename from Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch rename to Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch index 0cbf6042..e28741b6 100644 --- a/Waterfall-Proxy-Patches/0020-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,14 +1,14 @@ -From e57213dfb0ed9e6ebb122cb95d08a2e7592c4c60 Mon Sep 17 00:00:00 2001 +From 53f0affe159b7b18210d1927bd4991dd27b3b1d3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 3c67494f..f7ed1f46 100644 +index 3120abdb..4a17a117 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 -@@ -470,6 +470,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +453,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -17,7 +17,7 @@ index 3c67494f..f7ed1f46 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start if (sharedKey instanceof SecretKeySpec) { -@@ -529,6 +531,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -512,6 +514,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -27,7 +27,7 @@ index 3c67494f..f7ed1f46 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -610,8 +615,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -593,8 +598,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); @@ -37,5 +37,5 @@ index 3c67494f..f7ed1f46 100644 } } ); -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch b/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch deleted file mode 100644 index ec2fe065..00000000 --- a/Waterfall-Proxy-Patches/0015-use-address-getHostString.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 7fc05a47e12839eb256a9141ab122886ca788522 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:24:42 +0800 -Subject: [PATCH] use address & getHostString - - -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 -index 0dd2884d..474551d3 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -542,12 +542,15 @@ public class DownstreamBridge extends PacketHandler - else if ( subChannel.equals( "ServerIP" ) ) - { - ServerInfo info = bungee.getServerInfo( in.readUTF() ); -- if ( info != null && !info.getAddress().isUnresolved() ) -+ // FlameCord use address -+ InetSocketAddress address = info.getAddress(); -+ if ( info != null && !address.isUnresolved() ) - { - out.writeUTF( "ServerIP" ); - out.writeUTF( info.getName() ); -- out.writeUTF( info.getAddress().getAddress().getHostAddress() ); -- out.writeShort( info.getAddress().getPort() ); -+ // FlameCord - Use getHostString -+ out.writeUTF( address.getHostString() ); -+ out.writeShort( address.getPort() ); - } - } - else if ( subChannel.equals( "KickPlayer" ) ) --- -2.20.1 - diff --git a/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 83% rename from Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch index dec99640..0de50571 100644 --- a/Waterfall-Proxy-Patches/0021-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From d17df93a12dd7fc3bdda514ccfdd96041f8a9e88 Mon Sep 17 00:00:00 2001 +From 97c51221a89d054229919124c1f345d563406a46 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 fc1798fb..db3d9c86 100644 +index 01075a85..fb065ccd 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -310,7 +310,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -309,7 +309,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { @@ -20,5 +20,5 @@ index fc1798fb..db3d9c86 100644 return; } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch similarity index 84% rename from Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch index a732d6ff..1ffac04b 100644 --- a/Waterfall-Proxy-Patches/0022-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 1d113c7643f8d333cd70d8e6ddd64e78c1ab73be Mon Sep 17 00:00:00 2001 +From faa24f10ba4bb69ed99cdf3fafc42680b7dadd55 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 f7ed1f46..e7542b1c 100644 +index 4a17a117..95a6f40c 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 -@@ -513,7 +513,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -496,7 +496,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index f7ed1f46..e7542b1c 100644 return; } -- -2.20.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch similarity index 95% rename from Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index fa5fa300..72cf0743 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 05af8ef64d93e186b1568e60596935c70b260259 Mon Sep 17 00:00:00 2001 +From ec1abfc008553e30879c286fcd39d87844eabdb8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -116,7 +116,7 @@ index 00000000..81ded224 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index bb39d31b..28edad1a 100644 +index ec07ae6f..91da8ab6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 41d752a5..61c2e52a 100644 +index 4c7e0fdc..4527c2da 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; @@ -217,7 +217,7 @@ index 41d752a5..61c2e52a 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -233,11 +242,12 @@ public class BungeeCord extends ProxyServer +@@ -225,11 +234,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -235,7 +235,7 @@ index 41d752a5..61c2e52a 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -286,6 +296,15 @@ public class BungeeCord extends ProxyServer +@@ -278,6 +288,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -251,7 +251,7 @@ index 41d752a5..61c2e52a 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -577,9 +596,7 @@ public class BungeeCord extends ProxyServer +@@ -569,9 +588,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -263,7 +263,7 @@ index 41d752a5..61c2e52a 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7b99c466..522bd93d 100644 +index af73283e..e3e4ac9f 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -275,7 +275,7 @@ index 7b99c466..522bd93d 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -163,7 +165,7 @@ public class ServerConnector extends PacketHandler +@@ -162,7 +164,7 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -285,7 +285,7 @@ index 7b99c466..522bd93d 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 db3d9c86..bc365e8b 100644 +index fb065ccd..3d18dbf9 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -304,7 +304,7 @@ index db3d9c86..bc365e8b 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -390,9 +392,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -389,9 +391,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -319,10 +319,10 @@ index db3d9c86..bc365e8b 100644 b.connect().addListener( listener ); } 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 e7542b1c..deee607d 100644 +index 95a6f40c..82e23314 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 -@@ -16,6 +16,8 @@ import java.util.logging.Level; +@@ -14,6 +14,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -331,7 +331,7 @@ index e7542b1c..deee607d 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -152,7 +154,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -150,7 +152,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -341,7 +341,7 @@ index e7542b1c..deee607d 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6cd71071..423af854 100644 +index 6df3f3dd..264c22e8 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -353,7 +353,7 @@ index 6cd71071..423af854 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index b8e50855..7f18b564 100644 +index 3bbc1510..4c53e02c 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -366,7 +366,7 @@ index b8e50855..7f18b564 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 4996a7b4..1d86aa63 100644 +index 654203ab..a840bc70 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,8 @@ @@ -379,5 +379,5 @@ index 4996a7b4..1d86aa63 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch similarity index 96% rename from Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 7df216b3..68cc2839 100644 --- a/Waterfall-Proxy-Patches/0024-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 2b17b5973a9618e4f4939c801d47e34a43c26477 Mon Sep 17 00:00:00 2001 +From 983a88969c8f9a151ad81f3e0b77c664d065217f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 61c2e52a..a862f0a2 100644 +index 4527c2da..8111f40d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; @@ -145,7 +145,7 @@ index 61c2e52a..a862f0a2 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -286,9 +287,10 @@ public class BungeeCord extends ProxyServer +@@ -278,9 +279,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -158,7 +158,7 @@ index 61c2e52a..a862f0a2 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -304,6 +306,7 @@ public class BungeeCord extends ProxyServer +@@ -296,6 +298,7 @@ public class BungeeCord extends ProxyServer } FlameCord.renew(logger, whitelistedAddresses); @@ -166,7 +166,7 @@ index 61c2e52a..a862f0a2 100644 if ( config.isForgeSupport() ) { -@@ -833,4 +836,56 @@ public class BungeeCord extends ProxyServer +@@ -825,4 +828,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -224,5 +224,5 @@ index 61c2e52a..a862f0a2 100644 + } } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch similarity index 98% rename from Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index f15c0278..96c0ae1b 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From b2c9244be507307e1f490b2dfb53f8021d81fd85 Mon Sep 17 00:00:00 2001 +From b5571b07773efbc291f87e7b85ff1b4d25ba3192 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -209,10 +209,10 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a862f0a2..fb19d5dc 100644 +index 8111f40d..483884a4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -596,14 +596,8 @@ public class BungeeCord extends ProxyServer +@@ -588,14 +588,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { @@ -230,5 +230,5 @@ index a862f0a2..fb19d5dc 100644 @Override -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch new file mode 100644 index 00000000..50dd6c22 --- /dev/null +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -0,0 +1,127 @@ +From 88219f64895f1a90ecb7448c38e409f13981eaa9 Mon Sep 17 00:00:00 2001 +From: linsaftw +Date: Sat, 20 Mar 2021 12:36:25 -0300 +Subject: [PATCH] Fix ByteBuf memory leaks + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index e3e4ac9f..c8089afc 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -274,9 +274,15 @@ public class ServerConnector extends PacketHandler + } else + { + ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); +- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); +- brand.release(); ++ ++ try ++ { ++ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); ++ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); ++ } finally ++ { ++ brand.release(); ++ } + } + + user.setDimension( login.getDimension() ); +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 +index 9e180c30..40c016d6 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -287,15 +287,24 @@ public class DownstreamBridge extends PacketHandler + if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) + { + ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- String serverBrand = DefinedPacket.readString( brand ); +- brand.release(); + +- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); ++ try { ++ String serverBrand; + +- brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall +- pluginMessage.setData( brand ); +- brand.release(); ++ try { ++ serverBrand = DefinedPacket.readString( brand ); ++ } finally { ++ brand.release(); ++ } ++ ++ Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); ++ ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData( brand ); ++ } finally { ++ brand.release(); ++ } + // changes in the packet are ignored so we need to send it manually + con.unsafe().sendPacket( pluginMessage ); + throw CancelSendSignal.INSTANCE; +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index 13456b34..6d4b96cd 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -141,11 +141,15 @@ public abstract class EntityMap + if ( readId == oldId || readId == newId ) + { + ByteBuf data = packet.copy(); +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- data.release(); ++ ++ try { ++ packet.readerIndex( offset ); ++ packet.writerIndex( offset ); ++ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); ++ packet.writeBytes( data ); ++ } finally { ++ data.release(); ++ } + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index cefa0206..8d4439ab 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -38,16 +38,22 @@ public class ForgeUtils + { + Map modTags = new HashMap<>(); + ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- byte discriminator = payload.readByte(); +- if ( discriminator == 2 ) // ModList +- { +- ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ ++ try { ++ byte discriminator = payload.readByte(); ++ if ( discriminator == 2 ) // ModList + { +- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ ByteBuf buffer = payload.slice(); ++ int modCount = DefinedPacket.readVarInt( buffer, 2 ); ++ for ( int i = 0; i < modCount; i++ ) ++ { ++ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ } + } ++ } finally { ++ payload.release(); + } ++ + return modTags; + } + +-- +2.31.1.windows.1 + diff --git a/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch similarity index 91% rename from Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch index 27c57e67..1b26d356 100644 --- a/Waterfall-Proxy-Patches/0027-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch @@ -1,11 +1,11 @@ -From eea04c872972cf457d2ffc61fda629c4ad7c21d0 Mon Sep 17 00:00:00 2001 +From b0a0b07a690aa1a78ed90f2318dd269145497e4d Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 28edad1a..f0761a4f 100644 +index 91da8ab6..c03e1b51 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -23,5 +23,5 @@ index 28edad1a..f0761a4f 100644 if ( packet != null ) { -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-Firewall-System.patch b/Waterfall-Proxy-Patches/0023-Firewall-System.patch similarity index 97% rename from Waterfall-Proxy-Patches/0028-Firewall-System.patch rename to Waterfall-Proxy-Patches/0023-Firewall-System.patch index a588199f..a7b73031 100644 --- a/Waterfall-Proxy-Patches/0028-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0023-Firewall-System.patch @@ -1,4 +1,4 @@ -From d1d73f437bc7e61be80eed98c4d8485f53b38a02 Mon Sep 17 00:00:00 2001 +From f3e4276fb66c18b3c78975e452d1d4b6c78939dc Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -246,7 +246,7 @@ index 00000000..dfb5c6d3 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index f0761a4f..31873afc 100644 +index c03e1b51..7f4b5b45 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -303,10 +303,10 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 494375cd..aedfece3 100644 +index c8089afc..2b2a12d8 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -165,6 +165,9 @@ public class ServerConnector extends PacketHandler +@@ -164,6 +164,9 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -317,10 +317,10 @@ index 494375cd..aedfece3 100644 } } 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 deee607d..3720825a 100644 +index 82e23314..8e1749a4 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 -@@ -154,6 +154,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -152,6 +152,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -330,7 +330,7 @@ index deee607d..3720825a 100644 throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } -@@ -396,6 +399,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -379,6 +382,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } break; default: @@ -341,7 +341,7 @@ index deee607d..3720825a 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 423af854..70917b0b 100644 +index 264c22e8..2101cbc4 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -2,6 +2,7 @@ package net.md_5.bungee.connection; @@ -352,7 +352,7 @@ index 423af854..70917b0b 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -59,6 +60,9 @@ public class PingHandler extends PacketHandler +@@ -58,6 +59,9 @@ public class PingHandler extends PacketHandler { if ( packet.packet == null ) { @@ -363,7 +363,7 @@ index 423af854..70917b0b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 7f18b564..616651ba 100644 +index 4c53e02c..376daee9 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -375,7 +375,7 @@ index 7f18b564..616651ba 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; 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 1d86aa63..915c162f 100644 +index a840bc70..4e23c996 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 @@ -63,6 +63,13 @@ public class PipelineUtils @@ -426,5 +426,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch similarity index 83% rename from Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch index e84d6b86..29115df1 100644 --- a/Waterfall-Proxy-Patches/0029-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 59dcb230fde16df56f6a30ea041a4c20fb2d2794 Mon Sep 17 00:00:00 2001 +From 9f407b33ffcaf789e7c58bcd2455bbbc6b7b8c32 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac1..8822c6d3 100644 +index 8bb61ac1..056dcb81 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -24,24 +24,23 @@ index 8bb61ac1..8822c6d3 100644 @Getter private boolean firewallNotify = true; @Getter -@@ -34,6 +43,12 @@ public class FlameCordConfiguration { +@@ -34,6 +43,11 @@ public class FlameCordConfiguration { configuration = configurationProvider.load(configurationFile); } -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, -+ configuration); ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 3720825a..03c5aa07 100644 +index 8e1749a4..4767edb6 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 -@@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -353,7 +353,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +50,7 @@ index 3720825a..03c5aa07 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -379,7 +380,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -362,7 +363,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -62,7 +61,7 @@ index 3720825a..03c5aa07 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 616651ba..7bf30b23 100644 +index 376daee9..62895541 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -75,8 +74,8 @@ index 616651ba..7bf30b23 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); } -@@ -63,7 +64,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel.close(); +@@ -62,7 +63,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.markClosed(); handler.disconnected( channel ); - if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) @@ -85,7 +84,7 @@ index 616651ba..7bf30b23 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -94,10 +96,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -93,10 +95,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); @@ -94,16 +93,15 @@ index 616651ba..7bf30b23 100644 - channel.getRemoteAddress(), newAddress - } ); + // FlameCord - Option to log haproxy -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) + ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] + { + channel.getRemoteAddress(), newAddress + } ); -+ } channel.setRemoteAddress( newAddress ); } finally -@@ -141,6 +146,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -140,6 +144,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); @@ -114,7 +112,7 @@ index 616651ba..7bf30b23 100644 { if ( cause instanceof ReadTimeoutException ) 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 915c162f..a6722b41 100644 +index 4e23c996..7fb1e70f 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 @@ -116,7 +116,10 @@ public class PipelineUtils @@ -125,10 +123,22 @@ index 915c162f..a6722b41 100644 + // FlameCord - Option to log exceptions + if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { + cause.printStackTrace(); ++ } + + ctx.close(); + } +@@ -218,7 +221,10 @@ public class PipelineUtils + // FlameCord - Close on exception caught + @Override + public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { +- cause.printStackTrace(); ++ // FlameCord - Option to log exceptions ++ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { ++ cause.printStackTrace(); + } ctx.close(); } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0030-Always-release-packet.patch b/Waterfall-Proxy-Patches/0025-Always-release-packet.patch similarity index 83% rename from Waterfall-Proxy-Patches/0030-Always-release-packet.patch rename to Waterfall-Proxy-Patches/0025-Always-release-packet.patch index a10c5ac0..74cb390a 100644 --- a/Waterfall-Proxy-Patches/0030-Always-release-packet.patch +++ b/Waterfall-Proxy-Patches/0025-Always-release-packet.patch @@ -1,14 +1,14 @@ -From e00ed4d4e69f192d801c294b96a5bac11c21a344 Mon Sep 17 00:00:00 2001 +From 8b821ba664dec9f72eae84e445cd6b973550de9d Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packet diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 7bf30b23..21bd5a17 100644 +index 62895541..7316dc7a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -112,12 +112,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -110,12 +110,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter return; } @@ -27,7 +27,7 @@ index 7bf30b23..21bd5a17 100644 if ( sendPacket && packet.packet != null ) { try -@@ -132,10 +134,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -130,10 +132,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { handler.handle( packet ); } @@ -42,5 +42,5 @@ index 7bf30b23..21bd5a17 100644 } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch similarity index 97% rename from Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch index 5a12408e..69b7729c 100644 --- a/Waterfall-Proxy-Patches/0031-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 14c353d7490b306ac6b9caee45b8d8eec824c128 Mon Sep 17 00:00:00 2001 +From 4490a84ec88d2ee52c4333eb6f5fe1b2433a50d8 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -82,5 +82,5 @@ index 90031156..a190dfae 100644 ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] { -- -2.26.2.windows.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch deleted file mode 100644 index ca12aa0f..00000000 --- a/Waterfall-Proxy-Patches/0026-Fix-ByteBuf-memory-leaks.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 70d54b4ecbdca409826513d00c0a4d53d6603a11 Mon Sep 17 00:00:00 2001 -From: linsaftw -Date: Sat, 20 Mar 2021 12:36:25 -0300 -Subject: [PATCH] Fix ByteBuf memory leaks - - -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 522bd93d..494375cd 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -284,9 +284,15 @@ public class ServerConnector extends PacketHandler - } else - { - ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString(brandString, brand); -- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -- brand.release(); -+ -+ try -+ { -+ DefinedPacket.writeString(brandString, brand); -+ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ } finally -+ { -+ brand.release(); -+ } - } - // FlameCord end - } -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 -index 474551d3..8716d0c8 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -294,12 +294,21 @@ public class DownstreamBridge extends PacketHandler - try - { - ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); -- String serverBrand = DefinedPacket.readString(brand); -- brand.release(); -- brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -- pluginMessage.setData(brand); -- brand.release(); -+ String serverBrand = null; -+ -+ try { -+ serverBrand = DefinedPacket.readString(brand); -+ } finally { -+ brand.release(); -+ } -+ -+ try { -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData(brand); -+ } finally { -+ brand.release(); -+ } - } catch (Exception ProtocolHacksSuck) - { - return; -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 44066317..e4b97490 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -145,11 +145,17 @@ public abstract class EntityMap - if ( readId == oldId || readId == newId ) - { - ByteBuf data = packet.copy(); -- packet.readerIndex( offset ); -- packet.writerIndex( offset ); -- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -- packet.writeBytes( data ); -- data.release(); -+ -+ try -+ { -+ packet.readerIndex( offset ); -+ packet.writerIndex( offset ); -+ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -+ packet.writeBytes( data ); -+ } finally -+ { -+ data.release(); -+ } - } - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -index 6755fe84..21871d14 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -@@ -39,19 +39,27 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 - && profile.getProperties().length >= 1 ) - { - ByteBuf rest = packet.copy(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -- DefinedPacket.writeString( username, packet ); -- DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -- for ( LoginResult.Property property : profile.getProperties() ) -+ -+ try -+ { -+ packet.readerIndex( readerIndex ); -+ packet.writerIndex( readerIndex + packetIdLength + idLength ); -+ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -+ DefinedPacket.writeString( username, packet ); -+ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -+ -+ for ( LoginResult.Property property : profile.getProperties() ) -+ { -+ DefinedPacket.writeString( property.getName(), packet ); -+ DefinedPacket.writeString( property.getValue(), packet ); -+ DefinedPacket.writeString( property.getSignature(), packet ); -+ } -+ -+ packet.writeBytes( rest ); -+ } finally - { -- DefinedPacket.writeString( property.getName(), packet ); -- DefinedPacket.writeString( property.getValue(), packet ); -- DefinedPacket.writeString( property.getSignature(), packet ); -+ rest.release(); - } -- packet.writeBytes( rest ); -- rest.release(); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206..cede3994 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -@@ -38,15 +38,22 @@ public class ForgeUtils - { - Map modTags = new HashMap<>(); - ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- byte discriminator = payload.readByte(); -- if ( discriminator == 2 ) // ModList -+ -+ try - { -- ByteBuf buffer = payload.slice(); -- int modCount = DefinedPacket.readVarInt( buffer, 2 ); -- for ( int i = 0; i < modCount; i++ ) -+ byte discriminator = payload.readByte(); -+ if ( discriminator == 2 ) // ModList - { -- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ ByteBuf buffer = payload.slice(); -+ -+ int modCount = DefinedPacket.readVarInt( buffer, 2 ); -+ for ( int i = 0; i < modCount; i++ ) -+ { -+ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ } - } -+ } finally { -+ payload.release(); - } - return modTags; - } --- -2.31.1 - diff --git a/Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch b/Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch similarity index 94% rename from Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch rename to Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch index c74af6a6..7911fef2 100644 --- a/Waterfall-Proxy-Patches/0032-Apply-buffer-limits.patch +++ b/Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch @@ -1,14 +1,14 @@ -From 9b03768079f2ac841fa87e3e10d3808b7bc3cae3 Mon Sep 17 00:00:00 2001 +From 3dc90158a5898f0546df38b2b55c49e949d78177 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 12:56:29 -0300 Subject: [PATCH] Apply buffer limits diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index fb19d5dc..7c5af95b 100644 +index 483884a4..ab9e2ab5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -378,6 +378,9 @@ public class BungeeCord extends ProxyServer +@@ -370,6 +370,9 @@ public class BungeeCord extends ProxyServer } } }; @@ -18,7 +18,7 @@ index fb19d5dc..7c5af95b 100644 new ServerBootstrap() .channel( PipelineUtils.getServerChannel( info.getSocketAddress() ) ) .option( ChannelOption.SO_REUSEADDR, true ) // TODO: Move this elsewhere! -@@ -385,6 +388,8 @@ public class BungeeCord extends ProxyServer +@@ -377,6 +380,8 @@ public class BungeeCord extends ProxyServer .childHandler( PipelineUtils.SERVER_CHILD ) .group( bossEventLoopGroup, workerEventLoopGroup ) .localAddress( info.getSocketAddress() ) @@ -52,7 +52,7 @@ index 37657c4c..ba31471e 100644 if ( ssl ) { 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 a6722b41..5de2e6ef 100644 +index 7fb1e70f..c7038164 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 @@ -207,6 +207,11 @@ public class PipelineUtils @@ -95,5 +95,5 @@ index 8becc26a..8304685c 100644 } } -- -2.31.1 +2.31.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch b/Waterfall-Proxy-Patches/0028-Limit-String-read.patch similarity index 89% rename from Waterfall-Proxy-Patches/0033-Limit-String-read.patch rename to Waterfall-Proxy-Patches/0028-Limit-String-read.patch index 7b723219..fcbfd361 100644 --- a/Waterfall-Proxy-Patches/0033-Limit-String-read.patch +++ b/Waterfall-Proxy-Patches/0028-Limit-String-read.patch @@ -1,11 +1,11 @@ -From 01ec864075a0abd0084167e9e72e632f254de58f Mon Sep 17 00:00:00 2001 +From a6622a844340dc2983b7d8da50037a4a509a038f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 15:40:41 -0300 Subject: [PATCH] Limit String read 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 -index 93d17f6b..dd663e1d 100644 +index 31a95495..01484bcc 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -36,12 +36,13 @@ public abstract class DefinedPacket @@ -24,5 +24,5 @@ index 93d17f6b..dd663e1d 100644 { if(!MinecraftDecoder.DEBUG) throw STRING_TOO_MANY_BYTES_EXCEPTION; // Waterfall start: Additional DoS mitigations -- -2.31.1 +2.31.1.windows.1 From f8e41e8f7d0deedc4ce4cf764dd56e5011591a1c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:25:38 -0300 Subject: [PATCH 116/499] Added FlameCord rebrand --- .../0004-FlameCord-rebrand.patch | 49 +++++++++++++++++++ ...ke-PlayerHandshakeEvent-cancellable.patch} | 2 +- ...0006-Make-a-getter-for-the-callback.patch} | 2 +- ...able-update-checker-Use-bungee-name.patch} | 2 +- ...> 0008-Change-replaceAll-to-replace.patch} | 2 +- ...ctions-Don-t-flush-if-not-necessary.patch} | 2 +- ...-Checks.patch => 0010-Packet-Checks.patch} | 2 +- ...ch => 0011-Default-timeout-to-10000.patch} | 2 +- ...-encrypt-only-if-onlineMode-is-true.patch} | 2 +- ...013-Don-t-allow-name-containing-dot.patch} | 2 +- ...4-Use-pipeline-to-reduce-redundancy.patch} | 2 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 2 +- ...-to-avoid-multiple-incoming-packets.patch} | 2 +- ...teException-to-QuietException-and-e.patch} | 2 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 2 +- ...tch => 0019-FlameCord-General-Patch.patch} | 4 +- ...tch => 0020-FlameCord-module-system.patch} | 4 +- ...021-FlameCord-message-configuration.patch} | 4 +- ...ch => 0022-Fix-ByteBuf-memory-leaks.patch} | 2 +- ...> 0023-Check-if-packetID-is-invalid.patch} | 2 +- ...ystem.patch => 0024-Firewall-System.patch} | 2 +- ...ch => 0025-FlameCord-logger-options.patch} | 2 +- ...patch => 0026-Always-release-packet.patch} | 2 +- ...ded-an-api-method-to-unload-Plugins.patch} | 2 +- ...s.patch => 0028-Apply-buffer-limits.patch} | 4 +- ...ead.patch => 0029-Limit-String-read.patch} | 2 +- 26 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch rename Waterfall-Proxy-Patches/{0004-Make-PlayerHandshakeEvent-cancellable.patch => 0005-Make-PlayerHandshakeEvent-cancellable.patch} (97%) rename Waterfall-Proxy-Patches/{0005-Make-a-getter-for-the-callback.patch => 0006-Make-a-getter-for-the-callback.patch} (93%) rename Waterfall-Proxy-Patches/{0006-Disable-update-checker-Use-bungee-name.patch => 0007-Disable-update-checker-Use-bungee-name.patch} (98%) rename Waterfall-Proxy-Patches/{0007-Change-replaceAll-to-replace.patch => 0008-Change-replaceAll-to-replace.patch} (95%) rename Waterfall-Proxy-Patches/{0008-Close-connections-Don-t-flush-if-not-necessary.patch => 0009-Close-connections-Don-t-flush-if-not-necessary.patch} (99%) rename Waterfall-Proxy-Patches/{0009-Packet-Checks.patch => 0010-Packet-Checks.patch} (97%) rename Waterfall-Proxy-Patches/{0010-Default-timeout-to-10000.patch => 0011-Default-timeout-to-10000.patch} (92%) rename Waterfall-Proxy-Patches/{0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch => 0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch} (94%) rename Waterfall-Proxy-Patches/{0012-Don-t-allow-name-containing-dot.patch => 0013-Don-t-allow-name-containing-dot.patch} (94%) rename Waterfall-Proxy-Patches/{0013-Use-pipeline-to-reduce-redundancy.patch => 0014-Use-pipeline-to-reduce-redundancy.patch} (98%) rename Waterfall-Proxy-Patches/{0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (93%) rename Waterfall-Proxy-Patches/{0015-Finish-early-to-avoid-multiple-incoming-packets.patch => 0016-Finish-early-to-avoid-multiple-incoming-packets.patch} (96%) rename Waterfall-Proxy-Patches/{0016-Change-IllegalStateException-to-QuietException-and-e.patch => 0017-Change-IllegalStateException-to-QuietException-and-e.patch} (94%) rename Waterfall-Proxy-Patches/{0017-Don-t-declare-uuid-unless-it-s-null.patch => 0018-Don-t-declare-uuid-unless-it-s-null.patch} (94%) rename Waterfall-Proxy-Patches/{0018-FlameCord-General-Patch.patch => 0019-FlameCord-General-Patch.patch} (99%) rename Waterfall-Proxy-Patches/{0019-FlameCord-module-system.patch => 0020-FlameCord-module-system.patch} (99%) rename Waterfall-Proxy-Patches/{0020-FlameCord-message-configuration.patch => 0021-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0021-Fix-ByteBuf-memory-leaks.patch => 0022-Fix-ByteBuf-memory-leaks.patch} (98%) rename Waterfall-Proxy-Patches/{0022-Check-if-packetID-is-invalid.patch => 0023-Check-if-packetID-is-invalid.patch} (94%) rename Waterfall-Proxy-Patches/{0023-Firewall-System.patch => 0024-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0024-FlameCord-logger-options.patch => 0025-FlameCord-logger-options.patch} (99%) rename Waterfall-Proxy-Patches/{0025-Always-release-packet.patch => 0026-Always-release-packet.patch} (95%) rename Waterfall-Proxy-Patches/{0026-Added-an-api-method-to-unload-Plugins.patch => 0027-Added-an-api-method-to-unload-Plugins.patch} (98%) rename Waterfall-Proxy-Patches/{0027-Apply-buffer-limits.patch => 0028-Apply-buffer-limits.patch} (97%) rename Waterfall-Proxy-Patches/{0028-Limit-String-read.patch => 0029-Limit-String-read.patch} (93%) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch new file mode 100644 index 00000000..30881fc5 --- /dev/null +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -0,0 +1,49 @@ +From 369e4a2764e0b93edfed7b1a8f2f06f60930ce8f Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 8 Jun 2021 22:24:27 -0300 +Subject: [PATCH] FlameCord rebrand + + +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index 527f310e..a4ef6d3b 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { + YamlConfig config = new YamlConfig(new File("waterfall.yml")); + config.load(false); // Load, but no permissions + logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); +- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); ++ // FlameCord - Make the version look better ++ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); + useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 4c7e0fdc..3e7bd97b 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer + @Override + public String getVersion() + { +- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); ++ return "0.5.4"; + } + + public void reloadMessages() +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +index 820f7b03..aeda7963 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +@@ -16,6 +16,7 @@ public class CommandBungee extends Command + @Override + public void execute(CommandSender sender, String[] args) + { +- sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ // FlameCord - Use custom version message ++ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); + } + } +-- +2.31.1.windows.1 + diff --git a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch similarity index 97% rename from Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch rename to Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 5d321fdd..8bb4d8d1 100644 --- a/Waterfall-Proxy-Patches/0004-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From f83c723e3637308caaeb936b9549827f53f36cc9 Mon Sep 17 00:00:00 2001 +From 42608d211e93b47f5a72640f63178c815b429ab6 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable diff --git a/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch similarity index 93% rename from Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch rename to Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch index 3ac19527..17ca426f 100644 --- a/Waterfall-Proxy-Patches/0005-Make-a-getter-for-the-callback.patch +++ b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch @@ -1,4 +1,4 @@ -From d6e3943dcc28a4e9a6639fafbeab0526010cdadb Mon Sep 17 00:00:00 2001 +From d57a08c1bd284e3f13166a5778361c789cce23ea Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:58:18 +0800 Subject: [PATCH] Make a getter for the callback diff --git a/Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch similarity index 98% rename from Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch rename to Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index 3b4b5e44..4d83719b 100644 --- a/Waterfall-Proxy-Patches/0006-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -1,4 +1,4 @@ -From acb48a3f1ccc1ec0047025c71ca77d6c70eac9b7 Mon Sep 17 00:00:00 2001 +From 930c3622edaa63c7538d225d809e84c55b6a14fb Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch similarity index 95% rename from Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch rename to Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch index a1018bd5..7f61919f 100644 --- a/Waterfall-Proxy-Patches/0007-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -1,4 +1,4 @@ -From 91cb9c13a57df9a21e2e2894a3365d36e2e54d08 Mon Sep 17 00:00:00 2001 +From 3906e9fc63eaf02028688cfb83c830dba8980ded Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 99% rename from Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch rename to Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index fb6e3948..06967ce6 100644 --- a/Waterfall-Proxy-Patches/0008-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From f1b1c7e6c185bc7a13cf6125dc2672b9a53e12e1 Mon Sep 17 00:00:00 2001 +From fd1cdbfda00482440c45e74217c78f5b62b1be49 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary diff --git a/Waterfall-Proxy-Patches/0009-Packet-Checks.patch b/Waterfall-Proxy-Patches/0010-Packet-Checks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0009-Packet-Checks.patch rename to Waterfall-Proxy-Patches/0010-Packet-Checks.patch index 1fa6617f..6829e055 100644 --- a/Waterfall-Proxy-Patches/0009-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0010-Packet-Checks.patch @@ -1,4 +1,4 @@ -From f61307367e3fb2e33ef946df1b28973645f3eba8 Mon Sep 17 00:00:00 2001 +From 92d4715a7044c29ab63cfdf9b65c145be7860873 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch similarity index 92% rename from Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch rename to Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch index cc794ed3..b83de80b 100644 --- a/Waterfall-Proxy-Patches/0010-Default-timeout-to-10000.patch +++ b/Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch @@ -1,4 +1,4 @@ -From 7ecd3743ff93e43b827419fd1705b75aa9cf2e8c Mon Sep 17 00:00:00 2001 +From 40d019da485a276d84ebf1fe9aa0276288e50b55 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 Subject: [PATCH] Default timeout to 10000 diff --git a/Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch similarity index 94% rename from Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index c921f253..cfff0326 100644 --- a/Waterfall-Proxy-Patches/0011-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,4 +1,4 @@ -From 19fd8591a6237ca960a1533236c4fd352a621a9d Mon Sep 17 00:00:00 2001 +From c21daf0a4ba52c12de9e92b1eb815c893e93db4d Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true diff --git a/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch similarity index 94% rename from Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index 24159684..42b33a8b 100644 --- a/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,4 +1,4 @@ -From e6b04ac9bcc7a544cf3291b159c9498f94cc9029 Mon Sep 17 00:00:00 2001 +From 1cdd4fe76f18d526b8f4b963a7ee07f8929312ed Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot diff --git a/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch similarity index 98% rename from Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch index 625a300c..927f5b92 100644 --- a/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -1,4 +1,4 @@ -From 77d2ccf13e5f767020d6dac546bdbaf275afc8a3 Mon Sep 17 00:00:00 2001 +From ee27ec7faf4a11ad24c751a4ae6307a9b24044e7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 93% rename from Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index fb39b888..73728372 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,4 +1,4 @@ -From b5157be241a3611c3fefc0a4bc297325e83951de Mon Sep 17 00:00:00 2001 +From 6b6dd8e0fc01d46fb928cbac548cc2ca1a0a7da1 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true diff --git a/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch similarity index 96% rename from Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch rename to Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch index e28741b6..d6c8b452 100644 --- a/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,4 +1,4 @@ -From 53f0affe159b7b18210d1927bd4991dd27b3b1d3 Mon Sep 17 00:00:00 2001 +From a497afed2aec0b47499e6d4f9cadedab6a2512f6 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets diff --git a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 94% rename from Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch index 0de50571..d9f7669f 100644 --- a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 97c51221a89d054229919124c1f345d563406a46 Mon Sep 17 00:00:00 2001 +From 68f77c174634d73fbce5ddee67d9168277447333 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain diff --git a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch similarity index 94% rename from Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch index 1ffac04b..ad213ea9 100644 --- a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,4 +1,4 @@ -From faa24f10ba4bb69ed99cdf3fafc42680b7dadd55 Mon Sep 17 00:00:00 2001 +From d8d2c3450c09ebcc32c821e99b0fa4c7559a18a9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch similarity index 99% rename from Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index 72cf0743..98a0144c 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From ec1abfc008553e30879c286fcd39d87844eabdb8 Mon Sep 17 00:00:00 2001 +From 3f7501fbe223e4a4178a5c96f0394b435421872e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4c7e0fdc..4527c2da 100644 +index 3e7bd97b..46f180a0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch similarity index 99% rename from Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch index 68cc2839..d3a3c6df 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 983a88969c8f9a151ad81f3e0b77c664d065217f Mon Sep 17 00:00:00 2001 +From 9d1c11965e719870b3f8cd3c31cfeb4ca966cde0 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4527c2da..8111f40d 100644 +index 46f180a0..b1ac28a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch index 96c0ae1b..8f680407 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From b5571b07773efbc291f87e7b85ff1b4d25ba3192 Mon Sep 17 00:00:00 2001 +From 8d486c50cd28b8e5714285f643ea3dc75adeb34c Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -209,7 +209,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8111f40d..483884a4 100644 +index b1ac28a5..d2c9a5be 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -588,14 +588,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch similarity index 98% rename from Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch index 50dd6c22..c9f8241b 100644 --- a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 88219f64895f1a90ecb7448c38e409f13981eaa9 Mon Sep 17 00:00:00 2001 +From 49e04cc1caba6d1ccf009951e02fd20ffe6edf0b Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch similarity index 94% rename from Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch index 1b26d356..1c1db045 100644 --- a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch @@ -1,4 +1,4 @@ -From b0a0b07a690aa1a78ed90f2318dd269145497e4d Mon Sep 17 00:00:00 2001 +From fb4385149fe4543ff5285b95a1b9d6a833a3adcb Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/Waterfall-Proxy-Patches/0023-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0023-Firewall-System.patch rename to Waterfall-Proxy-Patches/0024-Firewall-System.patch index a7b73031..85b58fc9 100644 --- a/Waterfall-Proxy-Patches/0023-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From f3e4276fb66c18b3c78975e452d1d4b6c78939dc Mon Sep 17 00:00:00 2001 +From e8b8ffdb3f71d8f97f5a49e46c33928157bfa8c3 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch similarity index 99% rename from Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch index 29115df1..84fa687b 100644 --- a/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 9f407b33ffcaf789e7c58bcd2455bbbc6b7b8c32 Mon Sep 17 00:00:00 2001 +From 7ebcb22ca7416573a78883ba592672c6f0ec62f7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/Waterfall-Proxy-Patches/0025-Always-release-packet.patch b/Waterfall-Proxy-Patches/0026-Always-release-packet.patch similarity index 95% rename from Waterfall-Proxy-Patches/0025-Always-release-packet.patch rename to Waterfall-Proxy-Patches/0026-Always-release-packet.patch index 74cb390a..6b69e569 100644 --- a/Waterfall-Proxy-Patches/0025-Always-release-packet.patch +++ b/Waterfall-Proxy-Patches/0026-Always-release-packet.patch @@ -1,4 +1,4 @@ -From 8b821ba664dec9f72eae84e445cd6b973550de9d Mon Sep 17 00:00:00 2001 +From e1e3b84d99787375e4985810ef55911b8540e738 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packet diff --git a/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch similarity index 98% rename from Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch index 69b7729c..da233702 100644 --- a/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 4490a84ec88d2ee52c4333eb6f5fe1b2433a50d8 Mon Sep 17 00:00:00 2001 +From 0b208fdf287585eed2787a5ab7eba1a39cf7b670 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins diff --git a/Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch similarity index 97% rename from Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch rename to Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch index 7911fef2..2097e722 100644 --- a/Waterfall-Proxy-Patches/0027-Apply-buffer-limits.patch +++ b/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch @@ -1,11 +1,11 @@ -From 3dc90158a5898f0546df38b2b55c49e949d78177 Mon Sep 17 00:00:00 2001 +From fb88c2ddba3687968164ffa6a8f91801f739c18f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 12:56:29 -0300 Subject: [PATCH] Apply buffer limits diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 483884a4..ab9e2ab5 100644 +index d2c9a5be..b3b322c4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -370,6 +370,9 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0028-Limit-String-read.patch b/Waterfall-Proxy-Patches/0029-Limit-String-read.patch similarity index 93% rename from Waterfall-Proxy-Patches/0028-Limit-String-read.patch rename to Waterfall-Proxy-Patches/0029-Limit-String-read.patch index fcbfd361..aeb17920 100644 --- a/Waterfall-Proxy-Patches/0028-Limit-String-read.patch +++ b/Waterfall-Proxy-Patches/0029-Limit-String-read.patch @@ -1,4 +1,4 @@ -From a6622a844340dc2983b7d8da50037a4a509a038f Mon Sep 17 00:00:00 2001 +From b86af279788955740e72eea8f06ed6a153d80719 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 15:40:41 -0300 Subject: [PATCH] Limit String read From b6130f0a42e04929e05fd354d517c83160dac154 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:39:12 -0300 Subject: [PATCH 117/499] Update Waterfall --- Waterfall | 2 +- .../0008-Change-replaceAll-to-replace.patch | 6 +++--- .../0013-Don-t-allow-name-containing-dot.patch | 8 ++++---- .../0019-FlameCord-General-Patch.patch | 8 ++++---- .../0022-Fix-ByteBuf-memory-leaks.patch | 6 +++--- Waterfall-Proxy-Patches/0024-Firewall-System.patch | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Waterfall b/Waterfall index 5d64a217..4eb5b153 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 5d64a21724a931a651b21191b8785ed65bbca489 +Subproject commit 4eb5b15309a86e27d075c7ede233131290254faa diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch index 7f61919f..8ca6cc4f 100644 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -1,14 +1,14 @@ -From 3906e9fc63eaf02028688cfb83c830dba8980ded Mon Sep 17 00:00:00 2001 +From 2cf1175a59dd57569142d33de750ab8358171141 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 2d9c0cda..af73283e 100644 +index a5efb0af..f5e09292 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -126,7 +126,8 @@ public class ServerConnector extends PacketHandler +@@ -127,7 +127,8 @@ public class ServerConnector extends PacketHandler newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index 42b33a8b..ac015b13 100644 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,22 +1,22 @@ -From 1cdd4fe76f18d526b8f4b963a7ee07f8929312ed Mon Sep 17 00:00:00 2001 +From c180aa80773a50794cef5bff389d663b876b49b3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot 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 e23cf604..b4067b1e 100644 +index 9293739f..10b5aafb 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 @@ -387,13 +387,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; -- if ( getName().contains( "." ) ) +- if ( getName().contains( " " ) ) + // FlameCord - Use name + final String name = getName(); + -+ if ( name.contains( "." ) ) ++ if ( name.contains( " " ) || name.contains( "." ) ) { disconnect( bungee.getTranslation( "name_invalid" ) ); return; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index 98a0144c..5cb2906d 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 3f7501fbe223e4a4178a5c96f0394b435421872e Mon Sep 17 00:00:00 2001 +From 91af7ea587264e4af28fecb81b12163fe8a7f75e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -263,7 +263,7 @@ index 3e7bd97b..46f180a0 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index af73283e..e3e4ac9f 100644 +index f5e09292..3e3e42a2 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -275,7 +275,7 @@ index af73283e..e3e4ac9f 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -162,7 +164,7 @@ public class ServerConnector extends PacketHandler +@@ -163,7 +165,7 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -319,7 +319,7 @@ index fb065ccd..3d18dbf9 100644 b.connect().addListener( listener ); } 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 95a6f40c..82e23314 100644 +index aa952717..a1ec1bff 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 @@ -14,6 +14,8 @@ import java.util.logging.Level; diff --git a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch index c9f8241b..e326abae 100644 --- a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 49e04cc1caba6d1ccf009951e02fd20ffe6edf0b Mon Sep 17 00:00:00 2001 +From 6c410c530ba6004e34032a1460c644808dd230b1 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index e3e4ac9f..c8089afc 100644 +index 3e3e42a2..ccab6800 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -274,9 +274,15 @@ public class ServerConnector extends PacketHandler +@@ -275,9 +275,15 @@ public class ServerConnector extends PacketHandler } else { ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch index 85b58fc9..d1868bcd 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From e8b8ffdb3f71d8f97f5a49e46c33928157bfa8c3 Mon Sep 17 00:00:00 2001 +From 160af8c9a43c4a028b766ebf26ef530b51fa5e57 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -303,10 +303,10 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index c8089afc..2b2a12d8 100644 +index ccab6800..d57a0516 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -164,6 +164,9 @@ public class ServerConnector extends PacketHandler +@@ -165,6 +165,9 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -317,7 +317,7 @@ index c8089afc..2b2a12d8 100644 } } 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 82e23314..8e1749a4 100644 +index a1ec1bff..3c8bd33b 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 @@ -152,6 +152,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection From 3071c68a44cdc9d0299685e5cb04cd208b42bd52 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:15:34 +0200 Subject: [PATCH 118/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: c74fe8a Updated Upstream (BungeeCord) 91217e0 Adjusted README versions (#656) 6bf7f90 Updated Upstream (BungeeCord) (#655) --- Waterfall | 2 +- .../0001-POM-Changes.patch | 118 +++++++++--------- .../0002-FlameCord-POM-Changes.patch | 16 +-- scripts/upstreamCommit.sh | 2 +- 4 files changed, 69 insertions(+), 69 deletions(-) diff --git a/Waterfall b/Waterfall index 4eb5b153..c74fe8a9 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 4eb5b15309a86e27d075c7ede233131290254faa +Subproject commit c74fe8a9b23803ea7d84dda757c07ac7a3bad03b diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index aa309ad8..c1903ff7 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 011203cba62c5509e045a31445b71ba1e580b8d6 Mon Sep 17 00:00:00 2001 +From accb1c7028ac8f8eebbd8116d350d93cc0da1215 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index ca1ed8811..adec9d39f 100644 +index 87c17046..f85369c5 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -14,14 +14,14 @@ index ca1ed8811..adec9d39f 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-api + flamecord-api - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-API @@ -58,7 +58,7 @@ index ca1ed8811..adec9d39f 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 37c0880cd..139b7ac12 100644 +index 7a9e8258..c302b3b1 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,18 +5,18 @@ @@ -67,14 +67,14 @@ index 37c0880cd..139b7ac12 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-bootstrap + flamecord-bootstrap - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Bootstrap @@ -102,7 +102,7 @@ index 37c0880cd..139b7ac12 100644 org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml -index 853092339..5cc621414 100644 +index cfa0e16e..8179e4ae 100644 --- a/chat/pom.xml +++ b/chat/pom.xml @@ -5,18 +5,18 @@ @@ -111,14 +111,14 @@ index 853092339..5cc621414 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-chat + flamecord-chat - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Chat @@ -129,7 +129,7 @@ index 853092339..5cc621414 100644 diff --git a/config/pom.xml b/config/pom.xml -index 38db2292d..7cdcbd8b3 100644 +index 6c122954..7edb1ba5 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -5,18 +5,18 @@ @@ -138,14 +138,14 @@ index 38db2292d..7cdcbd8b3 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-config + flamecord-config - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Config @@ -156,7 +156,7 @@ index 38db2292d..7cdcbd8b3 100644 diff --git a/event/pom.xml b/event/pom.xml -index 82a411b08..b1a990c93 100644 +index 563783e9..52154fd0 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -5,16 +5,16 @@ @@ -165,14 +165,14 @@ index 82a411b08..b1a990c93 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-event + flamecord-event - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Event @@ -181,7 +181,7 @@ index 82a411b08..b1a990c93 100644 + Generic java event dispatching API intended for use with FlameCord. diff --git a/log/pom.xml b/log/pom.xml -index 646dbfae5..00f7b9c92 100644 +index 3663d6d9..e3995bdd 100644 --- a/log/pom.xml +++ b/log/pom.xml @@ -5,18 +5,18 @@ @@ -190,14 +190,14 @@ index 646dbfae5..00f7b9c92 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log + flamecord-log - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Log @@ -217,7 +217,7 @@ index 646dbfae5..00f7b9c92 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 51187fd15..9fe7044f9 100644 +index 7ec6e530..78d92f27 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml @@ -4,18 +4,18 @@ @@ -226,14 +226,14 @@ index 51187fd15..9fe7044f9 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log4j + flamecord-log4j - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Log @@ -269,7 +269,7 @@ index 51187fd15..9fe7044f9 100644 diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 472314c2f..8eb065721 100644 +index 11e990d9..1bfcf47e 100644 --- a/module/cmd-alert/pom.xml +++ b/module/cmd-alert/pom.xml @@ -5,13 +5,13 @@ @@ -278,18 +278,18 @@ index 472314c2f..8eb065721 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-alert + flamecord-module-cmd-alert - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index de8faee02..09e2835aa 100644 +index b732d67f..5f57af9e 100644 --- a/module/cmd-find/pom.xml +++ b/module/cmd-find/pom.xml @@ -5,13 +5,13 @@ @@ -298,18 +298,18 @@ index de8faee02..09e2835aa 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-find + flamecord-module-cmd-find - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index 0cab9a7ab..5d1ff0424 100644 +index d17cb787..45656595 100644 --- a/module/cmd-list/pom.xml +++ b/module/cmd-list/pom.xml @@ -5,13 +5,13 @@ @@ -318,18 +318,18 @@ index 0cab9a7ab..5d1ff0424 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-list + flamecord-module-cmd-list - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index 240c95487..1f6a7c681 100644 +index d1972708..b3bf39c8 100644 --- a/module/cmd-send/pom.xml +++ b/module/cmd-send/pom.xml @@ -5,13 +5,13 @@ @@ -338,18 +338,18 @@ index 240c95487..1f6a7c681 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-send + flamecord-module-cmd-send - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 4c13d5177..c353e8293 100644 +index 3b2c4952..b66c2cff 100644 --- a/module/cmd-server/pom.xml +++ b/module/cmd-server/pom.xml @@ -5,13 +5,13 @@ @@ -358,18 +358,18 @@ index 4c13d5177..c353e8293 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-server + flamecord-module-cmd-server - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/module/pom.xml b/module/pom.xml -index c9849b6c1..ca0a9c87d 100644 +index 0ef98d58..c6668ffc 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -5,18 +5,18 @@ @@ -378,14 +378,14 @@ index c9849b6c1..ca0a9c87d 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT pom - Waterfall Modules @@ -405,7 +405,7 @@ index c9849b6c1..ca0a9c87d 100644 compile diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index 45910b0e7..d1a2d86c8 100644 +index b88398cf..621bf1c2 100644 --- a/module/reconnect-yaml/pom.xml +++ b/module/reconnect-yaml/pom.xml @@ -5,13 +5,13 @@ @@ -414,18 +414,18 @@ index 45910b0e7..d1a2d86c8 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-reconnect-yaml + flamecord-module-reconnect-yaml - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar diff --git a/native/pom.xml b/native/pom.xml -index db15febbc..a2efb5e52 100644 +index 652a869d..b56fdc51 100644 --- a/native/pom.xml +++ b/native/pom.xml @@ -5,18 +5,18 @@ @@ -434,14 +434,14 @@ index db15febbc..a2efb5e52 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-native + flamecord-native - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Native @@ -452,7 +452,7 @@ index db15febbc..a2efb5e52 100644 diff --git a/pom.xml b/pom.xml -index 02480a208..f61cdf375 100644 +index fd71cdbd..26e85fb8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ @@ -468,7 +468,7 @@ index 02480a208..f61cdf375 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT pom - Waterfall-Parent @@ -499,7 +499,7 @@ index 02480a208..f61cdf375 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 402266ca1..993cbca95 100644 +index dbc0a3ab..433fbfe0 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -5,18 +5,18 @@ @@ -508,14 +508,14 @@ index 402266ca1..993cbca95 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-protocol + flamecord-protocol - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Protocol @@ -535,7 +535,7 @@ index 402266ca1..993cbca95 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index 602b9a93f..e2ce69e43 100644 +index c3a2eeb6..7bfe7d6b 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -544,14 +544,14 @@ index 602b9a93f..e2ce69e43 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-proxy + flamecord-proxy - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Proxy @@ -597,7 +597,7 @@ index 602b9a93f..e2ce69e43 100644 compile diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -index 338c30d35..c04992523 100644 +index 338c30d3..2ba0ab64 100644 --- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java +++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java @@ -20,7 +20,7 @@ public class JenkinsModuleSource implements ModuleSource @@ -610,7 +610,7 @@ index 338c30d35..c04992523 100644 version.getBuild(), module.getName() diff --git a/query/pom.xml b/query/pom.xml -index 8ce88f4a4..813696e45 100644 +index dea7d85f..b4570001 100644 --- a/query/pom.xml +++ b/query/pom.xml @@ -5,18 +5,18 @@ @@ -619,14 +619,14 @@ index 8ce88f4a4..813696e45 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-query + flamecord-query - 1.16-R0.5-SNAPSHOT + 1.17-R0.1-SNAPSHOT jar - Waterfall-Query @@ -646,5 +646,5 @@ index 8ce88f4a4..813696e45 100644 compile -- -2.31.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch index 7b67e218..e65b17fb 100644 --- a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 390c73f1736afb9ea786fcfa142b671f087aeb1f Mon Sep 17 00:00:00 2001 +From 60a16fffd914c3eb6cca576b85fe34d02c135768 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..5f618ddf +index 00000000..ed4c392c --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -17,13 +17,13 @@ index 00000000..5f618ddf + + io.github.waterfallmc + flamecord-parent -+ 1.16-R0.5-SNAPSHOT ++ 1.17-R0.1-SNAPSHOT + ../pom.xml + + + dev._2lstudios + flamecord-flamecord -+ 1.16-R0.5-SNAPSHOT ++ 1.17-R0.1-SNAPSHOT + jar + + FlameCord-FlameCord @@ -55,7 +55,7 @@ index 00000000..5f618ddf + + diff --git a/pom.xml b/pom.xml -index b1052b2b..c46258f2 100644 +index 26e85fb8..b305e245 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,9 @@ @@ -69,7 +69,7 @@ index b1052b2b..c46258f2 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 044be0c3..6fa1ade1 100644 +index 433fbfe0..22319300 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -64,5 +64,14 @@ @@ -88,7 +88,7 @@ index 044be0c3..6fa1ade1 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index d3750214..05255a29 100644 +index 7bfe7d6b..d9a375e7 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -150,6 +150,51 @@ @@ -144,5 +144,5 @@ index d3750214..05255a29 100644 -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/scripts/upstreamCommit.sh b/scripts/upstreamCommit.sh index aa7c1a92..8aaad42f 100755 --- a/scripts/upstreamCommit.sh +++ b/scripts/upstreamCommit.sh @@ -15,7 +15,7 @@ if [ ! -z "$waterfall" ]; then logsuffix="$logsuffix\n\nWaterfall Changes:\n$waterfall" if [ -z "$updated" ]; then updated="Waterfall"; else updated="$updated/Waterfall"; fi fi -disclaimer="Upstream has released updates that appears to apply and compile correctly.\nThis update has not been tested by PaperMC and as with ANY update, please do your own testing" +disclaimer="Upstream has released updates that appears to apply and compile correctly.\nThis update has not been tested by 2LStudios and as with ANY update, please do your own testing" if [ ! -z "$1" ]; then disclaimer="$@" From 373709b9df36733b9c112ec94f2d9df052dc844a Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Jun 2021 16:37:52 -0300 Subject: [PATCH 119/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b239628..dc7c7f36 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ To compile FlameCord you need the same requirements as FlameCord, and run the co -FlameCord [![Build Status](https://papermc.io/ci/job/FlameCord/badge/icon)](https://papermc.io/ci/job/FlameCord/) +FlameCord ======= FlameCord is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. From 5446af4f43c0b3ce7ed75f6b5dd6abe89c003083 Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Wed, 9 Jun 2021 16:11:12 -0500 Subject: [PATCH 120/499] Updated markdown files to reflect recent changes --- CONTRIBUTING.md | 7 +++---- README.md | 30 +++++++----------------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab30dc72..0494f946 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ Contributing to FlameCord ========================== -WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. +FlameCord follows the parameters of the WaterfallMC project when making a Pull Request. WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. ## Understanding Patches Patches to FlameCord are very simple, but center around the directory 'FlameCord-Proxy' @@ -14,8 +14,8 @@ Assuming you already have forked the repository: This directory is not a git repository in the traditional sense: - Every single commit in FlameCord-Proxy is a patch. -- 'origin/master' points to a directory similar to FlameCord-Proxy but for FlameCord -- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, FlameCord, Waterfall, and Bungeecord don't +- 'origin/master' points to a directory similar to Waterfall-Proxy but for FlameCord +- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, Waterfall, and Bungeecord don't - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update FlameCord ## Adding Patches @@ -38,7 +38,6 @@ This method works by temporarily resetting HEAD to the desired commit to edit us 1. If you have changes you are working on type `git stash` to store them for later. - Later you can type `git stash pop` to get them back. 2. Type `git rebase -i upstream/upstream` - - It should show something like [this](https://gist.github.com/Zbob750/e6bb220d3b734933c320). 3. Replace `pick` with `edit` for the commit/patch you want to modify, and "save" the changes. - Only do this for one commit at a time. 4. Make the changes you want to make to the patch. diff --git a/README.md b/README.md index dc7c7f36..1c5130d8 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,31 @@ FlameCord ======= -FlameCord is a patch for FlameCord to fix possible exploits and add useful functionalities. +FlameCord is a patch for Waterfall to fix possible exploits and add useful functionalities. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. -FlameCord is compiled like FlameCord does; Please follow the CONTRIBUTING.md file. If you need help you can always contact us on Discord. - -To compile FlameCord you need the same requirements as FlameCord, and run the command `./flamecord b` to get the corresponding jar. +FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. -FlameCord -======= - -FlameCord is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. - Waterfall focuses on three main areas: * **Stability**: Waterfall aims to be stable. We will achieve this through making the code base testable and discouraging practices that lead to proxy lag. * **Features**: Waterfall aims to include more features than canonical BungeeCord. * **Scalability**: Waterfall should be able to handle a large number of concurrent players, given a reasonably modern CPU, memory, and good network connection. -FlameCord focuses on one main area: +FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: -* **Additional Client Version Support**: FlameCord aims to support client versions older then what is supported in upstream. This includes 1.7 support. Additionally FlameCord may release Snapshot and PRE Client support patches as time permits. +* **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. ## Why fork Waterfall? -FlameCord has a goal of adding additional protocol versions. - -FlameCord was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. +Waterfall was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. FlameCord will track upstream Waterfall and merge changes as needed. ## How to (Server Admins) -Download a copy of FlameCord.jar from our homepage here: [FlameCord](https://papermc.io/downloads#FlameCord) +You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). Or you can download it for free in the [releases tab](https://github.com/2lstudios-mc/FlameCord/releases). FlameCord requires **Java 8** or above. @@ -47,11 +38,4 @@ Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/ ## Join us * Feel free to open a PR! We accept contributions. -* Join us on IRC (irc.spi.gt #paper, [webchat](http://irc.spi.gt/iris/?nick=&channels=paper)). -* Visit our forums (https://papermc.io/forums). - -Special Thanks To ------------------ -![YourKit-Logo](https://yourkit.com/images/yklogo.png) - -[YourKit](https://yourkit.com/), makers of the outstanding Java profiler, supports open source projects of all kinds with their full-featured [Java](https://yourkit.com/features/) and [.NET](https://yourkit.com/dotnet/features/) application profilers. We thank them for granting FlameCord an OSS license so that we can make our software the best it can be. +* Join to our [Discord Server](https://discord.gg/gF36AT3). \ No newline at end of file From ae6fe11f0e65e35cb6db282f6c598122b3b72349 Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Wed, 9 Jun 2021 16:23:45 -0500 Subject: [PATCH 121/499] Small readme improvement --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c5130d8..c58a4d7f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](h +## Features + Waterfall focuses on three main areas: * **Stability**: Waterfall aims to be stable. We will achieve this through making the code base testable and discouraging practices that lead to proxy lag. @@ -19,7 +21,7 @@ FlameCord being a fork of Waterfall, has all its features, and some of its own, ## Why fork Waterfall? -Waterfall was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. +Waterfall was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. FlameCord will track upstream Waterfall and merge changes as needed. @@ -31,7 +33,7 @@ FlameCord requires **Java 8** or above. ## How To (Compiling from source) -To compile FlameCord, you need JDK8, git, bash, maven, and an internet connection. +To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet connection. Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` From 2e0c07bd957c091ffe9f092d1c72d75fa1bc8dc1 Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Wed, 9 Jun 2021 16:42:09 -0500 Subject: [PATCH 122/499] More changes --- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 10 +++++----- pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index c1903ff7..e001bbc8 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -476,7 +476,7 @@ index fd71cdbd..26e85fb8 100644 - https://github.com/WaterfallMC/Waterfall + FlameCord-Parent + Parent project for all FlameCord modules. -+ https://github.com/PaperMC/FlameCord ++ https://github.com/2lstudios-mc/FlameCord 2015 WaterfallMC @@ -487,14 +487,14 @@ index fd71cdbd..26e85fb8 100644 - scm:git:git@github.com:com:WaterfallMC/Waterfall.git - scm:git:git@github.com:WaterfallMC/Waterfall.git - git@github.com:WaterfallMC/Waterfall.git -+ scm:git:git@github.com:com:PaperMC/FlameCord.git -+ scm:git:git@github.com:PaperMC/FlameCord.git -+ git@github.com:PaperMC/FlameCord.git ++ scm:git:git@github.com:com:2lstudios-mc/FlameCord.git ++ scm:git:git@github.com:2lstudios-mc/FlameCord.git ++ git@github.com:2lstudios-mc/FlameCord.git GitHub - https://github.com/PaperMC/Waterfall/issues -+ https://github.com/PaperMC/FlameCord/issues ++ https://github.com/2lstudios-mc/FlameCord/issues diff --git a/pom.xml b/pom.xml index 8b9c2e01..e251aee2 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ FlameCord-Super Super project for FlameCord. - https://github.com/WaterfallMC/FlameCord + https://github.com/2lstudios-mc/FlameCord FlameCord-Proxy From db6bf5013afd45ff377fa88919841f689a1140e2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:31:22 -0300 Subject: [PATCH 123/499] Added packet limits --- .../0030-Apply-packet-limits.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch diff --git a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch new file mode 100644 index 00000000..bf66fe3b --- /dev/null +++ b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch @@ -0,0 +1,30 @@ +From cfa71e7554b7e6dd29c6bfd768ca09ce4e8249d3 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Jun 2021 11:30:19 -0300 +Subject: [PATCH] Apply packet limits + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +index 7dbbfd3c..732bf553 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -43,4 +44,8 @@ public class Handshake extends DefinedPacket + { + handler.handle( this ); + } ++ ++ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits ++ } + } +-- +2.31.1.windows.1 + From c02eabf30738deebcc23b0f7ed9ac1f1282b7319 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:36:32 -0300 Subject: [PATCH 124/499] Update 0004-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 30881fc5..7c4cc452 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.4"; ++ return "0.5.5"; } public void reloadMessages() From ac48c3f1a519a81c57922a760f04893382c5f3ac Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 20:28:00 -0300 Subject: [PATCH 125/499] further improve dos prevention --- .../0028-Apply-buffer-limits.patch | 18 +++++++++--------- .../0030-Apply-packet-limits.patch | 7 ++++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch index 2097e722..76ad0132 100644 --- a/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch +++ b/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch @@ -1,11 +1,11 @@ -From fb88c2ddba3687968164ffa6a8f91801f739c18f Mon Sep 17 00:00:00 2001 +From a6c965c0ff65261382ea757939fc326529487b39 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 May 2021 12:56:29 -0300 Subject: [PATCH] Apply buffer limits diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d2c9a5be..b3b322c4 100644 +index c7576b22..00fedc40 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -370,6 +370,9 @@ public class BungeeCord extends ProxyServer @@ -13,7 +13,7 @@ index d2c9a5be..b3b322c4 100644 } }; + -+ int bufferSize = 65536; // FlameCord ++ int bufferSize = 8192; // FlameCord + new ServerBootstrap() .channel( PipelineUtils.getServerChannel( info.getSocketAddress() ) ) @@ -28,7 +28,7 @@ index d2c9a5be..b3b322c4 100644 if ( info.isQueryEnabled() ) diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java -index 37657c4c..ba31471e 100644 +index 37657c4c..a72f821b 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java @@ -2,6 +2,7 @@ package net.md_5.bungee.http; @@ -43,7 +43,7 @@ index 37657c4c..ba31471e 100644 @Override protected void initChannel(Channel ch) throws Exception { -+ int bufferSize = 65536; // FlameCord ++ int bufferSize = 8192; // FlameCord + + ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord + ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord @@ -52,7 +52,7 @@ index 37657c4c..ba31471e 100644 if ( ssl ) { 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 7fb1e70f..c7038164 100644 +index 7fb1e70f..fd2e8bd7 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 @@ -207,6 +207,11 @@ public class PipelineUtils @@ -60,7 +60,7 @@ index 7fb1e70f..c7038164 100644 // IP_TOS is not supported (Windows XP / Windows Server 2003) } + -+ int bufferSize = 65536; // FlameCord ++ int bufferSize = 8192; // FlameCord + + ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord + ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord @@ -68,7 +68,7 @@ index 7fb1e70f..c7038164 100644 ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); ch.config().setWriteBufferWaterMark( MARK ); diff --git a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java -index 8becc26a..8304685c 100644 +index 8becc26a..dc20fc5f 100644 --- a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java +++ b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java @@ -1,5 +1,6 @@ @@ -82,7 +82,7 @@ index 8becc26a..8304685c 100644 public void start(Class channel, InetSocketAddress address, EventLoopGroup eventLoop, ChannelFutureListener future) { -+ int bufferSize = 65536; // FlameCord ++ int bufferSize = 8192; // FlameCord + new Bootstrap() .channel( channel ) diff --git a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch index bf66fe3b..6bbdfd23 100644 --- a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch @@ -1,11 +1,11 @@ -From cfa71e7554b7e6dd29c6bfd768ca09ce4e8249d3 Mon Sep 17 00:00:00 2001 +From 048c2bcd5660d0e2b637a4a017b08181fd83435d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..732bf553 100644 +index 7dbbfd3c..fed1e607 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -16,11 +16,12 @@ index 7dbbfd3c..732bf553 100644 @Data @NoArgsConstructor -@@ -43,4 +44,8 @@ public class Handshake extends DefinedPacket +@@ -43,4 +44,9 @@ public class Handshake extends DefinedPacket { handler.handle( this ); } + ++ @Override + public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits + } From d41c8c9ec73a875b9dac89d3f4bbc5a8dcd832a9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 20:32:13 -0300 Subject: [PATCH 126/499] further improve dos prevention --- .../0030-Apply-packet-limits.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch index 6bbdfd23..be10f49a 100644 --- a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch @@ -1,11 +1,11 @@ -From 048c2bcd5660d0e2b637a4a017b08181fd83435d Mon Sep 17 00:00:00 2001 +From 9bb24df8c3a8622965c912a9c596b86791674578 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..fed1e607 100644 +index 7dbbfd3c..00f387d8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -16,14 +16,19 @@ index 7dbbfd3c..fed1e607 100644 @Data @NoArgsConstructor -@@ -43,4 +44,9 @@ public class Handshake extends DefinedPacket +@@ -43,4 +44,14 @@ public class Handshake extends DefinedPacket { handler.handle( this ); } + + @Override ++ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 5 + ((255 * 4 + 3) + 5) + 2 + 1; // FlameCord - Apply packet limits (by Janmm14) ++ } ++ ++ @Override + public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits ++ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits (by Janmm14) + } } -- From 28b62ba2c9221d96c9747e6c07274d04b00d635f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 11 Jun 2021 13:48:51 -0300 Subject: [PATCH 127/499] Update 0004-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 7c4cc452..ee69c4af 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.5"; ++ return "0.5.6"; } public void reloadMessages() From b1afbbc25f0ee6a33588e18c52f5c45fb0607734 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 12 Jun 2021 23:25:20 -0300 Subject: [PATCH 128/499] Delete 0029-Limit-String-read.patch --- .../0029-Limit-String-read.patch | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0029-Limit-String-read.patch diff --git a/Waterfall-Proxy-Patches/0029-Limit-String-read.patch b/Waterfall-Proxy-Patches/0029-Limit-String-read.patch deleted file mode 100644 index aeb17920..00000000 --- a/Waterfall-Proxy-Patches/0029-Limit-String-read.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b86af279788955740e72eea8f06ed6a153d80719 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 19 May 2021 15:40:41 -0300 -Subject: [PATCH] Limit String read - - -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 -index 31a95495..01484bcc 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -36,12 +36,13 @@ public abstract class DefinedPacket - - public static String readString(ByteBuf buf) - { -- return readString( buf, Short.MAX_VALUE ); -+ return readString( buf, 2048 ); // FlameCord - } - - public static String readString(ByteBuf buf, int maxLen) - { - int len = readVarInt( buf ); -+ - if ( len > maxLen * 4 ) - { - if(!MinecraftDecoder.DEBUG) throw STRING_TOO_MANY_BYTES_EXCEPTION; // Waterfall start: Additional DoS mitigations --- -2.31.1.windows.1 - From 31a495012b5b71dbbf4e1d5136d32b96e270f9d2 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Sun, 13 Jun 2021 18:49:24 +0200 Subject: [PATCH 129/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: acf737f Updated Upstream (BungeeCord) (#658) cd2ccc6 Updated Upstream (BungeeCord) --- Waterfall | 2 +- ...ply-packet-limits.patch => 0029-Apply-packet-limits.patch} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename Waterfall-Proxy-Patches/{0030-Apply-packet-limits.patch => 0029-Apply-packet-limits.patch} (94%) diff --git a/Waterfall b/Waterfall index c74fe8a9..acf737f3 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit c74fe8a9b23803ea7d84dda757c07ac7a3bad03b +Subproject commit acf737f35fa65d143e1a67faeaed9cf2f9846447 diff --git a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch similarity index 94% rename from Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch index be10f49a..8d04d41d 100644 --- a/Waterfall-Proxy-Patches/0030-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 9bb24df8c3a8622965c912a9c596b86791674578 Mon Sep 17 00:00:00 2001 +From fd8069ef569a8ab85a743a52f1fd9b67cad09ba4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits @@ -32,5 +32,5 @@ index 7dbbfd3c..00f387d8 100644 + } } -- -2.31.1.windows.1 +2.32.0.windows.1 From bc538c66281465e9255b3e54a6dc9f48a2c78f80 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Jun 2021 22:08:10 -0300 Subject: [PATCH 130/499] Delete 0028-Apply-buffer-limits.patch --- .../0028-Apply-buffer-limits.patch | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch diff --git a/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch deleted file mode 100644 index 76ad0132..00000000 --- a/Waterfall-Proxy-Patches/0028-Apply-buffer-limits.patch +++ /dev/null @@ -1,99 +0,0 @@ -From a6c965c0ff65261382ea757939fc326529487b39 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 19 May 2021 12:56:29 -0300 -Subject: [PATCH] Apply buffer limits - - -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c7576b22..00fedc40 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -370,6 +370,9 @@ public class BungeeCord extends ProxyServer - } - } - }; -+ -+ int bufferSize = 8192; // FlameCord -+ - new ServerBootstrap() - .channel( PipelineUtils.getServerChannel( info.getSocketAddress() ) ) - .option( ChannelOption.SO_REUSEADDR, true ) // TODO: Move this elsewhere! -@@ -377,6 +380,8 @@ public class BungeeCord extends ProxyServer - .childHandler( PipelineUtils.SERVER_CHILD ) - .group( bossEventLoopGroup, workerEventLoopGroup ) - .localAddress( info.getSocketAddress() ) -+ .childOption(ChannelOption.SO_RCVBUF, bufferSize) // FlameCord -+ .childOption(ChannelOption.SO_SNDBUF, bufferSize) // FlameCord - .bind().addListener( listener ); - - if ( info.isQueryEnabled() ) -diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java -index 37657c4c..a72f821b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java -+++ b/proxy/src/main/java/net/md_5/bungee/http/HttpInitializer.java -@@ -2,6 +2,7 @@ package net.md_5.bungee.http; - - import io.netty.channel.Channel; - import io.netty.channel.ChannelInitializer; -+import io.netty.channel.ChannelOption; - import io.netty.handler.codec.http.HttpClientCodec; - import io.netty.handler.ssl.SslContextBuilder; - import io.netty.handler.ssl.SslHandler; -@@ -23,6 +24,11 @@ public class HttpInitializer extends ChannelInitializer - @Override - protected void initChannel(Channel ch) throws Exception - { -+ int bufferSize = 8192; // FlameCord -+ -+ ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord -+ ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord -+ - ch.pipeline().addLast( "timeout", new ReadTimeoutHandler( HttpClient.TIMEOUT, TimeUnit.MILLISECONDS ) ); - if ( ssl ) - { -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 7fb1e70f..fd2e8bd7 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 -@@ -207,6 +207,11 @@ public class PipelineUtils - { - // IP_TOS is not supported (Windows XP / Windows Server 2003) - } -+ -+ int bufferSize = 8192; // FlameCord -+ -+ ch.config().setOption( ChannelOption.SO_RCVBUF, bufferSize ); // FlameCord -+ ch.config().setOption( ChannelOption.SO_SNDBUF, bufferSize ); // FlameCord - ch.config().setOption( ChannelOption.TCP_NODELAY, true ); - ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); - ch.config().setWriteBufferWaterMark( MARK ); -diff --git a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java -index 8becc26a..dc20fc5f 100644 ---- a/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java -+++ b/query/src/main/java/net/md_5/bungee/query/RemoteQuery.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.query; - -+import io.netty.channel.ChannelOption; - import io.netty.bootstrap.Bootstrap; - import io.netty.channel.Channel; - import io.netty.channel.ChannelFutureListener; -@@ -18,11 +19,15 @@ public class RemoteQuery - - public void start(Class channel, InetSocketAddress address, EventLoopGroup eventLoop, ChannelFutureListener future) - { -+ int bufferSize = 8192; // FlameCord -+ - new Bootstrap() - .channel( channel ) - .group( eventLoop ) - .handler( new QueryHandler( bungee, listener ) ) - .localAddress( address ) -+ .option(ChannelOption.SO_RCVBUF, bufferSize) // FlameCord -+ .option(ChannelOption.SO_SNDBUF, bufferSize) // FlameCord - .bind().addListener( future ); - } - } --- -2.31.1.windows.1 - From ededcfbb391ef9f8039602c85b7a467e1f762457 Mon Sep 17 00:00:00 2001 From: Valentina Avalos Date: Tue, 29 Jun 2021 02:55:59 -0300 Subject: [PATCH 131/499] Rename patch 29 -> 28 --- .../0028-Apply-packet-limits.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch diff --git a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch new file mode 100644 index 00000000..8d04d41d --- /dev/null +++ b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch @@ -0,0 +1,36 @@ +From fd8069ef569a8ab85a743a52f1fd9b67cad09ba4 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Jun 2021 11:30:19 -0300 +Subject: [PATCH] Apply packet limits + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +index 7dbbfd3c..00f387d8 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -43,4 +44,14 @@ public class Handshake extends DefinedPacket + { + handler.handle( this ); + } ++ ++ @Override ++ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 5 + ((255 * 4 + 3) + 5) + 2 + 1; // FlameCord - Apply packet limits (by Janmm14) ++ } ++ ++ @Override ++ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits (by Janmm14) ++ } + } +-- +2.32.0.windows.1 + From d828980fd457877f75a0efc964a0018ab6f4a78f Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 29 Jun 2021 18:23:19 +0200 Subject: [PATCH 132/499] Delete duplicate patch --- .../0029-Apply-packet-limits.patch | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch diff --git a/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch deleted file mode 100644 index 8d04d41d..00000000 --- a/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch +++ /dev/null @@ -1,36 +0,0 @@ -From fd8069ef569a8ab85a743a52f1fd9b67cad09ba4 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 10 Jun 2021 11:30:19 -0300 -Subject: [PATCH] Apply packet limits - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..00f387d8 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; - import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor -@@ -43,4 +44,14 @@ public class Handshake extends DefinedPacket - { - handler.handle( this ); - } -+ -+ @Override -+ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 5 + ((255 * 4 + 3) + 5) + 2 + 1; // FlameCord - Apply packet limits (by Janmm14) -+ } -+ -+ @Override -+ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits (by Janmm14) -+ } - } --- -2.32.0.windows.1 - From ade6480166cf34132936e916f4c70800fa63a274 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 2 Jul 2021 09:02:40 -0300 Subject: [PATCH 133/499] Update 0028-Apply-packet-limits.patch --- Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch index 8d04d41d..daa21e31 100644 --- a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch @@ -23,12 +23,12 @@ index 7dbbfd3c..00f387d8 100644 + + @Override + public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 5 + ((255 * 4 + 3) + 5) + 2 + 1; // FlameCord - Apply packet limits (by Janmm14) ++ return 1036 + 256; // FlameCord - Apply packet limits (by Janmm14) + } + + @Override + public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 1 + 2 + 1 + 1; // FlameCord - Apply packet limits (by Janmm14) ++ return 5; // FlameCord - Apply packet limits (by Janmm14) + } } -- From c0c25635bdd77db855e453f8a713f569f7c66398 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 3 Jul 2021 16:56:19 -0300 Subject: [PATCH 134/499] version 0.5.9 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index ee69c4af..387d4f4c 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.6"; ++ return "0.5.9"; } public void reloadMessages() From d75d7d1edcb443ef92aa1125445438a03c9eb446 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Sun, 4 Jul 2021 22:22:11 +0200 Subject: [PATCH 135/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: a5c78a9 (Maybe) Fix javadoc search eb920b8 Updated Upstream (BungeeCord) 8e9b90a fix compile-native not working on linux ee819df Updated Upstream (BungeeCord) 66601f7 [ci skip] link to javadocs page instead of attempting direct --- Waterfall | 2 +- ...onnections-Don-t-flush-if-not-necessary.patch | 8 ++++---- ...e-to-encrypt-only-if-onlineMode-is-true.patch | 8 ++++---- .../0013-Don-t-allow-name-containing-dot.patch | 15 ++++----------- ...custom-uuids-even-if-onlineMode-is-true.patch | 8 ++++---- ...arly-to-avoid-multiple-incoming-packets.patch | 12 ++++++------ ...lStateException-to-QuietException-and-e.patch | 8 ++++---- ...018-Don-t-declare-uuid-unless-it-s-null.patch | 8 ++++---- .../0019-FlameCord-General-Patch.patch | 16 ++++++++-------- 9 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Waterfall b/Waterfall index acf737f3..a5c78a96 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit acf737f35fa65d143e1a67faeaed9cf2f9846447 +Subproject commit a5c78a961e091417914a7723d5d840c17b92f52e diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 06967ce6..68b05ea7 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From fd1cdbfda00482440c45e74217c78f5b62b1be49 Mon Sep 17 00:00:00 2001 +From cf8b96298bc7e02d04b30aa1dca04968bda068d8 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 49ba34db..6e148782 100644 +index 0647a774..37784acd 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 @@ -192,6 +192,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -56,7 +56,7 @@ index 49ba34db..6e148782 100644 } @Override -@@ -606,7 +624,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -600,7 +618,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -173,5 +173,5 @@ index 0c1ecfb8..b3bdfd05 100644 } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index cfff0326..ff7fffb5 100644 --- a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From c21daf0a4ba52c12de9e92b1eb815c893e93db4d Mon Sep 17 00:00:00 2001 +From bb419bd35b5e513be0ca20cda4c97bcaa23f0cd7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 6e148782..e23cf604 100644 +index 37784acd..1811084a 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 -@@ -432,11 +432,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -426,11 +426,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); @@ -23,5 +23,5 @@ index 6e148782..e23cf604 100644 }; -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index ac015b13..db2973f6 100644 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,14 +1,14 @@ -From c180aa80773a50794cef5bff389d663b876b49b3 Mon Sep 17 00:00:00 2001 +From 9754f77c4142bebe9425d493b6826503dd9060f9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot 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 9293739f..10b5aafb 100644 +index 1811084a..1925188f 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 -@@ -387,13 +387,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -387,7 +387,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; @@ -20,13 +20,6 @@ index 9293739f..10b5aafb 100644 { disconnect( bungee.getTranslation( "name_invalid" ) ); return; - } - -- if ( getName().length() > 16 ) -+ if ( name.length() > 16 ) - { - disconnect( bungee.getTranslation( "name_too_long" ) ); - return; -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 73728372..1bcaef3d 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 6b6dd8e0fc01d46fb928cbac548cc2ca1a0a7da1 Mon Sep 17 00:00:00 2001 +From ac987c138b977c2029dc845bbec5f9a1b70dd746 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 b4067b1e..3120abdb 100644 +index 1925188f..554526a3 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 -@@ -686,7 +686,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -680,7 +680,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index b4067b1e..3120abdb 100644 } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch index d6c8b452..19c7103a 100644 --- a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,14 +1,14 @@ -From a497afed2aec0b47499e6d4f9cadedab6a2512f6 Mon Sep 17 00:00:00 2001 +From f8d0abde43d1fa6abc45631b372e5a71d1af2f48 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 3120abdb..4a17a117 100644 +index 554526a3..e643d8a7 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 -@@ -453,6 +453,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -447,6 +447,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -17,7 +17,7 @@ index 3120abdb..4a17a117 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start if (sharedKey instanceof SecretKeySpec) { -@@ -512,6 +514,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -506,6 +508,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { @@ -27,7 +27,7 @@ index 3120abdb..4a17a117 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -593,8 +598,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -587,8 +592,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection } userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); @@ -37,5 +37,5 @@ index 3120abdb..4a17a117 100644 } } ); -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch index d9f7669f..1c5b34ce 100644 --- a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 68f77c174634d73fbce5ddee67d9168277447333 Mon Sep 17 00:00:00 2001 +From 8b3e6f968ad9a19466653d9a08b31da13567b6d2 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 01075a85..fb065ccd 100644 +index fc98b4b1..db79b58a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -309,7 +309,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -310,7 +310,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { @@ -20,5 +20,5 @@ index 01075a85..fb065ccd 100644 return; } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch index ad213ea9..9d387892 100644 --- a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From d8d2c3450c09ebcc32c821e99b0fa4c7559a18a9 Mon Sep 17 00:00:00 2001 +From ae64b8938eadb7ee4b0c68572b4e270530603ad9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 4a17a117..95a6f40c 100644 +index e643d8a7..dc5b64b7 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 -@@ -496,7 +496,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -490,7 +490,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index 4a17a117..95a6f40c 100644 return; } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index 5cb2906d..d8e6e9b5 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 91af7ea587264e4af28fecb81b12163fe8a7f75e Mon Sep 17 00:00:00 2001 +From 1f6d89b080f89d2a235554957815deb3047dab05 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e7bd97b..46f180a0 100644 +index 778fe4a1..9c45f305 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; @@ -285,10 +285,10 @@ index f5e09292..3e3e42a2 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 fb065ccd..3d18dbf9 100644 +index db79b58a..a847c049 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; +@@ -36,6 +36,7 @@ import net.md_5.bungee.api.SkinConfiguration; import net.md_5.bungee.api.Title; import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.TextComponent; @@ -296,7 +296,7 @@ index fb065ccd..3d18dbf9 100644 import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.PermissionCheckEvent; -@@ -65,6 +66,7 @@ import net.md_5.bungee.tab.ServerUnique; +@@ -66,6 +67,7 @@ import net.md_5.bungee.tab.ServerUnique; import net.md_5.bungee.tab.TabList; import net.md_5.bungee.util.CaseInsensitiveSet; import net.md_5.bungee.util.ChatComponentTransformer; @@ -304,7 +304,7 @@ index fb065ccd..3d18dbf9 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -389,9 +391,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -390,9 +392,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -319,7 +319,7 @@ index fb065ccd..3d18dbf9 100644 b.connect().addListener( listener ); } 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 aa952717..a1ec1bff 100644 +index dc5b64b7..e88ec72a 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 @@ -14,6 +14,8 @@ import java.util.logging.Level; @@ -379,5 +379,5 @@ index 654203ab..a840bc70 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.31.1.windows.1 +2.32.0.windows.1 From a9ca533e3f642233a65c686bb9102adff81cf6c0 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 6 Jul 2021 22:13:09 +0200 Subject: [PATCH 136/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: 9dd430a Updated Upstream (BungeeCord) (#667) --- Waterfall | 2 +- .../0022-Fix-ByteBuf-memory-leaks.patch | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall b/Waterfall index a5c78a96..9dd430af 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit a5c78a961e091417914a7723d5d840c17b92f52e +Subproject commit 9dd430af6d1809020fc95637f86ba21340ccada1 diff --git a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch index e326abae..bcfa09a8 100644 --- a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 6c410c530ba6004e34032a1460c644808dd230b1 Mon Sep 17 00:00:00 2001 +From fb2700e20203d8aeb36b8f64b688df0b264cb9dc Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks @@ -64,10 +64,10 @@ index 9e180c30..40c016d6 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 13456b34..6d4b96cd 100644 +index 09df5a93..67ef2cb4 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -141,11 +141,15 @@ public abstract class EntityMap +@@ -142,11 +142,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -123,5 +123,5 @@ index cefa0206..8d4439ab 100644 } -- -2.31.1.windows.1 +2.32.0.windows.1 From 8716136762570f5835927944833d6d293b593930 Mon Sep 17 00:00:00 2001 From: Adrianed04 Date: Fri, 9 Jul 2021 19:06:51 -0500 Subject: [PATCH 137/499] [ci skip] Separate compilation tests for better organization --- .github/workflows/flamecord-build.yml | 16 +++---- .github/workflows/flamecord-pull-request.yml | 49 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/flamecord-pull-request.yml diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index b37fcfc9..068c0c73 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -1,10 +1,10 @@ -# This workflow will perform a compilation test -# on each pull request or push to the branch master -# to check its correct compilation and will deliver -# an artifact to check if the change is working properly. +# This workflow will perform a compilation test on +# each push to the branch master to check its correct +# compilation and will deliver an artifact to check +# if the change is working properly. name: FlameCord Maven Build -on: [push, pull_request] +on: [push] jobs: build: @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v2 - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v2.1.0 with: java-version: ${{ matrix.java }} distribution: 'adopt' @@ -30,7 +30,7 @@ jobs: # The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven Packages - uses: actions/cache@v2.1.5 + uses: actions/cache@v2.1.6 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -44,7 +44,7 @@ jobs: # An artifact is generated in a compressed file according to each JDK build version. - name: Upload FlameCord - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v2.2.4 with: name: FlameCord-JDK${{ matrix.java }} path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml new file mode 100644 index 00000000..85ad7940 --- /dev/null +++ b/.github/workflows/flamecord-pull-request.yml @@ -0,0 +1,49 @@ +# This workflow will perform a compilation test on each +# pull request to check its correct compilation and will deliver +# an artifact to check if the change is working properly. +name: FlameCord Pull Request + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + # The corresponding tests are performed in the versions + # marked as Long Term Support by Oracle and in its + # latest version up to the moment. + strategy: + matrix: + java: [8, 11, 16] + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup JAVA ${{ matrix.java }} + uses: actions/setup-java@v2.1.0 + with: + java-version: ${{ matrix.java }} + distribution: 'adopt' + architecture: x64 + + # The corresponding dependencies are stored in the cache to speed up the test. + - name: Cache Maven Packages + uses: actions/cache@v2.1.6 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build FlameCord + run: | + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + scripts/build.sh --jar + + # An artifact is generated in a compressed file according to each JDK build version. + - name: Upload FlameCord + uses: actions/upload-artifact@v2.2.4 + with: + name: FlameCord-JDK${{ matrix.java }} + path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From 76ec170809b98b6bb2599fec0814a00b00449d82 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 11 Jul 2021 17:29:43 -0300 Subject: [PATCH 138/499] Update 0004-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 387d4f4c..ae0b4037 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.5.9"; ++ return "0.6.0"; } public void reloadMessages() From e76554de5914dabb51a3d20bb294898f84b9405b Mon Sep 17 00:00:00 2001 From: norhu1130 Date: Fri, 16 Jul 2021 11:16:11 +0900 Subject: [PATCH 139/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: f17de74 remove 4MB buffer size limit due to protocol changes dc044fb Don't bother locking to fetch a v4 UUID from the offline UUIDs map Signed-off-by: norhu1130 --- Waterfall | 2 +- ...ferences-from-Waterfall-to-FlameCord.patch | 20 +++++++++---------- ...sable-update-checker-Use-bungee-name.patch | 10 +++++----- .../0020-FlameCord-module-system.patch | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Waterfall b/Waterfall index 9dd430af..f17de747 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9dd430af6d1809020fc95637f86ba21340ccada1 +Subproject commit f17de7472d01af9cf94198e00386ed998558ea00 diff --git a/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch index 43775c05..50ecbd8c 100644 --- a/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,11 +1,11 @@ -From a5f023bb3c21941eaf45f1c8946b719d0752590e Mon Sep 17 00:00:00 2001 +From 97946438e45cb5480c3924d5c340cecd1f1a354f Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to FlameCord diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -index a4516ed96..1f63a2c27 100644 +index a4516ed9..9838f5c5 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -7,7 +7,7 @@ public class Bootstrap @@ -18,7 +18,7 @@ index a4516ed96..1f63a2c27 100644 return; } diff --git a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -index d703d6d24..d8dcdc1e3 100644 +index d703d6d2..49dce84b 100644 --- a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java +++ b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java @@ -12,7 +12,7 @@ public class LogDispatcher extends Thread @@ -31,7 +31,7 @@ index d703d6d24..d8dcdc1e3 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c09f5b4c3..97de4271c 100644 +index 07d74c67..a4b58d9c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer @@ -53,10 +53,10 @@ index c09f5b4c3..97de4271c 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 356805285..1c2628d31 100644 +index 0db3d76a..25da0a65 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -76,7 +76,7 @@ public class BungeeCordLauncher +@@ -63,7 +63,7 @@ public class BungeeCordLauncher BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); @@ -66,7 +66,7 @@ index 356805285..1c2628d31 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index b26035cf9..4e2c6129c 100644 +index b26035cf..820f7b03 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,6 @@ public class CommandBungee extends Command @@ -78,7 +78,7 @@ index b26035cf9..4e2c6129c 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -index 720d0c3b5..dca7601b0 100644 +index 720d0c3b..5ab4db18 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -23,7 +23,7 @@ public class CommandReload extends Command @@ -92,7 +92,7 @@ index 720d0c3b5..dca7601b0 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 65121ba24..d4fad294c 100644 +index 0644b8cd..9c11ac57 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -227,7 +227,7 @@ public class YamlConfig implements ConfigurationAdapter @@ -105,5 +105,5 @@ index 65121ba24..d4fad294c 100644 SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- -2.31.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index 4d83719b..5a167af1 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -1,14 +1,14 @@ -From 930c3622edaa63c7538d225d809e84c55b6a14fb Mon Sep 17 00:00:00 2001 +From 6cc482b6a66e0085ff7eb4ad565592ec9dd0d285 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 713bbbef..96db5e5e 100644 +index 25da0a65..d4b612b3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -58,25 +58,12 @@ public class BungeeCordLauncher +@@ -45,25 +45,12 @@ public class BungeeCordLauncher return; } @@ -38,7 +38,7 @@ index 713bbbef..96db5e5e 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index d5b3e6f8..7994c1c1 100644 +index 9c11ac57..ae4c7ac2 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -22,6 +22,7 @@ import java.util.Locale; @@ -70,5 +70,5 @@ index d5b3e6f8..7994c1c1 100644 int maxPlayers = get( "max_players", 1, val ); -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch index d3a3c6df..1728af7d 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 9d1c11965e719870b3f8cd3c31cfeb4ca966cde0 Mon Sep 17 00:00:00 2001 +From 67799e8a980a77546059d9c362d9845fce792f22 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 46f180a0..b1ac28a5 100644 +index a788559e..7681240b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; @@ -166,7 +166,7 @@ index 46f180a0..b1ac28a5 100644 if ( config.isForgeSupport() ) { -@@ -825,4 +828,56 @@ public class BungeeCord extends ProxyServer +@@ -830,4 +833,56 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -224,5 +224,5 @@ index 46f180a0..b1ac28a5 100644 + } } -- -2.31.1.windows.1 +2.32.0.windows.1 From a985ee382d26a06bca41f6c880e831a8579f9185 Mon Sep 17 00:00:00 2001 From: guacaplushy Date: Mon, 19 Jul 2021 14:05:08 -0400 Subject: [PATCH 140/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: 9137560 Updated Upstream (BungeeCord) (#678) 7196e44 Don't spam github actions log with maven progress (#662) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index f17de747..91375602 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit f17de7472d01af9cf94198e00386ed998558ea00 +Subproject commit 913756028a76c9867076010d54dbcf20282808ed From 9675b8df9bbd2a3cbd8a4df4d437408e66a46bdf Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 19 Jul 2021 20:13:20 -0300 Subject: [PATCH 141/499] version 0.6.1 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index ae0b4037..4fd27dd0 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.0"; ++ return "0.6.1"; } public void reloadMessages() From 434c23701ab319d372e1dc6dcb83079fc8dc8a0e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 19 Jul 2021 20:35:26 -0300 Subject: [PATCH 142/499] fix flamecord patches --- .../0025-FlameCord-logger-options.patch | 75 ++++++------------- .../0026-Always-release-packet.patch | 10 +-- 2 files changed, 29 insertions(+), 56 deletions(-) diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch index 84fa687b..fe075405 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch @@ -1,14 +1,14 @@ -From 7ebcb22ca7416573a78883ba592672c6f0ec62f7 Mon Sep 17 00:00:00 2001 +From 6eaee9fe8f737a2550080e90c282d77f0e4b49f4 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac1..056dcb81 100644 +index 8bb61ac1..aafd99d8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; +@@ -12,6 +12,16 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration { @@ -20,11 +20,12 @@ index 8bb61ac1..056dcb81 100644 + private boolean loggerDump = false; + @Getter + private boolean loggerHaProxy = false; ++ + @Getter private boolean firewallNotify = true; @Getter -@@ -34,6 +43,11 @@ public class FlameCordConfiguration { +@@ -34,6 +44,11 @@ public class FlameCordConfiguration { configuration = configurationProvider.load(configurationFile); } @@ -37,7 +38,7 @@ index 8bb61ac1..056dcb81 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 8e1749a4..4767edb6 100644 +index 83d074be..9805cff1 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 @@ -353,7 +353,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -61,7 +62,7 @@ index 8e1749a4..4767edb6 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 376daee9..62895541 100644 +index 8d6f9d3a..e5602230 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -84,24 +85,24 @@ index 376daee9..62895541 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -93,10 +95,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); +@@ -95,10 +97,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -- { -- channel.getRemoteAddress(), newAddress -- } ); -+ // FlameCord - Option to log haproxy -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) -+ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ { -+ channel.getRemoteAddress(), newAddress -+ } ); +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] +- { +- channel.getRemoteAddress(), newAddress +- } ); ++ // FlameCord - Option to log haproxy ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); - channel.setRemoteAddress( newAddress ); - } finally -@@ -140,6 +144,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.setRemoteAddress( newAddress ); + } +@@ -143,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); @@ -111,34 +112,6 @@ index 376daee9..62895541 100644 if ( logExceptions ) { if ( cause instanceof ReadTimeoutException ) -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 4e23c996..7fb1e70f 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 -@@ -116,7 +116,10 @@ public class PipelineUtils - // FlameCord - Close on exception caught - @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -- cause.printStackTrace(); -+ // FlameCord - Option to log exceptions -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { -+ cause.printStackTrace(); -+ } - - ctx.close(); - } -@@ -218,7 +221,10 @@ public class PipelineUtils - // FlameCord - Close on exception caught - @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -- cause.printStackTrace(); -+ // FlameCord - Option to log exceptions -+ if (FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions()) { -+ cause.printStackTrace(); -+ } - - ctx.close(); - } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-Always-release-packet.patch b/Waterfall-Proxy-Patches/0026-Always-release-packet.patch index 6b69e569..328dc76b 100644 --- a/Waterfall-Proxy-Patches/0026-Always-release-packet.patch +++ b/Waterfall-Proxy-Patches/0026-Always-release-packet.patch @@ -1,14 +1,14 @@ -From e1e3b84d99787375e4985810ef55911b8540e738 Mon Sep 17 00:00:00 2001 +From 863b4ad3004b71c19707a0921dcaf2695b1e3247 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packet diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 62895541..7316dc7a 100644 +index e5602230..085cda11 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -110,12 +110,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -113,12 +113,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter return; } @@ -27,7 +27,7 @@ index 62895541..7316dc7a 100644 if ( sendPacket && packet.packet != null ) { try -@@ -130,10 +132,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -133,10 +135,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { handler.handle( packet ); } @@ -42,5 +42,5 @@ index 62895541..7316dc7a 100644 } -- -2.31.1.windows.1 +2.32.0.windows.1 From 33e04ce035f254e3de32acc676203727d8bab6f4 Mon Sep 17 00:00:00 2001 From: guacaplushy Date: Mon, 19 Jul 2021 20:42:27 -0400 Subject: [PATCH 143/499] Updated Upstream (Waterfall) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: 7e6af4c Strip hostname from InetSocketAddress (#679) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 91375602..7e6af4ce 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 913756028a76c9867076010d54dbcf20282808ed +Subproject commit 7e6af4cef64d5d377a6ffd00a534379e6efa94cf From be63b6d4e9d5ef2a527448a95354e8f42e7de249 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 2 Aug 2021 21:41:59 -0300 Subject: [PATCH 144/499] Added scoreboard bossbar toggle option --- ...0029-Added-scoreboard-bossbar-toggle.patch | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch diff --git a/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch b/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch new file mode 100644 index 00000000..5cb03e36 --- /dev/null +++ b/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch @@ -0,0 +1,80 @@ +From 73b68bd089ab2780acec9d8bb1f3b320ce64846c Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Mon, 2 Aug 2021 21:32:30 -0300 +Subject: [PATCH] Added scoreboard bossbar toggle + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index aafd99d8..423688c0 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -31,6 +31,11 @@ public class FlameCordConfiguration { + @Getter + private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); + ++ @Getter ++ private boolean proxyScoreboard = false; ++ @Getter ++ private boolean proxyBossBar = false; ++ + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { + final String fileName = "./flamecord.yml"; +@@ -54,6 +59,9 @@ public class FlameCordConfiguration { + this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); + this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); + ++ this.proxyScoreboard = setIfUnexistant("proxy-scoreboard", this.proxyScoreboard, configuration); ++ this.proxyBossBar = setIfUnexistant("proxy-bossbar", this.proxyBossBar, configuration); ++ + if (!configurationExists) { + configurationProvider.save(configuration, configurationFile); + } +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 +index e95431a0..a843d69a 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -2,6 +2,8 @@ package net.md_5.bungee.protocol; + + import com.google.common.base.Preconditions; + import com.google.common.collect.Iterables; ++ ++import dev._2lstudios.flamecord.FlameCord; + import gnu.trove.map.TIntObjectMap; + import gnu.trove.map.TObjectIntMap; + import gnu.trove.map.hash.TIntObjectHashMap; +@@ -114,6 +116,7 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_16_2, 0x39 ), + map( ProtocolConstants.MINECRAFT_1_17, 0x3D ) + ); ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyBossBar()) + TO_CLIENT.registerPacket( + BossBar.class, + BossBar::new, +@@ -160,6 +163,7 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_16_2, 0x0F ), + map( ProtocolConstants.MINECRAFT_1_17, 0x11 ) + ); ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) + TO_CLIENT.registerPacket( + ScoreboardObjective.class, + ScoreboardObjective::new, +@@ -172,6 +176,7 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_15, 0x4A ), + map( ProtocolConstants.MINECRAFT_1_17, 0x53 ) + ); ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) + TO_CLIENT.registerPacket( + ScoreboardScore.class, + ScoreboardScore::new, +@@ -184,6 +189,7 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_15, 0x4D ), + map( ProtocolConstants.MINECRAFT_1_17, 0x56 ) + ); ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) + TO_CLIENT.registerPacket( + ScoreboardDisplay.class, + ScoreboardDisplay::new, +-- +2.32.0.windows.1 + From dbbc77e69feecac601875f6478cc979538a852b6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 2 Aug 2021 21:42:22 -0300 Subject: [PATCH 145/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 91375602..7e6af4ce 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 913756028a76c9867076010d54dbcf20282808ed +Subproject commit 7e6af4cef64d5d377a6ffd00a534379e6efa94cf From 4656e8f2ab7fedb57c89c83a3d79dfbe7a20e6fb Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 2 Aug 2021 22:01:58 -0300 Subject: [PATCH 146/499] version 0.6.2 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 4fd27dd0..37040d43 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.1"; ++ return "0.6.2"; } public void reloadMessages() From 8cfe152791e9e66943eb00fb8f71bb9b06032783 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:11:02 -0300 Subject: [PATCH 147/499] Fixed Scoreboard/BossBar toggle issues --- ...0029-Added-scoreboard-bossbar-toggle.patch | 96 ++++++++++++------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch b/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch index 5cb03e36..f056f4c7 100644 --- a/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch +++ b/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch @@ -1,4 +1,4 @@ -From 73b68bd089ab2780acec9d8bb1f3b320ce64846c Mon Sep 17 00:00:00 2001 +From a24de40ec3b2d81f2825843d88694e3891bd1010 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 2 Aug 2021 21:32:30 -0300 Subject: [PATCH] Added scoreboard bossbar toggle @@ -31,50 +31,74 @@ index aafd99d8..423688c0 100644 configurationProvider.save(configuration, configurationFile); } 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 -index e95431a0..a843d69a 100644 +index e95431a0..309c18d3 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -2,6 +2,8 @@ package net.md_5.bungee.protocol; +@@ -2,6 +2,7 @@ package net.md_5.bungee.protocol; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; + -+import dev._2lstudios.flamecord.FlameCord; import gnu.trove.map.TIntObjectMap; import gnu.trove.map.TObjectIntMap; import gnu.trove.map.hash.TIntObjectHashMap; -@@ -114,6 +116,7 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_16_2, 0x39 ), - map( ProtocolConstants.MINECRAFT_1_17, 0x3D ) - ); -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyBossBar()) - TO_CLIENT.registerPacket( - BossBar.class, - BossBar::new, -@@ -160,6 +163,7 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_16_2, 0x0F ), - map( ProtocolConstants.MINECRAFT_1_17, 0x11 ) - ); -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) - TO_CLIENT.registerPacket( - ScoreboardObjective.class, - ScoreboardObjective::new, -@@ -172,6 +176,7 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_15, 0x4A ), - map( ProtocolConstants.MINECRAFT_1_17, 0x53 ) - ); -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) - TO_CLIENT.registerPacket( - ScoreboardScore.class, - ScoreboardScore::new, -@@ -184,6 +189,7 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_15, 0x4D ), - map( ProtocolConstants.MINECRAFT_1_17, 0x56 ) - ); -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) - TO_CLIENT.registerPacket( - ScoreboardDisplay.class, - ScoreboardDisplay::new, +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 +index 40c016d6..9becb0ae 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -13,6 +13,7 @@ import com.mojang.brigadier.suggestion.Suggestion; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.tree.LiteralCommandNode; + ++import dev._2lstudios.flamecord.FlameCord; + import io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent; // Waterfall + import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufAllocator; +@@ -175,6 +176,8 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(ScoreboardObjective objective) throws Exception + { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) ++ return; + Scoreboard serverScoreboard = con.getServerSentScoreboard(); + switch ( objective.getAction() ) + { +@@ -200,6 +203,8 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(ScoreboardScore score) throws Exception + { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) ++ return; + Scoreboard serverScoreboard = con.getServerSentScoreboard(); + switch ( score.getAction() ) + { +@@ -219,6 +224,8 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(ScoreboardDisplay displayScoreboard) throws Exception + { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) ++ return; + Scoreboard serverScoreboard = con.getServerSentScoreboard(); + serverScoreboard.setName( displayScoreboard.getName() ); + serverScoreboard.setPosition( Position.values()[displayScoreboard.getPosition()] ); +@@ -227,6 +234,8 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(net.md_5.bungee.protocol.packet.Team team) throws Exception + { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) ++ return; + Scoreboard serverScoreboard = con.getServerSentScoreboard(); + // Remove team and move on + if ( team.getMode() == 1 ) +@@ -646,6 +655,8 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(BossBar bossBar) + { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyBossBar()) ++ return; + switch ( bossBar.getAction() ) + { + // Handle add bossbar -- 2.32.0.windows.1 From 4a4735b80d84f1357b4ea18099b197a701a09aad Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:14:41 -0300 Subject: [PATCH 148/499] Revert scoreboard/bossbar toggle --- ...0029-Added-scoreboard-bossbar-toggle.patch | 104 ------------------ 1 file changed, 104 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch diff --git a/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch b/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch deleted file mode 100644 index f056f4c7..00000000 --- a/Waterfall-Proxy-Patches/0029-Added-scoreboard-bossbar-toggle.patch +++ /dev/null @@ -1,104 +0,0 @@ -From a24de40ec3b2d81f2825843d88694e3891bd1010 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Mon, 2 Aug 2021 21:32:30 -0300 -Subject: [PATCH] Added scoreboard bossbar toggle - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aafd99d8..423688c0 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -31,6 +31,11 @@ public class FlameCordConfiguration { - @Getter - private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); - -+ @Getter -+ private boolean proxyScoreboard = false; -+ @Getter -+ private boolean proxyBossBar = false; -+ - public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { - try { - final String fileName = "./flamecord.yml"; -@@ -54,6 +59,9 @@ public class FlameCordConfiguration { - this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); - this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); - -+ this.proxyScoreboard = setIfUnexistant("proxy-scoreboard", this.proxyScoreboard, configuration); -+ this.proxyBossBar = setIfUnexistant("proxy-bossbar", this.proxyBossBar, configuration); -+ - if (!configurationExists) { - configurationProvider.save(configuration, configurationFile); - } -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 -index e95431a0..309c18d3 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -2,6 +2,7 @@ package net.md_5.bungee.protocol; - - import com.google.common.base.Preconditions; - import com.google.common.collect.Iterables; -+ - import gnu.trove.map.TIntObjectMap; - import gnu.trove.map.TObjectIntMap; - import gnu.trove.map.hash.TIntObjectHashMap; -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 -index 40c016d6..9becb0ae 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -13,6 +13,7 @@ import com.mojang.brigadier.suggestion.Suggestion; - import com.mojang.brigadier.suggestion.Suggestions; - import com.mojang.brigadier.tree.LiteralCommandNode; - -+import dev._2lstudios.flamecord.FlameCord; - import io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent; // Waterfall - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufAllocator; -@@ -175,6 +176,8 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(ScoreboardObjective objective) throws Exception - { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) -+ return; - Scoreboard serverScoreboard = con.getServerSentScoreboard(); - switch ( objective.getAction() ) - { -@@ -200,6 +203,8 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(ScoreboardScore score) throws Exception - { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) -+ return; - Scoreboard serverScoreboard = con.getServerSentScoreboard(); - switch ( score.getAction() ) - { -@@ -219,6 +224,8 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(ScoreboardDisplay displayScoreboard) throws Exception - { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) -+ return; - Scoreboard serverScoreboard = con.getServerSentScoreboard(); - serverScoreboard.setName( displayScoreboard.getName() ); - serverScoreboard.setPosition( Position.values()[displayScoreboard.getPosition()] ); -@@ -227,6 +234,8 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(net.md_5.bungee.protocol.packet.Team team) throws Exception - { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyScoreboard()) -+ return; - Scoreboard serverScoreboard = con.getServerSentScoreboard(); - // Remove team and move on - if ( team.getMode() == 1 ) -@@ -646,6 +655,8 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(BossBar bossBar) - { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isProxyBossBar()) -+ return; - switch ( bossBar.getAction() ) - { - // Handle add bossbar --- -2.32.0.windows.1 - From 38eebadbc1d6df68dc09dcf8195d26838e65b525 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:15:23 -0300 Subject: [PATCH 149/499] version 0.6.1 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 37040d43..4fd27dd0 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.2"; ++ return "0.6.1"; } public void reloadMessages() From eb1cd295d6564182c724462c15241f2b35599458 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 24 Aug 2021 17:50:16 +0200 Subject: [PATCH 150/499] Added missing messages, removed unnecessary ones --- .../0021-FlameCord-message-configuration.patch | 14 ++++++++------ Waterfall-Proxy-Patches/0024-Firewall-System.patch | 14 +++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch index 8f680407..a4f4e2bd 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 8d486c50cd28b8e5714285f643ea3dc75adeb34c Mon Sep 17 00:00:00 2001 +From 243a50f0f4ccc0bfc197f17ade84f89557d82f35 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -35,10 +35,10 @@ index 2e317533..8957c79a 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..ebfaa761 +index 00000000..028b6d4c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,121 @@ +@@ -0,0 +1,123 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -83,6 +83,8 @@ index 00000000..ebfaa761 + "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); + setIfUnexistant("fallback_lobby", + "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("timeout", ++ "Server not reachable (timeout). Offline? Incorrectly configured address/port/firewall?", configuration); + setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); + setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", + configuration); @@ -100,7 +102,6 @@ index 00000000..ebfaa761 + "&cThe server you were previously on went down, you have been connected to a fallback server", + configuration); + setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_too_long", "Cannot have username longer than 16 characters", configuration); + setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); + setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); + setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); @@ -121,6 +122,7 @@ index 00000000..ebfaa761 + setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); + setIfUnexistant("command_perms_permission", "&9- {0}", configuration); + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); @@ -209,7 +211,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b1ac28a5..d2c9a5be 100644 +index c08d9c50..7e40f20a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -588,14 +588,8 @@ public class BungeeCord extends ProxyServer @@ -230,5 +232,5 @@ index b1ac28a5..d2c9a5be 100644 @Override -- -2.31.1.windows.1 +2.32.0.windows.2 diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch index d1868bcd..3c327cb1 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From 160af8c9a43c4a028b766ebf26ef530b51fa5e57 Mon Sep 17 00:00:00 2001 +From 9f455bc55f7af057192e8075a9f295adad8de734 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -96,11 +96,11 @@ index 81ded224..8bb61ac1 100644 configurationProvider.save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ebfaa761..c88077ad 100644 +index 028b6d4c..56044631 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -82,9 +82,17 @@ public class MessagesConfiguration { - setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); +@@ -84,9 +84,17 @@ public class MessagesConfiguration { + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); // FlameCord + setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); @@ -317,7 +317,7 @@ index ccab6800..d57a0516 100644 } } 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 a1ec1bff..3c8bd33b 100644 +index e88ec72a..83d074be 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 @@ -152,6 +152,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -363,7 +363,7 @@ index 264c22e8..2101cbc4 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 4c53e02c..376daee9 100644 +index 28543346..8d6f9d3a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -426,5 +426,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.31.1.windows.1 +2.32.0.windows.2 From 4922558ba14d86b03b19050751d3952de860fd4c Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:49:08 -0300 Subject: [PATCH 151/499] Update 0004-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 4fd27dd0..37040d43 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.1"; ++ return "0.6.2"; } public void reloadMessages() From 9576a95525e86a5f1bd007889f868a214c5665b0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 24 Aug 2021 19:37:18 -0300 Subject: [PATCH 152/499] fix reconnect module --- .../0020-FlameCord-module-system.patch | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch index 1728af7d..7b00c08f 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 67799e8a980a77546059d9c362d9845fce792f22 Mon Sep 17 00:00:00 2001 +From 0cdc879be6e32c45bdb2e3214a003f24808c2702 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a788559e..7681240b 100644 +index 90812759..6efe18c2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; @@ -158,21 +158,21 @@ index a788559e..7681240b 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -296,6 +298,7 @@ public class BungeeCord extends ProxyServer +@@ -313,6 +315,7 @@ public class BungeeCord extends ProxyServer + connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); } - - FlameCord.renew(logger, whitelistedAddresses); -+ registerModules(); + startListeners(); ++ loadModules(); - if ( config.isForgeSupport() ) + saveThread.scheduleAtFixedRate( new TimerTask() { -@@ -830,4 +833,56 @@ public class BungeeCord extends ProxyServer +@@ -830,4 +833,52 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } + + // FlameCord - Method to simplify module registering -+ public void registerModules() { ++ public void loadModules() { + final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); + + // Bungeecord Commands @@ -206,17 +206,13 @@ index a788559e..7681240b 100644 + pluginManager.registerCommand(null, new CommandServer()); + } + -+ try { -+ if (modulesConfiguration.reconnectEnabled) { -+ for (ListenerInfo info : getConfig().getListeners()) { -+ if (!info.isForceDefault() && getReconnectHandler() == null) { -+ setReconnectHandler(new YamlReconnectHandler()); -+ break; -+ } ++ if (modulesConfiguration.reconnectEnabled) { ++ for (ListenerInfo info : getConfig().getListeners()) { ++ if (!info.isForceDefault() && getReconnectHandler() == null) { ++ setReconnectHandler(new YamlReconnectHandler()); ++ break; + } + } -+ } catch (final Exception exception) { -+ logger.warning("Reconnect module is not able to work on FlameCord!"); + } + + // Flamecord - Commands (Had to make it like this because of maven limitations) From deab79ad06a3c0bd71698a815b3f94e05f70cf3b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 24 Aug 2021 19:37:34 -0300 Subject: [PATCH 153/499] version 0.6.3 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 37040d43..418d0d4b 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.2"; ++ return "0.6.3"; } public void reloadMessages() From 0baddde320e1c6a943c6a9bcd9dbdbd375160ba5 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Mon, 30 Aug 2021 20:16:05 +0200 Subject: [PATCH 154/499] Fix Firewall-Names --- .../0024-Firewall-System.patch | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch index 3c327cb1..6fd41480 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From 9f455bc55f7af057192e8075a9f295adad8de734 Mon Sep 17 00:00:00 2001 +From 7a80f39c65fcf3ef6569fbb5ee96715708875ca7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -317,7 +317,7 @@ index ccab6800..d57a0516 100644 } } 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 e88ec72a..83d074be 100644 +index e88ec72a..a720a0c3 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 @@ -152,6 +152,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -340,6 +340,22 @@ index e88ec72a..83d074be 100644 throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); } } +@@ -392,6 +398,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection + // FlameCord - Use name + final String name = getName(); + ++ // FlameCord start - Firewall and close if username is blocked ++ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( name ) ) ++ { ++ FlameCord.getInstance().getFirewallManager().addFirewalled( ch.getRemoteAddress() ); ++ ch.close(); ++ return; ++ } ++ // FlameCord end ++ + if ( name.contains( " " ) || name.contains( "." ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java index 264c22e8..2101cbc4 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -426,5 +442,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.32.0.windows.2 +2.33.0.windows.2 From cd5ef657f9605b80dcee06591d4109a3ebddee1a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:22:58 -0300 Subject: [PATCH 155/499] updated upstream --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 7e6af4ce..9d1a910f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 7e6af4cef64d5d377a6ffd00a534379e6efa94cf +Subproject commit 9d1a910f972e278a1396f0a1a0c505485ec6f5f7 From 5c7b3a9176b80d8e88b38cd1468706c7a488fb2b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:39:13 -0300 Subject: [PATCH 156/499] updated patches --- ...ake-PlayerHandshakeEvent-cancellable.patch | 8 ++--- ...ections-Don-t-flush-if-not-necessary.patch | 10 +++---- ...o-encrypt-only-if-onlineMode-is-true.patch | 15 ++++------ ...0013-Don-t-allow-name-containing-dot.patch | 30 +++++++++---------- ...tom-uuids-even-if-onlineMode-is-true.patch | 6 ++-- ...y-to-avoid-multiple-incoming-packets.patch | 13 ++------ .../0019-FlameCord-General-Patch.patch | 10 +++---- .../0024-Firewall-System.patch | 28 ++++++++--------- .../0025-FlameCord-logger-options.patch | 8 ++--- 9 files changed, 56 insertions(+), 72 deletions(-) diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 8bb4d8d1..ba6c2fbd 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From 42608d211e93b47f5a72640f63178c815b429ab6 Mon Sep 17 00:00:00 2001 +From bbdbe9a57a15f0d72cfca33949147e0256044299 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 b7ecd828..49ba34db 100644 +index 0fd58e83..2af68601 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 -@@ -320,7 +320,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -321,7 +321,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index b7ecd828..49ba34db 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 68b05ea7..deadca6b 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From cf8b96298bc7e02d04b30aa1dca04968bda068d8 Mon Sep 17 00:00:00 2001 +From 377cba38cd24e2e64a89104547befaf18cdbbd8b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 0647a774..37784acd 100644 +index 2af68601..3b1f3d99 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 -@@ -192,6 +192,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -193,6 +193,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index 0647a774..37784acd 100644 String kickMessage; if ( v1_5 ) -@@ -257,6 +264,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -258,6 +265,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -38,7 +38,7 @@ index 0647a774..37784acd 100644 Gson gson = BungeeCord.getInstance().gson; unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); if ( bungee.getConnectionThrottle() != null ) -@@ -286,11 +302,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -287,11 +303,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { diff --git a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index ff7fffb5..f9ee943d 100644 --- a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,27 +1,22 @@ -From bb419bd35b5e513be0ca20cda4c97bcaa23f0cd7 Mon Sep 17 00:00:00 2001 +From d0df3e9283244e4124ea3abb0c210743e9a5b39f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 37784acd..1811084a 100644 +index 3b1f3d99..503ee86a 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 -@@ -426,11 +426,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection - if ( onlineMode ) +@@ -428,6 +428,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { + thisState = State.ENCRYPT; unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); + // FlameCord - Change state to encrypt only if onlineMode is true + thisState = State.ENCRYPT; } else { - finish(); - } -- thisState = State.ENCRYPT; - } - }; - + thisState = State.FINISHING; -- 2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index db2973f6..109b2f24 100644 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,25 +1,23 @@ -From 9754f77c4142bebe9425d493b6826503dd9060f9 Mon Sep 17 00:00:00 2001 +From 17b968a7aa4e4afec3eff6e09f150ede548aff6a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot -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 1811084a..1925188f 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 -@@ -387,7 +387,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); - this.loginRequest = loginRequest; - -- if ( getName().contains( " " ) ) -+ // FlameCord - Use name -+ final String name = getName(); -+ -+ if ( name.contains( " " ) || name.contains( "." ) ) +diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +index d1cd1090..44cb1ce6 100644 +--- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java ++++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +@@ -21,7 +21,8 @@ public final class AllowedCharacters + } else { - disconnect( bungee.getTranslation( "name_invalid" ) ); - return; + // Don't allow spaces, Yaml config doesn't support them +- return isChatAllowedCharacter( c ) && c != ' '; ++ // FlameCord - Don't allow dots ++ return isChatAllowedCharacter( c ) && c != ' ' && c != '.'; + } + } + -- 2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 1bcaef3d..041c237a 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From ac987c138b977c2029dc845bbec5f9a1b70dd746 Mon Sep 17 00:00:00 2001 +From 7dec0219892d80bac509c0c6a919b8bbbe691ef6 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 1925188f..554526a3 100644 +index 503ee86a..5927d57d 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 -@@ -680,7 +680,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -678,7 +678,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch index 19c7103a..8a9f0e18 100644 --- a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,11 +1,11 @@ -From f8d0abde43d1fa6abc45631b372e5a71d1af2f48 Mon Sep 17 00:00:00 2001 +From 2bf254d23544622bf9a32880bace6d821e42477f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 554526a3..e643d8a7 100644 +index 5927d57d..4316da26 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 @@ -447,6 +447,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -27,15 +27,6 @@ index 554526a3..e643d8a7 100644 if ( isOnlineMode() ) { // Check for multiple connections -@@ -587,8 +592,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - - userCon.connect( server, null, true, ServerConnectEvent.Reason.JOIN_PROXY ); -- -- thisState = State.FINISHED; - } - } - } ); -- 2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index d8e6e9b5..299a10c9 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 1f6d89b080f89d2a235554957815deb3047dab05 Mon Sep 17 00:00:00 2001 +From c0015af5ddf9eb2e081949e90a908ba36acf27ba Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 778fe4a1..9c45f305 100644 +index 136da2a8..4991c0a1 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; @@ -319,7 +319,7 @@ index db79b58a..a847c049 100644 b.connect().addListener( listener ); } 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 dc5b64b7..e88ec72a 100644 +index 98b46cc2..d5e4dcb6 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 @@ -14,6 +14,8 @@ import java.util.logging.Level; @@ -331,7 +331,7 @@ index dc5b64b7..e88ec72a 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -150,7 +152,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -151,7 +153,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -353,7 +353,7 @@ index 6df3f3dd..264c22e8 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 3bbc1510..4c53e02c 100644 +index c0e4791f..28543346 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch index 6fd41480..833afc08 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From 7a80f39c65fcf3ef6569fbb5ee96715708875ca7 Mon Sep 17 00:00:00 2001 +From 26fb15428c81e5532a5b61b15f2ddf6b0a690539 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -317,10 +317,10 @@ index ccab6800..d57a0516 100644 } } 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 e88ec72a..a720a0c3 100644 +index d5e4dcb6..7bdddfa5 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 -@@ -152,6 +152,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -153,6 +153,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -330,7 +330,7 @@ index e88ec72a..a720a0c3 100644 throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } -@@ -379,6 +382,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -380,6 +383,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } break; default: @@ -340,22 +340,22 @@ index e88ec72a..a720a0c3 100644 throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); } } -@@ -392,6 +398,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection - // FlameCord - Use name - final String name = getName(); - -+ // FlameCord start - Firewall and close if username is blocked +@@ -394,6 +400,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; + } ++ ++ // FlameCord - Firewall and close if username is blocked + if ( FlameCord.getInstance().getFirewallManager().isFirewalled( name ) ) + { + FlameCord.getInstance().getFirewallManager().addFirewalled( ch.getRemoteAddress() ); + ch.close(); + return; + } -+ // FlameCord end + - if ( name.contains( " " ) || name.contains( "." ) ) - { - disconnect( bungee.getTranslation( "name_invalid" ) ); + this.loginRequest = loginRequest; + + int limit = BungeeCord.getInstance().config.getPlayerLimit(); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java index 264c22e8..2101cbc4 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -442,5 +442,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.33.0.windows.2 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch index fe075405..293345c9 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 6eaee9fe8f737a2550080e90c282d77f0e4b49f4 Mon Sep 17 00:00:00 2001 +From ea567bac560207c0a619d621b0ee7dced802e022 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -38,10 +38,10 @@ index 8bb61ac1..aafd99d8 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 83d074be..9805cff1 100644 +index 7bdddfa5..37317a47 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 -@@ -353,7 +353,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -354,7 +354,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index 83d074be..9805cff1 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -362,7 +363,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -363,7 +364,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login From d882af647d3e89029752c94c90f6e60c9472a785 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 22:27:34 -0300 Subject: [PATCH 157/499] updated source --- .../0005-1.7.x-support.patch | 1514 +++++++++++++++++ ...ke-PlayerHandshakeEvent-cancellable.patch} | 8 +- ...0007-Make-a-getter-for-the-callback.patch} | 6 +- ...able-update-checker-Use-bungee-name.patch} | 6 +- ...> 0009-Change-replaceAll-to-replace.patch} | 8 +- ...ctions-Don-t-flush-if-not-necessary.patch} | 30 +- ...-Checks.patch => 0011-Packet-Checks.patch} | 8 +- ...ch => 0012-Default-timeout-to-10000.patch} | 6 +- ...-encrypt-only-if-onlineMode-is-true.patch} | 6 +- ...014-Don-t-allow-name-containing-dot.patch} | 4 +- ...5-Use-pipeline-to-reduce-redundancy.patch} | 6 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 6 +- ...-to-avoid-multiple-incoming-packets.patch} | 12 +- ...teException-to-QuietException-and-e.patch} | 6 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 6 +- ...tch => 0020-FlameCord-General-Patch.patch} | 38 +- ...tch => 0021-FlameCord-module-system.patch} | 14 +- .../0022-Fix-ByteBuf-memory-leaks.patch | 127 -- ...022-FlameCord-message-configuration.patch} | 14 +- .../0023-Fix-ByteBuf-memory-leaks.patch | 68 + ...> 0024-Check-if-packetID-is-invalid.patch} | 6 +- ...ystem.patch => 0025-Firewall-System.patch} | 38 +- ...ch => 0026-FlameCord-logger-options.patch} | 12 +- ...patch => 0027-Always-release-packet.patch} | 4 +- ...ded-an-api-method-to-unload-Plugins.patch} | 6 +- ...s.patch => 0029-Apply-packet-limits.patch} | 4 +- 26 files changed, 1710 insertions(+), 253 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0005-1.7.x-support.patch rename Waterfall-Proxy-Patches/{0005-Make-PlayerHandshakeEvent-cancellable.patch => 0006-Make-PlayerHandshakeEvent-cancellable.patch} (91%) rename Waterfall-Proxy-Patches/{0006-Make-a-getter-for-the-callback.patch => 0007-Make-a-getter-for-the-callback.patch} (87%) rename Waterfall-Proxy-Patches/{0007-Disable-update-checker-Use-bungee-name.patch => 0008-Disable-update-checker-Use-bungee-name.patch} (96%) rename Waterfall-Proxy-Patches/{0008-Change-replaceAll-to-replace.patch => 0009-Change-replaceAll-to-replace.patch} (86%) rename Waterfall-Proxy-Patches/{0009-Close-connections-Don-t-flush-if-not-necessary.patch => 0010-Close-connections-Don-t-flush-if-not-necessary.patch} (87%) rename Waterfall-Proxy-Patches/{0010-Packet-Checks.patch => 0011-Packet-Checks.patch} (93%) rename Waterfall-Proxy-Patches/{0011-Default-timeout-to-10000.patch => 0012-Default-timeout-to-10000.patch} (86%) rename Waterfall-Proxy-Patches/{0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch => 0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch} (84%) rename Waterfall-Proxy-Patches/{0013-Don-t-allow-name-containing-dot.patch => 0014-Don-t-allow-name-containing-dot.patch} (89%) rename Waterfall-Proxy-Patches/{0014-Use-pipeline-to-reduce-redundancy.patch => 0015-Use-pipeline-to-reduce-redundancy.patch} (96%) rename Waterfall-Proxy-Patches/{0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (84%) rename Waterfall-Proxy-Patches/{0016-Finish-early-to-avoid-multiple-incoming-packets.patch => 0017-Finish-early-to-avoid-multiple-incoming-packets.patch} (78%) rename Waterfall-Proxy-Patches/{0017-Change-IllegalStateException-to-QuietException-and-e.patch => 0018-Change-IllegalStateException-to-QuietException-and-e.patch} (85%) rename Waterfall-Proxy-Patches/{0018-Don-t-declare-uuid-unless-it-s-null.patch => 0019-Don-t-declare-uuid-unless-it-s-null.patch} (86%) rename Waterfall-Proxy-Patches/{0019-FlameCord-General-Patch.patch => 0020-FlameCord-General-Patch.patch} (94%) rename Waterfall-Proxy-Patches/{0020-FlameCord-module-system.patch => 0021-FlameCord-module-system.patch} (96%) delete mode 100644 Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch rename Waterfall-Proxy-Patches/{0021-FlameCord-message-configuration.patch => 0022-FlameCord-message-configuration.patch} (97%) create mode 100644 Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch rename Waterfall-Proxy-Patches/{0023-Check-if-packetID-is-invalid.patch => 0024-Check-if-packetID-is-invalid.patch} (91%) rename Waterfall-Proxy-Patches/{0024-Firewall-System.patch => 0025-Firewall-System.patch} (96%) rename Waterfall-Proxy-Patches/{0025-FlameCord-logger-options.patch => 0026-FlameCord-logger-options.patch} (95%) rename Waterfall-Proxy-Patches/{0026-Always-release-packet.patch => 0027-Always-release-packet.patch} (93%) rename Waterfall-Proxy-Patches/{0027-Added-an-api-method-to-unload-Plugins.patch => 0028-Added-an-api-method-to-unload-Plugins.patch} (96%) rename Waterfall-Proxy-Patches/{0028-Apply-packet-limits.patch => 0029-Apply-packet-limits.patch} (92%) diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch new file mode 100644 index 00000000..3e2d7ec6 --- /dev/null +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -0,0 +1,1514 @@ +From a421ce9004de456cfd72b8e3f40578056889de24 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 30 Sep 2021 19:54:33 -0300 +Subject: [PATCH] 1.7.x support + + +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 +index a310844dc..d07b88b85 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +@@ -303,4 +303,36 @@ public abstract class DefinedPacket + return 0; + } + // Waterfall end ++ ++ // FlameCord start - 1.7.x support ++ public static byte[] v17readArray(ByteBuf buf) ++ { ++ // Read in a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) ++ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. ++ int len = readVarShort( buf ); ++ ++ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit ++ Preconditions.checkArgument( len <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot receive array longer than 2097050 (got %s bytes)", len ); ++ ++ byte[] ret = new byte[ len ]; ++ buf.readBytes( ret ); ++ return ret; ++ } ++ ++ public static void v17writeArray(byte[] b, ByteBuf buf, boolean allowExtended) ++ { ++ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit ++ if ( allowExtended ) ++ { ++ Preconditions.checkArgument( b.length <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot send array longer than 2097050 (got %s bytes)", b.length ); ++ } else ++ { ++ Preconditions.checkArgument( b.length <= Short.MAX_VALUE, "Cannot send array longer than Short.MAX_VALUE (got %s bytes)", b.length ); ++ } ++ // Write a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) ++ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. ++ writeVarShort( buf, b.length ); ++ buf.writeBytes( b ); ++ } ++ // FlameCord end - 1.7.x support + } +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 +index e95431a0f..ec6181ee7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -58,7 +58,7 @@ public enum Protocol + TO_SERVER.registerPacket( + Handshake.class, + Handshake::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + } + }, +@@ -70,7 +70,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + KeepAlive.class, + KeepAlive::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), + map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), + map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), +@@ -82,7 +82,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Login.class, + Login::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), + map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), +@@ -93,7 +93,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Chat.class, + Chat::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), + map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), + map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), +@@ -103,7 +103,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Respawn.class, + Respawn::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x07 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x07 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), +@@ -126,20 +126,20 @@ public enum Protocol + TO_CLIENT.registerPacket( + EntityEffect.class, + EntityEffect::new, +- map(ProtocolConstants.MINECRAFT_1_8, 0x1D), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support + map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + ); + TO_CLIENT.registerPacket( + EntityRemoveEffect.class, + EntityRemoveEffect::new, +- map(ProtocolConstants.MINECRAFT_1_8, 0x1E), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support + map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + ); + // Waterfall end + TO_CLIENT.registerPacket( + PlayerListItem.class, // PlayerInfo + PlayerListItem::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x38 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x38 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), + map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), +@@ -152,7 +152,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + TabCompleteResponse.class, + TabCompleteResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3A ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3A ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), + map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), + map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), +@@ -163,7 +163,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardObjective.class, + ScoreboardObjective::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3B ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3B ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), + map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), +@@ -175,7 +175,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardScore.class, + ScoreboardScore::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3C ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3C ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), +@@ -187,7 +187,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardDisplay.class, + ScoreboardDisplay::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3D ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3D ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), +@@ -199,7 +199,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Team.class, + Team::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3E ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3E ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), +@@ -211,7 +211,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + PluginMessage.class, + PluginMessage::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3F ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3F ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), + map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), +@@ -223,7 +223,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Kick.class, + Kick::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x40 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x40 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), + map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), + map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), +@@ -235,7 +235,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Title.class, + Title::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x45 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x45 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), +@@ -262,7 +262,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + PlayerListHeaderFooter.class, + PlayerListHeaderFooter::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x47 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x47 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), + map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), +@@ -276,7 +276,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + EntityStatus.class, + EntityStatus::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x1A ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1A ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), + map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), + map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), +@@ -314,7 +314,7 @@ public enum Protocol + TO_SERVER.registerPacket( + KeepAlive.class, + KeepAlive::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), + map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), +@@ -326,7 +326,7 @@ public enum Protocol + TO_SERVER.registerPacket( + Chat.class, + Chat::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), +@@ -335,7 +335,7 @@ public enum Protocol + TO_SERVER.registerPacket( + TabCompleteRequest.class, + TabCompleteRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x14 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x14 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), +@@ -345,7 +345,7 @@ public enum Protocol + TO_SERVER.registerPacket( + ClientSettings.class, + ClientSettings::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x15 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x15 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), +@@ -354,7 +354,7 @@ public enum Protocol + TO_SERVER.registerPacket( + PluginMessage.class, + PluginMessage::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x17 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x17 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), +@@ -372,23 +372,23 @@ public enum Protocol + TO_CLIENT.registerPacket( + StatusResponse.class, + StatusResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + PingPacket.class, + PingPacket::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + + TO_SERVER.registerPacket( + StatusRequest.class, + StatusRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + PingPacket.class, + PingPacket::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + } + }, +@@ -400,22 +400,22 @@ public enum Protocol + TO_CLIENT.registerPacket( + Kick.class, + Kick::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + EncryptionRequest.class, + EncryptionRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + LoginSuccess.class, + LoginSuccess::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + SetCompression.class, + SetCompression::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x03 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x03 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + LoginPayloadRequest.class, +@@ -426,12 +426,12 @@ public enum Protocol + TO_SERVER.registerPacket( + LoginRequest.class, + LoginRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + EncryptionResponse.class, + EncryptionResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + LoginPayloadResponse.class, +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 +index caf7ed0b6..787b93740 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +@@ -7,6 +7,10 @@ public class ProtocolConstants + { + + private static final boolean SNAPSHOT_SUPPORT = Boolean.getBoolean( "net.md_5.bungee.protocol.snapshot" ); ++ // FlameCord start - 1.7.x support ++ public static final int MINECRAFT_1_7_2 = 4; ++ public static final int MINECRAFT_1_7_6 = 5; ++ // FlameCord end - 1.7.x support + public static final int MINECRAFT_1_8 = 47; + public static final int MINECRAFT_1_9 = 107; + public static final int MINECRAFT_1_9_1 = 108; +@@ -42,6 +46,7 @@ public class ProtocolConstants + static + { + ImmutableList.Builder supportedVersions = ImmutableList.builder().add( ++ "1.7.x", // FlameCord - 1.7.x support + "1.8.x", + "1.9.x", + "1.10.x", +@@ -54,6 +59,10 @@ public class ProtocolConstants + "1.17.x" + ); + ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( ++ // FlameCord start - 1.7.x support ++ ProtocolConstants.MINECRAFT_1_7_2, ++ ProtocolConstants.MINECRAFT_1_7_6, ++ // FlameCord end - 1.7.x support + ProtocolConstants.MINECRAFT_1_8, + ProtocolConstants.MINECRAFT_1_9, + ProtocolConstants.MINECRAFT_1_9_1, +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +index 29440533f..22b7d4632 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +@@ -28,6 +28,18 @@ public class ClientSettings extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ locale = readString( buf ); ++ viewDistance = buf.readByte(); ++ chatFlags = buf.readUnsignedByte(); ++ chatColours = buf.readBoolean(); ++ skinParts = buf.readByte(); ++ difficulty = buf.readByte(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + locale = readString( buf, 16 ); + viewDistance = buf.readByte(); + chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); +@@ -46,6 +58,18 @@ public class ClientSettings extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( locale, buf ); ++ buf.writeByte( viewDistance ); ++ buf.writeByte( chatFlags ); ++ buf.writeBoolean( chatColours ); ++ buf.writeByte( skinParts ); ++ buf.writeByte( difficulty ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( locale, buf ); + buf.writeByte( viewDistance ); + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +index a29524ca8..ddcc4249e 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +@@ -23,6 +23,15 @@ public class EncryptionRequest extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ serverId = readString( buf ); ++ publicKey = v17readArray( buf ); ++ verifyToken = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + serverId = readString( buf ); + publicKey = readArray( buf ); + verifyToken = readArray( buf ); +@@ -31,6 +40,15 @@ public class EncryptionRequest extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( serverId, buf ); ++ v17writeArray( publicKey, buf, false ); ++ v17writeArray( verifyToken, buf, false ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( serverId, buf ); + writeArray( publicKey, buf ); + writeArray( verifyToken, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +index 53575ce0e..33f5718a4 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +@@ -22,6 +22,14 @@ public class EncryptionResponse extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ sharedSecret = v17readArray( buf ); ++ verifyToken = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + sharedSecret = readArray( buf, 128 ); + verifyToken = readArray( buf, 128 ); + } +@@ -29,6 +37,14 @@ public class EncryptionResponse extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ v17writeArray( sharedSecret, buf, false ); ++ v17writeArray( verifyToken, buf, false ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeArray( sharedSecret, buf ); + writeArray( verifyToken, buf ); + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +index b004bc416..548e592e7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +@@ -21,12 +21,26 @@ public class KeepAlive extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ randomId = buf.readInt(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + randomId = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) ? buf.readLong() : readVarInt( buf ); + } + + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ buf.writeInt((int) randomId); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) + { + buf.writeLong( randomId ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +index 551bd1046..5aeae06c3 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +@@ -23,6 +23,11 @@ public class LoginSuccess extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { ++ uuid = readUndashedUUID( buf ); ++ } else ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) + { + uuid = readUUID( buf ); +@@ -36,6 +41,11 @@ public class LoginSuccess extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { ++ writeUndashedUUID( uuid.toString(), buf ); ++ } else ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) + { + writeUUID( uuid, buf ); +@@ -51,4 +61,14 @@ public class LoginSuccess extends DefinedPacket + { + handler.handle( this ); + } ++ ++ // FlameCord start - 1.7.x support ++ private static UUID readUndashedUUID(ByteBuf buf) { ++ return UUID.fromString( new StringBuilder( readString( buf ) ).insert( 20, '-' ).insert( 16, '-' ).insert( 12, '-' ).insert( 8, '-' ).toString() ); ++ } ++ ++ private static void writeUndashedUUID(String uuid, ByteBuf buf) { ++ writeString( new StringBuilder( 32 ).append( uuid, 0, 8 ).append( uuid, 9, 13 ).append( uuid, 14, 18 ).append( uuid, 19, 23 ).append( uuid, 24, 36 ).toString(), buf ); ++ } ++ // FlameCord end - 1.7.x support + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +index 92bacc7cd..3a46ee103 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +@@ -21,6 +21,17 @@ public class PlayerListItem extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ items = new Item[ 1 ]; ++ Item item = items[ 0 ] = new Item(); ++ item.displayName = item.username = readString( buf ); ++ action = !buf.readBoolean() ? Action.REMOVE_PLAYER : Action.ADD_PLAYER; ++ item.ping = buf.readShort(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + action = Action.values()[DefinedPacket.readVarInt( buf )]; + items = new Item[ DefinedPacket.readVarInt( buf ) ]; + for ( int i = 0; i < items.length; i++ ) +@@ -75,6 +86,16 @@ public class PlayerListItem extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ Item item = items[0]; // Only one at a time ++ writeString( item.displayName, buf ); // TODO: Server unique only! ++ buf.writeBoolean( action != Action.REMOVE_PLAYER ); ++ buf.writeShort( item.ping ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + DefinedPacket.writeVarInt( action.ordinal(), buf ); + DefinedPacket.writeVarInt( items.length, buf ); + for ( Item item : items ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +index c652ffb4f..1638dcf5b 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +@@ -82,6 +82,14 @@ public class PluginMessage extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ tag = readString( buf ); ++ data = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); + int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; + Preconditions.checkArgument( buf.readableBytes() < maxSize ); +@@ -92,6 +100,14 @@ public class PluginMessage extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( tag, buf ); ++ v17writeArray( data, buf, allowExtendedPacket ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); + buf.writeBytes( data ); + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +index 3c7905d54..936fa06cd 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +@@ -28,6 +28,15 @@ public class ScoreboardObjective extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ name = readString( buf ); ++ value = readString( buf ); ++ action = buf.readByte(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + name = readString( buf ); + action = buf.readByte(); + if ( action == 0 || action == 2 ) +@@ -46,6 +55,15 @@ public class ScoreboardObjective extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( name, buf ); ++ writeString( value, buf ); ++ buf.writeByte( action ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( name, buf ); + buf.writeByte( action ); + if ( action == 0 || action == 2 ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +index 0b27fc86b..f3e1ce851 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +@@ -27,6 +27,19 @@ public class ScoreboardScore extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ itemName = readString( buf ); ++ action = buf.readByte(); ++ if ( action != 1 ) ++ { ++ scoreName = readString( buf ); ++ value = buf.readInt(); ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + itemName = readString( buf ); + action = buf.readByte(); + scoreName = readString( buf ); +@@ -39,6 +52,19 @@ public class ScoreboardScore extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( itemName, buf ); ++ buf.writeByte( action ); ++ if ( action != 1 ) ++ { ++ writeString( scoreName, buf ); ++ buf.writeInt( value ); ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( itemName, buf ); + buf.writeByte( action ); + writeString( scoreName, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +index 80e4f85af..6614ffb21 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +@@ -37,6 +37,13 @@ public class TabCompleteRequest extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ cursor = readString( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) + { + transactionId = readVarInt( buf ); +@@ -60,6 +67,13 @@ public class TabCompleteRequest extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( cursor, buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) + { + writeVarInt( transactionId, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +index a5555f6af..1a8cd7da1 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +@@ -44,6 +44,30 @@ public class Team extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ name = readString( buf ); ++ mode = buf.readByte(); ++ if ( mode == 0 || mode == 2 ) ++ { ++ displayName = readString( buf ); ++ prefix = readString( buf ); ++ suffix = readString( buf ); ++ friendlyFire = buf.readByte(); ++ } ++ if ( mode == 0 || mode == 3 || mode == 4 ) ++ { ++ int len = buf.readShort(); ++ players = new String[ len ]; ++ for ( int i = 0; i < len; i++ ) ++ { ++ players[i] = readString( buf ); ++ } ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + name = readString( buf ); + mode = buf.readByte(); + if ( mode == 0 || mode == 2 ) +@@ -81,6 +105,29 @@ public class Team extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ writeString( name, buf ); ++ buf.writeByte( mode ); ++ if ( mode == 0 || mode == 2 ) ++ { ++ writeString( displayName, buf ); ++ writeString( prefix, buf ); ++ writeString( suffix, buf ); ++ buf.writeByte( friendlyFire ); ++ } ++ if ( mode == 0 || mode == 3 || mode == 4 ) ++ { ++ buf.writeShort( players.length ); ++ for ( String player : players ) ++ { ++ writeString( player, buf ); ++ } ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( name, buf ); + buf.writeByte( mode ); + if ( mode == 0 || mode == 2 ) +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 136da2a8e..b3f77bcab 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer + .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) + .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) + .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); ++ // FlameCord start - 1.7.x support ++ public final Gson gsonLegacy = new GsonBuilder() ++ .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) ++ .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) ++ .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) ++ .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer( ProtocolConstants.MINECRAFT_1_7_2 ) ) ++ .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); ++ // FlameCord end - 1.7.x support + @Getter + private ConnectionThrottle connectionThrottle; + private final ModuleManager moduleManager = new ModuleManager(); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +index 1d377a655..0ea5f90b4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +@@ -183,6 +183,7 @@ public class BungeeTitle implements Title + @Override + public Title send(ProxiedPlayer player) + { ++ if ( ProtocolConstants.isBeforeOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return this; // FlameCord - 1.7.x support + sendPacket( player, clear ); + sendPacket( player, reset ); + sendPacket( player, times ); +diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +index 491cf1a16..6cd8ec3b4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java ++++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +@@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; + import java.lang.reflect.Type; + import java.util.UUID; + import net.md_5.bungee.api.ServerPing; ++import net.md_5.bungee.protocol.ProtocolConstants; + + public class PlayerInfoSerializer implements JsonSerializer, JsonDeserializer + { ++ // FlameCord start - 1.7.x support ++ private final int protocol; ++ ++ public PlayerInfoSerializer() ++ { ++ this.protocol = ProtocolConstants.MINECRAFT_1_7_6; ++ } ++ ++ public PlayerInfoSerializer(int protocol) ++ { ++ this.protocol = protocol; ++ } ++ // FlameCord end - 1.7.x support + + @Override + public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException +@@ -20,7 +34,7 @@ public class PlayerInfoSerializer implements JsonSerializer= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); +- brand.release(); ++ // FlameCord start - 1.7.x support ++ String brandString = bungee.getName() + " (" + bungee.getVersion() + ")"; ++ ++ if ( ProtocolConstants.isBeforeOrEq( user.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); ++ } else ++ { ++ ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); ++ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); ++ brand.release(); ++ } + } ++ // FlameCord end - 1.7.x support + + user.setDimension( login.getDimension() ); + } else +@@ -287,7 +298,7 @@ public class ServerConnector extends PacketHandler + if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall + for ( Objective objective : serverScoreboard.getObjectives() ) + { +- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); ++ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // Travertine - 1.7 support + } + for ( Score score : serverScoreboard.getScores() ) + { +@@ -456,7 +467,13 @@ public class ServerConnector extends PacketHandler + if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) + { + this.handshakeHandler.handle( pluginMessage ); +- ++ // FlameCord start - 1.7.x support ++ if ( user.getForgeClientHandler().checkUserOutdated() ) ++ { ++ ch.close(); ++ user.getPendingConnects().remove(target); ++ } ++ // FlameCord end - 1.7.x support + // We send the message as part of the handler, so don't send it here. + throw CancelSendSignal.INSTANCE; + } +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 fc98b4b19..85ae3fc9d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -197,6 +197,7 @@ public final class UserConnection implements ProxiedPlayer + public void setDisplayName(String name) + { + Preconditions.checkNotNull( name, "displayName" ); ++ Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // FlameCord - 1.7.x support + displayName = name; + } + +@@ -512,7 +513,7 @@ public final class UserConnection implements ProxiedPlayer + // transform score components + message = ChatComponentTransformer.getInstance().transform( this, true, message ); + +- if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) ++ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord + { + // Versions older than 1.11 cannot send the Action bar with the new JSON formattings + // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 +@@ -708,6 +709,7 @@ public final class UserConnection implements ProxiedPlayer + @Override + public void setTabHeader(BaseComponent header, BaseComponent footer) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; + footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; + +@@ -720,6 +722,7 @@ public final class UserConnection implements ProxiedPlayer + @Override + public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + header = ChatComponentTransformer.getInstance().transform( this, true, header ); + footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); + +@@ -749,6 +752,7 @@ public final class UserConnection implements ProxiedPlayer + + public void setCompressionThreshold(int compressionThreshold) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) + { + this.compressionThreshold = compressionThreshold; +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 +index 9e180c30c..c00b3dcd8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; + import io.netty.channel.unix.DomainSocketAddress; + import java.io.DataInput; + import java.net.InetSocketAddress; ++import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.HashMap; // Waterfall + import java.util.List; +@@ -179,7 +180,7 @@ public class DownstreamBridge extends PacketHandler + switch ( objective.getAction() ) + { + case 0: +- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType().toString() ) ); ++ serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // FlameCord - 1.7.x support + break; + case 1: + serverScoreboard.removeObjective( objective.getName() ); +@@ -189,7 +190,7 @@ public class DownstreamBridge extends PacketHandler + if ( oldObjective != null ) + { + oldObjective.setValue( objective.getValue() ); +- oldObjective.setType( objective.getType().toString() ); ++ oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // FlameCord - 1.7.x support + } + break; + default: +@@ -286,19 +287,27 @@ public class DownstreamBridge extends PacketHandler + + if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) + { +- ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- String serverBrand = DefinedPacket.readString( brand ); +- brand.release(); +- +- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); +- +- brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall +- pluginMessage.setData( brand ); +- brand.release(); +- // changes in the packet are ignored so we need to send it manually +- con.unsafe().sendPacket( pluginMessage ); +- throw CancelSendSignal.INSTANCE; ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); ++ String serverBrand = DefinedPacket.readString( brand ); ++ brand.release(); ++ ++ Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); ++ ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData( brand ); ++ brand.release(); ++ // changes in the packet are ignored so we need to send it manually ++ con.unsafe().sendPacket( pluginMessage ); ++ throw CancelSendSignal.INSTANCE; ++ } else { ++ String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); ++ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord ++ } ++ // FlameCord end - 1.7.x support + } + + if ( pluginMessage.getTag().equals( "BungeeCord" ) ) +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 0fd58e83a..7a403a1ab 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 +@@ -3,6 +3,9 @@ package net.md_5.bungee.connection; + import com.google.common.base.Charsets; + import com.google.common.base.Preconditions; + import com.google.gson.Gson; ++import com.google.gson.JsonElement; ++import com.google.gson.JsonObject; ++ + import java.math.BigInteger; + import java.net.InetSocketAddress; + import java.net.SocketAddress; +@@ -258,8 +261,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void done(ProxyPingEvent pingResult, Throwable error) + { +- Gson gson = BungeeCord.getInstance().gson; +- unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); ++ // FlameCord start - 1.7.x support ++ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; ++ if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ // Minecraft < 1.9 doesn't send string server descriptions as chat components. Older 1.7+ // clients even crash when encountering a chat component instead of a string. To be on the ++ // safe side, always send legacy descriptions for < 1.9 clients. ++ JsonElement element = gson.toJsonTree(pingResult.getResponse()); ++ Preconditions.checkArgument(element.isJsonObject(), "Response is not a JSON object"); ++ JsonObject object = element.getAsJsonObject(); ++ object.addProperty("description", pingResult.getResponse().getDescription()); ++ ++ unsafe.sendPacket(new StatusResponse(gson.toJson(element))); ++ } else ++ { ++ unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); ++ } ++ // FlameCord end - 1.7.x support + if ( bungee.getConnectionThrottle() != null ) + { + bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +index 6df3f3dd9..a409d440b 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +@@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; + import net.md_5.bungee.protocol.MinecraftEncoder; + import net.md_5.bungee.protocol.PacketWrapper; + import net.md_5.bungee.protocol.Protocol; ++import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.Handshake; + import net.md_5.bungee.protocol.packet.StatusRequest; + import net.md_5.bungee.protocol.packet.StatusResponse; +@@ -65,7 +66,7 @@ public class PingHandler extends PacketHandler + @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") + public void handle(StatusResponse statusResponse) throws Exception + { +- Gson gson = BungeeCord.getInstance().gson; ++ Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // FlameCord - 1.7.x support + ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class ); + ( (BungeeServerInfo) target ).cachePing( serverPing ); + callback.done( serverPing, null ); +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 c769976f3..c34629136 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 +@@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler + } ); + for ( ProxiedPlayer player : con.getServer().getInfo().getPlayers() ) + { +- player.unsafe().sendPacket( packet ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( packet ); ++ } ++ // FlameCord end - 1.7.x support + } + con.getServer().disconnect( "Quitting" ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index 09df5a93a..22ca9c967 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -35,6 +35,12 @@ public abstract class EntityMap + // Waterfall end + switch ( version ) + { ++ // FlameCord start - 1.7.x support ++ case ProtocolConstants.MINECRAFT_1_7_2: ++ return EntityMap_1_7_2.INSTANCE; ++ case ProtocolConstants.MINECRAFT_1_7_6: ++ return EntityMap_1_7_6.INSTANCE; ++ // FlameCord end - 1.7.x support + case ProtocolConstants.MINECRAFT_1_8: + return EntityMap_1_8.INSTANCE; + case ProtocolConstants.MINECRAFT_1_9: +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +new file mode 100644 +index 000000000..cdc07dc45 +--- /dev/null ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +@@ -0,0 +1,102 @@ ++// FlameCord start - 1.7.x support ++package net.md_5.bungee.entitymap; ++ ++import io.netty.buffer.ByteBuf; ++import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; ++ ++class EntityMap_1_7_2 extends EntityMap ++{ ++ ++ static final EntityMap INSTANCE = new EntityMap_1_7_2(); ++ ++ EntityMap_1_7_2() ++ { ++ addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment ++ addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed ++ addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation ++ addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player ++ addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item ++ addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object ++ addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob ++ addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting ++ addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb ++ addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity ++ addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity ++ addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move ++ addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look ++ addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move ++ addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport ++ addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look ++ addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status ++ addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity ++ addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata ++ addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect ++ addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect ++ addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties ++ addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation ++ addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity ++ ++ addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity ++ addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation ++ addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action ++ } ++ ++ @Override ++ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) ++ { ++ super.rewriteClientbound( packet, oldId, newId ); ++ ++ //Special cases ++ int readerIndex = packet.readerIndex(); ++ int packetId = DefinedPacket.readVarInt( packet ); ++ int packetIdLength = packet.readerIndex() - readerIndex; ++ if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) ++ { ++ rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); ++ } else if ( packetId == 0x13 /* Destroy Entities */ ) ++ { ++ int count = packet.getByte( packetIdLength ); ++ for ( int i = 0; i < count; i++ ) ++ { ++ rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); ++ } ++ } else if ( packetId == 0x0E /* Spawn Object */ ) ++ { ++ DefinedPacket.readVarInt( packet ); ++ int type = packet.readUnsignedByte(); ++ ++ if ( type == 60 || type == 90 ) ++ { ++ packet.skipBytes( 14 ); ++ int position = packet.readerIndex(); ++ int readId = packet.readInt(); ++ int changedId = -1; ++ if ( readId == oldId ) ++ { ++ packet.setInt( position, newId ); ++ changedId = newId; ++ } else if ( readId == newId ) ++ { ++ packet.setInt( position, oldId ); ++ changedId = oldId; ++ } ++ if ( changedId != -1 ) ++ { ++ if ( changedId == 0 && readId != 0 ) ++ { // Trim off the extra data ++ packet.readerIndex( readerIndex ); ++ packet.writerIndex( packet.readableBytes() - 6 ); ++ } else if ( changedId != 0 && readId == 0 ) ++ { // Add on the extra data ++ packet.readerIndex( readerIndex ); ++ packet.capacity( packet.readableBytes() + 6 ); ++ packet.writerIndex( packet.readableBytes() + 6 ); ++ } ++ } ++ } ++ } ++ packet.readerIndex( readerIndex ); ++ } ++} ++// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +new file mode 100644 +index 000000000..5ce42f628 +--- /dev/null ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +@@ -0,0 +1,62 @@ ++// FlameCord start - 1.7.x support ++package net.md_5.bungee.entitymap; ++ ++import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; ++import io.netty.buffer.ByteBuf; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.UserConnection; ++import net.md_5.bungee.connection.LoginResult; ++import net.md_5.bungee.protocol.DefinedPacket; ++ ++class EntityMap_1_7_6 extends EntityMap_1_7_2 ++{ ++ ++ static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); ++ ++ @Override ++ @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") ++ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) ++ { ++ super.rewriteClientbound( packet, oldId, newId ); ++ ++ int readerIndex = packet.readerIndex(); ++ int packetId = DefinedPacket.readVarInt( packet ); ++ int packetIdLength = packet.readerIndex() - readerIndex; ++ if ( packetId == 0x0C /* Spawn Player */ ) ++ { ++ DefinedPacket.readVarInt( packet ); ++ int idLength = packet.readerIndex() - readerIndex - packetIdLength; ++ String uuid = DefinedPacket.readString( packet ); ++ String username = DefinedPacket.readString( packet ); ++ int props = DefinedPacket.readVarInt( packet ); ++ if ( props == 0 ) ++ { ++ UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); ++ if ( player != null ) ++ { ++ LoginResult profile = player.getPendingConnection().getLoginProfile(); ++ if ( profile != null && profile.getProperties() != null ++ && profile.getProperties().length >= 1 ) ++ { ++ ByteBuf rest = packet.copy(); ++ packet.readerIndex( readerIndex ); ++ packet.writerIndex( readerIndex + packetIdLength + idLength ); ++ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); ++ DefinedPacket.writeString( username, packet ); ++ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); ++ for ( LoginResult.Property property : profile.getProperties() ) ++ { ++ DefinedPacket.writeString( property.getName(), packet ); ++ DefinedPacket.writeString( property.getValue(), packet ); ++ DefinedPacket.writeString( property.getSignature(), packet ); ++ } ++ packet.writeBytes( rest ); ++ rest.release(); ++ } ++ } ++ } ++ } ++ packet.readerIndex( readerIndex ); ++ } ++} ++// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +index bea2bbff9..caed43849 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +@@ -8,6 +8,7 @@ import lombok.Getter; + import lombok.NonNull; + import lombok.RequiredArgsConstructor; + import lombok.Setter; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.UserConnection; + import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.EntityRemoveEffect; +@@ -23,6 +24,12 @@ public class ForgeClientHandler + @NonNull + private final UserConnection con; + ++ // FlameCord start - 1.7.x support ++ @Getter ++ @Setter(AccessLevel.PACKAGE) ++ private boolean forgeOutdated = false; ++ // FlameCord end - 1.7.x support ++ + /** + * The users' mod list. + */ +@@ -175,4 +182,21 @@ public class ForgeClientHandler + { + return fmlTokenInHandshake || clientModList != null; + } ++ ++ // FlameCord start - 1.7.x support ++ /** ++ * Checks to see if a user is using an outdated FML build, and takes ++ * appropriate action on the User side. This should only be called during a ++ * server connection, by the ServerConnector ++ * ++ * @return true if the user's FML build is outdated, otherwise ++ * false ++ */ ++ public boolean checkUserOutdated() { ++ if (forgeOutdated) { ++ con.disconnect( BungeeCord.getInstance().getTranslation("connect_kick_outdated_forge") ); ++ } ++ return forgeOutdated; ++ } ++ // FlameCord end - 1.7.x support + } +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +index 5e02f8c8a..85bc21b9f 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +@@ -3,6 +3,7 @@ package net.md_5.bungee.forge; + import java.util.Map; + import net.md_5.bungee.ServerConnector; + import net.md_5.bungee.UserConnection; ++import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.PluginMessage; + + /** +@@ -84,6 +85,22 @@ enum ForgeClientHandshakeState implements IForgeClientPacketHandler clientModList = ForgeUtils.readModList( message ); + con.getForgeClientHandler().setClientModList( clientModList ); ++ // FlameCord start - 1.7.x support ++ // If the user is below 1.8, we need to check the version of FML - it's not always an OK version. ++ if ( ProtocolConstants.isBeforeOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ // Get the version from the mod list. ++ int buildNumber = ForgeUtils.getFmlBuildNumber( clientModList ); ++ ++ // If we get 0, we're probably using a testing build, so let it though. Otherwise, check the build number. ++ if ( buildNumber < ForgeConstants.FML_MIN_BUILD_VERSION && buildNumber != 0 ) ++ { ++ // Mark the user as an old Forge user. This will then cause any Forge ServerConnectors to cancel any ++ // connections to it. ++ con.getForgeClientHandler().setForgeOutdated( true ); ++ } ++ } ++ // FlameCord end - 1.7.x support + } + + return WAITINGSERVERDATA; +diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +index daf12f74e..7d0534857 100644 +--- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java ++++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +@@ -4,12 +4,14 @@ import java.util.Collection; + import java.util.HashSet; + import java.util.UUID; + import net.md_5.bungee.api.connection.ProxiedPlayer; ++import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.PlayerListItem; + + public class ServerUnique extends TabList + { + + private final Collection uuids = new HashSet<>(); ++ private final Collection usernames = new HashSet<>(); // FlameCord - 1.7.x support + + public ServerUnique(ProxiedPlayer player) + { +@@ -23,10 +25,26 @@ public class ServerUnique extends TabList + { + if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) + { +- uuids.add( item.getUuid() ); ++ // FlameCord start - 1.7.x support ++ if ( item.getUuid() != null ) ++ { ++ uuids.add( item.getUuid() ); ++ } else ++ { ++ usernames.add( item.getUsername() ); ++ } ++ // FlameCord end - 1.7.x support + } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) + { +- uuids.remove( item.getUuid() ); ++ // FlameCord start - 1.7.x support ++ if ( item.getUuid() != null ) ++ { ++ uuids.remove( item.getUuid() ); ++ } else ++ { ++ usernames.remove( item.getUsername() ); ++ } ++ // FlameCord end - 1.7.x support + } + } + player.unsafe().sendPacket( playerListItem ); +@@ -43,16 +61,46 @@ public class ServerUnique extends TabList + { + PlayerListItem packet = new PlayerListItem(); + packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); +- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; ++ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // FlameCord - 1.7.x support + int i = 0; ++ ++ // FlameCord start - 1.7.x support ++ for ( String username : usernames ) ++ { ++ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); ++ item.setUsername( username ); ++ item.setDisplayName( username ); ++ } ++ // FlameCord end - 1.7.x support ++ + for ( UUID uuid : uuids ) + { + PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); + item.setUuid( uuid ); + } + packet.setItems( items ); +- player.unsafe().sendPacket( packet ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( packet ); ++ } else ++ { ++ // Split up the packet ++ for ( PlayerListItem.Item item : packet.getItems() ) ++ { ++ PlayerListItem p2 = new PlayerListItem(); ++ p2.setAction( packet.getAction() ); ++ ++ p2.setItems( new PlayerListItem.Item[] ++ { ++ item ++ } ); ++ player.unsafe().sendPacket( p2 ); ++ } ++ } ++ // FlameCord end - 1.7.x support + uuids.clear(); ++ usernames.clear(); // FlameCord - 1.7.x support + } + + @Override +-- +2.32.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch similarity index 91% rename from Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch rename to Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch index ba6c2fbd..c8dc01b4 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,11 +1,11 @@ -From bbdbe9a57a15f0d72cfca33949147e0256044299 Mon Sep 17 00:00:00 2001 +From f34f232e1ba5b0498d5b6cab7c68938163ac3022 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9..e29b0ed3 100644 +index 2f7b38d9e..e29b0ed35 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java @@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 0fd58e83..2af68601 100644 +index 7a403a1ab..5132c537f 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 -@@ -321,7 +321,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -339,7 +339,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); diff --git a/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch similarity index 87% rename from Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch rename to Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch index 17ca426f..2bb2d304 100644 --- a/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch +++ b/Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch @@ -1,11 +1,11 @@ -From d57a08c1bd284e3f13166a5778361c789cce23ea Mon Sep 17 00:00:00 2001 +From 397911abe1f38fc29509d1b54db5549ca5764cce Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:58:18 +0800 Subject: [PATCH] Make a getter for the callback diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -index cf85ca06..8a945a99 100644 +index cf85ca06d..8a945a996 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java @@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; @@ -19,5 +19,5 @@ index cf85ca06..8a945a99 100644 private final Map intents = new ConcurrentHashMap<>(); private final AtomicBoolean fired = new AtomicBoolean(); -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch similarity index 96% rename from Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch rename to Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch index 5a167af1..6b93b0f3 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch @@ -1,11 +1,11 @@ -From 6cc482b6a66e0085ff7eb4ad565592ec9dd0d285 Mon Sep 17 00:00:00 2001 +From e546821e6a206365a2b569e803fe33e85a99a481 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 25da0a65..d4b612b3 100644 +index 25da0a65e..d4b612b36 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -45,25 +45,12 @@ public class BungeeCordLauncher @@ -38,7 +38,7 @@ index 25da0a65..d4b612b3 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 9c11ac57..ae4c7ac2 100644 +index 9c11ac576..ae4c7ac25 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -22,6 +22,7 @@ import java.util.Locale; diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch similarity index 86% rename from Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch rename to Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch index 8ca6cc4f..e50959a4 100644 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch @@ -1,14 +1,14 @@ -From 2cf1175a59dd57569142d33de750ab8358171141 Mon Sep 17 00:00:00 2001 +From 236c13d0121ef6ae5c6d7932c62c37a71f3ec1f7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a5efb0af..f5e09292 100644 +index 7d66fdbda..b25cede0e 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -127,7 +127,8 @@ public class ServerConnector extends PacketHandler +@@ -128,7 +128,8 @@ public class ServerConnector extends PacketHandler newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. @@ -19,5 +19,5 @@ index a5efb0af..f5e09292 100644 // All done. properties = newp; -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 87% rename from Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch rename to Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index deadca6b..1a6cbcd4 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From 377cba38cd24e2e64a89104547befaf18cdbbd8b Mon Sep 17 00:00:00 2001 +From f1b73e099fe0f7d5ca594ed2457f2e2e2c52514b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 2af68601..3b1f3d99 100644 +index 5132c537f..5efcb9b2c 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 -@@ -193,6 +193,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -196,6 +196,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,23 +22,25 @@ index 2af68601..3b1f3d99 100644 String kickMessage; if ( v1_5 ) -@@ -258,6 +265,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -261,6 +268,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { + // FlameCord - Close if response is null -+ // FlameCord - Return if connection is closed + if (pingResult.getResponse() == null) { + ch.close(); + return; -+ } else if (ch.isClosed()) { ++ } ++ ++ // FlameCord - Return if connection is closed ++ if (ch.isClosed()) { + return; + } + - Gson gson = BungeeCord.getInstance().gson; - unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); - if ( bungee.getConnectionThrottle() != null ) -@@ -287,11 +303,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + // FlameCord start - 1.7.x support + Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; + if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) +@@ -305,11 +323,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -56,7 +58,7 @@ index 2af68601..3b1f3d99 100644 } @Override -@@ -600,7 +618,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -618,7 +638,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -67,7 +69,7 @@ index 2af68601..3b1f3d99 100644 { ch.close(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..5c05f2b9 100644 +index 6dc5633f5..5c05f2b94 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -80,40 +80,27 @@ public class ChannelWrapper @@ -119,7 +121,7 @@ index 6dc5633f..5c05f2b9 100644 } 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 96704d5e..654203ab 100644 +index 96704d5eb..654203abb 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -160,7 +162,7 @@ index 96704d5e..654203ab 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b3bdfd05 100644 +index 0c1ecfb8e..b3bdfd05e 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0010-Packet-Checks.patch b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch similarity index 93% rename from Waterfall-Proxy-Patches/0010-Packet-Checks.patch rename to Waterfall-Proxy-Patches/0011-Packet-Checks.patch index 6829e055..d9195b44 100644 --- a/Waterfall-Proxy-Patches/0010-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch @@ -1,11 +1,11 @@ -From 92d4715a7044c29ab63cfdf9b65c145be7860873 Mon Sep 17 00:00:00 2001 +From 32f56cb02f7336ed609e181e5bb582fa5a9d0d79 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 01d35f41..ec07ae6f 100644 +index 01d35f41a..ec07ae6fd 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -29,7 +29,7 @@ index 01d35f41..ec07ae6f 100644 Object packetTypeInfo = null; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 270545f2..3bbc1510 100644 +index f8d6becd6..c0e4791f9 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -78,6 +78,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -45,5 +45,5 @@ index 270545f2..3bbc1510 100644 { HAProxyMessage proxy = (HAProxyMessage) msg; -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch similarity index 86% rename from Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch rename to Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch index b83de80b..c4ed776a 100644 --- a/Waterfall-Proxy-Patches/0011-Default-timeout-to-10000.patch +++ b/Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch @@ -1,11 +1,11 @@ -From 40d019da485a276d84ebf1fe9aa0276288e50b55 Mon Sep 17 00:00:00 2001 +From 245d1262bdf112f20eba342196f07bd5036c62ea Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 Subject: [PATCH] Default timeout to 10000 diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197a..c41930ae 100644 +index 85d2197ac..c41930ae7 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig @@ -19,5 +19,5 @@ index 85d2197a..c41930ae 100644 * UUID used for metrics. */ -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch similarity index 84% rename from Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index f9ee943d..8baeec7b 100644 --- a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From d0df3e9283244e4124ea3abb0c210743e9a5b39f Mon Sep 17 00:00:00 2001 +From 21ea3112cf27d28dbf72ded9b702fd031c9336a5 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 3b1f3d99..503ee86a 100644 +index 5efcb9b2c..751643a68 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 -@@ -428,6 +428,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -448,6 +448,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { thisState = State.ENCRYPT; unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch similarity index 89% rename from Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch index 109b2f24..45a75c78 100644 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch @@ -1,11 +1,11 @@ -From 17b968a7aa4e4afec3eff6e09f150ede548aff6a Mon Sep 17 00:00:00 2001 +From fd5189254c8261ce764428c1ab8ee302fc842ca3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -index d1cd1090..44cb1ce6 100644 +index d1cd10905..44cb1ce66 100644 --- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java @@ -21,7 +21,8 @@ public final class AllowedCharacters diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch similarity index 96% rename from Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch index 927f5b92..a25ab955 100644 --- a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From ee27ec7faf4a11ad24c751a4ae6307a9b24044e7 Mon Sep 17 00:00:00 2001 +From 7182131a4230bc24a36f1f0fd7c155edb95e9361 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 5c05f2b9..606866a5 100644 +index 5c05f2b94..606866a52 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -74,5 +74,5 @@ index 5c05f2b9..606866a5 100644 } } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 84% rename from Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 041c237a..c2a38969 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 7dec0219892d80bac509c0c6a919b8bbbe691ef6 Mon Sep 17 00:00:00 2001 +From 1c22b3cd263a326cb66e312e7b537877b30eac23 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 503ee86a..5927d57d 100644 +index 751643a68..6a9f1bd8e 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 -@@ -678,7 +678,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -698,7 +698,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch similarity index 78% rename from Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch rename to Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch index 8a9f0e18..84511335 100644 --- a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,28 +1,28 @@ -From 2bf254d23544622bf9a32880bace6d821e42477f Mon Sep 17 00:00:00 2001 +From 7824c3357547e77f9e307d2fcdd19e1122a7bcd8 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 5927d57d..4316da26 100644 +index 6a9f1bd8e..674b3ead8 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 -@@ -447,6 +447,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -467,6 +467,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); + // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHED; ++ thisState = State.FINISHING; SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start if (sharedKey instanceof SecretKeySpec) { -@@ -506,6 +508,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -526,6 +528,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { + // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHED; ++ thisState = State.FINISHING; + if ( isOnlineMode() ) { diff --git a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 85% rename from Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch index 1c5b34ce..c895b08f 100644 --- a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 8b3e6f968ad9a19466653d9a08b31da13567b6d2 Mon Sep 17 00:00:00 2001 +From 9836196e9e4b3cb650697a608f54d506d4b1502b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 fc98b4b1..db79b58a 100644 +index 85ae3fc9d..6232f1ec0 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -310,7 +310,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -311,7 +311,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { diff --git a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch similarity index 86% rename from Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch index 9d387892..67d35601 100644 --- a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From ae64b8938eadb7ee4b0c68572b4e270530603ad9 Mon Sep 17 00:00:00 2001 +From 1cea5ef145ff10f975c0bc774b18d46f02c89e34 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 e643d8a7..dc5b64b7 100644 +index 674b3ead8..72e0098dc 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 -@@ -490,7 +490,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -510,7 +510,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch similarity index 94% rename from Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch index 299a10c9..e2c4b3a5 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From c0015af5ddf9eb2e081949e90a908ba36acf27ba Mon Sep 17 00:00:00 2001 +From 22e56507775a8d2f89d7602977f80a584678b99f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..252612a3 +index 000000000..252612a31 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,34 @@ @@ -47,7 +47,7 @@ index 00000000..252612a3 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 00000000..81ded224 +index 000000000..81ded2243 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,64 @@ @@ -116,7 +116,7 @@ index 00000000..81ded224 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec07ae6f..91da8ab6 100644 +index ec07ae6fd..91da8ab65 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -128,7 +128,7 @@ index ec07ae6f..91da8ab6 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 00000000..a323598e +index 000000000..a323598eb --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 136da2a8..4991c0a1 100644 +index b3f77bcab..2a702d141 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,9 @@ import com.google.common.collect.Sets; @@ -217,7 +217,7 @@ index 136da2a8..4991c0a1 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -225,11 +234,12 @@ public class BungeeCord extends ProxyServer +@@ -233,11 +242,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -235,7 +235,7 @@ index 136da2a8..4991c0a1 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -278,6 +288,15 @@ public class BungeeCord extends ProxyServer +@@ -286,6 +296,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -251,7 +251,7 @@ index 136da2a8..4991c0a1 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -569,9 +588,7 @@ public class BungeeCord extends ProxyServer +@@ -577,9 +596,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -263,7 +263,7 @@ index 136da2a8..4991c0a1 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index f5e09292..3e3e42a2 100644 +index b25cede0e..1e01dea51 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -275,7 +275,7 @@ index f5e09292..3e3e42a2 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -163,7 +165,7 @@ public class ServerConnector extends PacketHandler +@@ -164,7 +166,7 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -285,7 +285,7 @@ index f5e09292..3e3e42a2 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 db79b58a..a847c049 100644 +index 6232f1ec0..bd5ce6a2e 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -36,6 +36,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -304,7 +304,7 @@ index db79b58a..a847c049 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -390,9 +392,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -391,9 +393,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -319,10 +319,10 @@ index db79b58a..a847c049 100644 b.connect().addListener( listener ); } 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 98b46cc2..d5e4dcb6 100644 +index 72e0098dc..447940111 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 -@@ -14,6 +14,8 @@ import java.util.logging.Level; +@@ -17,6 +17,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -331,7 +331,7 @@ index 98b46cc2..d5e4dcb6 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -151,7 +153,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -154,7 +156,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -341,7 +341,7 @@ index 98b46cc2..d5e4dcb6 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd..264c22e8 100644 +index a409d440b..3503c089d 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -353,7 +353,7 @@ index 6df3f3dd..264c22e8 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index c0e4791f..28543346 100644 +index c0e4791f9..285433467 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -366,7 +366,7 @@ index c0e4791f..28543346 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 654203ab..a840bc70 100644 +index 654203abb..a840bc700 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,8 @@ diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch similarity index 96% rename from Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch index 7b00c08f..cf61e484 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 0cdc879be6e32c45bdb2e3214a003f24808c2702 Mon Sep 17 00:00:00 2001 +From 5515f767e5231b29a0f30d7754f3fee84a6f5e97 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 252612a3..2e317533 100644 +index 252612a31..2e317533e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -35,7 +35,7 @@ index 252612a3..2e317533 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 00000000..e82c4844 +index 000000000..e82c4844b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,94 @@ @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 90812759..6efe18c2 100644 +index 2a702d141..e9061e6a8 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; @@ -145,7 +145,7 @@ index 90812759..6efe18c2 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -278,9 +279,10 @@ public class BungeeCord extends ProxyServer +@@ -286,9 +287,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -158,7 +158,7 @@ index 90812759..6efe18c2 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -313,6 +315,7 @@ public class BungeeCord extends ProxyServer +@@ -321,6 +323,7 @@ public class BungeeCord extends ProxyServer connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); } startListeners(); @@ -166,7 +166,7 @@ index 90812759..6efe18c2 100644 saveThread.scheduleAtFixedRate( new TimerTask() { -@@ -830,4 +833,52 @@ public class BungeeCord extends ProxyServer +@@ -838,4 +841,52 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } diff --git a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch deleted file mode 100644 index bcfa09a8..00000000 --- a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch +++ /dev/null @@ -1,127 +0,0 @@ -From fb2700e20203d8aeb36b8f64b688df0b264cb9dc Mon Sep 17 00:00:00 2001 -From: linsaftw -Date: Sat, 20 Mar 2021 12:36:25 -0300 -Subject: [PATCH] Fix ByteBuf memory leaks - - -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3e3e42a2..ccab6800 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -275,9 +275,15 @@ public class ServerConnector extends PacketHandler - } else - { - ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); -- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -- brand.release(); -+ -+ try -+ { -+ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); -+ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ } finally -+ { -+ brand.release(); -+ } - } - - user.setDimension( login.getDimension() ); -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 -index 9e180c30..40c016d6 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -287,15 +287,24 @@ public class DownstreamBridge extends PacketHandler - if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) - { - ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- String serverBrand = DefinedPacket.readString( brand ); -- brand.release(); - -- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); -+ try { -+ String serverBrand; - -- brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -- pluginMessage.setData( brand ); -- brand.release(); -+ try { -+ serverBrand = DefinedPacket.readString( brand ); -+ } finally { -+ brand.release(); -+ } -+ -+ Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); -+ -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData( brand ); -+ } finally { -+ brand.release(); -+ } - // changes in the packet are ignored so we need to send it manually - con.unsafe().sendPacket( pluginMessage ); - throw CancelSendSignal.INSTANCE; -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 09df5a93..67ef2cb4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -142,11 +142,15 @@ public abstract class EntityMap - if ( readId == oldId || readId == newId ) - { - ByteBuf data = packet.copy(); -- packet.readerIndex( offset ); -- packet.writerIndex( offset ); -- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -- packet.writeBytes( data ); -- data.release(); -+ -+ try { -+ packet.readerIndex( offset ); -+ packet.writerIndex( offset ); -+ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -+ packet.writeBytes( data ); -+ } finally { -+ data.release(); -+ } - } - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206..8d4439ab 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -@@ -38,16 +38,22 @@ public class ForgeUtils - { - Map modTags = new HashMap<>(); - ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- byte discriminator = payload.readByte(); -- if ( discriminator == 2 ) // ModList -- { -- ByteBuf buffer = payload.slice(); -- int modCount = DefinedPacket.readVarInt( buffer, 2 ); -- for ( int i = 0; i < modCount; i++ ) -+ -+ try { -+ byte discriminator = payload.readByte(); -+ if ( discriminator == 2 ) // ModList - { -- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ ByteBuf buffer = payload.slice(); -+ int modCount = DefinedPacket.readVarInt( buffer, 2 ); -+ for ( int i = 0; i < modCount; i++ ) -+ { -+ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ } - } -+ } finally { -+ payload.release(); - } -+ - return modTags; - } - --- -2.32.0.windows.1 - diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch similarity index 97% rename from Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch index a4f4e2bd..7017613c 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From 243a50f0f4ccc0bfc197f17ade84f89557d82f35 Mon Sep 17 00:00:00 2001 +From 6030c4824ddd3b9a496b3ad1dd7acb05799158df Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 2e317533..8957c79a 100644 +index 2e317533e..8957c79ac 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -35,7 +35,7 @@ index 2e317533..8957c79a 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..028b6d4c +index 000000000..028b6d4cf --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -0,0 +1,123 @@ @@ -164,7 +164,7 @@ index 00000000..028b6d4c +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index a323598e..bf6f8538 100644 +index a323598eb..bf6f85386 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -211,10 +211,10 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c08d9c50..7e40f20a 100644 +index e9061e6a8..e3604c0f6 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -588,14 +588,8 @@ public class BungeeCord extends ProxyServer +@@ -596,14 +596,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { @@ -232,5 +232,5 @@ index c08d9c50..7e40f20a 100644 @Override -- -2.32.0.windows.2 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch new file mode 100644 index 00000000..c6b1d56d --- /dev/null +++ b/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch @@ -0,0 +1,68 @@ +From 9cd696425b856f9f75a7b012245bde185bba08a5 Mon Sep 17 00:00:00 2001 +From: linsaftw +Date: Sat, 20 Mar 2021 12:36:25 -0300 +Subject: [PATCH] Fix ByteBuf memory leaks + + +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index 22ca9c967..99928eb20 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -148,11 +148,15 @@ public abstract class EntityMap + if ( readId == oldId || readId == newId ) + { + ByteBuf data = packet.copy(); +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- data.release(); ++ ++ try { ++ packet.readerIndex( offset ); ++ packet.writerIndex( offset ); ++ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); ++ packet.writeBytes( data ); ++ } finally { ++ data.release(); ++ } + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index cefa0206e..8d4439ab8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -38,16 +38,22 @@ public class ForgeUtils + { + Map modTags = new HashMap<>(); + ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- byte discriminator = payload.readByte(); +- if ( discriminator == 2 ) // ModList +- { +- ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ ++ try { ++ byte discriminator = payload.readByte(); ++ if ( discriminator == 2 ) // ModList + { +- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ ByteBuf buffer = payload.slice(); ++ int modCount = DefinedPacket.readVarInt( buffer, 2 ); ++ for ( int i = 0; i < modCount; i++ ) ++ { ++ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ } + } ++ } finally { ++ payload.release(); + } ++ + return modTags; + } + +-- +2.32.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch similarity index 91% rename from Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch index 1c1db045..9ea29399 100644 --- a/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch @@ -1,11 +1,11 @@ -From fb4385149fe4543ff5285b95a1b9d6a833a3adcb Mon Sep 17 00:00:00 2001 +From bbcf8ceff1a4dc626dd39f2bc31f6bceae1ac913 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 91da8ab6..c03e1b51 100644 +index 91da8ab65..c03e1b513 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -23,5 +23,5 @@ index 91da8ab6..c03e1b51 100644 if ( packet != null ) { -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0025-Firewall-System.patch similarity index 96% rename from Waterfall-Proxy-Patches/0024-Firewall-System.patch rename to Waterfall-Proxy-Patches/0025-Firewall-System.patch index 833afc08..7658aeb3 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0025-Firewall-System.patch @@ -1,11 +1,11 @@ -From 26fb15428c81e5532a5b61b15f2ddf6b0a690539 Mon Sep 17 00:00:00 2001 +From dee5fc50a694b5251e2f6e2e6f25ce1cefb0ec65 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79a..fd889644 100644 +index 8957c79ac..fd889644f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -6,6 +6,7 @@ import java.util.logging.Logger; @@ -64,7 +64,7 @@ index 8957c79a..fd889644 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded224..8bb61ac1 100644 +index 81ded2243..8bb61ac11 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -96,7 +96,7 @@ index 81ded224..8bb61ac1 100644 configurationProvider.save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 028b6d4c..56044631 100644 +index 028b6d4cf..560446318 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -84,9 +84,17 @@ public class MessagesConfiguration { @@ -120,7 +120,7 @@ index 028b6d4c..56044631 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java new file mode 100644 -index 00000000..dfb5c6d3 +index 000000000..dfb5c6d30 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java @@ -0,0 +1,120 @@ @@ -246,7 +246,7 @@ index 00000000..dfb5c6d3 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index c03e1b51..7f4b5b45 100644 +index c03e1b513..7f4b5b45a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -275,7 +275,7 @@ index c03e1b51..7f4b5b45 100644 } finally { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index bf6f8538..fa0b59c2 100644 +index bf6f85386..fa0b59c27 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -5,6 +5,7 @@ import java.util.HashSet; @@ -303,10 +303,10 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index ccab6800..d57a0516 100644 +index 1e01dea51..5e1cca9ae 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -165,6 +165,9 @@ public class ServerConnector extends PacketHandler +@@ -166,6 +166,9 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -317,10 +317,10 @@ index ccab6800..d57a0516 100644 } } 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 d5e4dcb6..7bdddfa5 100644 +index 447940111..8f142f488 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 -@@ -153,6 +153,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -156,6 +156,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -330,7 +330,7 @@ index d5e4dcb6..7bdddfa5 100644 throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } -@@ -380,6 +383,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -400,6 +403,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } break; default: @@ -340,13 +340,13 @@ index d5e4dcb6..7bdddfa5 100644 throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); } } -@@ -394,6 +400,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -414,6 +420,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection disconnect( bungee.getTranslation( "name_invalid" ) ); return; } + + // FlameCord - Firewall and close if username is blocked -+ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( name ) ) ++ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( loginRequest.getData() ) ) + { + FlameCord.getInstance().getFirewallManager().addFirewalled( ch.getRemoteAddress() ); + ch.close(); @@ -357,7 +357,7 @@ index d5e4dcb6..7bdddfa5 100644 int limit = BungeeCord.getInstance().config.getPlayerLimit(); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 264c22e8..2101cbc4 100644 +index 3503c089d..283b3134f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -2,6 +2,7 @@ package net.md_5.bungee.connection; @@ -368,7 +368,7 @@ index 264c22e8..2101cbc4 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -58,6 +59,9 @@ public class PingHandler extends PacketHandler +@@ -59,6 +60,9 @@ public class PingHandler extends PacketHandler { if ( packet.packet == null ) { @@ -379,7 +379,7 @@ index 264c22e8..2101cbc4 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 28543346..8d6f9d3a 100644 +index 285433467..8d6f9d3ae 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -391,7 +391,7 @@ index 28543346..8d6f9d3a 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; 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 a840bc70..4e23c996 100644 +index a840bc700..4e23c996e 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 @@ -63,6 +63,13 @@ public class PipelineUtils @@ -409,7 +409,7 @@ index a840bc70..4e23c996 100644 { ch.close(); diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b3bdfd05..49d53f17 100644 +index b3bdfd05e..49d53f177 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -2,6 +2,8 @@ package net.md_5.bungee.query; diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch similarity index 95% rename from Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch index 293345c9..89b4ac12 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From ea567bac560207c0a619d621b0ee7dced802e022 Mon Sep 17 00:00:00 2001 +From 1e753a003c6e30aeb86d841d6076e7a1ddd6f755 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac1..aafd99d8 100644 +index 8bb61ac11..aafd99d8c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,16 @@ import net.md_5.bungee.config.Configuration; @@ -38,10 +38,10 @@ index 8bb61ac1..aafd99d8 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 7bdddfa5..37317a47 100644 +index 8f142f488..5fd105410 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 -@@ -354,7 +354,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -374,7 +374,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index 7bdddfa5..37317a47 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -363,7 +364,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -383,7 +384,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -62,7 +62,7 @@ index 7bdddfa5..37317a47 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 8d6f9d3a..e5602230 100644 +index 8d6f9d3ae..e5602230a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0026-Always-release-packet.patch b/Waterfall-Proxy-Patches/0027-Always-release-packet.patch similarity index 93% rename from Waterfall-Proxy-Patches/0026-Always-release-packet.patch rename to Waterfall-Proxy-Patches/0027-Always-release-packet.patch index 328dc76b..b046de86 100644 --- a/Waterfall-Proxy-Patches/0026-Always-release-packet.patch +++ b/Waterfall-Proxy-Patches/0027-Always-release-packet.patch @@ -1,11 +1,11 @@ -From 863b4ad3004b71c19707a0921dcaf2695b1e3247 Mon Sep 17 00:00:00 2001 +From 99c527b3d3e388ca5584b0e01e8009e590fc41a5 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packet diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index e5602230..085cda11 100644 +index e5602230a..085cda114 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -113,12 +113,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch similarity index 96% rename from Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch index da233702..d9f2e087 100644 --- a/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 0b208fdf287585eed2787a5ab7eba1a39cf7b670 Mon Sep 17 00:00:00 2001 +From f9314b3f2dce279120c4b7408b6afcc0eef1590d Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -6,7 +6,7 @@ Subject: [PATCH] Added an api method to unload Plugins Format Code to Bungee's code style diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156..a190dfae 100644 +index 90031156f..a190dfae8 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -25,6 +25,7 @@ import java.util.Set; @@ -82,5 +82,5 @@ index 90031156..a190dfae 100644 ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] { -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch similarity index 92% rename from Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch index daa21e31..abea274f 100644 --- a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch @@ -1,11 +1,11 @@ -From fd8069ef569a8ab85a743a52f1fd9b67cad09ba4 Mon Sep 17 00:00:00 2001 +From 872fdc668b2bd4ce164b15b24e9a15426f1e85e1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..00f387d8 100644 +index 7dbbfd3cd..e903313df 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; From 8cb0cee8a6046990265195ff5c2a2d6150aa9484 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 1 Oct 2021 00:22:37 -0300 Subject: [PATCH 158/499] 1.7.x support improvements --- .../0005-1.7.x-support.patch | 272 +++++++++--------- 1 file changed, 131 insertions(+), 141 deletions(-) diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index 3e2d7ec6..576973a3 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,4 +1,4 @@ -From a421ce9004de456cfd72b8e3f40578056889de24 Mon Sep 17 00:00:00 2001 +From 6e47eca098c2a7576acd64fe87bc915f21c8bb31 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -357,35 +357,50 @@ index caf7ed0b6..787b93740 100644 ProtocolConstants.MINECRAFT_1_8, ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +index 6034fc180..6100687cb 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +@@ -41,6 +41,7 @@ public class Chat extends DefinedPacket + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { + message = readString( buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); ++ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support + if ( direction == ProtocolConstants.Direction.TO_CLIENT ) + { + position = buf.readByte(); +@@ -60,6 +61,7 @@ public class Chat extends DefinedPacket + } else + // Waterfall end + writeString( message, buf ); ++ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support + if ( direction == ProtocolConstants.Direction.TO_CLIENT ) + { + buf.writeByte( position ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 29440533f..22b7d4632 100644 +index 29440533f..8d00c3897 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -@@ -28,6 +28,18 @@ public class ClientSettings extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { +@@ -33,6 +33,12 @@ public class ClientSettings extends DefinedPacket + chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); + chatColours = buf.readBoolean(); + skinParts = buf.readByte(); + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { -+ locale = readString( buf ); -+ viewDistance = buf.readByte(); -+ chatFlags = buf.readUnsignedByte(); -+ chatColours = buf.readBoolean(); -+ skinParts = buf.readByte(); ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + difficulty = buf.readByte(); -+ return; + } + // FlameCord end - 1.7.x support -+ - locale = readString( buf, 16 ); - viewDistance = buf.readByte(); - chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); -@@ -46,6 +58,18 @@ public class ClientSettings extends DefinedPacket + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) + { + mainHand = DefinedPacket.readVarInt( buf ); +@@ -46,6 +52,19 @@ public class ClientSettings extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( locale, buf ); + buf.writeByte( viewDistance ); + buf.writeByte( chatFlags ); @@ -400,15 +415,16 @@ index 29440533f..22b7d4632 100644 buf.writeByte( viewDistance ); if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca8..ddcc4249e 100644 +index a29524ca8..86182cdd3 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -@@ -23,6 +23,15 @@ public class EncryptionRequest extends DefinedPacket +@@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + serverId = readString( buf ); + publicKey = v17readArray( buf ); + verifyToken = v17readArray( buf ); @@ -419,12 +435,13 @@ index a29524ca8..ddcc4249e 100644 serverId = readString( buf ); publicKey = readArray( buf ); verifyToken = readArray( buf ); -@@ -31,6 +40,15 @@ public class EncryptionRequest extends DefinedPacket +@@ -31,6 +41,16 @@ public class EncryptionRequest extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( serverId, buf ); + v17writeArray( publicKey, buf, false ); + v17writeArray( verifyToken, buf, false ); @@ -436,15 +453,16 @@ index a29524ca8..ddcc4249e 100644 writeArray( publicKey, buf ); writeArray( verifyToken, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 53575ce0e..33f5718a4 100644 +index 53575ce0e..52d7a5cc8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -@@ -22,6 +22,14 @@ public class EncryptionResponse extends DefinedPacket +@@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + sharedSecret = v17readArray( buf ); + verifyToken = v17readArray( buf ); + return; @@ -454,12 +472,13 @@ index 53575ce0e..33f5718a4 100644 sharedSecret = readArray( buf, 128 ); verifyToken = readArray( buf, 128 ); } -@@ -29,6 +37,14 @@ public class EncryptionResponse extends DefinedPacket +@@ -29,6 +38,15 @@ public class EncryptionResponse extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + v17writeArray( sharedSecret, buf, false ); + v17writeArray( verifyToken, buf, false ); + return; @@ -470,15 +489,16 @@ index 53575ce0e..33f5718a4 100644 writeArray( verifyToken, buf ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc416..548e592e7 100644 +index b004bc416..a8c3e7736 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -@@ -21,12 +21,26 @@ public class KeepAlive extends DefinedPacket +@@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + randomId = buf.readInt(); + return; + } @@ -491,7 +511,8 @@ index b004bc416..548e592e7 100644 public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + buf.writeInt((int) randomId); + return; + } @@ -544,15 +565,16 @@ index 551bd1046..5aeae06c3 100644 + // FlameCord end - 1.7.x support } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 92bacc7cd..3a46ee103 100644 +index 92bacc7cd..cae5bda5c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -@@ -21,6 +21,17 @@ public class PlayerListItem extends DefinedPacket +@@ -21,6 +21,18 @@ public class PlayerListItem extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + items = new Item[ 1 ]; + Item item = items[ 0 ] = new Item(); + item.displayName = item.username = readString( buf ); @@ -565,12 +587,13 @@ index 92bacc7cd..3a46ee103 100644 action = Action.values()[DefinedPacket.readVarInt( buf )]; items = new Item[ DefinedPacket.readVarInt( buf ) ]; for ( int i = 0; i < items.length; i++ ) -@@ -75,6 +86,16 @@ public class PlayerListItem extends DefinedPacket +@@ -75,6 +87,17 @@ public class PlayerListItem extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + Item item = items[0]; // Only one at a time + writeString( item.displayName, buf ); // TODO: Server unique only! + buf.writeBoolean( action != Action.REMOVE_PLAYER ); @@ -583,15 +606,16 @@ index 92bacc7cd..3a46ee103 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index c652ffb4f..1638dcf5b 100644 +index c652ffb4f..90aaee0a9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -@@ -82,6 +82,14 @@ public class PluginMessage extends DefinedPacket +@@ -82,6 +82,15 @@ public class PluginMessage extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + tag = readString( buf ); + data = v17readArray( buf ); + return; @@ -601,12 +625,13 @@ index c652ffb4f..1638dcf5b 100644 tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; Preconditions.checkArgument( buf.readableBytes() < maxSize ); -@@ -92,6 +100,14 @@ public class PluginMessage extends DefinedPacket +@@ -92,6 +101,15 @@ public class PluginMessage extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( tag, buf ); + v17writeArray( data, buf, allowExtendedPacket ); + return; @@ -617,15 +642,16 @@ index c652ffb4f..1638dcf5b 100644 buf.writeBytes( data ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d54..936fa06cd 100644 +index 3c7905d54..75b371e9c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -@@ -28,6 +28,15 @@ public class ScoreboardObjective extends DefinedPacket +@@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + name = readString( buf ); + value = readString( buf ); + action = buf.readByte(); @@ -636,12 +662,13 @@ index 3c7905d54..936fa06cd 100644 name = readString( buf ); action = buf.readByte(); if ( action == 0 || action == 2 ) -@@ -46,6 +55,15 @@ public class ScoreboardObjective extends DefinedPacket +@@ -46,6 +56,16 @@ public class ScoreboardObjective extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( name, buf ); + writeString( value, buf ); + buf.writeByte( action ); @@ -653,15 +680,16 @@ index 3c7905d54..936fa06cd 100644 buf.writeByte( action ); if ( action == 0 || action == 2 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86b..f3e1ce851 100644 +index 0b27fc86b..a812441d9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -@@ -27,6 +27,19 @@ public class ScoreboardScore extends DefinedPacket +@@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + itemName = readString( buf ); + action = buf.readByte(); + if ( action != 1 ) @@ -676,12 +704,13 @@ index 0b27fc86b..f3e1ce851 100644 itemName = readString( buf ); action = buf.readByte(); scoreName = readString( buf ); -@@ -39,6 +52,19 @@ public class ScoreboardScore extends DefinedPacket +@@ -39,6 +53,20 @@ public class ScoreboardScore extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( itemName, buf ); + buf.writeByte( action ); + if ( action != 1 ) @@ -696,79 +725,40 @@ index 0b27fc86b..f3e1ce851 100644 writeString( itemName, buf ); buf.writeByte( action ); writeString( scoreName, buf ); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 80e4f85af..6614ffb21 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -@@ -37,6 +37,13 @@ public class TabCompleteRequest extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { -+ cursor = readString( buf ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) - { - transactionId = readVarInt( buf ); -@@ -60,6 +67,13 @@ public class TabCompleteRequest extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { -+ writeString( cursor, buf ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) - { - writeVarInt( transactionId, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..1a8cd7da1 100644 +index a5555f6af..7c21c9dd8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -@@ -44,6 +44,30 @@ public class Team extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { -+ name = readString( buf ); -+ mode = buf.readByte(); -+ if ( mode == 0 || mode == 2 ) -+ { -+ displayName = readString( buf ); -+ prefix = readString( buf ); -+ suffix = readString( buf ); -+ friendlyFire = buf.readByte(); -+ } -+ if ( mode == 0 || mode == 3 || mode == 4 ) +@@ -55,7 +55,12 @@ public class Team extends DefinedPacket + suffix = readString( buf ); + } + friendlyFire = buf.readByte(); +- nameTagVisibility = readString( buf ); ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) + { -+ int len = buf.readShort(); -+ players = new String[ len ]; -+ for ( int i = 0; i < len; i++ ) -+ { -+ players[i] = readString( buf ); -+ } ++ nameTagVisibility = readString( buf ); + } -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - name = readString( buf ); - mode = buf.readByte(); - if ( mode == 0 || mode == 2 ) -@@ -81,6 +105,29 @@ public class Team extends DefinedPacket ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) + { + collisionRule = readString( buf ); +@@ -69,7 +74,7 @@ public class Team extends DefinedPacket + } + if ( mode == 0 || mode == 3 || mode == 4 ) + { +- int len = readVarInt( buf ); ++ int len = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt( buf ) : readVarShort( buf ); // FlameCord - 1.7.x support + players = new String[ len ]; + for ( int i = 0; i < len; i++ ) + { +@@ -81,6 +86,30 @@ public class Team extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support -+ if (protocolVersion == ProtocolConstants.MINECRAFT_1_7_2 || protocolVersion == ProtocolConstants.MINECRAFT_1_7_6) { ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { + writeString( name, buf ); + buf.writeByte( mode ); + if ( mode == 0 || mode == 2 ) @@ -879,7 +869,7 @@ index 491cf1a16..6cd8ec3b4 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a5efb0af2..7d66fdbda 100644 +index a5efb0af2..2bdd03b3f 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -890,7 +880,7 @@ index a5efb0af2..7d66fdbda 100644 import java.util.Locale; import java.util.Arrays; // Waterfall import java.util.Queue; -@@ -271,11 +272,21 @@ public class ServerConnector extends PacketHandler +@@ -271,10 +272,20 @@ public class ServerConnector extends PacketHandler user.getServer().disconnect( "Quitting" ); } else { @@ -911,17 +901,16 @@ index a5efb0af2..7d66fdbda 100644 + user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); + brand.release(); + } ++ // FlameCord end - 1.7.x support } -+ // FlameCord end - 1.7.x support user.setDimension( login.getDimension() ); - } else @@ -287,7 +298,7 @@ public class ServerConnector extends PacketHandler if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall for ( Objective objective : serverScoreboard.getObjectives() ) { - user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); -+ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // Travertine - 1.7 support ++ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support } for ( Score score : serverScoreboard.getScores() ) { @@ -941,7 +930,7 @@ index a5efb0af2..7d66fdbda 100644 throw CancelSendSignal.INSTANCE; } 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 fc98b4b19..85ae3fc9d 100644 +index fc98b4b19..b50036b44 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -197,6 +197,7 @@ public final class UserConnection implements ProxiedPlayer @@ -957,7 +946,7 @@ index fc98b4b19..85ae3fc9d 100644 message = ChatComponentTransformer.getInstance().transform( this, true, message ); - if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord ++ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 @@ -986,7 +975,7 @@ index fc98b4b19..85ae3fc9d 100644 { this.compressionThreshold = compressionThreshold; 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 -index 9e180c30c..c00b3dcd8 100644 +index 9e180c30c..df618972f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1015,7 +1004,7 @@ index 9e180c30c..c00b3dcd8 100644 } break; default: -@@ -286,19 +287,27 @@ public class DownstreamBridge extends PacketHandler +@@ -286,19 +287,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1035,22 +1024,23 @@ index 9e180c30c..c00b3dcd8 100644 + // FlameCord start - 1.7.x support + if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) + { -+ ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); -+ String serverBrand = DefinedPacket.readString( brand ); -+ brand.release(); -+ -+ Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); -+ -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData( brand ); -+ brand.release(); -+ // changes in the packet are ignored so we need to send it manually -+ con.unsafe().sendPacket( pluginMessage ); -+ throw CancelSendSignal.INSTANCE; -+ } else { ++ try ++ { ++ ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); ++ String serverBrand = DefinedPacket.readString(brand); ++ brand.release(); ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData(brand); ++ brand.release(); ++ } catch (Exception ProtocolHacksSuck) ++ { ++ return; ++ } ++ } else ++ { + String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); -+ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord ++ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord - 1.7.x support + } + // FlameCord end - 1.7.x support } From c257a85a26775b3a17aade4aaf9cef2cf1cf43f5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 1 Oct 2021 00:45:47 -0300 Subject: [PATCH 159/499] fix 1.7.x tab complete packets --- .../0005-1.7.x-support.patch | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index 576973a3..1b80bc39 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 6e47eca098c2a7576acd64fe87bc915f21c8bb31 Mon Sep 17 00:00:00 2001 +From 702633e22f59f3a5b0df89f6d557c4a819358caf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -725,6 +725,26 @@ index 0b27fc86b..a812441d9 100644 writeString( itemName, buf ); buf.writeByte( action ); writeString( scoreName, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +index 80e4f85af..cab28b999 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +@@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket + } + cursor = readString( buf, ( protocolVersion > ProtocolConstants.MINECRAFT_1_13 ? 32500 : ( protocolVersion == ProtocolConstants.MINECRAFT_1_13 ? 256 : 32767 ) ) ); + ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) + { + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) +@@ -66,6 +67,7 @@ public class TabCompleteRequest extends DefinedPacket + } + writeString( cursor, buf ); + ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) + { + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java index a5555f6af..7c21c9dd8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java From ca23156b65927988fe80ff302eaa90a2a4a16c1c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:42:49 -0300 Subject: [PATCH 160/499] fix 1.7 scoreboard packets --- .../0005-1.7.x-support.patch | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index 1b80bc39..b0f0d7cd 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 702633e22f59f3a5b0df89f6d557c4a819358caf Mon Sep 17 00:00:00 2001 +From b74598019073565159c2d9a1d93680916632e78b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -746,10 +746,10 @@ index 80e4f85af..cab28b999 100644 { if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..7c21c9dd8 100644 +index a5555f6af..09dc67f9e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -@@ -55,7 +55,12 @@ public class Team extends DefinedPacket +@@ -55,12 +55,22 @@ public class Team extends DefinedPacket suffix = readString( buf ); } friendlyFire = buf.readByte(); @@ -763,16 +763,27 @@ index a5555f6af..7c21c9dd8 100644 if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) { collisionRule = readString( buf ); -@@ -69,7 +74,7 @@ public class Team extends DefinedPacket + } +- color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ++ { ++ color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); ++ } ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) + { + prefix = readString( buf ); +@@ -69,7 +79,7 @@ public class Team extends DefinedPacket } if ( mode == 0 || mode == 3 || mode == 4 ) { - int len = readVarInt( buf ); -+ int len = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt( buf ) : readVarShort( buf ); // FlameCord - 1.7.x support ++ int len = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt( buf ) : buf.readShort(); // FlameCord - 1.7.x support players = new String[ len ]; for ( int i = 0; i < len; i++ ) { -@@ -81,6 +86,30 @@ public class Team extends DefinedPacket +@@ -81,6 +91,30 @@ public class Team extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { From a6ec5d5f6f231f002594ddcb621b6f38fdfcfa01 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 1 Oct 2021 19:22:59 -0300 Subject: [PATCH 161/499] fix 1.7.x effects causing crashes --- .../0005-1.7.x-support.patch | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index b0f0d7cd..716f0586 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,4 +1,4 @@ -From b74598019073565159c2d9a1d93680916632e78b Mon Sep 17 00:00:00 2001 +From 908d4cf9fa68b614ef69fa1c79877816966d3863 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -488,6 +488,106 @@ index 53575ce0e..52d7a5cc8 100644 writeArray( sharedSecret, buf ); writeArray( verifyToken, buf ); } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +index d11a9ea9d..0ed78a8c4 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -21,20 +22,41 @@ public class EntityEffect extends DefinedPacket { + private boolean hideParticles; + + @Override +- public void read(ByteBuf buf) { +- this.entityId = readVarInt(buf); ++ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support + this.effectId = buf.readUnsignedByte(); + this.amplifier = buf.readUnsignedByte(); +- this.duration = readVarInt(buf); +- this.hideParticles = buf.readBoolean(); ++ this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ++ { ++ this.hideParticles = buf.readBoolean(); ++ } ++ // FlameCord end - 1.7.x support + } + + @Override +- public void write(ByteBuf buf) { +- writeVarInt(this.entityId, buf); ++ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.entityId, buf); ++ } else ++ { ++ buf.writeInt(effectId); ++ } ++ // FlameCord end - 1.7.x support + buf.writeByte(this.effectId); + buf.writeByte(this.amplifier); +- writeVarInt(this.duration, buf); ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.duration, buf); ++ } else ++ { ++ buf.writeShort(duration); ++ } ++ // FlameCord end - 1.7.x support + buf.writeBoolean(this.hideParticles); + } + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +index 7ed2dc3ab..435b85789 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -18,14 +19,22 @@ public class EntityRemoveEffect extends DefinedPacket { + private int effectId; + + @Override +- public void read(ByteBuf buf) { +- this.entityId = readVarInt(buf); ++ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support + this.effectId = buf.readUnsignedByte(); + } + + @Override +- public void write(ByteBuf buf) { +- writeVarInt(this.entityId, buf); ++ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.entityId, buf); ++ } else ++ { ++ buf.writeInt(entityId); ++ } ++ // FlameCord end - 1.7.x support + buf.writeByte(effectId); + } + diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java index b004bc416..a8c3e7736 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java From 3b32aa56fd32579e1e978a1346e02cd6c0aec648 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:43:13 -0300 Subject: [PATCH 162/499] Rename 0027-Always-release-packet.patch to 0027-Always-release-packets.patch --- ...ays-release-packet.patch => 0027-Always-release-packets.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Waterfall-Proxy-Patches/{0027-Always-release-packet.patch => 0027-Always-release-packets.patch} (100%) diff --git a/Waterfall-Proxy-Patches/0027-Always-release-packet.patch b/Waterfall-Proxy-Patches/0027-Always-release-packets.patch similarity index 100% rename from Waterfall-Proxy-Patches/0027-Always-release-packet.patch rename to Waterfall-Proxy-Patches/0027-Always-release-packets.patch From fdc5e527ec077a38f3554d312984249ecb035cc9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 00:06:05 -0300 Subject: [PATCH 163/499] checks improvements --- Waterfall-Proxy-Patches/0011-Packet-Checks.patch | 10 +++++++--- .../0026-FlameCord-logger-options.patch | 8 ++++---- .../0027-Always-release-packets.patch | 8 ++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch index d9195b44..e3ef7b3a 100644 --- a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch @@ -1,4 +1,4 @@ -From 32f56cb02f7336ed609e181e5bb582fa5a9d0d79 Mon Sep 17 00:00:00 2001 +From 295841ad76a439554074bfde7813de1a487d20a5 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks @@ -29,15 +29,19 @@ index 01d35f41a..ec07ae6fd 100644 Object packetTypeInfo = null; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index f8d6becd6..c0e4791f9 100644 +index f8d6becd6..336050075 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -78,6 +78,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -78,6 +78,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + // FlameCord - Return if channel isn't active + if (!ctx.channel().isActive()) { ++ if (msg instanceof PacketWrapper) { ++ ((PacketWrapper) msg).trySingleRelease(); ++ } ++ + return; + } + diff --git a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch index 89b4ac12..cbc9be4c 100644 --- a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 1e753a003c6e30aeb86d841d6076e7a1ddd6f755 Mon Sep 17 00:00:00 2001 +From ac00cd8c9705f60f9dfbf763241c1e1fd436574a Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -62,7 +62,7 @@ index 8f142f488..5fd105410 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 8d6f9d3ae..e5602230a 100644 +index 224146868..fbc19f66b 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -85,7 +85,7 @@ index 8d6f9d3ae..e5602230a 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -95,10 +97,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -99,10 +101,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); @@ -102,7 +102,7 @@ index 8d6f9d3ae..e5602230a 100644 channel.setRemoteAddress( newAddress ); } -@@ -143,6 +147,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -147,6 +151,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); diff --git a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch b/Waterfall-Proxy-Patches/0027-Always-release-packets.patch index b046de86..ba599b57 100644 --- a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0027-Always-release-packets.patch @@ -1,14 +1,14 @@ -From 99c527b3d3e388ca5584b0e01e8009e590fc41a5 Mon Sep 17 00:00:00 2001 +From 73145c83efc9cf45bc6fb0adfa0903f3c2d5b144 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packet diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index e5602230a..085cda114 100644 +index fbc19f66b..a2bd24107 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -113,12 +113,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -117,12 +117,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter return; } @@ -27,7 +27,7 @@ index e5602230a..085cda114 100644 if ( sendPacket && packet.packet != null ) { try -@@ -133,10 +135,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -137,10 +139,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { handler.handle( packet ); } From a93cfc82f12bbcd0955baf2830206e62aa9bef5c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:52:01 -0300 Subject: [PATCH 164/499] rename patch #27 --- Waterfall-Proxy-Patches/0027-Always-release-packets.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch b/Waterfall-Proxy-Patches/0027-Always-release-packets.patch index ba599b57..e08ef5ef 100644 --- a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0027-Always-release-packets.patch @@ -1,7 +1,7 @@ -From 73145c83efc9cf45bc6fb0adfa0903f3c2d5b144 Mon Sep 17 00:00:00 2001 +From 5f8c739acdbcaf1e2e38fab2541c1d4e3a4c2638 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 -Subject: [PATCH] Always release packet +Subject: [PATCH] Always release packets diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java From e9f2e690361fce29636afddcf35bd475b82b54f9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:52:29 -0300 Subject: [PATCH 165/499] firewall throttled connections --- Waterfall-Proxy-Patches/0025-Firewall-System.patch | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0025-Firewall-System.patch b/Waterfall-Proxy-Patches/0025-Firewall-System.patch index 7658aeb3..8be3723e 100644 --- a/Waterfall-Proxy-Patches/0025-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0025-Firewall-System.patch @@ -1,4 +1,4 @@ -From dee5fc50a694b5251e2f6e2e6f25ce1cefb0ec65 Mon Sep 17 00:00:00 2001 +From 6e800ce464c39da6b513e08f7227b380a161f80a Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -303,7 +303,7 @@ index bf6f85386..fa0b59c27 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 1e01dea51..5e1cca9ae 100644 +index 7bc9b1b47..b4f9e3a7d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -166,6 +166,9 @@ public class ServerConnector extends PacketHandler @@ -379,7 +379,7 @@ index 3503c089d..283b3134f 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 285433467..8d6f9d3ae 100644 +index 89a6d14a9..224146868 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -391,10 +391,10 @@ index 285433467..8d6f9d3ae 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; 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 a840bc700..4e23c996e 100644 +index a840bc700..f7455a7ee 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 -@@ -63,6 +63,13 @@ public class PipelineUtils +@@ -63,8 +63,16 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); @@ -407,7 +407,10 @@ index a840bc700..4e23c996e 100644 + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) { ++ FlameCord.getInstance().getFirewallManager().addFirewalled( remoteAddress ); // FlameCord - Firewall throttled connections ch.close(); + return; + } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index b3bdfd05e..49d53f177 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java From 4ad51381e7067a383d6be853f58941d1090e079e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:52:39 -0300 Subject: [PATCH 166/499] custom motd system --- .../0030-Custom-motd-system.patch | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0030-Custom-motd-system.patch diff --git a/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch new file mode 100644 index 00000000..f5cce928 --- /dev/null +++ b/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch @@ -0,0 +1,72 @@ +From 34b303a44be51266612eb4e68bef0c157449cea5 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 7 Oct 2021 21:37:24 -0300 +Subject: [PATCH] Custom motd system + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index aafd99d8c..c005e6864 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -6,12 +6,33 @@ import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; + import java.util.HashSet; ++import java.util.List; ++import java.util.Random; + + import lombok.Getter; ++import net.md_5.bungee.api.ChatColor; + import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ private List colors(final List strings) { ++ for (int i = 0; i < strings.size(); i++) { ++ strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); ++ } ++ ++ return strings; ++ } ++ ++ @Getter ++ private boolean customMotdEnabled = false; ++ private List customMotdMotds = Arrays.asList(new String[] { "&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!" }); ++ ++ public String getRandomMotd() { ++ final Random random = new Random(); ++ ++ return customMotdMotds.get(random.nextInt(customMotdMotds.size())); ++ } ++ + @Getter + private boolean loggerInitialhandler = false; + @Getter +@@ -44,6 +65,9 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); ++ this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); ++ + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); +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 5fd105410..c51aeb445 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 +@@ -254,7 +254,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); +- final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); ++ // FlameCord - Custom motd ++ final String listenerMotd = FlameCord.getInstance().getFlameCordConfiguration().isCustomMotdEnabled() ? FlameCord.getInstance().getFlameCordConfiguration().getRandomMotd() : listener.getMotd(); ++ final String motd = ( forced != null ) ? forced.getMotd() : listenerMotd; + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); + + Callback pingBack = new Callback() +-- +2.32.0.windows.1 + From 0dee7966df72e524fc634a60320138a85c5dc991 Mon Sep 17 00:00:00 2001 From: 4drian3d Date: Sun, 10 Oct 2021 23:29:24 -0500 Subject: [PATCH 167/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0005-1.7.x-support.patch | 94 +++++++++---------- .../0023-Fix-ByteBuf-memory-leaks.patch | 10 +- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Waterfall b/Waterfall index 9d1a910f..85c0a35f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9d1a910f972e278a1396f0a1a0c505485ec6f5f7 +Subproject commit 85c0a35f0b40a12ff0d7a35c6ea31287eecab707 diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index 716f0586..0a1fcf46 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,11 +1,11 @@ -From 908d4cf9fa68b614ef69fa1c79877816966d3863 Mon Sep 17 00:00:00 2001 +From c3083e66928221721e457f93e1fcf9db40a7e4e9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index a310844dc..d07b88b85 100644 +index a310844d..d07b88b8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -303,4 +303,36 @@ public abstract class DefinedPacket @@ -46,7 +46,7 @@ index a310844dc..d07b88b85 100644 + // FlameCord end - 1.7.x support } 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 -index e95431a0f..ec6181ee7 100644 +index 7f0b71c9..04851233 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -58,7 +58,7 @@ public enum Protocol @@ -190,7 +190,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -262,7 +262,7 @@ public enum Protocol +@@ -265,7 +265,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -276,7 +276,7 @@ public enum Protocol +@@ -280,7 +280,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -314,7 +314,7 @@ public enum Protocol +@@ -318,7 +318,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -326,7 +326,7 @@ public enum Protocol +@@ -330,7 +330,7 @@ public enum Protocol TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -335,7 +335,7 @@ public enum Protocol +@@ -339,7 +339,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -345,7 +345,7 @@ public enum Protocol +@@ -349,7 +349,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -354,7 +354,7 @@ public enum Protocol +@@ -358,7 +358,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index e95431a0f..ec6181ee7 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -372,23 +372,23 @@ public enum Protocol +@@ -376,23 +376,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index e95431a0f..ec6181ee7 100644 ); } }, -@@ -400,22 +400,22 @@ public enum Protocol +@@ -404,22 +404,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index e95431a0f..ec6181ee7 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -426,12 +426,12 @@ public enum Protocol +@@ -430,12 +430,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -324,7 +324,7 @@ index e95431a0f..ec6181ee7 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index caf7ed0b6..787b93740 100644 +index bb37ba04..beb25715 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index caf7ed0b6..787b93740 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -42,6 +46,7 @@ public class ProtocolConstants +@@ -43,6 +47,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,7 +346,7 @@ index caf7ed0b6..787b93740 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -54,6 +59,10 @@ public class ProtocolConstants +@@ -55,6 +60,10 @@ public class ProtocolConstants "1.17.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( @@ -358,7 +358,7 @@ index caf7ed0b6..787b93740 100644 ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index 6034fc180..6100687cb 100644 +index 6034fc18..6100687c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -41,6 +41,7 @@ public class Chat extends DefinedPacket @@ -378,7 +378,7 @@ index 6034fc180..6100687cb 100644 { buf.writeByte( position ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 29440533f..8d00c3897 100644 +index 29440533..8d00c389 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -33,6 +33,12 @@ public class ClientSettings extends DefinedPacket @@ -415,7 +415,7 @@ index 29440533f..8d00c3897 100644 buf.writeByte( viewDistance ); if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca8..86182cdd3 100644 +index a29524ca..86182cdd 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java @@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket @@ -453,7 +453,7 @@ index a29524ca8..86182cdd3 100644 writeArray( publicKey, buf ); writeArray( verifyToken, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 53575ce0e..52d7a5cc8 100644 +index 53575ce0..52d7a5cc 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket @@ -489,7 +489,7 @@ index 53575ce0e..52d7a5cc8 100644 writeArray( verifyToken, buf ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9d..0ed78a8c4 100644 +index d11a9ea9..0ed78a8c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -550,7 +550,7 @@ index d11a9ea9d..0ed78a8c4 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3ab..435b85789 100644 +index 7ed2dc3a..435b8578 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -589,7 +589,7 @@ index 7ed2dc3ab..435b85789 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc416..a8c3e7736 100644 +index b004bc41..a8c3e773 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java @@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket @@ -622,7 +622,7 @@ index b004bc416..a8c3e7736 100644 { buf.writeLong( randomId ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 551bd1046..5aeae06c3 100644 +index 551bd104..5aeae06c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java @@ -23,6 +23,11 @@ public class LoginSuccess extends DefinedPacket @@ -665,7 +665,7 @@ index 551bd1046..5aeae06c3 100644 + // FlameCord end - 1.7.x support } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 92bacc7cd..cae5bda5c 100644 +index 92bacc7c..cae5bda5 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java @@ -21,6 +21,18 @@ public class PlayerListItem extends DefinedPacket @@ -706,7 +706,7 @@ index 92bacc7cd..cae5bda5c 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index c652ffb4f..90aaee0a9 100644 +index c652ffb4..90aaee0a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -82,6 +82,15 @@ public class PluginMessage extends DefinedPacket @@ -742,7 +742,7 @@ index c652ffb4f..90aaee0a9 100644 buf.writeBytes( data ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d54..75b371e9c 100644 +index 3c7905d5..75b371e9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket @@ -780,7 +780,7 @@ index 3c7905d54..75b371e9c 100644 buf.writeByte( action ); if ( action == 0 || action == 2 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86b..a812441d9 100644 +index 0b27fc86..a812441d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java @@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket @@ -826,7 +826,7 @@ index 0b27fc86b..a812441d9 100644 buf.writeByte( action ); writeString( scoreName, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 80e4f85af..cab28b999 100644 +index 80e4f85a..cab28b99 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java @@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket @@ -846,7 +846,7 @@ index 80e4f85af..cab28b999 100644 { if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..09dc67f9e 100644 +index a5555f6a..09dc67f9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java @@ -55,12 +55,22 @@ public class Team extends DefinedPacket @@ -915,7 +915,7 @@ index a5555f6af..09dc67f9e 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 136da2a8e..b3f77bcab 100644 +index 136da2a8..b3f77bca 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -934,7 +934,7 @@ index 136da2a8e..b3f77bcab 100644 private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 1d377a655..0ea5f90b4 100644 +index 1d377a65..0ea5f90b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java @@ -183,6 +183,7 @@ public class BungeeTitle implements Title @@ -946,7 +946,7 @@ index 1d377a655..0ea5f90b4 100644 sendPacket( player, reset ); sendPacket( player, times ); diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a16..6cd8ec3b4 100644 +index 491cf1a1..6cd8ec3b 100644 --- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java @@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; @@ -1000,7 +1000,7 @@ index 491cf1a16..6cd8ec3b4 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a5efb0af2..2bdd03b3f 100644 +index 134d4356..0d044231 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -1061,7 +1061,7 @@ index a5efb0af2..2bdd03b3f 100644 throw CancelSendSignal.INSTANCE; } 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 fc98b4b19..b50036b44 100644 +index fc98b4b1..b50036b4 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -197,6 +197,7 @@ public final class UserConnection implements ProxiedPlayer @@ -1106,7 +1106,7 @@ index fc98b4b19..b50036b44 100644 { this.compressionThreshold = compressionThreshold; 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 -index 9e180c30c..df618972f 100644 +index d3650ff8..b10d5b0a 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; @@ -1135,7 +1135,7 @@ index 9e180c30c..df618972f 100644 } break; default: -@@ -286,19 +287,28 @@ public class DownstreamBridge extends PacketHandler +@@ -287,19 +288,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1178,7 +1178,7 @@ index 9e180c30c..df618972f 100644 if ( pluginMessage.getTag().equals( "BungeeCord" ) ) 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 0fd58e83a..7a403a1ab 100644 +index 0fd58e83..7a403a1a 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1218,7 +1218,7 @@ index 0fd58e83a..7a403a1ab 100644 { bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd9..a409d440b 100644 +index 6df3f3dd..a409d440 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; @@ -1239,7 +1239,7 @@ index 6df3f3dd9..a409d440b 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 c769976f3..c34629136 100644 +index c769976f..c3462913 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 @@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler @@ -1257,7 +1257,7 @@ index c769976f3..c34629136 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 09df5a93a..22ca9c967 100644 +index 99ad8b9c..a70405dc 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,12 @@ public abstract class EntityMap @@ -1275,7 +1275,7 @@ index 09df5a93a..22ca9c967 100644 case ProtocolConstants.MINECRAFT_1_9: diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java new file mode 100644 -index 000000000..cdc07dc45 +index 00000000..cdc07dc4 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java @@ -0,0 +1,102 @@ @@ -1384,7 +1384,7 @@ index 000000000..cdc07dc45 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java new file mode 100644 -index 000000000..5ce42f628 +index 00000000..5ce42f62 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -0,0 +1,62 @@ @@ -1452,7 +1452,7 @@ index 000000000..5ce42f628 +// FlameCord end - 1.7.x support \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff9..caed43849 100644 +index bea2bbff..caed4384 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -8,6 +8,7 @@ import lombok.Getter; @@ -1499,7 +1499,7 @@ index bea2bbff9..caed43849 100644 + // FlameCord end - 1.7.x support } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8a..85bc21b9f 100644 +index 5e02f8c8..85bc21b9 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java @@ -3,6 +3,7 @@ package net.md_5.bungee.forge; @@ -1534,7 +1534,7 @@ index 5e02f8c8a..85bc21b9f 100644 return WAITINGSERVERDATA; diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index daf12f74e..7d0534857 100644 +index daf12f74..7d053485 100644 --- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java @@ -4,12 +4,14 @@ import java.util.Collection; @@ -1631,5 +1631,5 @@ index daf12f74e..7d0534857 100644 @Override -- -2.32.0.windows.1 +2.33.0.windows.2 diff --git a/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch index c6b1d56d..f49c0a2d 100644 --- a/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 9cd696425b856f9f75a7b012245bde185bba08a5 Mon Sep 17 00:00:00 2001 +From 09a2ffeb9e770078c9b024016fc708c6a04a371e Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 22ca9c967..99928eb20 100644 +index a70405dc..33b72eb0 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -148,11 +148,15 @@ public abstract class EntityMap +@@ -150,11 +150,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -30,7 +30,7 @@ index 22ca9c967..99928eb20 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206e..8d4439ab8 100644 +index cefa0206..8d4439ab 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -38,16 +38,22 @@ public class ForgeUtils @@ -64,5 +64,5 @@ index cefa0206e..8d4439ab8 100644 } -- -2.32.0.windows.1 +2.33.0.windows.2 From 37b4a811484440c3acfc0cc3e652de97c46ccce8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:43:04 -0300 Subject: [PATCH 168/499] version 0.6.4 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 418d0d4b..71c02bde 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 4c7e0fdc..3e7bd97b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.3"; ++ return "0.6.4"; } public void reloadMessages() From c8ba01838bed120831e42ff38c8a3882a2feec05 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 31 Oct 2021 11:16:33 -0300 Subject: [PATCH 169/499] Update and rename 0012-Default-timeout-to-10000.patch to 0012-Change-default-timeout.patch --- ...meout-to-10000.patch => 0012-Change-default-timeout.patch} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename Waterfall-Proxy-Patches/{0012-Default-timeout-to-10000.patch => 0012-Change-default-timeout.patch} (91%) diff --git a/Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch similarity index 91% rename from Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch rename to Waterfall-Proxy-Patches/0012-Change-default-timeout.patch index c4ed776a..d18782d8 100644 --- a/Waterfall-Proxy-Patches/0012-Default-timeout-to-10000.patch +++ b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch @@ -1,7 +1,7 @@ From 245d1262bdf112f20eba342196f07bd5036c62ea Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 -Subject: [PATCH] Default timeout to 10000 +Subject: [PATCH] Change default timeout diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -14,7 +14,7 @@ index 85d2197ac..c41930ae7 100644 */ - private int timeout = 30000; + // FlameCord - Modify default timeout -+ private int timeout = 10000; ++ private int timeout = 17000; /** * UUID used for metrics. */ From 4d00d540c8a16963e040a905ebc7f1e3e92fa87e Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Sat, 30 Oct 2021 15:03:40 +0200 Subject: [PATCH 170/499] Minor improvements Removed unused translations, moved command-imports to the modules-patch, registered alertraw command --- .../0020-FlameCord-General-Patch.patch | 48 +++++++------------ .../0021-FlameCord-module-system.patch | 36 ++++++++++---- ...0022-FlameCord-message-configuration.patch | 18 ++++--- .../0025-Firewall-System.patch | 30 ++++++------ 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch index e2c4b3a5..58fa83d5 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 22e56507775a8d2f89d7602977f80a584678b99f Mon Sep 17 00:00:00 2001 +From 624c0d36a8479146327e29383fe1d1b2fbbba34f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 000000000..252612a31 +index 00000000..252612a3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,34 @@ @@ -47,7 +47,7 @@ index 000000000..252612a31 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..81ded2243 +index 00000000..81ded224 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,64 @@ @@ -116,7 +116,7 @@ index 000000000..81ded2243 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec07ae6fd..91da8ab65 100644 +index ec07ae6f..91da8ab6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -128,7 +128,7 @@ index ec07ae6fd..91da8ab65 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 000000000..a323598eb +index 00000000..a323598e --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -191,33 +191,19 @@ index 000000000..a323598eb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b3f77bcab..2a702d141 100644 +index b914b5c2..719e73e4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -9,6 +9,9 @@ import com.google.common.collect.Sets; +@@ -9,6 +9,8 @@ import com.google.common.collect.Sets; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.gson.Gson; import com.google.gson.GsonBuilder; + +import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.commands.FlameCordCommand; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -86,6 +89,12 @@ import net.md_5.bungee.conf.Configuration; - import net.md_5.bungee.conf.YamlConfig; - import net.md_5.bungee.forge.ForgeConstants; - import net.md_5.bungee.module.ModuleManager; -+import net.md_5.bungee.module.cmd.alert.CommandAlert; -+import net.md_5.bungee.module.cmd.find.CommandFind; -+import net.md_5.bungee.module.cmd.list.CommandList; -+import net.md_5.bungee.module.cmd.send.CommandSend; -+import net.md_5.bungee.module.cmd.server.CommandServer; -+import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; - import net.md_5.bungee.netty.PipelineUtils; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.ProtocolConstants; -@@ -233,11 +242,12 @@ public class BungeeCord extends ProxyServer +@@ -233,11 +235,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -235,7 +221,7 @@ index b3f77bcab..2a702d141 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -286,6 +296,15 @@ public class BungeeCord extends ProxyServer +@@ -286,6 +289,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -251,7 +237,7 @@ index b3f77bcab..2a702d141 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -577,9 +596,7 @@ public class BungeeCord extends ProxyServer +@@ -577,9 +589,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -263,7 +249,7 @@ index b3f77bcab..2a702d141 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index b25cede0e..1e01dea51 100644 +index 191ca1a6..3b1e4adc 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -1,6 +1,8 @@ @@ -285,7 +271,7 @@ index b25cede0e..1e01dea51 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 6232f1ec0..bd5ce6a2e 100644 +index c87f8a61..70778443 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -36,6 +36,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -319,7 +305,7 @@ index 6232f1ec0..bd5ce6a2e 100644 b.connect().addListener( listener ); } 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 72e0098dc..447940111 100644 +index 72e0098d..44794011 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 @@ -17,6 +17,8 @@ import java.util.logging.Level; @@ -341,7 +327,7 @@ index 72e0098dc..447940111 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index a409d440b..3503c089d 100644 +index a409d440..3503c089 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -353,7 +339,7 @@ index a409d440b..3503c089d 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index c0e4791f9..285433467 100644 +index 33605007..89a6d14a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -366,7 +352,7 @@ index c0e4791f9..285433467 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 654203abb..a840bc700 100644 +index 654203ab..a840bc70 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,8 @@ @@ -379,5 +365,5 @@ index 654203abb..a840bc700 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.32.0.windows.1 +2.33.0.windows.2 diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch index cf61e484..23d8436b 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 5515f767e5231b29a0f30d7754f3fee84a6f5e97 Mon Sep 17 00:00:00 2001 +From b7dab4ca2f05f09e2e48856bdf5c402d00bd06ea Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 252612a31..2e317533e 100644 +index 252612a3..2e317533 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -35,7 +35,7 @@ index 252612a31..2e317533e 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 000000000..e82c4844b +index 00000000..e82c4844 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,94 @@ @@ -134,18 +134,33 @@ index 000000000..e82c4844b + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2a702d141..e9061e6a8 100644 +index 719e73e4..536c6052 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -12,6 +12,7 @@ import com.google.gson.GsonBuilder; +@@ -11,6 +11,8 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; import dev._2lstudios.flamecord.FlameCord; - import dev._2lstudios.flamecord.commands.FlameCordCommand; ++import dev._2lstudios.flamecord.commands.FlameCordCommand; +import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -286,9 +287,10 @@ public class BungeeCord extends ProxyServer +@@ -88,6 +90,13 @@ import net.md_5.bungee.conf.Configuration; + import net.md_5.bungee.conf.YamlConfig; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.module.ModuleManager; ++import net.md_5.bungee.module.cmd.alert.CommandAlert; ++import net.md_5.bungee.module.cmd.alert.CommandAlertRaw; ++import net.md_5.bungee.module.cmd.find.CommandFind; ++import net.md_5.bungee.module.cmd.list.CommandList; ++import net.md_5.bungee.module.cmd.send.CommandSend; ++import net.md_5.bungee.module.cmd.server.CommandServer; ++import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; + import net.md_5.bungee.netty.PipelineUtils; + import net.md_5.bungee.protocol.DefinedPacket; + import net.md_5.bungee.protocol.ProtocolConstants; +@@ -279,9 +288,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -158,7 +173,7 @@ index 2a702d141..e9061e6a8 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -321,6 +323,7 @@ public class BungeeCord extends ProxyServer +@@ -314,6 +324,7 @@ public class BungeeCord extends ProxyServer connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); } startListeners(); @@ -166,7 +181,7 @@ index 2a702d141..e9061e6a8 100644 saveThread.scheduleAtFixedRate( new TimerTask() { -@@ -838,4 +841,52 @@ public class BungeeCord extends ProxyServer +@@ -831,4 +842,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -192,6 +207,7 @@ index 2a702d141..e9061e6a8 100644 + // Modules Commands + if (modulesConfiguration.alertEnabled) { + pluginManager.registerCommand(null, new CommandAlert()); ++ pluginManager.registerCommand(null, new CommandAlertRaw()); + } + if (modulesConfiguration.findEnabled) { + pluginManager.registerCommand(null, new CommandFind()); @@ -220,5 +236,5 @@ index 2a702d141..e9061e6a8 100644 + } } -- -2.32.0.windows.1 +2.33.0.windows.2 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch index 7017613c..a4ff044d 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From 6030c4824ddd3b9a496b3ad1dd7acb05799158df Mon Sep 17 00:00:00 2001 +From 30cf3c288a1222d0bc674b91fb9c4aac98734dd6 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 2e317533e..8957c79ac 100644 +index 2e317533..8957c79a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -35,10 +35,10 @@ index 2e317533e..8957c79ac 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 000000000..028b6d4cf +index 00000000..a32522fe --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,123 @@ +@@ -0,0 +1,121 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -96,7 +96,6 @@ index 000000000..028b6d4cf + setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); + setIfUnexistant("proxy_full", "Server is full!", configuration); + setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_kick", "[Kicked] ", configuration); + setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); + setIfUnexistant("server_went_down", + "&cThe server you were previously on went down, you have been connected to a fallback server", @@ -117,7 +116,6 @@ index 000000000..028b6d4cf + setIfUnexistant("send_cmd_usage", + "&cNot enough arguments, usage: /send ", configuration); + setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("successfully_summoned", "&aSuccessfully summoned player(s)", configuration); + setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); + setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); + setIfUnexistant("command_perms_permission", "&9- {0}", configuration); @@ -164,7 +162,7 @@ index 000000000..028b6d4cf +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index a323598eb..bf6f85386 100644 +index a323598e..bf6f8538 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -211,10 +209,10 @@ index a323598eb..bf6f85386 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e9061e6a8..e3604c0f6 100644 +index 536c6052..2327e5e3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -596,14 +596,8 @@ public class BungeeCord extends ProxyServer +@@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { @@ -232,5 +230,5 @@ index e9061e6a8..e3604c0f6 100644 @Override -- -2.32.0.windows.1 +2.33.0.windows.2 diff --git a/Waterfall-Proxy-Patches/0025-Firewall-System.patch b/Waterfall-Proxy-Patches/0025-Firewall-System.patch index 8be3723e..be60c1a7 100644 --- a/Waterfall-Proxy-Patches/0025-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0025-Firewall-System.patch @@ -1,11 +1,11 @@ -From 6e800ce464c39da6b513e08f7227b380a161f80a Mon Sep 17 00:00:00 2001 +From 4448ba222341e511e7b2add8e6c10c315d3d6a73 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79ac..fd889644f 100644 +index 8957c79a..fd889644 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -6,6 +6,7 @@ import java.util.logging.Logger; @@ -64,7 +64,7 @@ index 8957c79ac..fd889644f 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded2243..8bb61ac11 100644 +index 81ded224..8bb61ac1 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -96,10 +96,10 @@ index 81ded2243..8bb61ac11 100644 configurationProvider.save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 028b6d4cf..560446318 100644 +index a32522fe..72d48d66 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -84,9 +84,17 @@ public class MessagesConfiguration { +@@ -82,9 +82,17 @@ public class MessagesConfiguration { setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); // FlameCord @@ -120,7 +120,7 @@ index 028b6d4cf..560446318 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java new file mode 100644 -index 000000000..dfb5c6d30 +index 00000000..dfb5c6d3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java @@ -0,0 +1,120 @@ @@ -246,7 +246,7 @@ index 000000000..dfb5c6d30 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index c03e1b513..7f4b5b45a 100644 +index c03e1b51..7f4b5b45 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -275,7 +275,7 @@ index c03e1b513..7f4b5b45a 100644 } finally { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index bf6f85386..fa0b59c27 100644 +index bf6f8538..fa0b59c2 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -5,6 +5,7 @@ import java.util.HashSet; @@ -303,7 +303,7 @@ index bf6f85386..fa0b59c27 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7bc9b1b47..b4f9e3a7d 100644 +index 3b1e4adc..ab9d3ca8 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -166,6 +166,9 @@ public class ServerConnector extends PacketHandler @@ -317,7 +317,7 @@ index 7bc9b1b47..b4f9e3a7d 100644 } } 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 447940111..8f142f488 100644 +index 44794011..8f142f48 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 @@ -156,6 +156,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -357,7 +357,7 @@ index 447940111..8f142f488 100644 int limit = BungeeCord.getInstance().config.getPlayerLimit(); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 3503c089d..283b3134f 100644 +index 3503c089..283b3134 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -2,6 +2,7 @@ package net.md_5.bungee.connection; @@ -379,7 +379,7 @@ index 3503c089d..283b3134f 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 89a6d14a9..224146868 100644 +index 89a6d14a..22414686 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -391,7 +391,7 @@ index 89a6d14a9..224146868 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; 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 a840bc700..f7455a7ee 100644 +index a840bc70..f7455a7e 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 @@ -63,8 +63,16 @@ public class PipelineUtils @@ -412,7 +412,7 @@ index a840bc700..f7455a7ee 100644 return; } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b3bdfd05e..49d53f177 100644 +index b3bdfd05..49d53f17 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -2,6 +2,8 @@ package net.md_5.bungee.query; @@ -445,5 +445,5 @@ index b3bdfd05e..49d53f177 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.32.0.windows.1 +2.33.0.windows.2 From 99274ac2dd65073968a0582b4899773460c69472 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 30 Nov 2021 11:50:10 -0300 Subject: [PATCH 171/499] 1.18 update --- Waterfall | 2 +- .../0001-POM-Changes.patch | 276 +++++++----------- .../0002-FlameCord-POM-Changes.patch | 20 +- .../0004-FlameCord-rebrand.patch | 10 +- .../0005-1.7.x-support.patch | 58 ++-- ...ake-PlayerHandshakeEvent-cancellable.patch | 8 +- .../0009-Change-replaceAll-to-replace.patch | 6 +- ...ections-Don-t-flush-if-not-necessary.patch | 18 +- ...o-encrypt-only-if-onlineMode-is-true.patch | 6 +- ...tom-uuids-even-if-onlineMode-is-true.patch | 6 +- ...y-to-avoid-multiple-incoming-packets.patch | 8 +- ...ateException-to-QuietException-and-e.patch | 6 +- ...-Don-t-declare-uuid-unless-it-s-null.patch | 6 +- .../0020-FlameCord-General-Patch.patch | 22 +- .../0025-Firewall-System.patch | 16 +- .../0026-FlameCord-logger-options.patch | 12 +- .../0030-Custom-motd-system.patch | 8 +- 17 files changed, 215 insertions(+), 273 deletions(-) diff --git a/Waterfall b/Waterfall index 85c0a35f..0fb2c920 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 85c0a35f0b40a12ff0d7a35c6ea31287eecab707 +Subproject commit 0fb2c92016bef352763958fb5c56056e6ea2b8ee diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index e001bbc8..91cda163 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From accb1c7028ac8f8eebbd8116d350d93cc0da1215 Mon Sep 17 00:00:00 2001 +From b5f7d605923205d2127b60c04a34f76db4259d55 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes diff --git a/api/pom.xml b/api/pom.xml -index 87c17046..f85369c5 100644 +index 9b29dfca..bfb96040 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,41 +5,41 @@ @@ -14,14 +14,14 @@ index 87c17046..f85369c5 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-api + flamecord-api - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-API @@ -58,33 +58,31 @@ index 87c17046..f85369c5 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 7a9e8258..c302b3b1 100644 +index 00ce099c..5b0c348f 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-bootstrap + flamecord-bootstrap - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Bootstrap -- Java 1.6 loader for Waterfall + FlameCord-Bootstrap -+ Java 1.6 loader for FlameCord + Java 1.6 loader for Waterfall - true -@@ -30,14 +30,14 @@ +@@ -30,7 +30,7 @@ io.github.waterfallmc @@ -93,70 +91,58 @@ index 7a9e8258..c302b3b1 100644 ${project.version} compile - - - -- Waterfall -+ FlameCord - - - org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml -index cfa0e16e..8179e4ae 100644 +index 0ad5dd16..48c0029f 100644 --- a/chat/pom.xml +++ b/chat/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-chat + flamecord-chat - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Chat -- Minecraft JSON chat API intended for use with Waterfall + FlameCord-Chat -+ Minecraft JSON chat API intended for use with FlameCord + Minecraft JSON chat API intended for use with Waterfall - diff --git a/config/pom.xml b/config/pom.xml -index 6c122954..7edb1ba5 100644 +index 2caffc27..5a7c9993 100644 --- a/config/pom.xml +++ b/config/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-config + flamecord-config - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Config -- Generic java configuration API intended for use with Waterfall + FlameCord-Config -+ Generic java configuration API intended for use with FlameCord + Generic java configuration API intended for use with Waterfall - diff --git a/event/pom.xml b/event/pom.xml -index 563783e9..52154fd0 100644 +index e2432463..ade69b60 100644 --- a/event/pom.xml +++ b/event/pom.xml @@ -5,16 +5,16 @@ @@ -165,48 +151,45 @@ index 563783e9..52154fd0 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-event + flamecord-event - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Event -- Generic java event dispatching API intended for use with Waterfall. + FlameCord-Event -+ Generic java event dispatching API intended for use with FlameCord. + Generic java event dispatching API intended for use with Waterfall. diff --git a/log/pom.xml b/log/pom.xml -index 3663d6d9..e3995bdd 100644 +index 465ebbf2..acf53b43 100644 --- a/log/pom.xml +++ b/log/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log + flamecord-log - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Log -- Simplistic and performant java.util.Logger based logger and console API designed for use with Waterfall and Minecraft related applications. + FlameCord-Log -+ Simplistic and performant java.util.Logger based logger and console API designed for use with FlameCord and Minecraft related applications. + Simplistic and performant java.util.Logger based logger and console API designed for use with Waterfall and Minecraft related applications. - @@ -27,7 +27,7 @@ @@ -217,59 +200,32 @@ index 3663d6d9..e3995bdd 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 7ec6e530..78d92f27 100644 +index 34740637..09fb31d5 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml -@@ -4,18 +4,18 @@ +@@ -4,17 +4,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-log4j + flamecord-log4j - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Log -- Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. + FlameCord-Log -+ Simplistic and performant Log4j2 based logger and console API designed for use with FlameCord and Minecraft related applications. + Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. - 2.14.0 -@@ -50,5 +50,24 @@ - 3.4.2 - runtime - -+ -+ -+ net.minecrell -+ terminalconsoleappender -+ 1.0.0 -+ -+ -+ net.java.dev.jna -+ jna -+ 4.4.0 -+ runtime -+ -+ -+ -+ io.github.waterfallmc -+ flamecord-chat -+ ${project.version} -+ compile -+ - - diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index 11e990d9..1bfcf47e 100644 +index b41791f1..6b53066f 100644 --- a/module/cmd-alert/pom.xml +++ b/module/cmd-alert/pom.xml @@ -5,13 +5,13 @@ @@ -278,18 +234,18 @@ index 11e990d9..1bfcf47e 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-alert + flamecord-module-cmd-alert - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index b732d67f..5f57af9e 100644 +index a17080ab..b8d562cf 100644 --- a/module/cmd-find/pom.xml +++ b/module/cmd-find/pom.xml @@ -5,13 +5,13 @@ @@ -298,18 +254,18 @@ index b732d67f..5f57af9e 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-find + flamecord-module-cmd-find - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index d17cb787..45656595 100644 +index 16003086..f7cebd89 100644 --- a/module/cmd-list/pom.xml +++ b/module/cmd-list/pom.xml @@ -5,13 +5,13 @@ @@ -318,18 +274,18 @@ index d17cb787..45656595 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-list + flamecord-module-cmd-list - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index d1972708..b3bf39c8 100644 +index ba084281..62e7d4f4 100644 --- a/module/cmd-send/pom.xml +++ b/module/cmd-send/pom.xml @@ -5,13 +5,13 @@ @@ -338,18 +294,18 @@ index d1972708..b3bf39c8 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-send + flamecord-module-cmd-send - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index 3b2c4952..b66c2cff 100644 +index cb4d2932..5c6253ac 100644 --- a/module/cmd-server/pom.xml +++ b/module/cmd-server/pom.xml @@ -5,13 +5,13 @@ @@ -358,43 +314,36 @@ index 3b2c4952..b66c2cff 100644 io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module-cmd-server + flamecord-module-cmd-server - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar diff --git a/module/pom.xml b/module/pom.xml -index 0ef98d58..c6668ffc 100644 +index 350a49b8..415de113 100644 --- a/module/pom.xml +++ b/module/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,13 +5,13 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT pom -- Waterfall Modules -- Parent project for all Waterfall modules. -+ FlameCord Modules -+ Parent project for all FlameCord modules. - - - cmd-alert @@ -36,7 +36,7 @@ @@ -405,57 +354,48 @@ index 0ef98d58..c6668ffc 100644 compile diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index b88398cf..621bf1c2 100644 +index d3476fc5..ee786715 100644 --- a/module/reconnect-yaml/pom.xml +++ b/module/reconnect-yaml/pom.xml -@@ -5,13 +5,13 @@ +@@ -5,7 +5,7 @@ io.github.waterfallmc - waterfall-module + flamecord-module - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml - - io.github.waterfallmc -- waterfall-module-reconnect-yaml -+ flamecord-module-reconnect-yaml - 1.17-R0.1-SNAPSHOT - jar - diff --git a/native/pom.xml b/native/pom.xml -index 652a869d..b56fdc51 100644 +index 1eff2c93..58fc77b4 100644 --- a/native/pom.xml +++ b/native/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-native + flamecord-native - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Native -- Optional native code to speed up and enhance Waterfall functionality. + FlameCord-Native -+ Optional native code to speed up and enhance FlameCord functionality. + Optional native code to speed up and enhance Waterfall functionality. - diff --git a/pom.xml b/pom.xml -index fd71cdbd..26e85fb8 100644 +index 94fad2cc..db494b4c 100644 --- a/pom.xml +++ b/pom.xml -@@ -5,19 +5,19 @@ +@@ -5,23 +5,23 @@ io.github.waterfallmc @@ -468,7 +408,7 @@ index fd71cdbd..26e85fb8 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT pom - Waterfall-Parent @@ -476,56 +416,81 @@ index fd71cdbd..26e85fb8 100644 - https://github.com/WaterfallMC/Waterfall + FlameCord-Parent + Parent project for all FlameCord modules. -+ https://github.com/2lstudios-mc/FlameCord ++ https://github.com/2LStudios-MC/FlameCord 2015 - WaterfallMC -@@ -66,13 +66,13 @@ +- WaterfallMC +- https://github.com/WaterfallMC ++ 2LStudios ++ https://github.com/2LStudios-MC + + + +@@ -47,6 +47,9 @@ + + fuzzybot + ++ ++ LinsaFTW ++ + + + +@@ -66,13 +69,13 @@ - scm:git:git@github.com:com:WaterfallMC/Waterfall.git - scm:git:git@github.com:WaterfallMC/Waterfall.git - git@github.com:WaterfallMC/Waterfall.git -+ scm:git:git@github.com:com:2lstudios-mc/FlameCord.git -+ scm:git:git@github.com:2lstudios-mc/FlameCord.git -+ git@github.com:2lstudios-mc/FlameCord.git ++ scm:git:git@github.com:com:2LStudios-MC/FlameCord.git ++ scm:git:git@github.com:2LStudios-MC/FlameCord.git ++ git@github.com:2LStudios-MC/FlameCord.git GitHub - https://github.com/PaperMC/Waterfall/issues -+ https://github.com/2lstudios-mc/FlameCord/issues ++ https://github.com/2LStudios-MC/FlameCord/issues +@@ -412,8 +415,8 @@ + + false + +- Waterfall ${project.version} API +- Waterfall ${project.version} API ++ FlameCord ${project.version} API ++ FlameCord ${project.version} API + + api/target/generated-sources/delombok; + chat/target/generated-sources/delombok diff --git a/protocol/pom.xml b/protocol/pom.xml -index dbc0a3ab..433fbfe0 100644 +index c62e0175..27e4096d 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-protocol + flamecord-protocol - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Protocol -- Minimal implementation of the Minecraft protocol for use in Waterfall + FlameCord-Protocol -+ Minimal implementation of the Minecraft protocol for use in FlameCord + Minimal implementation of the Minecraft protocol for use in Waterfall - - -@@ -42,7 +42,7 @@ + +@@ -27,7 +27,7 @@ io.github.waterfallmc @@ -535,7 +500,7 @@ index dbc0a3ab..433fbfe0 100644 compile diff --git a/proxy/pom.xml b/proxy/pom.xml -index c3a2eeb6..7bfe7d6b 100644 +index 22c4f71b..171171c2 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -5,17 +5,17 @@ @@ -544,14 +509,14 @@ index c3a2eeb6..7bfe7d6b 100644 io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-proxy + flamecord-proxy - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Proxy @@ -596,46 +561,31 @@ index c3a2eeb6..7bfe7d6b 100644 ${project.version} compile -diff --git a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -index 338c30d3..2ba0ab64 100644 ---- a/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -+++ b/proxy/src/main/java/net/md_5/bungee/module/JenkinsModuleSource.java -@@ -20,7 +20,7 @@ public class JenkinsModuleSource implements ModuleSource - { - final String url = String.format( - "https://papermc.io/api/v2/projects/%1$s/versions/%2$s/builds/%3$s/downloads/%4$s-%2$s-%3$s.jar", -- "waterfall", -+ "flamecord", // FlameCord - net.md_5.bungee.api.ProxyServer.getInstance().getVersion().split(":")[2].split("-")[0], - version.getBuild(), - module.getName() diff --git a/query/pom.xml b/query/pom.xml -index dea7d85f..b4570001 100644 +index 081bff62..550a463e 100644 --- a/query/pom.xml +++ b/query/pom.xml -@@ -5,18 +5,18 @@ +@@ -5,17 +5,17 @@ io.github.waterfallmc - waterfall-parent + flamecord-parent - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT ../pom.xml io.github.waterfallmc - waterfall-query + flamecord-query - 1.17-R0.1-SNAPSHOT + 1.18-R0.1-SNAPSHOT jar - Waterfall-Query -- Minecraft query implementation based on the Waterfall API. + FlameCord-Query -+ Minecraft query implementation based on the FlameCord API. + Minecraft query implementation based on the Waterfall API. - @@ -27,7 +27,7 @@ diff --git a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch index e65b17fb..5f357579 100644 --- a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 60a16fffd914c3eb6cca576b85fe34d02c135768 Mon Sep 17 00:00:00 2001 +From b3bb0138f7cd3923259af7c6d484ce0c3d783bf8 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..ed4c392c +index 00000000..fc24d714 --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -17,13 +17,13 @@ index 00000000..ed4c392c + + io.github.waterfallmc + flamecord-parent -+ 1.17-R0.1-SNAPSHOT ++ 1.18-R0.1-SNAPSHOT + ../pom.xml + + + dev._2lstudios + flamecord-flamecord -+ 1.17-R0.1-SNAPSHOT ++ 1.18-R0.1-SNAPSHOT + jar + + FlameCord-FlameCord @@ -55,10 +55,10 @@ index 00000000..ed4c392c + + diff --git a/pom.xml b/pom.xml -index 26e85fb8..b305e245 100644 +index db494b4c..0c856cc2 100644 --- a/pom.xml +++ b/pom.xml -@@ -63,6 +63,9 @@ +@@ -66,6 +66,9 @@ query native @@ -69,10 +69,10 @@ index 26e85fb8..b305e245 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 433fbfe0..22319300 100644 +index 27e4096d..cfaa38c2 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml -@@ -64,5 +64,14 @@ +@@ -49,5 +49,14 @@ 1.3.0 compile @@ -88,7 +88,7 @@ index 433fbfe0..22319300 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 7bfe7d6b..d9a375e7 100644 +index 171171c2..77fda7a9 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -150,6 +150,51 @@ @@ -134,7 +134,7 @@ index 7bfe7d6b..d9a375e7 100644 + compile + + -+ io.github.waterfallmc ++ net.md-5 + flamecord-module-reconnect-yaml + ${project.version} + compile diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 71c02bde..5eebb39a 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -1,14 +1,14 @@ -From 369e4a2764e0b93edfed7b1a8f2f06f60930ce8f Mon Sep 17 00:00:00 2001 +From 390e68cddccf09565d47e0f4ee9176942584f67f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 527f310e..a4ef6d3b 100644 +index e31fb00a..ff4bbf34 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -51,7 +51,8 @@ public class WaterfallConfiguration extends Configuration { +@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { YamlConfig config = new YamlConfig(new File("waterfall.yml")); config.load(false); // Load, but no permissions logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); @@ -19,7 +19,7 @@ index 527f310e..a4ef6d3b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4c7e0fdc..3e7bd97b 100644 +index a4b58d9c..b884c40f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -45,5 +45,5 @@ index 820f7b03..aeda7963 100644 } } -- -2.31.1.windows.1 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch index 0a1fcf46..f2606961 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0005-1.7.x-support.patch @@ -1,4 +1,4 @@ -From c3083e66928221721e457f93e1fcf9db40a7e4e9 Mon Sep 17 00:00:00 2001 +From 527c0c09b4b5a8f5b5928bec1003e0943a152b99 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -324,7 +324,7 @@ index 7f0b71c9..04851233 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index bb37ba04..beb25715 100644 +index f1276c09..1fd80ffe 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -346,8 +346,8 @@ index bb37ba04..beb25715 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -55,6 +60,10 @@ public class ProtocolConstants - "1.17.x" +@@ -56,6 +61,10 @@ public class ProtocolConstants + "1.18.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( + // FlameCord start - 1.7.x support @@ -378,10 +378,10 @@ index 6034fc18..6100687c 100644 { buf.writeByte( position ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index 29440533..8d00c389 100644 +index d7d4e6ab..570a89f0 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -@@ -33,6 +33,12 @@ public class ClientSettings extends DefinedPacket +@@ -34,6 +34,12 @@ public class ClientSettings extends DefinedPacket chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); chatColours = buf.readBoolean(); skinParts = buf.readByte(); @@ -394,7 +394,7 @@ index 29440533..8d00c389 100644 if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) { mainHand = DefinedPacket.readVarInt( buf ); -@@ -46,6 +52,19 @@ public class ClientSettings extends DefinedPacket +@@ -51,6 +57,19 @@ public class ClientSettings extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -706,10 +706,10 @@ index 92bacc7c..cae5bda5 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index c652ffb4..90aaee0a 100644 +index 4f3a8c72..2d87692f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -@@ -82,6 +82,15 @@ public class PluginMessage extends DefinedPacket +@@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -725,7 +725,7 @@ index c652ffb4..90aaee0a 100644 tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; Preconditions.checkArgument( buf.readableBytes() < maxSize ); -@@ -92,6 +101,15 @@ public class PluginMessage extends DefinedPacket +@@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 136da2a8..b3f77bca 100644 +index b884c40f..b914b5c2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1000,18 +1000,10 @@ index 491cf1a1..6cd8ec3b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 134d4356..0d044231 100644 +index 9e74d158..75028024 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufAllocator; - import java.net.InetSocketAddress; -+import java.nio.charset.StandardCharsets; - import java.util.Locale; - import java.util.Arrays; // Waterfall - import java.util.Queue; -@@ -271,10 +272,20 @@ public class ServerConnector extends PacketHandler +@@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler user.getServer().disconnect( "Quitting" ); } else { @@ -1036,7 +1028,7 @@ index 134d4356..0d044231 100644 } user.setDimension( login.getDimension() ); -@@ -287,7 +298,7 @@ public class ServerConnector extends PacketHandler +@@ -296,7 +306,7 @@ public class ServerConnector extends PacketHandler if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall for ( Objective objective : serverScoreboard.getObjectives() ) { @@ -1045,7 +1037,7 @@ index 134d4356..0d044231 100644 } for ( Score score : serverScoreboard.getScores() ) { -@@ -456,7 +467,13 @@ public class ServerConnector extends PacketHandler +@@ -465,7 +475,13 @@ public class ServerConnector extends PacketHandler if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) { this.handshakeHandler.handle( pluginMessage ); @@ -1061,10 +1053,10 @@ index 134d4356..0d044231 100644 throw CancelSendSignal.INSTANCE; } 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 fc98b4b1..b50036b4 100644 +index 871a2990..43042c6a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -197,6 +197,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -194,6 +194,7 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkNotNull( name, "displayName" ); @@ -1072,7 +1064,7 @@ index fc98b4b1..b50036b4 100644 displayName = name; } -@@ -512,7 +513,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -509,7 +510,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1081,7 +1073,7 @@ index fc98b4b1..b50036b4 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -708,6 +709,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -705,6 +706,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1089,7 +1081,7 @@ index fc98b4b1..b50036b4 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -720,6 +722,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -717,6 +719,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1097,7 +1089,7 @@ index fc98b4b1..b50036b4 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -749,6 +752,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -746,6 +749,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1178,7 +1170,7 @@ index d3650ff8..b10d5b0a 100644 if ( pluginMessage.getTag().equals( "BungeeCord" ) ) 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 0fd58e83..7a403a1a 100644 +index 4afab05d..f6378e03 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1191,7 +1183,7 @@ index 0fd58e83..7a403a1a 100644 import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.SocketAddress; -@@ -258,8 +261,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -257,8 +260,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -1239,7 +1231,7 @@ index 6df3f3dd..a409d440 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 c769976f..c3462913 100644 +index 9537208e..e354032a 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 @@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler @@ -1631,5 +1623,5 @@ index daf12f74..7d053485 100644 @Override -- -2.33.0.windows.2 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch index c8dc01b4..06fd1509 100644 --- a/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,11 +1,11 @@ -From f34f232e1ba5b0498d5b6cab7c68938163ac3022 Mon Sep 17 00:00:00 2001 +From 8a5dda879ac3e69c9b1a31e1f5624270133a4b9a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9e..e29b0ed35 100644 +index 2f7b38d9..e29b0ed3 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java @@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; @@ -35,10 +35,10 @@ index 2f7b38d9e..e29b0ed35 100644 /** * Connection attempting to login. 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 7a403a1ab..5132c537f 100644 +index f6378e03..23571d40 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 -@@ -339,7 +339,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -338,7 +338,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); diff --git a/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch index e50959a4..14d103d6 100644 --- a/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch @@ -1,14 +1,14 @@ -From 236c13d0121ef6ae5c6d7932c62c37a71f3ec1f7 Mon Sep 17 00:00:00 2001 +From ea59533c1d800b45c6e2ccb905f29055e38b9452 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 7d66fdbda..b25cede0e 100644 +index 75028024..2ee16684 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -128,7 +128,8 @@ public class ServerConnector extends PacketHandler +@@ -129,7 +129,8 @@ public class ServerConnector extends PacketHandler newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 1a6cbcd4..09411a33 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From f1b73e099fe0f7d5ca594ed2457f2e2e2c52514b Mon Sep 17 00:00:00 2001 +From 7c85f2aea606560d42e89e74c5f59feec583114c Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 5132c537f..5efcb9b2c 100644 +index 23571d40..1ec75614 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 -@@ -196,6 +196,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -195,6 +195,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index 5132c537f..5efcb9b2c 100644 String kickMessage; if ( v1_5 ) -@@ -261,6 +268,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -260,6 +267,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -40,7 +40,7 @@ index 5132c537f..5efcb9b2c 100644 // FlameCord start - 1.7.x support Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -305,11 +323,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -304,11 +322,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -58,7 +58,7 @@ index 5132c537f..5efcb9b2c 100644 } @Override -@@ -618,7 +638,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -617,7 +637,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -69,7 +69,7 @@ index 5132c537f..5efcb9b2c 100644 { ch.close(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f5..5c05f2b94 100644 +index 6dc5633f..5c05f2b9 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -80,40 +80,27 @@ public class ChannelWrapper @@ -121,7 +121,7 @@ index 6dc5633f5..5c05f2b94 100644 } 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 96704d5eb..654203abb 100644 +index 96704d5e..654203ab 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -162,7 +162,7 @@ index 96704d5eb..654203abb 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b3bdfd05e 100644 +index 0c1ecfb8..b3bdfd05 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index 8baeec7b..dcafad8d 100644 --- a/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 21ea3112cf27d28dbf72ded9b702fd031c9336a5 Mon Sep 17 00:00:00 2001 +From d1b196832e3a6920299a047bfa7478254fab1182 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true 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 5efcb9b2c..751643a68 100644 +index 1ec75614..5f583e6b 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 -@@ -448,6 +448,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -447,6 +447,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { thisState = State.ENCRYPT; unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); diff --git a/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch index c2a38969..54cebcd7 100644 --- a/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 1c22b3cd263a326cb66e312e7b537877b30eac23 Mon Sep 17 00:00:00 2001 +From 2e9551451687de578103687f9c109fa0cb0941d9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 751643a68..6a9f1bd8e 100644 +index 5f583e6b..ea4f37c5 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 -@@ -698,7 +698,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -697,7 +697,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch index 84511335..59e5c4d8 100644 --- a/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,14 +1,14 @@ -From 7824c3357547e77f9e307d2fcdd19e1122a7bcd8 Mon Sep 17 00:00:00 2001 +From 6515f2b44123bddf35ab541ed9a7489498e10099 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 6a9f1bd8e..674b3ead8 100644 +index ea4f37c5..6018dccf 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 -@@ -467,6 +467,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -466,6 +466,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -17,7 +17,7 @@ index 6a9f1bd8e..674b3ead8 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start if (sharedKey instanceof SecretKeySpec) { -@@ -526,6 +528,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -525,6 +527,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { diff --git a/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch index c895b08f..3b368216 100644 --- a/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 9836196e9e4b3cb650697a608f54d506d4b1502b Mon Sep 17 00:00:00 2001 +From d3de5793409f78a1c29503afe900c04ce69f6b4d Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 85ae3fc9d..6232f1ec0 100644 +index 43042c6a..9b04f7ca 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -311,7 +311,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -308,7 +308,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { diff --git a/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch index 67d35601..82cf9b5c 100644 --- a/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 1cea5ef145ff10f975c0bc774b18d46f02c89e34 Mon Sep 17 00:00:00 2001 +From f62ce8fddd6ad50d94817ae022899a0ee529e47c Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 674b3ead8..72e0098dc 100644 +index 6018dccf..cec2fc00 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 -@@ -510,7 +510,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -509,7 +509,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch index 58fa83d5..fee35950 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 624c0d36a8479146327e29383fe1d1b2fbbba34f Mon Sep 17 00:00:00 2001 +From adc72a242925985dee8270c4b7233a14f8d7938c Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -249,19 +249,19 @@ index b914b5c2..719e73e4 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 191ca1a6..3b1e4adc 100644 +index 2ee16684..3a41769a 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -1,6 +1,8 @@ - package net.md_5.bungee; +@@ -2,6 +2,8 @@ package net.md_5.bungee; + import com.google.common.base.Joiner; import com.google.common.base.Preconditions; + +import dev._2lstudios.flamecord.FlameCord; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -164,7 +166,7 @@ public class ServerConnector extends PacketHandler +@@ -165,7 +167,7 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -271,7 +271,7 @@ index 191ca1a6..3b1e4adc 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 c87f8a61..70778443 100644 +index 9b04f7ca..c63a2b5b 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -36,6 +36,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -290,7 +290,7 @@ index c87f8a61..70778443 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -391,9 +393,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -388,9 +390,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -305,10 +305,10 @@ index c87f8a61..70778443 100644 b.connect().addListener( listener ); } 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 72e0098d..44794011 100644 +index cec2fc00..d637999f 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 -@@ -17,6 +17,8 @@ import java.util.logging.Level; +@@ -19,6 +19,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -317,7 +317,7 @@ index 72e0098d..44794011 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -154,7 +156,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -157,7 +159,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -365,5 +365,5 @@ index 654203ab..a840bc70 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.33.0.windows.2 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0025-Firewall-System.patch b/Waterfall-Proxy-Patches/0025-Firewall-System.patch index be60c1a7..1902bc90 100644 --- a/Waterfall-Proxy-Patches/0025-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0025-Firewall-System.patch @@ -1,4 +1,4 @@ -From 4448ba222341e511e7b2add8e6c10c315d3d6a73 Mon Sep 17 00:00:00 2001 +From 157518ad0bfc96a066af7348b3cf01fc3efd24bf Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -303,10 +303,10 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3b1e4adc..ab9d3ca8 100644 +index 3a41769a..f2805229 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -166,6 +166,9 @@ public class ServerConnector extends PacketHandler +@@ -167,6 +167,9 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { @@ -317,10 +317,10 @@ index 3b1e4adc..ab9d3ca8 100644 } } 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 44794011..8f142f48 100644 +index d637999f..f2957c01 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 -@@ -156,6 +156,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -159,6 +159,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -330,7 +330,7 @@ index 44794011..8f142f48 100644 throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); } } -@@ -400,6 +403,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -399,6 +402,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } break; default: @@ -340,7 +340,7 @@ index 44794011..8f142f48 100644 throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); } } -@@ -414,6 +420,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -413,6 +419,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection disconnect( bungee.getTranslation( "name_invalid" ) ); return; } @@ -445,5 +445,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.33.0.windows.2 +2.32.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch index cbc9be4c..32ec88a6 100644 --- a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From ac00cd8c9705f60f9dfbf763241c1e1fd436574a Mon Sep 17 00:00:00 2001 +From 5127c5564e60fe2e59d0ad210b46b0de2cc06711 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac11..aafd99d8c 100644 +index 8bb61ac1..aafd99d8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,16 @@ import net.md_5.bungee.config.Configuration; @@ -38,10 +38,10 @@ index 8bb61ac11..aafd99d8c 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 8f142f488..5fd105410 100644 +index f2957c01..d1f2ea13 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 -@@ -374,7 +374,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -373,7 +373,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index 8f142f488..5fd105410 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -383,7 +384,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -382,7 +383,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -62,7 +62,7 @@ index 8f142f488..5fd105410 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 224146868..fbc19f66b 100644 +index 22414686..fbc19f66 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch index f5cce928..bb88b3ba 100644 --- a/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From 34b303a44be51266612eb4e68bef0c157449cea5 Mon Sep 17 00:00:00 2001 +From 5be0acb0644d94bb1a2e94ed6ec680e6166f16e7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aafd99d8c..c005e6864 100644 +index aafd99d8..16e5909a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -6,12 +6,33 @@ import java.util.ArrayList; @@ -53,10 +53,10 @@ index aafd99d8c..c005e6864 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 5fd105410..c51aeb445 100644 +index d1f2ea13..51b5afc2 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 -@@ -254,7 +254,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -253,7 +253,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); From e6457f6feebe6ab24b2aa12c95cb34d91a5c62bd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 30 Nov 2021 11:51:33 -0300 Subject: [PATCH 172/499] 0.6.5 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index 5eebb39a..a399ce5a 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..b884c40f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.4"; ++ return "0.6.5"; } public void reloadMessages() From 743612ed8b8845ea0285ddea7996f87458edaf7f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:04:33 -0300 Subject: [PATCH 173/499] fix compilation issues --- Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch index 5f357579..f28b72fe 100644 --- a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch @@ -135,7 +135,7 @@ index 171171c2..77fda7a9 100644 + + + net.md-5 -+ flamecord-module-reconnect-yaml ++ bungeecord-module-reconnect-yaml + ${project.version} + compile + From 58f62b590637307826889c5f8811dc279f81a6e2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:07:00 -0300 Subject: [PATCH 174/499] use FlameCord as jar name --- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index 91cda163..9dbdaa21 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From b5f7d605923205d2127b60c04a34f76db4259d55 Mon Sep 17 00:00:00 2001 +From 1863baa0785d05140075eaa53ec31628d240c83d Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -58,7 +58,7 @@ index 9b29dfca..bfb96040 100644 compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 00ce099c..5b0c348f 100644 +index 00ce099c..e797d892 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -5,17 +5,17 @@ @@ -82,7 +82,7 @@ index 00ce099c..5b0c348f 100644 Java 1.6 loader for Waterfall -@@ -30,7 +30,7 @@ +@@ -30,14 +30,14 @@ io.github.waterfallmc @@ -91,6 +91,14 @@ index 00ce099c..5b0c348f 100644 ${project.version} compile + + + +- Waterfall ++ FlameCord + + + org.apache.maven.plugins diff --git a/chat/pom.xml b/chat/pom.xml index 0ad5dd16..48c0029f 100644 --- a/chat/pom.xml From e70067a42da95829cdad31ce27b7e648ad745d7e Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 30 Nov 2021 20:05:09 +0100 Subject: [PATCH 175/499] Updated workflow for Github Actions and fixed typo --- .github/workflows/flamecord-build.yml | 8 ++++---- .github/workflows/flamecord-pull-request.yml | 8 ++++---- scripts/upstreamCommit.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 068c0c73..6ba7f9a4 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -15,14 +15,14 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11, 16] + java: [8, 11, 17] steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v2.1.0 + uses: actions/setup-java@v2 with: java-version: ${{ matrix.java }} distribution: 'adopt' @@ -30,7 +30,7 @@ jobs: # The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven Packages - uses: actions/cache@v2.1.6 + uses: actions/cache@v2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -44,7 +44,7 @@ jobs: # An artifact is generated in a compressed file according to each JDK build version. - name: Upload FlameCord - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2 with: name: FlameCord-JDK${{ matrix.java }} path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml index 85ad7940..c12eb25b 100644 --- a/.github/workflows/flamecord-pull-request.yml +++ b/.github/workflows/flamecord-pull-request.yml @@ -14,14 +14,14 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11, 16] + java: [8, 11, 17] steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v2.1.0 + uses: actions/setup-java@v2 with: java-version: ${{ matrix.java }} distribution: 'adopt' @@ -29,7 +29,7 @@ jobs: # The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven Packages - uses: actions/cache@v2.1.6 + uses: actions/cache@v2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -43,7 +43,7 @@ jobs: # An artifact is generated in a compressed file according to each JDK build version. - name: Upload FlameCord - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2 with: name: FlameCord-JDK${{ matrix.java }} path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/scripts/upstreamCommit.sh b/scripts/upstreamCommit.sh index 8aaad42f..4880b354 100755 --- a/scripts/upstreamCommit.sh +++ b/scripts/upstreamCommit.sh @@ -15,7 +15,7 @@ if [ ! -z "$waterfall" ]; then logsuffix="$logsuffix\n\nWaterfall Changes:\n$waterfall" if [ -z "$updated" ]; then updated="Waterfall"; else updated="$updated/Waterfall"; fi fi -disclaimer="Upstream has released updates that appears to apply and compile correctly.\nThis update has not been tested by 2LStudios and as with ANY update, please do your own testing" +disclaimer="Upstream has released updates that appear to apply and compile correctly.\nThis update has not been tested by 2LStudios and as with ANY update, please do your own testing" if [ ! -z "$1" ]; then disclaimer="$@" From e3f86bb08666c1d51156646865cd6a84f2799734 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Thu, 9 Dec 2021 21:52:46 +0100 Subject: [PATCH 176/499] Updated Upstream (Waterfall) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: f45703f Backport log4j fix from 2.15.0 5eadf31 Updated Upstream (BungeeCord) (#713) 699f788 Fix typos in optimize UUID conversion patch (#712) 9844a1a Update Java version in GitHub Actions (#707) 2916189 Updated Upstream (BungeeCord) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 0fb2c920..f45703fc 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 0fb2c92016bef352763958fb5c56056e6ea2b8ee +Subproject commit f45703fc46c8d8c35fab745181fce6f9f887be5d From 56a146b75ec9b90e5382ccaa8f7445743873d15e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 9 Dec 2021 21:23:02 -0300 Subject: [PATCH 177/499] 0.6.6 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index a399ce5a..cf9a5703 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..b884c40f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.5"; ++ return "0.6.6"; } public void reloadMessages() From 880b24e43c1a934f8d52e67403bb16219293d386 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:38:53 -0300 Subject: [PATCH 178/499] updated Waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index f45703fc..b3a0e144 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit f45703fc46c8d8c35fab745181fce6f9f887be5d +Subproject commit b3a0e144e6d38302afc3f155565836bc81adb4ad From 42a908564929f0876a799799695a204806dfe6a9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:44:33 -0300 Subject: [PATCH 179/499] 0.6.7 --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index cf9a5703..fde21a2f 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..b884c40f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.6"; ++ return "0.6.7"; } public void reloadMessages() From f9a568af06ee7f9a49df8b0e59d6b2d9679a0686 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 19 Dec 2021 11:09:06 -0300 Subject: [PATCH 180/499] bump log4j to 2.17.0 --- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index 9dbdaa21..a2bb3754 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From 1863baa0785d05140075eaa53ec31628d240c83d Mon Sep 17 00:00:00 2001 +From c0bc45190cbe164673dae740576804a695e0f55e Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -208,10 +208,10 @@ index 465ebbf2..acf53b43 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 34740637..09fb31d5 100644 +index 7dc322b2..3645c6b2 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml -@@ -4,17 +4,17 @@ +@@ -4,21 +4,21 @@ io.github.waterfallmc @@ -232,6 +232,11 @@ index 34740637..09fb31d5 100644 Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. +- 2.15.0 ++ 2.17.0 + + + diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml index b41791f1..6b53066f 100644 --- a/module/cmd-alert/pom.xml @@ -604,5 +609,5 @@ index 081bff62..550a463e 100644 compile -- -2.32.0.windows.1 +2.32.0 From 9c993213a7c2c2b3a1c34707f7a7b7635c3b58a8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 19 Dec 2021 11:10:06 -0300 Subject: [PATCH 181/499] update waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index b3a0e144..33a8c49f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit b3a0e144e6d38302afc3f155565836bc81adb4ad +Subproject commit 33a8c49fc7a5c7cda7df30e249d1202ef7b91d3e From 47839d8bb385c0b4565af5fbded8fa4340588b1a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 19 Dec 2021 11:11:16 -0300 Subject: [PATCH 182/499] fix compilation issues --- Waterfall-Proxy-Patches/0001-POM-Changes.patch | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch index a2bb3754..a8f69930 100644 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From c0bc45190cbe164673dae740576804a695e0f55e Mon Sep 17 00:00:00 2001 +From 2cd59f6fa8b5dbfadf0dfce47a6d5d0c79f40fd5 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Tue, 15 Nov 2016 08:56:43 -0500 Subject: [PATCH] POM Changes @@ -208,10 +208,10 @@ index 465ebbf2..acf53b43 100644 compile diff --git a/log4j/pom.xml b/log4j/pom.xml -index 7dc322b2..3645c6b2 100644 +index 39e2fa42..3645c6b2 100644 --- a/log4j/pom.xml +++ b/log4j/pom.xml -@@ -4,21 +4,21 @@ +@@ -4,17 +4,17 @@ io.github.waterfallmc @@ -232,11 +232,6 @@ index 7dc322b2..3645c6b2 100644 Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. -- 2.15.0 -+ 2.17.0 - - - diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml index b41791f1..6b53066f 100644 --- a/module/cmd-alert/pom.xml From 8f8e73c5b160718ad329b0162cd389202f38f1e0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 19 Dec 2021 11:15:28 -0300 Subject: [PATCH 183/499] Update 0004-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch index fde21a2f..af6f69f3 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..b884c40f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.7"; ++ return "0.6.8"; } public void reloadMessages() From e8f9518b739d52b9a3bc075a96789cdb9a23a6d9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 29 Dec 2021 22:14:20 -0300 Subject: [PATCH 184/499] Updated Waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 33a8c49f..a078e046 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 33a8c49fc7a5c7cda7df30e249d1202ef7b91d3e +Subproject commit a078e046a168baa5f004e930253ea1eb469a6ead From b0e53adc57f02fa6d266029473cdcef70e398ef4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 29 Dec 2021 23:02:28 -0300 Subject: [PATCH 185/499] Fix compilation issues --- ...patch => 0001-FlameCord-POM-Changes.patch} | 44 +- .../0001-POM-Changes.patch | 608 ------------------ ...erences-from-Waterfall-to-FlameCord.patch} | 4 +- ...and.patch => 0003-FlameCord-rebrand.patch} | 6 +- ...support.patch => 0004-1.7.x-support.patch} | 8 +- ...ke-PlayerHandshakeEvent-cancellable.patch} | 4 +- ...0006-Make-a-getter-for-the-callback.patch} | 6 +- ...able-update-checker-Use-bungee-name.patch} | 8 +- ...> 0008-Change-replaceAll-to-replace.patch} | 4 +- ...ctions-Don-t-flush-if-not-necessary.patch} | 4 +- ...-Checks.patch => 0010-Packet-Checks.patch} | 8 +- ...atch => 0011-Change-default-timeout.patch} | 6 +- ...-encrypt-only-if-onlineMode-is-true.patch} | 4 +- ...013-Don-t-allow-name-containing-dot.patch} | 6 +- ...4-Use-pipeline-to-reduce-redundancy.patch} | 6 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 4 +- ...-to-avoid-multiple-incoming-packets.patch} | 4 +- ...teException-to-QuietException-and-e.patch} | 4 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 4 +- ...tch => 0019-FlameCord-General-Patch.patch} | 8 +- ...tch => 0020-FlameCord-module-system.patch} | 6 +- ...021-FlameCord-message-configuration.patch} | 6 +- ...ch => 0022-Fix-ByteBuf-memory-leaks.patch} | 4 +- ...> 0023-Check-if-packetID-is-invalid.patch} | 6 +- ...ystem.patch => 0024-Firewall-System.patch} | 6 +- ...ch => 0025-FlameCord-logger-options.patch} | 4 +- ...atch => 0026-Always-release-packets.patch} | 6 +- ...ded-an-api-method-to-unload-Plugins.patch} | 6 +- ...s.patch => 0028-Apply-packet-limits.patch} | 6 +- ...em.patch => 0029-Custom-motd-system.patch} | 4 +- pom.xml | 6 +- 31 files changed, 100 insertions(+), 710 deletions(-) rename Waterfall-Proxy-Patches/{0002-FlameCord-POM-Changes.patch => 0001-FlameCord-POM-Changes.patch} (79%) delete mode 100644 Waterfall-Proxy-Patches/0001-POM-Changes.patch rename Waterfall-Proxy-Patches/{0003-Rename-references-from-Waterfall-to-FlameCord.patch => 0002-Rename-references-from-Waterfall-to-FlameCord.patch} (98%) rename Waterfall-Proxy-Patches/{0004-FlameCord-rebrand.patch => 0003-FlameCord-rebrand.patch} (96%) rename Waterfall-Proxy-Patches/{0005-1.7.x-support.patch => 0004-1.7.x-support.patch} (99%) rename Waterfall-Proxy-Patches/{0006-Make-PlayerHandshakeEvent-cancellable.patch => 0005-Make-PlayerHandshakeEvent-cancellable.patch} (96%) rename Waterfall-Proxy-Patches/{0007-Make-a-getter-for-the-callback.patch => 0006-Make-a-getter-for-the-callback.patch} (87%) rename Waterfall-Proxy-Patches/{0008-Disable-update-checker-Use-bungee-name.patch => 0007-Disable-update-checker-Use-bungee-name.patch} (96%) rename Waterfall-Proxy-Patches/{0009-Change-replaceAll-to-replace.patch => 0008-Change-replaceAll-to-replace.patch} (93%) rename Waterfall-Proxy-Patches/{0010-Close-connections-Don-t-flush-if-not-necessary.patch => 0009-Close-connections-Don-t-flush-if-not-necessary.patch} (98%) rename Waterfall-Proxy-Patches/{0011-Packet-Checks.patch => 0010-Packet-Checks.patch} (93%) rename Waterfall-Proxy-Patches/{0012-Change-default-timeout.patch => 0011-Change-default-timeout.patch} (86%) rename Waterfall-Proxy-Patches/{0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch => 0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch} (92%) rename Waterfall-Proxy-Patches/{0014-Don-t-allow-name-containing-dot.patch => 0013-Don-t-allow-name-containing-dot.patch} (87%) rename Waterfall-Proxy-Patches/{0015-Use-pipeline-to-reduce-redundancy.patch => 0014-Use-pipeline-to-reduce-redundancy.patch} (96%) rename Waterfall-Proxy-Patches/{0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (92%) rename Waterfall-Proxy-Patches/{0017-Finish-early-to-avoid-multiple-incoming-packets.patch => 0016-Finish-early-to-avoid-multiple-incoming-packets.patch} (94%) rename Waterfall-Proxy-Patches/{0018-Change-IllegalStateException-to-QuietException-and-e.patch => 0017-Change-IllegalStateException-to-QuietException-and-e.patch} (92%) rename Waterfall-Proxy-Patches/{0019-Don-t-declare-uuid-unless-it-s-null.patch => 0018-Don-t-declare-uuid-unless-it-s-null.patch} (93%) rename Waterfall-Proxy-Patches/{0020-FlameCord-General-Patch.patch => 0019-FlameCord-General-Patch.patch} (99%) rename Waterfall-Proxy-Patches/{0021-FlameCord-module-system.patch => 0020-FlameCord-module-system.patch} (98%) rename Waterfall-Proxy-Patches/{0022-FlameCord-message-configuration.patch => 0021-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0023-Fix-ByteBuf-memory-leaks.patch => 0022-Fix-ByteBuf-memory-leaks.patch} (97%) rename Waterfall-Proxy-Patches/{0024-Check-if-packetID-is-invalid.patch => 0023-Check-if-packetID-is-invalid.patch} (91%) rename Waterfall-Proxy-Patches/{0025-Firewall-System.patch => 0024-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0026-FlameCord-logger-options.patch => 0025-FlameCord-logger-options.patch} (98%) rename Waterfall-Proxy-Patches/{0027-Always-release-packets.patch => 0026-Always-release-packets.patch} (92%) rename Waterfall-Proxy-Patches/{0028-Added-an-api-method-to-unload-Plugins.patch => 0027-Added-an-api-method-to-unload-Plugins.patch} (96%) rename Waterfall-Proxy-Patches/{0029-Apply-packet-limits.patch => 0028-Apply-packet-limits.patch} (91%) rename Waterfall-Proxy-Patches/{0030-Custom-motd-system.patch => 0029-Custom-motd-system.patch} (97%) diff --git a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch similarity index 79% rename from Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch rename to Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index f28b72fe..9ffae465 100644 --- a/Waterfall-Proxy-Patches/0002-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From b3bb0138f7cd3923259af7c6d484ce0c3d783bf8 Mon Sep 17 00:00:00 2001 +From 9702193b1b27ffbe2fd79236b44d689d58ebafc1 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..fc24d714 +index 00000000..f4bf5ec6 --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -16,29 +16,29 @@ index 00000000..fc24d714 + + + io.github.waterfallmc -+ flamecord-parent ++ waterfall-parent + 1.18-R0.1-SNAPSHOT + ../pom.xml + + + dev._2lstudios -+ flamecord-flamecord ++ waterfall-flamecord + 1.18-R0.1-SNAPSHOT + jar + -+ FlameCord-FlameCord ++ Waterfall-FlameCord + FlameCord adds security essentials and new configuration options + + + + io.github.waterfallmc -+ flamecord-config ++ waterfall-config + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-chat ++ waterfall-chat + ${project.version} + compile + @@ -55,24 +55,22 @@ index 00000000..fc24d714 + + diff --git a/pom.xml b/pom.xml -index db494b4c..0c856cc2 100644 +index 505d1d14..45f14084 100644 --- a/pom.xml +++ b/pom.xml -@@ -66,6 +66,9 @@ +@@ -63,6 +63,7 @@ query native -+ -+ flamecord -+ ++ flamecord diff --git a/protocol/pom.xml b/protocol/pom.xml -index 27e4096d..cfaa38c2 100644 +index a783d9b0..f45d4f7a 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml -@@ -49,5 +49,14 @@ +@@ -64,5 +64,14 @@ 1.3.0 compile @@ -80,7 +78,7 @@ index 27e4096d..cfaa38c2 100644 + + + dev._2lstudios -+ flamecord-flamecord ++ waterfall-flamecord + ${project.version} + compile + @@ -88,7 +86,7 @@ index 27e4096d..cfaa38c2 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 171171c2..77fda7a9 100644 +index cca0ef95..3df0498a 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -150,6 +150,51 @@ @@ -99,37 +97,37 @@ index 171171c2..77fda7a9 100644 + + + dev._2lstudios -+ flamecord-flamecord ++ waterfall-flamecord + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-module-cmd-alert ++ waterfall-module-cmd-alert + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-module-cmd-find ++ waterfall-module-cmd-find + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-module-cmd-list ++ waterfall-module-cmd-list + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-module-cmd-send ++ waterfall-module-cmd-send + ${project.version} + compile + + + io.github.waterfallmc -+ flamecord-module-cmd-server ++ waterfall-module-cmd-server + ${project.version} + compile + @@ -144,5 +142,5 @@ index 171171c2..77fda7a9 100644 -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0001-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-POM-Changes.patch deleted file mode 100644 index a8f69930..00000000 --- a/Waterfall-Proxy-Patches/0001-POM-Changes.patch +++ /dev/null @@ -1,608 +0,0 @@ -From 2cd59f6fa8b5dbfadf0dfce47a6d5d0c79f40fd5 Mon Sep 17 00:00:00 2001 -From: Troy Frew -Date: Tue, 15 Nov 2016 08:56:43 -0500 -Subject: [PATCH] POM Changes - - -diff --git a/api/pom.xml b/api/pom.xml -index 9b29dfca..bfb96040 100644 ---- a/api/pom.xml -+++ b/api/pom.xml -@@ -5,41 +5,41 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-api -+ flamecord-api - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-API -+ FlameCord-API - API implemented by the Elastic Portal Suite - - - - io.github.waterfallmc -- waterfall-chat -+ flamecord-chat - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-config -+ flamecord-config - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-event -+ flamecord-event - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-protocol -+ flamecord-protocol - ${project.version} - compile - -diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 00ce099c..e797d892 100644 ---- a/bootstrap/pom.xml -+++ b/bootstrap/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-bootstrap -+ flamecord-bootstrap - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Bootstrap -+ FlameCord-Bootstrap - Java 1.6 loader for Waterfall - - -@@ -30,14 +30,14 @@ - - - io.github.waterfallmc -- waterfall-proxy -+ flamecord-proxy - ${project.version} - compile - - - - -- Waterfall -+ FlameCord - - - org.apache.maven.plugins -diff --git a/chat/pom.xml b/chat/pom.xml -index 0ad5dd16..48c0029f 100644 ---- a/chat/pom.xml -+++ b/chat/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-chat -+ flamecord-chat - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Chat -+ FlameCord-Chat - Minecraft JSON chat API intended for use with Waterfall - - -diff --git a/config/pom.xml b/config/pom.xml -index 2caffc27..5a7c9993 100644 ---- a/config/pom.xml -+++ b/config/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-config -+ flamecord-config - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Config -+ FlameCord-Config - Generic java configuration API intended for use with Waterfall - - -diff --git a/event/pom.xml b/event/pom.xml -index e2432463..ade69b60 100644 ---- a/event/pom.xml -+++ b/event/pom.xml -@@ -5,16 +5,16 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-event -+ flamecord-event - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Event -+ FlameCord-Event - Generic java event dispatching API intended for use with Waterfall. - -diff --git a/log/pom.xml b/log/pom.xml -index 465ebbf2..acf53b43 100644 ---- a/log/pom.xml -+++ b/log/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-log -+ flamecord-log - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Log -+ FlameCord-Log - Simplistic and performant java.util.Logger based logger and console API designed for use with Waterfall and Minecraft related applications. - - -@@ -27,7 +27,7 @@ - - - io.github.waterfallmc -- waterfall-chat -+ flamecord-chat - ${project.version} - compile - -diff --git a/log4j/pom.xml b/log4j/pom.xml -index 39e2fa42..3645c6b2 100644 ---- a/log4j/pom.xml -+++ b/log4j/pom.xml -@@ -4,17 +4,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-log4j -+ flamecord-log4j - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Log -+ FlameCord-Log - Simplistic and performant Log4j2 based logger and console API designed for use with Waterfall and Minecraft related applications. - - -diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml -index b41791f1..6b53066f 100644 ---- a/module/cmd-alert/pom.xml -+++ b/module/cmd-alert/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module-cmd-alert -+ flamecord-module-cmd-alert - 1.18-R0.1-SNAPSHOT - jar - -diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml -index a17080ab..b8d562cf 100644 ---- a/module/cmd-find/pom.xml -+++ b/module/cmd-find/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module-cmd-find -+ flamecord-module-cmd-find - 1.18-R0.1-SNAPSHOT - jar - -diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml -index 16003086..f7cebd89 100644 ---- a/module/cmd-list/pom.xml -+++ b/module/cmd-list/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module-cmd-list -+ flamecord-module-cmd-list - 1.18-R0.1-SNAPSHOT - jar - -diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml -index ba084281..62e7d4f4 100644 ---- a/module/cmd-send/pom.xml -+++ b/module/cmd-send/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module-cmd-send -+ flamecord-module-cmd-send - 1.18-R0.1-SNAPSHOT - jar - -diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml -index cb4d2932..5c6253ac 100644 ---- a/module/cmd-server/pom.xml -+++ b/module/cmd-server/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module-cmd-server -+ flamecord-module-cmd-server - 1.18-R0.1-SNAPSHOT - jar - -diff --git a/module/pom.xml b/module/pom.xml -index 350a49b8..415de113 100644 ---- a/module/pom.xml -+++ b/module/pom.xml -@@ -5,13 +5,13 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - pom - -@@ -36,7 +36,7 @@ - - - io.github.waterfallmc -- waterfall-api -+ flamecord-api - ${project.version} - compile - -diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml -index d3476fc5..ee786715 100644 ---- a/module/reconnect-yaml/pom.xml -+++ b/module/reconnect-yaml/pom.xml -@@ -5,7 +5,7 @@ - - - io.github.waterfallmc -- waterfall-module -+ flamecord-module - 1.18-R0.1-SNAPSHOT - ../pom.xml - -diff --git a/native/pom.xml b/native/pom.xml -index 1eff2c93..58fc77b4 100644 ---- a/native/pom.xml -+++ b/native/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-native -+ flamecord-native - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Native -+ FlameCord-Native - Optional native code to speed up and enhance Waterfall functionality. - - -diff --git a/pom.xml b/pom.xml -index 94fad2cc..db494b4c 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -5,23 +5,23 @@ - - - io.github.waterfallmc -- waterfall-super -+ flamecord-super - dev-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - pom - -- Waterfall-Parent -- Parent project for all Waterfall modules. -- https://github.com/WaterfallMC/Waterfall -+ FlameCord-Parent -+ Parent project for all FlameCord modules. -+ https://github.com/2LStudios-MC/FlameCord - 2015 - -- WaterfallMC -- https://github.com/WaterfallMC -+ 2LStudios -+ https://github.com/2LStudios-MC - - - -@@ -47,6 +47,9 @@ - - fuzzybot - -+ -+ LinsaFTW -+ - - - -@@ -66,13 +69,13 @@ - - - -- scm:git:git@github.com:com:WaterfallMC/Waterfall.git -- scm:git:git@github.com:WaterfallMC/Waterfall.git -- git@github.com:WaterfallMC/Waterfall.git -+ scm:git:git@github.com:com:2LStudios-MC/FlameCord.git -+ scm:git:git@github.com:2LStudios-MC/FlameCord.git -+ git@github.com:2LStudios-MC/FlameCord.git - - - GitHub -- https://github.com/PaperMC/Waterfall/issues -+ https://github.com/2LStudios-MC/FlameCord/issues - - - -@@ -412,8 +415,8 @@ - - false - -- Waterfall ${project.version} API -- Waterfall ${project.version} API -+ FlameCord ${project.version} API -+ FlameCord ${project.version} API - - api/target/generated-sources/delombok; - chat/target/generated-sources/delombok -diff --git a/protocol/pom.xml b/protocol/pom.xml -index c62e0175..27e4096d 100644 ---- a/protocol/pom.xml -+++ b/protocol/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-protocol -+ flamecord-protocol - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Protocol -+ FlameCord-Protocol - Minimal implementation of the Minecraft protocol for use in Waterfall - - -@@ -27,7 +27,7 @@ - - - io.github.waterfallmc -- waterfall-chat -+ flamecord-chat - ${project.version} - compile - -diff --git a/proxy/pom.xml b/proxy/pom.xml -index 22c4f71b..171171c2 100644 ---- a/proxy/pom.xml -+++ b/proxy/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-proxy -+ flamecord-proxy - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Proxy -+ FlameCord-Proxy - Proxy component of the Elastic Portal Suite - - -@@ -65,31 +65,31 @@ - - - io.github.waterfallmc -- waterfall-api -+ flamecord-api - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-log4j -+ flamecord-log4j - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-native -+ flamecord-native - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-protocol -+ flamecord-protocol - ${project.version} - compile - - - io.github.waterfallmc -- waterfall-query -+ flamecord-query - ${project.version} - compile - -diff --git a/query/pom.xml b/query/pom.xml -index 081bff62..550a463e 100644 ---- a/query/pom.xml -+++ b/query/pom.xml -@@ -5,17 +5,17 @@ - - - io.github.waterfallmc -- waterfall-parent -+ flamecord-parent - 1.18-R0.1-SNAPSHOT - ../pom.xml - - - io.github.waterfallmc -- waterfall-query -+ flamecord-query - 1.18-R0.1-SNAPSHOT - jar - -- Waterfall-Query -+ FlameCord-Query - Minecraft query implementation based on the Waterfall API. - - -@@ -27,7 +27,7 @@ - - - io.github.waterfallmc -- waterfall-api -+ flamecord-api - ${project.version} - compile - --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch similarity index 98% rename from Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch rename to Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index 50ecbd8c..c9817506 100644 --- a/Waterfall-Proxy-Patches/0003-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,4 +1,4 @@ -From 97946438e45cb5480c3924d5c340cecd1f1a354f Mon Sep 17 00:00:00 2001 +From add366ec45d3c5e193842db6e9851981cb8fe15c Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to FlameCord @@ -105,5 +105,5 @@ index 0644b8cd..9c11ac57 100644 SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch similarity index 96% rename from Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch rename to Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index af6f69f3..e0df3893 100644 --- a/Waterfall-Proxy-Patches/0004-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 390e68cddccf09565d47e0f4ee9176942584f67f Mon Sep 17 00:00:00 2001 +From fc1fff4cbc31017a66ef2e1fc02ad66f344983b4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c..b884c40f 100644 +index a4b58d9c..53b78a2f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -45,5 +45,5 @@ index 820f7b03..aeda7963 100644 } } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch similarity index 99% rename from Waterfall-Proxy-Patches/0005-1.7.x-support.patch rename to Waterfall-Proxy-Patches/0004-1.7.x-support.patch index f2606961..ef477ba1 100644 --- a/Waterfall-Proxy-Patches/0005-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 527c0c09b4b5a8f5b5928bec1003e0943a152b99 Mon Sep 17 00:00:00 2001 +From 19acf73dfa9f88a5671a04880a30b8ad206c702b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -324,7 +324,7 @@ index 7f0b71c9..04851233 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index f1276c09..1fd80ffe 100644 +index 0768e3b7..c001e4ca 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b884c40f..b914b5c2 100644 +index 53b78a2f..8ce69d2f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1623,5 +1623,5 @@ index daf12f74..7d053485 100644 @Override -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch similarity index 96% rename from Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch rename to Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 06fd1509..be3789d2 100644 --- a/Waterfall-Proxy-Patches/0006-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From 8a5dda879ac3e69c9b1a31e1f5624270133a4b9a Mon Sep 17 00:00:00 2001 +From fe67e1b15da0cebd4aa08a848529845a194dff24 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -52,5 +52,5 @@ index f6378e03..23571d40 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch similarity index 87% rename from Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch rename to Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch index 2bb2d304..f3bb0749 100644 --- a/Waterfall-Proxy-Patches/0007-Make-a-getter-for-the-callback.patch +++ b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch @@ -1,11 +1,11 @@ -From 397911abe1f38fc29509d1b54db5549ca5764cce Mon Sep 17 00:00:00 2001 +From c44b23dcab5a544424e6835060638e1bbf053ae2 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:58:18 +0800 Subject: [PATCH] Make a getter for the callback diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -index cf85ca06d..8a945a996 100644 +index cf85ca06..8a945a99 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java @@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; @@ -19,5 +19,5 @@ index cf85ca06d..8a945a996 100644 private final Map intents = new ConcurrentHashMap<>(); private final AtomicBoolean fired = new AtomicBoolean(); -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch similarity index 96% rename from Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch rename to Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index 6b93b0f3..d1cd6f15 100644 --- a/Waterfall-Proxy-Patches/0008-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -1,11 +1,11 @@ -From e546821e6a206365a2b569e803fe33e85a99a481 Mon Sep 17 00:00:00 2001 +From 11703076bee62715d944730066a85ed265510a55 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 25da0a65e..d4b612b36 100644 +index 25da0a65..d4b612b3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -45,25 +45,12 @@ public class BungeeCordLauncher @@ -38,7 +38,7 @@ index 25da0a65e..d4b612b36 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 9c11ac576..ae4c7ac25 100644 +index 9c11ac57..ae4c7ac2 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -22,6 +22,7 @@ import java.util.Locale; @@ -70,5 +70,5 @@ index 9c11ac576..ae4c7ac25 100644 int maxPlayers = get( "max_players", 1, val ); -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch similarity index 93% rename from Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch rename to Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch index 14d103d6..e287e35d 100644 --- a/Waterfall-Proxy-Patches/0009-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -1,4 +1,4 @@ -From ea59533c1d800b45c6e2ccb905f29055e38b9452 Mon Sep 17 00:00:00 2001 +From 6d9ca4241f7afcfba08144a7e247bfc36a4d5990 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() @@ -19,5 +19,5 @@ index 75028024..2ee16684 100644 // All done. properties = newp; -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 98% rename from Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch rename to Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 09411a33..c6549764 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 7c85f2aea606560d42e89e74c5f59feec583114c Mon Sep 17 00:00:00 2001 +From 4487e175bf2121239ffe3d12bb584c51fddb3e09 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -175,5 +175,5 @@ index 0c1ecfb8..b3bdfd05 100644 } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch b/Waterfall-Proxy-Patches/0010-Packet-Checks.patch similarity index 93% rename from Waterfall-Proxy-Patches/0011-Packet-Checks.patch rename to Waterfall-Proxy-Patches/0010-Packet-Checks.patch index e3ef7b3a..393cb666 100644 --- a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0010-Packet-Checks.patch @@ -1,11 +1,11 @@ -From 295841ad76a439554074bfde7813de1a487d20a5 Mon Sep 17 00:00:00 2001 +From 772e70bce0c9626cb3c724b7c30c4802f7311e63 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 01d35f41a..ec07ae6fd 100644 +index ac83e325..4b9b80b9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -29,7 +29,7 @@ index 01d35f41a..ec07ae6fd 100644 Object packetTypeInfo = null; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index f8d6becd6..336050075 100644 +index f8d6becd..33605007 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -78,6 +78,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -49,5 +49,5 @@ index f8d6becd6..336050075 100644 { HAProxyMessage proxy = (HAProxyMessage) msg; -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch b/Waterfall-Proxy-Patches/0011-Change-default-timeout.patch similarity index 86% rename from Waterfall-Proxy-Patches/0012-Change-default-timeout.patch rename to Waterfall-Proxy-Patches/0011-Change-default-timeout.patch index d18782d8..8ec0a616 100644 --- a/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch +++ b/Waterfall-Proxy-Patches/0011-Change-default-timeout.patch @@ -1,11 +1,11 @@ -From 245d1262bdf112f20eba342196f07bd5036c62ea Mon Sep 17 00:00:00 2001 +From 36e054d017b32104a878faed79fb18b5d8b5c9df Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 Subject: [PATCH] Change default timeout diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197ac..c41930ae7 100644 +index 85d2197a..3b5ce41e 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig @@ -19,5 +19,5 @@ index 85d2197ac..c41930ae7 100644 * UUID used for metrics. */ -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch similarity index 92% rename from Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch index dcafad8d..db4c956e 100644 --- a/Waterfall-Proxy-Patches/0013-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch @@ -1,4 +1,4 @@ -From d1b196832e3a6920299a047bfa7478254fab1182 Mon Sep 17 00:00:00 2001 +From f3f260439d3e290727bca84170308012220de21f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:03 +0800 Subject: [PATCH] Change state to encrypt only if onlineMode is true @@ -18,5 +18,5 @@ index 1ec75614..5f583e6b 100644 { thisState = State.FINISHING; -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch similarity index 87% rename from Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index 45a75c78..3f3b4ad6 100644 --- a/Waterfall-Proxy-Patches/0014-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,11 +1,11 @@ -From fd5189254c8261ce764428c1ab8ee302fc842ca3 Mon Sep 17 00:00:00 2001 +From 12dfe2f9bfb8251974d772be144a3d4cee6af772 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -index d1cd10905..44cb1ce66 100644 +index d1cd1090..44cb1ce6 100644 --- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java @@ -21,7 +21,8 @@ public final class AllowedCharacters @@ -19,5 +19,5 @@ index d1cd10905..44cb1ce66 100644 } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch similarity index 96% rename from Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch index a25ab955..2c979319 100644 --- a/Waterfall-Proxy-Patches/0015-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From 7182131a4230bc24a36f1f0fd7c155edb95e9361 Mon Sep 17 00:00:00 2001 +From 9bdca4aac70c33ec6cfdb26385dfd6644625edc7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 5c05f2b94..606866a52 100644 +index 5c05f2b9..606866a5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -74,5 +74,5 @@ index 5c05f2b94..606866a52 100644 } } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 92% rename from Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 54cebcd7..8a76b9af 100644 --- a/Waterfall-Proxy-Patches/0016-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,4 +1,4 @@ -From 2e9551451687de578103687f9c109fa0cb0941d9 Mon Sep 17 00:00:00 2001 +From 354740798d34dcf425060c6a078fbc3f8e2e4999 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true @@ -18,5 +18,5 @@ index 5f583e6b..ea4f37c5 100644 } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch similarity index 94% rename from Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch rename to Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch index 59e5c4d8..67cea885 100644 --- a/Waterfall-Proxy-Patches/0017-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,4 +1,4 @@ -From 6515f2b44123bddf35ab541ed9a7489498e10099 Mon Sep 17 00:00:00 2001 +From 7580742f7c57391982e8d50f5ece95351d494560 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets @@ -28,5 +28,5 @@ index ea4f37c5..6018dccf 100644 { // Check for multiple connections -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 92% rename from Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch index 3b368216..4450457e 100644 --- a/Waterfall-Proxy-Patches/0018-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From d3de5793409f78a1c29503afe900c04ce69f6b4d Mon Sep 17 00:00:00 2001 +From 9fd7c7d549ca2bffbf5121a98dbc425c197995e3 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -20,5 +20,5 @@ index 43042c6a..9b04f7ca 100644 return; } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch similarity index 93% rename from Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch index 82cf9b5c..4688c108 100644 --- a/Waterfall-Proxy-Patches/0019-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,4 +1,4 @@ -From f62ce8fddd6ad50d94817ae022899a0ee529e47c Mon Sep 17 00:00:00 2001 +From 0334ea06032155229acf53b24afcc09275a295ec Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null @@ -21,5 +21,5 @@ index 6018dccf..cec2fc00 100644 return; } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch similarity index 99% rename from Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index fee35950..c1649d06 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From adc72a242925985dee8270c4b7233a14f8d7938c Mon Sep 17 00:00:00 2001 +From 05455904f913721d646db1e34337e450d144e618 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -116,7 +116,7 @@ index 00000000..81ded224 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ec07ae6f..91da8ab6 100644 +index 4b9b80b9..aa35f870 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b914b5c2..719e73e4 100644 +index 8ce69d2f..727d0165 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -365,5 +365,5 @@ index 654203ab..a840bc70 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch similarity index 98% rename from Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch index 23d8436b..41a49599 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From b7dab4ca2f05f09e2e48856bdf5c402d00bd06ea Mon Sep 17 00:00:00 2001 +From d1ed6cb5cb2eb4a7a6e17455498d26cf2d8e2661 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 719e73e4..536c6052 100644 +index 727d0165..bb532698 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -236,5 +236,5 @@ index 719e73e4..536c6052 100644 + } } -- -2.33.0.windows.2 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch index a4ff044d..469da926 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 30cf3c288a1222d0bc674b91fb9c4aac98734dd6 Mon Sep 17 00:00:00 2001 +From 6f160c7e61e50eb5cca48f1881a4ab051a30c07f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -209,7 +209,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 536c6052..2327e5e3 100644 +index bb532698..2232b9d5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer @@ -230,5 +230,5 @@ index 536c6052..2327e5e3 100644 @Override -- -2.33.0.windows.2 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch index f49c0a2d..4f208f8e 100644 --- a/Waterfall-Proxy-Patches/0023-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 09a2ffeb9e770078c9b024016fc708c6a04a371e Mon Sep 17 00:00:00 2001 +From 02edb203875d8fc08fc20f529b7a401a8b797755 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks @@ -64,5 +64,5 @@ index cefa0206..8d4439ab 100644 } -- -2.33.0.windows.2 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch similarity index 91% rename from Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch index 9ea29399..5b2e5a64 100644 --- a/Waterfall-Proxy-Patches/0024-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch @@ -1,11 +1,11 @@ -From bbcf8ceff1a4dc626dd39f2bc31f6bceae1ac913 Mon Sep 17 00:00:00 2001 +From 4b25defca624ad1857a7474ff85162f11befb2a6 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 91da8ab65..c03e1b513 100644 +index aa35f870..3992f521 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -23,5 +23,5 @@ index 91da8ab65..c03e1b513 100644 if ( packet != null ) { -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0025-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0025-Firewall-System.patch rename to Waterfall-Proxy-Patches/0024-Firewall-System.patch index 1902bc90..dc6db39a 100644 --- a/Waterfall-Proxy-Patches/0025-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From 157518ad0bfc96a066af7348b3cf01fc3efd24bf Mon Sep 17 00:00:00 2001 +From 1fea7bc25b55797f2a9bc2f60f740dafa20ae23e Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -246,7 +246,7 @@ index 00000000..dfb5c6d3 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index c03e1b51..7f4b5b45 100644 +index 3992f521..68d41a89 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -445,5 +445,5 @@ index b3bdfd05..49d53f17 100644 throw new IllegalStateException( "Invalid data request packet" ); } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch similarity index 98% rename from Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch index 32ec88a6..24a330d3 100644 --- a/Waterfall-Proxy-Patches/0026-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 5127c5564e60fe2e59d0ad210b46b0de2cc06711 Mon Sep 17 00:00:00 2001 +From 28b2466c5993962d31f07bcf0d7bb6e2d5a8f314 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -113,5 +113,5 @@ index 22414686..fbc19f66 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch b/Waterfall-Proxy-Patches/0026-Always-release-packets.patch similarity index 92% rename from Waterfall-Proxy-Patches/0027-Always-release-packets.patch rename to Waterfall-Proxy-Patches/0026-Always-release-packets.patch index e08ef5ef..d2302808 100644 --- a/Waterfall-Proxy-Patches/0027-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0026-Always-release-packets.patch @@ -1,11 +1,11 @@ -From 5f8c739acdbcaf1e2e38fab2541c1d4e3a4c2638 Mon Sep 17 00:00:00 2001 +From cb73112031261bc3a8c654d8b111de99d225a84b Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packets diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index fbc19f66b..a2bd24107 100644 +index fbc19f66..a2bd2410 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -117,12 +117,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -42,5 +42,5 @@ index fbc19f66b..a2bd24107 100644 } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch similarity index 96% rename from Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch index d9f2e087..be14af48 100644 --- a/Waterfall-Proxy-Patches/0028-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From f9314b3f2dce279120c4b7408b6afcc0eef1590d Mon Sep 17 00:00:00 2001 +From 07cb259b14e70333203abbdba71f808c30d42212 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -6,7 +6,7 @@ Subject: [PATCH] Added an api method to unload Plugins Format Code to Bungee's code style diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156f..a190dfae8 100644 +index 90031156..a190dfae 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -25,6 +25,7 @@ import java.util.Set; @@ -82,5 +82,5 @@ index 90031156f..a190dfae8 100644 ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] { -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch similarity index 91% rename from Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch index abea274f..defe0775 100644 --- a/Waterfall-Proxy-Patches/0029-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch @@ -1,11 +1,11 @@ -From 872fdc668b2bd4ce164b15b24e9a15426f1e85e1 Mon Sep 17 00:00:00 2001 +From d85700309c2f2e6dcb87a572566072dfea72d82b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3cd..e903313df 100644 +index 7dbbfd3c..e903313d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -32,5 +32,5 @@ index 7dbbfd3cd..e903313df 100644 + } } -- -2.32.0.windows.1 +2.32.0 diff --git a/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch similarity index 97% rename from Waterfall-Proxy-Patches/0030-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0029-Custom-motd-system.patch index bb88b3ba..add58ad9 100644 --- a/Waterfall-Proxy-Patches/0030-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 5be0acb0644d94bb1a2e94ed6ec680e6166f16e7 Mon Sep 17 00:00:00 2001 +From 9e52562225da34ff7c905e2ed1ddaa5e7533686c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -68,5 +68,5 @@ index d1f2ea13..51b5afc2 100644 Callback pingBack = new Callback() -- -2.32.0.windows.1 +2.32.0 diff --git a/pom.xml b/pom.xml index e251aee2..93c4da7a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,16 +3,16 @@ 4.0.0 io.github.waterfallmc - flamecord-super + waterfall-super dev-SNAPSHOT pom - FlameCord-Super + Waterfall-Super Super project for FlameCord. https://github.com/2lstudios-mc/FlameCord - FlameCord-Proxy + Waterfall-Proxy From 94e21a7d42dd1b15b2c2069d609fd25252e9e387 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Dec 2021 11:40:04 -0300 Subject: [PATCH 186/499] 0.6.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index e0df3893..cb8018c4 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..53b78a2f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.8"; ++ return "0.6.9"; } public void reloadMessages() From d93dfe525f7b6756170d9f25a8c6dd7015e451e5 Mon Sep 17 00:00:00 2001 From: Sammwy Date: Sat, 15 Jan 2022 07:15:13 -0300 Subject: [PATCH 187/499] fix & update waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index a078e046..539846d9 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit a078e046a168baa5f004e930253ea1eb469a6ead +Subproject commit 539846d9ab226b37917b09ba0e2bc5f0fffe0bd6 From 0ca8b37b2bf2126e686a7058fb9872b6aeb90401 Mon Sep 17 00:00:00 2001 From: Sammwy Date: Sat, 15 Jan 2022 07:22:19 -0300 Subject: [PATCH 188/499] 0.7.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index cb8018c4..b487564f 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..53b78a2f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.6.9"; ++ return "0.7.0"; } public void reloadMessages() From ac540e0fb7795ae829c0d35fd5c6712d14ba8107 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 13 Feb 2022 13:47:34 -0300 Subject: [PATCH 189/499] Update Waterfall --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 539846d9..65ec15e5 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 539846d9ab226b37917b09ba0e2bc5f0fffe0bd6 +Subproject commit 65ec15e5cce6c64200006c983d53e91a84a6429e From d9a518d8feea94d987bcacf8ffec6e4be896c031 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:49:36 -0300 Subject: [PATCH 190/499] Update 0003-FlameCord-rebrand.patch --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b487564f..655eeee2 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..53b78a2f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.0"; ++ return "0.7.1"; } public void reloadMessages() From 02d28419eb51afa9cd6dfd26d3b1bc2497fbe284 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Mon, 14 Feb 2022 06:12:51 +0100 Subject: [PATCH 191/499] Fix build --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 93c4da7a..a1167dd0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ https://github.com/2lstudios-mc/FlameCord - Waterfall-Proxy + FlameCord-Proxy From 97a44e76d1217ee0c60f92178d1fac4ec8ef7ad5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 14 Feb 2022 18:03:15 -0300 Subject: [PATCH 192/499] final name: FlameCord --- ...ferences-from-Waterfall-to-FlameCord.patch | 15 ++++++++++- .../0004-1.7.x-support.patch | 26 +++++++++---------- ...ateException-to-QuietException-and-e.patch | 6 ++--- .../0019-FlameCord-General-Patch.patch | 12 ++++----- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index c9817506..5399cb32 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,9 +1,22 @@ -From add366ec45d3c5e193842db6e9851981cb8fe15c Mon Sep 17 00:00:00 2001 +From 73739a822f6730c871a88ade6d7fe7d5efbc117c Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to FlameCord +diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml +index 00ce099c..cbd16c34 100644 +--- a/bootstrap/pom.xml ++++ b/bootstrap/pom.xml +@@ -37,7 +37,7 @@ + + + +- Waterfall ++ FlameCord + + + org.apache.maven.plugins diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java index a4516ed9..9838f5c5 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index ef477ba1..44c56cd0 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 19acf73dfa9f88a5671a04880a30b8ad206c702b Mon Sep 17 00:00:00 2001 +From 180dd0525ba0c7d523d38bd430aa4ba59d1018b9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 53b78a2f..8ce69d2f 100644 +index 8b655261..1fe08b80 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1053,10 +1053,10 @@ index 9e74d158..75028024 100644 throw CancelSendSignal.INSTANCE; } 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 871a2990..43042c6a 100644 +index 4a858f31..adc25165 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -194,6 +194,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkNotNull( name, "displayName" ); @@ -1064,7 +1064,7 @@ index 871a2990..43042c6a 100644 displayName = name; } -@@ -509,7 +510,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -506,7 +507,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1073,7 +1073,7 @@ index 871a2990..43042c6a 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -705,6 +706,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -702,6 +703,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1081,7 +1081,7 @@ index 871a2990..43042c6a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -717,6 +719,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -714,6 +716,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1089,7 +1089,7 @@ index 871a2990..43042c6a 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -746,6 +749,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -743,6 +746,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1098,10 +1098,10 @@ index 871a2990..43042c6a 100644 { this.compressionThreshold = compressionThreshold; 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 -index d3650ff8..b10d5b0a 100644 +index 97c4b210..a0b03ec1 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled; +@@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; import io.netty.channel.unix.DomainSocketAddress; import java.io.DataInput; import java.net.InetSocketAddress; @@ -1109,7 +1109,7 @@ index d3650ff8..b10d5b0a 100644 import java.util.ArrayList; import java.util.HashMap; // Waterfall import java.util.List; -@@ -179,7 +180,7 @@ public class DownstreamBridge extends PacketHandler +@@ -184,7 +185,7 @@ public class DownstreamBridge extends PacketHandler switch ( objective.getAction() ) { case 0: @@ -1118,7 +1118,7 @@ index d3650ff8..b10d5b0a 100644 break; case 1: serverScoreboard.removeObjective( objective.getName() ); -@@ -189,7 +190,7 @@ public class DownstreamBridge extends PacketHandler +@@ -194,7 +195,7 @@ public class DownstreamBridge extends PacketHandler if ( oldObjective != null ) { oldObjective.setValue( objective.getValue() ); @@ -1127,7 +1127,7 @@ index d3650ff8..b10d5b0a 100644 } break; default: -@@ -287,19 +288,28 @@ public class DownstreamBridge extends PacketHandler +@@ -292,19 +293,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { diff --git a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch index 4450457e..fda5ab7e 100644 --- a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 9fd7c7d549ca2bffbf5121a98dbc425c197995e3 Mon Sep 17 00:00:00 2001 +From 4df5486ea459a830df12c18a10434cf69306cedf Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 43042c6a..9b04f7ca 100644 +index adc25165..935d2e30 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -308,7 +308,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -311,7 +311,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch index c1649d06..8388cfa4 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 05455904f913721d646db1e34337e450d144e618 Mon Sep 17 00:00:00 2001 +From d2a4a2fcb4e358adff2282a6a8f7eea654156395 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -191,7 +191,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8ce69d2f..727d0165 100644 +index 1fe08b80..4902d4f3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -271,10 +271,10 @@ index 2ee16684..3a41769a 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 9b04f7ca..c63a2b5b 100644 +index 935d2e30..e8eb555c 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -36,6 +36,7 @@ import net.md_5.bungee.api.SkinConfiguration; +@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; import net.md_5.bungee.api.Title; import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.TextComponent; @@ -282,7 +282,7 @@ index 9b04f7ca..c63a2b5b 100644 import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.PermissionCheckEvent; -@@ -66,6 +67,7 @@ import net.md_5.bungee.tab.ServerUnique; +@@ -65,6 +66,7 @@ import net.md_5.bungee.tab.ServerUnique; import net.md_5.bungee.tab.TabList; import net.md_5.bungee.util.CaseInsensitiveSet; import net.md_5.bungee.util.ChatComponentTransformer; @@ -290,7 +290,7 @@ index 9b04f7ca..c63a2b5b 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -388,9 +390,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -391,9 +393,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs From 430e71a459404313d1a5fb2e98af2e8cdfc7f6cb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:57:35 -0300 Subject: [PATCH 193/499] updated source --- .../0003-FlameCord-rebrand.patch | 18 +++- .../0024-Firewall-System.patch | 98 ++++++------------- .../0025-FlameCord-logger-options.patch | 29 ++++-- .../0029-Custom-motd-system.patch | 8 +- 4 files changed, 67 insertions(+), 86 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 655eeee2..a8b6ec49 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From fc1fff4cbc31017a66ef2e1fc02ad66f344983b4 Mon Sep 17 00:00:00 2001 +From 0f33be9482102e95dcc45eafab586d9538b89ef2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c..53b78a2f 100644 +index a4b58d9c..8b655261 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -44,6 +44,20 @@ index 820f7b03..aeda7963 100644 + sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); } } +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index 0c1ecfb8..b2b19996 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler + // Waterfall start + List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); + +- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", ++ // FlameCord - Rebrand ++ ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "FlameCord_Proxy", + bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), + listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); + QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); -- 2.32.0 diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0024-Firewall-System.patch index dc6db39a..149349ae 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0024-Firewall-System.patch @@ -1,4 +1,4 @@ -From 1fea7bc25b55797f2a9bc2f60f740dafa20ae23e Mon Sep 17 00:00:00 2001 +From f879e684f4870dec0814a5353e82d1fd512f6933 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -64,7 +64,7 @@ index 8957c79a..fd889644 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded224..8bb61ac1 100644 +index 81ded224..374ff1b6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; @@ -78,7 +78,7 @@ index 81ded224..8bb61ac1 100644 + @Getter + private int firewallSeconds = 60; + @Getter -+ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam" })); ++ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam","mcbot","mcstorm","dropbot","theresabot" })); + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { try { @@ -246,31 +246,14 @@ index 00000000..dfb5c6d3 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 3992f521..68d41a89 100644 +index 3992f521..7860d265 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -46,8 +46,14 @@ public class MinecraftDecoder extends MessageToMessageDecoder - final int capacity = in.capacity(); - - if (readableBytes > 2097152) { -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ - throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); - } else if (capacity > 2097152) { -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ - throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); - } - } -@@ -108,6 +114,9 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -108,6 +108,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder } else { packetTypeStr = "unknown"; } + -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall } finally { @@ -302,45 +285,11 @@ index bf6f8538..fa0b59c2 100644 case "reload": { // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a41769a..f2805229 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -167,6 +167,9 @@ public class ServerConnector extends PacketHandler - { - if ( packet.packet == null ) - { -+ // FlameCord - Firewall on unexpected packet -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); -+ - throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); - } - } 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 d637999f..f2957c01 100644 +index d637999f..d2ca464d 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 -@@ -159,6 +159,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - if ( packet.packet == null ) - { -+ // FlameCord - Firewall on unexpected packet -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); -+ - throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); - } - } -@@ -399,6 +402,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - break; - default: -+ // FlameCord - Firewall on unexpected packet -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ch.getRemoteAddress()); -+ - throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); - } - } -@@ -413,6 +419,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -413,6 +413,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection disconnect( bungee.getTranslation( "name_invalid" ) ); return; } @@ -379,7 +328,7 @@ index 3503c089..283b3134 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 89a6d14a..22414686 100644 +index 89a6d14a..d46d255b 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; @@ -390,6 +339,25 @@ index 89a6d14a..22414686 100644 import java.util.logging.Level; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; +@@ -146,6 +147,18 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); + ++<<<<<<< Updated upstream ++======= ++ // FlameCord - Option to log exceptions ++ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; ++ ++ // Flamecord - Firewall system ++ if (!(cause instanceof ReadTimeoutException)) ++ { ++ FlameCord.getInstance().getFirewallManager().addFirewalled( ctx.channel().remoteAddress() ); ++ } ++ ++>>>>>>> Stashed changes + if ( logExceptions ) + { + if ( cause instanceof ReadTimeoutException ) 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 a840bc70..f7455a7e 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java @@ -412,7 +380,7 @@ index a840bc70..f7455a7e 100644 return; } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b3bdfd05..49d53f17 100644 +index b1ecb7ef..06dcefa2 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -2,6 +2,8 @@ package net.md_5.bungee.query; @@ -434,16 +402,6 @@ index b3bdfd05..49d53f17 100644 bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); // FlameCord - Close on incorrect magic ctx.close(); -@@ -164,6 +169,9 @@ public class QueryHandler extends SimpleChannelInboundHandler - out.writeByte( 0x00 ); // Null - } else - { -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ - // Error! - throw new IllegalStateException( "Invalid data request packet" ); - } -- 2.32.0 diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch index 24a330d3..4b0151d7 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 28b2466c5993962d31f07bcf0d7bb6e2d5a8f314 Mon Sep 17 00:00:00 2001 +From 14465987214fcf28c77f371a15f1854780cafe49 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8bb61ac1..aafd99d8 100644 +index 374ff1b6..1d875b56 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,16 @@ import net.md_5.bungee.config.Configuration; @@ -38,10 +38,10 @@ index 8bb61ac1..aafd99d8 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 f2957c01..d1f2ea13 100644 +index d2ca464d..45193515 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 -@@ -373,7 +373,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -51,7 +51,7 @@ index f2957c01..d1f2ea13 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -382,7 +383,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -379,7 +380,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -62,7 +62,7 @@ index f2957c01..d1f2ea13 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 22414686..fbc19f66 100644 +index d46d255b..2f281d0c 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -102,13 +102,22 @@ index 22414686..fbc19f66 100644 channel.setRemoteAddress( newAddress ); } -@@ -147,6 +151,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -147,8 +151,6 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); -+ // FlameCord - Option to log exceptions -+ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; -+ +-<<<<<<< Updated upstream +-======= + // FlameCord - Option to log exceptions + logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; + +@@ -157,8 +159,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + FlameCord.getInstance().getFirewallManager().addFirewalled( ctx.channel().remoteAddress() ); + } +- +->>>>>>> Stashed changes ++ if ( logExceptions ) { if ( cause instanceof ReadTimeoutException ) diff --git a/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch index add58ad9..c44257a3 100644 --- a/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From 9e52562225da34ff7c905e2ed1ddaa5e7533686c Mon Sep 17 00:00:00 2001 +From 1117d65ff0475f51ddcc41cb8b5540ff9698f023 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aafd99d8..16e5909a 100644 +index 1d875b56..d320fa94 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -6,12 +6,33 @@ import java.util.ArrayList; @@ -53,10 +53,10 @@ index aafd99d8..16e5909a 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 d1f2ea13..51b5afc2 100644 +index 45193515..7f6a09c2 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 -@@ -253,7 +253,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -250,7 +250,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); From e0c71ad25591245ac44ebb0af1719acccafef0d6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:34:26 -0300 Subject: [PATCH 194/499] encryption packet limit --- .../0028-Apply-packet-limits.patch | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch index defe0775..94a1ff84 100644 --- a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch @@ -1,11 +1,30 @@ -From d85700309c2f2e6dcb87a572566072dfea72d82b Mon Sep 17 00:00:00 2001 +From 8af01fbf2f309700676e8c23474362f7bca3d8db Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +index 86182cdd..b28f4081 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +@@ -61,4 +61,14 @@ public class EncryptionRequest extends DefinedPacket + { + handler.handle( this ); + } ++ ++ @Override ++ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 20 + 256 + 256; // FlameCord - Apply packet limits ++ } ++ ++ @Override ++ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 20 + 1 + 1; // FlameCord - Apply packet limits ++ } + } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..e903313d 100644 +index 7dbbfd3c..b7842055 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -23,12 +42,12 @@ index 7dbbfd3c..e903313d 100644 + + @Override + public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 1036 + 256; // FlameCord - Apply packet limits (by Janmm14) ++ return 1036 + 256; // FlameCord - Apply packet limits + } + + @Override + public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 5; // FlameCord - Apply packet limits (by Janmm14) ++ return 5; // FlameCord - Apply packet limits + } } -- From 0e7ef1b9ee98840a20ed41e5df93923361bd7d0d Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:52:13 -0300 Subject: [PATCH 195/499] Update flamecord-build.yml --- .github/workflows/flamecord-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 6ba7f9a4..59016353 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -15,7 +15,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11, 17] + java: [8, 11, 18] steps: - name: Checkout Repository From 6661e25ac81d1fb2b766c96373825f5b6635c1fc Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Feb 2022 19:07:38 -0300 Subject: [PATCH 196/499] Update flamecord-pull-request.yml --- .github/workflows/flamecord-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml index c12eb25b..22035fde 100644 --- a/.github/workflows/flamecord-pull-request.yml +++ b/.github/workflows/flamecord-pull-request.yml @@ -14,7 +14,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11, 17] + java: [8, 11] steps: - name: Checkout Repository From 647173acc6ebf77115a81f4d74eb5cc9d962942f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Feb 2022 19:07:53 -0300 Subject: [PATCH 197/499] Update flamecord-build.yml --- .github/workflows/flamecord-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 59016353..4cf37dd9 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -15,7 +15,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11, 18] + java: [8, 11] steps: - name: Checkout Repository From bd6d6d0af4beac5e73468ad4cdadde21495884ac Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 19 Feb 2022 12:21:14 -0300 Subject: [PATCH 198/499] Remove patch 12 --- ...o-encrypt-only-if-onlineMode-is-true.patch | 22 ------------------- ...012-Don-t-allow-name-containing-dot.patch} | 2 +- ...3-Use-pipeline-to-reduce-redundancy.patch} | 2 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 6 ++--- ...-to-avoid-multiple-incoming-packets.patch} | 8 +++---- ...teException-to-QuietException-and-e.patch} | 2 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 6 ++--- ...tch => 0018-FlameCord-General-Patch.patch} | 4 ++-- ...tch => 0019-FlameCord-module-system.patch} | 4 ++-- ...020-FlameCord-message-configuration.patch} | 4 ++-- ...ch => 0021-Fix-ByteBuf-memory-leaks.patch} | 2 +- ...> 0022-Check-if-packetID-is-invalid.patch} | 2 +- ...ystem.patch => 0023-Firewall-System.patch} | 4 ++-- ...ch => 0024-FlameCord-logger-options.patch} | 4 ++-- ...atch => 0025-Always-release-packets.patch} | 4 ++-- ...ded-an-api-method-to-unload-Plugins.patch} | 2 +- ...s.patch => 0027-Apply-packet-limits.patch} | 2 +- ...em.patch => 0028-Custom-motd-system.patch} | 4 ++-- 18 files changed, 31 insertions(+), 53 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch rename Waterfall-Proxy-Patches/{0013-Don-t-allow-name-containing-dot.patch => 0012-Don-t-allow-name-containing-dot.patch} (92%) rename Waterfall-Proxy-Patches/{0014-Use-pipeline-to-reduce-redundancy.patch => 0013-Use-pipeline-to-reduce-redundancy.patch} (98%) rename Waterfall-Proxy-Patches/{0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (84%) rename Waterfall-Proxy-Patches/{0016-Finish-early-to-avoid-multiple-incoming-packets.patch => 0015-Finish-early-to-avoid-multiple-incoming-packets.patch} (83%) rename Waterfall-Proxy-Patches/{0017-Change-IllegalStateException-to-QuietException-and-e.patch => 0016-Change-IllegalStateException-to-QuietException-and-e.patch} (94%) rename Waterfall-Proxy-Patches/{0018-Don-t-declare-uuid-unless-it-s-null.patch => 0017-Don-t-declare-uuid-unless-it-s-null.patch} (86%) rename Waterfall-Proxy-Patches/{0019-FlameCord-General-Patch.patch => 0018-FlameCord-General-Patch.patch} (99%) rename Waterfall-Proxy-Patches/{0020-FlameCord-module-system.patch => 0019-FlameCord-module-system.patch} (99%) rename Waterfall-Proxy-Patches/{0021-FlameCord-message-configuration.patch => 0020-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0022-Fix-ByteBuf-memory-leaks.patch => 0021-Fix-ByteBuf-memory-leaks.patch} (97%) rename Waterfall-Proxy-Patches/{0023-Check-if-packetID-is-invalid.patch => 0022-Check-if-packetID-is-invalid.patch} (94%) rename Waterfall-Proxy-Patches/{0024-Firewall-System.patch => 0023-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0025-FlameCord-logger-options.patch => 0024-FlameCord-logger-options.patch} (98%) rename Waterfall-Proxy-Patches/{0026-Always-release-packets.patch => 0025-Always-release-packets.patch} (93%) rename Waterfall-Proxy-Patches/{0027-Added-an-api-method-to-unload-Plugins.patch => 0026-Added-an-api-method-to-unload-Plugins.patch} (98%) rename Waterfall-Proxy-Patches/{0028-Apply-packet-limits.patch => 0027-Apply-packet-limits.patch} (97%) rename Waterfall-Proxy-Patches/{0029-Custom-motd-system.patch => 0028-Custom-motd-system.patch} (97%) diff --git a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch deleted file mode 100644 index db4c956e..00000000 --- a/Waterfall-Proxy-Patches/0012-Change-state-to-encrypt-only-if-onlineMode-is-true.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f3f260439d3e290727bca84170308012220de21f Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:25:03 +0800 -Subject: [PATCH] Change state to encrypt only if onlineMode is true - - -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 1ec75614..5f583e6b 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 -@@ -447,6 +447,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - thisState = State.ENCRYPT; - unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); -+ // FlameCord - Change state to encrypt only if onlineMode is true -+ thisState = State.ENCRYPT; - } else - { - thisState = State.FINISHING; --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch similarity index 92% rename from Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch index 3f3b4ad6..617a5037 100644 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch @@ -1,4 +1,4 @@ -From 12dfe2f9bfb8251974d772be144a3d4cee6af772 Mon Sep 17 00:00:00 2001 +From 1110d8e2d16633d02c7839b38f800ee5cedc0a84 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch similarity index 98% rename from Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch index 2c979319..f4ee95a3 100644 --- a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch @@ -1,4 +1,4 @@ -From 9bdca4aac70c33ec6cfdb26385dfd6644625edc7 Mon Sep 17 00:00:00 2001 +From 290e7f633bb2ecffad78a8a2518ea9efdf890767 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 84% rename from Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 8a76b9af..786d4716 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 354740798d34dcf425060c6a078fbc3f8e2e4999 Mon Sep 17 00:00:00 2001 +From 78fe174f45379f66c5a409e723804bd147b6859f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 5f583e6b..ea4f37c5 100644 +index 1ec75614..b402d1d3 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 -@@ -697,7 +697,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -695,7 +695,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch similarity index 83% rename from Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch rename to Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch index 67cea885..a7d33d6d 100644 --- a/Waterfall-Proxy-Patches/0016-Finish-early-to-avoid-multiple-incoming-packets.patch +++ b/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch @@ -1,14 +1,14 @@ -From 7580742f7c57391982e8d50f5ece95351d494560 Mon Sep 17 00:00:00 2001 +From b38fb97cbf65ca5dc17ae20774c3036622b54754 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:36:08 +0800 Subject: [PATCH] Finish early to avoid multiple incoming packets 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 ea4f37c5..6018dccf 100644 +index b402d1d3..47440b2c 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 -@@ -466,6 +466,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -464,6 +464,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -17,7 +17,7 @@ index ea4f37c5..6018dccf 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start if (sharedKey instanceof SecretKeySpec) { -@@ -525,6 +527,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -523,6 +525,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection private void finish() { diff --git a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 94% rename from Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch index fda5ab7e..5ad084f1 100644 --- a/Waterfall-Proxy-Patches/0017-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 4df5486ea459a830df12c18a10434cf69306cedf Mon Sep 17 00:00:00 2001 +From 6281a0651c5c8732d17ee537ca78bde4f2daef2a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain diff --git a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch similarity index 86% rename from Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch index 4688c108..53a1d417 100644 --- a/Waterfall-Proxy-Patches/0018-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 0334ea06032155229acf53b24afcc09275a295ec Mon Sep 17 00:00:00 2001 +From 722de48f1ed260e5a8fa1344fd249563597842e2 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 6018dccf..cec2fc00 100644 +index 47440b2c..7acd433b 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 -@@ -509,7 +509,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -507,7 +507,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch similarity index 99% rename from Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 8388cfa4..d3607de0 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From d2a4a2fcb4e358adff2282a6a8f7eea654156395 Mon Sep 17 00:00:00 2001 +From 1c0261a04dc351ee4feab86eb3edefd09fcb7d06 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -305,7 +305,7 @@ index 935d2e30..e8eb555c 100644 b.connect().addListener( listener ); } 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 cec2fc00..d637999f 100644 +index 7acd433b..4f5d046d 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch similarity index 99% rename from Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 41a49599..31047b58 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From d1ed6cb5cb2eb4a7a6e17455498d26cf2d8e2661 Mon Sep 17 00:00:00 2001 +From 645dc7a5e1eaa711b171d4c497b533e0b3268b1f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -134,7 +134,7 @@ index 00000000..e82c4844 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 727d0165..bb532698 100644 +index 4902d4f3..82f5f65c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 469da926..c0b8e49e 100644 --- a/Waterfall-Proxy-Patches/0021-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 6f160c7e61e50eb5cca48f1881a4ab051a30c07f Mon Sep 17 00:00:00 2001 +From 0959726d85593ea41ebe631a4113d54fcb114ff7 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -209,7 +209,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index bb532698..2232b9d5 100644 +index 82f5f65c..23cb8839 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch index 4f208f8e..9e07a2d7 100644 --- a/Waterfall-Proxy-Patches/0022-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 02edb203875d8fc08fc20f529b7a401a8b797755 Mon Sep 17 00:00:00 2001 +From 3d9b611b86d0f883891e74f0bfd0400160db7fd5 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch similarity index 94% rename from Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch index 5b2e5a64..c129ddae 100644 --- a/Waterfall-Proxy-Patches/0023-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch @@ -1,4 +1,4 @@ -From 4b25defca624ad1857a7474ff85162f11befb2a6 Mon Sep 17 00:00:00 2001 +From f5878474798c7a033ebc36a4ae35b4e56ddaa235 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/Waterfall-Proxy-Patches/0024-Firewall-System.patch b/Waterfall-Proxy-Patches/0023-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0024-Firewall-System.patch rename to Waterfall-Proxy-Patches/0023-Firewall-System.patch index 149349ae..614f9c47 100644 --- a/Waterfall-Proxy-Patches/0024-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0023-Firewall-System.patch @@ -1,4 +1,4 @@ -From f879e684f4870dec0814a5353e82d1fd512f6933 Mon Sep 17 00:00:00 2001 +From 5c9ce1a80b941670b0663ba9b4643d659b313e73 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -286,7 +286,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); 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 d637999f..d2ca464d 100644 +index 4f5d046d..cbf438a4 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 @@ -413,6 +413,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch similarity index 98% rename from Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch index 4b0151d7..4e0c386b 100644 --- a/Waterfall-Proxy-Patches/0025-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 14465987214fcf28c77f371a15f1854780cafe49 Mon Sep 17 00:00:00 2001 +From 0d7bf718907da4d72bf74f027bbb161b7945466f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -38,7 +38,7 @@ index 374ff1b6..1d875b56 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 d2ca464d..45193515 100644 +index cbf438a4..e14f1b7b 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 @@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0026-Always-release-packets.patch b/Waterfall-Proxy-Patches/0025-Always-release-packets.patch similarity index 93% rename from Waterfall-Proxy-Patches/0026-Always-release-packets.patch rename to Waterfall-Proxy-Patches/0025-Always-release-packets.patch index d2302808..9bf633b6 100644 --- a/Waterfall-Proxy-Patches/0026-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0025-Always-release-packets.patch @@ -1,11 +1,11 @@ -From cb73112031261bc3a8c654d8b111de99d225a84b Mon Sep 17 00:00:00 2001 +From 2dfb39a36578b4d970c594a2e47fcac65926c4bc Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packets diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index fbc19f66..a2bd2410 100644 +index 2f281d0c..e5e98197 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -117,12 +117,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch similarity index 98% rename from Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch index be14af48..82ae557c 100644 --- a/Waterfall-Proxy-Patches/0027-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 07cb259b14e70333203abbdba71f808c30d42212 Mon Sep 17 00:00:00 2001 +From c62f85d0b4e8993a676ba535fe830dfca3f9f9f7 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins diff --git a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch similarity index 97% rename from Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch index 94a1ff84..c3aeadca 100644 --- a/Waterfall-Proxy-Patches/0028-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 8af01fbf2f309700676e8c23474362f7bca3d8db Mon Sep 17 00:00:00 2001 +From e9f150837aef91884cb8a32676131fc4013a60d0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0028-Custom-motd-system.patch similarity index 97% rename from Waterfall-Proxy-Patches/0029-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0028-Custom-motd-system.patch index c44257a3..473e062a 100644 --- a/Waterfall-Proxy-Patches/0029-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0028-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 1117d65ff0475f51ddcc41cb8b5540ff9698f023 Mon Sep 17 00:00:00 2001 +From 93f875968c671b81203120938bad781a62c56dff Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -53,7 +53,7 @@ index 1d875b56..d320fa94 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 45193515..7f6a09c2 100644 +index e14f1b7b..0469de2b 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 @@ -250,7 +250,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection From dfbb7c9ccd0222d63069f9861bd34c764540e987 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:50:21 -0300 Subject: [PATCH 199/499] Use TCP Fast Open --- .../0029-TCP-Fast-Open.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch diff --git a/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch new file mode 100644 index 00000000..9e698f36 --- /dev/null +++ b/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch @@ -0,0 +1,37 @@ +From d08330ba771879c20232f96cd93817f836c310dc Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 24 Feb 2022 23:41:57 -0300 +Subject: [PATCH] TCP Fast Open + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index d320fa94..c5aafda0 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ // FlameCord - TCP Fast Open ++ @Getter ++ private int tcpFastOpen = 3; ++ + private List colors(final List strings) { + for (int i = 0; i < strings.size(); i++) { + strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); +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 f7455a7e..b762d58d 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 +@@ -206,6 +206,8 @@ public class PipelineUtils + // IP_TOS is not supported (Windows XP / Windows Server 2003) + } + ch.config().setOption( ChannelOption.TCP_NODELAY, true ); ++ // FlameCord - TCP Fast Open ++ ch.config().setOption( ChannelOption.TCP_FASTOPEN, FlameCord.getInstance().getFlameCordConfiguration().getTcpFastOpen() ); + ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); + ch.config().setWriteBufferWaterMark( MARK ); + +-- +2.32.0 + From bfeb0bd9fa588b7d8557ce9e6492e8bd3f972ef2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 00:13:37 -0300 Subject: [PATCH 200/499] fix TCP Fast Open config --- Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch index 9e698f36..64b6f3b6 100644 --- a/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From d08330ba771879c20232f96cd93817f836c310dc Mon Sep 17 00:00:00 2001 +From c5bfc9f7157dff54fbf9f2f860790244aafe55b7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d320fa94..c5aafda0 100644 +index d320fa94..d0fb0de2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,6 +19,15 @@ index d320fa94..c5aafda0 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); +@@ -65,6 +69,8 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ + this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); + this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); + 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 f7455a7e..b762d58d 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java From e422dfc79eb717c14d0958f2ecf8ba3a98e5c7a1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:38:45 -0300 Subject: [PATCH 201/499] InitialHandler Processing State --- ...teException-to-QuietException-and-e.patch} | 2 +- ...y-to-avoid-multiple-incoming-packets.patch | 32 ---------- ...Don-t-declare-uuid-unless-it-s-null.patch} | 6 +- ...tch => 0017-FlameCord-General-Patch.patch} | 4 +- ...tch => 0018-FlameCord-module-system.patch} | 2 +- ...019-FlameCord-message-configuration.patch} | 2 +- ...ch => 0020-Fix-ByteBuf-memory-leaks.patch} | 2 +- ...> 0021-Check-if-packetID-is-invalid.patch} | 2 +- ...ystem.patch => 0022-Firewall-System.patch} | 4 +- ...ch => 0023-FlameCord-logger-options.patch} | 4 +- ...atch => 0024-Always-release-packets.patch} | 2 +- ...ded-an-api-method-to-unload-Plugins.patch} | 2 +- ...s.patch => 0026-Apply-packet-limits.patch} | 2 +- ...em.patch => 0027-Custom-motd-system.patch} | 4 +- ...st-Open.patch => 0028-TCP-Fast-Open.patch} | 2 +- ...0029-InitialHandler-Processing-State.patch | 62 +++++++++++++++++++ 16 files changed, 82 insertions(+), 52 deletions(-) rename Waterfall-Proxy-Patches/{0016-Change-IllegalStateException-to-QuietException-and-e.patch => 0015-Change-IllegalStateException-to-QuietException-and-e.patch} (94%) delete mode 100644 Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch rename Waterfall-Proxy-Patches/{0017-Don-t-declare-uuid-unless-it-s-null.patch => 0016-Don-t-declare-uuid-unless-it-s-null.patch} (86%) rename Waterfall-Proxy-Patches/{0018-FlameCord-General-Patch.patch => 0017-FlameCord-General-Patch.patch} (99%) rename Waterfall-Proxy-Patches/{0019-FlameCord-module-system.patch => 0018-FlameCord-module-system.patch} (99%) rename Waterfall-Proxy-Patches/{0020-FlameCord-message-configuration.patch => 0019-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0021-Fix-ByteBuf-memory-leaks.patch => 0020-Fix-ByteBuf-memory-leaks.patch} (97%) rename Waterfall-Proxy-Patches/{0022-Check-if-packetID-is-invalid.patch => 0021-Check-if-packetID-is-invalid.patch} (94%) rename Waterfall-Proxy-Patches/{0023-Firewall-System.patch => 0022-Firewall-System.patch} (99%) rename Waterfall-Proxy-Patches/{0024-FlameCord-logger-options.patch => 0023-FlameCord-logger-options.patch} (98%) rename Waterfall-Proxy-Patches/{0025-Always-release-packets.patch => 0024-Always-release-packets.patch} (95%) rename Waterfall-Proxy-Patches/{0026-Added-an-api-method-to-unload-Plugins.patch => 0025-Added-an-api-method-to-unload-Plugins.patch} (98%) rename Waterfall-Proxy-Patches/{0027-Apply-packet-limits.patch => 0026-Apply-packet-limits.patch} (97%) rename Waterfall-Proxy-Patches/{0028-Custom-motd-system.patch => 0027-Custom-motd-system.patch} (97%) rename Waterfall-Proxy-Patches/{0029-TCP-Fast-Open.patch => 0028-TCP-Fast-Open.patch} (97%) create mode 100644 Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch diff --git a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 94% rename from Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch index 5ad084f1..20d03ad3 100644 --- a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 6281a0651c5c8732d17ee537ca78bde4f2daef2a Mon Sep 17 00:00:00 2001 +From 741f02f0787e16c9032d2a8490f669b69963dcda Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain diff --git a/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch b/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch deleted file mode 100644 index a7d33d6d..00000000 --- a/Waterfall-Proxy-Patches/0015-Finish-early-to-avoid-multiple-incoming-packets.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b38fb97cbf65ca5dc17ae20774c3036622b54754 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:36:08 +0800 -Subject: [PATCH] Finish early to avoid multiple incoming packets - - -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 b402d1d3..47440b2c 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 -@@ -464,6 +464,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); - -+ // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHING; - SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); - // Waterfall start - if (sharedKey instanceof SecretKeySpec) { -@@ -523,6 +525,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - - private void finish() - { -+ // FlameCord - Finish here to avoid multiple incoming packets -+ thisState = State.FINISHING; -+ - if ( isOnlineMode() ) - { - // Check for multiple connections --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch similarity index 86% rename from Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index 53a1d417..d006fa05 100644 --- a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 722de48f1ed260e5a8fa1344fd249563597842e2 Mon Sep 17 00:00:00 2001 +From 0ddd8121e5e1bb37c08836aef5189d3b4a4a8a7d Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 47440b2c..7acd433b 100644 +index b402d1d3..0b5faf6b 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 -@@ -507,7 +507,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -505,7 +505,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch similarity index 99% rename from Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index d3607de0..5160c47f 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 1c0261a04dc351ee4feab86eb3edefd09fcb7d06 Mon Sep 17 00:00:00 2001 +From bd296fecf532bf07f59fb6a79acdbe7b888f004c Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -305,7 +305,7 @@ index 935d2e30..e8eb555c 100644 b.connect().addListener( listener ); } 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 7acd433b..4f5d046d 100644 +index 0b5faf6b..39c54cf1 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch similarity index 99% rename from Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch index 31047b58..70ec2173 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 645dc7a5e1eaa711b171d4c497b533e0b3268b1f Mon Sep 17 00:00:00 2001 +From d67854d0c57edad3fc8a7ed3ffaf7f537c19c810 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index c0b8e49e..2a4045eb 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 0959726d85593ea41ebe631a4113d54fcb114ff7 Mon Sep 17 00:00:00 2001 +From db9dc55944664f345292846ab3e07189d26abc25 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch index 9e07a2d7..9d560a3b 100644 --- a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 3d9b611b86d0f883891e74f0bfd0400160db7fd5 Mon Sep 17 00:00:00 2001 +From 200b5bcd9b96acddc178ec7768fe75257937ffc1 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch similarity index 94% rename from Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch index c129ddae..e836a7c4 100644 --- a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch @@ -1,4 +1,4 @@ -From f5878474798c7a033ebc36a4ae35b4e56ddaa235 Mon Sep 17 00:00:00 2001 +From c727441bc5d674eface4fa65b416aceca4477406 Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/Waterfall-Proxy-Patches/0023-Firewall-System.patch b/Waterfall-Proxy-Patches/0022-Firewall-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0023-Firewall-System.patch rename to Waterfall-Proxy-Patches/0022-Firewall-System.patch index 614f9c47..6b2ba2e6 100644 --- a/Waterfall-Proxy-Patches/0023-Firewall-System.patch +++ b/Waterfall-Proxy-Patches/0022-Firewall-System.patch @@ -1,4 +1,4 @@ -From 5c9ce1a80b941670b0663ba9b4643d659b313e73 Mon Sep 17 00:00:00 2001 +From ed7c49eb318e9bcdbcc8691d17dcb783d2382101 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 22:54:44 -0300 Subject: [PATCH] Firewall System @@ -286,7 +286,7 @@ index bf6f8538..fa0b59c2 100644 // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); 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 4f5d046d..cbf438a4 100644 +index 39c54cf1..3107cb69 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 @@ -413,6 +413,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch similarity index 98% rename from Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch index 4e0c386b..8f43b3f6 100644 --- a/Waterfall-Proxy-Patches/0024-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 0d7bf718907da4d72bf74f027bbb161b7945466f Mon Sep 17 00:00:00 2001 +From 6763ff02f698658f565186581d16667238c4e2e6 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -38,7 +38,7 @@ index 374ff1b6..1d875b56 100644 this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); 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 cbf438a4..e14f1b7b 100644 +index 3107cb69..220b7924 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 @@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0025-Always-release-packets.patch b/Waterfall-Proxy-Patches/0024-Always-release-packets.patch similarity index 95% rename from Waterfall-Proxy-Patches/0025-Always-release-packets.patch rename to Waterfall-Proxy-Patches/0024-Always-release-packets.patch index 9bf633b6..545965cd 100644 --- a/Waterfall-Proxy-Patches/0025-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0024-Always-release-packets.patch @@ -1,4 +1,4 @@ -From 2dfb39a36578b4d970c594a2e47fcac65926c4bc Mon Sep 17 00:00:00 2001 +From f33b7f843ea1f24793397d3090efc0253d2352ba Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packets diff --git a/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch similarity index 98% rename from Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch index 82ae557c..41fe15aa 100644 --- a/Waterfall-Proxy-Patches/0026-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From c62f85d0b4e8993a676ba535fe830dfca3f9f9f7 Mon Sep 17 00:00:00 2001 +From 546e4b91c6494dc9f00fd4afd009f59a211d32e8 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins diff --git a/Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch similarity index 97% rename from Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch index c3aeadca..8d1134ac 100644 --- a/Waterfall-Proxy-Patches/0027-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From e9f150837aef91884cb8a32676131fc4013a60d0 Mon Sep 17 00:00:00 2001 +From 69ec2dd1495c968ba7e9e4bb71138c89c866252f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/Waterfall-Proxy-Patches/0028-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0027-Custom-motd-system.patch similarity index 97% rename from Waterfall-Proxy-Patches/0028-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0027-Custom-motd-system.patch index 473e062a..dc68c731 100644 --- a/Waterfall-Proxy-Patches/0028-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0027-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 93f875968c671b81203120938bad781a62c56dff Mon Sep 17 00:00:00 2001 +From 6727e94ac5d06809541d0d437985d742cdd49137 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -53,7 +53,7 @@ index 1d875b56..d320fa94 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 e14f1b7b..0469de2b 100644 +index 220b7924..4295fd68 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 @@ -250,7 +250,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch similarity index 97% rename from Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch rename to Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch index 64b6f3b6..9ef55edf 100644 --- a/Waterfall-Proxy-Patches/0029-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch @@ -1,4 +1,4 @@ -From c5bfc9f7157dff54fbf9f2f860790244aafe55b7 Mon Sep 17 00:00:00 2001 +From 78aa1b77b4919f816e9ca983c500f688d4c3643e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch new file mode 100644 index 00000000..88033c49 --- /dev/null +++ b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch @@ -0,0 +1,62 @@ +From 3534b38cccbcdd2838d7c994f51cfcf3977f0937 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 25 Feb 2022 12:28:31 -0300 +Subject: [PATCH] InitialHandler Processing State + + +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 4295fd68..5296a5ae 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 +@@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + private enum State + { + +- HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; ++ PROCESSING, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; + } + + private boolean canSendKickMessage() +@@ -248,6 +248,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(StatusRequest statusRequest) throws Exception + { + Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ++ thisState = State.PROCESSING; + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); + // FlameCord - Custom motd +@@ -328,6 +329,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + // FlameCord - Never accept invalid packets + Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); ++ thisState = State.PROCESSING; + + unsafe.sendPacket( ping ); + +@@ -339,6 +341,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(Handshake handshake) throws Exception + { + Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); ++ thisState = State.PROCESSING; + this.handshake = handshake; + ch.setVersion( handshake.getProtocolVersion() ); + +@@ -411,6 +414,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(LoginRequest loginRequest) throws Exception + { + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); ++ thisState = State.PROCESSING; + + if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + { +@@ -478,6 +482,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(final EncryptionResponse encryptResponse) throws Exception + { + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); ++ thisState = State.PROCESSING; + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + // Waterfall start +-- +2.32.0 + From 1ac9a3b103c03d595f15072a399141279b329678 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 19:32:55 -0300 Subject: [PATCH 202/499] InitialHandler PROCESSING_USERNAME State --- ...0029-InitialHandler-Processing-State.patch | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch index 88033c49..292d92b7 100644 --- a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 3534b38cccbcdd2838d7c994f51cfcf3977f0937 Mon Sep 17 00:00:00 2001 +From cf468c96ce1390300c7ec73f3bf3a78df012cd10 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 4295fd68..5296a5ae 100644 +index 4295fd68..26a3dd25 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 @@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -13,7 +13,7 @@ index 4295fd68..5296a5ae 100644 { - HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; -+ PROCESSING, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; ++ PROCESSING, PROCESSING_USERNAME, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; } private boolean canSendKickMessage() @@ -37,7 +37,7 @@ index 4295fd68..5296a5ae 100644 public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ thisState = State.PROCESSING; ++ thisState = State.PROCESSING_USERNAME; this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); @@ -57,6 +57,23 @@ index 4295fd68..5296a5ae 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start +@@ -705,14 +710,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void setOnlineMode(boolean onlineMode) + { +- Preconditions.checkState( thisState == State.USERNAME, "Can only set online mode status whilst state is username" ); ++ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set online mode status whilst state is username" ); + this.onlineMode = onlineMode; + } + + @Override + public void setUniqueId(UUID uuid) + { +- Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); ++ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set uuid while state is username" ); + // FlameCord - Allow custom uuids even if onlineMode is true + this.uniqueId = uuid; + } -- 2.32.0 From c505d645800e448aec32af6aeacc54f145dea743 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 23:09:05 -0300 Subject: [PATCH 203/499] 0.7.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index a8b6ec49..edcece9e 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..8b655261 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.1"; ++ return "0.7.2"; } public void reloadMessages() From efbe80e5ec5cdea86daa0ba45abedfb20c72657e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 23:45:36 -0300 Subject: [PATCH 204/499] Fix Username Processing --- .../0029-InitialHandler-Processing-State.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch index 292d92b7..c8174c6c 100644 --- a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From cf468c96ce1390300c7ec73f3bf3a78df012cd10 Mon Sep 17 00:00:00 2001 +From b15eb1a4f0883814e41941d423325256e3306fc6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 4295fd68..26a3dd25 100644 +index 4295fd68..bf5e49e2 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 @@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -37,7 +37,7 @@ index 4295fd68..26a3dd25 100644 public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ thisState = State.PROCESSING_USERNAME; ++ thisState = State.PROCESSING; this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); @@ -45,7 +45,7 @@ index 4295fd68..26a3dd25 100644 public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); -+ thisState = State.PROCESSING; ++ thisState = State.PROCESSING_USERNAME; if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { From 438ca910e3aab5d030d3d67cadeeb12b1c620070 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:38:23 -0300 Subject: [PATCH 205/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 65ec15e5..0e326b5b 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 65ec15e5cce6c64200006c983d53e91a84a6429e +Subproject commit 0e326b5bc8b84cfa05bd4de52a6de67047dce4e7 From 631c66644d2de4b7086ac8d687ab41041dc86144 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:41:16 -0300 Subject: [PATCH 206/499] 0.7.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index edcece9e..9d027b5c 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..8b655261 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.2"; ++ return "0.7.3"; } public void reloadMessages() From e9464dab42d1a51cf557d012309368baafbd128b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:45:17 -0300 Subject: [PATCH 207/499] Allow kick message on PROCESSING_USERNAME --- .../0029-InitialHandler-Processing-State.patch | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch index c8174c6c..51db23c5 100644 --- a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From b15eb1a4f0883814e41941d423325256e3306fc6 Mon Sep 17 00:00:00 2001 +From 4c9f429e23271a52826f3c50bbdb35d7955f2073 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 4295fd68..bf5e49e2 100644 +index 4295fd68..75a73df3 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 -@@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -128,12 +128,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection private enum State { @@ -17,6 +17,12 @@ index 4295fd68..bf5e49e2 100644 } private boolean canSendKickMessage() + { +- return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; ++ return thisState == State.PROCESSING_USERNAME || thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; + } + + @Override @@ -248,6 +248,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { From ddc4c80d286a17850bdd85b4d0a711d2a2105580 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:03:22 -0300 Subject: [PATCH 208/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 0e326b5b..80a64a6f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 0e326b5bc8b84cfa05bd4de52a6de67047dce4e7 +Subproject commit 80a64a6f08eb4f00a12fd98991ca6640b4d5a3f0 From e2ed62346877ce12b0bcb5bb5a4d6b6eefd7de10 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:03:45 -0300 Subject: [PATCH 209/499] 0.7.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 9d027b5c..dd5cc726 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..8b655261 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.3"; ++ return "0.7.4"; } public void reloadMessages() From 3847290d6600ae3ba6c9b68c7ca539da7608f4a7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:38:12 -0300 Subject: [PATCH 210/499] Antibot System --- .../0022-Firewall-System.patch | 407 --------- ...ch => 0022-FlameCord-logger-options.patch} | 46 +- ...atch => 0023-Always-release-packets.patch} | 8 +- ...ded-an-api-method-to-unload-Plugins.patch} | 2 +- ...s.patch => 0025-Apply-packet-limits.patch} | 2 +- ...em.patch => 0026-Custom-motd-system.patch} | 8 +- ...st-Open.patch => 0027-TCP-Fast-Open.patch} | 10 +- ...028-InitialHandler-Processing-State.patch} | 8 +- .../0029-Antibot-System.patch | 854 ++++++++++++++++++ 9 files changed, 891 insertions(+), 454 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0022-Firewall-System.patch rename Waterfall-Proxy-Patches/{0023-FlameCord-logger-options.patch => 0022-FlameCord-logger-options.patch} (80%) rename Waterfall-Proxy-Patches/{0024-Always-release-packets.patch => 0023-Always-release-packets.patch} (84%) rename Waterfall-Proxy-Patches/{0025-Added-an-api-method-to-unload-Plugins.patch => 0024-Added-an-api-method-to-unload-Plugins.patch} (98%) rename Waterfall-Proxy-Patches/{0026-Apply-packet-limits.patch => 0025-Apply-packet-limits.patch} (97%) rename Waterfall-Proxy-Patches/{0027-Custom-motd-system.patch => 0026-Custom-motd-system.patch} (95%) rename Waterfall-Proxy-Patches/{0028-TCP-Fast-Open.patch => 0027-TCP-Fast-Open.patch} (90%) rename Waterfall-Proxy-Patches/{0029-InitialHandler-Processing-State.patch => 0028-InitialHandler-Processing-State.patch} (94%) create mode 100644 Waterfall-Proxy-Patches/0029-Antibot-System.patch diff --git a/Waterfall-Proxy-Patches/0022-Firewall-System.patch b/Waterfall-Proxy-Patches/0022-Firewall-System.patch deleted file mode 100644 index 6b2ba2e6..00000000 --- a/Waterfall-Proxy-Patches/0022-Firewall-System.patch +++ /dev/null @@ -1,407 +0,0 @@ -From ed7c49eb318e9bcdbcc8691d17dcb783d2382101 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 30 Apr 2021 22:54:44 -0300 -Subject: [PATCH] Firewall System - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79a..fd889644 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -6,6 +6,7 @@ import java.util.logging.Logger; - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; - import lombok.Getter; - import net.md_5.bungee.config.ConfigurationProvider; - import net.md_5.bungee.config.YamlConfiguration; -@@ -14,12 +15,15 @@ public class FlameCord { - @Getter - private static FlameCord instance; - @Getter -+ private final FirewallManager firewallManager; -+ @Getter - private final FlameCordConfiguration flameCordConfiguration; - @Getter - private final ModulesConfiguration modulesConfiguration; - @Getter - private final MessagesConfiguration messagesConfiguration; - @Getter -+ private final Thread thread; - private boolean running = true; - - public static void renew(final Logger logger, final Collection whitelistedAddresses) { -@@ -36,7 +40,29 @@ public class FlameCord { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); -+ this.firewallManager = new FirewallManager(logger, whitelistedAddresses, -+ flameCordConfiguration.getFirewallSeconds()); - this.modulesConfiguration = new ModulesConfiguration(configurationProvider); - this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -+ this.thread = new Thread() { -+ @Override -+ public void run() { -+ while (running) { -+ try { -+ sleep(1000L); -+ -+ if (!running) { -+ return; -+ } -+ -+ firewallManager.tick(); -+ } catch (final Exception e) { -+ // Ignored -+ } -+ } -+ } -+ }; -+ -+ this.thread.start(); - } - } -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded224..374ff1b6 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration { -+ @Getter -+ private boolean firewallNotify = true; -+ @Getter -+ private boolean firewallEnabled = true; -+ @Getter -+ private int firewallSeconds = 60; -+ @Getter -+ private Collection firewallNames = new HashSet<>(Arrays.asList(new String[] { "mcspam","mcbot","mcstorm","dropbot","theresabot" })); -+ - public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { - try { - final String fileName = "./flamecord.yml"; -@@ -25,6 +34,11 @@ public class FlameCordConfiguration { - configuration = configurationProvider.load(configurationFile); - } - -+ this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); -+ this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); -+ this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); -+ this.firewallNames = setIfUnexistant("firewall.names", this.firewallNames, configuration); -+ - if (!configurationExists) { - configurationProvider.save(configuration, configurationFile); - } -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index a32522fe..72d48d66 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -82,9 +82,17 @@ public class MessagesConfiguration { - setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); - - // FlameCord -+ setIfUnexistant("firewall_added", "&e{0}&c had been firewalled from the proxy!", configuration); -+ setIfUnexistant("firewall_blocked", "&e{0}&c is firewalled from the proxy, request blocked!", -+ configuration); -+ setIfUnexistant("firewall_info", -+ "&aThere are&b {0} &aaddresses firewalled!\n&aThe firewall will clear in &b{1} &aseconds!", -+ configuration); -+ setIfUnexistant("firewall_cleared", "&b{0}&a addresses had been automatically removed from the firewall!", -+ configuration); - setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); - setIfUnexistant("flamecord_help", -- "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall&7 >&b Shows information about the Firewall!\n&e /flamecord help&7 >&b Shows this message!", - configuration); - setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -new file mode 100644 -index 00000000..dfb5c6d3 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/firewall/FirewallManager.java -@@ -0,0 +1,120 @@ -+package dev._2lstudios.flamecord.firewall; -+ -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.Collection; -+import java.util.HashSet; -+import java.util.logging.Logger; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import lombok.Getter; -+ -+public class FirewallManager { -+ private final Logger logger; -+ private final Collection whitelistedAddresses; -+ private final Collection firewalled; -+ private final int defaultSeconds; -+ @Getter -+ private int seconds; -+ -+ public FirewallManager(final Logger logger, final Collection whitelistedAddresses, -+ final int defaultSeconds) { -+ this.logger = logger; -+ this.whitelistedAddresses = whitelistedAddresses; -+ this.firewalled = new HashSet<>(); -+ this.defaultSeconds = defaultSeconds; -+ this.seconds = defaultSeconds; -+ } -+ -+ public boolean isWhitelisted(final SocketAddress address) { -+ final String addressString = address.toString(); -+ -+ for (final String whitelistedAddressString : whitelistedAddresses) { -+ if (addressString.endsWith(whitelistedAddressString)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public void addFirewalled(final SocketAddress address) { -+ if (address == null) { -+ return; -+ } -+ -+ if (FlameCord.getInstance().getFlameCordConfiguration().isFirewallEnabled() && !isWhitelisted(address)) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ if (!this.firewalled.contains(hostString)) { -+ this.firewalled.add(hostString); -+ logAdded(address); -+ } -+ } -+ } -+ -+ public void logAdded(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_added", hostString)); -+ } -+ } -+ -+ public void logBlocked(final SocketAddress address) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final FlameCordConfiguration flameCordConfiguration = flameCord.getFlameCordConfiguration(); -+ -+ if (flameCordConfiguration.isFirewallNotify()) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String hostString = iNetSocketAddress.getHostString(); -+ -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_blocked", hostString)); -+ } -+ } -+ -+ public Collection getFirewalled() { -+ return this.firewalled; -+ } -+ -+ public boolean isFirewalled(final SocketAddress address) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ -+ return this.firewalled.contains(iNetSocketAddress.getHostString()); -+ } -+ -+ public boolean isFirewalled(final String name) { -+ final String nameLowerCase = name.toLowerCase(); -+ -+ for (final String string : FlameCord.getInstance().getFlameCordConfiguration().getFirewallNames()) { -+ if (nameLowerCase.contains(string)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public void tick() { -+ if (--seconds <= 0) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final int size = this.firewalled.size(); -+ -+ if (size > 0) { -+ if (flameCord.getFlameCordConfiguration().isFirewallNotify()) { -+ this.logger.info(flameCord.getMessagesConfiguration().getTranslation("firewall_cleared", size)); -+ } -+ -+ this.firewalled.clear(); -+ } -+ -+ this.seconds = defaultSeconds; -+ } -+ } -+} -\ No newline at end of file -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 3992f521..7860d265 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -108,6 +108,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } else { - packetTypeStr = "unknown"; - } -+ - throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall - } finally - { -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index bf6f8538..fa0b59c2 100644 ---- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -5,6 +5,7 @@ import java.util.HashSet; - - import dev._2lstudios.flamecord.FlameCord; - import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import dev._2lstudios.flamecord.firewall.FirewallManager; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.api.CommandSender; - import net.md_5.bungee.api.chat.TextComponent; -@@ -30,6 +31,15 @@ private final BungeeCord bungeeCord; - final String arg0 = args[0]; - - switch (arg0) { -+ case "firewall": { -+ final FirewallManager firewallManager = flameCord.getFirewallManager(); -+ final int amount = firewallManager.getFirewalled().size(), -+ seconds = firewallManager.getSeconds(); -+ -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("firewall_info", amount, seconds))); -+ break; -+ } - case "reload": { - // FlameCord - Collect ips from servers - final Collection whitelistedAddresses = new HashSet<>(); -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 39c54cf1..3107cb69 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 -@@ -413,6 +413,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection - disconnect( bungee.getTranslation( "name_invalid" ) ); - return; - } -+ -+ // FlameCord - Firewall and close if username is blocked -+ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( loginRequest.getData() ) ) -+ { -+ FlameCord.getInstance().getFirewallManager().addFirewalled( ch.getRemoteAddress() ); -+ ch.close(); -+ return; -+ } -+ - this.loginRequest = loginRequest; - - int limit = BungeeCord.getInstance().config.getPlayerLimit(); -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 3503c089..283b3134 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -2,6 +2,7 @@ package net.md_5.bungee.connection; - - import com.google.gson.Gson; - -+import dev._2lstudios.flamecord.FlameCord; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -@@ -59,6 +60,9 @@ public class PingHandler extends PacketHandler - { - if ( packet.packet == null ) - { -+ // FlameCord - Firewall on unexpected packet -+ FlameCord.getInstance().getFirewallManager().addFirewalled(channel.getRemoteAddress()); -+ - throw new QuietException( "Unexpected packet received during ping process! " + BufUtil.dump( packet.buf, 16 ) ); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 89a6d14a..d46d255b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -11,6 +11,7 @@ import io.netty.handler.codec.haproxy.HAProxyMessage; - import io.netty.handler.timeout.ReadTimeoutException; - import java.io.IOException; - import java.net.InetSocketAddress; -+import java.net.SocketAddress; - import java.util.logging.Level; - import net.md_5.bungee.api.ProxyServer; - import net.md_5.bungee.connection.CancelSendSignal; -@@ -146,6 +147,18 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - boolean logExceptions = !( handler instanceof PingHandler ); - -+<<<<<<< Updated upstream -+======= -+ // FlameCord - Option to log exceptions -+ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; -+ -+ // Flamecord - Firewall system -+ if (!(cause instanceof ReadTimeoutException)) -+ { -+ FlameCord.getInstance().getFirewallManager().addFirewalled( ctx.channel().remoteAddress() ); -+ } -+ -+>>>>>>> Stashed changes - if ( logExceptions ) - { - if ( cause instanceof ReadTimeoutException ) -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 a840bc70..f7455a7e 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 -@@ -63,8 +63,16 @@ public class PipelineUtils - { - SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); - -+ // FlameCord - Firewall system -+ if ( FlameCord.getInstance().getFirewallManager().isFirewalled( remoteAddress ) ) { -+ FlameCord.getInstance().getFirewallManager().logBlocked( remoteAddress ); -+ ch.close(); -+ return; -+ } -+ - if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) - { -+ FlameCord.getInstance().getFirewallManager().addFirewalled( remoteAddress ); // FlameCord - Firewall throttled connections - ch.close(); - return; - } -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b1ecb7ef..06dcefa2 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -2,6 +2,8 @@ package net.md_5.bungee.query; - - import com.google.common.cache.Cache; - import com.google.common.cache.CacheBuilder; -+ -+import dev._2lstudios.flamecord.FlameCord; - import io.github.waterfallmc.waterfall.QueryResult; - import io.github.waterfallmc.waterfall.event.ProxyQueryEvent; - import io.netty.buffer.ByteBuf; -@@ -70,6 +72,9 @@ public class QueryHandler extends SimpleChannelInboundHandler - ByteBuf in = msg.content(); - if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) - { -+ // FlameCord - Firewall system -+ FlameCord.getInstance().getFirewallManager().addFirewalled(ctx.channel().remoteAddress()); -+ - bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); - // FlameCord - Close on incorrect magic - ctx.close(); --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch similarity index 80% rename from Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 8f43b3f6..04a8035a 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,14 +1,14 @@ -From 6763ff02f698658f565186581d16667238c4e2e6 Mon Sep 17 00:00:00 2001 +From 141ff1f306aa26df898e33629e23fdb14621bb16 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 374ff1b6..1d875b56 100644 +index 81ded224..70d0fb61 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,16 @@ import net.md_5.bungee.config.Configuration; +@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration { @@ -21,11 +21,10 @@ index 374ff1b6..1d875b56 100644 + @Getter + private boolean loggerHaProxy = false; + -+ - @Getter - private boolean firewallNotify = true; - @Getter -@@ -34,6 +44,11 @@ public class FlameCordConfiguration { + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { + final String fileName = "./flamecord.yml"; +@@ -25,6 +34,11 @@ public class FlameCordConfiguration { configuration = configurationProvider.load(configurationFile); } @@ -34,11 +33,11 @@ index 374ff1b6..1d875b56 100644 + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + - this.firewallEnabled = setIfUnexistant("firewall.enabled", this.firewallEnabled, configuration); - this.firewallNotify = setIfUnexistant("firewall.notify", this.firewallNotify, configuration); - this.firewallSeconds = setIfUnexistant("firewall.seconds", this.firewallSeconds, configuration); + if (!configurationExists) { + configurationProvider.save(configuration, configurationFile); + } 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 3107cb69..220b7924 100644 +index 39c54cf1..cfd6249e 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 @@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -62,10 +61,10 @@ index 3107cb69..220b7924 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index d46d255b..2f281d0c 100644 +index 89a6d14a..8eda3110 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -47,7 +47,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel = new ChannelWrapper( ctx ); handler.connected( channel ); @@ -75,7 +74,7 @@ index d46d255b..2f281d0c 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); } -@@ -62,7 +63,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -61,7 +62,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel.markClosed(); handler.disconnected( channel ); @@ -85,7 +84,7 @@ index d46d255b..2f281d0c 100644 { ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } -@@ -99,10 +101,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -98,10 +100,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); @@ -102,21 +101,12 @@ index d46d255b..2f281d0c 100644 channel.setRemoteAddress( newAddress ); } -@@ -147,8 +151,6 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -146,6 +150,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); --<<<<<<< Updated upstream --======= - // FlameCord - Option to log exceptions - logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; - -@@ -157,8 +159,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - FlameCord.getInstance().getFirewallManager().addFirewalled( ctx.channel().remoteAddress() ); - } -- -->>>>>>> Stashed changes ++ // FlameCord - Option to log exceptions ++ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; + if ( logExceptions ) { diff --git a/Waterfall-Proxy-Patches/0024-Always-release-packets.patch b/Waterfall-Proxy-Patches/0023-Always-release-packets.patch similarity index 84% rename from Waterfall-Proxy-Patches/0024-Always-release-packets.patch rename to Waterfall-Proxy-Patches/0023-Always-release-packets.patch index 545965cd..abcbe855 100644 --- a/Waterfall-Proxy-Patches/0024-Always-release-packets.patch +++ b/Waterfall-Proxy-Patches/0023-Always-release-packets.patch @@ -1,14 +1,14 @@ -From f33b7f843ea1f24793397d3090efc0253d2352ba Mon Sep 17 00:00:00 2001 +From d355f46a5efe21ebf60fa02dc5cd36acc9b6f227 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 23:28:19 -0300 Subject: [PATCH] Always release packets diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 2f281d0c..e5e98197 100644 +index 8eda3110..cef44d8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -117,12 +117,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -116,12 +116,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter return; } @@ -27,7 +27,7 @@ index 2f281d0c..e5e98197 100644 if ( sendPacket && packet.packet != null ) { try -@@ -137,10 +139,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -136,10 +138,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { handler.handle( packet ); } diff --git a/Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch similarity index 98% rename from Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch index 41fe15aa..d9eabf01 100644 --- a/Waterfall-Proxy-Patches/0025-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 546e4b91c6494dc9f00fd4afd009f59a211d32e8 Mon Sep 17 00:00:00 2001 +From 15a8f8edb2a5bca8b39560784ce8d20cb1f89d74 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins diff --git a/Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch similarity index 97% rename from Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch index 8d1134ac..178f94b3 100644 --- a/Waterfall-Proxy-Patches/0026-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 69ec2dd1495c968ba7e9e4bb71138c89c866252f Mon Sep 17 00:00:00 2001 +From 596bb7b14abdea0ba23fa966a6d594977c230331 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/Waterfall-Proxy-Patches/0027-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch similarity index 95% rename from Waterfall-Proxy-Patches/0027-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index dc68c731..52ceafad 100644 --- a/Waterfall-Proxy-Patches/0027-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From 6727e94ac5d06809541d0d437985d742cdd49137 Mon Sep 17 00:00:00 2001 +From 4c4837561bfbec01a8d9e671bc40d262b78f48df Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1d875b56..d320fa94 100644 +index 70d0fb61..b3491271 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -6,12 +6,33 @@ import java.util.ArrayList; @@ -42,7 +42,7 @@ index 1d875b56..d320fa94 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -44,6 +65,9 @@ public class FlameCordConfiguration { +@@ -34,6 +55,9 @@ public class FlameCordConfiguration { configuration = configurationProvider.load(configurationFile); } @@ -53,7 +53,7 @@ index 1d875b56..d320fa94 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 220b7924..4295fd68 100644 +index cfd6249e..0c608e0f 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 @@ -250,7 +250,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch similarity index 90% rename from Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch rename to Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 9ef55edf..b8fc191a 100644 --- a/Waterfall-Proxy-Patches/0028-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 78aa1b77b4919f816e9ca983c500f688d4c3643e Mon Sep 17 00:00:00 2001 +From a4b23efe724a4a64f8004583cb9667b8dcae62d6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d320fa94..d0fb0de2 100644 +index b3491271..3bf73d9e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index d320fa94..d0fb0de2 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -65,6 +69,8 @@ public class FlameCordConfiguration { +@@ -55,6 +59,8 @@ public class FlameCordConfiguration { configuration = configurationProvider.load(configurationFile); } @@ -29,10 +29,10 @@ index d320fa94..d0fb0de2 100644 this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); 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 f7455a7e..b762d58d 100644 +index a840bc70..f4bf745c 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 -@@ -206,6 +206,8 @@ public class PipelineUtils +@@ -198,6 +198,8 @@ public class PipelineUtils // IP_TOS is not supported (Windows XP / Windows Server 2003) } ch.config().setOption( ChannelOption.TCP_NODELAY, true ); diff --git a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch similarity index 94% rename from Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch rename to Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index c8174c6c..407e3962 100644 --- a/Waterfall-Proxy-Patches/0029-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From b15eb1a4f0883814e41941d423325256e3306fc6 Mon Sep 17 00:00:00 2001 +From cdf449f0be0a29592f76f2b53afc2da0949d58f1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 4295fd68..bf5e49e2 100644 +index 0c608e0f..4d9e9b89 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 @@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -49,7 +49,7 @@ index 4295fd68..bf5e49e2 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -478,6 +482,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -469,6 +473,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(final EncryptionResponse encryptResponse) throws Exception { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -57,7 +57,7 @@ index 4295fd68..bf5e49e2 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start -@@ -705,14 +710,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -696,14 +701,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch new file mode 100644 index 00000000..bdfa879a --- /dev/null +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -0,0 +1,854 @@ +From 63d3913f6a959a1f6342ce20e5a60c30e6025f16 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 4 Mar 2022 13:35:53 -0300 +Subject: [PATCH] Antibot System + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java +new file mode 100644 +index 00000000..5f2bc8e8 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java +@@ -0,0 +1,32 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class AccountsCheck { ++ private final AddressDataManager addressDataManager; ++ ++ public AccountsCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotAccountsEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ ++ if (addressData.getAccounts().size() >= config.getAntibotAccountsLimit()) { ++ if (config.isAntibotAccountsFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java +new file mode 100644 +index 00000000..1ee8b52d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java +@@ -0,0 +1,108 @@ ++package dev._2lstudios.antibot; ++ ++import java.util.Collection; ++import java.util.HashSet; ++ ++import dev._2lstudios.flamecord.FlameCord; ++ ++public class AddressData { ++ private final Collection accounts = new HashSet<>(); ++ private String lastAccount = ""; ++ private long lastPing = 0; ++ private long penultimateConnection = 0; ++ private long lastConnection = 0; ++ private long lastFirewall = 0; ++ private int pingsSecond = 0; ++ private int totalPings = 0; ++ private int connectionsSecond = 0; ++ private int totalConnections = 0; ++ ++ public Collection getAccounts() { ++ return accounts; ++ } ++ ++ public String getLastAccount() { ++ return lastAccount; ++ } ++ ++ public void addAccount(final String account) { ++ this.lastAccount = account; ++ this.accounts.add(account); ++ } ++ ++ public long getPenultimateConnection() { ++ return penultimateConnection; ++ } ++ ++ public long getTimeSincePenultimateConnection() { ++ return System.currentTimeMillis() - penultimateConnection; ++ } ++ ++ public long getLastConnection() { ++ return lastConnection; ++ } ++ ++ public long getTimeSinceLastConnection() { ++ return System.currentTimeMillis() - lastConnection; ++ } ++ ++ private void updatePingsSecond() { ++ if (System.currentTimeMillis() - lastPing >= 1000) { ++ pingsSecond = 0; ++ } ++ } ++ ++ public int getPingsSecond() { ++ updatePingsSecond(); ++ return pingsSecond; ++ } ++ ++ public void addPing() { ++ lastPing = System.currentTimeMillis(); ++ updatePingsSecond(); ++ pingsSecond++; ++ totalPings++; ++ } ++ ++ public int getTotalPings() { ++ return totalPings; ++ } ++ ++ private void updateConnectionsSecond() { ++ if (System.currentTimeMillis() - lastConnection >= 1000) { ++ connectionsSecond = 0; ++ } ++ } ++ ++ public int getConnectionsSecond() { ++ updateConnectionsSecond(); ++ return connectionsSecond; ++ } ++ ++ public void addConnection() { ++ final long currentTime = System.currentTimeMillis(); ++ ++ updateConnectionsSecond(); ++ penultimateConnection = lastConnection == 0 ? currentTime : lastConnection; ++ lastConnection = currentTime; ++ connectionsSecond++; ++ totalConnections++; ++ } ++ ++ public int getTotalConnections() { ++ return totalConnections; ++ } ++ ++ public boolean isFirewalled() { ++ return System.currentTimeMillis() - lastFirewall < FlameCord.getInstance().getFlameCordConfiguration() ++ .getAntibotFirewallExpire(); ++ } ++ ++ public void firewall() { ++ this.lastFirewall = System.currentTimeMillis(); ++ } ++ ++ public void setTotalConnections(final int totalConnections) { ++ this.totalConnections = totalConnections; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java +new file mode 100644 +index 00000000..d19c2eb0 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java +@@ -0,0 +1,25 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++ ++public class AddressDataManager { ++ private final Map addressData = new HashMap<>(); ++ ++ public AddressData getAddressData(final SocketAddress address) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String addressString = iNetSocketAddress.getHostString(); ++ ++ if (addressData.containsKey(addressString)) { ++ return addressData.get(addressString); ++ } else { ++ AddressData data = new AddressData(); ++ ++ addressData.put(addressString, data); ++ ++ return data; ++ } ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java +new file mode 100644 +index 00000000..c3a6ab43 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java +@@ -0,0 +1,49 @@ ++package dev._2lstudios.antibot; ++ ++public class CheckManager { ++ private final AccountsCheck accountsCheck; ++ private final FastChatCheck fastChatCheck; ++ private final FirewallCheck firewallCheck; ++ private final NicknameCheck nicknameCheck; ++ private final PasswordCheck passwordCheck; ++ private final RatelimitCheck ratelimitCheck; ++ private final ReconnectCheck reconnectCheck; ++ ++ public CheckManager(final AddressDataManager addressDataManager) { ++ this.accountsCheck = new AccountsCheck(addressDataManager); ++ this.fastChatCheck = new FastChatCheck(addressDataManager); ++ this.firewallCheck = new FirewallCheck(addressDataManager); ++ this.nicknameCheck = new NicknameCheck(addressDataManager); ++ this.passwordCheck = new PasswordCheck(addressDataManager); ++ this.ratelimitCheck = new RatelimitCheck(addressDataManager); ++ this.reconnectCheck = new ReconnectCheck(addressDataManager); ++ } ++ ++ public AccountsCheck getAccountsCheck() { ++ return accountsCheck; ++ } ++ ++ public FastChatCheck getFastChatCheck() { ++ return fastChatCheck; ++ } ++ ++ public FirewallCheck getFirewallCheck() { ++ return firewallCheck; ++ } ++ ++ public NicknameCheck getNicknameCheck() { ++ return nicknameCheck; ++ } ++ ++ public PasswordCheck getPasswordCheck() { ++ return passwordCheck; ++ } ++ ++ public RatelimitCheck getRatelimitCheck() { ++ return ratelimitCheck; ++ } ++ ++ public ReconnectCheck getReconnectCheck() { ++ return reconnectCheck; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java +new file mode 100644 +index 00000000..76902c27 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java +@@ -0,0 +1,32 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class FastChatCheck { ++ private final AddressDataManager addressDataManager; ++ ++ public FastChatCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = new AddressDataManager(); ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotFastChatEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ ++ if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { ++ if (config.isAntibotFastChatFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java +new file mode 100644 +index 00000000..ffa48b92 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java +@@ -0,0 +1,26 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class FirewallCheck { ++ private final AddressDataManager addressDataManager; ++ ++ public FirewallCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotFirewallEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ ++ return addressData.isFirewalled(); ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java +new file mode 100644 +index 00000000..9599ad3d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java +@@ -0,0 +1,61 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class NicknameCheck { ++ private AddressDataManager addressDataManager; ++ private int lastLength = 0; ++ private int lengthRepeatCount = 0; ++ ++ public NicknameCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public void updateNickname(final FlameCordConfiguration config, final String nickname) { ++ final int length = nickname.length(); ++ ++ if (lastLength == length) { ++ if (lengthRepeatCount < config.getAntibotNicknameLimit()) { ++ lengthRepeatCount++; ++ } ++ } else if (lengthRepeatCount > 0) { ++ lengthRepeatCount--; ++ } ++ ++ lastLength = length; ++ } ++ ++ private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { ++ for (final String blacklisted : config.getAntibotNicknameBlacklist()) { ++ if (nickname.startsWith(blacklisted)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotNicknameEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final String nickname = addressData.getLastAccount(); ++ ++ updateNickname(config, nickname); ++ ++ if (isBlacklisted(config, nickname) || lengthRepeatCount >= config.getAntibotNicknameLimit()) { ++ if (config.isAntibotNicknameFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java +new file mode 100644 +index 00000000..64400605 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java +@@ -0,0 +1,62 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class PasswordCheck { ++ private AddressDataManager addressDataManager; ++ private String lastNickname = ""; ++ private String lastPassword = ""; ++ private int repeatCount = 0; ++ ++ public PasswordCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ private void updatePassword(final FlameCordConfiguration config, final String nickname, final String password) { ++ if (!nickname.equals(lastNickname)) { ++ if (password.equals(lastPassword)) { ++ if (repeatCount < config.getAntibotPasswordLimit()) { ++ repeatCount++; ++ } ++ } else if (repeatCount > 0) { ++ repeatCount--; ++ } ++ } ++ ++ lastNickname = nickname; ++ lastPassword = password; ++ } ++ ++ public boolean check(final SocketAddress socketAddress, final String passwordMessage) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotPasswordEnabled()) { ++ if (passwordMessage.contains("/login ") || passwordMessage.contains("/l ") ++ || passwordMessage.contains("/register ") ++ || passwordMessage.contains("/reg ")) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final String nickname = addressData.getLastAccount(); ++ final String password = passwordMessage.split(" ")[1]; ++ ++ updatePassword(config, nickname, password); ++ ++ if (repeatCount >= config.getAntibotPasswordLimit()) { ++ if (config.isAntibotPasswordFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ } ++ ++ return false; ++ } ++ ++ public int getRepeatCount() { ++ return repeatCount; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java +new file mode 100644 +index 00000000..40edb98c +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java +@@ -0,0 +1,33 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class RatelimitCheck { ++ private final AddressDataManager addressDataManager; ++ ++ public RatelimitCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotRatelimitEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ ++ if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() ++ || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { ++ if (config.isAntibotRatelimitFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java +new file mode 100644 +index 00000000..f958a6f2 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java +@@ -0,0 +1,33 @@ ++package dev._2lstudios.antibot; ++ ++import java.net.SocketAddress; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class ReconnectCheck { ++ private final AddressDataManager addressDataManager; ++ ++ public ReconnectCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotReconnectEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() || addressData.getTotalPings() < config.getAntibotReconnectPings(); ++ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config.getAntibotReconnectMaxTime(); ++ ++ if (tooSlow) { ++ addressData.setTotalConnections(0); ++ return false; ++ } else { ++ return needsAttempts; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index 8957c79a..53148d68 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; + import java.util.Collection; + import java.util.logging.Logger; + ++import dev._2lstudios.antibot.AddressDataManager; ++import dev._2lstudios.antibot.CheckManager; + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +@@ -11,6 +13,10 @@ import net.md_5.bungee.config.ConfigurationProvider; + import net.md_5.bungee.config.YamlConfiguration; + + public class FlameCord { ++ @Getter ++ private final AddressDataManager addressDataManager; ++ @Getter ++ private final CheckManager checkManager; + @Getter + private static FlameCord instance; + @Getter +@@ -35,6 +41,8 @@ public class FlameCord { + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + ++ this.addressDataManager = new AddressDataManager(); ++ this.checkManager = new CheckManager(addressDataManager); + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 3bf73d9e..1a445ec8 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,81 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ // FlameCord start - Antibot System ++ @Getter ++ private boolean antibotAccountsEnabled = true; ++ @Getter ++ private boolean antibotAccountsFirewall = true; ++ @Getter ++ private int antibotAccountsLimit = 3; ++ @Getter ++ private boolean antibotFastChatEnabled = true; ++ @Getter ++ private boolean antibotFastChatFirewall = true; ++ @Getter ++ private int antibotFastChatTime = 1000; ++ @Getter ++ private boolean antibotFirewallEnabled = true; ++ @Getter ++ private int antibotFirewallExpire = 30000; ++ @Getter ++ private boolean antibotNicknameEnabled = true; ++ @Getter ++ private boolean antibotNicknameFirewall = true; ++ @Getter ++ private int antibotNicknameLimit = 3; ++ @Getter ++ private Collection antibotNicknameBlacklist = Arrays.asList("mcspam"); ++ @Getter ++ private boolean antibotPasswordEnabled = true; ++ @Getter ++ private boolean antibotPasswordFirewall = true; ++ @Getter ++ private int antibotPasswordLimit = 3; ++ @Getter ++ private boolean antibotRatelimitEnabled = true; ++ @Getter ++ private boolean antibotRatelimitFirewall = true; ++ @Getter ++ private int antibotRatelimitConnectionsPerSecond = 3; ++ @Getter ++ private int antibotRatelimitPingsPerSecond = 8; ++ @Getter ++ private boolean antibotReconnectEnabled = true; ++ @Getter ++ private int antibotReconnectAttempts = 2; ++ @Getter ++ private int antibotReconnectPings = 0; ++ @Getter ++ private int antibotReconnectMaxTime = 10000; ++ ++ public void loadAntibot(final Configuration config) { ++ this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); ++ this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); ++ this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); ++ this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); ++ this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); ++ this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); ++ this.antibotFirewallEnabled = setIfUnexistant("antibot.fastchat.firewall", this.antibotFirewallEnabled, config); ++ this.antibotFirewallExpire = setIfUnexistant("antibot.fastchat.time", this.antibotFirewallExpire, config); ++ this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); ++ this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); ++ this.antibotNicknameLimit = setIfUnexistant("antibot.nickname.limit", this.antibotNicknameLimit, config); ++ this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); ++ this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); ++ this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); ++ this.antibotPasswordLimit = setIfUnexistant("antibot.password.limit", this.antibotPasswordLimit, config); ++ this.antibotRatelimitEnabled = setIfUnexistant("antibot.ratelimit.enabled", this.antibotRatelimitEnabled, config); ++ this.antibotRatelimitFirewall = setIfUnexistant("antibot.ratelimit.firewall", this.antibotRatelimitFirewall, config); ++ this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); ++ this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); ++ this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); ++ this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); ++ this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); ++ this.antibotReconnectMaxTime = setIfUnexistant("antibot.reconnect.max-time", this.antibotReconnectMaxTime, config); ++ } ++ // FlameCord end - Antibot System ++ + // FlameCord - TCP Fast Open + @Getter + private int tcpFastOpen = 3; +@@ -59,6 +134,8 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ loadAntibot(configuration); ++ + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); + + this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index a32522fe..9b628ad5 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -81,6 +81,16 @@ public class MessagesConfiguration { + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + ++ // FlameCord start - Antibot System ++ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ // FlameCord end - Antibot System ++ + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", +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 4d9e9b89..56793ae7 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 +@@ -19,6 +19,8 @@ import java.util.logging.Level; + import javax.crypto.SecretKey; + import javax.crypto.spec.SecretKeySpec; + ++import dev._2lstudios.antibot.AddressData; ++import dev._2lstudios.antibot.CheckManager; + import dev._2lstudios.flamecord.FlameCord; + + import lombok.Getter; +@@ -133,7 +135,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + private boolean canSendKickMessage() + { +- return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; ++ return thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; + } + + @Override +@@ -371,6 +373,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + return; + } + ++ // FlameCord start - Antibot System ++ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ // FlameCord end - Antibot System ++ + switch ( handshake.getRequestedProtocol() ) + { + case 1: +@@ -382,6 +389,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + thisState = State.STATUS; + ch.setProtocol( Protocol.STATUS ); ++ ++ // FlameCord start - Antibot System ++ addressData.addPing(); ++ ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + break; + case 2: + // Login +@@ -393,6 +411,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.USERNAME; + ch.setProtocol( Protocol.LOGIN ); + ++ // FlameCord start - Antibot System ++ addressData.addConnection(); ++ ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) + { + if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) +@@ -430,6 +458,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection + return; + } + ++ // FlameCord start - Antibot System ++ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ ++ addressData.addAccount( loginRequest.getData() ); ++ ++ if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); ++ return; ++ } ++ ++ if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getAccounts().size() ) ); ++ return; ++ } ++ ++ if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + // If offline mode and they are already on, don't allow connect + // We can just check by UUID here as names are based on UUID + if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) +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 e354032a..dd424439 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,9 @@ 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 dev._2lstudios.antibot.CheckManager; ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.channel.Channel; + import java.util.ArrayList; + import java.util.LinkedList; +@@ -166,6 +169,22 @@ public class UpstreamBridge extends PacketHandler + } + Preconditions.checkArgument(!empty, "Chat message is empty"); + ++ // FlameCord start - Antibot System ++ final CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ ++ if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) ++ { ++ con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); ++ throw CancelSendSignal.INSTANCE; ++ } ++ ++ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), chat.getMessage() ) ) ++ { ++ con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); ++ throw CancelSendSignal.INSTANCE; ++ } ++ // FlameCord end - Antibot System ++ + ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() ); + if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) + { +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index cef44d8a..8fe2b37f 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); + ++ // Flamecord start - Antibot System ++ if (!(cause instanceof ReadTimeoutException)) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); ++ } ++ // Flamecord end - Antibot System ++ + // FlameCord - Option to log exceptions + logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; + +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 f4bf745c..eaedb459 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 +@@ -63,6 +63,14 @@ public class PipelineUtils + { + SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + ++ // FlameCord start - Antibot System ++ if ( FlameCord.getInstance().getCheckManager().getFirewallCheck().check( ch.remoteAddress() ) ) ++ { ++ ch.close(); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) + { + ch.close(); +-- +2.32.0 + From b0a1abdf310d3adcd29d7a4fa8538a4330030c8a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:52 -0300 Subject: [PATCH 211/499] Allow Invalid Names --- .../0030-Allow-Invalid-Names.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch new file mode 100644 index 00000000..49a80d08 --- /dev/null +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -0,0 +1,46 @@ +From 1b786bef7bb3a52c0f246b82e930290f518fc8db Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 4 Mar 2022 14:09:35 -0300 +Subject: [PATCH] Allow Invalid Names + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 1a445ec8..25cfc0bd 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration { ++ // FlameCord - Allow Invalid Names ++ @Getter ++ private boolean allowInvalidNames = false; ++ + // FlameCord start - Antibot System + @Getter + private boolean antibotAccountsEnabled = true; +@@ -134,6 +138,8 @@ public class FlameCordConfiguration { + configuration = configurationProvider.load(configurationFile); + } + ++ this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); ++ + loadAntibot(configuration); + + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); +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 56793ae7..49bb7ade 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 +@@ -444,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); + thisState = State.PROCESSING_USERNAME; + +- if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) ++ if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; +-- +2.32.0 + From efbaec4ed6c7ee3131004883fa46547027037f80 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:13:31 -0300 Subject: [PATCH 212/499] Fix Merge Issues --- .../0029-Antibot-System.patch | 19 +++++++++++-------- .../0030-Allow-Invalid-Names.patch | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index bdfa879a..ee21f086 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 63d3913f6a959a1f6342ce20e5a60c30e6025f16 Mon Sep 17 00:00:00 2001 +From 10f4ef5fac597b0e430170642fff1ab709930421 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -675,7 +675,7 @@ index a32522fe..9b628ad5 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4d9e9b89..56793ae7 100644 +index 4ced9bd6..714a903d 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -687,16 +687,19 @@ index 4d9e9b89..56793ae7 100644 import dev._2lstudios.flamecord.FlameCord; import lombok.Getter; -@@ -133,7 +135,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -133,7 +135,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection private boolean canSendKickMessage() { -- return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; ++<<<<<<< HEAD + return thisState == State.PROCESSING_USERNAME || thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; ++======= + return thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; ++>>>>>>> Antibot System } @Override -@@ -371,6 +373,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -371,6 +377,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -708,7 +711,7 @@ index 4d9e9b89..56793ae7 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -382,6 +389,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -382,6 +393,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -726,7 +729,7 @@ index 4d9e9b89..56793ae7 100644 break; case 2: // Login -@@ -393,6 +411,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -393,6 +415,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -743,7 +746,7 @@ index 4d9e9b89..56793ae7 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +458,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -430,6 +462,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 49a80d08..932ce588 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From 1b786bef7bb3a52c0f246b82e930290f518fc8db Mon Sep 17 00:00:00 2001 +From cbe27677eeb2b1d2821160e46b8073ed37023725 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -29,10 +29,10 @@ index 1a445ec8..25cfc0bd 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 56793ae7..49bb7ade 100644 +index 714a903d..066ef4b9 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 -@@ -444,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -448,7 +448,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; From 080bb49dc3126f6211da3eeb4248d8aada5b8ec8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:23:44 -0300 Subject: [PATCH 213/499] Fix Compilation Issues --- .../0029-Antibot-System.patch | 24 +++++-------------- .../0030-Allow-Invalid-Names.patch | 6 ++--- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index ee21f086..7952f933 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 10f4ef5fac597b0e430170642fff1ab709930421 Mon Sep 17 00:00:00 2001 +From 59f4c0db582075e42dbd24f1edb7796c973a2f1b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -675,7 +675,7 @@ index a32522fe..9b628ad5 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..714a903d 100644 +index 4ced9bd6..9df6b16e 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -687,19 +687,7 @@ index 4ced9bd6..714a903d 100644 import dev._2lstudios.flamecord.FlameCord; import lombok.Getter; -@@ -133,7 +135,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - - private boolean canSendKickMessage() - { -+<<<<<<< HEAD - return thisState == State.PROCESSING_USERNAME || thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -+======= -+ return thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -+>>>>>>> Antibot System - } - - @Override -@@ -371,6 +377,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -371,6 +373,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -711,7 +699,7 @@ index 4ced9bd6..714a903d 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -382,6 +393,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -382,6 +389,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -729,7 +717,7 @@ index 4ced9bd6..714a903d 100644 break; case 2: // Login -@@ -393,6 +415,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -393,6 +411,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -746,7 +734,7 @@ index 4ced9bd6..714a903d 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +462,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -430,6 +458,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 932ce588..ed98b73e 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From cbe27677eeb2b1d2821160e46b8073ed37023725 Mon Sep 17 00:00:00 2001 +From 0b4b916937b76ef836e07d55d2654757a1390246 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -29,10 +29,10 @@ index 1a445ec8..25cfc0bd 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 714a903d..066ef4b9 100644 +index 9df6b16e..3f6bcd8a 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 -@@ -448,7 +448,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -444,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; From 4abe55daf4742207b002b64e595e0f5be3da5a63 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:23:59 -0300 Subject: [PATCH 214/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 65ec15e5..80a64a6f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 65ec15e5cce6c64200006c983d53e91a84a6429e +Subproject commit 80a64a6f08eb4f00a12fd98991ca6640b4d5a3f0 From 706546c800f319b52df6079c575c3909ae9f43b3 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 16:13:56 -0300 Subject: [PATCH 215/499] 0.7.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index dd5cc726..37c6b9aa 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..8b655261 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.4"; ++ return "0.7.5"; } public void reloadMessages() From 8483d48afff03eaf34d46d52cd0ed514b934f21c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 5 Mar 2022 10:24:50 -0300 Subject: [PATCH 216/499] Avoid Copying Buf --- .../0004-1.7.x-support.patch | 12 ++-- .../0020-Fix-ByteBuf-memory-leaks.patch | 6 +- .../0031-Avoid-Copying-Buf.patch | 58 +++++++++++++++++++ 3 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 44c56cd0..512b813b 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 180dd0525ba0c7d523d38bd430aa4ba59d1018b9 Mon Sep 17 00:00:00 2001 +From 4ad196ffeace48412b9dd00040c605ffc6f2fb36 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -324,7 +324,7 @@ index 7f0b71c9..04851233 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index 0768e3b7..c001e4ca 100644 +index 6360818c..5e4f3d64 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index 0768e3b7..c001e4ca 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -43,6 +47,7 @@ public class ProtocolConstants +@@ -44,6 +48,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,7 +346,7 @@ index 0768e3b7..c001e4ca 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -56,6 +61,10 @@ public class ProtocolConstants +@@ -57,6 +62,10 @@ public class ProtocolConstants "1.18.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8b655261..1fe08b80 100644 +index 28032ae4..d1994a52 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1249,7 +1249,7 @@ index 9537208e..e354032a 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 99ad8b9c..a70405dc 100644 +index cda6451d..1509071f 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -35,6 +35,12 @@ public abstract class EntityMap diff --git a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch index 9d560a3b..b34cdbf1 100644 --- a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 200b5bcd9b96acddc178ec7768fe75257937ffc1 Mon Sep 17 00:00:00 2001 +From 23d65a0daab152315d3815042c57d14e51674bb7 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index a70405dc..33b72eb0 100644 +index 1509071f..b9bcecb5 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -150,11 +150,15 @@ public abstract class EntityMap +@@ -151,11 +151,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); diff --git a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch new file mode 100644 index 00000000..a3adbb77 --- /dev/null +++ b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch @@ -0,0 +1,58 @@ +From 99606ff5af524a4f89bd9c3c1743f657aa9b5161 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 5 Mar 2022 10:24:11 -0300 +Subject: [PATCH] Avoid Copying Buf + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 3992f521..6b46177d 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -39,6 +39,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; ++ int readerIndex = in.readerIndex(); // FlameCord - Avoid Copying Buf + + // FlameCord - Check size before decoding + if (prot == protocol.TO_SERVER) { +@@ -52,8 +53,6 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + } + +- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( +- + Object packetTypeInfo = null; + try + { +@@ -92,8 +91,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder + in.skipBytes( in.readableBytes() ); + } + +- out.add( new PacketWrapper( packet, slice ) ); +- slice = null; ++ // FlameCord start - Avoid Copying Buf ++ in.readerIndex( readerIndex ); ++ out.add( new PacketWrapper( packet, in.retain() ) ); ++ // FlameCord end - Avoid Copying Buf + } catch (BadPacketException | IndexOutOfBoundsException e) { + // Waterfall start: Additional DoS mitigations + if(!DEBUG) { +@@ -108,13 +109,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } else { + packetTypeStr = "unknown"; + } +- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall +- } finally +- { +- if ( slice != null ) +- { +- slice.release(); +- } ++ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(in), e); // Waterfall + } + } + +-- +2.32.0 + From aaf6f939fcc947d80e266868fe888cf924045377 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 5 Mar 2022 16:19:04 -0300 Subject: [PATCH 217/499] Remove Patch 31 --- .../0031-Avoid-Copying-Buf.patch | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch diff --git a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch deleted file mode 100644 index a3adbb77..00000000 --- a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Buf.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 99606ff5af524a4f89bd9c3c1743f657aa9b5161 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sat, 5 Mar 2022 10:24:11 -0300 -Subject: [PATCH] Avoid Copying Buf - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 3992f521..6b46177d 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -39,6 +39,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - - Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ int readerIndex = in.readerIndex(); // FlameCord - Avoid Copying Buf - - // FlameCord - Check size before decoding - if (prot == protocol.TO_SERVER) { -@@ -52,8 +53,6 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - } - -- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( -- - Object packetTypeInfo = null; - try - { -@@ -92,8 +91,10 @@ public class MinecraftDecoder extends MessageToMessageDecoder - in.skipBytes( in.readableBytes() ); - } - -- out.add( new PacketWrapper( packet, slice ) ); -- slice = null; -+ // FlameCord start - Avoid Copying Buf -+ in.readerIndex( readerIndex ); -+ out.add( new PacketWrapper( packet, in.retain() ) ); -+ // FlameCord end - Avoid Copying Buf - } catch (BadPacketException | IndexOutOfBoundsException e) { - // Waterfall start: Additional DoS mitigations - if(!DEBUG) { -@@ -108,13 +109,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } else { - packetTypeStr = "unknown"; - } -- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall -- } finally -- { -- if ( slice != null ) -- { -- slice.release(); -- } -+ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(in), e); // Waterfall - } - } - --- -2.32.0 - From debf729df0b8bc95b43008f5925a918dd2dd665f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 6 Mar 2022 10:59:38 -0300 Subject: [PATCH 218/499] Fix Nickname Bug --- .../0029-Antibot-System.patch | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 7952f933..c8f86577 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 59f4c0db582075e42dbd24f1edb7796c973a2f1b Mon Sep 17 00:00:00 2001 +From b47344c51a3e6387263877d9ce93932f873d08df Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -314,10 +314,10 @@ index 00000000..ffa48b92 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..9599ad3d +index 00000000..035148db --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java -@@ -0,0 +1,61 @@ +@@ -0,0 +1,71 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -327,6 +327,7 @@ index 00000000..9599ad3d + +public class NicknameCheck { + private AddressDataManager addressDataManager; ++ private String lastNickname = ""; + private int lastLength = 0; + private int lengthRepeatCount = 0; + @@ -338,7 +339,7 @@ index 00000000..9599ad3d + final int length = nickname.length(); + + if (lastLength == length) { -+ if (lengthRepeatCount < config.getAntibotNicknameLimit()) { ++ if (lengthRepeatCount < config.getAntibotNicknameLimit() && !nickname.equals(lastNickname)) { + lengthRepeatCount++; + } + } else if (lengthRepeatCount > 0) { @@ -346,6 +347,7 @@ index 00000000..9599ad3d + } + + lastLength = length; ++ lastNickname = nickname; + } + + private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { @@ -365,6 +367,14 @@ index 00000000..9599ad3d + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + final String nickname = addressData.getLastAccount(); + ++ if (isBlacklisted(config, nickname)) { ++ if (config.isAntibotNicknameFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ + updateNickname(config, nickname); + + if (isBlacklisted(config, nickname) || lengthRepeatCount >= config.getAntibotNicknameLimit()) { From df9937ce07ec0e1c8f1b86d7fdaf16e6fe7ea0e6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 6 Mar 2022 11:00:52 -0300 Subject: [PATCH 219/499] 0.7.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 37c6b9aa..2f00daa7 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 0f33be9482102e95dcc45eafab586d9538b89ef2 Mon Sep 17 00:00:00 2001 +From 5c17305be9b4188d465958b85097b9bd12c3c037 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c..8b655261 100644 +index a4b58d9c..1bb4c820 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index a4b58d9c..8b655261 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.5"; ++ return "0.7.6"; } public void reloadMessages() From f06713e1d4112f1c1ba43f54972819e1ce50e7f4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 6 Mar 2022 11:57:48 -0300 Subject: [PATCH 220/499] Fix Config Value Regeneration --- .../0017-FlameCord-General-Patch.patch | 87 +++++++++++-------- .../0018-FlameCord-module-system.patch | 57 ++---------- ...0019-FlameCord-message-configuration.patch | 20 ++--- .../0022-FlameCord-logger-options.patch | 14 +-- .../0026-Custom-motd-system.patch | 8 +- .../0027-TCP-Fast-Open.patch | 8 +- .../0029-Antibot-System.patch | 12 +-- .../0030-Allow-Invalid-Names.patch | 8 +- 8 files changed, 87 insertions(+), 127 deletions(-) diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 5160c47f..e6b66617 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From bd296fecf532bf07f59fb6a79acdbe7b888f004c Mon Sep 17 00:00:00 2001 +From 64e6384ad6a59b910e932735b6d505038104ea72 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -45,56 +45,30 @@ index 00000000..252612a3 + } +} \ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java new file mode 100644 -index 00000000..81ded224 +index 00000000..cfbd55c3 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,64 @@ ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +@@ -0,0 +1,38 @@ +package dev._2lstudios.flamecord.configuration; + -+import java.io.File; -+import java.io.IOException; +import java.util.ArrayList; -+import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; + -+import lombok.Getter; +import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class FlameCordConfiguration { -+ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { -+ try { -+ final String fileName = "./flamecord.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); + -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { ++public class FlameConfig { ++ int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { + return (int) setIfUnexistant(arg1, (Object) arg2, configuration); + } + -+ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { ++ boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { + return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); + } + -+ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { + if (!configuration.contains(arg1)) { + configuration.set(arg1, arg2); + @@ -104,7 +78,7 @@ index 00000000..81ded224 + } + } + -+ private Collection setIfUnexistant(final String arg1, final Collection arg2, ++ Collection setIfUnexistant(final String arg1, final Collection arg2, + final Configuration configuration) { + if (!configuration.contains(arg1)) { + configuration.set(arg1, new ArrayList<>(arg2)); @@ -115,6 +89,45 @@ index 00000000..81ded224 + } + } +} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +new file mode 100644 +index 00000000..c8148e90 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -0,0 +1,33 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.HashSet; ++ ++import lombok.Getter; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class FlameCordConfiguration extends FlameConfig { ++ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { ++ try { ++ final String fileName = "./flamecord.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ configurationProvider.save(configuration, configurationFile); ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java index 4b9b80b9..aa35f870 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -191,7 +204,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 1fe08b80..4902d4f3 100644 +index 3ea5518f..2ca3e2b3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch index 70ec2173..1712632d 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From d67854d0c57edad3fc8a7ed3ffaf7f537c19c810 Mon Sep 17 00:00:00 2001 +From e35251dcc5fc75498efeb2a829ff9cb76cac5620 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -35,10 +35,10 @@ index 252612a3..2e317533 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 00000000..e82c4844 +index 00000000..6c5bb961 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -@@ -0,0 +1,94 @@ +@@ -0,0 +1,49 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -47,32 +47,15 @@ index 00000000..e82c4844 +import net.md_5.bungee.config.Configuration; +import net.md_5.bungee.config.ConfigurationProvider; + -+public class ModulesConfiguration { -+ // Reconnect Module ++public class ModulesConfiguration extends FlameConfig { + public boolean reconnectEnabled = false; -+ -+ // Alert Module + public boolean alertEnabled = true; -+ -+ // Find Module + public boolean findEnabled = true; -+ -+ // IP Module + public boolean ipEnabled = true; -+ -+ // List Module + public boolean listEnabled = true; -+ -+ // Perms Module + public boolean permsEnabled = true; -+ -+ // Reload Module + public boolean reloadEnabled = true; -+ -+ // Send Module + public boolean sendEnabled = true; -+ -+ // Server + public boolean serverEnabled = true; + + public ModulesConfiguration(final ConfigurationProvider configurationProvider) { @@ -89,52 +72,24 @@ index 00000000..e82c4844 + } + + this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); -+ + this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); -+ + this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); -+ + this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); -+ + this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); -+ + this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); -+ + this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); -+ + this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); -+ + this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, + configuration); + -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } ++ configurationProvider.save(configuration, configurationFile); + } catch (final IOException e) { + e.printStackTrace(); + } + } -+ -+ private String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { -+ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ private Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ -+ return arg2; -+ } else { -+ return configuration.get(arg1); -+ } -+ } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4902d4f3..82f5f65c 100644 +index 2ca3e2b3..93f57747 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index 2a4045eb..22892963 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From db9dc55944664f345292846ab3e07189d26abc25 Mon Sep 17 00:00:00 2001 +From 99d94a26237d95b60348c4de7feb9ff9c6744a9b Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -35,10 +35,10 @@ index 2e317533..8957c79a 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..a32522fe +index 00000000..57462992 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,121 @@ +@@ -0,0 +1,113 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -52,7 +52,7 @@ index 00000000..a32522fe +import net.md_5.bungee.config.Configuration; +import net.md_5.bungee.config.ConfigurationProvider; + -+public class MessagesConfiguration { ++public class MessagesConfiguration extends FlameConfig { + private final Logger logger; + private final Map messages = new HashMap<>(); + @@ -129,9 +129,7 @@ index 00000000..a32522fe + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + -+ if (!configurationExists) { -+ configurationProvider.save(configuration, configurationFile); -+ } ++ configurationProvider.save(configuration, configurationFile); + + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); @@ -153,12 +151,6 @@ index 00000000..a32522fe + + return MessageFormat.format(messages.getOrDefault(name, ""), args); + } -+ -+ private void setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ } -+ } +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -209,7 +201,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 82f5f65c..23cb8839 100644 +index 93f57747..29475584 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 04a8035a..5ed25b75 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,17 +1,17 @@ -From 141ff1f306aa26df898e33629e23fdb14621bb16 Mon Sep 17 00:00:00 2001 +From d49ffb31a988bab4c7b0d2e2b652f65ce240c087 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 81ded224..70d0fb61 100644 +index c8148e90..701db67c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; - public class FlameCordConfiguration { + public class FlameCordConfiguration extends FlameConfig { + @Getter + private boolean loggerInitialhandler = false; + @Getter @@ -24,7 +24,7 @@ index 81ded224..70d0fb61 100644 public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { try { final String fileName = "./flamecord.yml"; -@@ -25,6 +34,11 @@ public class FlameCordConfiguration { +@@ -25,6 +34,11 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -33,9 +33,9 @@ index 81ded224..70d0fb61 100644 + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + - if (!configurationExists) { - configurationProvider.save(configuration, configurationFile); - } + configurationProvider.save(configuration, configurationFile); + } catch (final IOException e) { + e.printStackTrace(); 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 39c54cf1..cfd6249e 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 52ceafad..fd86ac82 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From 4c4837561bfbec01a8d9e671bc40d262b78f48df Mon Sep 17 00:00:00 2001 +From 608e7343216c313476d8c0d09a8b94c9f85a8519 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 70d0fb61..b3491271 100644 +index 701db67c..48deace6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -6,12 +6,33 @@ import java.util.ArrayList; @@ -20,7 +20,7 @@ index 70d0fb61..b3491271 100644 import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; - public class FlameCordConfiguration { + public class FlameCordConfiguration extends FlameConfig { + private List colors(final List strings) { + for (int i = 0; i < strings.size(); i++) { + strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); @@ -42,7 +42,7 @@ index 70d0fb61..b3491271 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -34,6 +55,9 @@ public class FlameCordConfiguration { +@@ -34,6 +55,9 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index b8fc191a..36d0a666 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,17 +1,17 @@ -From a4b23efe724a4a64f8004583cb9667b8dcae62d6 Mon Sep 17 00:00:00 2001 +From 216628c6de6f3697ed82a84be11d73301705e170 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b3491271..3bf73d9e 100644 +index 48deace6..d972fcea 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; - public class FlameCordConfiguration { + public class FlameCordConfiguration extends FlameConfig { + // FlameCord - TCP Fast Open + @Getter + private int tcpFastOpen = 3; @@ -19,7 +19,7 @@ index b3491271..3bf73d9e 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -55,6 +59,8 @@ public class FlameCordConfiguration { +@@ -55,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index c8f86577..f4a49254 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From b47344c51a3e6387263877d9ce93932f873d08df Mon Sep 17 00:00:00 2001 +From bced3b6f79614a6580b98f1d2935ab0bbaba75d6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -569,13 +569,13 @@ index 8957c79a..53148d68 100644 this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 3bf73d9e..1a445ec8 100644 +index d972fcea..df8c90e6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,81 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; - public class FlameCordConfiguration { + public class FlameCordConfiguration extends FlameConfig { + // FlameCord start - Antibot System + @Getter + private boolean antibotAccountsEnabled = true; @@ -654,7 +654,7 @@ index 3bf73d9e..1a445ec8 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +134,8 @@ public class FlameCordConfiguration { +@@ -59,6 +134,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -664,10 +664,10 @@ index 3bf73d9e..1a445ec8 100644 this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index a32522fe..9b628ad5 100644 +index 57462992..0490b7f6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -81,6 +81,16 @@ public class MessagesConfiguration { +@@ -81,6 +81,16 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index ed98b73e..216a1d65 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,17 +1,17 @@ -From 0b4b916937b76ef836e07d55d2654757a1390246 Mon Sep 17 00:00:00 2001 +From 17e051173143aa7d903059ba7acedab551dcbcdd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1a445ec8..25cfc0bd 100644 +index df8c90e6..2385ae93 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; - public class FlameCordConfiguration { + public class FlameCordConfiguration extends FlameConfig { + // FlameCord - Allow Invalid Names + @Getter + private boolean allowInvalidNames = false; @@ -19,7 +19,7 @@ index 1a445ec8..25cfc0bd 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -134,6 +138,8 @@ public class FlameCordConfiguration { +@@ -134,6 +138,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } From 0afd7d7bf21a0784c3b6593f87bd869cdf80cdbc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 6 Mar 2022 14:04:09 -0300 Subject: [PATCH 221/499] Aggressive Reconnect Check --- .../0029-Antibot-System.patch | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index f4a49254..82e57e98 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From bced3b6f79614a6580b98f1d2935ab0bbaba75d6 Mon Sep 17 00:00:00 2001 +From f0f3d12f41102a0cff279933451834be28d79ba1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -6,7 +6,7 @@ Subject: [PATCH] Antibot System diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..5f2bc8e8 +index 00000000..5a390f99 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,32 @@ @@ -30,7 +30,7 @@ index 00000000..5f2bc8e8 + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + -+ if (addressData.getAccounts().size() >= config.getAntibotAccountsLimit()) { ++ if (addressData.getNicknames().size() >= config.getAntibotAccountsLimit()) { + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -44,10 +44,10 @@ index 00000000..5f2bc8e8 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..1ee8b52d +index 00000000..40b8b32c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,108 @@ +@@ -0,0 +1,114 @@ +package dev._2lstudios.antibot; + +import java.util.Collection; @@ -56,8 +56,8 @@ index 00000000..1ee8b52d +import dev._2lstudios.flamecord.FlameCord; + +public class AddressData { -+ private final Collection accounts = new HashSet<>(); -+ private String lastAccount = ""; ++ private final Collection nicknames = new HashSet<>(); ++ private String lastNickname = ""; + private long lastPing = 0; + private long penultimateConnection = 0; + private long lastConnection = 0; @@ -67,17 +67,23 @@ index 00000000..1ee8b52d + private int connectionsSecond = 0; + private int totalConnections = 0; + -+ public Collection getAccounts() { -+ return accounts; ++ public Collection getNicknames() { ++ return nicknames; + } + -+ public String getLastAccount() { -+ return lastAccount; ++ public String getLastNickname() { ++ return lastNickname; + } + -+ public void addAccount(final String account) { -+ this.lastAccount = account; -+ this.accounts.add(account); ++ public void addNickname(final String nickname) { ++ if (!lastNickname.equals(nickname)) { ++ this.lastNickname = nickname; ++ this.totalConnections = 1; ++ } ++ ++ if (!this.nicknames.contains(nickname)) { ++ this.nicknames.add(nickname); ++ } + } + + public long getPenultimateConnection() { @@ -314,7 +320,7 @@ index 00000000..ffa48b92 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..035148db +index 00000000..e0e836e0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,71 @@ @@ -365,7 +371,7 @@ index 00000000..035148db + + if (config.isAntibotNicknameEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); -+ final String nickname = addressData.getLastAccount(); ++ final String nickname = addressData.getLastNickname(); + + if (isBlacklisted(config, nickname)) { + if (config.isAntibotNicknameFirewall()) { @@ -391,7 +397,7 @@ index 00000000..035148db +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..64400605 +index 00000000..8ffe1e21 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -435,7 +441,7 @@ index 00000000..64400605 + || passwordMessage.contains("/register ") + || passwordMessage.contains("/reg ")) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); -+ final String nickname = addressData.getLastAccount(); ++ final String nickname = addressData.getLastNickname(); + final String password = passwordMessage.split(" ")[1]; + + updatePassword(config, nickname, password); @@ -685,7 +691,7 @@ index 57462992..0490b7f6 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..9df6b16e 100644 +index 4ced9bd6..8c0d59f1 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -752,7 +758,7 @@ index 4ced9bd6..9df6b16e 100644 + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); + -+ addressData.addAccount( loginRequest.getData() ); ++ addressData.addNickname( loginRequest.getData() ); + + if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) + { @@ -762,7 +768,7 @@ index 4ced9bd6..9df6b16e 100644 + + if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress() ) ) + { -+ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getAccounts().size() ) ); ++ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); + return; + } + From c3da944a9daff012cde59756e65e8eb73eb74ccd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:38:03 -0300 Subject: [PATCH 222/499] RateLimit Pings 8 -> 16 --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 82e57e98..070020ae 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From f0f3d12f41102a0cff279933451834be28d79ba1 Mon Sep 17 00:00:00 2001 +From cfbb1db6b2378c236e43e05fac4fde78af791934 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -575,7 +575,7 @@ index 8957c79a..53148d68 100644 this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..df8c90e6 100644 +index d972fcea..5aef0c7b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,81 @@ import net.md_5.bungee.config.Configuration; @@ -620,7 +620,7 @@ index d972fcea..df8c90e6 100644 + @Getter + private int antibotRatelimitConnectionsPerSecond = 3; + @Getter -+ private int antibotRatelimitPingsPerSecond = 8; ++ private int antibotRatelimitPingsPerSecond = 16; + @Getter + private boolean antibotReconnectEnabled = true; + @Getter From e85926db46321aade32ceda3e847993caeffc106 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:32:25 -0300 Subject: [PATCH 223/499] Improve Nickname Check --- .../0029-Antibot-System.patch | 45 +++---------------- .../0030-Allow-Invalid-Names.patch | 8 ++-- 2 files changed, 11 insertions(+), 42 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 070020ae..7d5680fb 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From cfbb1db6b2378c236e43e05fac4fde78af791934 Mon Sep 17 00:00:00 2001 +From 015789eed372670ab8438bf252690093b089ac3a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -320,10 +320,10 @@ index 00000000..ffa48b92 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..e0e836e0 +index 00000000..83b2f266 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java -@@ -0,0 +1,71 @@ +@@ -0,0 +1,43 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -333,29 +333,11 @@ index 00000000..e0e836e0 + +public class NicknameCheck { + private AddressDataManager addressDataManager; -+ private String lastNickname = ""; -+ private int lastLength = 0; -+ private int lengthRepeatCount = 0; + + public NicknameCheck(final AddressDataManager addressDataManager) { + this.addressDataManager = addressDataManager; + } + -+ public void updateNickname(final FlameCordConfiguration config, final String nickname) { -+ final int length = nickname.length(); -+ -+ if (lastLength == length) { -+ if (lengthRepeatCount < config.getAntibotNicknameLimit() && !nickname.equals(lastNickname)) { -+ lengthRepeatCount++; -+ } -+ } else if (lengthRepeatCount > 0) { -+ lengthRepeatCount--; -+ } -+ -+ lastLength = length; -+ lastNickname = nickname; -+ } -+ + private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { + for (final String blacklisted : config.getAntibotNicknameBlacklist()) { + if (nickname.startsWith(blacklisted)) { @@ -380,16 +362,6 @@ index 00000000..e0e836e0 + + return true; + } -+ -+ updateNickname(config, nickname); -+ -+ if (isBlacklisted(config, nickname) || lengthRepeatCount >= config.getAntibotNicknameLimit()) { -+ if (config.isAntibotNicknameFirewall()) { -+ addressData.firewall(); -+ } -+ -+ return true; -+ } + } + + return false; @@ -575,10 +547,10 @@ index 8957c79a..53148d68 100644 this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..5aef0c7b 100644 +index d972fcea..760b08d3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,81 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,78 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -604,9 +576,7 @@ index d972fcea..5aef0c7b 100644 + @Getter + private boolean antibotNicknameFirewall = true; + @Getter -+ private int antibotNicknameLimit = 3; -+ @Getter -+ private Collection antibotNicknameBlacklist = Arrays.asList("mcspam"); ++ private Collection antibotNicknameBlacklist = Arrays.asList("mcstorm", "mcdown", "mcbot", "theresa_bot", "dropbot", "kingbot"); + @Getter + private boolean antibotPasswordEnabled = true; + @Getter @@ -641,7 +611,6 @@ index d972fcea..5aef0c7b 100644 + this.antibotFirewallExpire = setIfUnexistant("antibot.fastchat.time", this.antibotFirewallExpire, config); + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); + this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); -+ this.antibotNicknameLimit = setIfUnexistant("antibot.nickname.limit", this.antibotNicknameLimit, config); + this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); + this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); + this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); @@ -660,7 +629,7 @@ index d972fcea..5aef0c7b 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +134,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -59,6 +131,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 216a1d65..f7db1699 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 17e051173143aa7d903059ba7acedab551dcbcdd Mon Sep 17 00:00:00 2001 +From 45096bd8e219897f49fc57711842e338a381dd7d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index df8c90e6..2385ae93 100644 +index 760b08d3..eff356e8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index df8c90e6..2385ae93 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -134,6 +138,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -131,6 +135,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -29,7 +29,7 @@ index df8c90e6..2385ae93 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 9df6b16e..3f6bcd8a 100644 +index 8c0d59f1..cf51f119 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 @@ -444,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection From 858f2672e0c570c06e83c75d15b5de2b723a0785 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:32:42 -0300 Subject: [PATCH 224/499] 0.7.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 2f00daa7..e037f342 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..1bb4c820 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.6"; ++ return "0.7.7"; } public void reloadMessages() From 8ead63377d93bf0c240069cebd09ef9799975446 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Mar 2022 10:57:28 -0300 Subject: [PATCH 225/499] Add Logger for Antibot --- .../0029-Antibot-System.patch | 111 ++++++++++++++---- .../0030-Allow-Invalid-Names.patch | 10 +- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 7d5680fb..5657854a 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 015789eed372670ab8438bf252690093b089ac3a Mon Sep 17 00:00:00 2001 +From fc67c21e56c8c6c490c9ea6b8c699e114fa1ee5f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -6,12 +6,13 @@ Subject: [PATCH] Antibot System diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..5a390f99 +index 00000000..765bf829 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,33 @@ +package dev._2lstudios.antibot; + ++import java.net.InetSocketAddress; +import java.net.SocketAddress; + +import dev._2lstudios.flamecord.FlameCord; @@ -44,7 +45,7 @@ index 00000000..5a390f99 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..40b8b32c +index 00000000..e9cd8b5e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java @@ -0,0 +1,114 @@ @@ -114,8 +115,8 @@ index 00000000..40b8b32c + } + + public void addPing() { -+ lastPing = System.currentTimeMillis(); + updatePingsSecond(); ++ lastPing = System.currentTimeMillis(); + pingsSecond++; + totalPings++; + } @@ -437,7 +438,7 @@ index 00000000..8ffe1e21 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..40edb98c +index 00000000..f9ab936b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -463,12 +464,12 @@ index 00000000..40edb98c + + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { -+ if (config.isAntibotRatelimitFirewall()) { -+ addressData.firewall(); -+ } -+ -+ return true; -+ } ++ if (config.isAntibotRatelimitFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } + } + + return false; @@ -547,10 +548,10 @@ index 8957c79a..53148d68 100644 this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..760b08d3 100644 +index d972fcea..e2674c3a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,78 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,99 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -562,28 +563,38 @@ index d972fcea..760b08d3 100644 + @Getter + private int antibotAccountsLimit = 3; + @Getter ++ private boolean antibotAccountsLog = true; ++ @Getter + private boolean antibotFastChatEnabled = true; + @Getter + private boolean antibotFastChatFirewall = true; + @Getter + private int antibotFastChatTime = 1000; + @Getter ++ private boolean antibotFastChatLog = true; ++ @Getter + private boolean antibotFirewallEnabled = true; + @Getter + private int antibotFirewallExpire = 30000; + @Getter ++ private boolean antibotFirewallLog = true; ++ @Getter + private boolean antibotNicknameEnabled = true; + @Getter + private boolean antibotNicknameFirewall = true; + @Getter + private Collection antibotNicknameBlacklist = Arrays.asList("mcstorm", "mcdown", "mcbot", "theresa_bot", "dropbot", "kingbot"); + @Getter ++ private boolean antibotNicknameLog = true; ++ @Getter + private boolean antibotPasswordEnabled = true; + @Getter + private boolean antibotPasswordFirewall = true; + @Getter + private int antibotPasswordLimit = 3; + @Getter ++ private boolean antibotPasswordLog = true; ++ @Getter + private boolean antibotRatelimitEnabled = true; + @Getter + private boolean antibotRatelimitFirewall = true; @@ -592,6 +603,8 @@ index d972fcea..760b08d3 100644 + @Getter + private int antibotRatelimitPingsPerSecond = 16; + @Getter ++ private boolean antibotRatelimitLog = true; ++ @Getter + private boolean antibotReconnectEnabled = true; + @Getter + private int antibotReconnectAttempts = 2; @@ -599,37 +612,46 @@ index d972fcea..760b08d3 100644 + private int antibotReconnectPings = 0; + @Getter + private int antibotReconnectMaxTime = 10000; ++ @Getter ++ private boolean antibotReconnectLog = true; + + public void loadAntibot(final Configuration config) { + this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); + this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); + this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); ++ this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); + this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); + this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); -+ this.antibotFirewallEnabled = setIfUnexistant("antibot.fastchat.firewall", this.antibotFirewallEnabled, config); -+ this.antibotFirewallExpire = setIfUnexistant("antibot.fastchat.time", this.antibotFirewallExpire, config); ++ this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); ++ this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.firewall", this.antibotFirewallEnabled, config); ++ this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); ++ this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); + this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); + this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); ++ this.antibotNicknameLog = setIfUnexistant("antibot.nickname.log", this.antibotNicknameLog, config); + this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); + this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); + this.antibotPasswordLimit = setIfUnexistant("antibot.password.limit", this.antibotPasswordLimit, config); ++ this.antibotPasswordLog = setIfUnexistant("antibot.password.log", this.antibotPasswordLog, config); + this.antibotRatelimitEnabled = setIfUnexistant("antibot.ratelimit.enabled", this.antibotRatelimitEnabled, config); + this.antibotRatelimitFirewall = setIfUnexistant("antibot.ratelimit.firewall", this.antibotRatelimitFirewall, config); + this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); + this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); ++ this.antibotRatelimitLog = setIfUnexistant("antibot.ratelimit.log", this.antibotRatelimitLog, config); + this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); + this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); + this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); + this.antibotReconnectMaxTime = setIfUnexistant("antibot.reconnect.max-time", this.antibotReconnectMaxTime, config); ++ this.antibotReconnectLog = setIfUnexistant("antibot.reconnect.log", this.antibotReconnectLog, config); + } + // FlameCord end - Antibot System + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +131,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -59,6 +152,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -660,7 +682,7 @@ index 57462992..0490b7f6 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..8c0d59f1 100644 +index 4ced9bd6..2796486e 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -684,7 +706,7 @@ index 4ced9bd6..8c0d59f1 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -382,6 +389,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -382,6 +389,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -694,6 +716,11 @@ index 4ced9bd6..8c0d59f1 100644 + + if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] is pinging too many times", ch.getRemoteAddress() ); ++ } ++ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); + return; + } @@ -702,7 +729,7 @@ index 4ced9bd6..8c0d59f1 100644 break; case 2: // Login -@@ -393,6 +411,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -393,6 +416,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -711,6 +738,11 @@ index 4ced9bd6..8c0d59f1 100644 + + if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] is connecting too many times", ch.getRemoteAddress() ); ++ } ++ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } @@ -719,7 +751,7 @@ index 4ced9bd6..8c0d59f1 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +458,31 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -430,6 +468,46 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -731,18 +763,33 @@ index 4ced9bd6..8c0d59f1 100644 + + if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] has a blacklisted nickname", ch.getRemoteAddress() ); ++ } ++ + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); + return; + } + + if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] has too many accounts", ch.getRemoteAddress() ); ++ } ++ + disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); + return; + } + + if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotReconnectLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] has to reconnect to join", ch.getRemoteAddress() ); ++ } ++ + disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); + return; + } @@ -752,10 +799,10 @@ index 4ced9bd6..8c0d59f1 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 e354032a..dd424439 100644 +index e354032a..976c37e1 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,9 @@ import com.google.common.base.Preconditions; +@@ -4,10 +4,15 @@ import com.google.common.base.Preconditions; import com.mojang.brigadier.context.StringRange; import com.mojang.brigadier.suggestion.Suggestion; import com.mojang.brigadier.suggestion.Suggestions; @@ -765,7 +812,13 @@ index e354032a..dd424439 100644 import io.netty.channel.Channel; import java.util.ArrayList; import java.util.LinkedList; -@@ -166,6 +169,22 @@ public class UpstreamBridge extends PacketHandler + import java.util.List; ++import java.util.logging.Level; ++ + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.ServerConnection.KeepAliveData; + import net.md_5.bungee.UserConnection; +@@ -166,6 +171,32 @@ public class UpstreamBridge extends PacketHandler } Preconditions.checkArgument(!empty, "Chat message is empty"); @@ -774,12 +827,22 @@ index e354032a..dd424439 100644 + + if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFastChatLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] is chatting too fast", con.getCh().getRemoteAddress() ); ++ } ++ + con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); + throw CancelSendSignal.INSTANCE; + } + + if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), chat.getMessage() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotPasswordLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); ++ } ++ + con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); + throw CancelSendSignal.INSTANCE; + } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index f7db1699..9fcf2ca4 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 45096bd8e219897f49fc57711842e338a381dd7d Mon Sep 17 00:00:00 2001 +From 34fa9f25ab794f26d34f99db1fe18f3ce9b1f93a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 760b08d3..eff356e8 100644 +index e2674c3a..97b5887e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 760b08d3..eff356e8 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -131,6 +135,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -152,6 +156,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -29,10 +29,10 @@ index 760b08d3..eff356e8 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 8c0d59f1..cf51f119 100644 +index 2796486e..12ab15cf 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 -@@ -444,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -454,7 +454,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; From 9a3a35ffd8dac16249d238c6a9c21d585179e176 Mon Sep 17 00:00:00 2001 From: 4drian3d Date: Tue, 8 Mar 2022 09:52:18 -0500 Subject: [PATCH 226/499] Remove upload actions --- .github/workflows/flamecord-build.yml | 9 +-------- .github/workflows/flamecord-pull-request.yml | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 4cf37dd9..3f31a69b 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -15,7 +15,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11] + java: [8, 17] steps: - name: Checkout Repository @@ -41,10 +41,3 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar - - # An artifact is generated in a compressed file according to each JDK build version. - - name: Upload FlameCord - uses: actions/upload-artifact@v2 - with: - name: FlameCord-JDK${{ matrix.java }} - path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml index 22035fde..10fe5f82 100644 --- a/.github/workflows/flamecord-pull-request.yml +++ b/.github/workflows/flamecord-pull-request.yml @@ -14,7 +14,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 11] + java: [8, 17] steps: - name: Checkout Repository @@ -40,10 +40,3 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar - - # An artifact is generated in a compressed file according to each JDK build version. - - name: Upload FlameCord - uses: actions/upload-artifact@v2 - with: - name: FlameCord-JDK${{ matrix.java }} - path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From 162b87322c9e4b375941db47d3b4a2c4d72fc627 Mon Sep 17 00:00:00 2001 From: samupro-dev <72470573+samupro-dev@users.noreply.github.com> Date: Tue, 8 Mar 2022 22:07:49 +0100 Subject: [PATCH 227/499] Update flamecord-build.yml Re-added artifact upload, added Java 11 and changed the name --- .github/workflows/flamecord-build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index 3f31a69b..cdfa81bd 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -2,7 +2,7 @@ # each push to the branch master to check its correct # compilation and will deliver an artifact to check # if the change is working properly. -name: FlameCord Maven Build +name: FlameCord Build (master) on: [push] @@ -15,7 +15,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 17] + java: [8, 11, 17] steps: - name: Checkout Repository @@ -41,3 +41,10 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar + + # An artifact is generated in a compressed file according to each JDK build version. + - name: Upload FlameCord + uses: actions/upload-artifact@v2 + with: + name: FlameCord-JDK${{ matrix.java }} + path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From 064269e98c4233517679071659d4d871f9f1f9fe Mon Sep 17 00:00:00 2001 From: samupro-dev <72470573+samupro-dev@users.noreply.github.com> Date: Tue, 8 Mar 2022 22:08:08 +0100 Subject: [PATCH 228/499] Update flamecord-pull-request.yml Re-added artifact upload, added Java 11 and changed the name --- .github/workflows/flamecord-pull-request.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml index 10fe5f82..c8514853 100644 --- a/.github/workflows/flamecord-pull-request.yml +++ b/.github/workflows/flamecord-pull-request.yml @@ -1,7 +1,7 @@ # This workflow will perform a compilation test on each # pull request to check its correct compilation and will deliver # an artifact to check if the change is working properly. -name: FlameCord Pull Request +name: FlameCord Build (pull request) on: [pull_request] @@ -14,7 +14,7 @@ jobs: # latest version up to the moment. strategy: matrix: - java: [8, 17] + java: [8, 11, 17] steps: - name: Checkout Repository @@ -40,3 +40,10 @@ jobs: git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar + + # An artifact is generated in a compressed file according to each JDK build version. + - name: Upload FlameCord + uses: actions/upload-artifact@v2 + with: + name: FlameCord-JDK${{ matrix.java }} + path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From 81a78853347fc40f49fb51908c8cbc5fd8f720e3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Mar 2022 23:08:31 -0300 Subject: [PATCH 229/499] Updated Source --- .../0003-FlameCord-rebrand.patch | 6 +- .../0029-Antibot-System.patch | 10 +-- .../0031-Avoid-Copying-Bytebufs.patch | 85 +++++++++++++++++++ 3 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index e037f342..9402a5f6 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 5c17305be9b4188d465958b85097b9bd12c3c037 Mon Sep 17 00:00:00 2001 +From 90ef2ebb8fe1980cb7c1aa063e78729b52e31210 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c..1bb4c820 100644 +index a4b58d9c..6bfef060 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index a4b58d9c..1bb4c820 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.7"; ++ return "0.7.9"; } public void reloadMessages() diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5657854a..593cadda 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From fc67c21e56c8c6c490c9ea6b8c699e114fa1ee5f Mon Sep 17 00:00:00 2001 +From 177c5397f7d374466b86da79bd6a3a00b88c5b60 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -321,7 +321,7 @@ index 00000000..ffa48b92 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..83b2f266 +index 00000000..f9b1ad70 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,43 @@ @@ -341,7 +341,7 @@ index 00000000..83b2f266 + + private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { + for (final String blacklisted : config.getAntibotNicknameBlacklist()) { -+ if (nickname.startsWith(blacklisted)) { ++ if (nickname.toLowerCase().contains(blacklisted)) { + return true; + } + } @@ -548,7 +548,7 @@ index 8957c79a..53148d68 100644 this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..e2674c3a 100644 +index d972fcea..1f354631 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,99 @@ import net.md_5.bungee.config.Configuration; @@ -601,7 +601,7 @@ index d972fcea..e2674c3a 100644 + @Getter + private int antibotRatelimitConnectionsPerSecond = 3; + @Getter -+ private int antibotRatelimitPingsPerSecond = 16; ++ private int antibotRatelimitPingsPerSecond = 8; + @Getter + private boolean antibotRatelimitLog = true; + @Getter diff --git a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch new file mode 100644 index 00000000..9d54bd0b --- /dev/null +++ b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch @@ -0,0 +1,85 @@ +From ac51cce7a1881d4247b90cfbdf5ebe286b6e6fbe Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 8 Mar 2022 23:02:29 -0300 +Subject: [PATCH] Avoid Copying Bytebufs + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 3992f521..01504c75 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -52,7 +52,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + } + +- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( ++ // FlameCord - Avoid Copying Bytebufs ++ int oldReaderIndex = in.readerIndex(); + + Object packetTypeInfo = null; + try +@@ -92,8 +93,11 @@ public class MinecraftDecoder extends MessageToMessageDecoder + in.skipBytes( in.readableBytes() ); + } + +- out.add( new PacketWrapper( packet, slice ) ); +- slice = null; ++ // Flamecord start - Avoid Copying Bytebufs ++ in.readerIndex(oldReaderIndex); ++ in = in.retain(); ++ out.add( new PacketWrapper( packet, in ) ); ++ // Flamecord end - Avoid Copying Bytebufs + } catch (BadPacketException | IndexOutOfBoundsException e) { + // Waterfall start: Additional DoS mitigations + if(!DEBUG) { +@@ -108,13 +112,11 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } else { + packetTypeStr = "unknown"; + } +- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall +- } finally +- { +- if ( slice != null ) +- { +- slice.release(); +- } ++ ++ // Flamecord start - Avoid Copying Bytebufs ++ in.readerIndex(oldReaderIndex); ++ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(in), e); // Waterfall ++ // Flamecord end - Avoid Copying Bytebufs + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +index 5ce42f62..f32f7681 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +@@ -38,7 +38,8 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 + if ( profile != null && profile.getProperties() != null + && profile.getProperties().length >= 1 ) + { +- ByteBuf rest = packet.copy(); ++ // Flamecord - Avoid Copying Bytebufs ++ int oldReaderIndex = packet.readerIndex(); + packet.readerIndex( readerIndex ); + packet.writerIndex( readerIndex + packetIdLength + idLength ); + DefinedPacket.writeString( player.getUniqueId().toString(), packet ); +@@ -50,8 +51,12 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 + DefinedPacket.writeString( property.getValue(), packet ); + DefinedPacket.writeString( property.getSignature(), packet ); + } +- packet.writeBytes( rest ); +- rest.release(); ++ // Flamecord start - Avoid Copying Bytebufs ++ int newReaderIndex = packet.readerIndex(); ++ packet.readerIndex( oldReaderIndex ); ++ packet.writeBytes( packet ); ++ packet.readerIndex( newReaderIndex ); ++ // Flamecord end - Avoid Copying Bytebufs + } + } + } +-- +2.32.0 + From 0891d8daee46900034fb4e1715941361695f3078 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:42:33 -0300 Subject: [PATCH 230/499] Duplicate buf instead of Copy --- .../0031-Avoid-Copying-Bytebufs.patch | 85 ------------------- .../0031-Duplicate-buf-instead-of-Copy.patch | 33 +++++++ 2 files changed, 33 insertions(+), 85 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch create mode 100644 Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch diff --git a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch b/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch deleted file mode 100644 index 9d54bd0b..00000000 --- a/Waterfall-Proxy-Patches/0031-Avoid-Copying-Bytebufs.patch +++ /dev/null @@ -1,85 +0,0 @@ -From ac51cce7a1881d4247b90cfbdf5ebe286b6e6fbe Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 8 Mar 2022 23:02:29 -0300 -Subject: [PATCH] Avoid Copying Bytebufs - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 3992f521..01504c75 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -52,7 +52,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - } - -- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( -+ // FlameCord - Avoid Copying Bytebufs -+ int oldReaderIndex = in.readerIndex(); - - Object packetTypeInfo = null; - try -@@ -92,8 +93,11 @@ public class MinecraftDecoder extends MessageToMessageDecoder - in.skipBytes( in.readableBytes() ); - } - -- out.add( new PacketWrapper( packet, slice ) ); -- slice = null; -+ // Flamecord start - Avoid Copying Bytebufs -+ in.readerIndex(oldReaderIndex); -+ in = in.retain(); -+ out.add( new PacketWrapper( packet, in ) ); -+ // Flamecord end - Avoid Copying Bytebufs - } catch (BadPacketException | IndexOutOfBoundsException e) { - // Waterfall start: Additional DoS mitigations - if(!DEBUG) { -@@ -108,13 +112,11 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } else { - packetTypeStr = "unknown"; - } -- throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(slice), e); // Waterfall -- } finally -- { -- if ( slice != null ) -- { -- slice.release(); -- } -+ -+ // Flamecord start - Avoid Copying Bytebufs -+ in.readerIndex(oldReaderIndex); -+ throw new FastDecoderException("Error decoding packet " + packetTypeStr + " with contents:\n" + ByteBufUtil.prettyHexDump(in), e); // Waterfall -+ // Flamecord end - Avoid Copying Bytebufs - } - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -index 5ce42f62..f32f7681 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -@@ -38,7 +38,8 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 - if ( profile != null && profile.getProperties() != null - && profile.getProperties().length >= 1 ) - { -- ByteBuf rest = packet.copy(); -+ // Flamecord - Avoid Copying Bytebufs -+ int oldReaderIndex = packet.readerIndex(); - packet.readerIndex( readerIndex ); - packet.writerIndex( readerIndex + packetIdLength + idLength ); - DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -@@ -50,8 +51,12 @@ class EntityMap_1_7_6 extends EntityMap_1_7_2 - DefinedPacket.writeString( property.getValue(), packet ); - DefinedPacket.writeString( property.getSignature(), packet ); - } -- packet.writeBytes( rest ); -- rest.release(); -+ // Flamecord start - Avoid Copying Bytebufs -+ int newReaderIndex = packet.readerIndex(); -+ packet.readerIndex( oldReaderIndex ); -+ packet.writeBytes( packet ); -+ packet.readerIndex( newReaderIndex ); -+ // Flamecord end - Avoid Copying Bytebufs - } - } - } --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch new file mode 100644 index 00000000..d621b4af --- /dev/null +++ b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch @@ -0,0 +1,33 @@ +From 0c74e3dae65a16605b5faee82cac81a4dc72d933 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 9 Mar 2022 14:36:43 -0300 +Subject: [PATCH] Duplicate buf instead of Copy + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 3992f521..074d2437 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -52,7 +52,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + } + +- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( ++ // FlameCord - Duplicate buf instead of Copy ++ ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( + + Object packetTypeInfo = null; + try +@@ -92,7 +93,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder + in.skipBytes( in.readableBytes() ); + } + +- out.add( new PacketWrapper( packet, slice ) ); ++ // FlameCord - Duplicate buf instead of Copy ++ out.add( new PacketWrapper( packet, slice.retain() ) ); + slice = null; + } catch (BadPacketException | IndexOutOfBoundsException e) { + // Waterfall start: Additional DoS mitigations +-- +2.32.0 + From 2d8ca5f2c77249806b03b2a1c18fd38616da79d8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:42:42 -0300 Subject: [PATCH 231/499] 0.8.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 9402a5f6..b9f369c6 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.7.9"; ++ return "0.8.0"; } public void reloadMessages() From 03e6b26318bea58d7f2b1ce6acafe10dbf95cff7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:10:00 -0300 Subject: [PATCH 232/499] General Restructuration --- .../0017-FlameCord-General-Patch.patch | 37 ++++++++++--------- .../0018-FlameCord-module-system.patch | 22 +++++------ ...0019-FlameCord-message-configuration.patch | 27 +++++++------- .../0029-Antibot-System.patch | 24 ++++++------ 4 files changed, 54 insertions(+), 56 deletions(-) diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index e6b66617..4d55418b 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 64e6384ad6a59b910e932735b6d505038104ea72 Mon Sep 17 00:00:00 2001 +From d22662f6826b0cced8e7cd3c4052fb87b502d0d7 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,10 +6,10 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..252612a3 +index 00000000..8e69160d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,34 @@ +@@ -0,0 +1,35 @@ +package dev._2lstudios.flamecord; + +import java.util.Collection; @@ -23,26 +23,27 @@ index 00000000..252612a3 +public class FlameCord { + @Getter + private static FlameCord instance; -+ @Getter -+ private final FlameCordConfiguration flameCordConfiguration; -+ @Getter -+ private boolean running = true; + -+ public static void renew(final Logger logger, final Collection whitelistedAddresses) { ++ public static void reload(final Logger logger, final Collection whitelistedAddresses) { + if (FlameCord.instance != null) { -+ FlameCord.instance.running = false; ++ instance.reload(logger); ++ } else { ++ FlameCord.instance = new FlameCord(logger, whitelistedAddresses); + } -+ -+ final FlameCord instance = new FlameCord(logger, whitelistedAddresses); -+ -+ FlameCord.instance = instance; + } + -+ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { ++ @Getter ++ private FlameCordConfiguration flameCordConfiguration; ++ ++ private void reload(final Logger logger) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + } ++ ++ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { ++ reload(logger); ++ } +} \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -141,7 +142,7 @@ index 4b9b80b9..aa35f870 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 00000000..a323598e +index 00000000..91d60bfb --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -183,7 +184,7 @@ index 00000000..a323598e + whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); + } + -+ FlameCord.renew(bungeeCord.getLogger(), whitelistedAddresses); ++ FlameCord.reload(bungeeCord.getLogger(), whitelistedAddresses); + sender.sendMessage(TextComponent + .fromLegacyText("flamecord_reload")); + break; @@ -204,7 +205,7 @@ index 00000000..a323598e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3ea5518f..2ca3e2b3 100644 +index 0de754d5..a09d6baf 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -245,7 +246,7 @@ index 3ea5518f..2ca3e2b3 100644 + whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); + } + -+ FlameCord.renew(logger, whitelistedAddresses); ++ FlameCord.reload(logger, whitelistedAddresses); + if ( config.isForgeSupport() ) { diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch index 1712632d..e10ddcc4 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From e35251dcc5fc75498efeb2a829ff9cb76cac5620 Mon Sep 17 00:00:00 2001 +From c701401d36a6cee1d4ba6a651eaec3148939b62c Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 252612a3..2e317533 100644 +index 8e69160d..ac37eaa3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -16,23 +16,21 @@ index 252612a3..2e317533 100644 import lombok.Getter; import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.YamlConfiguration; -@@ -14,6 +15,8 @@ public class FlameCord { - @Getter - private final FlameCordConfiguration flameCordConfiguration; +@@ -22,11 +23,14 @@ public class FlameCord { + @Getter -+ private final ModulesConfiguration modulesConfiguration; + private FlameCordConfiguration flameCordConfiguration; + @Getter - private boolean running = true; ++ private ModulesConfiguration modulesConfiguration; - public static void renew(final Logger logger, final Collection whitelistedAddresses) { -@@ -30,5 +33,6 @@ public class FlameCord { + private void reload(final Logger logger) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); } - } -\ No newline at end of file + + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 index 00000000..6c5bb961 @@ -89,7 +87,7 @@ index 00000000..6c5bb961 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2ca3e2b3..93f57747 100644 +index a09d6baf..ed5ce6e6 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index 22892963..543bd025 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From 99d94a26237d95b60348c4de7feb9ff9c6744a9b Mon Sep 17 00:00:00 2001 +From a2394941af909d50114567bebc428ee13099578d Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 2e317533..8957c79a 100644 +index ac37eaa3..c78ab3a7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -16,23 +16,22 @@ index 2e317533..8957c79a 100644 import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import lombok.Getter; import net.md_5.bungee.config.ConfigurationProvider; -@@ -17,6 +18,8 @@ public class FlameCord { +@@ -25,12 +26,15 @@ public class FlameCord { + private FlameCordConfiguration flameCordConfiguration; @Getter - private final ModulesConfiguration modulesConfiguration; - @Getter -+ private final MessagesConfiguration messagesConfiguration; + private ModulesConfiguration modulesConfiguration; + @Getter - private boolean running = true; ++ private MessagesConfiguration messagesConfiguration; - public static void renew(final Logger logger, final Collection whitelistedAddresses) { -@@ -34,5 +37,6 @@ public class FlameCord { + private void reload(final Logger logger) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); } - } -\ No newline at end of file + + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 index 00000000..57462992 @@ -154,7 +153,7 @@ index 00000000..57462992 +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index a323598e..bf6f8538 100644 +index 91d60bfb..cc76325b 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -175,7 +174,7 @@ index a323598e..bf6f8538 100644 if (args.length > 0) { @@ -38,21 +40,22 @@ private final BungeeCord bungeeCord; - FlameCord.renew(bungeeCord.getLogger(), whitelistedAddresses); + FlameCord.reload(bungeeCord.getLogger(), whitelistedAddresses); sender.sendMessage(TextComponent - .fromLegacyText("flamecord_reload")); + .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); @@ -201,7 +200,7 @@ index a323598e..bf6f8538 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 93f57747..29475584 100644 +index ed5ce6e6..18c53872 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 593cadda..00233fe0 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 177c5397f7d374466b86da79bd6a3a00b88c5b60 Mon Sep 17 00:00:00 2001 +From 21db663839576a02b5d703fbc7eeddcab8d80a95 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -515,7 +515,7 @@ index 00000000..f958a6f2 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8957c79a..53148d68 100644 +index c78ab3a7..15be1191 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -527,19 +527,19 @@ index 8957c79a..53148d68 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -11,6 +13,10 @@ import net.md_5.bungee.config.ConfigurationProvider; - import net.md_5.bungee.config.YamlConfiguration; - - public class FlameCord { +@@ -25,6 +27,10 @@ public class FlameCord { + @Getter + private FlameCordConfiguration flameCordConfiguration; + @Getter ++ private AddressDataManager addressDataManager; + @Getter -+ private final AddressDataManager addressDataManager; ++ private CheckManager checkManager; + @Getter -+ private final CheckManager checkManager; - @Getter - private static FlameCord instance; + private ModulesConfiguration modulesConfiguration; @Getter -@@ -35,6 +41,8 @@ public class FlameCord { - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + private MessagesConfiguration messagesConfiguration; +@@ -32,6 +38,8 @@ public class FlameCord { + private void reload(final Logger logger) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + this.addressDataManager = new AddressDataManager(); From 9aa2feaade121a8e9d6d0ffdf8a44016816e8776 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:18:16 -0300 Subject: [PATCH 233/499] Country Check --- .../0029-Antibot-System.patch | 254 ++++++++++++++++-- .../0030-Allow-Invalid-Names.patch | 10 +- 2 files changed, 231 insertions(+), 33 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 00233fe0..6d5916df 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,9 +1,25 @@ -From 21db663839576a02b5d703fbc7eeddcab8d80a95 Mon Sep 17 00:00:00 2001 +From 77f474120462359d93992cb5e3727c8be41b9046 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +index f4bf5ec6..4a0d8e5d 100644 +--- a/flamecord/pom.xml ++++ b/flamecord/pom.xml +@@ -30,6 +30,11 @@ + ${project.version} + compile + ++ ++ com.maxmind.db ++ maxmind-db ++ 2.0.0 ++ + + + diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 index 00000000..765bf829 @@ -45,10 +61,10 @@ index 00000000..765bf829 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..e9cd8b5e +index 00000000..053734f3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,114 @@ +@@ -0,0 +1,123 @@ +package dev._2lstudios.antibot; + +import java.util.Collection; @@ -59,6 +75,7 @@ index 00000000..e9cd8b5e +public class AddressData { + private final Collection nicknames = new HashSet<>(); + private String lastNickname = ""; ++ private String country = null; + private long lastPing = 0; + private long penultimateConnection = 0; + private long lastConnection = 0; @@ -162,6 +179,14 @@ index 00000000..e9cd8b5e + public void setTotalConnections(final int totalConnections) { + this.totalConnections = totalConnections; + } ++ ++ public String setCountry(final String country) { ++ return this.country = country; ++ } ++ ++ public String getCountry() { ++ return country; ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 @@ -196,57 +221,195 @@ index 00000000..d19c2eb0 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..c3a6ab43 +index 00000000..ebf37a2b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java -@@ -0,0 +1,49 @@ +@@ -0,0 +1,39 @@ +package dev._2lstudios.antibot; + ++import lombok.Getter; ++ +public class CheckManager { ++ @Getter + private final AccountsCheck accountsCheck; ++ @Getter ++ private final CountryCheck countryCheck; ++ @Getter + private final FastChatCheck fastChatCheck; ++ @Getter + private final FirewallCheck firewallCheck; ++ @Getter + private final NicknameCheck nicknameCheck; ++ @Getter + private final PasswordCheck passwordCheck; ++ @Getter + private final RatelimitCheck ratelimitCheck; ++ @Getter + private final ReconnectCheck reconnectCheck; + + public CheckManager(final AddressDataManager addressDataManager) { + this.accountsCheck = new AccountsCheck(addressDataManager); ++ this.countryCheck = new CountryCheck(addressDataManager); + this.fastChatCheck = new FastChatCheck(addressDataManager); + this.firewallCheck = new FirewallCheck(addressDataManager); + this.nicknameCheck = new NicknameCheck(addressDataManager); + this.passwordCheck = new PasswordCheck(addressDataManager); + this.ratelimitCheck = new RatelimitCheck(addressDataManager); + this.reconnectCheck = new ReconnectCheck(addressDataManager); ++ ++ this.countryCheck.load(); ++ } ++ ++ public void unload() { ++ this.countryCheck.unload(); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java +new file mode 100644 +index 00000000..b2981fdb +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java +@@ -0,0 +1,142 @@ ++package dev._2lstudios.antibot; ++ ++import java.io.File; ++import java.io.IOException; ++import java.io.InputStream; ++import java.net.InetAddress; ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.net.URL; ++import java.nio.file.Files; ++ ++import com.maxmind.db.CHMCache; ++import com.maxmind.db.MaxMindDbConstructor; ++import com.maxmind.db.MaxMindDbParameter; ++import com.maxmind.db.Reader; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class CountryCheck { ++ private final AddressDataManager addressDataManager; ++ private Reader maxMindReader; ++ ++ public CountryCheck(final AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public void download(final URL url, final File file) throws Exception { ++ try (InputStream in = url.openStream()) { ++ Files.copy(in, file.toPath()); ++ } + } + -+ public AccountsCheck getAccountsCheck() { -+ return accountsCheck; ++ public void load() { ++ final File file = new File("GeoLite2-Country.mmdb"); ++ ++ try { ++ if (!file.exists()) { ++ System.out.println("Starting download of MaxMindDB (This will take some seconds...)"); ++ download(new URL("https://git.io/GeoLite2-Country.mmdb"), file); ++ } ++ ++ this.maxMindReader = new Reader(file, new CHMCache()); ++ } catch (final Exception exception) { ++ // Ignored ++ } + } + -+ public FastChatCheck getFastChatCheck() { -+ return fastChatCheck; ++ public void unload() { ++ try { ++ if (this.maxMindReader != null) { ++ this.maxMindReader.close(); ++ } ++ } catch (final IOException ex) { ++ // Ignored ++ } + } + -+ public FirewallCheck getFirewallCheck() { -+ return firewallCheck; ++ private boolean isBlacklisted(final FlameCordConfiguration config, final String isoCode) { ++ for (final String blacklisted : config.getAntibotCountryBlacklist()) { ++ if (isoCode.contains(blacklisted)) { ++ return true; ++ } ++ } ++ ++ return false; + } + -+ public NicknameCheck getNicknameCheck() { -+ return nicknameCheck; ++ public static class LookupResult { ++ private final Country country; ++ ++ @MaxMindDbConstructor ++ public LookupResult(@MaxMindDbParameter(name = "country") final Country country) { ++ this.country = country; ++ } ++ ++ public Country getCountry() { ++ return this.country; ++ } + } + -+ public PasswordCheck getPasswordCheck() { -+ return passwordCheck; ++ public static class Country { ++ private final String isoCode; ++ ++ @MaxMindDbConstructor ++ public Country(@MaxMindDbParameter(name = "iso_code") final String isoCode) { ++ this.isoCode = isoCode; ++ } ++ ++ public String getIsoCode() { ++ return this.isoCode; ++ } + } + -+ public RatelimitCheck getRatelimitCheck() { -+ return ratelimitCheck; ++ private String getIsoCode(final InetAddress address) { ++ try { ++ final LookupResult lookupResult = maxMindReader.get(address, LookupResult.class); ++ ++ if (lookupResult == null) { ++ return "LOCAL"; ++ } else { ++ final Country country = lookupResult.getCountry(); ++ final String isoCode = country.getIsoCode(); ++ ++ return isoCode; ++ } ++ } catch (final IOException exception) { ++ // Ignored ++ } ++ ++ return null; + } + -+ public ReconnectCheck getReconnectCheck() { -+ return reconnectCheck; ++ public boolean check(final SocketAddress socketAddress) { ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (config.isAntibotCountryEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final String addressCountry = addressData.getCountry(); ++ final String country; ++ ++ if (addressCountry != null) { ++ country = addressCountry; ++ } else { ++ country = getIsoCode(((InetSocketAddress) socketAddress).getAddress()); ++ addressData.setCountry(country); ++ } ++ ++ System.out.println(country); ++ ++ if (country != null && isBlacklisted(config, country)) { ++ if (config.isAntibotNicknameFirewall()) { ++ addressData.firewall(); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -515,7 +678,7 @@ index 00000000..f958a6f2 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7..15be1191 100644 +index c78ab3a7..3df7ac26 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -538,20 +701,31 @@ index c78ab3a7..15be1191 100644 private ModulesConfiguration modulesConfiguration; @Getter private MessagesConfiguration messagesConfiguration; -@@ -32,6 +38,8 @@ public class FlameCord { +@@ -32,6 +38,11 @@ public class FlameCord { private void reload(final Logger logger) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + this.addressDataManager = new AddressDataManager(); ++ ++ if (checkManager != null) checkManager.unload(); ++ + this.checkManager = new CheckManager(addressDataManager); this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..1f354631 100644 +index d972fcea..9d9d1011 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,99 @@ import net.md_5.bungee.config.Configuration; +@@ -5,7 +5,6 @@ import java.io.IOException; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.HashSet; + import java.util.List; + import java.util.Random; + +@@ -15,6 +14,111 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -565,6 +739,14 @@ index d972fcea..1f354631 100644 + @Getter + private boolean antibotAccountsLog = true; + @Getter ++ private boolean antibotCountryEnabled = true; ++ @Getter ++ private boolean antibotCountryFirewall = true; ++ @Getter ++ private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); ++ @Getter ++ private boolean antibotCountryLog = true; ++ @Getter + private boolean antibotFastChatEnabled = true; + @Getter + private boolean antibotFastChatFirewall = true; @@ -620,6 +802,10 @@ index d972fcea..1f354631 100644 + this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); + this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); + this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); ++ this.antibotCountryEnabled = setIfUnexistant("antibot.country.enabled", this.antibotCountryEnabled, config); ++ this.antibotCountryFirewall = setIfUnexistant("antibot.country.firewall", this.antibotCountryFirewall, config); ++ this.antibotCountryBlacklist = setIfUnexistant("antibot.country.blacklist", this.antibotCountryBlacklist, config); ++ this.antibotCountryLog = setIfUnexistant("antibot.country.log", this.antibotCountryLog, config); + this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); + this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); @@ -651,7 +837,7 @@ index d972fcea..1f354631 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +152,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -59,6 +163,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -661,10 +847,10 @@ index d972fcea..1f354631 100644 this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 57462992..0490b7f6 100644 +index 57462992..ee0295c7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -81,6 +81,16 @@ public class MessagesConfiguration extends FlameConfig { +@@ -81,6 +81,17 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); @@ -676,13 +862,14 @@ index 57462992..0490b7f6 100644 + setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + // FlameCord end - Antibot System + // FlameCord setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..2796486e 100644 +index 4ced9bd6..a9a17154 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -751,7 +938,7 @@ index 4ced9bd6..2796486e 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +468,46 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -430,6 +468,57 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -793,6 +980,17 @@ index 4ced9bd6..2796486e 100644 + disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); + return; + } ++ ++ if ( checkManager.getCountryCheck().check( ch.getRemoteAddress() ) ) ++ { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotCountryLog() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] had his country blocked from the server", ch.getRemoteAddress() ); ++ } ++ ++ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); ++ return; ++ } + // FlameCord end - Antibot System + // If offline mode and they are already on, don't allow connect diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 9fcf2ca4..40038fc7 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From 34fa9f25ab794f26d34f99db1fe18f3ce9b1f93a Mon Sep 17 00:00:00 2001 +From 5d44779327119a5967c7a343a214b8b420732d64 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index e2674c3a..97b5887e 100644 +index 9d9d1011..aaa5298c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; +@@ -14,6 +14,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index e2674c3a..97b5887e 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -152,6 +156,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -163,6 +167,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -29,7 +29,7 @@ index e2674c3a..97b5887e 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 2796486e..12ab15cf 100644 +index a9a17154..0c5fd21e 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 @@ -454,7 +454,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection From 83adc414c8a1109a4d859c68b07d4700cf3ed6fa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:18:49 -0300 Subject: [PATCH 234/499] 0.8.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b9f369c6..967d720d 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.0"; ++ return "0.8.1"; } public void reloadMessages() From bbc3e01aeeec64870b861192977ba96931dd4847 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:33:34 -0300 Subject: [PATCH 235/499] Remove Unused Log --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 6d5916df..14dee768 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 77f474120462359d93992cb5e3727c8be41b9046 Mon Sep 17 00:00:00 2001 +From eddab2cf05a5d80fa734db35a1c0d6c7bc7a75ce Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -266,10 +266,10 @@ index 00000000..ebf37a2b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..b2981fdb +index 00000000..5cb5021a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java -@@ -0,0 +1,142 @@ +@@ -0,0 +1,140 @@ +package dev._2lstudios.antibot; + +import java.io.File; @@ -398,8 +398,6 @@ index 00000000..b2981fdb + addressData.setCountry(country); + } + -+ System.out.println(country); -+ + if (country != null && isBlacklisted(config, country)) { + if (config.isAntibotNicknameFirewall()) { + addressData.firewall(); From 393555898dd1ba4e87d8c14d6815aa87d255517d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:17:53 -0300 Subject: [PATCH 236/499] Antibot Firewall Ipset Option --- .../0029-Antibot-System.patch | 97 +++++++++++++------ .../0030-Allow-Invalid-Names.patch | 6 +- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 14dee768..8b2ceec4 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From eddab2cf05a5d80fa734db35a1c0d6c7bc7a75ce Mon Sep 17 00:00:00 2001 +From aa6407df7daef6d3fa424d942c50b0dec1115eef Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -61,12 +61,13 @@ index 00000000..765bf829 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..053734f3 +index 00000000..3a6565c7 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,123 @@ +@@ -0,0 +1,143 @@ +package dev._2lstudios.antibot; + ++import java.io.IOException; +import java.util.Collection; +import java.util.HashSet; + @@ -74,6 +75,7 @@ index 00000000..053734f3 + +public class AddressData { + private final Collection nicknames = new HashSet<>(); ++ private final String hostString; + private String lastNickname = ""; + private String country = null; + private long lastPing = 0; @@ -85,6 +87,10 @@ index 00000000..053734f3 + private int connectionsSecond = 0; + private int totalConnections = 0; + ++ public AddressData(final String hostString) { ++ this.hostString = hostString; ++ } ++ + public Collection getNicknames() { + return nicknames; + } @@ -172,7 +178,21 @@ index 00000000..053734f3 + .getAntibotFirewallExpire(); + } + ++ public String getHostString() { ++ return hostString; ++ } ++ + public void firewall() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { ++ Runtime runtime = Runtime.getRuntime(); ++ ++ try { ++ runtime.exec("ipset add flamecord_blacklist " + getHostString()); ++ } catch (IOException exception) { ++ // Ignored ++ } ++ } ++ + this.lastFirewall = System.currentTimeMillis(); + } + @@ -190,7 +210,7 @@ index 00000000..053734f3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 00000000..d19c2eb0 +index 00000000..3f6e4186 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java @@ -0,0 +1,25 @@ @@ -211,7 +231,7 @@ index 00000000..d19c2eb0 + if (addressData.containsKey(addressString)) { + return addressData.get(addressString); + } else { -+ AddressData data = new AddressData(); ++ AddressData data = new AddressData(addressString); + + addressData.put(addressString, data); + @@ -221,12 +241,13 @@ index 00000000..d19c2eb0 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..ebf37a2b +index 00000000..137ed980 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java -@@ -0,0 +1,39 @@ +@@ -0,0 +1,41 @@ +package dev._2lstudios.antibot; + ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; +import lombok.Getter; + +public class CheckManager { @@ -247,17 +268,18 @@ index 00000000..ebf37a2b + @Getter + private final ReconnectCheck reconnectCheck; + -+ public CheckManager(final AddressDataManager addressDataManager) { ++ public CheckManager(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { + this.accountsCheck = new AccountsCheck(addressDataManager); + this.countryCheck = new CountryCheck(addressDataManager); + this.fastChatCheck = new FastChatCheck(addressDataManager); -+ this.firewallCheck = new FirewallCheck(addressDataManager); ++ this.firewallCheck = new FirewallCheck(addressDataManager, flameCordConfiguration); + this.nicknameCheck = new NicknameCheck(addressDataManager); + this.passwordCheck = new PasswordCheck(addressDataManager); + this.ratelimitCheck = new RatelimitCheck(addressDataManager); + this.reconnectCheck = new ReconnectCheck(addressDataManager); + + this.countryCheck.load(); ++ this.firewallCheck.load(); + } + + public void unload() { @@ -450,28 +472,42 @@ index 00000000..76902c27 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java new file mode 100644 -index 00000000..ffa48b92 +index 00000000..665e2088 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java -@@ -0,0 +1,26 @@ +@@ -0,0 +1,40 @@ +package dev._2lstudios.antibot; + ++import java.io.IOException; +import java.net.SocketAddress; + -+import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class FirewallCheck { + private final AddressDataManager addressDataManager; ++ private final FlameCordConfiguration flameCordConfiguration; + -+ public FirewallCheck(final AddressDataManager addressDataManager) { ++ public FirewallCheck(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { + this.addressDataManager = addressDataManager; ++ this.flameCordConfiguration = flameCordConfiguration; + } + -+ public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ public void load() { ++ if (flameCordConfiguration.isAntibotFirewallIpset()) { ++ Runtime runtime = Runtime.getRuntime(); ++ ++ try { ++ runtime.exec("ipset create flamecord_blacklist hash:ip timeout " + flameCordConfiguration.getAntibotFirewallExpire()); ++ runtime.exec("iptables -D INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); ++ runtime.exec("iptables -I INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); ++ } catch (IOException exception) { ++ // Ignored ++ } ++ } ++ } + -+ if (config.isAntibotFirewallEnabled()) { ++ public boolean check(final SocketAddress socketAddress) { ++ if (flameCordConfiguration.isAntibotFirewallEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + + return addressData.isFirewalled(); @@ -676,7 +712,7 @@ index 00000000..f958a6f2 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7..3df7ac26 100644 +index c78ab3a7..4079caa5 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -688,7 +724,7 @@ index c78ab3a7..3df7ac26 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -25,6 +27,10 @@ public class FlameCord { +@@ -25,16 +27,24 @@ public class FlameCord { @Getter private FlameCordConfiguration flameCordConfiguration; @Getter @@ -699,20 +735,22 @@ index c78ab3a7..3df7ac26 100644 private ModulesConfiguration modulesConfiguration; @Getter private MessagesConfiguration messagesConfiguration; -@@ -32,6 +38,11 @@ public class FlameCord { + private void reload(final Logger logger) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - -+ this.addressDataManager = new AddressDataManager(); -+ ++ + if (checkManager != null) checkManager.unload(); -+ -+ this.checkManager = new CheckManager(addressDataManager); + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); ++ this.addressDataManager = new AddressDataManager(); ++ this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); + } + + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..9d9d1011 100644 +index d972fcea..dc9ba8f0 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -5,7 +5,6 @@ import java.io.IOException; @@ -723,7 +761,7 @@ index d972fcea..9d9d1011 100644 import java.util.List; import java.util.Random; -@@ -15,6 +14,111 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +14,114 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -755,6 +793,8 @@ index d972fcea..9d9d1011 100644 + @Getter + private boolean antibotFirewallEnabled = true; + @Getter ++ private boolean antibotFirewallIpset = true; ++ @Getter + private int antibotFirewallExpire = 30000; + @Getter + private boolean antibotFirewallLog = true; @@ -808,7 +848,8 @@ index d972fcea..9d9d1011 100644 + this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); + this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); -+ this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.firewall", this.antibotFirewallEnabled, config); ++ this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); ++ this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); @@ -835,7 +876,7 @@ index d972fcea..9d9d1011 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +163,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -59,6 +166,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 40038fc7..138539a7 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 5d44779327119a5967c7a343a214b8b420732d64 Mon Sep 17 00:00:00 2001 +From 59bd5c9b337f2f398cd092ded01185743aab1e2f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9d9d1011..aaa5298c 100644 +index dc9ba8f0..aa1c8266 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -14,6 +14,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9d9d1011..aaa5298c 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -163,6 +167,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -166,6 +170,8 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } From be3481c6f267ddbd9e0a65e74dc78f163883cc61 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:21:24 -0300 Subject: [PATCH 237/499] 0.8.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 967d720d..0539f16a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.1"; ++ return "0.8.2"; } public void reloadMessages() From 81d5e3cbf66ae9d416cae24b5d178b4b5d915d95 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:04:35 -0300 Subject: [PATCH 238/499] Disable entity Metadata Rewrite by Default --- ...e-entity-Metadata-Rewrite-by-Default.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch new file mode 100644 index 00000000..17a1b39b --- /dev/null +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch @@ -0,0 +1,22 @@ +From d77efb7c81a4826148fd305a6703e746bb82592a Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Mar 2022 20:04:08 -0300 +Subject: [PATCH] Disable entity Metadata Rewrite by Default + + +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index ff4bbf34..0c8622cc 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -42,7 +42,7 @@ public class WaterfallConfiguration extends Configuration { + private int tabThrottle = 1000; + private boolean disableModernTabLimiter = true; + +- private boolean disableEntityMetadataRewrite = false; ++ private boolean disableEntityMetadataRewrite = true; // FlameCord - Disable entity Metadata Rewrite by Default + private boolean disableTabListRewrite = false; + + /* +-- +2.32.0 + From 097d5ada4ece3c63a44c90c20fe6093141c667f9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:34:22 -0300 Subject: [PATCH 239/499] Disable entity Metadata Rewrite --- ...e-entity-Metadata-Rewrite-by-Default.patch | 22 - ...0032-Disable-entity-Metadata-Rewrite.patch | 3234 +++++++++++++++++ 2 files changed, 3234 insertions(+), 22 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch create mode 100644 Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch deleted file mode 100644 index 17a1b39b..00000000 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite-by-Default.patch +++ /dev/null @@ -1,22 +0,0 @@ -From d77efb7c81a4826148fd305a6703e746bb82592a Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 10 Mar 2022 20:04:08 -0300 -Subject: [PATCH] Disable entity Metadata Rewrite by Default - - -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index ff4bbf34..0c8622cc 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -42,7 +42,7 @@ public class WaterfallConfiguration extends Configuration { - private int tabThrottle = 1000; - private boolean disableModernTabLimiter = true; - -- private boolean disableEntityMetadataRewrite = false; -+ private boolean disableEntityMetadataRewrite = true; // FlameCord - Disable entity Metadata Rewrite by Default - private boolean disableTabListRewrite = false; - - /* --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch new file mode 100644 index 00000000..03e402c0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -0,0 +1,3234 @@ +From 05caaeafd1d30cd331e17dd438d21f8d7505890a Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Mar 2022 20:23:55 -0300 +Subject: [PATCH] Disable entity Metadata Rewrite + + +diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +index 469fe0e1..97bd384b 100644 +--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java ++++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +@@ -251,11 +251,6 @@ public interface ProxyConfig + */ + boolean isDisableModernTabLimiter(); + +- /** +- * @return Should we disable entity metadata rewriting? +- */ +- boolean isDisableEntityMetadataRewrite(); +- + /** + * Whether tablist rewriting should be disabled or not + * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise +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 +index ee2317e8..15a61b7e 100644 +--- 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,8 +8,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; + import net.md_5.bungee.protocol.packet.Commands; + import net.md_5.bungee.protocol.packet.EncryptionRequest; + import net.md_5.bungee.protocol.packet.EncryptionResponse; +-import net.md_5.bungee.protocol.packet.EntityEffect; // Waterfall +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; // Waterfall + import net.md_5.bungee.protocol.packet.EntityStatus; + import net.md_5.bungee.protocol.packet.GameState; + import net.md_5.bungee.protocol.packet.Handshake; +@@ -195,14 +193,4 @@ public abstract class AbstractPacketHandler + public void handle(GameState gameState) throws Exception + { + } +- +- // Waterfall start +- public void handle(EntityEffect entityEffect) throws Exception +- { +- } +- +- public void handle(EntityRemoveEffect removeEffect) throws Exception +- { +- } +- // Waterfall end + } +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 +index 04851233..8e59720f 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -18,8 +18,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; + import net.md_5.bungee.protocol.packet.EncryptionResponse; + import net.md_5.bungee.protocol.packet.EntityStatus; + import net.md_5.bungee.protocol.packet.GameState; +-import net.md_5.bungee.protocol.packet.EntityEffect; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.Handshake; + import net.md_5.bungee.protocol.packet.KeepAlive; + import net.md_5.bungee.protocol.packet.Kick; +@@ -122,20 +120,6 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_16, 0x0C ), + map( ProtocolConstants.MINECRAFT_1_17, 0x0D ) + ); +- // Waterfall start +- TO_CLIENT.registerPacket( +- EntityEffect.class, +- EntityEffect::new, +- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support +- map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) +- ); +- TO_CLIENT.registerPacket( +- EntityRemoveEffect.class, +- EntityRemoveEffect::new, +- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support +- map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) +- ); +- // Waterfall end + TO_CLIENT.registerPacket( + PlayerListItem.class, // PlayerInfo + PlayerListItem::new, +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +deleted file mode 100644 +index 0ed78a8c..00000000 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java ++++ /dev/null +@@ -1,67 +0,0 @@ +-package net.md_5.bungee.protocol.packet; +- +-import io.netty.buffer.ByteBuf; +-import lombok.AllArgsConstructor; +-import lombok.Data; +-import lombok.EqualsAndHashCode; +-import lombok.NoArgsConstructor; +-import net.md_5.bungee.protocol.AbstractPacketHandler; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-@Data +-@NoArgsConstructor +-@AllArgsConstructor +-@EqualsAndHashCode(callSuper = false) +-public class EntityEffect extends DefinedPacket { +- +- private int entityId; +- private int effectId; +- private int amplifier; +- private int duration; +- private boolean hideParticles; +- +- @Override +- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support +- this.effectId = buf.readUnsignedByte(); +- this.amplifier = buf.readUnsignedByte(); +- this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support +- // FlameCord start - 1.7.x support +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) +- { +- this.hideParticles = buf.readBoolean(); +- } +- // FlameCord end - 1.7.x support +- } +- +- @Override +- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.entityId, buf); +- } else +- { +- buf.writeInt(effectId); +- } +- // FlameCord end - 1.7.x support +- buf.writeByte(this.effectId); +- buf.writeByte(this.amplifier); +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.duration, buf); +- } else +- { +- buf.writeShort(duration); +- } +- // FlameCord end - 1.7.x support +- buf.writeBoolean(this.hideParticles); +- } +- +- @Override +- public void handle(AbstractPacketHandler handler) throws Exception { +- handler.handle(this); +- } +-} +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +deleted file mode 100644 +index 435b8578..00000000 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java ++++ /dev/null +@@ -1,45 +0,0 @@ +-package net.md_5.bungee.protocol.packet; +- +-import io.netty.buffer.ByteBuf; +-import lombok.AllArgsConstructor; +-import lombok.Data; +-import lombok.EqualsAndHashCode; +-import lombok.NoArgsConstructor; +-import net.md_5.bungee.protocol.AbstractPacketHandler; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-@Data +-@NoArgsConstructor +-@AllArgsConstructor +-@EqualsAndHashCode(callSuper = false) +-public class EntityRemoveEffect extends DefinedPacket { +- +- private int entityId; +- private int effectId; +- +- @Override +- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support +- this.effectId = buf.readUnsignedByte(); +- } +- +- @Override +- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.entityId, buf); +- } else +- { +- buf.writeInt(entityId); +- } +- // FlameCord end - 1.7.x support +- buf.writeByte(effectId); +- } +- +- @Override +- public void handle(AbstractPacketHandler handler) throws Exception { +- handler.handle(this); +- } +-} +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index ff4bbf34..a008b132 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { + private int tabThrottle = 1000; + private boolean disableModernTabLimiter = true; + +- private boolean disableEntityMetadataRewrite = false; + private boolean disableTabListRewrite = false; + + /* +@@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); + disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter); +- disableEntityMetadataRewrite = config.getBoolean("disable_entity_metadata_rewrite", disableEntityMetadataRewrite); + disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite); + pluginChannelLimit = config.getInt("registered_plugin_channels_limit", pluginChannelLimit); + pluginChannelNameLimit = config.getInt("plugin_channel_name_limit", pluginChannelNameLimit); +@@ -105,11 +103,6 @@ public class WaterfallConfiguration extends Configuration { + return disableModernTabLimiter; + } + +- @Override +- public boolean isDisableEntityMetadataRewrite() { +- return disableEntityMetadataRewrite; +- } +- + @Override + public boolean isDisableTabListRewrite() { + return disableTabListRewrite; +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 3a41769a..d2bf095a 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -243,11 +243,6 @@ public class ServerConnector extends PacketHandler + ch.write( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:register" : "REGISTER", Joiner.on( "\0" ).join( registeredChannels ).getBytes( StandardCharsets.UTF_8 ), false ) ); + } + +- if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null ) +- { +- ch.write( user.getSettings() ); +- } +- + if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla + { + user.getForgeClientHandler().setHandshakeComplete(); +@@ -306,20 +301,6 @@ public class ServerConnector extends PacketHandler + user.getTabListHandler().onServerChange(); + + Scoreboard serverScoreboard = user.getServerSentScoreboard(); +- if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall +- for ( Objective objective : serverScoreboard.getObjectives() ) +- { +- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support +- } +- for ( Score score : serverScoreboard.getScores() ) +- { +- user.unsafe().sendPacket( new ScoreboardScore( score.getItemName(), (byte) 1, score.getScoreName(), score.getValue() ) ); +- } +- for ( Team team : serverScoreboard.getTeams() ) +- { +- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.Team( team.getName() ) ); +- } +- } // Waterfall + serverScoreboard.clear(); + + for ( UUID bossbar : user.getSentBossBars() ) +@@ -338,33 +319,27 @@ public class ServerConnector extends PacketHandler + } + + user.setDimensionChange( true ); +- if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- } + + user.setServerEntityId( login.getEntityId() ); + + // Waterfall start +- if ( user.isDisableEntityMetadataRewrite() ) { +- // Ensure that we maintain consistency +- user.setClientEntityId( login.getEntityId() ); ++ // Ensure that we maintain consistency ++ user.setClientEntityId( login.getEntityId() ); + +- // Only send if we are not in the same dimension +- if ( login.getDimension() != user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- } ++ // Only send if we are not in the same dimension ++ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer ++ { ++ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); ++ } + +- Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), +- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); +- user.unsafe().sendPacket(modLogin); ++ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), ++ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); ++ user.unsafe().sendPacket(modLogin); + +- // Only send if we're in the same dimension +- if ( login.getDimension() == user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- } ++ // Only send if we're in the same dimension ++ if ( login.getDimension() == user.getDimension() ) // Waterfall - defer ++ { ++ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); + } + // Waterfall end + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +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 e8eb555c..723b004a 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -43,7 +43,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; + import net.md_5.bungee.api.score.Scoreboard; + import net.md_5.bungee.chat.ComponentSerializer; + import net.md_5.bungee.connection.InitialHandler; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.forge.ForgeClientHandler; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.forge.ForgeServerHandler; +@@ -135,8 +134,6 @@ public final class UserConnection implements ProxiedPlayer + /*========================================================================*/ + @Getter + private String displayName; +- @Getter +- private EntityMap entityRewrite; + private Locale locale; + /*========================================================================*/ + @Getter +@@ -157,8 +154,6 @@ public final class UserConnection implements ProxiedPlayer + + public void init() + { +- this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); +- + this.displayName = name; + + tabListHandler = new ServerUnique( this ); +@@ -771,10 +766,4 @@ public final class UserConnection implements ProxiedPlayer + { + return serverSentScoreboard; + } +- +- // Waterfall start +- public boolean isDisableEntityMetadataRewrite() { +- return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE; +- } +- // Waterfall end + } +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 +index a0b03ec1..20adce50 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; + import net.md_5.bungee.api.score.Scoreboard; + import net.md_5.bungee.api.score.Team; + import net.md_5.bungee.chat.ComponentSerializer; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.PacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; +@@ -54,8 +53,6 @@ import net.md_5.bungee.protocol.PacketWrapper; + import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.BossBar; + import net.md_5.bungee.protocol.packet.Commands; +-import net.md_5.bungee.protocol.packet.EntityEffect; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.KeepAlive; + import net.md_5.bungee.protocol.packet.Kick; + import net.md_5.bungee.protocol.packet.PlayerListItem; +@@ -147,11 +144,6 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(PacketWrapper packet) throws Exception + { +- EntityMap rewrite = con.getEntityRewrite(); +- if ( rewrite != null ) +- { +- rewrite.rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId(), con.getPendingConnection().getVersion() ); +- } + con.sendPacket( packet ); + } + +@@ -685,34 +677,6 @@ public class DownstreamBridge extends PacketHandler + } + } + +- // Waterfall start +- @Override +- public void handle(EntityEffect entityEffect) throws Exception +- { +- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall +- // Don't send any potions when switching between servers (which involves a handshake), which can trigger a race +- // condition on the client. +- if (this.con.getForgeClientHandler().isForgeUser() && !this.con.getForgeClientHandler().isHandshakeComplete()) { +- throw CancelSendSignal.INSTANCE; +- } +- con.getPotions().put(rewriteEntityId(entityEffect.getEntityId()), entityEffect.getEffectId()); +- } +- +- @Override +- public void handle(EntityRemoveEffect removeEffect) throws Exception +- { +- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall +- con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId()); +- } +- +- private int rewriteEntityId(int entityId) { +- if (entityId == con.getServerEntityId()) { +- return con.getClientEntityId(); +- } +- return entityId; +- } +- // Waterfall end +- + @Override + public void handle(Respawn respawn) + { +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 976c37e1..ec20e714 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 +@@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; + import net.md_5.bungee.api.event.PluginMessageEvent; + import net.md_5.bungee.api.event.SettingsChangedEvent; + import net.md_5.bungee.api.event.TabCompleteEvent; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.PacketHandler; +@@ -128,11 +127,6 @@ public class UpstreamBridge extends PacketHandler + { + if ( con.getServer() != null ) + { +- EntityMap rewrite = con.getEntityRewrite(); +- if ( rewrite != null ) +- { +- rewrite.rewriteServerbound( packet.buf, con.getClientEntityId(), con.getServerEntityId(), con.getPendingConnection().getVersion() ); +- } + con.getServer().getCh().write( packet ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +deleted file mode 100644 +index b9bcecb5..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ /dev/null +@@ -1,368 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import io.netty.buffer.ByteBufInputStream; +-import java.io.DataInputStream; +-import lombok.AccessLevel; +-import lombok.NoArgsConstructor; +- +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +-import se.llbit.nbt.NamedTag; +-import se.llbit.nbt.Tag; +- +-/** +- * Class to rewrite integers within packets. +- */ +-@NoArgsConstructor(access = AccessLevel.PACKAGE) +-public abstract class EntityMap +-{ +- +- private final boolean[] clientboundInts = new boolean[ 256 ]; +- private final boolean[] clientboundVarInts = new boolean[ 256 ]; +- +- private final boolean[] serverboundInts = new boolean[ 256 ]; +- private final boolean[] serverboundVarInts = new boolean[ 256 ]; +- +- // Returns the correct entity map for the protocol version +- public static EntityMap getEntityMap(int version) +- { +- // Waterfall start +- if (net.md_5.bungee.api.ProxyServer.getInstance().getConfig().isDisableEntityMetadataRewrite()) { +- return EntityMap_Dummy.INSTANCE; +- } +- // Waterfall end +- switch ( version ) +- { +- // FlameCord start - 1.7.x support +- case ProtocolConstants.MINECRAFT_1_7_2: +- return EntityMap_1_7_2.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_7_6: +- return EntityMap_1_7_6.INSTANCE; +- // FlameCord end - 1.7.x support +- case ProtocolConstants.MINECRAFT_1_8: +- return EntityMap_1_8.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_9: +- case ProtocolConstants.MINECRAFT_1_9_1: +- case ProtocolConstants.MINECRAFT_1_9_2: +- return EntityMap_1_9.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_9_4: +- return EntityMap_1_9_4.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_10: +- return EntityMap_1_10.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_11: +- case ProtocolConstants.MINECRAFT_1_11_1: +- return EntityMap_1_11.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_12: +- return EntityMap_1_12.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_12_1: +- case ProtocolConstants.MINECRAFT_1_12_2: +- return EntityMap_1_12_1.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_13: +- case ProtocolConstants.MINECRAFT_1_13_1: +- case ProtocolConstants.MINECRAFT_1_13_2: +- return EntityMap_1_13.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_14: +- case ProtocolConstants.MINECRAFT_1_14_1: +- case ProtocolConstants.MINECRAFT_1_14_2: +- case ProtocolConstants.MINECRAFT_1_14_3: +- case ProtocolConstants.MINECRAFT_1_14_4: +- return EntityMap_1_14.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_15: +- case ProtocolConstants.MINECRAFT_1_15_1: +- case ProtocolConstants.MINECRAFT_1_15_2: +- return EntityMap_1_15.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_16: +- case ProtocolConstants.MINECRAFT_1_16_1: +- return EntityMap_1_16.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_16_2: +- case ProtocolConstants.MINECRAFT_1_16_3: +- case ProtocolConstants.MINECRAFT_1_16_4: +- return EntityMap_1_16_2.INSTANCE_1_16_2; +- case ProtocolConstants.MINECRAFT_1_17: +- case ProtocolConstants.MINECRAFT_1_17_1: +- return EntityMap_1_16_2.INSTANCE_1_17; +- case ProtocolConstants.MINECRAFT_1_18: +- case ProtocolConstants.MINECRAFT_1_18_2: +- return EntityMap_1_16_2.INSTANCE_1_18; +- } +- throw new RuntimeException( "Version " + version + " has no entity map" ); +- } +- +- protected void addRewrite(int id, ProtocolConstants.Direction direction, boolean varint) +- { +- if ( direction == ProtocolConstants.Direction.TO_CLIENT ) +- { +- if ( varint ) +- { +- clientboundVarInts[id] = true; +- } else +- { +- clientboundInts[id] = true; +- } +- } else if ( varint ) +- { +- serverboundVarInts[id] = true; +- } else +- { +- serverboundInts[id] = true; +- } +- } +- +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- rewrite( packet, oldId, newId, serverboundInts, serverboundVarInts ); +- } +- +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- rewriteServerbound( packet, oldId, newId ); +- } +- +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- rewrite( packet, oldId, newId, clientboundInts, clientboundVarInts ); +- } +- +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- rewriteClientbound( packet, oldId, newId ); +- } +- +- protected static void rewriteInt(ByteBuf packet, int oldId, int newId, int offset) +- { +- int readId = packet.getInt( offset ); +- if ( readId == oldId ) +- { +- packet.setInt( offset, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( offset, oldId ); +- } +- } +- +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- protected static void rewriteVarInt(ByteBuf packet, int oldId, int newId, int offset) +- { +- // Need to rewrite the packet because VarInts are variable length +- int readId = DefinedPacket.readVarInt( packet ); +- int readIdLength = packet.readerIndex() - offset; +- if ( readId == oldId || readId == newId ) +- { +- ByteBuf data = packet.copy(); +- +- try { +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- } finally { +- data.release(); +- } +- } +- } +- +- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex) +- { +- rewriteMetaVarInt( packet, oldId, newId, metaIndex, -1 ); +- } +- +- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex, int protocolVersion) +- { +- int readerIndex = packet.readerIndex(); +- +- short index; +- while ( ( index = packet.readUnsignedByte() ) != 0xFF ) +- { +- int type = DefinedPacket.readVarInt( packet ); +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) +- { +- switch ( type ) +- { +- case 5: // optional chat +- if ( packet.readBoolean() ) +- { +- DefinedPacket.readString( packet ); +- } +- continue; +- case 15: // particle +- int particleId = DefinedPacket.readVarInt( packet ); +- +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 ) +- { +- switch ( particleId ) +- { +- case 3: // minecraft:block +- case 23: // minecraft:falling_dust +- DefinedPacket.readVarInt( packet ); // block state +- break; +- case 14: // minecraft:dust +- packet.skipBytes( 16 ); // float, float, float, flat +- break; +- case 32: // minecraft:item +- readSkipSlot( packet, protocolVersion ); +- break; +- } +- } else +- { +- switch ( particleId ) +- { +- case 3: // minecraft:block +- case 20: // minecraft:falling_dust +- DefinedPacket.readVarInt( packet ); // block state +- break; +- case 11: // minecraft:dust +- packet.skipBytes( 16 ); // float, float, float, flat +- break; +- case 27: // minecraft:item +- readSkipSlot( packet, protocolVersion ); +- break; +- } +- } +- continue; +- default: +- if ( type >= 6 ) +- { +- type--; +- } +- break; +- } +- } +- +- switch ( type ) +- { +- case 0: +- packet.skipBytes( 1 ); // byte +- break; +- case 1: +- if ( index == metaIndex ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, position ); +- packet.readerIndex( position ); +- } +- DefinedPacket.readVarInt( packet ); +- break; +- case 2: +- packet.skipBytes( 4 ); // float +- break; +- case 3: +- case 4: +- DefinedPacket.readString( packet ); +- break; +- case 5: +- readSkipSlot( packet, protocolVersion ); +- break; +- case 6: +- packet.skipBytes( 1 ); // boolean +- break; +- case 7: +- packet.skipBytes( 12 ); // float, float, float +- break; +- case 8: +- packet.readLong(); +- break; +- case 9: +- if ( packet.readBoolean() ) +- { +- packet.skipBytes( 8 ); // long +- } +- break; +- case 10: +- DefinedPacket.readVarInt( packet ); +- break; +- case 11: +- if ( packet.readBoolean() ) +- { +- packet.skipBytes( 16 ); // long, long +- } +- break; +- case 12: +- DefinedPacket.readVarInt( packet ); +- break; +- case 13: +- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); +- if ( tag.isError() ) +- { +- throw new RuntimeException( tag.error() ); +- } +- break; +- case 15: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- break; +- case 16: +- if ( index == metaIndex ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId + 1, newId + 1, position ); +- packet.readerIndex( position ); +- } +- DefinedPacket.readVarInt( packet ); +- break; +- case 17: +- DefinedPacket.readVarInt( packet ); +- break; +- default: +- // Waterfall start - Don't lie +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) +- { +- type++; +- } +- throw new IllegalArgumentException( "Unknown meta type " + type + ": Using mods? refer to disable_entity_metadata_rewrite in waterfall.yml" ); +- // Waterfall end +- } +- } +- +- packet.readerIndex( readerIndex ); +- } +- +- private static void readSkipSlot(ByteBuf packet, int protocolVersion) +- { +- if ( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) ? packet.readBoolean() : packet.readShort() != -1 ) +- { +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) +- { +- DefinedPacket.readVarInt( packet ); +- } +- packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short +- +- int position = packet.readerIndex(); +- if ( packet.readByte() != 0 ) +- { +- packet.readerIndex( position ); +- +- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); +- if ( tag.isError() ) +- { +- throw new RuntimeException( tag.error() ); +- } +- } +- } +- } +- +- // Handles simple packets +- private static void rewrite(ByteBuf packet, int oldId, int newId, boolean[] ints, boolean[] varints) +- { +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if (packetId < 0 || packetId > ints.length || packetId > varints.length) { // Invalid packet id +- // Ignore these invalid packets for compatibility reasons +- packet.readerIndex( readerIndex ); +- return; +- } +- +- if ( ints[packetId] ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength ); +- } else if ( varints[packetId] ) +- { +- rewriteVarInt( packet, oldId, newId, readerIndex + packetIdLength ); +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +deleted file mode 100644 +index 6db530c3..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_10 extends EntityMap +-{ +- +- static final EntityMap_1_10 INSTANCE = new EntityMap_1_10(); +- +- EntityMap_1_10() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +deleted file mode 100644 +index 36822127..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_11 extends EntityMap +-{ +- +- static final EntityMap_1_11 INSTANCE = new EntityMap_1_11(); +- +- EntityMap_1_11() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +deleted file mode 100644 +index 38e12ce4..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_12 extends EntityMap +-{ +- +- static final EntityMap_1_12 INSTANCE = new EntityMap_1_12(); +- +- EntityMap_1_12() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x32, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x35, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3C /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4A /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x42 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x31 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3B /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +deleted file mode 100644 +index 5f296839..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_12_1 extends EntityMap +-{ +- +- static final EntityMap_1_12_1 INSTANCE = new EntityMap_1_12_1(); +- +- EntityMap_1_12_1() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x30, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3D /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4B /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x43 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x32 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2D /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3C /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +deleted file mode 100644 +index f3372f08..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_13 extends EntityMap +-{ +- +- static final EntityMap_1_13 INSTANCE = new EntityMap_1_13(); +- +- EntityMap_1_13() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x41, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x50, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x52, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x53, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x19, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x40 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4F /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x46 /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x35 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2F /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3F /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13, protocolVersion ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x28 /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +deleted file mode 100644 +index 8210b0a7..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_14 extends EntityMap +-{ +- +- static final EntityMap_1_14 INSTANCE = new EntityMap_1_14(); +- +- EntityMap_1_14() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x44 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x55 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4A /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 101 || type == 71 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 71 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x43 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 15, protocolVersion ); // guardian beam +- break; +- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +deleted file mode 100644 +index c2cf810f..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_15 extends EntityMap +-{ +- +- static final EntityMap_1_15 INSTANCE = new EntityMap_1_15(); +- +- EntityMap_1_15() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x09, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x57, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x5A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x56 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4B /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x38 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 72 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x33 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam +- break; +- case 0x51 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +deleted file mode 100644 +index c8b06707..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_16 extends EntityMap +-{ +- +- static final EntityMap_1_16 INSTANCE = new EntityMap_1_16(); +- +- EntityMap_1_16() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x02, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x55 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4B /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 72 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x04 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam +- break; +- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2C /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +deleted file mode 100644 +index 2f0e303d..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java ++++ /dev/null +@@ -1,74 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import lombok.AccessLevel; +-import lombok.RequiredArgsConstructor; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +- +-@RequiredArgsConstructor(access = AccessLevel.PRIVATE) +-class EntityMap_1_16_2 extends EntityMap +-{ +- +- static final EntityMap_1_16_2 INSTANCE_1_16_2 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); +- // +- private final int spawnPlayerId; +- private final int spectateId; +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == spawnPlayerId ) +- { +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == spectateId && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +deleted file mode 100644 +index cdc07dc4..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java ++++ /dev/null +@@ -1,102 +0,0 @@ +-// FlameCord start - 1.7.x support +-package net.md_5.bungee.entitymap; +- +-import io.netty.buffer.ByteBuf; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_7_2 extends EntityMap +-{ +- +- static final EntityMap INSTANCE = new EntityMap_1_7_2(); +- +- EntityMap_1_7_2() +- { +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation +- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object +- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob +- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting +- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb +- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move +- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look +- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move +- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport +- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look +- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata +- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect +- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect +- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity +- +- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- } else if ( packetId == 0x13 /* Destroy Entities */ ) +- { +- int count = packet.getByte( packetIdLength ); +- for ( int i = 0; i < count; i++ ) +- { +- rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); +- } +- } else if ( packetId == 0x0E /* Spawn Object */ ) +- { +- DefinedPacket.readVarInt( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 ) +- { +- packet.skipBytes( 14 ); +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- int changedId = -1; +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- changedId = newId; +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- changedId = oldId; +- } +- if ( changedId != -1 ) +- { +- if ( changedId == 0 && readId != 0 ) +- { // Trim off the extra data +- packet.readerIndex( readerIndex ); +- packet.writerIndex( packet.readableBytes() - 6 ); +- } else if ( changedId != 0 && readId == 0 ) +- { // Add on the extra data +- packet.readerIndex( readerIndex ); +- packet.capacity( packet.readableBytes() + 6 ); +- packet.writerIndex( packet.readableBytes() + 6 ); +- } +- } +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +-// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +deleted file mode 100644 +index 5ce42f62..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java ++++ /dev/null +@@ -1,62 +0,0 @@ +-// FlameCord start - 1.7.x support +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.connection.LoginResult; +-import net.md_5.bungee.protocol.DefinedPacket; +- +-class EntityMap_1_7_6 extends EntityMap_1_7_2 +-{ +- +- static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0C /* Spawn Player */ ) +- { +- DefinedPacket.readVarInt( packet ); +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- String uuid = DefinedPacket.readString( packet ); +- String username = DefinedPacket.readString( packet ); +- int props = DefinedPacket.readVarInt( packet ); +- if ( props == 0 ) +- { +- UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); +- if ( player != null ) +- { +- LoginResult profile = player.getPendingConnection().getLoginProfile(); +- if ( profile != null && profile.getProperties() != null +- && profile.getProperties().length >= 1 ) +- { +- ByteBuf rest = packet.copy(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeString( player.getUniqueId().toString(), packet ); +- DefinedPacket.writeString( username, packet ); +- DefinedPacket.writeVarInt( profile.getProperties().length, packet ); +- for ( LoginResult.Property property : profile.getProperties() ) +- { +- DefinedPacket.writeString( property.getName(), packet ); +- DefinedPacket.writeString( property.getValue(), packet ); +- DefinedPacket.writeString( property.getSignature(), packet ); +- } +- packet.writeBytes( rest ); +- rest.release(); +- } +- } +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +-// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +deleted file mode 100644 +index 8e2dbe69..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java ++++ /dev/null +@@ -1,176 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_8 extends EntityMap +-{ +- +- static final EntityMap_1_8 INSTANCE = new EntityMap_1_8(); +- +- EntityMap_1_8() +- { +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation +- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object +- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob +- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting +- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb +- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move +- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look +- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move +- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport +- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look +- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata +- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect +- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect +- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Update Entity NBT +- +- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0D /* Collect Item */ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( packetId == 0x1B /* Attach Entity */ ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- } else if ( packetId == 0x13 /* Destroy Entities */ ) +- { +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( readerIndex + packetIdLength ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- } else if ( packetId == 0x0E /* Spawn Object */ ) +- { +- +- DefinedPacket.readVarInt( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 ) +- { +- packet.skipBytes( 14 ); +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- int changedId = readId; +- +- if ( readId == oldId ) +- { +- packet.setInt( position, changedId = newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, changedId = oldId ); +- } +- +- if ( readId > 0 && changedId <= 0 ) +- { +- packet.writerIndex( packet.writerIndex() - 6 ); +- } else if ( changedId > 0 && readId <= 0 ) +- { +- packet.ensureWritable( 6 ); +- packet.writerIndex( packet.writerIndex() + 6 ); +- } +- } +- } else if ( packetId == 0x0C /* Spawn Player */ ) +- { +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- } else if ( packetId == 0x42 /* Combat Event */ ) +- { +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x18 /* Spectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +deleted file mode 100644 +index d61dc0cb..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_9 extends EntityMap +-{ +- +- static final EntityMap_1_9 INSTANCE = new EntityMap_1_9(); +- +- EntityMap_1_9() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x49 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +deleted file mode 100644 +index bfbc8432..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_9_4 extends EntityMap +-{ +- +- static final EntityMap_1_9_4 INSTANCE = new EntityMap_1_9_4(); +- +- EntityMap_1_9_4() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +deleted file mode 100644 +index cb81d1dd..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java ++++ /dev/null +@@ -1,30 +0,0 @@ +- +-package net.md_5.bungee.entitymap; +- +-import io.netty.buffer.ByteBuf; +-// Waterfall start +- +-public class EntityMap_Dummy extends EntityMap { +- +- public static final EntityMap_Dummy INSTANCE = new EntityMap_Dummy(); +- +- EntityMap_Dummy() { +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) { +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) { +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { +- } +-} +-// Waterfall end +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +index caed4384..af428090 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +@@ -11,7 +11,6 @@ import lombok.Setter; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.UserConnection; + import net.md_5.bungee.protocol.ProtocolConstants; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.PluginMessage; + + /** +@@ -113,10 +112,6 @@ public class ForgeClientHandler + } + + private void resetAllThePotions(UserConnection con) { +- // Just to be sure +- for (Map.Entry entry: con.getPotions().entries()) { +- con.unsafe().sendPacket(new EntityRemoveEffect(entry.getKey(), entry.getValue())); +- } + con.getPotions().clear(); + } + +-- +2.32.0 + From 311e70c6e592a10e100b5fa6edc7fc02bdceb890 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:11:12 -0300 Subject: [PATCH 240/499] Dont Blacklist Localhost --- .../0029-Antibot-System.patch | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 8b2ceec4..77e83cfd 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From aa6407df7daef6d3fa424d942c50b0dec1115eef Mon Sep 17 00:00:00 2001 +From 296528e63d4a653bfc88eaf498d59002c3e27cce Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -61,10 +61,10 @@ index 00000000..765bf829 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..3a6565c7 +index 00000000..e09a7093 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,143 @@ +@@ -0,0 +1,145 @@ +package dev._2lstudios.antibot; + +import java.io.IOException; @@ -183,17 +183,19 @@ index 00000000..3a6565c7 + } + + public void firewall() { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { -+ Runtime runtime = Runtime.getRuntime(); -+ -+ try { -+ runtime.exec("ipset add flamecord_blacklist " + getHostString()); -+ } catch (IOException exception) { -+ // Ignored ++ if (!hostString.equals("127.0.0.1")) { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { ++ Runtime runtime = Runtime.getRuntime(); ++ ++ try { ++ runtime.exec("ipset add flamecord_blacklist " + hostString); ++ } catch (IOException exception) { ++ // Ignored ++ } + } -+ } + -+ this.lastFirewall = System.currentTimeMillis(); ++ this.lastFirewall = System.currentTimeMillis(); ++ } + } + + public void setTotalConnections(final int totalConnections) { From ccb40a1604e91a21eae7b9df595a3401a2ae3aa8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:19:30 -0300 Subject: [PATCH 241/499] Firewall time in seconds --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 77e83cfd..8ec0f248 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 296528e63d4a653bfc88eaf498d59002c3e27cce Mon Sep 17 00:00:00 2001 +From 397d14b6036461dbee94f15ff2bb0452e6852a41 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -61,7 +61,7 @@ index 00000000..765bf829 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..e09a7093 +index 00000000..21755811 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java @@ -0,0 +1,145 @@ @@ -175,7 +175,7 @@ index 00000000..e09a7093 + + public boolean isFirewalled() { + return System.currentTimeMillis() - lastFirewall < FlameCord.getInstance().getFlameCordConfiguration() -+ .getAntibotFirewallExpire(); ++ .getAntibotFirewallExpire() * 1000; + } + + public String getHostString() { @@ -752,7 +752,7 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..dc9ba8f0 100644 +index d972fcea..0c6590ef 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -5,7 +5,6 @@ import java.io.IOException; @@ -797,7 +797,7 @@ index d972fcea..dc9ba8f0 100644 + @Getter + private boolean antibotFirewallIpset = true; + @Getter -+ private int antibotFirewallExpire = 30000; ++ private int antibotFirewallExpire = 30; + @Getter + private boolean antibotFirewallLog = true; + @Getter From 97ee1b9267b31c25528c261534d36efba9393eaa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:41:47 -0300 Subject: [PATCH 242/499] Clean IPSet on Reload --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 8ec0f248..5f1fbc03 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 397d14b6036461dbee94f15ff2bb0452e6852a41 Mon Sep 17 00:00:00 2001 +From f846e8d2a7d59f4cbdb5924068a035cfd3b23392 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -474,10 +474,10 @@ index 00000000..76902c27 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java new file mode 100644 -index 00000000..665e2088 +index 00000000..d3b77f03 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,42 @@ +package dev._2lstudios.antibot; + +import java.io.IOException; @@ -499,8 +499,10 @@ index 00000000..665e2088 + Runtime runtime = Runtime.getRuntime(); + + try { -+ runtime.exec("ipset create flamecord_blacklist hash:ip timeout " + flameCordConfiguration.getAntibotFirewallExpire()); + runtime.exec("iptables -D INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); ++ runtime.exec("ipset flush flamecord_blacklist"); ++ runtime.exec("ipset destroy flamecord_blacklist"); ++ runtime.exec("ipset create flamecord_blacklist hash:ip timeout " + flameCordConfiguration.getAntibotFirewallExpire()); + runtime.exec("iptables -I INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); + } catch (IOException exception) { + // Ignored @@ -752,7 +754,7 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..0c6590ef 100644 +index d972fcea..4a145a11 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -5,7 +5,6 @@ import java.io.IOException; @@ -797,7 +799,7 @@ index d972fcea..0c6590ef 100644 + @Getter + private boolean antibotFirewallIpset = true; + @Getter -+ private int antibotFirewallExpire = 30; ++ private int antibotFirewallExpire = 60; + @Getter + private boolean antibotFirewallLog = true; + @Getter From 2fc14c4e1b86b35f6631443365e266cbe9e163a5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 21:42:17 -0300 Subject: [PATCH 243/499] 0.8.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 0539f16a..4aa4bc65 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.2"; ++ return "0.8.3"; } public void reloadMessages() From 9c8eb35e49256d8e4f581b828b143dd3f92827b1 Mon Sep 17 00:00:00 2001 From: samupro-dev <72470573+samupro-dev@users.noreply.github.com> Date: Mon, 14 Mar 2022 16:29:08 +0100 Subject: [PATCH 244/499] Update flamecord-build.yml --- .github/workflows/flamecord-build.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml index cdfa81bd..6a7abd36 100644 --- a/.github/workflows/flamecord-build.yml +++ b/.github/workflows/flamecord-build.yml @@ -18,33 +18,36 @@ jobs: java: [8, 11, 17] steps: + # Checkout repository - name: Checkout Repository - uses: actions/checkout@v2 - + uses: actions/checkout@v3 + + # Setup a version of the Java JDK - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} distribution: 'adopt' architecture: x64 - + # The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven Packages - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - + + # Start building FlameCord - name: Build FlameCord run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar - + # An artifact is generated in a compressed file according to each JDK build version. - name: Upload FlameCord - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: FlameCord-JDK${{ matrix.java }} path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From cabe4d01e6a28d220b1e183ad4cc44b02f164e12 Mon Sep 17 00:00:00 2001 From: samupro-dev <72470573+samupro-dev@users.noreply.github.com> Date: Mon, 14 Mar 2022 16:29:34 +0100 Subject: [PATCH 245/499] Update flamecord-pull-request.yml --- .github/workflows/flamecord-pull-request.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml index c8514853..18408cb9 100644 --- a/.github/workflows/flamecord-pull-request.yml +++ b/.github/workflows/flamecord-pull-request.yml @@ -17,33 +17,36 @@ jobs: java: [8, 11, 17] steps: + # Checkout repository - name: Checkout Repository - uses: actions/checkout@v2 - + uses: actions/checkout@v3 + + # Setup a version of the Java JDK - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} distribution: 'adopt' architecture: x64 - + # The corresponding dependencies are stored in the cache to speed up the test. - name: Cache Maven Packages - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - + + # Start building FlameCord - name: Build FlameCord run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" scripts/build.sh --jar - + # An artifact is generated in a compressed file according to each JDK build version. - name: Upload FlameCord - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: FlameCord-JDK${{ matrix.java }} path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From c96790fc15b8db61743937547a87b6c9ec165ceb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:00:34 -0300 Subject: [PATCH 246/499] Make accounts check less strict --- .../0029-Antibot-System.patch | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5f1fbc03..547d4073 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From f846e8d2a7d59f4cbdb5924068a035cfd3b23392 Mon Sep 17 00:00:00 2001 +From dde05524ed1972ad06fb3aa975d5992f6b00ea57 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,13 +22,12 @@ index f4bf5ec6..4a0d8e5d 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..765bf829 +index 00000000..65aefa21 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,32 @@ +package dev._2lstudios.antibot; + -+import java.net.InetSocketAddress; +import java.net.SocketAddress; + +import dev._2lstudios.flamecord.FlameCord; @@ -41,13 +40,13 @@ index 00000000..765bf829 + this.addressDataManager = addressDataManager; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress socketAddress, final String nickname) { + final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); + + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + -+ if (addressData.getNicknames().size() >= config.getAntibotAccountsLimit()) { ++ if (!addressData.hasNickname(nickname) && addressData.getNicknames().size() + 1 >= config.getAntibotAccountsLimit()) { + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -61,10 +60,10 @@ index 00000000..765bf829 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..21755811 +index 00000000..cd8220d1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,145 @@ +@@ -0,0 +1,149 @@ +package dev._2lstudios.antibot; + +import java.io.IOException; @@ -209,6 +208,10 @@ index 00000000..21755811 + public String getCountry() { + return country; + } ++ ++ public boolean hasNickname(final String nickname) { ++ return nicknames.contains(nickname); ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 @@ -912,7 +915,7 @@ index 57462992..ee0295c7 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..a9a17154 100644 +index 4ced9bd6..da7ad71a 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -981,35 +984,36 @@ index 4ced9bd6..a9a17154 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +468,57 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -430,6 +468,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } + // FlameCord start - Antibot System + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ String nickname = loginRequest.getData(); + -+ addressData.addNickname( loginRequest.getData() ); -+ -+ if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) ++ if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress(), nickname ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has a blacklisted nickname", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[{0}] has too many accounts", ch.getRemoteAddress() ); + } + -+ disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); ++ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); + return; + } + -+ if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress() ) ) ++ addressData.addNickname( nickname ); ++ ++ if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has too many accounts", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[{0}] has a blacklisted nickname", ch.getRemoteAddress() ); + } + -+ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); ++ disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); + return; + } + From 9d8529e7006cd33c1d8bc7f3cd48c7217b16faad Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:01:10 -0300 Subject: [PATCH 247/499] 0.8.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 4aa4bc65..b1226fa1 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.3"; ++ return "0.8.4"; } public void reloadMessages() From 4ceec440d0b4135ad29cfb6d6a8956fb9242bbcf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:32:57 -0300 Subject: [PATCH 248/499] Fix accounts check count --- .../0003-FlameCord-rebrand.patch | 12 +++--- .../0029-Antibot-System.patch | 42 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b1226fa1..1bc359ce 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 90ef2ebb8fe1980cb7c1aa063e78729b52e31210 Mon Sep 17 00:00:00 2001 +From 40ee61cc9b114b89dfabfc3f0f070edf18c2bd03 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index e31fb00a..ff4bbf34 100644 +index e31fb00ae..ff4bbf34d 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,7 +19,7 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c..6bfef060 100644 +index a4b58d9c6..40ceeb18d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @@ -27,12 +27,12 @@ index a4b58d9c..6bfef060 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.4"; ++ return "0.8.3"; } public void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03..aeda7963 100644 +index 820f7b03c..aeda79639 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03..aeda7963 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b2b19996 100644 +index 0c1ecfb8e..b2b199969 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 547d4073..5124eb85 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,11 +1,11 @@ -From dde05524ed1972ad06fb3aa975d5992f6b00ea57 Mon Sep 17 00:00:00 2001 +From ef2217060030ca38439852c119e8b43c8af79746 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index f4bf5ec6..4a0d8e5d 100644 +index f4bf5ec6e..4a0d8e5da 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,11 @@ @@ -22,7 +22,7 @@ index f4bf5ec6..4a0d8e5d 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..65aefa21 +index 000000000..83b0fe73a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,32 @@ @@ -46,7 +46,7 @@ index 00000000..65aefa21 + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + -+ if (!addressData.hasNickname(nickname) && addressData.getNicknames().size() + 1 >= config.getAntibotAccountsLimit()) { ++ if (!addressData.hasNickname(nickname) && addressData.getNicknames().size() + 1 > config.getAntibotAccountsLimit()) { + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -60,7 +60,7 @@ index 00000000..65aefa21 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..cd8220d1 +index 000000000..cd8220d18 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java @@ -0,0 +1,149 @@ @@ -215,7 +215,7 @@ index 00000000..cd8220d1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 00000000..3f6e4186 +index 000000000..3f6e4186b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java @@ -0,0 +1,25 @@ @@ -246,7 +246,7 @@ index 00000000..3f6e4186 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..137ed980 +index 000000000..137ed9808 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java @@ -0,0 +1,41 @@ @@ -293,7 +293,7 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..5cb5021a +index 000000000..5cb5021ab --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -439,7 +439,7 @@ index 00000000..5cb5021a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..76902c27 +index 000000000..76902c279 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -477,7 +477,7 @@ index 00000000..76902c27 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java new file mode 100644 -index 00000000..d3b77f03 +index 000000000..d3b77f03f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java @@ -0,0 +1,42 @@ @@ -525,7 +525,7 @@ index 00000000..d3b77f03 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..f9b1ad70 +index 000000000..f9b1ad70b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,43 @@ @@ -574,7 +574,7 @@ index 00000000..f9b1ad70 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..8ffe1e21 +index 000000000..8ffe1e216 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -642,7 +642,7 @@ index 00000000..8ffe1e21 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..f9ab936b +index 000000000..f9ab936b1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -681,7 +681,7 @@ index 00000000..f9ab936b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..f958a6f2 +index 000000000..f958a6f23 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java @@ -0,0 +1,33 @@ @@ -719,7 +719,7 @@ index 00000000..f958a6f2 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7..4079caa5 100644 +index c78ab3a7c..4079caa5d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -757,7 +757,7 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea..4a145a11 100644 +index d972fcea2..4a145a110 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -5,7 +5,6 @@ import java.io.IOException; @@ -893,7 +893,7 @@ index d972fcea..4a145a11 100644 this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 57462992..ee0295c7 100644 +index 574629920..ee0295c73 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -81,6 +81,17 @@ public class MessagesConfiguration extends FlameConfig { @@ -915,7 +915,7 @@ index 57462992..ee0295c7 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6..da7ad71a 100644 +index 4ced9bd6a..da7ad71a2 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -1044,7 +1044,7 @@ index 4ced9bd6..da7ad71a 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 e354032a..976c37e1 100644 +index e354032aa..976c37e10 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,10 +4,15 @@ import com.google.common.base.Preconditions; @@ -1097,7 +1097,7 @@ index e354032a..976c37e1 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index cef44d8a..8fe2b37f 100644 +index cef44d8a6..8fe2b37f6 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -1115,7 +1115,7 @@ index cef44d8a..8fe2b37f 100644 logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; 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 f4bf745c..eaedb459 100644 +index f4bf745c8..eaedb4593 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 @@ -63,6 +63,14 @@ public class PipelineUtils From 1ed9e61ca703a9037ce9bec6a5e34feca82d4b0d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Mar 2022 14:43:12 -0300 Subject: [PATCH 249/499] Make accounts check count more precise --- .../0003-FlameCord-rebrand.patch | 2 +- .../0029-Antibot-System.patch | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 1bc359ce..b3b66388 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c6..40ceeb18d 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.3"; ++ return "0.8.4"; } public void reloadMessages() diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5124eb85..20a8012d 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From ef2217060030ca38439852c119e8b43c8af79746 Mon Sep 17 00:00:00 2001 +From 42bcedf00c5abd628c032f20e43970ff8ff13f71 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,13 +22,14 @@ index f4bf5ec6e..4a0d8e5da 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 000000000..83b0fe73a +index 000000000..dfee9bf83 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,36 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; ++import java.util.Collection; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -45,8 +46,11 @@ index 000000000..83b0fe73a + + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final Collection nicknames = addressData.getNicknames(); ++ ++ if (nicknames.size() > config.getAntibotAccountsLimit()) { ++ nicknames.remove(nickname); + -+ if (!addressData.hasNickname(nickname) && addressData.getNicknames().size() + 1 > config.getAntibotAccountsLimit()) { + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -915,7 +919,7 @@ index 574629920..ee0295c73 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6a..da7ad71a2 100644 +index 4ced9bd6a..55b424d2c 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -993,6 +997,8 @@ index 4ced9bd6a..da7ad71a2 100644 + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); + String nickname = loginRequest.getData(); + ++ addressData.addNickname( nickname ); ++ + if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress(), nickname ) ) + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) @@ -1004,8 +1010,6 @@ index 4ced9bd6a..da7ad71a2 100644 + return; + } + -+ addressData.addNickname( nickname ); -+ + if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) From 99eed3757e5384695d65cd8d5eb15eede336df89 Mon Sep 17 00:00:00 2001 From: HakanGulgen Date: Fri, 18 Mar 2022 15:21:06 +0300 Subject: [PATCH 250/499] More features for custom motd. --- .../0033-More-features-for-custom-motd.patch | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch diff --git a/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch b/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch new file mode 100644 index 00000000..124a0a34 --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch @@ -0,0 +1,205 @@ +From 28d1948625c40a66e5a22557dd1fd1e56af893ad Mon Sep 17 00:00:00 2001 +From: HakanGulgen +Date: Fri, 18 Mar 2022 15:18:09 +0300 +Subject: [PATCH] More features for custom motd. + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +index cfbd55c3..360305b9 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +@@ -11,6 +11,10 @@ public class FlameConfig { + return (int) setIfUnexistant(arg1, (Object) arg2, configuration); + } + ++ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ + boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { + return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); + } +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index be49f581..929b37ea 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -2,11 +2,7 @@ package dev._2lstudios.flamecord.configuration; + + import java.io.File; + import java.io.IOException; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.List; +-import java.util.Random; ++import java.util.*; + + import lombok.Getter; + import net.md_5.bungee.api.ChatColor; +@@ -138,16 +134,59 @@ public class FlameCordConfiguration extends FlameConfig { + return strings; + } + +- @Getter +- private boolean customMotdEnabled = false; +- private List customMotdMotds = Arrays.asList(new String[] { "&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!" }); ++ public String getMOTD(final int maxPlayers, final int onlinePlayers) { ++ final String motd = motds.get(new Random().nextInt(motds.size())); ++ ++ return motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ } + +- public String getRandomMotd() { +- final Random random = new Random(); ++ public String[] getSample(final int maxPlayers, final int onlinePlayers) { ++ final String sample = samples.get(new Random().nextInt(samples.size())); + +- return customMotdMotds.get(random.nextInt(customMotdMotds.size())); ++ return sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)).split("\n"); ++ } ++ ++ public int getFakePlayersAmount(final int players) { ++ switch (fakePlayersMode) { ++ case "STATIC": ++ return fakePlayersAmount; ++ case "RANDOM": ++ return (int) (Math.floor(Math.random() * fakePlayersAmount) + 1); ++ case "DIVISION": ++ return players / fakePlayersAmount; ++ default: ++ return 0; ++ } + } + ++ @Getter ++ private boolean motdEnabled = false; ++ @Getter ++ private List motds = Collections.singletonList("&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!"); ++ ++ @Getter ++ private boolean sampleEnabled = false; ++ @Getter ++ private List samples = Collections.singletonList("&eDefault &cFlameCord&e sample!\n&eChange me in &cflamecord.yml&e file!"); ++ ++ @Getter ++ private boolean protocolEnabled = false; ++ @Getter ++ private String protocolName = "FlameCord 1.7-1.18"; ++ ++ @Getter ++ private boolean maxPlayersEnabled = false; ++ @Getter ++ private int maxPlayersAmount = 1000; ++ @Getter ++ private boolean maxPlayersOneMore = false; ++ ++ @Getter ++ private boolean fakePlayersEnabled = false; ++ @Getter ++ private int fakePlayersAmount = 3; ++ private String fakePlayersMode = "DIVISION"; ++ + @Getter + private boolean loggerInitialhandler = false; + @Getter +@@ -176,8 +215,18 @@ public class FlameCordConfiguration extends FlameConfig { + + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); + +- this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); +- this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); ++ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); ++ this.motds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); ++ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); ++ this.samples = colors(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); ++ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); ++ this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); ++ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); ++ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); ++ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); ++ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); ++ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); ++ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); +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 b6cd7e4b..c82098a1 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 +@@ -23,6 +23,8 @@ import dev._2lstudios.antibot.AddressData; + import dev._2lstudios.antibot.CheckManager; + import dev._2lstudios.flamecord.FlameCord; + ++import dev._2lstudios.flamecord.configuration.FlameConfig; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -253,9 +255,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.PROCESSING; + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); +- // FlameCord - Custom motd +- final String listenerMotd = FlameCord.getInstance().getFlameCordConfiguration().isCustomMotdEnabled() ? FlameCord.getInstance().getFlameCordConfiguration().getRandomMotd() : listener.getMotd(); +- final String motd = ( forced != null ) ? forced.getMotd() : listenerMotd; + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); + + Callback pingBack = new Callback() +@@ -318,7 +317,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection + ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); + } else + { +- pingBack.done( getPingInfo( motd, protocol ), null ); ++ // FlameCord - Custom MOTD ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ String motd; ++ String protocolName; ++ ++ ServerPing.PlayerInfo[] sample = null; ++ ++ int maxPlayers = listener.getMaxPlayers(); ++ int onlinePlayers = bungee.getOnlineCount(); ++ ++ if (config.isFakePlayersEnabled()) { ++ onlinePlayers += config.getFakePlayersAmount(onlinePlayers); ++ } ++ ++ if (config.isMaxPlayersEnabled()) { ++ maxPlayers = config.isMaxPlayersOneMore() ? maxPlayers + 1 : config.getMaxPlayersAmount(); ++ } ++ ++ if (config.isMotdEnabled()) { ++ motd = config.getMOTD(maxPlayers, onlinePlayers); ++ } else { ++ motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); ++ } ++ ++ if (config.isProtocolEnabled()) { ++ protocolName = config.getProtocolName(); ++ } else { ++ protocolName = bungee.getName() + " " + bungee.getGameVersion(); ++ } ++ ++ if (config.isSampleEnabled()) { ++ final UUID fakeUuid = new UUID(0, 0); ++ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers); ++ ++ sample = new ServerPing.PlayerInfo[sampleString.length]; ++ ++ for (int i = 0; i < sampleString.length; i++) { ++ sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); ++ } ++ } ++ ++ pingBack.done( new ServerPing( ++ new ServerPing.Protocol( protocolName, protocol ), ++ new ServerPing.Players( maxPlayers, onlinePlayers, sample ), ++ motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); + } + + thisState = State.PING; +-- +2.35.1.windows.2 + From a3398caa9d3257b4797b2f5d2b6322c7a5b53be6 Mon Sep 17 00:00:00 2001 From: HakanGulgen Date: Fri, 18 Mar 2022 19:09:11 +0300 Subject: [PATCH 251/499] Custom motd bug fix --- .../0033-More-features-for-custom-motd.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch b/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch index 124a0a34..113f54d0 100644 --- a/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch +++ b/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch @@ -1,4 +1,4 @@ -From 28d1948625c40a66e5a22557dd1fd1e56af893ad Mon Sep 17 00:00:00 2001 +From 9aa3361d1876942d2c63f36ab92e4167314dc37c Mon Sep 17 00:00:00 2001 From: HakanGulgen Date: Fri, 18 Mar 2022 15:18:09 +0300 Subject: [PATCH] More features for custom motd. @@ -124,7 +124,7 @@ index be49f581..929b37ea 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); 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 b6cd7e4b..c82098a1 100644 +index b6cd7e4b..7fa3217e 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 @@ -23,6 +23,8 @@ import dev._2lstudios.antibot.AddressData; @@ -167,7 +167,7 @@ index b6cd7e4b..c82098a1 100644 + } + + if (config.isMaxPlayersEnabled()) { -+ maxPlayers = config.isMaxPlayersOneMore() ? maxPlayers + 1 : config.getMaxPlayersAmount(); ++ maxPlayers = config.isMaxPlayersOneMore() ? onlinePlayers + 1 : config.getMaxPlayersAmount(); + } + + if (config.isMotdEnabled()) { From f0a9a2ea709e9032178f8dfd0c137f776b0c2528 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 19 Mar 2022 20:20:14 -0300 Subject: [PATCH 252/499] Update README.md --- README.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c58a4d7f..cd1b9dc2 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,22 @@ FlameCord ======= -FlameCord is a patch for Waterfall to fix possible exploits and add useful functionalities. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. +FlameCord is a Waterfall modification to fix exploits, improve performance and protect against bot attacks. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. - + ## Features -Waterfall focuses on three main areas: - -* **Stability**: Waterfall aims to be stable. We will achieve this through making the code base testable and discouraging practices that lead to proxy lag. -* **Features**: Waterfall aims to include more features than canonical BungeeCord. -* **Scalability**: Waterfall should be able to handle a large number of concurrent players, given a reasonably modern CPU, memory, and good network connection. - FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: * **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. +* **Bot Protection**: FlameCord brings swift bot protection for your Minecraft server to avoid extra CPU usage and crashes in your machines. ## Why fork Waterfall? -Waterfall was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. +FlameCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. FlameCord will track upstream Waterfall and merge changes as needed. @@ -29,7 +24,7 @@ FlameCord will track upstream Waterfall and merge changes as needed. You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). Or you can download it for free in the [releases tab](https://github.com/2lstudios-mc/FlameCord/releases). -FlameCord requires **Java 8** or above. +FlameCord requires **JRE 8** or above. ## How To (Compiling from source) @@ -40,4 +35,4 @@ Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/ ## Join us * Feel free to open a PR! We accept contributions. -* Join to our [Discord Server](https://discord.gg/gF36AT3). \ No newline at end of file +* Join to our [Discord Server](https://discord.gg/gF36AT3). From 1b10dc5088ddbbfc5314821fc7cd72887f314626 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 19 Mar 2022 20:23:28 -0300 Subject: [PATCH 253/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd1b9dc2..fed4fbde 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ FlameCord will track upstream Waterfall and merge changes as needed. You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). Or you can download it for free in the [releases tab](https://github.com/2lstudios-mc/FlameCord/releases). -FlameCord requires **JRE 8** or above. +FlameCord requires **Java 8** or above. ## How To (Compiling from source) From 620d687a28e8cd31faa3dc2cefb508a691834cff Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Mar 2022 23:08:05 -0300 Subject: [PATCH 254/499] Delete .github/workflows directory --- .github/workflows/flamecord-build.yml | 53 -------------------- .github/workflows/flamecord-pull-request.yml | 52 ------------------- 2 files changed, 105 deletions(-) delete mode 100644 .github/workflows/flamecord-build.yml delete mode 100644 .github/workflows/flamecord-pull-request.yml diff --git a/.github/workflows/flamecord-build.yml b/.github/workflows/flamecord-build.yml deleted file mode 100644 index 6a7abd36..00000000 --- a/.github/workflows/flamecord-build.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This workflow will perform a compilation test on -# each push to the branch master to check its correct -# compilation and will deliver an artifact to check -# if the change is working properly. -name: FlameCord Build (master) - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - # The corresponding tests are performed in the versions - # marked as Long Term Support by Oracle and in its - # latest version up to the moment. - strategy: - matrix: - java: [8, 11, 17] - - steps: - # Checkout repository - - name: Checkout Repository - uses: actions/checkout@v3 - - # Setup a version of the Java JDK - - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: 'adopt' - architecture: x64 - - # The corresponding dependencies are stored in the cache to speed up the test. - - name: Cache Maven Packages - uses: actions/cache@v2.1.7 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - # Start building FlameCord - - name: Build FlameCord - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - scripts/build.sh --jar - - # An artifact is generated in a compressed file according to each JDK build version. - - name: Upload FlameCord - uses: actions/upload-artifact@v3 - with: - name: FlameCord-JDK${{ matrix.java }} - path: FlameCord-Proxy/bootstrap/target/FlameCord.jar diff --git a/.github/workflows/flamecord-pull-request.yml b/.github/workflows/flamecord-pull-request.yml deleted file mode 100644 index 18408cb9..00000000 --- a/.github/workflows/flamecord-pull-request.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This workflow will perform a compilation test on each -# pull request to check its correct compilation and will deliver -# an artifact to check if the change is working properly. -name: FlameCord Build (pull request) - -on: [pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - # The corresponding tests are performed in the versions - # marked as Long Term Support by Oracle and in its - # latest version up to the moment. - strategy: - matrix: - java: [8, 11, 17] - - steps: - # Checkout repository - - name: Checkout Repository - uses: actions/checkout@v3 - - # Setup a version of the Java JDK - - name: Setup JAVA ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: 'adopt' - architecture: x64 - - # The corresponding dependencies are stored in the cache to speed up the test. - - name: Cache Maven Packages - uses: actions/cache@v2.1.7 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - # Start building FlameCord - - name: Build FlameCord - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - scripts/build.sh --jar - - # An artifact is generated in a compressed file according to each JDK build version. - - name: Upload FlameCord - uses: actions/upload-artifact@v3 - with: - name: FlameCord-JDK${{ matrix.java }} - path: FlameCord-Proxy/bootstrap/target/FlameCord.jar From 03fc86080816be5898d6d9e65ddcf77493be4734 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 27 Mar 2022 01:41:49 -0300 Subject: [PATCH 255/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fed4fbde..7cb7a4b5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ FlameCord is a Waterfall modification to fix exploits, improve performance and p FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. - + ## Features From 7bdc34eea024b673da4763ce49cf46f45364ca48 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 27 Mar 2022 01:42:50 -0300 Subject: [PATCH 256/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cb7a4b5..f6cfc58d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ FlameCord is a Waterfall modification to fix exploits, improve performance and p FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. - + ## Features From 61792c61edc12aaca074a991206405151cf33b64 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 1 Apr 2022 14:25:50 -0300 Subject: [PATCH 257/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6cfc58d..9acb91de 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ FlameCord will track upstream Waterfall and merge changes as needed. ## How to (Server Admins) -You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). Or you can download it for free in the [releases tab](https://github.com/2lstudios-mc/FlameCord/releases). +You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). FlameCord requires **Java 8** or above. From 02f7843ad1636a8f7840ff7189f956a4a794c75c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 22 Apr 2022 19:05:34 -0300 Subject: [PATCH 258/499] Fix Patch --- .../0026-Custom-motd-system.patch | 172 +++++++++++++-- .../0027-TCP-Fast-Open.patch | 19 +- ...0028-InitialHandler-Processing-State.patch | 20 +- .../0029-Antibot-System.patch | 71 +++--- .../0030-Allow-Invalid-Names.patch | 18 +- .../0033-More-features-for-custom-motd.patch | 205 ------------------ 6 files changed, 216 insertions(+), 289 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index fd86ac82..8a6f38bc 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,17 +1,36 @@ -From 608e7343216c313476d8c0d09a8b94c9f85a8519 Mon Sep 17 00:00:00 2001 +From ef99f50e3a8120e593752abea6d21a7251b32004 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +index cfbd55c3..360305b9 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +@@ -11,6 +11,10 @@ public class FlameConfig { + return (int) setIfUnexistant(arg1, (Object) arg2, configuration); + } + ++ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ + boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { + return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); + } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 701db67c..48deace6 100644 +index 701db67c..236940e1 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -6,12 +6,33 @@ import java.util.ArrayList; - import java.util.Arrays; - import java.util.Collection; - import java.util.HashSet; +@@ -3,15 +3,77 @@ package dev._2lstudios.flamecord.configuration; + import java.io.File; + import java.io.IOException; + import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.HashSet; ++import java.util.Collections; +import java.util.List; +import java.util.Random; @@ -29,44 +48,157 @@ index 701db67c..48deace6 100644 + return strings; + } + -+ @Getter -+ private boolean customMotdEnabled = false; -+ private List customMotdMotds = Arrays.asList(new String[] { "&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!" }); ++ public String getMOTD(final int maxPlayers, final int onlinePlayers) { ++ final String motd = motds.get(new Random().nextInt(motds.size())); ++ ++ return motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ } + -+ public String getRandomMotd() { -+ final Random random = new Random(); ++ public String[] getSample(final int maxPlayers, final int onlinePlayers) { ++ final String sample = samples.get(new Random().nextInt(samples.size())); + -+ return customMotdMotds.get(random.nextInt(customMotdMotds.size())); ++ return sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)).split("\n"); + } ++ ++ public int getFakePlayersAmount(final int players) { ++ switch (fakePlayersMode) { ++ case "STATIC": ++ return fakePlayersAmount; ++ case "RANDOM": ++ return (int) (Math.floor(Math.random() * fakePlayersAmount) + 1); ++ case "DIVISION": ++ return players / fakePlayersAmount; ++ default: ++ return 0; ++ } ++ } ++ ++ @Getter ++ private boolean motdEnabled = false; ++ @Getter ++ private List motds = Collections.singletonList("&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!"); ++ ++ @Getter ++ private boolean sampleEnabled = false; ++ @Getter ++ private List samples = Collections.singletonList("&eDefault &cFlameCord&e sample!\n&eChange me in &cflamecord.yml&e file!"); ++ ++ @Getter ++ private boolean protocolEnabled = false; ++ @Getter ++ private String protocolName = "FlameCord 1.7-1.18"; ++ ++ @Getter ++ private boolean maxPlayersEnabled = false; ++ @Getter ++ private int maxPlayersAmount = 1000; ++ @Getter ++ private boolean maxPlayersOneMore = false; ++ ++ @Getter ++ private boolean fakePlayersEnabled = false; ++ @Getter ++ private int fakePlayersAmount = 3; ++ private String fakePlayersMode = "DIVISION"; + @Getter private boolean loggerInitialhandler = false; @Getter -@@ -34,6 +55,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -34,6 +96,19 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } -+ this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); -+ this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); ++ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); ++ this.motds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); ++ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); ++ this.samples = colors(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); ++ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); ++ this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); ++ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); ++ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); ++ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); ++ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); ++ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); ++ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 cfd6249e..0c608e0f 100644 +index cfd6249e..d1a06397 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 -@@ -250,7 +250,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -21,6 +21,8 @@ import javax.crypto.spec.SecretKeySpec; + + import dev._2lstudios.flamecord.FlameCord; + ++import dev._2lstudios.flamecord.configuration.FlameConfig; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -250,7 +252,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); -+ // FlameCord - Custom motd -+ final String listenerMotd = FlameCord.getInstance().getFlameCordConfiguration().isCustomMotdEnabled() ? FlameCord.getInstance().getFlameCordConfiguration().getRandomMotd() : listener.getMotd(); -+ final String motd = ( forced != null ) ? forced.getMotd() : listenerMotd; final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() +@@ -313,7 +314,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection + ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); + } else + { +- pingBack.done( getPingInfo( motd, protocol ), null ); ++ // FlameCord - Custom MOTD ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ String motd; ++ String protocolName; ++ ++ ServerPing.PlayerInfo[] sample = null; ++ ++ int maxPlayers = listener.getMaxPlayers(); ++ int onlinePlayers = bungee.getOnlineCount(); ++ ++ if (config.isFakePlayersEnabled()) { ++ onlinePlayers += config.getFakePlayersAmount(onlinePlayers); ++ } ++ ++ if (config.isMaxPlayersEnabled()) { ++ maxPlayers = config.isMaxPlayersOneMore() ? onlinePlayers + 1 : config.getMaxPlayersAmount(); ++ } ++ ++ if (config.isMotdEnabled()) { ++ motd = config.getMOTD(maxPlayers, onlinePlayers); ++ } else { ++ motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); ++ } ++ ++ if (config.isProtocolEnabled()) { ++ protocolName = config.getProtocolName(); ++ } else { ++ protocolName = bungee.getName() + " " + bungee.getGameVersion(); ++ } ++ ++ if (config.isSampleEnabled()) { ++ final UUID fakeUuid = new UUID(0, 0); ++ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers); ++ ++ sample = new ServerPing.PlayerInfo[sampleString.length]; ++ ++ for (int i = 0; i < sampleString.length; i++) { ++ sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); ++ } ++ } ++ ++ pingBack.done( new ServerPing( ++ new ServerPing.Protocol( protocolName, protocol ), ++ new ServerPing.Players( maxPlayers, onlinePlayers, sample ), ++ motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); + } + + thisState = State.PING; -- 2.32.0 diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 36d0a666..8c387d6e 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,14 +1,14 @@ -From 216628c6de6f3697ed82a84be11d73301705e170 Mon Sep 17 00:00:00 2001 +From 84a9655972b3e051e914e26484dd7dbb5de8c05d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 48deace6..d972fcea 100644 +index 236940e1..a70ce1ab 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; +@@ -13,6 +13,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,15 +19,14 @@ index 48deace6..d972fcea 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -55,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { - configuration = configurationProvider.load(configurationFile); - } - +@@ -108,6 +112,7 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); + this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); -+ - this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); - this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); 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 a840bc70..f4bf745c 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 0e6b9c13..44a1b33f 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From cdf449f0be0a29592f76f2b53afc2da0949d58f1 Mon Sep 17 00:00:00 2001 +From 2955e7fb79cc4a078a7290263cf86e2da94381f8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 0c608e0f..4d9e9b89 100644 +index d1a06397..0a09f92c 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 -@@ -128,12 +128,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -130,12 +130,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection private enum State { @@ -23,15 +23,15 @@ index 0c608e0f..4d9e9b89 100644 } @Override -@@ -248,6 +248,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -250,6 +250,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); + thisState = State.PROCESSING; ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - // FlameCord - Custom motd -@@ -328,6 +329,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); +@@ -372,6 +373,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index 0c608e0f..4d9e9b89 100644 unsafe.sendPacket( ping ); -@@ -339,6 +341,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -383,6 +385,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index 0c608e0f..4d9e9b89 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); -@@ -411,6 +414,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -455,6 +458,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index 0c608e0f..4d9e9b89 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -469,6 +473,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -513,6 +517,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(final EncryptionResponse encryptResponse) throws Exception { Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); @@ -63,7 +63,7 @@ index 0c608e0f..4d9e9b89 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start -@@ -696,14 +701,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -740,14 +745,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 20a8012d..5053f176 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,11 +1,11 @@ -From 42bcedf00c5abd628c032f20e43970ff8ff13f71 Mon Sep 17 00:00:00 2001 +From dc2f5c179aab771c706954ed2b29dcadf943ce29 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index f4bf5ec6e..4a0d8e5da 100644 +index f4bf5ec6..4a0d8e5d 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,11 @@ @@ -22,7 +22,7 @@ index f4bf5ec6e..4a0d8e5da 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 000000000..dfee9bf83 +index 00000000..dfee9bf8 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ @@ -64,7 +64,7 @@ index 000000000..dfee9bf83 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 000000000..cd8220d18 +index 00000000..cd8220d1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java @@ -0,0 +1,149 @@ @@ -219,7 +219,7 @@ index 000000000..cd8220d18 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 000000000..3f6e4186b +index 00000000..3f6e4186 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java @@ -0,0 +1,25 @@ @@ -250,7 +250,7 @@ index 000000000..3f6e4186b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 000000000..137ed9808 +index 00000000..137ed980 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java @@ -0,0 +1,41 @@ @@ -297,7 +297,7 @@ index 000000000..137ed9808 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 000000000..5cb5021ab +index 00000000..5cb5021a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -443,7 +443,7 @@ index 000000000..5cb5021ab +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 000000000..76902c279 +index 00000000..76902c27 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -481,7 +481,7 @@ index 000000000..76902c279 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java new file mode 100644 -index 000000000..d3b77f03f +index 00000000..d3b77f03 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java @@ -0,0 +1,42 @@ @@ -529,7 +529,7 @@ index 000000000..d3b77f03f +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 000000000..f9b1ad70b +index 00000000..f9b1ad70 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,43 @@ @@ -578,7 +578,7 @@ index 000000000..f9b1ad70b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 000000000..8ffe1e216 +index 00000000..8ffe1e21 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -646,7 +646,7 @@ index 000000000..8ffe1e216 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..f9ab936b1 +index 00000000..f9ab936b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -685,7 +685,7 @@ index 000000000..f9ab936b1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 000000000..f958a6f23 +index 00000000..f958a6f2 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java @@ -0,0 +1,33 @@ @@ -723,7 +723,7 @@ index 000000000..f958a6f23 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7c..4079caa5d 100644 +index c78ab3a7..4079caa5 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -761,18 +761,19 @@ index c78ab3a7c..4079caa5d 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d972fcea2..4a145a110 100644 +index a70ce1ab..48fcaef2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -5,7 +5,6 @@ import java.io.IOException; +@@ -4,6 +4,8 @@ import java.io.File; + import java.io.IOException; import java.util.ArrayList; - import java.util.Arrays; - import java.util.Collection; --import java.util.HashSet; + import java.util.Collections; ++import java.util.Arrays; ++import java.util.Collection; import java.util.List; import java.util.Random; -@@ -15,6 +14,114 @@ import net.md_5.bungee.config.Configuration; +@@ -13,6 +15,114 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -887,17 +888,17 @@ index d972fcea2..4a145a110 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -59,6 +166,8 @@ public class FlameCordConfiguration extends FlameConfig { - configuration = configurationProvider.load(configurationFile); - } - +@@ -112,6 +222,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); + this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + loadAntibot(configuration); + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); - this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 574629920..ee0295c73 100644 +index 57462992..ee0295c7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -81,6 +81,17 @@ public class MessagesConfiguration extends FlameConfig { @@ -919,7 +920,7 @@ index 574629920..ee0295c73 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 4ced9bd6a..55b424d2c 100644 +index 0a09f92c..813f0e9b 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -930,8 +931,8 @@ index 4ced9bd6a..55b424d2c 100644 +import dev._2lstudios.antibot.CheckManager; import dev._2lstudios.flamecord.FlameCord; - import lombok.Getter; -@@ -371,6 +373,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + import dev._2lstudios.flamecord.configuration.FlameConfig; +@@ -415,6 +417,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -943,7 +944,7 @@ index 4ced9bd6a..55b424d2c 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -382,6 +389,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -426,6 +433,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -966,7 +967,7 @@ index 4ced9bd6a..55b424d2c 100644 break; case 2: // Login -@@ -393,6 +416,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -437,6 +460,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -988,7 +989,7 @@ index 4ced9bd6a..55b424d2c 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -430,6 +468,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -474,6 +512,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1048,7 +1049,7 @@ index 4ced9bd6a..55b424d2c 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 e354032aa..976c37e10 100644 +index e354032a..976c37e1 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,10 +4,15 @@ import com.google.common.base.Preconditions; @@ -1101,7 +1102,7 @@ index e354032aa..976c37e10 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index cef44d8a6..8fe2b37f6 100644 +index cef44d8a..8fe2b37f 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -1119,7 +1120,7 @@ index cef44d8a6..8fe2b37f6 100644 logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; 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 f4bf745c8..eaedb4593 100644 +index f4bf745c..eaedb459 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 @@ -63,6 +63,14 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 138539a7..8d4ba0b5 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From 59bd5c9b337f2f398cd092ded01185743aab1e2f Mon Sep 17 00:00:00 2001 +From 7d701499f3907a23062b0f9a76ecd433e688d0a8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index dc9ba8f0..aa1c8266 100644 +index 48fcaef2..a2e11adf 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -14,6 +14,10 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,20 +19,20 @@ index dc9ba8f0..aa1c8266 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -166,6 +170,8 @@ public class FlameCordConfiguration extends FlameConfig { - configuration = configurationProvider.load(configurationFile); - } - +@@ -222,6 +226,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); + this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); + loadAntibot(configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 a9a17154..0c5fd21e 100644 +index 813f0e9b..7fa3217e 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 -@@ -454,7 +454,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -498,7 +498,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch b/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch deleted file mode 100644 index 113f54d0..00000000 --- a/Waterfall-Proxy-Patches/0033-More-features-for-custom-motd.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 9aa3361d1876942d2c63f36ab92e4167314dc37c Mon Sep 17 00:00:00 2001 -From: HakanGulgen -Date: Fri, 18 Mar 2022 15:18:09 +0300 -Subject: [PATCH] More features for custom motd. - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -index cfbd55c3..360305b9 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -11,6 +11,10 @@ public class FlameConfig { - return (int) setIfUnexistant(arg1, (Object) arg2, configuration); - } - -+ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ - boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { - return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); - } -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index be49f581..929b37ea 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -2,11 +2,7 @@ package dev._2lstudios.flamecord.configuration; - - import java.io.File; - import java.io.IOException; --import java.util.ArrayList; --import java.util.Arrays; --import java.util.Collection; --import java.util.List; --import java.util.Random; -+import java.util.*; - - import lombok.Getter; - import net.md_5.bungee.api.ChatColor; -@@ -138,16 +134,59 @@ public class FlameCordConfiguration extends FlameConfig { - return strings; - } - -- @Getter -- private boolean customMotdEnabled = false; -- private List customMotdMotds = Arrays.asList(new String[] { "&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!" }); -+ public String getMOTD(final int maxPlayers, final int onlinePlayers) { -+ final String motd = motds.get(new Random().nextInt(motds.size())); -+ -+ return motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); -+ } - -- public String getRandomMotd() { -- final Random random = new Random(); -+ public String[] getSample(final int maxPlayers, final int onlinePlayers) { -+ final String sample = samples.get(new Random().nextInt(samples.size())); - -- return customMotdMotds.get(random.nextInt(customMotdMotds.size())); -+ return sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)).split("\n"); -+ } -+ -+ public int getFakePlayersAmount(final int players) { -+ switch (fakePlayersMode) { -+ case "STATIC": -+ return fakePlayersAmount; -+ case "RANDOM": -+ return (int) (Math.floor(Math.random() * fakePlayersAmount) + 1); -+ case "DIVISION": -+ return players / fakePlayersAmount; -+ default: -+ return 0; -+ } - } - -+ @Getter -+ private boolean motdEnabled = false; -+ @Getter -+ private List motds = Collections.singletonList("&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!"); -+ -+ @Getter -+ private boolean sampleEnabled = false; -+ @Getter -+ private List samples = Collections.singletonList("&eDefault &cFlameCord&e sample!\n&eChange me in &cflamecord.yml&e file!"); -+ -+ @Getter -+ private boolean protocolEnabled = false; -+ @Getter -+ private String protocolName = "FlameCord 1.7-1.18"; -+ -+ @Getter -+ private boolean maxPlayersEnabled = false; -+ @Getter -+ private int maxPlayersAmount = 1000; -+ @Getter -+ private boolean maxPlayersOneMore = false; -+ -+ @Getter -+ private boolean fakePlayersEnabled = false; -+ @Getter -+ private int fakePlayersAmount = 3; -+ private String fakePlayersMode = "DIVISION"; -+ - @Getter - private boolean loggerInitialhandler = false; - @Getter -@@ -176,8 +215,18 @@ public class FlameCordConfiguration extends FlameConfig { - - this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); - -- this.customMotdEnabled = setIfUnexistant("custom-motd.enabled", this.customMotdEnabled, configuration); -- this.customMotdMotds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motds", this.customMotdMotds, configuration))); -+ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.motds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); -+ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.samples = colors(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); -+ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); -+ this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); -+ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); -+ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); -+ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); -+ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); -+ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); -+ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); - - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -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 b6cd7e4b..7fa3217e 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 -@@ -23,6 +23,8 @@ import dev._2lstudios.antibot.AddressData; - import dev._2lstudios.antibot.CheckManager; - import dev._2lstudios.flamecord.FlameCord; - -+import dev._2lstudios.flamecord.configuration.FlameConfig; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -@@ -253,9 +255,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection - thisState = State.PROCESSING; - - ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); -- // FlameCord - Custom motd -- final String listenerMotd = FlameCord.getInstance().getFlameCordConfiguration().isCustomMotdEnabled() ? FlameCord.getInstance().getFlameCordConfiguration().getRandomMotd() : listener.getMotd(); -- final String motd = ( forced != null ) ? forced.getMotd() : listenerMotd; - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); - - Callback pingBack = new Callback() -@@ -318,7 +317,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection - ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); - } else - { -- pingBack.done( getPingInfo( motd, protocol ), null ); -+ // FlameCord - Custom MOTD -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ -+ String motd; -+ String protocolName; -+ -+ ServerPing.PlayerInfo[] sample = null; -+ -+ int maxPlayers = listener.getMaxPlayers(); -+ int onlinePlayers = bungee.getOnlineCount(); -+ -+ if (config.isFakePlayersEnabled()) { -+ onlinePlayers += config.getFakePlayersAmount(onlinePlayers); -+ } -+ -+ if (config.isMaxPlayersEnabled()) { -+ maxPlayers = config.isMaxPlayersOneMore() ? onlinePlayers + 1 : config.getMaxPlayersAmount(); -+ } -+ -+ if (config.isMotdEnabled()) { -+ motd = config.getMOTD(maxPlayers, onlinePlayers); -+ } else { -+ motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); -+ } -+ -+ if (config.isProtocolEnabled()) { -+ protocolName = config.getProtocolName(); -+ } else { -+ protocolName = bungee.getName() + " " + bungee.getGameVersion(); -+ } -+ -+ if (config.isSampleEnabled()) { -+ final UUID fakeUuid = new UUID(0, 0); -+ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers); -+ -+ sample = new ServerPing.PlayerInfo[sampleString.length]; -+ -+ for (int i = 0; i < sampleString.length; i++) { -+ sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); -+ } -+ } -+ -+ pingBack.done( new ServerPing( -+ new ServerPing.Protocol( protocolName, protocol ), -+ new ServerPing.Players( maxPlayers, onlinePlayers, sample ), -+ motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); - } - - thisState = State.PING; --- -2.35.1.windows.2 - From b931fe97930c7824f224ce132e89af8ff76fcf74 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 22 Apr 2022 19:11:49 -0300 Subject: [PATCH 259/499] Fix Patches --- .../0026-Custom-motd-system.patch | 14 +++++++------- .../0027-TCP-Fast-Open.patch | 8 ++++---- .../0029-Antibot-System.patch | 17 ++++------------- .../0030-Allow-Invalid-Names.patch | 8 ++++---- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 8a6f38bc..033d9fc7 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From ef99f50e3a8120e593752abea6d21a7251b32004 Mon Sep 17 00:00:00 2001 +From e4f068cdf525de91cca34a4cc493303acbe1dec4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,17 +20,17 @@ index cfbd55c3..360305b9 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 701db67c..236940e1 100644 +index 701db67c..25716fa7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,77 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,80 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; --import java.util.Arrays; --import java.util.Collection; --import java.util.HashSet; +import java.util.Collections; + import java.util.Arrays; + import java.util.Collection; + import java.util.HashSet; +import java.util.List; +import java.util.Random; @@ -104,7 +104,7 @@ index 701db67c..236940e1 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -34,6 +96,19 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -34,6 +99,19 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 8c387d6e..602d03f4 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,14 +1,14 @@ -From 84a9655972b3e051e914e26484dd7dbb5de8c05d Mon Sep 17 00:00:00 2001 +From d520f9c83d7a5a455fd08bfa57f598140f512024 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 236940e1..a70ce1ab 100644 +index 25716fa7..a77cecf0 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -13,6 +13,10 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index 236940e1..a70ce1ab 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -108,6 +112,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -111,6 +115,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5053f176..ce3d8f2d 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From dc2f5c179aab771c706954ed2b29dcadf943ce29 Mon Sep 17 00:00:00 2001 +From f46da0d9a58d8a72acf3e144b6e59d96ca0c3aca Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -761,19 +761,10 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a70ce1ab..48fcaef2 100644 +index a77cecf0..9ace4ff5 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -4,6 +4,8 @@ import java.io.File; - import java.io.IOException; - import java.util.ArrayList; - import java.util.Collections; -+import java.util.Arrays; -+import java.util.Collection; - import java.util.List; - import java.util.Random; - -@@ -13,6 +15,114 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,114 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -888,7 +879,7 @@ index a70ce1ab..48fcaef2 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -112,6 +222,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -115,6 +223,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 8d4ba0b5..37ea18e7 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From 7d701499f3907a23062b0f9a76ecd433e688d0a8 Mon Sep 17 00:00:00 2001 +From 979e4625e5efa8e34d885f6e7ce02dae8d008161 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 48fcaef2..a2e11adf 100644 +index 9ace4ff5..d2fa6216 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index 48fcaef2..a2e11adf 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -222,6 +226,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -223,6 +227,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); From 54f917b1f2ad292d54b32bef95f2f49ce408b736 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 22 Apr 2022 20:49:28 -0300 Subject: [PATCH 260/499] 0.8.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b3b66388..750ef921 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index a4b58d9c6..40ceeb18d 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.4"; ++ return "0.8.5"; } public void reloadMessages() From 4a255602e3d9e72ab3ca03d18213ea1c5dcadc7f Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Mon, 25 Apr 2022 04:27:45 +0200 Subject: [PATCH 261/499] don't show extra info due spam-issues --- ...nt-show-extra-info-in-connect-errors.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch diff --git a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch new file mode 100644 index 00000000..dbefc807 --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch @@ -0,0 +1,66 @@ +From d63d977ab6d6bdb5591bc838fc96fae5394298f5 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Mon, 25 Apr 2022 04:25:32 +0200 +Subject: [PATCH] Dont show extra info in connect errors + + +diff --git a/api/src/main/java/net/md_5/bungee/Util.java b/api/src/main/java/net/md_5/bungee/Util.java +index 70bf87f7..df5f33d1 100644 +--- a/api/src/main/java/net/md_5/bungee/Util.java ++++ b/api/src/main/java/net/md_5/bungee/Util.java +@@ -92,23 +92,11 @@ public class Util + */ + public static String exception(Throwable t) + { +- return exception( t, true ); +- } +- +- /** +- * Constructs a pretty one line version of a {@link Throwable}. Useful for +- * debugging. +- * +- * @param t the {@link Throwable} to format. +- * @param includeLineNumbers whether to include line numbers +- * @return a string representing information about the {@link Throwable} +- */ +- public static String exception(Throwable t, boolean includeLineNumbers) +- { ++ //FlameCord remove aditional information + // TODO: We should use clear manually written exceptions + StackTraceElement[] trace = t.getStackTrace(); + return t.getClass().getSimpleName() + " : " + t.getMessage() +- + ( ( includeLineNumbers && trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" ); ++ + ( (trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" ); + } + + public static String csv(Iterable objects) +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 723b004a..725896ff 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multimap; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; ++import io.netty.channel.ConnectTimeoutException; + import io.netty.channel.ChannelFuture; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelInitializer; +@@ -399,7 +400,13 @@ public final class UserConnection implements ProxiedPlayer + + private String connectionFailMessage(Throwable cause) + { +- return Util.exception( cause, false ); ++ if ( cause instanceof ConnectTimeoutException ) ++ { ++ return bungee.getTranslation( "timeout" ); ++ } else ++ { ++ return cause.getClass().getName(); ++ } + } + + @Override +-- +2.34.1.windows.1 + From 76d8996e1430f1c10808c037908e4f395f0a486a Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 24 Apr 2022 23:31:11 -0300 Subject: [PATCH 262/499] Follow FlameCord Comments --- .../0033-Dont-show-extra-info-in-connect-errors.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch index dbefc807..4e74ab48 100644 --- a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch +++ b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch @@ -25,7 +25,7 @@ index 70bf87f7..df5f33d1 100644 - */ - public static String exception(Throwable t, boolean includeLineNumbers) - { -+ //FlameCord remove aditional information ++ // FlameCord - remove aditional information // TODO: We should use clear manually written exceptions StackTraceElement[] trace = t.getStackTrace(); return t.getClass().getSimpleName() + " : " + t.getMessage() From b69efbcf2c410ba5025b46d2024cd51c35df44d2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:49:40 -0300 Subject: [PATCH 263/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- ...ferences-from-Waterfall-to-FlameCord.patch | 6 +- .../0003-FlameCord-rebrand.patch | 12 +- .../0004-1.7.x-support.patch | 904 +++++++++++++++++- ...ections-Don-t-flush-if-not-necessary.patch | 10 +- .../0017-FlameCord-General-Patch.patch | 12 +- .../0018-FlameCord-module-system.patch | 6 +- ...0019-FlameCord-message-configuration.patch | 6 +- .../0027-TCP-Fast-Open.patch | 6 +- .../0029-Antibot-System.patch | 8 +- ...0032-Disable-entity-Metadata-Rewrite.patch | 6 +- ...nt-show-extra-info-in-connect-errors.patch | 13 +- 12 files changed, 938 insertions(+), 53 deletions(-) diff --git a/Waterfall b/Waterfall index 80a64a6f..2322301e 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 80a64a6f08eb4f00a12fd98991ca6640b4d5a3f0 +Subproject commit 2322301e636482f5eee44b7f7586a66408a502f4 diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index 5399cb32..198ebf20 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,4 +1,4 @@ -From 73739a822f6730c871a88ade6d7fe7d5efbc117c Mon Sep 17 00:00:00 2001 +From 6c907417fb81eab79424a93cd1d5db29ebbab197 Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to FlameCord @@ -44,7 +44,7 @@ index d703d6d2..49dce84b 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 07d74c67..a4b58d9c 100644 +index 9ef2b77a..2fef94e5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer @@ -56,7 +56,7 @@ index 07d74c67..a4b58d9c 100644 try { -@@ -539,7 +539,7 @@ public class BungeeCord extends ProxyServer +@@ -536,7 +536,7 @@ public class BungeeCord extends ProxyServer @Override public String getName() { diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 750ef921..7b712c0e 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 40ee61cc9b114b89dfabfc3f0f070edf18c2bd03 Mon Sep 17 00:00:00 2001 +From 87c680c40d5cb84882e5328c9f1d0adffc86b386 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index e31fb00ae..ff4bbf34d 100644 +index e31fb00a..ff4bbf34 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,10 +19,10 @@ index e31fb00ae..ff4bbf34d 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a4b58d9c6..40ceeb18d 100644 +index 2fef94e5..15a639de 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer +@@ -542,7 +542,7 @@ public class BungeeCord extends ProxyServer @Override public String getVersion() { @@ -32,7 +32,7 @@ index a4b58d9c6..40ceeb18d 100644 public void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03c..aeda79639 100644 +index 820f7b03..aeda7963 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03c..aeda79639 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b2b199969 100644 +index 0c1ecfb8..b2b19996 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 512b813b..1e4f6e0d 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 4ad196ffeace48412b9dd00040c605ffc6f2fb36 Mon Sep 17 00:00:00 2001 +From 2c965a41d72b044e78b263ce969bfd91a14062ba Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -706,7 +706,7 @@ index 92bacc7c..cae5bda5 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 4f3a8c72..2d87692f 100644 +index 91f71c09..57a82d29 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket @@ -723,8 +723,8 @@ index 4f3a8c72..2d87692f 100644 + // FlameCord end - 1.7.x support + tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); - int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; - Preconditions.checkArgument( buf.readableBytes() < maxSize ); + int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000; + Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" ); @@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) @@ -741,6 +741,112 @@ index 4f3a8c72..2d87692f 100644 writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); buf.writeBytes( data ); } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig +new file mode 100644 +index 00000000..91f71c09 +--- /dev/null ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig +@@ -0,0 +1,100 @@ ++package net.md_5.bungee.protocol.packet; ++ ++import com.google.common.base.Function; ++import com.google.common.base.Preconditions; ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.ByteBufUtil; // Waterfall ++import java.io.ByteArrayInputStream; ++import java.io.DataInput; ++import java.io.DataInputStream; ++import java.util.Locale; ++import lombok.AllArgsConstructor; ++import lombok.Data; ++import lombok.EqualsAndHashCode; ++import lombok.NoArgsConstructor; ++import net.md_5.bungee.protocol.AbstractPacketHandler; ++import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; ++ ++@Data ++@NoArgsConstructor ++@AllArgsConstructor ++@EqualsAndHashCode(callSuper = false) ++public class PluginMessage extends DefinedPacket ++{ ++ ++ public static final Function MODERNISE = new Function() ++ { ++ @Override ++ public String apply(String tag) ++ { ++ // Transform as per Bukkit ++ if ( tag.equals( "BungeeCord" ) ) ++ { ++ return "bungeecord:main"; ++ } ++ if ( tag.equals( "bungeecord:main" ) ) ++ { ++ return "BungeeCord"; ++ } ++ ++ // Code that gets to here is UNLIKELY to be viable on the Bukkit side of side things, ++ // but we keep it anyway. It will eventually be enforced API side. ++ if ( tag.indexOf( ':' ) != -1 ) ++ { ++ return tag; ++ } ++ ++ return "legacy:" + tag.toLowerCase( Locale.ROOT ); ++ } ++ }; ++ ++ public PluginMessage(String tag, ByteBuf data, boolean allowExtendedPacket) { ++ this(tag, ByteBufUtil.getBytes(data), allowExtendedPacket); ++ } ++ ++ private String tag; ++ private byte[] data; ++ ++ public void setData(byte[] data) { ++ this.data = Preconditions.checkNotNull(data, "Null data"); ++ } ++ ++ public void setData(ByteBuf buf) { ++ Preconditions.checkNotNull(buf, "Null buffer"); ++ setData(ByteBufUtil.getBytes(buf)); ++ } ++ ++ /** ++ * Allow this packet to be sent as an "extended" packet. ++ */ ++ private boolean allowExtendedPacket = false; ++ ++ @Override ++ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) ++ { ++ tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); ++ int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000; ++ Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" ); ++ data = new byte[ buf.readableBytes() ]; ++ buf.readBytes( data ); ++ } ++ ++ @Override ++ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) ++ { ++ writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); ++ buf.writeBytes( data ); ++ } ++ ++ @Override ++ public void handle(AbstractPacketHandler handler) throws Exception ++ { ++ handler.handle( this ); ++ } ++ ++ public DataInput getStream() ++ { ++ return new DataInputStream( new ByteArrayInputStream( data ) ); ++ } ++} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java index 3c7905d5..75b371e9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -915,7 +1021,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 28032ae4..d1994a52 100644 +index 15a639de..0b02ae7d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1053,7 +1159,7 @@ index 9e74d158..75028024 100644 throw CancelSendSignal.INSTANCE; } 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 4a858f31..adc25165 100644 +index 7c52ee9a..fe73e6e8 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer @@ -1064,7 +1170,7 @@ index 4a858f31..adc25165 100644 displayName = name; } -@@ -506,7 +507,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -507,7 +508,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1073,7 +1179,7 @@ index 4a858f31..adc25165 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -702,6 +703,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -703,6 +704,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1081,7 +1187,7 @@ index 4a858f31..adc25165 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -714,6 +716,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -715,6 +717,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1089,7 +1195,7 @@ index 4a858f31..adc25165 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -743,6 +746,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -744,6 +747,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1097,6 +1203,784 @@ index 4a858f31..adc25165 100644 if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) { this.compressionThreshold = compressionThreshold; +diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig +new file mode 100644 +index 00000000..7c52ee9a +--- /dev/null ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig +@@ -0,0 +1,772 @@ ++package net.md_5.bungee; ++ ++import com.google.common.base.Preconditions; ++import com.google.common.collect.HashMultimap; ++import com.google.common.collect.ImmutableMap; ++import com.google.common.collect.Multimap; ++import io.netty.bootstrap.Bootstrap; ++import io.netty.channel.Channel; ++import io.netty.channel.ChannelFuture; ++import io.netty.channel.ChannelFutureListener; ++import io.netty.channel.ChannelInitializer; ++import io.netty.channel.ChannelOption; ++import io.netty.util.internal.PlatformDependent; ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.Collection; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.LinkedList; ++import java.util.Locale; ++import java.util.Map; ++import java.util.Objects; ++import java.util.Queue; ++import java.util.UUID; ++import java.util.logging.Level; ++import lombok.Getter; ++import lombok.NonNull; ++import lombok.RequiredArgsConstructor; ++import lombok.Setter; ++import net.md_5.bungee.api.Callback; ++import net.md_5.bungee.api.ChatMessageType; ++import net.md_5.bungee.api.ProxyServer; ++import net.md_5.bungee.api.ServerConnectRequest; ++import net.md_5.bungee.api.SkinConfiguration; ++import net.md_5.bungee.api.Title; ++import net.md_5.bungee.api.chat.BaseComponent; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.config.ServerInfo; ++import net.md_5.bungee.api.connection.ProxiedPlayer; ++import net.md_5.bungee.api.event.PermissionCheckEvent; ++import net.md_5.bungee.api.event.ServerConnectEvent; ++import net.md_5.bungee.api.score.Scoreboard; ++import net.md_5.bungee.chat.ComponentSerializer; ++import net.md_5.bungee.connection.InitialHandler; ++import net.md_5.bungee.entitymap.EntityMap; ++import net.md_5.bungee.forge.ForgeClientHandler; ++import net.md_5.bungee.forge.ForgeConstants; ++import net.md_5.bungee.forge.ForgeServerHandler; ++import net.md_5.bungee.netty.ChannelWrapper; ++import net.md_5.bungee.netty.HandlerBoss; ++import net.md_5.bungee.netty.PipelineUtils; ++import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.MinecraftDecoder; ++import net.md_5.bungee.protocol.MinecraftEncoder; ++import net.md_5.bungee.protocol.PacketWrapper; ++import net.md_5.bungee.protocol.Protocol; ++import net.md_5.bungee.protocol.ProtocolConstants; ++import net.md_5.bungee.protocol.packet.Chat; ++import net.md_5.bungee.protocol.packet.ClientSettings; ++import net.md_5.bungee.protocol.packet.Kick; ++import net.md_5.bungee.protocol.packet.PlayerListHeaderFooter; ++import net.md_5.bungee.protocol.packet.PluginMessage; ++import net.md_5.bungee.protocol.packet.SetCompression; ++import net.md_5.bungee.tab.ServerUnique; ++import net.md_5.bungee.tab.TabList; ++import net.md_5.bungee.util.CaseInsensitiveSet; ++import net.md_5.bungee.util.ChatComponentTransformer; ++ ++@RequiredArgsConstructor ++public final class UserConnection implements ProxiedPlayer ++{ ++ ++ /*========================================================================*/ ++ @NonNull ++ private final ProxyServer bungee; ++ @NonNull ++ @Getter ++ private final ChannelWrapper ch; ++ @Getter ++ @NonNull ++ private final String name; ++ @Getter ++ private final InitialHandler pendingConnection; ++ /*========================================================================*/ ++ @Getter ++ @Setter ++ private ServerConnection server; ++ @Getter ++ @Setter ++ private Object dimension; ++ @Getter ++ @Setter ++ private boolean dimensionChange = true; ++ @Getter ++ private final Collection pendingConnects = new HashSet<>(); ++ /*========================================================================*/ ++ @Getter ++ @Setter ++ private int ping = 100; ++ @Getter ++ @Setter ++ private ServerInfo reconnectServer; ++ @Getter ++ private TabList tabListHandler; ++ @Getter ++ @Setter ++ private int gamemode; ++ @Getter ++ private int compressionThreshold = -1; ++ // Used for trying multiple servers in order ++ @Setter ++ private Queue serverJoinQueue; ++ /*========================================================================*/ ++ private final Collection groups = new CaseInsensitiveSet(); ++ private final Collection permissions = new CaseInsensitiveSet(); ++ /*========================================================================*/ ++ @Getter ++ @Setter ++ private int clientEntityId; ++ @Getter ++ @Setter ++ private int serverEntityId; ++ @Getter ++ private ClientSettings settings; ++ @Getter ++ private final Scoreboard serverSentScoreboard = new Scoreboard(); ++ @Getter ++ private final Collection sentBossBars = new HashSet<>(); ++ // Waterfall start ++ @Getter ++ private final Multimap potions = HashMultimap.create(); ++ // Waterfall end ++ /*========================================================================*/ ++ @Getter ++ private String displayName; ++ @Getter ++ private EntityMap entityRewrite; ++ private Locale locale; ++ /*========================================================================*/ ++ @Getter ++ @Setter ++ private ForgeClientHandler forgeClientHandler; ++ @Getter ++ @Setter ++ private ForgeServerHandler forgeServerHandler; ++ /*========================================================================*/ ++ private final Unsafe unsafe = new Unsafe() ++ { ++ @Override ++ public void sendPacket(DefinedPacket packet) ++ { ++ ch.write( packet ); ++ } ++ }; ++ ++ public void init() ++ { ++ this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); ++ ++ this.displayName = name; ++ ++ tabListHandler = new ServerUnique( this ); ++ ++ Collection g = bungee.getConfigurationAdapter().getGroups( name ); ++ g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) ); ++ for ( String s : g ) ++ { ++ addGroups( s ); ++ } ++ ++ forgeClientHandler = new ForgeClientHandler( this ); ++ ++ // No-config FML handshake marker. ++ // Set whether the connection has a 1.8 FML marker in the handshake. ++ if (this.getPendingConnection().getExtraDataInHandshake().contains( ForgeConstants.FML_HANDSHAKE_TOKEN )) ++ { ++ forgeClientHandler.setFmlTokenInHandshake( true ); ++ } ++ } ++ ++ public void sendPacket(PacketWrapper packet) ++ { ++ ch.write( packet ); ++ } ++ ++ @Deprecated ++ public boolean isActive() ++ { ++ return !ch.isClosed(); ++ } ++ ++ @Override ++ public void setDisplayName(String name) ++ { ++ Preconditions.checkNotNull( name, "displayName" ); ++ displayName = name; ++ } ++ ++ @Override ++ public void connect(ServerInfo target) ++ { ++ connect( target, null, ServerConnectEvent.Reason.PLUGIN ); ++ } ++ ++ @Override ++ public void connect(ServerInfo target, ServerConnectEvent.Reason reason) ++ { ++ connect( target, null, false, reason ); ++ } ++ ++ @Override ++ public void connect(ServerInfo target, Callback callback) ++ { ++ connect( target, callback, false, ServerConnectEvent.Reason.PLUGIN ); ++ } ++ ++ @Override ++ public void connect(ServerInfo target, Callback callback, ServerConnectEvent.Reason reason) ++ { ++ connect( target, callback, false, reason ); ++ } ++ ++ @Deprecated ++ public void connectNow(ServerInfo target) ++ { ++ connectNow( target, ServerConnectEvent.Reason.UNKNOWN ); ++ } ++ ++ public void connectNow(ServerInfo target, ServerConnectEvent.Reason reason) ++ { ++ dimensionChange = true; ++ connect( target, reason ); ++ } ++ ++ public ServerInfo updateAndGetNextServer(ServerInfo currentTarget) ++ { ++ if ( serverJoinQueue == null ) ++ { ++ serverJoinQueue = new LinkedList<>( getPendingConnection().getListener().getServerPriority() ); ++ } ++ ++ ServerInfo next = null; ++ while ( !serverJoinQueue.isEmpty() ) ++ { ++ ServerInfo candidate = ProxyServer.getInstance().getServerInfo( serverJoinQueue.remove() ); ++ if ( !Objects.equals( currentTarget, candidate ) ) ++ { ++ next = candidate; ++ break; ++ } ++ } ++ ++ return next; ++ } ++ ++ public void connect(ServerInfo info, final Callback callback, final boolean retry) ++ { ++ connect( info, callback, retry, ServerConnectEvent.Reason.PLUGIN ); ++ } ++ ++ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason) ++ { ++ // Waterfall start ++ connect(info, callback, retry, reason, bungee.getConfig().getServerConnectTimeout()); ++ } ++ public void connect(ServerInfo info, final Callback callback, final boolean retry, int timeout) { ++ connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN, timeout); ++ } ++ ++ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout) { ++ this.connect(info, callback, retry, reason, timeout, true); ++ } ++ ++ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout, boolean sendFeedback) ++ { ++ // Waterfall end ++ Preconditions.checkNotNull( info, "info" ); ++ ++ ServerConnectRequest.Builder builder = ServerConnectRequest.builder().retry( retry ).reason( reason ).target( info ).sendFeedback(sendFeedback); // Waterfall - feedback param ++ builder.connectTimeout(timeout); // Waterfall ++ if ( callback != null ) ++ { ++ // Convert the Callback to be compatible with Callback from ServerConnectRequest. ++ builder.callback( new Callback() ++ { ++ @Override ++ public void done(ServerConnectRequest.Result result, Throwable error) ++ { ++ callback.done( ( result == ServerConnectRequest.Result.SUCCESS ) ? Boolean.TRUE : Boolean.FALSE, error ); ++ } ++ } ); ++ } ++ ++ connect( builder.build() ); ++ } ++ ++ @Override ++ public void connect(final ServerConnectRequest request) ++ { ++ Preconditions.checkNotNull( request, "request" ); ++ ++ final Callback callback = request.getCallback(); ++ ServerConnectEvent event = new ServerConnectEvent( this, request.getTarget(), request.getReason(), request ); ++ if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) ++ { ++ if ( callback != null ) ++ { ++ callback.done( ServerConnectRequest.Result.EVENT_CANCEL, null ); ++ } ++ ++ if ( getServer() == null && !ch.isClosing() ) ++ { ++ throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); ++ } ++ return; ++ } ++ ++ final BungeeServerInfo target = (BungeeServerInfo) event.getTarget(); // Update in case the event changed target ++ ++ if ( getServer() != null && Objects.equals( getServer().getInfo(), target ) ) ++ { ++ if ( callback != null ) ++ { ++ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTED, null ); ++ } ++ ++ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connected" ) ); // Waterfall ++ return; ++ } ++ if ( pendingConnects.contains( target ) ) ++ { ++ if ( callback != null ) ++ { ++ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTING, null ); ++ } ++ ++ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connecting" ) ); // Waterfall ++ return; ++ } ++ ++ pendingConnects.add( target ); ++ ++ ChannelInitializer initializer = new ChannelInitializer() ++ { ++ @Override ++ protected void initChannel(Channel ch) throws Exception ++ { ++ PipelineUtils.BASE.initChannel( ch ); ++ ch.pipeline().addAfter( PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, new MinecraftDecoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); ++ ch.pipeline().addAfter( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, new MinecraftEncoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); ++ ch.pipeline().get( HandlerBoss.class ).setHandler( new ServerConnector( bungee, UserConnection.this, target ) ); ++ } ++ }; ++ ChannelFutureListener listener = new ChannelFutureListener() ++ { ++ @Override ++ @SuppressWarnings("ThrowableResultIgnored") ++ public void operationComplete(ChannelFuture future) throws Exception ++ { ++ if ( callback != null ) ++ { ++ callback.done( ( future.isSuccess() ) ? ServerConnectRequest.Result.SUCCESS : ServerConnectRequest.Result.FAIL, future.cause() ); ++ } ++ ++ if ( !future.isSuccess() ) ++ { ++ future.channel().close(); ++ pendingConnects.remove( target ); ++ ++ ServerInfo def = updateAndGetNextServer( target ); ++ if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) ) ++ { ++ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_lobby" ) ); // Waterfall ++ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout(), request.isSendFeedback() ); // Waterfall ++ } else if ( dimensionChange ) ++ { ++ disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); ++ } else ++ { ++ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); ++ } ++ } ++ } ++ }; ++ Bootstrap b = new Bootstrap() ++ .channel( PipelineUtils.getChannel( target.getAddress() ) ) ++ .group( ch.getHandle().eventLoop() ) ++ .handler( initializer ) ++ .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) ++ .remoteAddress( target.getAddress() ); ++ // Windows is bugged, multi homed users will just have to live with random connecting IPs ++ if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) ++ { ++ b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); ++ } ++ b.connect().addListener( listener ); ++ } ++ ++ private String connectionFailMessage(Throwable cause) ++ { ++ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall ++ return ""; // Waterfall ++ } ++ ++ @Override ++ public void disconnect(String reason) ++ { ++ disconnect0( TextComponent.fromLegacyText( reason ) ); ++ } ++ ++ @Override ++ public void disconnect(BaseComponent... reason) ++ { ++ disconnect0( reason ); ++ } ++ ++ @Override ++ public void disconnect(BaseComponent reason) ++ { ++ disconnect0( reason ); ++ } ++ ++ public void disconnect0(final BaseComponent... reason) ++ { ++ if ( !ch.isClosing() ) ++ { ++ bungee.getLogger().log( Level.INFO, "[{0}] disconnected with: {1}", new Object[] ++ { ++ getName(), BaseComponent.toLegacyText( reason ) ++ } ); ++ ++ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); ++ ++ if ( server != null ) ++ { ++ server.setObsolete( true ); ++ server.disconnect( "Quitting" ); ++ } ++ } ++ } ++ ++ @Override ++ public void chat(String message) ++ { ++ Preconditions.checkState( server != null, "Not connected to server" ); ++ server.getCh().write( new Chat( message ) ); ++ } ++ ++ @Override ++ public void sendMessage(String message) ++ { ++ sendMessage( TextComponent.fromLegacyText( message ) ); ++ } ++ ++ @Override ++ public void sendMessages(String... messages) ++ { ++ for ( String message : messages ) ++ { ++ sendMessage( message ); ++ } ++ } ++ ++ @Override ++ public void sendMessage(BaseComponent... message) ++ { ++ sendMessage( ChatMessageType.SYSTEM, message ); ++ } ++ ++ @Override ++ public void sendMessage(BaseComponent message) ++ { ++ sendMessage( ChatMessageType.SYSTEM, message ); ++ } ++ ++ @Override ++ public void sendMessage(ChatMessageType position, BaseComponent... message) ++ { ++ sendMessage( position, null, message ); ++ } ++ ++ @Override ++ public void sendMessage(ChatMessageType position, BaseComponent message) ++ { ++ sendMessage( position, (UUID) null, message ); ++ } ++ ++ @Override ++ public void sendMessage(UUID sender, BaseComponent... message) ++ { ++ sendMessage( ChatMessageType.CHAT, sender, message ); ++ } ++ ++ @Override ++ public void sendMessage(UUID sender, BaseComponent message) ++ { ++ sendMessage( ChatMessageType.CHAT, sender, message ); ++ } ++ ++ private void sendMessage(ChatMessageType position, UUID sender, String message) ++ { ++ unsafe().sendPacket( new Chat( message, (byte) position.ordinal(), sender ) ); ++ } ++ ++ private void sendMessage(ChatMessageType position, UUID sender, BaseComponent... message) ++ { ++ // transform score components ++ message = ChatComponentTransformer.getInstance().transform( this, true, message ); ++ ++ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) ++ { ++ // Versions older than 1.11 cannot send the Action bar with the new JSON formattings ++ // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 ++ if ( getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_10 ) ++ { ++ sendMessage( position, sender, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); ++ } else ++ { ++ net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title(); ++ title.setAction( net.md_5.bungee.protocol.packet.Title.Action.ACTIONBAR ); ++ title.setText( ComponentSerializer.toString( message ) ); ++ unsafe.sendPacket( title ); ++ } ++ } else ++ { ++ sendMessage( position, sender, ComponentSerializer.toString( message ) ); ++ } ++ } ++ ++ @Override ++ public void sendData(String channel, byte[] data) ++ { ++ unsafe().sendPacket( new PluginMessage( channel, data, forgeClientHandler.isForgeUser() ) ); ++ } ++ ++ @Override ++ public InetSocketAddress getAddress() ++ { ++ return (InetSocketAddress) getSocketAddress(); ++ } ++ ++ @Override ++ public SocketAddress getSocketAddress() ++ { ++ return ch.getRemoteAddress(); ++ } ++ ++ @Override ++ public Collection getGroups() ++ { ++ return Collections.unmodifiableCollection( groups ); ++ } ++ ++ @Override ++ public void addGroups(String... groups) ++ { ++ for ( String group : groups ) ++ { ++ this.groups.add( group ); ++ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) ++ { ++ setPermission( permission, true ); ++ } ++ } ++ } ++ ++ @Override ++ public void removeGroups(String... groups) ++ { ++ for ( String group : groups ) ++ { ++ this.groups.remove( group ); ++ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) ++ { ++ setPermission( permission, false ); ++ } ++ } ++ } ++ ++ @Override ++ public boolean hasPermission(String permission) ++ { ++ return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission(); ++ } ++ ++ @Override ++ public void setPermission(String permission, boolean value) ++ { ++ if ( value ) ++ { ++ permissions.add( permission ); ++ } else ++ { ++ permissions.remove( permission ); ++ } ++ } ++ ++ @Override ++ public Collection getPermissions() ++ { ++ return Collections.unmodifiableCollection( permissions ); ++ } ++ ++ @Override ++ public String toString() ++ { ++ return name; ++ } ++ ++ @Override ++ public Unsafe unsafe() ++ { ++ return unsafe; ++ } ++ ++ @Override ++ public String getUUID() ++ { ++ return getPendingConnection().getUUID(); ++ } ++ ++ @Override ++ public UUID getUniqueId() ++ { ++ return getPendingConnection().getUniqueId(); ++ } ++ ++ public void setSettings(ClientSettings settings) ++ { ++ this.settings = settings; ++ this.locale = null; ++ } ++ ++ @Override ++ public Locale getLocale() ++ { ++ return ( locale == null && settings != null ) ? locale = Locale.forLanguageTag( settings.getLocale().replace( '_', '-' ) ) : locale; ++ } ++ ++ @Override ++ public byte getViewDistance() ++ { ++ return ( settings != null ) ? settings.getViewDistance() : 10; ++ } ++ ++ @Override ++ public ProxiedPlayer.ChatMode getChatMode() ++ { ++ if ( settings == null ) ++ { ++ return ProxiedPlayer.ChatMode.SHOWN; ++ } ++ ++ switch ( settings.getChatFlags() ) ++ { ++ default: ++ case 0: ++ return ProxiedPlayer.ChatMode.SHOWN; ++ case 1: ++ return ProxiedPlayer.ChatMode.COMMANDS_ONLY; ++ case 2: ++ return ProxiedPlayer.ChatMode.HIDDEN; ++ } ++ } ++ ++ @Override ++ public boolean hasChatColors() ++ { ++ return settings == null || settings.isChatColours(); ++ } ++ ++ @Override ++ public SkinConfiguration getSkinParts() ++ { ++ return ( settings != null ) ? new PlayerSkinConfiguration( settings.getSkinParts() ) : PlayerSkinConfiguration.SKIN_SHOW_ALL; ++ } ++ ++ @Override ++ public ProxiedPlayer.MainHand getMainHand() ++ { ++ return ( settings == null || settings.getMainHand() == 1 ) ? ProxiedPlayer.MainHand.RIGHT : ProxiedPlayer.MainHand.LEFT; ++ } ++ ++ @Override ++ public boolean isForgeUser() ++ { ++ return forgeClientHandler.isForgeUser(); ++ } ++ ++ @Override ++ public Map getModList() ++ { ++ if ( forgeClientHandler.getClientModList() == null ) ++ { ++ // Return an empty map, rather than a null, if the client hasn't got any mods, ++ // or is yet to complete a handshake. ++ return ImmutableMap.of(); ++ } ++ ++ return ImmutableMap.copyOf( forgeClientHandler.getClientModList() ); ++ } ++ ++ @Override ++ public void setTabHeader(BaseComponent header, BaseComponent footer) ++ { ++ header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; ++ footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; ++ ++ unsafe().sendPacket( new PlayerListHeaderFooter( ++ ComponentSerializer.toString( header ), ++ ComponentSerializer.toString( footer ) ++ ) ); ++ } ++ ++ @Override ++ public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) ++ { ++ header = ChatComponentTransformer.getInstance().transform( this, true, header ); ++ footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); ++ ++ unsafe().sendPacket( new PlayerListHeaderFooter( ++ ComponentSerializer.toString( header ), ++ ComponentSerializer.toString( footer ) ++ ) ); ++ } ++ ++ @Override ++ public void resetTabHeader() ++ { ++ // Mojang did not add a way to remove the header / footer completely, we can only set it to empty ++ setTabHeader( (BaseComponent) null, null ); ++ } ++ ++ @Override ++ public void sendTitle(Title title) ++ { ++ title.send( this ); ++ } ++ ++ public String getExtraDataInHandshake() ++ { ++ return this.getPendingConnection().getExtraDataInHandshake(); ++ } ++ ++ public void setCompressionThreshold(int compressionThreshold) ++ { ++ if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) ++ { ++ this.compressionThreshold = compressionThreshold; ++ unsafe.sendPacket( new SetCompression( compressionThreshold ) ); ++ ch.setCompressionThreshold( compressionThreshold ); ++ } ++ } ++ ++ @Override ++ public boolean isConnected() ++ { ++ return !ch.isClosed(); ++ } ++ ++ @Override ++ public Scoreboard getScoreboard() ++ { ++ return serverSentScoreboard; ++ } ++ ++ // Waterfall start ++ public boolean isDisableEntityMetadataRewrite() { ++ return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE; ++ } ++ // Waterfall end ++} 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 index 97c4b210..a0b03ec1 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index c6549764..09a150f1 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 4487e175bf2121239ffe3d12bb584c51fddb3e09 Mon Sep 17 00:00:00 2001 +From fe19c98e455af24d9970a73215de3b651545d919 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -121,7 +121,7 @@ index 6dc5633f..5c05f2b9 100644 } 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 96704d5e..654203ab 100644 +index 2a21243b..a95193ba 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -132,7 +132,7 @@ index 96704d5e..654203ab 100644 import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; -@@ -102,6 +103,14 @@ public class PipelineUtils +@@ -98,6 +99,14 @@ public class PipelineUtils BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); } @@ -147,7 +147,7 @@ index 96704d5e..654203ab 100644 }; public static final Base BASE = new Base(); private static final KickStringWriter legacyKicker = new KickStringWriter(); -@@ -196,5 +205,13 @@ public class PipelineUtils +@@ -192,5 +201,13 @@ public class PipelineUtils ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); } @@ -162,7 +162,7 @@ index 96704d5e..654203ab 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b3bdfd05 100644 +index b2b19996..b1ecb7ef 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 4d55418b..056f73bf 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From d22662f6826b0cced8e7cd3c4052fb87b502d0d7 Mon Sep 17 00:00:00 2001 +From a102b1a867083a5fa6873b59eb015dfdddf651fd Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0de754d5..a09d6baf 100644 +index 0b02ae7d..774439c5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -251,7 +251,7 @@ index 0de754d5..a09d6baf 100644 if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -577,9 +589,7 @@ public class BungeeCord extends ProxyServer +@@ -574,9 +586,7 @@ public class BungeeCord extends ProxyServer String translation = ""; try { @@ -285,7 +285,7 @@ index 2ee16684..3a41769a 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 935d2e30..e8eb555c 100644 +index 5cc50806..ff9fd071 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -353,7 +353,7 @@ index a409d440..3503c089 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 33605007..89a6d14a 100644 +index 675fa8f1..c8748ce5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -366,7 +366,7 @@ index 33605007..89a6d14a 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 654203ab..a840bc70 100644 +index a95193ba..a4c3bd71 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,8 @@ diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch index e10ddcc4..d2167fa9 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From c701401d36a6cee1d4ba6a651eaec3148939b62c Mon Sep 17 00:00:00 2001 +From 27bc5adef578e2afe6d9d13d9bf6c9869d5af691 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -87,7 +87,7 @@ index 00000000..6c5bb961 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a09d6baf..ed5ce6e6 100644 +index 774439c5..b6ecffc3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -134,7 +134,7 @@ index a09d6baf..ed5ce6e6 100644 saveThread.scheduleAtFixedRate( new TimerTask() { -@@ -831,4 +842,53 @@ public class BungeeCord extends ProxyServer +@@ -828,4 +839,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index 543bd025..9e8e01bd 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From a2394941af909d50114567bebc428ee13099578d Mon Sep 17 00:00:00 2001 +From cb76c6ea58a87229b54a1459474f8d622f970262 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -200,10 +200,10 @@ index 91d60bfb..cc76325b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ed5ce6e6..18c53872 100644 +index b6ecffc3..62cd066d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -597,14 +597,8 @@ public class BungeeCord extends ProxyServer +@@ -594,14 +594,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 602d03f4..a39182b9 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,4 +1,4 @@ -From d520f9c83d7a5a455fd08bfa57f598140f512024 Mon Sep 17 00:00:00 2001 +From 4604b7da5875a338c84ebe9d8ed00491178890f6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open @@ -28,10 +28,10 @@ index 25716fa7..a77cecf0 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); 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 a840bc70..f4bf745c 100644 +index a4c3bd71..ffea1599 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 -@@ -198,6 +198,8 @@ public class PipelineUtils +@@ -194,6 +194,8 @@ public class PipelineUtils // IP_TOS is not supported (Windows XP / Windows Server 2003) } ch.config().setOption( ChannelOption.TCP_NODELAY, true ); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index ce3d8f2d..254c53b6 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From f46da0d9a58d8a72acf3e144b6e59d96ca0c3aca Mon Sep 17 00:00:00 2001 +From f29028455593a9899431f5cb3631cd176c6c958a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1093,7 +1093,7 @@ index e354032a..976c37e1 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index cef44d8a..8fe2b37f 100644 +index 20c4c0a4..a2086b45 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -1111,10 +1111,10 @@ index cef44d8a..8fe2b37f 100644 logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; 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 f4bf745c..eaedb459 100644 +index ffea1599..eacc8aae 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 -@@ -63,6 +63,14 @@ public class PipelineUtils +@@ -59,6 +59,14 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index 03e402c0..4dad7382 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 05caaeafd1d30cd331e17dd438d21f8d7505890a Mon Sep 17 00:00:00 2001 +From 6ea893947c44bc8002a84ca44e31dfc636c0bde0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -324,7 +324,7 @@ index 3a41769a..d2bf095a 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); 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 e8eb555c..723b004a 100644 +index ff9fd071..c3e9d24b 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -43,7 +43,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -353,7 +353,7 @@ index e8eb555c..723b004a 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -771,10 +766,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -772,10 +767,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } diff --git a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch index 4e74ab48..9e8c8782 100644 --- a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch +++ b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch @@ -1,11 +1,11 @@ -From d63d977ab6d6bdb5591bc838fc96fae5394298f5 Mon Sep 17 00:00:00 2001 +From e5ad77a97d771020af50ba542a3d5563a8bac0ad Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Mon, 25 Apr 2022 04:25:32 +0200 Subject: [PATCH] Dont show extra info in connect errors diff --git a/api/src/main/java/net/md_5/bungee/Util.java b/api/src/main/java/net/md_5/bungee/Util.java -index 70bf87f7..df5f33d1 100644 +index 70bf87f7..fdac341b 100644 --- a/api/src/main/java/net/md_5/bungee/Util.java +++ b/api/src/main/java/net/md_5/bungee/Util.java @@ -92,23 +92,11 @@ public class Util @@ -35,7 +35,7 @@ index 70bf87f7..df5f33d1 100644 public static String csv(Iterable objects) 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 723b004a..725896ff 100644 +index c3e9d24b..725896ff 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap; @@ -46,11 +46,12 @@ index 723b004a..725896ff 100644 import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelInitializer; -@@ -399,7 +400,13 @@ public final class UserConnection implements ProxiedPlayer +@@ -399,8 +400,13 @@ public final class UserConnection implements ProxiedPlayer private String connectionFailMessage(Throwable cause) { -- return Util.exception( cause, false ); +- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall +- return ""; // Waterfall + if ( cause instanceof ConnectTimeoutException ) + { + return bungee.getTranslation( "timeout" ); @@ -62,5 +63,5 @@ index 723b004a..725896ff 100644 @Override -- -2.34.1.windows.1 +2.32.0 From 396e163fdf25fbfa78e5fb861cee832511e5e91d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 26 Apr 2022 09:48:17 -0300 Subject: [PATCH 264/499] Use Waterfall Implementation --- ...nt-show-extra-info-in-connect-errors.patch | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch diff --git a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch b/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch deleted file mode 100644 index 9e8c8782..00000000 --- a/Waterfall-Proxy-Patches/0033-Dont-show-extra-info-in-connect-errors.patch +++ /dev/null @@ -1,67 +0,0 @@ -From e5ad77a97d771020af50ba542a3d5563a8bac0ad Mon Sep 17 00:00:00 2001 -From: xIsm4 -Date: Mon, 25 Apr 2022 04:25:32 +0200 -Subject: [PATCH] Dont show extra info in connect errors - - -diff --git a/api/src/main/java/net/md_5/bungee/Util.java b/api/src/main/java/net/md_5/bungee/Util.java -index 70bf87f7..fdac341b 100644 ---- a/api/src/main/java/net/md_5/bungee/Util.java -+++ b/api/src/main/java/net/md_5/bungee/Util.java -@@ -92,23 +92,11 @@ public class Util - */ - public static String exception(Throwable t) - { -- return exception( t, true ); -- } -- -- /** -- * Constructs a pretty one line version of a {@link Throwable}. Useful for -- * debugging. -- * -- * @param t the {@link Throwable} to format. -- * @param includeLineNumbers whether to include line numbers -- * @return a string representing information about the {@link Throwable} -- */ -- public static String exception(Throwable t, boolean includeLineNumbers) -- { -+ // FlameCord - remove aditional information - // TODO: We should use clear manually written exceptions - StackTraceElement[] trace = t.getStackTrace(); - return t.getClass().getSimpleName() + " : " + t.getMessage() -- + ( ( includeLineNumbers && trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" ); -+ + ( (trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" ); - } - - public static String csv(Iterable objects) -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 c3e9d24b..725896ff 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap; - import com.google.common.collect.Multimap; - import io.netty.bootstrap.Bootstrap; - import io.netty.channel.Channel; -+import io.netty.channel.ConnectTimeoutException; - import io.netty.channel.ChannelFuture; - import io.netty.channel.ChannelFutureListener; - import io.netty.channel.ChannelInitializer; -@@ -399,8 +400,13 @@ public final class UserConnection implements ProxiedPlayer - - private String connectionFailMessage(Throwable cause) - { -- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall -- return ""; // Waterfall -+ if ( cause instanceof ConnectTimeoutException ) -+ { -+ return bungee.getTranslation( "timeout" ); -+ } else -+ { -+ return cause.getClass().getName(); -+ } - } - - @Override --- -2.32.0 - From 8bd7462b9d4245efd29bd67bdc82780bdbf2aaa7 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Tue, 26 Apr 2022 15:42:59 +0200 Subject: [PATCH 265/499] Make connection error toggleable. --- ...033-Make-connection-error-toggleable.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch diff --git a/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch b/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch new file mode 100644 index 00000000..156c5e06 --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch @@ -0,0 +1,56 @@ +From 887dde9d8163212432a974a65b8c433eb4f3dca5 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Tue, 26 Apr 2022 15:41:57 +0200 +Subject: [PATCH] Make connection error toggleable + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index d2fa6216..625df19c 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -201,6 +201,8 @@ public class FlameCordConfiguration extends FlameConfig { + private boolean loggerDump = false; + @Getter + private boolean loggerHaProxy = false; ++ @Getter ++ private boolean loggerDetailedConnection = false; + + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + try { +@@ -236,7 +238,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); +- this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + + configurationProvider.save(configuration, configurationFile); + } catch (final IOException e) { +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 c3e9d24b..6131d7ea 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; + import com.google.common.collect.HashMultimap; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multimap; ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFuture; +@@ -399,7 +400,10 @@ public final class UserConnection implements ProxiedPlayer + + private String connectionFailMessage(Throwable cause) + { +- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall ++ //FlameCord - Allow for toggle the logging of connection failures ++ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { ++ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ } + return ""; // Waterfall + } + +-- +2.34.1.windows.1 + From 309c99a2a8246e131c2d9f12a2ca44010b07f4fe Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 26 Apr 2022 10:50:57 -0300 Subject: [PATCH 266/499] Merge Patch 33 w/logger options --- .../0022-FlameCord-logger-options.patch | 39 +++++++++++-- .../0026-Custom-motd-system.patch | 6 +- .../0027-TCP-Fast-Open.patch | 6 +- .../0029-Antibot-System.patch | 6 +- .../0030-Allow-Invalid-Names.patch | 6 +- ...0032-Disable-entity-Metadata-Rewrite.patch | 12 ++-- ...033-Make-connection-error-toggleable.patch | 56 ------------------- 7 files changed, 51 insertions(+), 80 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 5ed25b75..e1c6ff16 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,14 +1,14 @@ -From d49ffb31a988bab4c7b0d2e2b652f65ce240c087 Mon Sep 17 00:00:00 2001 +From 8b4d2b4a334c1c60e707e785f16dfc6422b02854 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c8148e90..701db67c 100644 +index c8148e90..c327841a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,15 @@ import net.md_5.bungee.config.Configuration; +@@ -12,6 +12,17 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -20,22 +20,49 @@ index c8148e90..701db67c 100644 + private boolean loggerDump = false; + @Getter + private boolean loggerHaProxy = false; ++ @Getter ++ private boolean loggerDetailedConnection = false; + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { try { final String fileName = "./flamecord.yml"; -@@ -25,6 +34,11 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -25,6 +36,12 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); + this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + configurationProvider.save(configuration, configurationFile); } catch (final IOException e) { e.printStackTrace(); +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 ff9fd071..849b4774 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; + import com.google.common.collect.HashMultimap; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multimap; ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFuture; +@@ -404,7 +405,10 @@ public final class UserConnection implements ProxiedPlayer + + private String connectionFailMessage(Throwable cause) + { +- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall ++ //FlameCord - Allow for toggle the logging of connection failures ++ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { ++ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ } + return ""; // Waterfall + } + 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 39c54cf1..cfd6249e 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -61,7 +88,7 @@ index 39c54cf1..cfd6249e 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 89a6d14a..8eda3110 100644 +index c8748ce5..778deb63 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 033d9fc7..89ac5d90 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From e4f068cdf525de91cca34a4cc493303acbe1dec4 Mon Sep 17 00:00:00 2001 +From 0253c8d3380bbee90deda46a1abfac43d326466d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,7 +20,7 @@ index cfbd55c3..360305b9 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 701db67c..25716fa7 100644 +index c327841a..de2cc947 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,80 @@ package dev._2lstudios.flamecord.configuration; @@ -104,7 +104,7 @@ index 701db67c..25716fa7 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -34,6 +99,19 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +101,19 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index a39182b9..51059b89 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 4604b7da5875a338c84ebe9d8ed00491178890f6 Mon Sep 17 00:00:00 2001 +From ca72ee92ce1d192bfd4551116eab80a9efa69bee Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 25716fa7..a77cecf0 100644 +index de2cc947..5d92c20c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 25716fa7..a77cecf0 100644 private List colors(final List strings) { for (int i = 0; i < strings.size(); i++) { strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -111,6 +115,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -113,6 +117,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 254c53b6..f07fef21 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From f29028455593a9899431f5cb3631cd176c6c958a Mon Sep 17 00:00:00 2001 +From e5616ba6e102d223ec1d68f70df71d3a5a70bee0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -761,7 +761,7 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a77cecf0..9ace4ff5 100644 +index 5d92c20c..53e5ecee 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,114 @@ import net.md_5.bungee.config.Configuration; @@ -879,7 +879,7 @@ index a77cecf0..9ace4ff5 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -115,6 +223,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +225,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 37ea18e7..a653270f 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 979e4625e5efa8e34d885f6e7ce02dae8d008161 Mon Sep 17 00:00:00 2001 +From d30a65a70532afd6c6385f39bd708454274448a7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9ace4ff5..d2fa6216 100644 +index 53e5ecee..625df19c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9ace4ff5..d2fa6216 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -223,6 +227,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -225,6 +229,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index 4dad7382..ddb7de28 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 6ea893947c44bc8002a84ca44e31dfc636c0bde0 Mon Sep 17 00:00:00 2001 +From bad778afeee50f6043077174f44ee97afcc8bd5b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -324,10 +324,10 @@ index 3a41769a..d2bf095a 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); 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 ff9fd071..c3e9d24b 100644 +index 849b4774..6131d7ea 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -43,7 +43,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; +@@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; import net.md_5.bungee.api.score.Scoreboard; import net.md_5.bungee.chat.ComponentSerializer; import net.md_5.bungee.connection.InitialHandler; @@ -335,7 +335,7 @@ index ff9fd071..c3e9d24b 100644 import net.md_5.bungee.forge.ForgeClientHandler; import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.forge.ForgeServerHandler; -@@ -135,8 +134,6 @@ public final class UserConnection implements ProxiedPlayer +@@ -136,8 +135,6 @@ public final class UserConnection implements ProxiedPlayer /*========================================================================*/ @Getter private String displayName; @@ -344,7 +344,7 @@ index ff9fd071..c3e9d24b 100644 private Locale locale; /*========================================================================*/ @Getter -@@ -157,8 +154,6 @@ public final class UserConnection implements ProxiedPlayer +@@ -158,8 +155,6 @@ public final class UserConnection implements ProxiedPlayer public void init() { @@ -353,7 +353,7 @@ index ff9fd071..c3e9d24b 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -772,10 +767,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -776,10 +771,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } diff --git a/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch b/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch deleted file mode 100644 index 156c5e06..00000000 --- a/Waterfall-Proxy-Patches/0033-Make-connection-error-toggleable.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 887dde9d8163212432a974a65b8c433eb4f3dca5 Mon Sep 17 00:00:00 2001 -From: xIsm4 -Date: Tue, 26 Apr 2022 15:41:57 +0200 -Subject: [PATCH] Make connection error toggleable - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d2fa6216..625df19c 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -201,6 +201,8 @@ public class FlameCordConfiguration extends FlameConfig { - private boolean loggerDump = false; - @Getter - private boolean loggerHaProxy = false; -+ @Getter -+ private boolean loggerDetailedConnection = false; - - public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { - try { -@@ -236,7 +238,8 @@ public class FlameCordConfiguration extends FlameConfig { - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); - this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -- this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); - - configurationProvider.save(configuration, configurationFile); - } catch (final IOException e) { -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 c3e9d24b..6131d7ea 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; - import com.google.common.collect.HashMultimap; - import com.google.common.collect.ImmutableMap; - import com.google.common.collect.Multimap; -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.bootstrap.Bootstrap; - import io.netty.channel.Channel; - import io.netty.channel.ChannelFuture; -@@ -399,7 +400,10 @@ public final class UserConnection implements ProxiedPlayer - - private String connectionFailMessage(Throwable cause) - { -- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall -+ //FlameCord - Allow for toggle the logging of connection failures -+ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { -+ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall -+ } - return ""; // Waterfall - } - --- -2.34.1.windows.1 - From ee8dee236edc6ab9e63340eff2902ef62310c8bd Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 26 Apr 2022 10:51:38 -0300 Subject: [PATCH 267/499] 0.8.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 7b712c0e..478df72a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.5"; ++ return "0.8.6"; } public void reloadMessages() From 2af084aaec4c53a1ed58d8819bdf5434fc7c5eab Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 26 Apr 2022 11:20:44 -0300 Subject: [PATCH 268/499] Command List Format --- .../0033-Command-List-Format.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0033-Command-List-Format.patch diff --git a/Waterfall-Proxy-Patches/0033-Command-List-Format.patch b/Waterfall-Proxy-Patches/0033-Command-List-Format.patch new file mode 100644 index 00000000..4e01d8e0 --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Command-List-Format.patch @@ -0,0 +1,34 @@ +From f1f00b0c2e5d89472ad23b951181797c55b92424 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 26 Apr 2022 10:58:11 -0300 +Subject: [PATCH] Command List Format + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index ee0295c7..1ba8c8a5 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -35,6 +35,7 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); + setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); + setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list_format", "&aServers:&r", configuration); + setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); + setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); + setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); +diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +index c2227110..d9c8e352 100644 +--- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java ++++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +@@ -25,6 +25,8 @@ public class CommandList extends Command + @Override + public void execute(CommandSender sender, String[] args) + { ++ sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format" ) ); ++ + for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) + { + if ( !server.canAccess( sender ) ) +-- +2.32.0 + From c3fd987ec683164d3c386724b9b5d6b3048dd7df Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Sat, 30 Apr 2022 12:54:50 +0200 Subject: [PATCH 269/499] Fix brand not displayed (#120) --- .../0004-1.7.x-support.patch | 19 ++++++++----------- ...0032-Disable-entity-Metadata-Rewrite.patch | 8 ++++---- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 1e4f6e0d..274c5ce1 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 2c965a41d72b044e78b263ce969bfd91a14062ba Mon Sep 17 00:00:00 2001 +From 8369e2e37828ebdb3448b61a3a484dcf25e813a7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -1021,7 +1021,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 15a639de..0b02ae7d 100644 +index 11b62d81..5ef34fcb 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1982,7 +1982,7 @@ index 00000000..7c52ee9a + // Waterfall end +} 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 -index 97c4b210..a0b03ec1 100644 +index 97c4b210..6082d40c 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; @@ -2011,7 +2011,7 @@ index 97c4b210..a0b03ec1 100644 } break; default: -@@ -292,19 +293,28 @@ public class DownstreamBridge extends PacketHandler +@@ -292,16 +293,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -2025,9 +2025,6 @@ index 97c4b210..a0b03ec1 100644 - DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall - pluginMessage.setData( brand ); - brand.release(); -- // changes in the packet are ignored so we need to send it manually -- con.unsafe().sendPacket( pluginMessage ); -- throw CancelSendSignal.INSTANCE; + // FlameCord start - 1.7.x support + if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) + { @@ -2050,9 +2047,9 @@ index 97c4b210..a0b03ec1 100644 + pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord - 1.7.x support + } + // FlameCord end - 1.7.x support - } - - if ( pluginMessage.getTag().equals( "BungeeCord" ) ) + // changes in the packet are ignored so we need to send it manually + con.unsafe().sendPacket( pluginMessage ); + throw CancelSendSignal.INSTANCE; 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 4afab05d..f6378e03 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -2507,5 +2504,5 @@ index daf12f74..7d053485 100644 @Override -- -2.32.0 +2.36.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index ddb7de28..d8205881 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From bad778afeee50f6043077174f44ee97afcc8bd5b Mon Sep 17 00:00:00 2001 +From 27d447c5af7941b6a84a2fed75d742a434a128f3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -365,7 +365,7 @@ index 849b4774..6131d7ea 100644 - // Waterfall end } 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 -index a0b03ec1..20adce50 100644 +index 6082d40c..194ada04 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -397,7 +397,7 @@ index a0b03ec1..20adce50 100644 con.sendPacket( packet ); } -@@ -685,34 +677,6 @@ public class DownstreamBridge extends PacketHandler +@@ -688,34 +680,6 @@ public class DownstreamBridge extends PacketHandler } } @@ -3230,5 +3230,5 @@ index caed4384..af428090 100644 } -- -2.32.0 +2.36.0.windows.1 From 04f19f244421de8b4d0e603c2d17ea12fd9e0536 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Mon, 2 May 2022 14:56:56 -0300 Subject: [PATCH 270/499] Extra Information --- .../0029-Antibot-System.patch | 83 ++++++++++++++----- 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index f07fef21..dbcb96c6 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From e5616ba6e102d223ec1d68f70df71d3a5a70bee0 Mon Sep 17 00:00:00 2001 +From 3ccc4c5dfc0f960aa55b79124c1643b7f6fcfc04 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,10 +22,10 @@ index f4bf5ec6..4a0d8e5d 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..dfee9bf8 +index 00000000..89323f4b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java -@@ -0,0 +1,36 @@ +@@ -0,0 +1,40 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -51,6 +51,10 @@ index 00000000..dfee9bf8 + if (nicknames.size() > config.getAntibotAccountsLimit()) { + nicknames.remove(nickname); + ++ if (config.isAntibotAccountsLog()) { ++ System.out.println("[FlameCord] The player [" + nickname + "] has too many accounts!"); ++ } ++ + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -64,10 +68,10 @@ index 00000000..dfee9bf8 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..cd8220d1 +index 00000000..c53a46d0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,149 @@ +@@ -0,0 +1,153 @@ +package dev._2lstudios.antibot; + +import java.io.IOException; @@ -190,6 +194,10 @@ index 00000000..cd8220d1 + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { + Runtime runtime = Runtime.getRuntime(); + ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog()) { ++ System.out.println("[FlameCord] The IP [" + hostString + "] was blacklisted!"); ++ } ++ + try { + runtime.exec("ipset add flamecord_blacklist " + hostString); + } catch (IOException exception) { @@ -297,10 +305,10 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..5cb5021a +index 00000000..bc589302 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java -@@ -0,0 +1,140 @@ +@@ -0,0 +1,145 @@ +package dev._2lstudios.antibot; + +import java.io.File; @@ -430,7 +438,12 @@ index 00000000..5cb5021a + } + + if (country != null && isBlacklisted(config, country)) { -+ if (config.isAntibotNicknameFirewall()) { ++ if (config.isAntibotCountryLog()) { ++ System.out.println("[FlameCord] The IP [" + addressData.getHostString() ++ + "] comes from a blocked country! [" + country + "]"); ++ } ++ ++ if (config.isAntibotCountryFirewall()) { + addressData.firewall(); + } + @@ -443,10 +456,10 @@ index 00000000..5cb5021a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..76902c27 +index 00000000..927c1de3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,37 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -468,6 +481,11 @@ index 00000000..76902c27 + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + + if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { ++ if (config.isAntibotFastChatLog()) { ++ System.out.println( ++ "[FlameCord] The IP [" + addressData.getHostString() + "] is using the chat too fast!"); ++ } ++ + if (config.isAntibotFastChatFirewall()) { + addressData.firewall(); + } @@ -529,10 +547,10 @@ index 00000000..d3b77f03 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..f9b1ad70 +index 00000000..9105cdf4 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,47 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -565,6 +583,10 @@ index 00000000..f9b1ad70 + final String nickname = addressData.getLastNickname(); + + if (isBlacklisted(config, nickname)) { ++ if (config.isAntibotNicknameLog()) { ++ System.out.println("[FlameCord] The player [" + nickname + "] has a blacklisted nickname!"); ++ } ++ + if (config.isAntibotNicknameFirewall()) { + addressData.firewall(); + } @@ -578,10 +600,10 @@ index 00000000..f9b1ad70 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..8ffe1e21 +index 00000000..ff1708cc --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java -@@ -0,0 +1,62 @@ +@@ -0,0 +1,66 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -628,6 +650,10 @@ index 00000000..8ffe1e21 + updatePassword(config, nickname, password); + + if (repeatCount >= config.getAntibotPasswordLimit()) { ++ if (config.isAntibotPasswordLog()) { ++ System.out.println("[FlameCord] The player [" + nickname + "] has a repeated password!"); ++ } ++ + if (config.isAntibotPasswordFirewall()) { + addressData.firewall(); + } @@ -646,10 +672,10 @@ index 00000000..8ffe1e21 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..f9ab936b +index 00000000..c236160a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,38 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -672,6 +698,11 @@ index 00000000..f9ab936b + + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { ++ if (config.isAntibotRatelimitLog()) { ++ System.out.println( ++ "[FlameCord] The IP [" + addressData.getHostString() + "] is connecting too fast!"); ++ } ++ + if (config.isAntibotRatelimitFirewall()) { + addressData.firewall(); + } @@ -685,10 +716,10 @@ index 00000000..f9ab936b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..f958a6f2 +index 00000000..f0c72962 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,41 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -708,13 +739,21 @@ index 00000000..f958a6f2 + + if (config.isAntibotReconnectEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); -+ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() || addressData.getTotalPings() < config.getAntibotReconnectPings(); -+ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config.getAntibotReconnectMaxTime(); ++ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() ++ || addressData.getTotalPings() < config.getAntibotReconnectPings(); ++ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config ++ .getAntibotReconnectMaxTime(); + + if (tooSlow) { + addressData.setTotalConnections(0); -+ return false; ++ return true; + } else { ++ if (config.isAntibotReconnectLog() && needsAttempts) { ++ System.out.println( ++ "[FlameCord] The IP [" + addressData.getHostString() ++ + "] needs to reconnect before joining!"); ++ } ++ + return needsAttempts; + } + } @@ -1130,5 +1169,5 @@ index ffea1599..eacc8aae 100644 { ch.close(); -- -2.32.0 +2.34.1 From 49dd1b673daa0099aae63c098583b9515b90acc6 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 2 May 2022 14:57:29 -0300 Subject: [PATCH 271/499] 0.8.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 478df72a..f53e9fab 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.6"; ++ return "0.8.7"; } public void reloadMessages() From b7ff8f339047efe510aa0204009e5d5a82ec934a Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Mon, 2 May 2022 16:00:25 -0300 Subject: [PATCH 272/499] Fix small issues --- .../0004-1.7.x-support.patch | 888 +----------------- 1 file changed, 2 insertions(+), 886 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 274c5ce1..c44caad8 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 8369e2e37828ebdb3448b61a3a484dcf25e813a7 Mon Sep 17 00:00:00 2001 +From 8cb0f498248681df39f0802cacb07c3053d7f4cf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -741,112 +741,6 @@ index 91f71c09..57a82d29 100644 writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); buf.writeBytes( data ); } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig -new file mode 100644 -index 00000000..91f71c09 ---- /dev/null -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java.orig -@@ -0,0 +1,100 @@ -+package net.md_5.bungee.protocol.packet; -+ -+import com.google.common.base.Function; -+import com.google.common.base.Preconditions; -+import io.netty.buffer.ByteBuf; -+import io.netty.buffer.ByteBufUtil; // Waterfall -+import java.io.ByteArrayInputStream; -+import java.io.DataInput; -+import java.io.DataInputStream; -+import java.util.Locale; -+import lombok.AllArgsConstructor; -+import lombok.Data; -+import lombok.EqualsAndHashCode; -+import lombok.NoArgsConstructor; -+import net.md_5.bungee.protocol.AbstractPacketHandler; -+import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; -+ -+@Data -+@NoArgsConstructor -+@AllArgsConstructor -+@EqualsAndHashCode(callSuper = false) -+public class PluginMessage extends DefinedPacket -+{ -+ -+ public static final Function MODERNISE = new Function() -+ { -+ @Override -+ public String apply(String tag) -+ { -+ // Transform as per Bukkit -+ if ( tag.equals( "BungeeCord" ) ) -+ { -+ return "bungeecord:main"; -+ } -+ if ( tag.equals( "bungeecord:main" ) ) -+ { -+ return "BungeeCord"; -+ } -+ -+ // Code that gets to here is UNLIKELY to be viable on the Bukkit side of side things, -+ // but we keep it anyway. It will eventually be enforced API side. -+ if ( tag.indexOf( ':' ) != -1 ) -+ { -+ return tag; -+ } -+ -+ return "legacy:" + tag.toLowerCase( Locale.ROOT ); -+ } -+ }; -+ -+ public PluginMessage(String tag, ByteBuf data, boolean allowExtendedPacket) { -+ this(tag, ByteBufUtil.getBytes(data), allowExtendedPacket); -+ } -+ -+ private String tag; -+ private byte[] data; -+ -+ public void setData(byte[] data) { -+ this.data = Preconditions.checkNotNull(data, "Null data"); -+ } -+ -+ public void setData(ByteBuf buf) { -+ Preconditions.checkNotNull(buf, "Null buffer"); -+ setData(ByteBufUtil.getBytes(buf)); -+ } -+ -+ /** -+ * Allow this packet to be sent as an "extended" packet. -+ */ -+ private boolean allowExtendedPacket = false; -+ -+ @Override -+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); -+ int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000; -+ Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" ); -+ data = new byte[ buf.readableBytes() ]; -+ buf.readBytes( data ); -+ } -+ -+ @Override -+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) -+ { -+ writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); -+ buf.writeBytes( data ); -+ } -+ -+ @Override -+ public void handle(AbstractPacketHandler handler) throws Exception -+ { -+ handler.handle( this ); -+ } -+ -+ public DataInput getStream() -+ { -+ return new DataInputStream( new ByteArrayInputStream( data ) ); -+ } -+} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java index 3c7905d5..75b371e9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -1203,784 +1097,6 @@ index 7c52ee9a..fe73e6e8 100644 if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) { this.compressionThreshold = compressionThreshold; -diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig -new file mode 100644 -index 00000000..7c52ee9a ---- /dev/null -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java.orig -@@ -0,0 +1,772 @@ -+package net.md_5.bungee; -+ -+import com.google.common.base.Preconditions; -+import com.google.common.collect.HashMultimap; -+import com.google.common.collect.ImmutableMap; -+import com.google.common.collect.Multimap; -+import io.netty.bootstrap.Bootstrap; -+import io.netty.channel.Channel; -+import io.netty.channel.ChannelFuture; -+import io.netty.channel.ChannelFutureListener; -+import io.netty.channel.ChannelInitializer; -+import io.netty.channel.ChannelOption; -+import io.netty.util.internal.PlatformDependent; -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.Collection; -+import java.util.Collections; -+import java.util.HashSet; -+import java.util.LinkedList; -+import java.util.Locale; -+import java.util.Map; -+import java.util.Objects; -+import java.util.Queue; -+import java.util.UUID; -+import java.util.logging.Level; -+import lombok.Getter; -+import lombok.NonNull; -+import lombok.RequiredArgsConstructor; -+import lombok.Setter; -+import net.md_5.bungee.api.Callback; -+import net.md_5.bungee.api.ChatMessageType; -+import net.md_5.bungee.api.ProxyServer; -+import net.md_5.bungee.api.ServerConnectRequest; -+import net.md_5.bungee.api.SkinConfiguration; -+import net.md_5.bungee.api.Title; -+import net.md_5.bungee.api.chat.BaseComponent; -+import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.config.ServerInfo; -+import net.md_5.bungee.api.connection.ProxiedPlayer; -+import net.md_5.bungee.api.event.PermissionCheckEvent; -+import net.md_5.bungee.api.event.ServerConnectEvent; -+import net.md_5.bungee.api.score.Scoreboard; -+import net.md_5.bungee.chat.ComponentSerializer; -+import net.md_5.bungee.connection.InitialHandler; -+import net.md_5.bungee.entitymap.EntityMap; -+import net.md_5.bungee.forge.ForgeClientHandler; -+import net.md_5.bungee.forge.ForgeConstants; -+import net.md_5.bungee.forge.ForgeServerHandler; -+import net.md_5.bungee.netty.ChannelWrapper; -+import net.md_5.bungee.netty.HandlerBoss; -+import net.md_5.bungee.netty.PipelineUtils; -+import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.MinecraftDecoder; -+import net.md_5.bungee.protocol.MinecraftEncoder; -+import net.md_5.bungee.protocol.PacketWrapper; -+import net.md_5.bungee.protocol.Protocol; -+import net.md_5.bungee.protocol.ProtocolConstants; -+import net.md_5.bungee.protocol.packet.Chat; -+import net.md_5.bungee.protocol.packet.ClientSettings; -+import net.md_5.bungee.protocol.packet.Kick; -+import net.md_5.bungee.protocol.packet.PlayerListHeaderFooter; -+import net.md_5.bungee.protocol.packet.PluginMessage; -+import net.md_5.bungee.protocol.packet.SetCompression; -+import net.md_5.bungee.tab.ServerUnique; -+import net.md_5.bungee.tab.TabList; -+import net.md_5.bungee.util.CaseInsensitiveSet; -+import net.md_5.bungee.util.ChatComponentTransformer; -+ -+@RequiredArgsConstructor -+public final class UserConnection implements ProxiedPlayer -+{ -+ -+ /*========================================================================*/ -+ @NonNull -+ private final ProxyServer bungee; -+ @NonNull -+ @Getter -+ private final ChannelWrapper ch; -+ @Getter -+ @NonNull -+ private final String name; -+ @Getter -+ private final InitialHandler pendingConnection; -+ /*========================================================================*/ -+ @Getter -+ @Setter -+ private ServerConnection server; -+ @Getter -+ @Setter -+ private Object dimension; -+ @Getter -+ @Setter -+ private boolean dimensionChange = true; -+ @Getter -+ private final Collection pendingConnects = new HashSet<>(); -+ /*========================================================================*/ -+ @Getter -+ @Setter -+ private int ping = 100; -+ @Getter -+ @Setter -+ private ServerInfo reconnectServer; -+ @Getter -+ private TabList tabListHandler; -+ @Getter -+ @Setter -+ private int gamemode; -+ @Getter -+ private int compressionThreshold = -1; -+ // Used for trying multiple servers in order -+ @Setter -+ private Queue serverJoinQueue; -+ /*========================================================================*/ -+ private final Collection groups = new CaseInsensitiveSet(); -+ private final Collection permissions = new CaseInsensitiveSet(); -+ /*========================================================================*/ -+ @Getter -+ @Setter -+ private int clientEntityId; -+ @Getter -+ @Setter -+ private int serverEntityId; -+ @Getter -+ private ClientSettings settings; -+ @Getter -+ private final Scoreboard serverSentScoreboard = new Scoreboard(); -+ @Getter -+ private final Collection sentBossBars = new HashSet<>(); -+ // Waterfall start -+ @Getter -+ private final Multimap potions = HashMultimap.create(); -+ // Waterfall end -+ /*========================================================================*/ -+ @Getter -+ private String displayName; -+ @Getter -+ private EntityMap entityRewrite; -+ private Locale locale; -+ /*========================================================================*/ -+ @Getter -+ @Setter -+ private ForgeClientHandler forgeClientHandler; -+ @Getter -+ @Setter -+ private ForgeServerHandler forgeServerHandler; -+ /*========================================================================*/ -+ private final Unsafe unsafe = new Unsafe() -+ { -+ @Override -+ public void sendPacket(DefinedPacket packet) -+ { -+ ch.write( packet ); -+ } -+ }; -+ -+ public void init() -+ { -+ this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); -+ -+ this.displayName = name; -+ -+ tabListHandler = new ServerUnique( this ); -+ -+ Collection g = bungee.getConfigurationAdapter().getGroups( name ); -+ g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) ); -+ for ( String s : g ) -+ { -+ addGroups( s ); -+ } -+ -+ forgeClientHandler = new ForgeClientHandler( this ); -+ -+ // No-config FML handshake marker. -+ // Set whether the connection has a 1.8 FML marker in the handshake. -+ if (this.getPendingConnection().getExtraDataInHandshake().contains( ForgeConstants.FML_HANDSHAKE_TOKEN )) -+ { -+ forgeClientHandler.setFmlTokenInHandshake( true ); -+ } -+ } -+ -+ public void sendPacket(PacketWrapper packet) -+ { -+ ch.write( packet ); -+ } -+ -+ @Deprecated -+ public boolean isActive() -+ { -+ return !ch.isClosed(); -+ } -+ -+ @Override -+ public void setDisplayName(String name) -+ { -+ Preconditions.checkNotNull( name, "displayName" ); -+ displayName = name; -+ } -+ -+ @Override -+ public void connect(ServerInfo target) -+ { -+ connect( target, null, ServerConnectEvent.Reason.PLUGIN ); -+ } -+ -+ @Override -+ public void connect(ServerInfo target, ServerConnectEvent.Reason reason) -+ { -+ connect( target, null, false, reason ); -+ } -+ -+ @Override -+ public void connect(ServerInfo target, Callback callback) -+ { -+ connect( target, callback, false, ServerConnectEvent.Reason.PLUGIN ); -+ } -+ -+ @Override -+ public void connect(ServerInfo target, Callback callback, ServerConnectEvent.Reason reason) -+ { -+ connect( target, callback, false, reason ); -+ } -+ -+ @Deprecated -+ public void connectNow(ServerInfo target) -+ { -+ connectNow( target, ServerConnectEvent.Reason.UNKNOWN ); -+ } -+ -+ public void connectNow(ServerInfo target, ServerConnectEvent.Reason reason) -+ { -+ dimensionChange = true; -+ connect( target, reason ); -+ } -+ -+ public ServerInfo updateAndGetNextServer(ServerInfo currentTarget) -+ { -+ if ( serverJoinQueue == null ) -+ { -+ serverJoinQueue = new LinkedList<>( getPendingConnection().getListener().getServerPriority() ); -+ } -+ -+ ServerInfo next = null; -+ while ( !serverJoinQueue.isEmpty() ) -+ { -+ ServerInfo candidate = ProxyServer.getInstance().getServerInfo( serverJoinQueue.remove() ); -+ if ( !Objects.equals( currentTarget, candidate ) ) -+ { -+ next = candidate; -+ break; -+ } -+ } -+ -+ return next; -+ } -+ -+ public void connect(ServerInfo info, final Callback callback, final boolean retry) -+ { -+ connect( info, callback, retry, ServerConnectEvent.Reason.PLUGIN ); -+ } -+ -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason) -+ { -+ // Waterfall start -+ connect(info, callback, retry, reason, bungee.getConfig().getServerConnectTimeout()); -+ } -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, int timeout) { -+ connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN, timeout); -+ } -+ -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout) { -+ this.connect(info, callback, retry, reason, timeout, true); -+ } -+ -+ public void connect(ServerInfo info, final Callback callback, final boolean retry, ServerConnectEvent.Reason reason, final int timeout, boolean sendFeedback) -+ { -+ // Waterfall end -+ Preconditions.checkNotNull( info, "info" ); -+ -+ ServerConnectRequest.Builder builder = ServerConnectRequest.builder().retry( retry ).reason( reason ).target( info ).sendFeedback(sendFeedback); // Waterfall - feedback param -+ builder.connectTimeout(timeout); // Waterfall -+ if ( callback != null ) -+ { -+ // Convert the Callback to be compatible with Callback from ServerConnectRequest. -+ builder.callback( new Callback() -+ { -+ @Override -+ public void done(ServerConnectRequest.Result result, Throwable error) -+ { -+ callback.done( ( result == ServerConnectRequest.Result.SUCCESS ) ? Boolean.TRUE : Boolean.FALSE, error ); -+ } -+ } ); -+ } -+ -+ connect( builder.build() ); -+ } -+ -+ @Override -+ public void connect(final ServerConnectRequest request) -+ { -+ Preconditions.checkNotNull( request, "request" ); -+ -+ final Callback callback = request.getCallback(); -+ ServerConnectEvent event = new ServerConnectEvent( this, request.getTarget(), request.getReason(), request ); -+ if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) -+ { -+ if ( callback != null ) -+ { -+ callback.done( ServerConnectRequest.Result.EVENT_CANCEL, null ); -+ } -+ -+ if ( getServer() == null && !ch.isClosing() ) -+ { -+ throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); -+ } -+ return; -+ } -+ -+ final BungeeServerInfo target = (BungeeServerInfo) event.getTarget(); // Update in case the event changed target -+ -+ if ( getServer() != null && Objects.equals( getServer().getInfo(), target ) ) -+ { -+ if ( callback != null ) -+ { -+ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTED, null ); -+ } -+ -+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connected" ) ); // Waterfall -+ return; -+ } -+ if ( pendingConnects.contains( target ) ) -+ { -+ if ( callback != null ) -+ { -+ callback.done( ServerConnectRequest.Result.ALREADY_CONNECTING, null ); -+ } -+ -+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "already_connecting" ) ); // Waterfall -+ return; -+ } -+ -+ pendingConnects.add( target ); -+ -+ ChannelInitializer initializer = new ChannelInitializer() -+ { -+ @Override -+ protected void initChannel(Channel ch) throws Exception -+ { -+ PipelineUtils.BASE.initChannel( ch ); -+ ch.pipeline().addAfter( PipelineUtils.FRAME_DECODER, PipelineUtils.PACKET_DECODER, new MinecraftDecoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); -+ ch.pipeline().addAfter( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, new MinecraftEncoder( Protocol.HANDSHAKE, false, getPendingConnection().getVersion() ) ); -+ ch.pipeline().get( HandlerBoss.class ).setHandler( new ServerConnector( bungee, UserConnection.this, target ) ); -+ } -+ }; -+ ChannelFutureListener listener = new ChannelFutureListener() -+ { -+ @Override -+ @SuppressWarnings("ThrowableResultIgnored") -+ public void operationComplete(ChannelFuture future) throws Exception -+ { -+ if ( callback != null ) -+ { -+ callback.done( ( future.isSuccess() ) ? ServerConnectRequest.Result.SUCCESS : ServerConnectRequest.Result.FAIL, future.cause() ); -+ } -+ -+ if ( !future.isSuccess() ) -+ { -+ future.channel().close(); -+ pendingConnects.remove( target ); -+ -+ ServerInfo def = updateAndGetNextServer( target ); -+ if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) ) -+ { -+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_lobby" ) ); // Waterfall -+ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout(), request.isSendFeedback() ); // Waterfall -+ } else if ( dimensionChange ) -+ { -+ disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); -+ } else -+ { -+ if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); -+ } -+ } -+ } -+ }; -+ Bootstrap b = new Bootstrap() -+ .channel( PipelineUtils.getChannel( target.getAddress() ) ) -+ .group( ch.getHandle().eventLoop() ) -+ .handler( initializer ) -+ .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) -+ .remoteAddress( target.getAddress() ); -+ // Windows is bugged, multi homed users will just have to live with random connecting IPs -+ if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) -+ { -+ b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); -+ } -+ b.connect().addListener( listener ); -+ } -+ -+ private String connectionFailMessage(Throwable cause) -+ { -+ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall -+ return ""; // Waterfall -+ } -+ -+ @Override -+ public void disconnect(String reason) -+ { -+ disconnect0( TextComponent.fromLegacyText( reason ) ); -+ } -+ -+ @Override -+ public void disconnect(BaseComponent... reason) -+ { -+ disconnect0( reason ); -+ } -+ -+ @Override -+ public void disconnect(BaseComponent reason) -+ { -+ disconnect0( reason ); -+ } -+ -+ public void disconnect0(final BaseComponent... reason) -+ { -+ if ( !ch.isClosing() ) -+ { -+ bungee.getLogger().log( Level.INFO, "[{0}] disconnected with: {1}", new Object[] -+ { -+ getName(), BaseComponent.toLegacyText( reason ) -+ } ); -+ -+ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); -+ -+ if ( server != null ) -+ { -+ server.setObsolete( true ); -+ server.disconnect( "Quitting" ); -+ } -+ } -+ } -+ -+ @Override -+ public void chat(String message) -+ { -+ Preconditions.checkState( server != null, "Not connected to server" ); -+ server.getCh().write( new Chat( message ) ); -+ } -+ -+ @Override -+ public void sendMessage(String message) -+ { -+ sendMessage( TextComponent.fromLegacyText( message ) ); -+ } -+ -+ @Override -+ public void sendMessages(String... messages) -+ { -+ for ( String message : messages ) -+ { -+ sendMessage( message ); -+ } -+ } -+ -+ @Override -+ public void sendMessage(BaseComponent... message) -+ { -+ sendMessage( ChatMessageType.SYSTEM, message ); -+ } -+ -+ @Override -+ public void sendMessage(BaseComponent message) -+ { -+ sendMessage( ChatMessageType.SYSTEM, message ); -+ } -+ -+ @Override -+ public void sendMessage(ChatMessageType position, BaseComponent... message) -+ { -+ sendMessage( position, null, message ); -+ } -+ -+ @Override -+ public void sendMessage(ChatMessageType position, BaseComponent message) -+ { -+ sendMessage( position, (UUID) null, message ); -+ } -+ -+ @Override -+ public void sendMessage(UUID sender, BaseComponent... message) -+ { -+ sendMessage( ChatMessageType.CHAT, sender, message ); -+ } -+ -+ @Override -+ public void sendMessage(UUID sender, BaseComponent message) -+ { -+ sendMessage( ChatMessageType.CHAT, sender, message ); -+ } -+ -+ private void sendMessage(ChatMessageType position, UUID sender, String message) -+ { -+ unsafe().sendPacket( new Chat( message, (byte) position.ordinal(), sender ) ); -+ } -+ -+ private void sendMessage(ChatMessageType position, UUID sender, BaseComponent... message) -+ { -+ // transform score components -+ message = ChatComponentTransformer.getInstance().transform( this, true, message ); -+ -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) -+ { -+ // Versions older than 1.11 cannot send the Action bar with the new JSON formattings -+ // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -+ if ( getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_10 ) -+ { -+ sendMessage( position, sender, ComponentSerializer.toString( new TextComponent( BaseComponent.toLegacyText( message ) ) ) ); -+ } else -+ { -+ net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title(); -+ title.setAction( net.md_5.bungee.protocol.packet.Title.Action.ACTIONBAR ); -+ title.setText( ComponentSerializer.toString( message ) ); -+ unsafe.sendPacket( title ); -+ } -+ } else -+ { -+ sendMessage( position, sender, ComponentSerializer.toString( message ) ); -+ } -+ } -+ -+ @Override -+ public void sendData(String channel, byte[] data) -+ { -+ unsafe().sendPacket( new PluginMessage( channel, data, forgeClientHandler.isForgeUser() ) ); -+ } -+ -+ @Override -+ public InetSocketAddress getAddress() -+ { -+ return (InetSocketAddress) getSocketAddress(); -+ } -+ -+ @Override -+ public SocketAddress getSocketAddress() -+ { -+ return ch.getRemoteAddress(); -+ } -+ -+ @Override -+ public Collection getGroups() -+ { -+ return Collections.unmodifiableCollection( groups ); -+ } -+ -+ @Override -+ public void addGroups(String... groups) -+ { -+ for ( String group : groups ) -+ { -+ this.groups.add( group ); -+ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) -+ { -+ setPermission( permission, true ); -+ } -+ } -+ } -+ -+ @Override -+ public void removeGroups(String... groups) -+ { -+ for ( String group : groups ) -+ { -+ this.groups.remove( group ); -+ for ( String permission : bungee.getConfigurationAdapter().getPermissions( group ) ) -+ { -+ setPermission( permission, false ); -+ } -+ } -+ } -+ -+ @Override -+ public boolean hasPermission(String permission) -+ { -+ return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission(); -+ } -+ -+ @Override -+ public void setPermission(String permission, boolean value) -+ { -+ if ( value ) -+ { -+ permissions.add( permission ); -+ } else -+ { -+ permissions.remove( permission ); -+ } -+ } -+ -+ @Override -+ public Collection getPermissions() -+ { -+ return Collections.unmodifiableCollection( permissions ); -+ } -+ -+ @Override -+ public String toString() -+ { -+ return name; -+ } -+ -+ @Override -+ public Unsafe unsafe() -+ { -+ return unsafe; -+ } -+ -+ @Override -+ public String getUUID() -+ { -+ return getPendingConnection().getUUID(); -+ } -+ -+ @Override -+ public UUID getUniqueId() -+ { -+ return getPendingConnection().getUniqueId(); -+ } -+ -+ public void setSettings(ClientSettings settings) -+ { -+ this.settings = settings; -+ this.locale = null; -+ } -+ -+ @Override -+ public Locale getLocale() -+ { -+ return ( locale == null && settings != null ) ? locale = Locale.forLanguageTag( settings.getLocale().replace( '_', '-' ) ) : locale; -+ } -+ -+ @Override -+ public byte getViewDistance() -+ { -+ return ( settings != null ) ? settings.getViewDistance() : 10; -+ } -+ -+ @Override -+ public ProxiedPlayer.ChatMode getChatMode() -+ { -+ if ( settings == null ) -+ { -+ return ProxiedPlayer.ChatMode.SHOWN; -+ } -+ -+ switch ( settings.getChatFlags() ) -+ { -+ default: -+ case 0: -+ return ProxiedPlayer.ChatMode.SHOWN; -+ case 1: -+ return ProxiedPlayer.ChatMode.COMMANDS_ONLY; -+ case 2: -+ return ProxiedPlayer.ChatMode.HIDDEN; -+ } -+ } -+ -+ @Override -+ public boolean hasChatColors() -+ { -+ return settings == null || settings.isChatColours(); -+ } -+ -+ @Override -+ public SkinConfiguration getSkinParts() -+ { -+ return ( settings != null ) ? new PlayerSkinConfiguration( settings.getSkinParts() ) : PlayerSkinConfiguration.SKIN_SHOW_ALL; -+ } -+ -+ @Override -+ public ProxiedPlayer.MainHand getMainHand() -+ { -+ return ( settings == null || settings.getMainHand() == 1 ) ? ProxiedPlayer.MainHand.RIGHT : ProxiedPlayer.MainHand.LEFT; -+ } -+ -+ @Override -+ public boolean isForgeUser() -+ { -+ return forgeClientHandler.isForgeUser(); -+ } -+ -+ @Override -+ public Map getModList() -+ { -+ if ( forgeClientHandler.getClientModList() == null ) -+ { -+ // Return an empty map, rather than a null, if the client hasn't got any mods, -+ // or is yet to complete a handshake. -+ return ImmutableMap.of(); -+ } -+ -+ return ImmutableMap.copyOf( forgeClientHandler.getClientModList() ); -+ } -+ -+ @Override -+ public void setTabHeader(BaseComponent header, BaseComponent footer) -+ { -+ header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; -+ footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -+ -+ unsafe().sendPacket( new PlayerListHeaderFooter( -+ ComponentSerializer.toString( header ), -+ ComponentSerializer.toString( footer ) -+ ) ); -+ } -+ -+ @Override -+ public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) -+ { -+ header = ChatComponentTransformer.getInstance().transform( this, true, header ); -+ footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -+ -+ unsafe().sendPacket( new PlayerListHeaderFooter( -+ ComponentSerializer.toString( header ), -+ ComponentSerializer.toString( footer ) -+ ) ); -+ } -+ -+ @Override -+ public void resetTabHeader() -+ { -+ // Mojang did not add a way to remove the header / footer completely, we can only set it to empty -+ setTabHeader( (BaseComponent) null, null ); -+ } -+ -+ @Override -+ public void sendTitle(Title title) -+ { -+ title.send( this ); -+ } -+ -+ public String getExtraDataInHandshake() -+ { -+ return this.getPendingConnection().getExtraDataInHandshake(); -+ } -+ -+ public void setCompressionThreshold(int compressionThreshold) -+ { -+ if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) -+ { -+ this.compressionThreshold = compressionThreshold; -+ unsafe.sendPacket( new SetCompression( compressionThreshold ) ); -+ ch.setCompressionThreshold( compressionThreshold ); -+ } -+ } -+ -+ @Override -+ public boolean isConnected() -+ { -+ return !ch.isClosed(); -+ } -+ -+ @Override -+ public Scoreboard getScoreboard() -+ { -+ return serverSentScoreboard; -+ } -+ -+ // Waterfall start -+ public boolean isDisableEntityMetadataRewrite() { -+ return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE; -+ } -+ // Waterfall end -+} 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 index 97c4b210..6082d40c 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -2504,5 +1620,5 @@ index daf12f74..7d053485 100644 @Override -- -2.36.0.windows.1 +2.34.1 From 3f4db39b8e0c8688854994549d0feebdd6f272f0 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Mon, 2 May 2022 17:29:21 -0300 Subject: [PATCH 273/499] Reconnect Threshold --- .../0029-Antibot-System.patch | 29 +++++++++++++++---- .../0030-Allow-Invalid-Names.patch | 8 ++--- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index dbcb96c6..585ecea3 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 3ccc4c5dfc0f960aa55b79124c1643b7f6fcfc04 Mon Sep 17 00:00:00 2001 +From 7a0dd6f334550dbdd859b74172434f2905219cc5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -716,10 +716,10 @@ index 00000000..c236160a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..f0c72962 +index 00000000..71904b0c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,52 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -729,6 +729,8 @@ index 00000000..f0c72962 + +public class ReconnectCheck { + private final AddressDataManager addressDataManager; ++ private int connections = 0; ++ private long lastConnection = 0; + + public ReconnectCheck(final AddressDataManager addressDataManager) { + this.addressDataManager = addressDataManager; @@ -738,6 +740,14 @@ index 00000000..f0c72962 + final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); + + if (config.isAntibotReconnectEnabled()) { ++ final long currentTime = System.currentTimeMillis(); ++ ++ if (currentTime - lastConnection > config.getAntibotReconnectConnectionThresholdLimit()) { ++ lastConnection = currentTime; ++ connections = 0; ++ } ++ ++ if (++connections > config.getAntibotReconnectConnectionThreshold()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() + || addressData.getTotalPings() < config.getAntibotReconnectPings(); @@ -757,6 +767,7 @@ index 00000000..f0c72962 + return needsAttempts; + } + } ++ } + + return false; + } @@ -800,10 +811,10 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 5d92c20c..53e5ecee 100644 +index 5d92c20c..da3f915f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,114 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,120 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -875,6 +886,10 @@ index 5d92c20c..53e5ecee 100644 + @Getter + private int antibotReconnectMaxTime = 10000; + @Getter ++ private int antibotReconnectConnectionThreshold = 1; ++ @Getter ++ private int antibotReconnectConnectionThresholdLimit = 8000; ++ @Getter + private boolean antibotReconnectLog = true; + + public void loadAntibot(final Configuration config) { @@ -911,6 +926,8 @@ index 5d92c20c..53e5ecee 100644 + this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); + this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); + this.antibotReconnectMaxTime = setIfUnexistant("antibot.reconnect.max-time", this.antibotReconnectMaxTime, config); ++ this.antibotReconnectConnectionThreshold = setIfUnexistant("antibot.reconnect.connection-threshold", this.antibotReconnectConnectionThreshold, config); ++ this.antibotReconnectConnectionThresholdLimit = setIfUnexistant("antibot.reconnect.connection-threshold-limit", this.antibotReconnectConnectionThresholdLimit, config); + this.antibotReconnectLog = setIfUnexistant("antibot.reconnect.log", this.antibotReconnectLog, config); + } + // FlameCord end - Antibot System @@ -918,7 +935,7 @@ index 5d92c20c..53e5ecee 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +225,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +231,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index a653270f..7af15c79 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From d30a65a70532afd6c6385f39bd708454274448a7 Mon Sep 17 00:00:00 2001 +From 478e6dc923312f50c739de42076d0c872925e506 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 53e5ecee..625df19c 100644 +index da3f915f..31631626 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 53e5ecee..625df19c 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -225,6 +229,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -231,6 +235,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -42,5 +42,5 @@ index 813f0e9b..7fa3217e 100644 disconnect( bungee.getTranslation( "name_invalid" ) ); return; -- -2.32.0 +2.34.1 From 5adb18e4a81f57cc969d50ca66dc03afcdc8fa8b Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Mon, 2 May 2022 17:35:47 -0300 Subject: [PATCH 274/499] Remove Extra Info --- .../0029-Antibot-System.patch | 91 ++++++------------- 1 file changed, 27 insertions(+), 64 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 585ecea3..cf7d4192 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 7a0dd6f334550dbdd859b74172434f2905219cc5 Mon Sep 17 00:00:00 2001 +From 58dc624333b5168ea23f83f963402b9a953b9f80 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,10 +22,10 @@ index f4bf5ec6..4a0d8e5d 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..89323f4b +index 00000000..dfee9bf8 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,36 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -51,10 +51,6 @@ index 00000000..89323f4b + if (nicknames.size() > config.getAntibotAccountsLimit()) { + nicknames.remove(nickname); + -+ if (config.isAntibotAccountsLog()) { -+ System.out.println("[FlameCord] The player [" + nickname + "] has too many accounts!"); -+ } -+ + if (config.isAntibotAccountsFirewall()) { + addressData.firewall(); + } @@ -68,10 +64,10 @@ index 00000000..89323f4b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..c53a46d0 +index 00000000..cd8220d1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,153 @@ +@@ -0,0 +1,149 @@ +package dev._2lstudios.antibot; + +import java.io.IOException; @@ -194,10 +190,6 @@ index 00000000..c53a46d0 + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { + Runtime runtime = Runtime.getRuntime(); + -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog()) { -+ System.out.println("[FlameCord] The IP [" + hostString + "] was blacklisted!"); -+ } -+ + try { + runtime.exec("ipset add flamecord_blacklist " + hostString); + } catch (IOException exception) { @@ -305,10 +297,10 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..bc589302 +index 00000000..6cb59295 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java -@@ -0,0 +1,145 @@ +@@ -0,0 +1,140 @@ +package dev._2lstudios.antibot; + +import java.io.File; @@ -438,11 +430,6 @@ index 00000000..bc589302 + } + + if (country != null && isBlacklisted(config, country)) { -+ if (config.isAntibotCountryLog()) { -+ System.out.println("[FlameCord] The IP [" + addressData.getHostString() -+ + "] comes from a blocked country! [" + country + "]"); -+ } -+ + if (config.isAntibotCountryFirewall()) { + addressData.firewall(); + } @@ -456,10 +443,10 @@ index 00000000..bc589302 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..927c1de3 +index 00000000..76902c27 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java -@@ -0,0 +1,37 @@ +@@ -0,0 +1,32 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -481,11 +468,6 @@ index 00000000..927c1de3 + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + + if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { -+ if (config.isAntibotFastChatLog()) { -+ System.out.println( -+ "[FlameCord] The IP [" + addressData.getHostString() + "] is using the chat too fast!"); -+ } -+ + if (config.isAntibotFastChatFirewall()) { + addressData.firewall(); + } @@ -547,10 +529,10 @@ index 00000000..d3b77f03 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..9105cdf4 +index 00000000..f9b1ad70 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java -@@ -0,0 +1,47 @@ +@@ -0,0 +1,43 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -583,10 +565,6 @@ index 00000000..9105cdf4 + final String nickname = addressData.getLastNickname(); + + if (isBlacklisted(config, nickname)) { -+ if (config.isAntibotNicknameLog()) { -+ System.out.println("[FlameCord] The player [" + nickname + "] has a blacklisted nickname!"); -+ } -+ + if (config.isAntibotNicknameFirewall()) { + addressData.firewall(); + } @@ -600,10 +578,10 @@ index 00000000..9105cdf4 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..ff1708cc +index 00000000..8ffe1e21 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java -@@ -0,0 +1,66 @@ +@@ -0,0 +1,62 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -650,10 +628,6 @@ index 00000000..ff1708cc + updatePassword(config, nickname, password); + + if (repeatCount >= config.getAntibotPasswordLimit()) { -+ if (config.isAntibotPasswordLog()) { -+ System.out.println("[FlameCord] The player [" + nickname + "] has a repeated password!"); -+ } -+ + if (config.isAntibotPasswordFirewall()) { + addressData.firewall(); + } @@ -672,10 +646,10 @@ index 00000000..ff1708cc +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..c236160a +index 00000000..f9ab936b --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java -@@ -0,0 +1,38 @@ +@@ -0,0 +1,33 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -698,11 +672,6 @@ index 00000000..c236160a + + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { -+ if (config.isAntibotRatelimitLog()) { -+ System.out.println( -+ "[FlameCord] The IP [" + addressData.getHostString() + "] is connecting too fast!"); -+ } -+ + if (config.isAntibotRatelimitFirewall()) { + addressData.firewall(); + } @@ -716,10 +685,10 @@ index 00000000..c236160a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..71904b0c +index 00000000..37568225 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java -@@ -0,0 +1,52 @@ +@@ -0,0 +1,46 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -748,26 +717,20 @@ index 00000000..71904b0c + } + + if (++connections > config.getAntibotReconnectConnectionThreshold()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); -+ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() -+ || addressData.getTotalPings() < config.getAntibotReconnectPings(); -+ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config -+ .getAntibotReconnectMaxTime(); ++ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() ++ || addressData.getTotalPings() < config.getAntibotReconnectPings(); ++ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config ++ .getAntibotReconnectMaxTime(); + -+ if (tooSlow) { -+ addressData.setTotalConnections(0); -+ return true; -+ } else { -+ if (config.isAntibotReconnectLog() && needsAttempts) { -+ System.out.println( -+ "[FlameCord] The IP [" + addressData.getHostString() -+ + "] needs to reconnect before joining!"); ++ if (tooSlow) { ++ addressData.setTotalConnections(0); ++ return true; ++ } else { ++ return needsAttempts; + } -+ -+ return needsAttempts; + } + } -+ } + + return false; + } From 52117d8b70b145be5a4ed5209aa322ca69c51623 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Mon, 2 May 2022 17:46:07 -0300 Subject: [PATCH 275/499] Improve Extra Information --- .../0029-Antibot-System.patch | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index cf7d4192..8266380a 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 58dc624333b5168ea23f83f963402b9a953b9f80 Mon Sep 17 00:00:00 2001 +From 08d5bd1686d021b4ea1d27aa5fef85ca0a2743ab Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -297,7 +297,7 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..6cb59295 +index 00000000..8507e1a7 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -395,7 +395,7 @@ index 00000000..6cb59295 + } + } + -+ private String getIsoCode(final InetAddress address) { ++ public String getIsoCode(final InetAddress address) { + try { + final LookupResult lookupResult = maxMindReader.get(address, LookupResult.class); + @@ -930,7 +930,7 @@ index 57462992..ee0295c7 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 0a09f92c..813f0e9b 100644 +index 0a09f92c..f20acb2f 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 @@ -19,6 +19,8 @@ import java.util.logging.Level; @@ -966,7 +966,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] is pinging too many times", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is pinging too fast", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); @@ -988,7 +988,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] is connecting too many times", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is connecting too fast", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); @@ -1014,7 +1014,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has too many accounts", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has too many accounts", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); @@ -1025,7 +1025,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has a blacklisted nickname", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); @@ -1036,7 +1036,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotReconnectLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has to reconnect to join", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has to reconnect to join", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); @@ -1047,7 +1047,7 @@ index 0a09f92c..813f0e9b 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotCountryLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] had his country blocked from the server", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has his country blocked from the server", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); @@ -1059,7 +1059,7 @@ index 0a09f92c..813f0e9b 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 e354032a..976c37e1 100644 +index e354032a..f5fc53bc 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,10 +4,15 @@ import com.google.common.base.Preconditions; @@ -1089,7 +1089,7 @@ index e354032a..976c37e1 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFastChatLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] is chatting too fast", con.getCh().getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is chatting too fast", con.getCh().getRemoteAddress() ); + } + + con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); @@ -1100,7 +1100,7 @@ index e354032a..976c37e1 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotPasswordLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); + } + + con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); @@ -1130,16 +1130,21 @@ index 20c4c0a4..a2086b45 100644 logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; 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 ffea1599..eacc8aae 100644 +index ffea1599..6bf109f5 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 -@@ -59,6 +59,14 @@ public class PipelineUtils +@@ -59,6 +59,19 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + // FlameCord start - Antibot System + if ( FlameCord.getInstance().getCheckManager().getFirewallCheck().check( ch.remoteAddress() ) ) + { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) ++ { ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server", ch.remoteAddress() ); ++ } ++ + ch.close(); + return; + } From f7e3e8a90bf0eb734ba2f7acc2daa2ff9b15aef3 Mon Sep 17 00:00:00 2001 From: Roger <58123692+xRoier@users.noreply.github.com> Date: Thu, 5 May 2022 10:29:04 +0200 Subject: [PATCH 276/499] Fix typo. in Issue #123 --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 8266380a..f76a1aaf 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -458,7 +458,7 @@ index 00000000..76902c27 + private final AddressDataManager addressDataManager; + + public FastChatCheck(final AddressDataManager addressDataManager) { -+ this.addressDataManager = new AddressDataManager(); ++ this.addressDataManager = addressDataManager; + } + + public boolean check(final SocketAddress socketAddress) { From d6bbda8e53f1bae006fd8ccfcdc30fa340423c76 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 7 May 2022 19:45:16 -0300 Subject: [PATCH 277/499] 0.8.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index f53e9fab..6a393568 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.7"; ++ return "0.8.8"; } public void reloadMessages() From f0fffed9f508491582f51b0f575f2f95905cc3f1 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Fri, 3 Jun 2022 18:19:50 -0300 Subject: [PATCH 278/499] Don't firewall IOException --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index f76a1aaf..992f17d2 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 08d5bd1686d021b4ea1d27aa5fef85ca0a2743ab Mon Sep 17 00:00:00 2001 +From 0726de831401f203d43c432107da8a5bb0514edf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -443,7 +443,7 @@ index 00000000..8507e1a7 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..76902c27 +index 00000000..61d4ca83 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -1112,7 +1112,7 @@ index e354032a..f5fc53bc 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 20c4c0a4..a2086b45 100644 +index 20c4c0a4..c737482e 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -1120,7 +1120,7 @@ index 20c4c0a4..a2086b45 100644 boolean logExceptions = !( handler instanceof PingHandler ); + // Flamecord start - Antibot System -+ if (!(cause instanceof ReadTimeoutException)) ++ if (!(cause instanceof ReadTimeoutException && cause instanceof IOException)) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); + } From 2554ec2219419e0ee85f61d14c1f0ea936d578f0 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 7 Jun 2022 21:48:14 +0200 Subject: [PATCH 279/499] Updated Upstream (Waterfall) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: 59dbd08 Updated Upstream (BungeeCord) (#747) 9719e25 Temp disable protocol limits for 1.19 9b0080a Fix crash on startup (#743) 958ae29 Updated Upstream (BungeeCord) (#741) 29f1cfb Improve login state transition a44c78a Various library bumps --- Waterfall | 2 +- .../0001-FlameCord-POM-Changes.patch | 18 +-- .../0004-1.7.x-support.patch | 132 +++++++++--------- ...ake-PlayerHandshakeEvent-cancellable.patch | 8 +- .../0008-Change-replaceAll-to-replace.patch | 12 +- ...ections-Don-t-flush-if-not-necessary.patch | 14 +- ...tom-uuids-even-if-onlineMode-is-true.patch | 8 +- ...ateException-to-QuietException-and-e.patch | 8 +- ...-Don-t-declare-uuid-unless-it-s-null.patch | 8 +- .../0017-FlameCord-General-Patch.patch | 20 +-- .../0020-Fix-ByteBuf-memory-leaks.patch | 8 +- .../0022-FlameCord-logger-options.patch | 14 +- .../0026-Custom-motd-system.patch | 12 +- ...0028-InitialHandler-Processing-State.patch | 26 ++-- .../0029-Antibot-System.patch | 26 ++-- .../0030-Allow-Invalid-Names.patch | 8 +- ...0032-Disable-entity-Metadata-Rewrite.patch | 63 +++++---- 17 files changed, 191 insertions(+), 196 deletions(-) diff --git a/Waterfall b/Waterfall index 2322301e..59dbd083 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 2322301e636482f5eee44b7f7586a66408a502f4 +Subproject commit 59dbd0833d2d681d65403819b0ead83094e18237 diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index 9ffae465..14b53ad5 100644 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 9702193b1b27ffbe2fd79236b44d689d58ebafc1 Mon Sep 17 00:00:00 2001 +From 78f08ffc6b5a3860c958d66ac3c469c39aff35ff Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..f4bf5ec6 +index 00000000..20edd900 --- /dev/null +++ b/flamecord/pom.xml @@ -0,0 +1,44 @@ @@ -17,13 +17,13 @@ index 00000000..f4bf5ec6 + + io.github.waterfallmc + waterfall-parent -+ 1.18-R0.1-SNAPSHOT ++ 1.19-R0.1-SNAPSHOT + ../pom.xml + + + dev._2lstudios + waterfall-flamecord -+ 1.18-R0.1-SNAPSHOT ++ 1.19-R0.1-SNAPSHOT + jar + + Waterfall-FlameCord @@ -55,7 +55,7 @@ index 00000000..f4bf5ec6 + + diff --git a/pom.xml b/pom.xml -index 505d1d14..45f14084 100644 +index 2b544c23..d940b21c 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ @@ -67,7 +67,7 @@ index 505d1d14..45f14084 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index a783d9b0..f45d4f7a 100644 +index 93ae5952..d6222d16 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -64,5 +64,14 @@ @@ -86,7 +86,7 @@ index a783d9b0..f45d4f7a 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index cca0ef95..3df0498a 100644 +index 72b7f3a9..47fd853e 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -150,6 +150,51 @@ @@ -140,7 +140,7 @@ index cca0ef95..3df0498a 100644 + - + -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index c44caad8..68a99d55 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,14 +1,14 @@ -From 8cb0f498248681df39f0802cacb07c3053d7f4cf Mon Sep 17 00:00:00 2001 +From 00d921eca130b83c9460fcb3947ce4414803e907 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index a310844d..d07b88b8 100644 +index 55c6ee72..56684de7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -303,4 +303,36 @@ public abstract class DefinedPacket +@@ -364,4 +364,36 @@ public abstract class DefinedPacket return 0; } // Waterfall end @@ -46,10 +46,10 @@ index a310844d..d07b88b8 100644 + // FlameCord end - 1.7.x support } 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 -index 7f0b71c9..04851233 100644 +index 4a07e5be..56f01363 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -58,7 +58,7 @@ public enum Protocol +@@ -62,7 +62,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, @@ -58,7 +58,7 @@ index 7f0b71c9..04851233 100644 ); } }, -@@ -70,7 +70,7 @@ public enum Protocol +@@ -74,7 +74,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, @@ -67,7 +67,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -82,7 +82,7 @@ public enum Protocol +@@ -87,7 +87,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, @@ -76,16 +76,16 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -93,7 +93,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Chat.class, +@@ -98,7 +98,7 @@ public enum Protocol + ); + TO_CLIENT.registerPacket( Chat.class, Chat::new, - map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), + map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // FlameCord - 1.7.x support map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -103,7 +103,7 @@ public enum Protocol +@@ -109,7 +109,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,7 +94,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -126,20 +126,20 @@ public enum Protocol +@@ -139,20 +139,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, @@ -118,7 +118,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -152,7 +152,7 @@ public enum Protocol +@@ -166,7 +166,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -163,7 +163,7 @@ public enum Protocol +@@ -178,7 +178,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -175,7 +175,7 @@ public enum Protocol +@@ -190,7 +190,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -145,7 +145,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -187,7 +187,7 @@ public enum Protocol +@@ -202,7 +202,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, @@ -154,7 +154,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -199,7 +199,7 @@ public enum Protocol +@@ -214,7 +214,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -211,7 +211,7 @@ public enum Protocol +@@ -226,7 +226,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -223,7 +223,7 @@ public enum Protocol +@@ -239,7 +239,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -235,7 +235,7 @@ public enum Protocol +@@ -252,7 +252,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -265,7 +265,7 @@ public enum Protocol +@@ -288,7 +288,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -280,7 +280,7 @@ public enum Protocol +@@ -304,7 +304,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -318,7 +318,7 @@ public enum Protocol +@@ -346,7 +346,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,16 +217,16 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -330,7 +330,7 @@ public enum Protocol - TO_SERVER.registerPacket( - Chat.class, +@@ -358,7 +358,7 @@ public enum Protocol + ); + TO_SERVER.registerPacket( Chat.class, Chat::new, - map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), + map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -339,7 +339,7 @@ public enum Protocol +@@ -378,7 +378,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -349,7 +349,7 @@ public enum Protocol +@@ -389,7 +389,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -358,7 +358,7 @@ public enum Protocol +@@ -399,7 +399,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index 7f0b71c9..04851233 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -376,23 +376,23 @@ public enum Protocol +@@ -418,23 +418,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index 7f0b71c9..04851233 100644 ); } }, -@@ -404,22 +404,22 @@ public enum Protocol +@@ -446,22 +446,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index 7f0b71c9..04851233 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -430,12 +430,12 @@ public enum Protocol +@@ -472,12 +472,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -324,7 +324,7 @@ index 7f0b71c9..04851233 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index 6360818c..5e4f3d64 100644 +index 164b544e..c12d2885 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index 6360818c..5e4f3d64 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -44,6 +48,7 @@ public class ProtocolConstants +@@ -45,6 +49,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,8 +346,8 @@ index 6360818c..5e4f3d64 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -57,6 +62,10 @@ public class ProtocolConstants - "1.18.x" +@@ -59,6 +64,10 @@ public class ProtocolConstants + "1.19.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( + // FlameCord start - 1.7.x support @@ -453,11 +453,11 @@ index a29524ca..86182cdd 100644 writeArray( publicKey, buf ); writeArray( verifyToken, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 53575ce0..52d7a5cc 100644 +index 50bb52b1..b15f9e6a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket - @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // FlameCord start - 1.7.x support @@ -470,9 +470,9 @@ index 53575ce0..52d7a5cc 100644 + // FlameCord end - 1.7.x support + sharedSecret = readArray( buf, 128 ); - verifyToken = readArray( buf, 128 ); - } -@@ -29,6 +38,15 @@ public class EncryptionResponse extends DefinedPacket + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19 || buf.readBoolean() ) + { +@@ -35,6 +44,15 @@ public class EncryptionResponse extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -486,8 +486,8 @@ index 53575ce0..52d7a5cc 100644 + // FlameCord end - 1.7.x support + writeArray( sharedSecret, buf ); - writeArray( verifyToken, buf ); - } + if ( verifyToken != null ) + { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java index d11a9ea9..0ed78a8c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java @@ -622,10 +622,10 @@ index b004bc41..a8c3e773 100644 { buf.writeLong( randomId ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 551bd104..5aeae06c 100644 +index 07fb3d79..7d03cd10 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -@@ -23,6 +23,11 @@ public class LoginSuccess extends DefinedPacket +@@ -25,6 +25,11 @@ public class LoginSuccess extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -637,7 +637,7 @@ index 551bd104..5aeae06c 100644 if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) { uuid = readUUID( buf ); -@@ -36,6 +41,11 @@ public class LoginSuccess extends DefinedPacket +@@ -42,6 +47,11 @@ public class LoginSuccess extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -649,7 +649,7 @@ index 551bd104..5aeae06c 100644 if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) { writeUUID( uuid, buf ); -@@ -51,4 +61,14 @@ public class LoginSuccess extends DefinedPacket +@@ -61,4 +71,14 @@ public class LoginSuccess extends DefinedPacket { handler.handle( this ); } @@ -665,10 +665,10 @@ index 551bd104..5aeae06c 100644 + // FlameCord end - 1.7.x support } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 92bacc7c..cae5bda5 100644 +index 7dfdb58d..4050acb4 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -@@ -21,6 +21,18 @@ public class PlayerListItem extends DefinedPacket +@@ -23,6 +23,18 @@ public class PlayerListItem extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -687,7 +687,7 @@ index 92bacc7c..cae5bda5 100644 action = Action.values()[DefinedPacket.readVarInt( buf )]; items = new Item[ DefinedPacket.readVarInt( buf ) ]; for ( int i = 0; i < items.length; i++ ) -@@ -75,6 +87,17 @@ public class PlayerListItem extends DefinedPacket +@@ -63,6 +75,17 @@ public class PlayerListItem extends DefinedPacket @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 11b62d81..5ef34fcb 100644 +index 04af585e..66a8e82b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1000,7 +1000,7 @@ index 491cf1a1..6cd8ec3b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 9e74d158..75028024 100644 +index ba7fc59c..d672c8ef 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler @@ -1037,7 +1037,7 @@ index 9e74d158..75028024 100644 } for ( Score score : serverScoreboard.getScores() ) { -@@ -465,7 +475,13 @@ public class ServerConnector extends PacketHandler +@@ -466,7 +476,13 @@ public class ServerConnector extends PacketHandler if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) { this.handshakeHandler.handle( pluginMessage ); @@ -1053,10 +1053,10 @@ index 9e74d158..75028024 100644 throw CancelSendSignal.INSTANCE; } 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 7c52ee9a..fe73e6e8 100644 +index b7d363b8..0d0f4376 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -193,6 +193,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -194,6 +194,7 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkNotNull( name, "displayName" ); @@ -1064,7 +1064,7 @@ index 7c52ee9a..fe73e6e8 100644 displayName = name; } -@@ -507,7 +508,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -518,7 +519,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1073,7 +1073,7 @@ index 7c52ee9a..fe73e6e8 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -703,6 +704,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -714,6 +715,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1081,7 +1081,7 @@ index 7c52ee9a..fe73e6e8 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -715,6 +717,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -726,6 +728,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1089,7 +1089,7 @@ index 7c52ee9a..fe73e6e8 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -744,6 +747,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -755,6 +758,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1167,7 +1167,7 @@ index 97c4b210..6082d40c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 4afab05d..f6378e03 100644 +index c973ca63..134c8a1d 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1180,7 +1180,7 @@ index 4afab05d..f6378e03 100644 import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.SocketAddress; -@@ -257,8 +260,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -259,8 +262,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -1228,10 +1228,10 @@ index 6df3f3dd..a409d440 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 9537208e..e354032a 100644 +index b9a4b03c..5a3555a6 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 -@@ -85,7 +85,12 @@ public class UpstreamBridge extends PacketHandler +@@ -87,7 +87,12 @@ public class UpstreamBridge extends PacketHandler } ); for ( ProxiedPlayer player : con.getServer().getInfo().getPlayers() ) { @@ -1246,10 +1246,10 @@ index 9537208e..e354032a 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index cda6451d..1509071f 100644 +index 59d63cc2..73fd60e0 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -35,6 +35,12 @@ public abstract class EntityMap +@@ -34,6 +34,12 @@ public abstract class EntityMap // Waterfall end switch ( version ) { @@ -1620,5 +1620,5 @@ index daf12f74..7d053485 100644 @Override -- -2.34.1 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index be3789d2..2a658722 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From fe67e1b15da0cebd4aa08a848529845a194dff24 Mon Sep 17 00:00:00 2001 +From dc40048d350211b27c7418575f25b5bc90325626 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 f6378e03..23571d40 100644 +index 134c8a1d..3372fb71 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 -@@ -338,7 +338,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -340,7 +340,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index f6378e03..23571d40 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch index e287e35d..bc20733d 100644 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -1,23 +1,23 @@ -From 6d9ca4241f7afcfba08144a7e247bfc36a4d5990 Mon Sep 17 00:00:00 2001 +From dca52858df4acbd78c9128f6e40e447b86824150 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:01:37 +0800 Subject: [PATCH] Change replaceAll() to replace() diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 75028024..2ee16684 100644 +index d672c8ef..9067b806 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -129,7 +129,8 @@ public class ServerConnector extends PacketHandler - newp[newp.length - 2] = new LoginResult.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); + newp[newp.length - 2] = new net.md_5.bungee.protocol.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. -- newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); +- newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); + // FlameCord - Change replaceAll() to replace() -+ newp[newp.length - 1] = new LoginResult.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); ++ newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); // All done. properties = newp; -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 09a150f1..1054ca59 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From fe19c98e455af24d9970a73215de3b651545d919 Mon Sep 17 00:00:00 2001 +From 3eb1986d6a7a41e141243a72281ca574cc258bca Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 23571d40..1ec75614 100644 +index 3372fb71..02e36035 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 -@@ -195,6 +195,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -197,6 +197,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index 23571d40..1ec75614 100644 String kickMessage; if ( v1_5 ) -@@ -260,6 +267,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -262,6 +269,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -40,7 +40,7 @@ index 23571d40..1ec75614 100644 // FlameCord start - 1.7.x support Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -304,11 +322,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -306,11 +324,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -58,7 +58,7 @@ index 23571d40..1ec75614 100644 } @Override -@@ -617,7 +637,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -644,7 +664,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -175,5 +175,5 @@ index b2b19996..b1ecb7ef 100644 } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 786d4716..266978c3 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 78fe174f45379f66c5a409e723804bd147b6859f Mon Sep 17 00:00:00 2001 +From e1a764e21fc1c6329271b609847e4850688ab05f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 1ec75614..b402d1d3 100644 +index 02e36035..faa548b2 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 -@@ -695,7 +695,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -722,7 +722,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index 1ec75614..b402d1d3 100644 } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch index 20d03ad3..87091d35 100644 --- a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 741f02f0787e16c9032d2a8490f669b69963dcda Mon Sep 17 00:00:00 2001 +From 7b7896c320e69ce36355bd3c1b5e8c46465f25d9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 adc25165..935d2e30 100644 +index 0d0f4376..e183e1a1 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -311,7 +311,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -312,7 +312,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { @@ -20,5 +20,5 @@ index adc25165..935d2e30 100644 return; } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index d006fa05..8d098643 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 0ddd8121e5e1bb37c08836aef5189d3b4a4a8a7d Mon Sep 17 00:00:00 2001 +From 09ed510ba131556b9b64e52d4adf1b5836f537fe Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 b402d1d3..0b5faf6b 100644 +index faa548b2..fb9a8a19 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 -@@ -505,7 +505,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -532,7 +532,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index b402d1d3..0b5faf6b 100644 return; } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 056f73bf..e5ad9e6c 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From a102b1a867083a5fa6873b59eb015dfdddf651fd Mon Sep 17 00:00:00 2001 +From fbb4acd9564930b3d9eec1617ab17c829106005a Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0b02ae7d..774439c5 100644 +index 66a8e82b..8de74e78 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -263,7 +263,7 @@ index 0b02ae7d..774439c5 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 2ee16684..3a41769a 100644 +index 9067b806..cb98a8ea 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -2,6 +2,8 @@ package net.md_5.bungee; @@ -285,7 +285,7 @@ index 2ee16684..3a41769a 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 5cc50806..ff9fd071 100644 +index e183e1a1..849ec128 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -296,7 +296,7 @@ index 5cc50806..ff9fd071 100644 import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.PermissionCheckEvent; -@@ -65,6 +66,7 @@ import net.md_5.bungee.tab.ServerUnique; +@@ -66,6 +67,7 @@ import net.md_5.bungee.tab.ServerUnique; import net.md_5.bungee.tab.TabList; import net.md_5.bungee.util.CaseInsensitiveSet; import net.md_5.bungee.util.ChatComponentTransformer; @@ -304,7 +304,7 @@ index 5cc50806..ff9fd071 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -391,9 +393,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -392,9 +394,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -319,10 +319,10 @@ index 5cc50806..ff9fd071 100644 b.connect().addListener( listener ); } 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 0b5faf6b..39c54cf1 100644 +index fb9a8a19..c6d552e7 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 -@@ -19,6 +19,8 @@ import java.util.logging.Level; +@@ -20,6 +20,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -331,7 +331,7 @@ index 0b5faf6b..39c54cf1 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -157,7 +159,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -159,7 +161,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -379,5 +379,5 @@ index a95193ba..a4c3bd71 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch index b34cdbf1..efaddbda 100644 --- a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 23d65a0daab152315d3815042c57d14e51674bb7 Mon Sep 17 00:00:00 2001 +From 2553ca852c00716e467c00887160a0bdeaaaa36b Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 1509071f..b9bcecb5 100644 +index 73fd60e0..9ec16808 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -151,11 +151,15 @@ public abstract class EntityMap +@@ -152,11 +152,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -64,5 +64,5 @@ index cefa0206..8d4439ab 100644 } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index e1c6ff16..65d8fb00 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 8b4d2b4a334c1c60e707e785f16dfc6422b02854 Mon Sep 17 00:00:00 2001 +From 409d6c896abd462511e28f1932a124d9966de6e1 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -40,7 +40,7 @@ index c8148e90..c327841a 100644 } catch (final IOException e) { e.printStackTrace(); 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 ff9fd071..849b4774 100644 +index 849ec128..dd7c8532 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -51,7 +51,7 @@ index ff9fd071..849b4774 100644 import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; -@@ -404,7 +405,10 @@ public final class UserConnection implements ProxiedPlayer +@@ -405,7 +406,10 @@ public final class UserConnection implements ProxiedPlayer private String connectionFailMessage(Throwable cause) { @@ -64,10 +64,10 @@ index ff9fd071..849b4774 100644 } 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 39c54cf1..cfd6249e 100644 +index c6d552e7..477ca39a 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 -@@ -370,7 +370,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -372,7 +372,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -77,7 +77,7 @@ index 39c54cf1..cfd6249e 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -379,7 +380,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -381,7 +382,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -139,5 +139,5 @@ index c8748ce5..778deb63 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 89ac5d90..4760ace1 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 0253c8d3380bbee90deda46a1abfac43d326466d Mon Sep 17 00:00:00 2001 +From d9798110ca3de1602a74372db57a5161cc07c382 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -125,10 +125,10 @@ index c327841a..de2cc947 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 cfd6249e..d1a06397 100644 +index 477ca39a..e6b5e5da 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 -@@ -21,6 +21,8 @@ import javax.crypto.spec.SecretKeySpec; +@@ -22,6 +22,8 @@ import javax.crypto.spec.SecretKeySpec; import dev._2lstudios.flamecord.FlameCord; @@ -137,7 +137,7 @@ index cfd6249e..d1a06397 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -250,7 +252,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -252,7 +254,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); @@ -145,7 +145,7 @@ index cfd6249e..d1a06397 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -313,7 +314,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -315,7 +316,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { @@ -200,5 +200,5 @@ index cfd6249e..d1a06397 100644 thisState = State.PING; -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 44a1b33f..6d765ee1 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From 2955e7fb79cc4a078a7290263cf86e2da94381f8 Mon Sep 17 00:00:00 2001 +From 1dab3e8e846bfac8bb6c6bc2293e8a9839ba3f0b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 d1a06397..0a09f92c 100644 +index e6b5e5da..75956d4a 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 -@@ -130,12 +130,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection private enum State { @@ -23,7 +23,7 @@ index d1a06397..0a09f92c 100644 } @Override -@@ -250,6 +250,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -252,6 +252,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -31,7 +31,7 @@ index d1a06397..0a09f92c 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -372,6 +373,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -374,6 +375,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index d1a06397..0a09f92c 100644 unsafe.sendPacket( ping ); -@@ -383,6 +385,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -385,6 +387,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index d1a06397..0a09f92c 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); -@@ -455,6 +458,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -457,6 +460,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,15 +55,7 @@ index d1a06397..0a09f92c 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -513,6 +517,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(final EncryptionResponse encryptResponse) throws Exception - { - Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); -+ thisState = State.PROCESSING; - - SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); - // Waterfall start -@@ -740,14 +745,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -767,14 +771,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { @@ -81,5 +73,5 @@ index d1a06397..0a09f92c 100644 this.uniqueId = uuid; } -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 992f17d2..597fb537 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,11 +1,11 @@ -From 0726de831401f203d43c432107da8a5bb0514edf Mon Sep 17 00:00:00 2001 +From e422abdffacba77082117395fb7831a46cd5cad0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index f4bf5ec6..4a0d8e5d 100644 +index 20edd900..5978bec6 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,11 @@ @@ -930,10 +930,10 @@ index 57462992..ee0295c7 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 0a09f92c..f20acb2f 100644 +index 75956d4a..716949ae 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 -@@ -19,6 +19,8 @@ import java.util.logging.Level; +@@ -20,6 +20,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -942,7 +942,7 @@ index 0a09f92c..f20acb2f 100644 import dev._2lstudios.flamecord.FlameCord; import dev._2lstudios.flamecord.configuration.FlameConfig; -@@ -415,6 +417,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -417,6 +419,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -954,7 +954,7 @@ index 0a09f92c..f20acb2f 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -426,6 +433,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -428,6 +435,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -977,7 +977,7 @@ index 0a09f92c..f20acb2f 100644 break; case 2: // Login -@@ -437,6 +460,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -439,6 +462,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -999,7 +999,7 @@ index 0a09f92c..f20acb2f 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -474,6 +512,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -499,6 +537,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1059,7 +1059,7 @@ index 0a09f92c..f20acb2f 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 e354032a..f5fc53bc 100644 +index 5a3555a6..7dfff614 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,10 +4,15 @@ import com.google.common.base.Preconditions; @@ -1078,7 +1078,7 @@ index e354032a..f5fc53bc 100644 import net.md_5.bungee.BungeeCord; import net.md_5.bungee.ServerConnection.KeepAliveData; import net.md_5.bungee.UserConnection; -@@ -166,6 +171,32 @@ public class UpstreamBridge extends PacketHandler +@@ -192,6 +197,32 @@ public class UpstreamBridge extends PacketHandler } Preconditions.checkArgument(!empty, "Chat message is empty"); @@ -1096,7 +1096,7 @@ index e354032a..f5fc53bc 100644 + throw CancelSendSignal.INSTANCE; + } + -+ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), chat.getMessage() ) ) ++ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), message ) ) + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotPasswordLog() ) + { @@ -1108,7 +1108,7 @@ index e354032a..f5fc53bc 100644 + } + // FlameCord end - Antibot System + - ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() ); + ChatEvent chatEvent = new ChatEvent( con, con.getServer(), message ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1154,5 +1154,5 @@ index ffea1599..6bf109f5 100644 { ch.close(); -- -2.34.1 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 7af15c79..1b3b62a7 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From 478e6dc923312f50c739de42076d0c872925e506 Mon Sep 17 00:00:00 2001 +From f1ef24bf5679ec5b5f06df202a1f3952a8f2f65e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -29,10 +29,10 @@ index da3f915f..31631626 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 813f0e9b..7fa3217e 100644 +index 716949ae..7c539248 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 -@@ -498,7 +498,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -500,7 +500,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; @@ -42,5 +42,5 @@ index 813f0e9b..7fa3217e 100644 disconnect( bungee.getTranslation( "name_invalid" ) ); return; -- -2.34.1 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index d8205881..d91ca0a1 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 27d447c5af7941b6a84a2fed75d742a434a128f3 Mon Sep 17 00:00:00 2001 +From c8a6949b1219f4c384d49f6db28a1b522ed4017c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -21,10 +21,10 @@ index 469fe0e1..97bd384b 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index ee2317e8..15a61b7e 100644 +index 558d0dbb..35236382 100644 --- 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,8 +8,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; +@@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; import net.md_5.bungee.protocol.packet.Commands; import net.md_5.bungee.protocol.packet.EncryptionRequest; import net.md_5.bungee.protocol.packet.EncryptionResponse; @@ -33,7 +33,7 @@ index ee2317e8..15a61b7e 100644 import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; import net.md_5.bungee.protocol.packet.Handshake; -@@ -195,14 +193,4 @@ public abstract class AbstractPacketHandler +@@ -215,14 +213,4 @@ public abstract class AbstractPacketHandler public void handle(GameState gameState) throws Exception { } @@ -49,10 +49,10 @@ index ee2317e8..15a61b7e 100644 - // Waterfall end } 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 -index 04851233..8e59720f 100644 +index 56f01363..7b9303fc 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -18,8 +18,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; +@@ -20,8 +20,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; import net.md_5.bungee.protocol.packet.EncryptionResponse; import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; @@ -61,9 +61,9 @@ index 04851233..8e59720f 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -122,20 +120,6 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_16, 0x0C ), - map( ProtocolConstants.MINECRAFT_1_17, 0x0D ) +@@ -135,20 +133,6 @@ public enum Protocol + PlayerChat::new, + map( ProtocolConstants.MINECRAFT_1_19, 0x30 ) ); - // Waterfall start - TO_CLIENT.registerPacket( @@ -239,7 +239,7 @@ index ff4bbf34..a008b132 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a41769a..d2bf095a 100644 +index cb98a8ea..c0b42ee2 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -243,11 +243,6 @@ public class ServerConnector extends PacketHandler @@ -281,7 +281,7 @@ index 3a41769a..d2bf095a 100644 user.setDimensionChange( true ); - if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); - } user.setServerEntityId( login.getEntityId() ); @@ -296,35 +296,35 @@ index 3a41769a..d2bf095a 100644 - // Only send if we are not in the same dimension - if ( login.getDimension() != user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); - } + // Only send if we are not in the same dimension + if ( login.getDimension() != user.getDimension() ) // Waterfall - defer + { -+ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); ++ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); + } - Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); +- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); - user.unsafe().sendPacket(modLogin); + Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() ); ++ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); + user.unsafe().sendPacket(modLogin); - // Only send if we're in the same dimension - if ( login.getDimension() == user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); - } + // Only send if we're in the same dimension + if ( login.getDimension() == user.getDimension() ) // Waterfall - defer + { -+ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); ++ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); } // Waterfall end - user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) ); + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 849b4774..6131d7ea 100644 +index dd7c8532..3950ce42 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -335,7 +335,7 @@ index 849b4774..6131d7ea 100644 import net.md_5.bungee.forge.ForgeClientHandler; import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.forge.ForgeServerHandler; -@@ -136,8 +135,6 @@ public final class UserConnection implements ProxiedPlayer +@@ -137,8 +136,6 @@ public final class UserConnection implements ProxiedPlayer /*========================================================================*/ @Getter private String displayName; @@ -344,7 +344,7 @@ index 849b4774..6131d7ea 100644 private Locale locale; /*========================================================================*/ @Getter -@@ -158,8 +155,6 @@ public final class UserConnection implements ProxiedPlayer +@@ -159,8 +156,6 @@ public final class UserConnection implements ProxiedPlayer public void init() { @@ -353,7 +353,7 @@ index 849b4774..6131d7ea 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -776,10 +771,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -787,10 +782,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } @@ -433,7 +433,7 @@ index 6082d40c..194ada04 100644 public void handle(Respawn respawn) { 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 976c37e1..ec20e714 100644 +index 7dfff614..9256477e 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 @@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -444,7 +444,7 @@ index 976c37e1..ec20e714 100644 import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.netty.ChannelWrapper; import net.md_5.bungee.netty.PacketHandler; -@@ -128,11 +127,6 @@ public class UpstreamBridge extends PacketHandler +@@ -130,11 +129,6 @@ public class UpstreamBridge extends PacketHandler { if ( con.getServer() != null ) { @@ -458,10 +458,10 @@ index 976c37e1..ec20e714 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index b9bcecb5..00000000 +index 9ec16808..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null -@@ -1,368 +0,0 @@ +@@ -1,369 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -470,7 +470,6 @@ index b9bcecb5..00000000 -import java.io.DataInputStream; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -- -import net.md_5.bungee.protocol.DefinedPacket; -import net.md_5.bungee.protocol.ProtocolConstants; -import se.llbit.nbt.NamedTag; @@ -550,6 +549,8 @@ index b9bcecb5..00000000 - case ProtocolConstants.MINECRAFT_1_18: - case ProtocolConstants.MINECRAFT_1_18_2: - return EntityMap_1_16_2.INSTANCE_1_18; +- case ProtocolConstants.MINECRAFT_1_19: +- return EntityMap_1_16_2.INSTANCE_1_19; - } - throw new RuntimeException( "Version " + version + " has no entity map" ); - } @@ -2355,10 +2356,10 @@ index c8b06707..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index 2f0e303d..00000000 +index b9d0b651..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null -@@ -1,74 +0,0 @@ +@@ -1,76 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -2378,6 +2379,8 @@ index 2f0e303d..00000000 - static final EntityMap_1_16_2 INSTANCE_1_16_2 = new EntityMap_1_16_2( 0x04, 0x2D ); - static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D ); - static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F ); +- - // - private final int spawnPlayerId; - private final int spectateId; @@ -3230,5 +3233,5 @@ index caed4384..af428090 100644 } -- -2.36.0.windows.1 +2.36.1.windows.1 From d9e53cff554affe2487e880a527faf361747249c Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 7 Jun 2022 20:29:45 -0300 Subject: [PATCH 280/499] 1.0.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 6a393568..705bddbd 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "0.8.8"; ++ return "1.0.0"; } public void reloadMessages() From 144994155a6bdf2843c00a2bcd94095fecef5123 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Tue, 7 Jun 2022 20:38:15 -0300 Subject: [PATCH 281/499] Allow displaynames larger than 16 characters --- .../0004-1.7.x-support.patch | 25 ++++++++++--------- ...ateException-to-QuietException-and-e.patch | 8 +++--- .../0017-FlameCord-General-Patch.patch | 12 ++++----- .../0022-FlameCord-logger-options.patch | 10 ++++---- ...0032-Disable-entity-Metadata-Rewrite.patch | 10 ++++---- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 68a99d55..60333ef8 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 00d921eca130b83c9460fcb3947ce4414803e907 Mon Sep 17 00:00:00 2001 +From 7afd78ade68587c487a3922481a89f8832819aa0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -46,7 +46,7 @@ index 55c6ee72..56684de7 100644 + // FlameCord end - 1.7.x support } 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 -index 4a07e5be..56f01363 100644 +index 014383b3..f8d4721e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -62,7 +62,7 @@ public enum Protocol @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 04af585e..66a8e82b 100644 +index 12a4d565..cd34f29f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1053,18 +1053,19 @@ index ba7fc59c..d672c8ef 100644 throw CancelSendSignal.INSTANCE; } 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 b7d363b8..0d0f4376 100644 +index b7d363b8..f4f67b35 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -194,6 +194,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer public void setDisplayName(String name) { Preconditions.checkNotNull( name, "displayName" ); -+ Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // FlameCord - 1.7.x support ++ // Its "spigot" responsability to choose wether to support 1.7 or not. ++ //Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // FlameCord - 1.7.x support displayName = name; } -@@ -518,7 +519,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -518,7 +520,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1073,7 +1074,7 @@ index b7d363b8..0d0f4376 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -714,6 +715,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -714,6 +716,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1081,7 +1082,7 @@ index b7d363b8..0d0f4376 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -726,6 +728,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -726,6 +729,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1089,7 +1090,7 @@ index b7d363b8..0d0f4376 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -755,6 +758,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -755,6 +759,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1167,7 +1168,7 @@ index 97c4b210..6082d40c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 c973ca63..134c8a1d 100644 +index ed1fe41a..7ddda6c3 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1620,5 +1621,5 @@ index daf12f74..7d053485 100644 @Override -- -2.36.1.windows.1 +2.34.1 diff --git a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch index 87091d35..18be2827 100644 --- a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 7b7896c320e69ce36355bd3c1b5e8c46465f25d9 Mon Sep 17 00:00:00 2001 +From 6545a44d71d2e9d6f08bf4f93306c12c34673b7a Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,10 +6,10 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 0d0f4376..e183e1a1 100644 +index f4f67b35..5293552d 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -312,7 +312,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -313,7 +313,8 @@ public final class UserConnection implements ProxiedPlayer if ( getServer() == null && !ch.isClosing() ) { @@ -20,5 +20,5 @@ index 0d0f4376..e183e1a1 100644 return; } -- -2.36.1.windows.1 +2.34.1 diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index e5ad9e6c..8747bca8 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From fbb4acd9564930b3d9eec1617ab17c829106005a Mon Sep 17 00:00:00 2001 +From 36c2b4b28806f491a6fa680be25afe6ba03179f1 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 66a8e82b..8de74e78 100644 +index cd34f29f..824dfca8 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -285,7 +285,7 @@ index 9067b806..cb98a8ea 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 e183e1a1..849ec128 100644 +index 5293552d..89b4122c 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -304,7 +304,7 @@ index e183e1a1..849ec128 100644 @RequiredArgsConstructor public final class UserConnection implements ProxiedPlayer -@@ -392,9 +394,11 @@ public final class UserConnection implements ProxiedPlayer +@@ -393,9 +395,11 @@ public final class UserConnection implements ProxiedPlayer .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) .remoteAddress( target.getAddress() ); // Windows is bugged, multi homed users will just have to live with random connecting IPs @@ -319,7 +319,7 @@ index e183e1a1..849ec128 100644 b.connect().addListener( listener ); } 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 fb9a8a19..c6d552e7 100644 +index 72328eed..0957c1f1 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 @@ -20,6 +20,8 @@ import java.util.logging.Level; @@ -379,5 +379,5 @@ index a95193ba..a4c3bd71 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.36.1.windows.1 +2.34.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 65d8fb00..ebfdcd3b 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 409d6c896abd462511e28f1932a124d9966de6e1 Mon Sep 17 00:00:00 2001 +From 8e2ea1839113e4c4c7775e6e8cf82fc51b443f4f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -40,7 +40,7 @@ index c8148e90..c327841a 100644 } catch (final IOException e) { e.printStackTrace(); 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 849ec128..dd7c8532 100644 +index 89b4122c..999c32f6 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -51,7 +51,7 @@ index 849ec128..dd7c8532 100644 import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; -@@ -405,7 +406,10 @@ public final class UserConnection implements ProxiedPlayer +@@ -406,7 +407,10 @@ public final class UserConnection implements ProxiedPlayer private String connectionFailMessage(Throwable cause) { @@ -64,7 +64,7 @@ index 849ec128..dd7c8532 100644 } 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 c6d552e7..477ca39a 100644 +index 0957c1f1..7209ac64 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 @@ -372,7 +372,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -139,5 +139,5 @@ index c8748ce5..778deb63 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.36.1.windows.1 +2.34.1 diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index d91ca0a1..74f9abc9 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From c8a6949b1219f4c384d49f6db28a1b522ed4017c Mon Sep 17 00:00:00 2001 +From b4d62f8bb20ed8b13f50c7993786dfe086c0311c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -49,7 +49,7 @@ index 558d0dbb..35236382 100644 - // Waterfall end } 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 -index 56f01363..7b9303fc 100644 +index f8d4721e..ca918057 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -20,8 +20,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -324,7 +324,7 @@ index cb98a8ea..c0b42ee2 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 dd7c8532..3950ce42 100644 +index 999c32f6..f2c60db6 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -353,7 +353,7 @@ index dd7c8532..3950ce42 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -787,10 +782,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -788,10 +783,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } @@ -3233,5 +3233,5 @@ index caed4384..af428090 100644 } -- -2.36.1.windows.1 +2.34.1 From a1be830a6ef2f7ddaac03d8880fa959fd4a46832 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Wed, 8 Jun 2022 10:30:07 -0300 Subject: [PATCH 282/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 59dbd083..9c65274d 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 59dbd0833d2d681d65403819b0ead83094e18237 +Subproject commit 9c65274dabb530630007508a86373b90e3e20893 From dc4fb3b6cddb0c680381b9fc98ff6147a39f709e Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Wed, 8 Jun 2022 10:30:45 -0300 Subject: [PATCH 283/499] 1.0.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 705bddbd..41f4d63a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.0"; ++ return "1.0.1"; } public void reloadMessages() From 106cd019da5ec31a95b3a369e9f3cff3fa6eac10 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Wed, 8 Jun 2022 20:00:48 +0200 Subject: [PATCH 284/499] Updated upstream and messages --- Waterfall | 2 +- .../0004-1.7.x-support.patch | 22 +++++++++---------- ...0019-FlameCord-message-configuration.patch | 15 +++++++------ .../0029-Antibot-System.patch | 10 ++++----- ...0032-Disable-entity-Metadata-Rewrite.patch | 10 ++++----- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Waterfall b/Waterfall index 9c65274d..e4f1e3ff 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9c65274dabb530630007508a86373b90e3e20893 +Subproject commit e4f1e3ff8d1b6ec226c3f1e00e5b0c495d9f9b6a diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 60333ef8..95976ea6 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,14 +1,14 @@ -From 7afd78ade68587c487a3922481a89f8832819aa0 Mon Sep 17 00:00:00 2001 +From 9301ed33769f86530bef028fbd6943e3d925b24a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index 55c6ee72..56684de7 100644 +index bafef27c..8efe1ef0 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -364,4 +364,36 @@ public abstract class DefinedPacket +@@ -370,4 +370,36 @@ public abstract class DefinedPacket return 0; } // Waterfall end @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 12a4d565..cd34f29f 100644 +index 0a3c7d89..b18fbef4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1053,7 +1053,7 @@ index ba7fc59c..d672c8ef 100644 throw CancelSendSignal.INSTANCE; } 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 b7d363b8..f4f67b35 100644 +index b44d13e5..2d72e26e 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer @@ -1065,7 +1065,7 @@ index b7d363b8..f4f67b35 100644 displayName = name; } -@@ -518,7 +520,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -524,7 +526,7 @@ public final class UserConnection implements ProxiedPlayer // transform score components message = ChatComponentTransformer.getInstance().transform( this, true, message ); @@ -1074,7 +1074,7 @@ index b7d363b8..f4f67b35 100644 { // Versions older than 1.11 cannot send the Action bar with the new JSON formattings // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -714,6 +716,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -720,6 +722,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent header, BaseComponent footer) { @@ -1082,7 +1082,7 @@ index b7d363b8..f4f67b35 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; -@@ -726,6 +729,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -732,6 +735,7 @@ public final class UserConnection implements ProxiedPlayer @Override public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) { @@ -1090,7 +1090,7 @@ index b7d363b8..f4f67b35 100644 header = ChatComponentTransformer.getInstance().transform( this, true, header ); footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); -@@ -755,6 +759,7 @@ public final class UserConnection implements ProxiedPlayer +@@ -761,6 +765,7 @@ public final class UserConnection implements ProxiedPlayer public void setCompressionThreshold(int compressionThreshold) { @@ -1229,7 +1229,7 @@ index 6df3f3dd..a409d440 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 b9a4b03c..5a3555a6 100644 +index 6240204e..fa87750f 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 @@ -87,7 +87,12 @@ public class UpstreamBridge extends PacketHandler @@ -1621,5 +1621,5 @@ index daf12f74..7d053485 100644 @Override -- -2.34.1 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index 9e8e01bd..ed50fa43 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From cb76c6ea58a87229b54a1459474f8d622f970262 Mon Sep 17 00:00:00 2001 +From 5307c5cb4ab7cc87761c9e2d4a7abcf27388b28e Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -34,10 +34,10 @@ index ac37eaa3..c78ab3a7 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..57462992 +index 00000000..4f306660 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,113 @@ +@@ -0,0 +1,114 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -82,8 +82,6 @@ index 00000000..57462992 + "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); + setIfUnexistant("fallback_lobby", + "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("timeout", -+ "Server not reachable (timeout). Offline? Incorrectly configured address/port/firewall?", configuration); + setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); + setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", + configuration); @@ -103,6 +101,9 @@ index 00000000..57462992 + setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); + setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); + setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); ++ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); ++ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); + setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); + setIfUnexistant("error_occurred_player", + "&cAn error occurred while parsing your message. (Hover for details)", configuration); @@ -200,7 +201,7 @@ index 91d60bfb..cc76325b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b6ecffc3..62cd066d 100644 +index 745d8efb..e564458f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -594,14 +594,8 @@ public class BungeeCord extends ProxyServer @@ -221,5 +222,5 @@ index b6ecffc3..62cd066d 100644 @Override -- -2.32.0 +2.36.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 597fb537..d58c99c4 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From e422abdffacba77082117395fb7831a46cd5cad0 Mon Sep 17 00:00:00 2001 +From fd425f8a23b16f34f1a538cb1f7c64cab08cfb33 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -908,10 +908,10 @@ index 5d92c20c..da3f915f 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 57462992..ee0295c7 100644 +index 4f306660..33c40733 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -81,6 +81,17 @@ public class MessagesConfiguration extends FlameConfig { +@@ -82,6 +82,17 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); @@ -930,7 +930,7 @@ index 57462992..ee0295c7 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 75956d4a..716949ae 100644 +index caff4e99..ad5fc0ae 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 @@ -20,6 +20,8 @@ import java.util.logging.Level; @@ -1059,7 +1059,7 @@ index 75956d4a..716949ae 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 5a3555a6..7dfff614 100644 +index fa87750f..67263bca 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,10 +4,15 @@ import com.google.common.base.Preconditions; diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index 74f9abc9..70529295 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From b4d62f8bb20ed8b13f50c7993786dfe086c0311c Mon Sep 17 00:00:00 2001 +From a0dc7dba773619cee8639cb1707ca40ece5717bc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -324,7 +324,7 @@ index cb98a8ea..c0b42ee2 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 999c32f6..f2c60db6 100644 +index 7c0c2fff..d37f419a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -353,7 +353,7 @@ index 999c32f6..f2c60db6 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -788,10 +783,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -794,10 +789,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } @@ -433,7 +433,7 @@ index 6082d40c..194ada04 100644 public void handle(Respawn respawn) { 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 7dfff614..9256477e 100644 +index 67263bca..bd6fe2d5 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 @@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -3233,5 +3233,5 @@ index caed4384..af428090 100644 } -- -2.34.1 +2.36.1.windows.1 From 55f62ff547bb3cc5f40c94f9f6d73e1e3a281793 Mon Sep 17 00:00:00 2001 From: LinsaFTW Date: Thu, 9 Jun 2022 10:27:37 -0300 Subject: [PATCH 285/499] 1.0.2 --- Waterfall | 2 +- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall b/Waterfall index e4f1e3ff..9c65274d 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit e4f1e3ff8d1b6ec226c3f1e00e5b0c495d9f9b6a +Subproject commit 9c65274dabb530630007508a86373b90e3e20893 diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 41f4d63a..f56d108b 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.1"; ++ return "1.0.2"; } public void reloadMessages() From 6bfd1178b39f2182732269c63fd5d8da8d3b8671 Mon Sep 17 00:00:00 2001 From: Luccboy <58391278+Luccboy@users.noreply.github.com> Date: Tue, 14 Jun 2022 12:49:38 +0200 Subject: [PATCH 286/499] Updated Upstream (Waterfall) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by 2LStudios and as with ANY update, please do your own testing Waterfall Changes: a033a14 Disable tab list rewriting by default ef0fc26 Fix packet IDs being bork due to optimisation attempt 4e0049a Add Protocol version to the packet not found messages e4f1e3f Updated Upstream (BungeeCord) --- Waterfall | 2 +- .../0004-1.7.x-support.patch | 58 +++++++++---------- ...0032-Disable-entity-Metadata-Rewrite.patch | 16 ++--- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Waterfall b/Waterfall index 9c65274d..a033a145 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 9c65274dabb530630007508a86373b90e3e20893 +Subproject commit a033a14504062b2e890a9b8ba24595abab6351d6 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 95976ea6..1f2c394f 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 9301ed33769f86530bef028fbd6943e3d925b24a Mon Sep 17 00:00:00 2001 +From a8d52e032cf7360eccb8b5b1cf3530a5563551bd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -46,10 +46,10 @@ index bafef27c..8efe1ef0 100644 + // FlameCord end - 1.7.x support } 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 -index 014383b3..f8d4721e 100644 +index f5a675a9..0d1cbbdb 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -62,7 +62,7 @@ public enum Protocol +@@ -64,7 +64,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, @@ -58,7 +58,7 @@ index 014383b3..f8d4721e 100644 ); } }, -@@ -74,7 +74,7 @@ public enum Protocol +@@ -76,7 +76,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, @@ -67,7 +67,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -87,7 +87,7 @@ public enum Protocol +@@ -89,7 +89,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, @@ -76,7 +76,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -98,7 +98,7 @@ public enum Protocol +@@ -100,7 +100,7 @@ public enum Protocol ); TO_CLIENT.registerPacket( Chat.class, Chat::new, @@ -85,7 +85,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -109,7 +109,7 @@ public enum Protocol +@@ -111,7 +111,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,20 +94,20 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -139,20 +139,20 @@ public enum Protocol +@@ -141,20 +141,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, - map(ProtocolConstants.MINECRAFT_1_8, 0x1D), + map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support - map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + map(ProtocolConstants.MINECRAFT_1_9, -1) ); TO_CLIENT.registerPacket( EntityRemoveEffect.class, EntityRemoveEffect::new, - map(ProtocolConstants.MINECRAFT_1_8, 0x1E), + map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support - map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) + map(ProtocolConstants.MINECRAFT_1_9, -1) ); // Waterfall end TO_CLIENT.registerPacket( @@ -118,7 +118,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -166,7 +166,7 @@ public enum Protocol +@@ -168,7 +168,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -178,7 +178,7 @@ public enum Protocol +@@ -180,7 +180,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -190,7 +190,7 @@ public enum Protocol +@@ -192,7 +192,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -145,7 +145,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -202,7 +202,7 @@ public enum Protocol +@@ -204,7 +204,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, @@ -154,7 +154,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -214,7 +214,7 @@ public enum Protocol +@@ -216,7 +216,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -226,7 +226,7 @@ public enum Protocol +@@ -228,7 +228,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -239,7 +239,7 @@ public enum Protocol +@@ -241,7 +241,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -252,7 +252,7 @@ public enum Protocol +@@ -254,7 +254,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -288,7 +288,7 @@ public enum Protocol +@@ -290,7 +290,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -304,7 +304,7 @@ public enum Protocol +@@ -306,7 +306,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -346,7 +346,7 @@ public enum Protocol +@@ -348,7 +348,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -358,7 +358,7 @@ public enum Protocol +@@ -360,7 +360,7 @@ public enum Protocol ); TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -378,7 +378,7 @@ public enum Protocol +@@ -380,7 +380,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -389,7 +389,7 @@ public enum Protocol +@@ -391,7 +391,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -399,7 +399,7 @@ public enum Protocol +@@ -401,7 +401,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index 014383b3..f8d4721e 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -418,23 +418,23 @@ public enum Protocol +@@ -420,23 +420,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index 014383b3..f8d4721e 100644 ); } }, -@@ -446,22 +446,22 @@ public enum Protocol +@@ -448,22 +448,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index 014383b3..f8d4721e 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -472,12 +472,12 @@ public enum Protocol +@@ -474,12 +474,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0a3c7d89..b18fbef4 100644 +index fc1a2b94..c0a02d4d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index 70529295..89af7b98 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From a0dc7dba773619cee8639cb1707ca40ece5717bc Mon Sep 17 00:00:00 2001 +From 62b34dc8e92b165c3200ddfe2f3fb72f1770e818 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -49,10 +49,10 @@ index 558d0dbb..35236382 100644 - // Waterfall end } 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 -index f8d4721e..ca918057 100644 +index 0d1cbbdb..d19b67ae 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -20,8 +20,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; +@@ -22,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; import net.md_5.bungee.protocol.packet.EncryptionResponse; import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; @@ -61,7 +61,7 @@ index f8d4721e..ca918057 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -135,20 +133,6 @@ public enum Protocol +@@ -137,20 +135,6 @@ public enum Protocol PlayerChat::new, map( ProtocolConstants.MINECRAFT_1_19, 0x30 ) ); @@ -70,13 +70,13 @@ index f8d4721e..ca918057 100644 - EntityEffect.class, - EntityEffect::new, - map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support -- map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) +- map(ProtocolConstants.MINECRAFT_1_9, -1) - ); - TO_CLIENT.registerPacket( - EntityRemoveEffect.class, - EntityRemoveEffect::new, - map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support -- map(ProtocolConstants.MINECRAFT_1_9, Integer.MIN_VALUE) +- map(ProtocolConstants.MINECRAFT_1_9, -1) - ); - // Waterfall end TO_CLIENT.registerPacket( @@ -207,7 +207,7 @@ index 435b8578..00000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index ff4bbf34..a008b132 100644 +index 966d2442..be337a68 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { @@ -215,7 +215,7 @@ index ff4bbf34..a008b132 100644 private boolean disableModernTabLimiter = true; - private boolean disableEntityMetadataRewrite = false; - private boolean disableTabListRewrite = false; + private boolean disableTabListRewrite = true; /* @@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { From 460b0f0c11f431533f5c71867069834233fe685b Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:59:59 -0300 Subject: [PATCH 287/499] 1.0.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index f56d108b..a9b8f336 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.2"; ++ return "1.0.3"; } public void reloadMessages() From 15517da3f2dbb6972a7305e780be7a8234dcbc58 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sun, 10 Jul 2022 22:14:23 -0300 Subject: [PATCH 288/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index a033a145..47c47905 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit a033a14504062b2e890a9b8ba24595abab6351d6 +Subproject commit 47c4790542d5ca23264816e8ecad13518b8294e6 From 39622ac5c9d6bdffb600ce2ff60bc542cc4d8726 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:36:40 -0300 Subject: [PATCH 289/499] 1.0.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index a9b8f336..dfda60c8 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.3"; ++ return "1.0.4"; } public void reloadMessages() From 544492fb6382056cb9120cfd28a9e6054f488f43 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Thu, 14 Jul 2022 17:04:01 -0300 Subject: [PATCH 290/499] fix timeout being detected by the firewall system --- .../0004-1.7.x-support.patch | 10 +++---- ...ake-PlayerHandshakeEvent-cancellable.patch | 8 ++--- ...ections-Don-t-flush-if-not-necessary.patch | 22 +++++++------- ...tom-uuids-even-if-onlineMode-is-true.patch | 8 ++--- ...-Don-t-declare-uuid-unless-it-s-null.patch | 8 ++--- .../0017-FlameCord-General-Patch.patch | 14 ++++----- .../0022-FlameCord-logger-options.patch | 14 ++++----- .../0026-Custom-motd-system.patch | 10 +++---- ...0028-InitialHandler-Processing-State.patch | 18 +++++------ .../0029-Antibot-System.patch | 30 ++++++++++++------- .../0030-Allow-Invalid-Names.patch | 8 ++--- 11 files changed, 80 insertions(+), 70 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 1f2c394f..c012d186 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From a8d52e032cf7360eccb8b5b1cf3530a5563551bd Mon Sep 17 00:00:00 2001 +From 2cd7efb81fd991e0da79090038a0abc6192d4dbb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index fc1a2b94..c0a02d4d 100644 +index 3ee1464b..14a4197c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1168,7 +1168,7 @@ index 97c4b210..6082d40c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 ed1fe41a..7ddda6c3 100644 +index 24893418..d1bcfadb 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1181,7 +1181,7 @@ index ed1fe41a..7ddda6c3 100644 import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.SocketAddress; -@@ -259,8 +262,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -279,8 +282,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -1621,5 +1621,5 @@ index daf12f74..7d053485 100644 @Override -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 2a658722..8ea7ad38 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From dc40048d350211b27c7418575f25b5bc90325626 Mon Sep 17 00:00:00 2001 +From 2e498d47fb1f9745b08b5cd91c8117892dfd90e4 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 134c8a1d..3372fb71 100644 +index d1bcfadb..c5965c0f 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 -@@ -340,7 +340,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -360,7 +360,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index 134c8a1d..3372fb71 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 1054ca59..b96d4d6b 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,17 +1,17 @@ -From 3eb1986d6a7a41e141243a72281ca574cc258bca Mon Sep 17 00:00:00 2001 +From 71299ecf762c2761414305e82f430a416a513f88 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 3372fb71..02e36035 100644 +index c5965c0f..b53ee6f7 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 -@@ -197,6 +197,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } +@@ -207,6 +207,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } - ServerPing legacy = result.getResponse(); + ServerPing legacy = result.getResponse(); + + // FlameCord - Close and return if legacy == null + if (legacy == null) { @@ -19,10 +19,10 @@ index 3372fb71..02e36035 100644 + return; + } + - String kickMessage; + String kickMessage; - if ( v1_5 ) -@@ -262,6 +269,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection + if ( v1_5 ) +@@ -282,6 +289,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -40,7 +40,7 @@ index 3372fb71..02e36035 100644 // FlameCord start - 1.7.x support Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -306,11 +324,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -326,11 +344,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -58,7 +58,7 @@ index 3372fb71..02e36035 100644 } @Override -@@ -644,7 +664,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -664,7 +684,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -175,5 +175,5 @@ index b2b19996..b1ecb7ef 100644 } -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 266978c3..64c10ac4 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From e1a764e21fc1c6329271b609847e4850688ab05f Mon Sep 17 00:00:00 2001 +From f50800ffe1780e78e2ac40377f98b906e1121fc7 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 02e36035..faa548b2 100644 +index b53ee6f7..28761766 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 -@@ -722,7 +722,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -742,7 +742,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index 02e36035..faa548b2 100644 } -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index 8d098643..b85e32bf 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 09ed510ba131556b9b64e52d4adf1b5836f537fe Mon Sep 17 00:00:00 2001 +From 98697593accf0d992c113a81c1ab3a67e2807048 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 faa548b2..fb9a8a19 100644 +index 28761766..80d8ab24 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 -@@ -532,7 +532,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -552,7 +552,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index faa548b2..fb9a8a19 100644 return; } -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 8747bca8..2220952d 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 36c2b4b28806f491a6fa680be25afe6ba03179f1 Mon Sep 17 00:00:00 2001 +From 7dd527ef1aac693470f03f18b8a276147e909099 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index cd34f29f..824dfca8 100644 +index 14a4197c..eb53d9aa 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -285,7 +285,7 @@ index 9067b806..cb98a8ea 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 5293552d..89b4122c 100644 +index 94702434..e48f7713 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -319,7 +319,7 @@ index 5293552d..89b4122c 100644 b.connect().addListener( listener ); } 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 72328eed..0957c1f1 100644 +index 80d8ab24..3bf47365 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 @@ -20,6 +20,8 @@ import java.util.logging.Level; @@ -331,7 +331,7 @@ index 72328eed..0957c1f1 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -159,7 +161,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -158,7 +160,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { @@ -353,7 +353,7 @@ index a409d440..3503c089 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 675fa8f1..c8748ce5 100644 +index 4820267b..694ecdb0 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -379,5 +379,5 @@ index a95193ba..a4c3bd71 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.34.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index ebfdcd3b..38c84102 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 8e2ea1839113e4c4c7775e6e8cf82fc51b443f4f Mon Sep 17 00:00:00 2001 +From 8dd5f12ca0bc67b8f7ea7257e4a2b1f8c2b4e7f6 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -40,7 +40,7 @@ index c8148e90..c327841a 100644 } catch (final IOException e) { e.printStackTrace(); 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 89b4122c..999c32f6 100644 +index e48f7713..7c0c2fff 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -64,10 +64,10 @@ index 89b4122c..999c32f6 100644 } 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 0957c1f1..7209ac64 100644 +index 3bf47365..af128f0b 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 -@@ -372,7 +372,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -392,7 +392,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -77,7 +77,7 @@ index 0957c1f1..7209ac64 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -381,7 +382,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -401,7 +402,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -88,7 +88,7 @@ index 0957c1f1..7209ac64 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index c8748ce5..778deb63 100644 +index 694ecdb0..14e3004f 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -139,5 +139,5 @@ index c8748ce5..778deb63 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.34.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 4760ace1..c4c011db 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From d9798110ca3de1602a74372db57a5161cc07c382 Mon Sep 17 00:00:00 2001 +From 2e496d47435bb97de442fe1a12020c695169f634 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -125,7 +125,7 @@ index c327841a..de2cc947 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 477ca39a..e6b5e5da 100644 +index af128f0b..9b2d8842 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 @@ -22,6 +22,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -137,7 +137,7 @@ index 477ca39a..e6b5e5da 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -252,7 +254,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -272,7 +274,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); @@ -145,7 +145,7 @@ index 477ca39a..e6b5e5da 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -315,7 +316,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -335,7 +336,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { @@ -200,5 +200,5 @@ index 477ca39a..e6b5e5da 100644 thisState = State.PING; -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 6d765ee1..27f7946a 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From 1dab3e8e846bfac8bb6c6bc2293e8a9839ba3f0b Mon Sep 17 00:00:00 2001 +From e235d2ea3d258d995b5e06cf0f6fd474863510fb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 e6b5e5da..75956d4a 100644 +index 9b2d8842..14461824 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 -@@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -131,12 +131,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection private enum State { @@ -23,7 +23,7 @@ index e6b5e5da..75956d4a 100644 } @Override -@@ -252,6 +252,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -272,6 +272,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -31,7 +31,7 @@ index e6b5e5da..75956d4a 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -374,6 +375,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -394,6 +395,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index e6b5e5da..75956d4a 100644 unsafe.sendPacket( ping ); -@@ -385,6 +387,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -405,6 +407,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index e6b5e5da..75956d4a 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); -@@ -457,6 +460,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -477,6 +480,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index e6b5e5da..75956d4a 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -767,14 +771,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -787,14 +791,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { @@ -73,5 +73,5 @@ index e6b5e5da..75956d4a 100644 this.uniqueId = uuid; } -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index d58c99c4..aa5a9c07 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From fd425f8a23b16f34f1a538cb1f7c64cab08cfb33 Mon Sep 17 00:00:00 2001 +From 7ff5f4b942384c2e27a65e84a793121bab6aff93 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -930,7 +930,7 @@ index 4f306660..33c40733 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 caff4e99..ad5fc0ae 100644 +index 14461824..bc73abe7 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 @@ -20,6 +20,8 @@ import java.util.logging.Level; @@ -942,7 +942,7 @@ index caff4e99..ad5fc0ae 100644 import dev._2lstudios.flamecord.FlameCord; import dev._2lstudios.flamecord.configuration.FlameConfig; -@@ -417,6 +419,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -437,6 +439,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -954,7 +954,7 @@ index caff4e99..ad5fc0ae 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -428,6 +435,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -448,6 +455,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -977,7 +977,7 @@ index caff4e99..ad5fc0ae 100644 break; case 2: // Login -@@ -439,6 +462,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -459,6 +482,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -999,7 +999,7 @@ index caff4e99..ad5fc0ae 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -499,6 +537,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -519,6 +557,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1112,17 +1112,27 @@ index fa87750f..67263bca 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 20c4c0a4..c737482e 100644 +index 65e79eec..dc2b6a7f 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -152,6 +152,13 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; + import java.io.IOException; + import java.net.InetSocketAddress; + import java.util.logging.Level; ++ ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.ProxyServer; + import net.md_5.bungee.connection.CancelSendSignal; + import net.md_5.bungee.connection.InitialHandler; +@@ -152,6 +154,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { boolean logExceptions = !( handler instanceof PingHandler ); + // Flamecord start - Antibot System -+ if (!(cause instanceof ReadTimeoutException && cause instanceof IOException)) ++ if (!(cause instanceof ReadTimeoutException) && !(cause instanceof IOException)) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getName(), ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + @@ -1154,5 +1164,5 @@ index ffea1599..6bf109f5 100644 { ch.close(); -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 1b3b62a7..bfda059c 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From f1ef24bf5679ec5b5f06df202a1f3952a8f2f65e Mon Sep 17 00:00:00 2001 +From 87c99406b973f087404a0f3e9af20f2daf94d613 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -29,10 +29,10 @@ index da3f915f..31631626 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 716949ae..7c539248 100644 +index bc73abe7..4c26462c 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 -@@ -500,7 +500,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -520,7 +520,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; @@ -42,5 +42,5 @@ index 716949ae..7c539248 100644 disconnect( bungee.getTranslation( "name_invalid" ) ); return; -- -2.36.1.windows.1 +2.37.0.windows.1 From aa5aeee49727ea2902630890358a11fe7bed7343 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Sun, 17 Jul 2022 11:15:40 +0200 Subject: [PATCH 291/499] Fix firewall and make it configurable --- .../0034-Fix-firewall-system.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch diff --git a/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch b/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch new file mode 100644 index 00000000..f4a262b9 --- /dev/null +++ b/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch @@ -0,0 +1,43 @@ +From 337765289b483876d466a7a194492a625f75e2a7 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Sun, 17 Jul 2022 11:13:51 +0200 +Subject: [PATCH] Fix firewall system + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 31631626..c443b8d1 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -36,6 +36,8 @@ public class FlameCordConfiguration extends FlameConfig { + @Getter + private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); + @Getter ++ private Collection antibotFirewalledPackets = Arrays.asList("BadPacketException","QuietException","IllegalStateConfig","FastException"); ++ @Getter + private boolean antibotCountryLog = true; + @Getter + private boolean antibotFastChatEnabled = true; +@@ -108,6 +110,7 @@ public class FlameCordConfiguration extends FlameConfig { + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); + this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); + this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); ++ this.antibotFirewalledPackets = setIfUnexistant("antibot.firewall.packets", this.antibotFirewalledPackets, config); + this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index dc2b6a7f..68d7b732 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -155,7 +155,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + boolean logExceptions = !( handler instanceof PingHandler ); + + // Flamecord start - Antibot System +- if (!(cause instanceof ReadTimeoutException) && !(cause instanceof IOException)) ++ if (cause == FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledPackets()) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getName(), ctx.channel().remoteAddress() ); +-- +2.34.1.windows.1 + From 35525953462b681b45c10e420aa6e232a43d0f73 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Thu, 21 Jul 2022 11:20:58 -0300 Subject: [PATCH 292/499] Configurable firewall exceptions (avoids errors) --- .../0029-Antibot-System.patch | 15 ++++--- .../0030-Allow-Invalid-Names.patch | 6 +-- .../0034-Fix-firewall-system.patch | 43 ------------------- 3 files changed, 12 insertions(+), 52 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index aa5a9c07..52cbf7c1 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 7ff5f4b942384c2e27a65e84a793121bab6aff93 Mon Sep 17 00:00:00 2001 +From 1d11012be7d3fa103d4911afe05daf603f974e79 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -774,10 +774,10 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 5d92c20c..da3f915f 100644 +index 5d92c20c..dbec217d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,120 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,123 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -797,6 +797,8 @@ index 5d92c20c..da3f915f 100644 + @Getter + private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); + @Getter ++ private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException","QuietException","IllegalStateConfig","FastException"); ++ @Getter + private boolean antibotCountryLog = true; + @Getter + private boolean antibotFastChatEnabled = true; @@ -869,6 +871,7 @@ index 5d92c20c..da3f915f 100644 + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); + this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); + this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); ++ this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); + this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); @@ -898,7 +901,7 @@ index 5d92c20c..da3f915f 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +231,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +234,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1112,7 +1115,7 @@ index fa87750f..67263bca 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 65e79eec..dc2b6a7f 100644 +index 65e79eec..423ae995 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1129,7 +1132,7 @@ index 65e79eec..dc2b6a7f 100644 boolean logExceptions = !( handler instanceof PingHandler ); + // Flamecord start - Antibot System -+ if (!(cause instanceof ReadTimeoutException) && !(cause instanceof IOException)) ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getName())) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getName(), ctx.channel().remoteAddress() ); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index bfda059c..7f3fe011 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 87c99406b973f087404a0f3e9af20f2daf94d613 Mon Sep 17 00:00:00 2001 +From a5c543d62975b9bfed3eabd7d60d91b7493ddcaf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index da3f915f..31631626 100644 +index dbec217d..628f81d0 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index da3f915f..31631626 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -231,6 +235,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -234,6 +238,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch b/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch deleted file mode 100644 index f4a262b9..00000000 --- a/Waterfall-Proxy-Patches/0034-Fix-firewall-system.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 337765289b483876d466a7a194492a625f75e2a7 Mon Sep 17 00:00:00 2001 -From: xIsm4 -Date: Sun, 17 Jul 2022 11:13:51 +0200 -Subject: [PATCH] Fix firewall system - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 31631626..c443b8d1 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -36,6 +36,8 @@ public class FlameCordConfiguration extends FlameConfig { - @Getter - private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); - @Getter -+ private Collection antibotFirewalledPackets = Arrays.asList("BadPacketException","QuietException","IllegalStateConfig","FastException"); -+ @Getter - private boolean antibotCountryLog = true; - @Getter - private boolean antibotFastChatEnabled = true; -@@ -108,6 +110,7 @@ public class FlameCordConfiguration extends FlameConfig { - this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); - this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); - this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); -+ this.antibotFirewalledPackets = setIfUnexistant("antibot.firewall.packets", this.antibotFirewalledPackets, config); - this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); - this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); - this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index dc2b6a7f..68d7b732 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -155,7 +155,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - boolean logExceptions = !( handler instanceof PingHandler ); - - // Flamecord start - Antibot System -- if (!(cause instanceof ReadTimeoutException) && !(cause instanceof IOException)) -+ if (cause == FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledPackets()) - { - FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); - BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getName(), ctx.channel().remoteAddress() ); --- -2.34.1.windows.1 - From fec040c63025a6a13d20c7fc0d59bd3e79766a0e Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:22:02 -0300 Subject: [PATCH 293/499] 1.0.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index dfda60c8..c7e5c9e3 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.4"; ++ return "1.0.5"; } public void reloadMessages() From 242796e90209e122a98b3cb1df59d55ecb51f5a6 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Thu, 28 Jul 2022 10:53:09 -0300 Subject: [PATCH 294/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0001-FlameCord-POM-Changes.patch | 8 +- .../0004-1.7.x-support.patch | 64 +++++++-------- ...ake-PlayerHandshakeEvent-cancellable.patch | 6 +- ...ections-Don-t-flush-if-not-necessary.patch | 12 +-- ...tom-uuids-even-if-onlineMode-is-true.patch | 6 +- ...-Don-t-declare-uuid-unless-it-s-null.patch | 6 +- .../0017-FlameCord-General-Patch.patch | 12 +-- .../0020-Fix-ByteBuf-memory-leaks.patch | 8 +- .../0022-FlameCord-logger-options.patch | 8 +- .../0026-Custom-motd-system.patch | 10 +-- ...0028-InitialHandler-Processing-State.patch | 16 ++-- .../0029-Antibot-System.patch | 77 +++++++++++++------ .../0030-Allow-Invalid-Names.patch | 8 +- ...0032-Disable-entity-Metadata-Rewrite.patch | 28 +++---- 15 files changed, 152 insertions(+), 119 deletions(-) diff --git a/Waterfall b/Waterfall index 47c47905..097888c7 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 47c4790542d5ca23264816e8ecad13518b8294e6 +Subproject commit 097888c72ab4afa14c5b543d7205ec91085444a4 diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index 14b53ad5..2da0b2fa 100644 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 78f08ffc6b5a3860c958d66ac3c469c39aff35ff Mon Sep 17 00:00:00 2001 +From 01758bf18170f703930757151d86c9440e8793da Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -86,10 +86,10 @@ index 93ae5952..d6222d16 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 72b7f3a9..47fd853e 100644 +index 1036a2e7..10fe411d 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -150,6 +150,51 @@ +@@ -157,6 +157,51 @@ runtime @@ -142,5 +142,5 @@ index 72b7f3a9..47fd853e 100644 -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index c012d186..1fb96e37 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 2cd7efb81fd991e0da79090038a0abc6192d4dbb Mon Sep 17 00:00:00 2001 +From 96bfa8b877c1f97e15f58e9092b7c8406625a72d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -46,10 +46,10 @@ index bafef27c..8efe1ef0 100644 + // FlameCord end - 1.7.x support } 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 -index f5a675a9..0d1cbbdb 100644 +index fb126a21..3787b21c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -64,7 +64,7 @@ public enum Protocol +@@ -63,7 +63,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, @@ -58,7 +58,7 @@ index f5a675a9..0d1cbbdb 100644 ); } }, -@@ -76,7 +76,7 @@ public enum Protocol +@@ -75,7 +75,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, @@ -76,7 +76,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -100,7 +100,7 @@ public enum Protocol +@@ -101,7 +101,7 @@ public enum Protocol ); TO_CLIENT.registerPacket( Chat.class, Chat::new, @@ -85,7 +85,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -111,7 +111,7 @@ public enum Protocol +@@ -112,7 +112,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,7 +94,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -141,20 +141,20 @@ public enum Protocol +@@ -138,20 +138,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, @@ -118,7 +118,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -168,7 +168,7 @@ public enum Protocol +@@ -166,7 +166,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -180,7 +180,7 @@ public enum Protocol +@@ -178,7 +178,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -192,7 +192,7 @@ public enum Protocol +@@ -191,7 +191,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -154,7 +154,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -216,7 +216,7 @@ public enum Protocol +@@ -217,7 +217,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -228,7 +228,7 @@ public enum Protocol +@@ -230,7 +230,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -241,7 +241,7 @@ public enum Protocol +@@ -244,7 +244,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -254,7 +254,7 @@ public enum Protocol +@@ -258,7 +258,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -290,7 +290,7 @@ public enum Protocol +@@ -298,7 +298,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -306,7 +306,7 @@ public enum Protocol +@@ -315,7 +315,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -348,7 +348,7 @@ public enum Protocol +@@ -360,7 +360,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -360,7 +360,7 @@ public enum Protocol +@@ -373,7 +373,7 @@ public enum Protocol ); TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -380,7 +380,7 @@ public enum Protocol +@@ -395,7 +395,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -391,7 +391,7 @@ public enum Protocol +@@ -407,7 +407,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -401,7 +401,7 @@ public enum Protocol +@@ -418,7 +418,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index f5a675a9..0d1cbbdb 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -420,23 +420,23 @@ public enum Protocol +@@ -438,23 +438,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index f5a675a9..0d1cbbdb 100644 ); } }, -@@ -448,22 +448,22 @@ public enum Protocol +@@ -466,22 +466,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index f5a675a9..0d1cbbdb 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -474,12 +474,12 @@ public enum Protocol +@@ -492,12 +492,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -324,7 +324,7 @@ index f5a675a9..0d1cbbdb 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index 164b544e..c12d2885 100644 +index aa5daf47..a6b13aa1 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index 164b544e..c12d2885 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -45,6 +49,7 @@ public class ProtocolConstants +@@ -46,6 +50,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,7 +346,7 @@ index 164b544e..c12d2885 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -59,6 +64,10 @@ public class ProtocolConstants +@@ -60,6 +65,10 @@ public class ProtocolConstants "1.19.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3ee1464b..14a4197c 100644 +index dfd38e32..43381641 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1000,7 +1000,7 @@ index 491cf1a1..6cd8ec3b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index ba7fc59c..d672c8ef 100644 +index 8181d76b..c23c7ff9 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler @@ -1168,7 +1168,7 @@ index 97c4b210..6082d40c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 24893418..d1bcfadb 100644 +index 6011078f..c6a3f1b8 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1181,7 +1181,7 @@ index 24893418..d1bcfadb 100644 import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.SocketAddress; -@@ -279,8 +282,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -280,8 +283,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -1247,7 +1247,7 @@ index 6240204e..fa87750f 100644 con.getServer().disconnect( "Quitting" ); } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 59d63cc2..73fd60e0 100644 +index 1b639a23..b285fead 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -34,6 +34,12 @@ public abstract class EntityMap diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 8ea7ad38..eda1b0b7 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,4 +1,4 @@ -From 2e498d47fb1f9745b08b5cd91c8117892dfd90e4 Mon Sep 17 00:00:00 2001 +From bcd1ccc0bed71e4a478d5c2a4988c6b6583df66c Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 d1bcfadb..c5965c0f 100644 +index c6a3f1b8..b307b5ca 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 -@@ -360,7 +360,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -361,7 +361,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index b96d4d6b..b0eed56a 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From 71299ecf762c2761414305e82f430a416a513f88 Mon Sep 17 00:00:00 2001 +From 445627b3ac1dc3bcbb85a4ce24164550df456144 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 c5965c0f..b53ee6f7 100644 +index b307b5ca..b7389a54 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 -@@ -207,6 +207,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index c5965c0f..b53ee6f7 100644 String kickMessage; if ( v1_5 ) -@@ -282,6 +289,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -283,6 +290,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -40,7 +40,7 @@ index c5965c0f..b53ee6f7 100644 // FlameCord start - 1.7.x support Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -326,11 +344,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -327,11 +345,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -58,7 +58,7 @@ index c5965c0f..b53ee6f7 100644 } @Override -@@ -664,7 +684,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -690,7 +710,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 64c10ac4..59cde9a1 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From f50800ffe1780e78e2ac40377f98b906e1121fc7 Mon Sep 17 00:00:00 2001 +From 94a3fa4d4735f4a136fc11796091f6d5d80d02d2 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 b53ee6f7..28761766 100644 +index b7389a54..c4b64a4b 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 -@@ -742,7 +742,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -768,7 +768,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index b85e32bf..520f3c4e 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From 98697593accf0d992c113a81c1ab3a67e2807048 Mon Sep 17 00:00:00 2001 +From cf93a1e99eafa0811416ca8ccec782805449af07 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 28761766..80d8ab24 100644 +index c4b64a4b..74199d2e 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 -@@ -552,7 +552,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -557,7 +557,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 2220952d..8bb213a9 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 7dd527ef1aac693470f03f18b8a276147e909099 Mon Sep 17 00:00:00 2001 +From b957e422d579add68cf389e7250903135a2ebf55 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 14a4197c..eb53d9aa 100644 +index 43381641..eb0f9a39 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -263,7 +263,7 @@ index 14a4197c..eb53d9aa 100644 { } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 9067b806..cb98a8ea 100644 +index da688839..055a1d88 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -2,6 +2,8 @@ package net.md_5.bungee; @@ -319,10 +319,10 @@ index 94702434..e48f7713 100644 b.connect().addListener( listener ); } 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 80d8ab24..3bf47365 100644 +index 74199d2e..3eec7b6b 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 -@@ -20,6 +20,8 @@ import java.util.logging.Level; +@@ -21,6 +21,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -331,7 +331,7 @@ index 80d8ab24..3bf47365 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -158,7 +160,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -159,7 +161,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { diff --git a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch index efaddbda..d07a90fb 100644 --- a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 2553ca852c00716e467c00887160a0bdeaaaa36b Mon Sep 17 00:00:00 2001 +From 67ca84034f74938b704e81cd9dbe4fa15ef10f49 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 73fd60e0..9ec16808 100644 +index b285fead..d4b57e5a 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -152,11 +152,15 @@ public abstract class EntityMap +@@ -154,11 +154,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -64,5 +64,5 @@ index cefa0206..8d4439ab 100644 } -- -2.36.1.windows.1 +2.37.0.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 38c84102..0f020a26 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 8dd5f12ca0bc67b8f7ea7257e4a2b1f8c2b4e7f6 Mon Sep 17 00:00:00 2001 +From 9267227d04296ef844096cfe3a1a063ffee94643 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -64,10 +64,10 @@ index e48f7713..7c0c2fff 100644 } 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 3bf47365..af128f0b 100644 +index 3eec7b6b..41c99bb4 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 -@@ -392,7 +392,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -393,7 +393,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -77,7 +77,7 @@ index 3bf47365..af128f0b 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -401,7 +402,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -402,7 +403,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index c4c011db..4fdbab5f 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 2e496d47435bb97de442fe1a12020c695169f634 Mon Sep 17 00:00:00 2001 +From 547085355fe3fa7a13e2b35f5ab6a53848a2ea11 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -125,10 +125,10 @@ index c327841a..de2cc947 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 af128f0b..9b2d8842 100644 +index 41c99bb4..5e82d29a 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 -@@ -22,6 +22,8 @@ import javax.crypto.spec.SecretKeySpec; +@@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; import dev._2lstudios.flamecord.FlameCord; @@ -137,7 +137,7 @@ index af128f0b..9b2d8842 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -272,7 +274,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -273,7 +275,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); @@ -145,7 +145,7 @@ index af128f0b..9b2d8842 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -335,7 +336,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -336,7 +337,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 27f7946a..fc4a7c13 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From e235d2ea3d258d995b5e06cf0f6fd474863510fb Mon Sep 17 00:00:00 2001 +From 227dc719b4a69f3773249b8e2cd601bdabbf6334 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 9b2d8842..14461824 100644 +index 5e82d29a..70d1ba25 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 -@@ -131,12 +131,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection private enum State { @@ -23,7 +23,7 @@ index 9b2d8842..14461824 100644 } @Override -@@ -272,6 +272,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -273,6 +273,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -31,7 +31,7 @@ index 9b2d8842..14461824 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -394,6 +395,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -395,6 +396,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index 9b2d8842..14461824 100644 unsafe.sendPacket( ping ); -@@ -405,6 +407,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -406,6 +408,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index 9b2d8842..14461824 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); -@@ -477,6 +480,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -478,6 +481,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index 9b2d8842..14461824 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -787,14 +791,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -813,14 +817,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 52cbf7c1..5f2c5bec 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 1d11012be7d3fa103d4911afe05daf603f974e79 Mon Sep 17 00:00:00 2001 +From 87687868835d39b7b293ae5715fbfbb14fc08045 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -774,7 +774,7 @@ index c78ab3a7..4079caa5 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 5d92c20c..dbec217d 100644 +index 5d92c20c..85f71cf8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,123 @@ import net.md_5.bungee.config.Configuration; @@ -797,7 +797,7 @@ index 5d92c20c..dbec217d 100644 + @Getter + private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); + @Getter -+ private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException","QuietException","IllegalStateConfig","FastException"); ++ private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException", "QuietException", "IllegalStateConfig", "FastException"); + @Getter + private boolean antibotCountryLog = true; + @Getter @@ -933,10 +933,10 @@ index 4f306660..33c40733 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 14461824..bc73abe7 100644 +index 70d1ba25..ba605657 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 -@@ -20,6 +20,8 @@ import java.util.logging.Level; +@@ -21,6 +21,8 @@ import java.util.logging.Level; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; @@ -945,7 +945,7 @@ index 14461824..bc73abe7 100644 import dev._2lstudios.flamecord.FlameCord; import dev._2lstudios.flamecord.configuration.FlameConfig; -@@ -437,6 +439,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -438,6 +440,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -957,7 +957,7 @@ index 14461824..bc73abe7 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -448,6 +455,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -449,6 +456,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -980,7 +980,7 @@ index 14461824..bc73abe7 100644 break; case 2: // Login -@@ -459,6 +482,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -460,6 +483,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1002,7 +1002,7 @@ index 14461824..bc73abe7 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -519,6 +557,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -523,6 +561,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1114,8 +1114,39 @@ index fa87750f..67263bca 100644 ChatEvent chatEvent = new ChatEvent( con, con.getServer(), message ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { +diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +index e2911d5e..69e0b551 100644 +--- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +@@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; + import io.netty.handler.codec.http.HttpResponseStatus; + import io.netty.handler.codec.http.LastHttpContent; + import java.nio.charset.Charset; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; + import lombok.RequiredArgsConstructor; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.Callback; + + @RequiredArgsConstructor +@@ -21,6 +25,14 @@ public class HttpHandler extends SimpleChannelInboundHandler + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { ++ // Flamecord start - Antibot System ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getSimpleName())) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getSimpleName(), ctx.channel().remoteAddress() ); ++ } ++ // Flamecord end - Antibot System ++ + try + { + callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 65e79eec..423ae995 100644 +index 65e79eec..f1f6fae2 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1127,21 +1158,21 @@ index 65e79eec..423ae995 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; import net.md_5.bungee.connection.InitialHandler; -@@ -152,6 +154,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -148,6 +150,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { ++ // Flamecord start - Antibot System ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getSimpleName())) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getSimpleName(), ctx.channel().remoteAddress() ); ++ } ++ // Flamecord end - Antibot System ++ + if ( ctx.channel().isActive() ) { boolean logExceptions = !( handler instanceof PingHandler ); - -+ // Flamecord start - Antibot System -+ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getName())) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getName(), ctx.channel().remoteAddress() ); -+ } -+ // Flamecord end - Antibot System -+ - // FlameCord - Option to log exceptions - logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; - 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 ffea1599..6bf109f5 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 7f3fe011..d1c3c2d3 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From a5c543d62975b9bfed3eabd7d60d91b7493ddcaf Mon Sep 17 00:00:00 2001 +From bc70ae0d44c9229270986b0eb5735783daf869ef Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index dbec217d..628f81d0 100644 +index 85f71cf8..d09dd8bd 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -29,10 +29,10 @@ index dbec217d..628f81d0 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 bc73abe7..4c26462c 100644 +index ba605657..3af33236 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 -@@ -520,7 +520,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index 89af7b98..b2858b8a 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 62b34dc8e92b165c3200ddfe2f3fb72f1770e818 Mon Sep 17 00:00:00 2001 +From a5798620c99905437a107fd4520b1479fcfd6d6b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -21,7 +21,7 @@ index 469fe0e1..97bd384b 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index 558d0dbb..35236382 100644 +index bbfa05e9..2658e144 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -33,7 +33,7 @@ index 558d0dbb..35236382 100644 import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; import net.md_5.bungee.protocol.packet.Handshake; -@@ -215,14 +213,4 @@ public abstract class AbstractPacketHandler +@@ -210,14 +208,4 @@ public abstract class AbstractPacketHandler public void handle(GameState gameState) throws Exception { } @@ -49,7 +49,7 @@ index 558d0dbb..35236382 100644 - // Waterfall end } 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 -index 0d1cbbdb..d19b67ae 100644 +index 3787b21c..84e614b5 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -61,9 +61,9 @@ index 0d1cbbdb..d19b67ae 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -137,20 +135,6 @@ public enum Protocol - PlayerChat::new, - map( ProtocolConstants.MINECRAFT_1_19, 0x30 ) +@@ -134,20 +132,6 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), + map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) ); - // Waterfall start - TO_CLIENT.registerPacket( @@ -239,7 +239,7 @@ index 966d2442..be337a68 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index cb98a8ea..c0b42ee2 100644 +index 055a1d88..a63e67f1 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -243,11 +243,6 @@ public class ServerConnector extends PacketHandler @@ -458,10 +458,10 @@ index 67263bca..bd6fe2d5 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index 9ec16808..00000000 +index d4b57e5a..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null -@@ -1,369 +0,0 @@ +@@ -1,371 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -551,6 +551,8 @@ index 9ec16808..00000000 - return EntityMap_1_16_2.INSTANCE_1_18; - case ProtocolConstants.MINECRAFT_1_19: - return EntityMap_1_16_2.INSTANCE_1_19; +- case ProtocolConstants.MINECRAFT_1_19_1: +- return EntityMap_1_16_2.INSTANCE_1_19_1; - } - throw new RuntimeException( "Version " + version + " has no entity map" ); - } @@ -2356,7 +2358,7 @@ index c8b06707..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index b9d0b651..00000000 +index 7241dc56..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null @@ -1,76 +0,0 @@ @@ -2380,7 +2382,7 @@ index b9d0b651..00000000 - static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D ); - static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); - static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F ); -- +- static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 ); - // - private final int spawnPlayerId; - private final int spectateId; @@ -3233,5 +3235,5 @@ index caed4384..af428090 100644 } -- -2.36.1.windows.1 +2.37.0.windows.1 From 8e172cbb77c185202382d0c7d329fd613363a583 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Thu, 28 Jul 2022 10:53:56 -0300 Subject: [PATCH 295/499] 1.0.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index c7e5c9e3..b42455f2 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.5"; ++ return "1.0.6"; } public void reloadMessages() From 2883c0f0ca0a4880c351a25d3ef4470d3d0fee77 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Thu, 4 Aug 2022 23:29:02 +0200 Subject: [PATCH 296/499] Dont frame unreadable connections --- ...34-Dont-frame-unreadable-connections.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch diff --git a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch new file mode 100644 index 00000000..dd6a28eb --- /dev/null +++ b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch @@ -0,0 +1,22 @@ +From 5cb2ccdb33cc1e380a97f2042bd5d50da8718665 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Thu, 4 Aug 2022 23:27:43 +0200 +Subject: [PATCH] Dont frame unreadable connections + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 074d2437..e248daee 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + { + // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() + // will fire any cumulated data through the pipeline, so we want to try and stop it here. +- if ( !ctx.channel().isActive() ) ++ if ( !ctx.channel().isActive() || !in.isReadable() ) //FlameCord - Check if connection is readable + { + return; + } +-- +2.34.1.windows.1 + From 77bb414a50765bd660359d8810f5c1853c0c9468 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 5 Aug 2022 16:46:10 -0300 Subject: [PATCH 297/499] Update 0034-Dont-frame-unreadable-connections.patch --- .../0034-Dont-frame-unreadable-connections.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch index dd6a28eb..5d632586 100644 --- a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch @@ -13,7 +13,7 @@ index 074d2437..e248daee 100644 // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() // will fire any cumulated data through the pipeline, so we want to try and stop it here. - if ( !ctx.channel().isActive() ) -+ if ( !ctx.channel().isActive() || !in.isReadable() ) //FlameCord - Check if connection is readable ++ if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable { return; } From 9560facf614fc1d6bd21b9b6d7675c0bba11215c Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 6 Aug 2022 12:39:12 -0300 Subject: [PATCH 298/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 097888c7..38725c7f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 097888c72ab4afa14c5b543d7205ec91085444a4 +Subproject commit 38725c7fde11bed8ecaeb517a7afa2268e361f62 From 597c06e565c691ff01dffb00ef79c4e3461a9598 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 6 Aug 2022 13:02:16 -0300 Subject: [PATCH 299/499] 1.0.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b42455f2..5c95aafd 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.6"; ++ return "1.0.7"; } public void reloadMessages() From e8ba944fc7079c021d275af71ace7bb004b3b444 Mon Sep 17 00:00:00 2001 From: Ismael Hanbel <76608233+xIsm4@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:55:29 +0200 Subject: [PATCH 300/499] Retain duplicate instead duplicate().retain() --- .../0031-Duplicate-buf-instead-of-Copy.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch index d621b4af..553176c6 100644 --- a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch +++ b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch @@ -14,7 +14,7 @@ index 3992f521..074d2437 100644 - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( + // FlameCord - Duplicate buf instead of Copy -+ ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( ++ ByteBuf slice = in.retainedDuplicate(); // Can't slice this one due to EntityMap :( Object packetTypeInfo = null; try From 5bd8c29b4ae8d01db0e3e59e29307091cd9d05a0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:10:55 -0300 Subject: [PATCH 301/499] 1.0.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 5c95aafd..b5c74b9f 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.7"; ++ return "1.0.8"; } public void reloadMessages() From 21e4006a999833ea7130af42af7f5fdfebc7b107 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 12 Aug 2022 10:11:18 -0300 Subject: [PATCH 302/499] revert retainedDuplicate from xlsm --- ...009-Close-connections-Don-t-flush-if-not-necessary.patch | 6 +++--- ...0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch | 6 +++--- .../0016-Don-t-declare-uuid-unless-it-s-null.patch | 6 +++--- .../0028-InitialHandler-Processing-State.patch | 6 +++--- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 6 +++--- .../0031-Duplicate-buf-instead-of-Copy.patch | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index b0eed56a..5fb9356d 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From 445627b3ac1dc3bcbb85a4ce24164550df456144 Mon Sep 17 00:00:00 2001 +From b283b715c48392013e3f6066c6016e9876368222 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 b307b5ca..b7389a54 100644 +index 787e23f8..09a54c1c 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 @@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -58,7 +58,7 @@ index b307b5ca..b7389a54 100644 } @Override -@@ -690,7 +710,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -691,7 +711,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 59cde9a1..d0350085 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 94a3fa4d4735f4a136fc11796091f6d5d80d02d2 Mon Sep 17 00:00:00 2001 +From fb92fd5de29eeb570ddfb40e6ecbbd6e36ecd4ec Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 b7389a54..c4b64a4b 100644 +index 09a54c1c..0e94d411 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 -@@ -768,7 +768,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index 520f3c4e..41f8e8b9 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From cf93a1e99eafa0811416ca8ccec782805449af07 Mon Sep 17 00:00:00 2001 +From dc8d4b51d88b9f0e6086def5aa4f5c3da5e00be6 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 c4b64a4b..74199d2e 100644 +index 0e94d411..76b10bb3 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 -@@ -557,7 +557,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -558,7 +558,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index fc4a7c13..a233a1f3 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 227dc719b4a69f3773249b8e2cd601bdabbf6334 Mon Sep 17 00:00:00 2001 +From c694749ccf2854172528a4d81cb2d81dfc06e635 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 5e82d29a..70d1ba25 100644 +index d99cb5d0..7035729b 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -55,7 +55,7 @@ index 5e82d29a..70d1ba25 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -813,14 +817,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -814,14 +818,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5f2c5bec..627d6b3e 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 87687868835d39b7b293ae5715fbfbb14fc08045 Mon Sep 17 00:00:00 2001 +From 4fc4176aa233588dddc277eb1ead2e66ed4c806f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -933,7 +933,7 @@ index 4f306660..33c40733 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 70d1ba25..ba605657 100644 +index 7035729b..ee08bbe5 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -1002,7 +1002,7 @@ index 70d1ba25..ba605657 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -523,6 +561,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,6 +562,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch index 553176c6..7d23d5d3 100644 --- a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch +++ b/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch @@ -1,4 +1,4 @@ -From 0c74e3dae65a16605b5faee82cac81a4dc72d933 Mon Sep 17 00:00:00 2001 +From 90635c0b9afe244a66f3806d52a316f0e4fcfe45 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:36:43 -0300 Subject: [PATCH] Duplicate buf instead of Copy @@ -14,7 +14,7 @@ index 3992f521..074d2437 100644 - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( + // FlameCord - Duplicate buf instead of Copy -+ ByteBuf slice = in.retainedDuplicate(); // Can't slice this one due to EntityMap :( ++ ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( Object packetTypeInfo = null; try @@ -29,5 +29,5 @@ index 3992f521..074d2437 100644 } catch (BadPacketException | IndexOutOfBoundsException e) { // Waterfall start: Additional DoS mitigations -- -2.32.0 +2.37.0.windows.1 From c5c8d50cb7e125dfb8e70f42becac105c7bbcb17 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Fri, 12 Aug 2022 10:12:05 -0300 Subject: [PATCH 303/499] 1.0.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b5c74b9f..cf5d865e 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.8"; ++ return "1.0.9"; } public void reloadMessages() From 6e643defdb1f4f890decc84140aee397de2dd3e9 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sun, 14 Aug 2022 19:30:01 -0300 Subject: [PATCH 304/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall b/Waterfall index 38725c7f..6ca6b706 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 38725c7fde11bed8ecaeb517a7afa2268e361f62 +Subproject commit 6ca6b706df2d7c8a36ba6e0caa8d29856db35aef From 2a6b2aea02a57bd2c812d09006ae3fad833f2820 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sun, 14 Aug 2022 19:35:01 -0300 Subject: [PATCH 305/499] Fix compilation issues --- .../0004-1.7.x-support.patch | 64 +++++++++---------- ...0032-Disable-entity-Metadata-Rewrite.patch | 18 +++--- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 1fb96e37..436e4dd4 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 96bfa8b877c1f97e15f58e9092b7c8406625a72d Mon Sep 17 00:00:00 2001 +From fd7c37150d6ff9c9fd0ad2d337e501113217786c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -46,10 +46,10 @@ index bafef27c..8efe1ef0 100644 + // FlameCord end - 1.7.x support } 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 -index fb126a21..3787b21c 100644 +index b852a24e..d94c2cdf 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -63,7 +63,7 @@ public enum Protocol +@@ -64,7 +64,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, @@ -58,7 +58,7 @@ index fb126a21..3787b21c 100644 ); } }, -@@ -75,7 +75,7 @@ public enum Protocol +@@ -76,7 +76,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, @@ -67,7 +67,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -89,7 +89,7 @@ public enum Protocol +@@ -90,7 +90,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, @@ -76,7 +76,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -101,7 +101,7 @@ public enum Protocol +@@ -102,7 +102,7 @@ public enum Protocol ); TO_CLIENT.registerPacket( Chat.class, Chat::new, @@ -85,7 +85,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -112,7 +112,7 @@ public enum Protocol +@@ -113,7 +113,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,7 +94,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -138,20 +138,20 @@ public enum Protocol +@@ -139,20 +139,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, @@ -118,7 +118,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -166,7 +166,7 @@ public enum Protocol +@@ -167,7 +167,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -178,7 +178,7 @@ public enum Protocol +@@ -179,7 +179,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -191,7 +191,7 @@ public enum Protocol +@@ -192,7 +192,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -145,7 +145,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -204,7 +204,7 @@ public enum Protocol +@@ -205,7 +205,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, @@ -154,7 +154,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -217,7 +217,7 @@ public enum Protocol +@@ -218,7 +218,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -230,7 +230,7 @@ public enum Protocol +@@ -231,7 +231,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -244,7 +244,7 @@ public enum Protocol +@@ -245,7 +245,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -258,7 +258,7 @@ public enum Protocol +@@ -259,7 +259,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -298,7 +298,7 @@ public enum Protocol +@@ -299,7 +299,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -315,7 +315,7 @@ public enum Protocol +@@ -316,7 +316,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -360,7 +360,7 @@ public enum Protocol +@@ -367,7 +367,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -373,7 +373,7 @@ public enum Protocol +@@ -380,7 +380,7 @@ public enum Protocol ); TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -395,7 +395,7 @@ public enum Protocol +@@ -402,7 +402,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -407,7 +407,7 @@ public enum Protocol +@@ -414,7 +414,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -418,7 +418,7 @@ public enum Protocol +@@ -425,7 +425,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index fb126a21..3787b21c 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -438,23 +438,23 @@ public enum Protocol +@@ -445,23 +445,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index fb126a21..3787b21c 100644 ); } }, -@@ -466,22 +466,22 @@ public enum Protocol +@@ -473,22 +473,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index fb126a21..3787b21c 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -492,12 +492,12 @@ public enum Protocol +@@ -499,12 +499,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index dfd38e32..43381641 100644 +index 848d5de5..b7e56763 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1099,7 +1099,7 @@ index b44d13e5..2d72e26e 100644 { this.compressionThreshold = compressionThreshold; 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 -index 97c4b210..6082d40c 100644 +index 59d204ce..a7cf0401 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; @@ -1110,7 +1110,7 @@ index 97c4b210..6082d40c 100644 import java.util.ArrayList; import java.util.HashMap; // Waterfall import java.util.List; -@@ -184,7 +185,7 @@ public class DownstreamBridge extends PacketHandler +@@ -185,7 +186,7 @@ public class DownstreamBridge extends PacketHandler switch ( objective.getAction() ) { case 0: @@ -1119,7 +1119,7 @@ index 97c4b210..6082d40c 100644 break; case 1: serverScoreboard.removeObjective( objective.getName() ); -@@ -194,7 +195,7 @@ public class DownstreamBridge extends PacketHandler +@@ -195,7 +196,7 @@ public class DownstreamBridge extends PacketHandler if ( oldObjective != null ) { oldObjective.setValue( objective.getValue() ); @@ -1128,7 +1128,7 @@ index 97c4b210..6082d40c 100644 } break; default: -@@ -292,16 +293,28 @@ public class DownstreamBridge extends PacketHandler +@@ -293,16 +294,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1168,7 +1168,7 @@ index 97c4b210..6082d40c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 6011078f..c6a3f1b8 100644 +index 975b6996..77c4922d 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index b2858b8a..e0e4c1ac 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From a5798620c99905437a107fd4520b1479fcfd6d6b Mon Sep 17 00:00:00 2001 +From 5b6019b5dc4ab852f504d2a77563b954cf92c7c9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -21,7 +21,7 @@ index 469fe0e1..97bd384b 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index bbfa05e9..2658e144 100644 +index 1defe650..608769eb 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -33,8 +33,8 @@ index bbfa05e9..2658e144 100644 import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; import net.md_5.bungee.protocol.packet.Handshake; -@@ -210,14 +208,4 @@ public abstract class AbstractPacketHandler - public void handle(GameState gameState) throws Exception +@@ -215,14 +213,4 @@ public abstract class AbstractPacketHandler + public void handle(ServerData serverData) throws Exception { } - @@ -49,7 +49,7 @@ index bbfa05e9..2658e144 100644 - // Waterfall end } 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 -index 3787b21c..84e614b5 100644 +index d94c2cdf..e10074f2 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -61,7 +61,7 @@ index 3787b21c..84e614b5 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -134,20 +132,6 @@ public enum Protocol +@@ -135,20 +133,6 @@ public enum Protocol map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) ); @@ -365,7 +365,7 @@ index 7c0c2fff..d37f419a 100644 - // Waterfall end } 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 -index 6082d40c..194ada04 100644 +index a7cf0401..d662c976 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -385,7 +385,7 @@ index 6082d40c..194ada04 100644 import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; import net.md_5.bungee.protocol.packet.PlayerListItem; -@@ -147,11 +144,6 @@ public class DownstreamBridge extends PacketHandler +@@ -148,11 +145,6 @@ public class DownstreamBridge extends PacketHandler @Override public void handle(PacketWrapper packet) throws Exception { @@ -397,7 +397,7 @@ index 6082d40c..194ada04 100644 con.sendPacket( packet ); } -@@ -688,34 +680,6 @@ public class DownstreamBridge extends PacketHandler +@@ -689,34 +681,6 @@ public class DownstreamBridge extends PacketHandler } } From f5d4820ede4d3c2533cd4693d09a1f484e626778 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sun, 14 Aug 2022 19:47:13 -0300 Subject: [PATCH 306/499] 1.1.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index cf5d865e..533b6317 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.0.9"; ++ return "1.1.0"; } public void reloadMessages() From d4e2f6d953ad53e9eb318a01b51afa48d63c1529 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Tue, 30 Aug 2022 15:47:16 -0300 Subject: [PATCH 307/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0004-1.7.x-support.patch | 24 +++++++++---------- ...0032-Disable-entity-Metadata-Rewrite.patch | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Waterfall b/Waterfall index 6ca6b706..31a36117 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 6ca6b706df2d7c8a36ba6e0caa8d29856db35aef +Subproject commit 31a361174c99f06b11420ec49ae9d99b4f5b4066 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 436e4dd4..84815e11 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,14 +1,14 @@ -From fd7c37150d6ff9c9fd0ad2d337e501113217786c Mon Sep 17 00:00:00 2001 +From 5f0853d26677fe45f76e60f61d5dcd8e82dd3371 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index bafef27c..8efe1ef0 100644 +index 561a9522..9a26c845 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -370,4 +370,36 @@ public abstract class DefinedPacket +@@ -365,4 +365,36 @@ public abstract class DefinedPacket return 0; } // Waterfall end @@ -358,7 +358,7 @@ index aa5daf47..a6b13aa1 100644 ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index 6034fc18..6100687c 100644 +index dc986609..230018ae 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -41,6 +41,7 @@ public class Chat extends DefinedPacket @@ -369,10 +369,10 @@ index 6034fc18..6100687c 100644 if ( direction == ProtocolConstants.Direction.TO_CLIENT ) { position = buf.readByte(); -@@ -60,6 +61,7 @@ public class Chat extends DefinedPacket - } else - // Waterfall end - writeString( message, buf ); +@@ -55,6 +56,7 @@ public class Chat extends DefinedPacket + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { + writeString( message, buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); + if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support if ( direction == ProtocolConstants.Direction.TO_CLIENT ) { @@ -915,7 +915,7 @@ index a5555f6a..09dc67f9 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 848d5de5..b7e56763 100644 +index d2548e07..04501b59 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer @@ -1374,7 +1374,7 @@ index 00000000..cdc07dc4 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java new file mode 100644 -index 00000000..5ce42f62 +index 00000000..cb9174b3 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -0,0 +1,62 @@ @@ -1424,7 +1424,7 @@ index 00000000..5ce42f62 + DefinedPacket.writeString( player.getUniqueId().toString(), packet ); + DefinedPacket.writeString( username, packet ); + DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -+ for ( LoginResult.Property property : profile.getProperties() ) ++ for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) + { + DefinedPacket.writeString( property.getName(), packet ); + DefinedPacket.writeString( property.getValue(), packet ); @@ -1621,5 +1621,5 @@ index daf12f74..7d053485 100644 @Override -- -2.37.0.windows.1 +2.37.2.windows.2 diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch index e0e4c1ac..b9034824 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 5b6019b5dc4ab852f504d2a77563b954cf92c7c9 Mon Sep 17 00:00:00 2001 +From 374bddd71d06eaa3d8d6118bfb83dfe42cf8850e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -2549,7 +2549,7 @@ index cdc07dc4..00000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java deleted file mode 100644 -index 5ce42f62..00000000 +index cb9174b3..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ /dev/null @@ -1,62 +0,0 @@ @@ -2599,7 +2599,7 @@ index 5ce42f62..00000000 - DefinedPacket.writeString( player.getUniqueId().toString(), packet ); - DefinedPacket.writeString( username, packet ); - DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -- for ( LoginResult.Property property : profile.getProperties() ) +- for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) - { - DefinedPacket.writeString( property.getName(), packet ); - DefinedPacket.writeString( property.getValue(), packet ); @@ -3235,5 +3235,5 @@ index caed4384..af428090 100644 } -- -2.37.0.windows.1 +2.37.2.windows.2 From 6f7e1a2a76618c9e4cdb0e93e3b76dd062072bcd Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 30 Aug 2022 16:01:36 -0300 Subject: [PATCH 308/499] 1.1.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 533b6317..157f36d8 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.0"; ++ return "1.1.1"; } public void reloadMessages() From c985c4727d4055d3174b13054d57c3c596db5ba1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:46:57 -0300 Subject: [PATCH 309/499] Add limits for LoginRequest 1.19 --- .../0025-Apply-packet-limits.patch | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch index 178f94b3..2e1988c9 100644 --- a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 596bb7b14abdea0ba23fa966a6d594977c230331 Mon Sep 17 00:00:00 2001 +From 3b10c67b44bca36048c12ccd92c6dc78efd50650 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits @@ -50,6 +50,20 @@ index 7dbbfd3c..b7842055 100644 + return 5; // FlameCord - Apply packet limits + } } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +index 682c8784..bb74cbc4 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +@@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket + public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // Accommodate the rare (but likely malicious) use of UTF-8 usernames, since it is technically + // legal on the protocol level. +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return -1; ++ // FlameCord - Apply packet limits ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 64; + return 1 + (16 * 4); + } + // Waterfall end -- -2.32.0 +2.37.3.windows.1 From 0ef875f66b7d6f2db65eb92ba9c7e5316c9fbeca Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:42:22 -0300 Subject: [PATCH 310/499] Avoid throwing IOOB on login --- .../0035-Avoid-throwing-IOOB-on-login.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch diff --git a/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch new file mode 100644 index 00000000..0ff07ca8 --- /dev/null +++ b/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch @@ -0,0 +1,23 @@ +From 69197173b7058afc69c176c8fe6c732700831bec Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 13 Sep 2022 20:41:48 -0300 +Subject: [PATCH] Avoid throwing IOOB on login + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +index bb74cbc4..e85f026b 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +@@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket + } + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 ) + { +- if ( buf.readBoolean() ) ++ // FlameCord - Avoid throwing IOOB on login ++ if ( buf.readableBytes() >= 1 && buf.readBoolean() ) + { + uuid = readUUID( buf ); + } +-- +2.37.3.windows.1 + From c320dbc466a939fdcefd05edd65ae44170970ba6 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:47:53 -0300 Subject: [PATCH 311/499] 1.1.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 157f36d8..7c14b417 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.1"; ++ return "1.1.2"; } public void reloadMessages() From 590bdd362316540210e8414258681f967e405187 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 17 Sep 2022 21:02:05 -0300 Subject: [PATCH 312/499] 1.1.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 7c14b417..d12643ed 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.2"; ++ return "1.1.3"; } public void reloadMessages() From b7e63aa153e5c433901ff28956b0243b820e3794 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 17 Sep 2022 21:04:06 -0300 Subject: [PATCH 313/499] Fix 1.19.2 not able to join --- Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch | 6 +++--- .../0035-Avoid-throwing-IOOB-on-login.patch | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch index 2e1988c9..c5ba0912 100644 --- a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 3b10c67b44bca36048c12ccd92c6dc78efd50650 Mon Sep 17 00:00:00 2001 +From b9e025ba81bbb80fdaf9d5dc4a52b358bfe382a9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits @@ -51,7 +51,7 @@ index 7dbbfd3c..b7842055 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 682c8784..bb74cbc4 100644 +index 682c8784..22a5b993 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java @@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket @@ -60,7 +60,7 @@ index 682c8784..bb74cbc4 100644 // legal on the protocol level. - if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return -1; + // FlameCord - Apply packet limits -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 64; ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 1024; return 1 + (16 * 4); } // Waterfall end diff --git a/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch index 0ff07ca8..b9f39089 100644 --- a/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch +++ b/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch @@ -1,11 +1,11 @@ -From 69197173b7058afc69c176c8fe6c732700831bec Mon Sep 17 00:00:00 2001 +From 960a54fbe3fc62cc1aa2607d9efe4eb4b33b03b0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:41:48 -0300 Subject: [PATCH] Avoid throwing IOOB on login diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index bb74cbc4..e85f026b 100644 +index 22a5b993..78a2d569 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java @@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket @@ -14,7 +14,7 @@ index bb74cbc4..e85f026b 100644 { - if ( buf.readBoolean() ) + // FlameCord - Avoid throwing IOOB on login -+ if ( buf.readableBytes() >= 1 && buf.readBoolean() ) ++ if ( buf.isReadable() && buf.readBoolean() ) { uuid = readUUID( buf ); } From 0ca7776b9a55dfac524386a318f7693f3d506638 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 Oct 2022 12:53:19 +0200 Subject: [PATCH 314/499] Fix errors on country check --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 627d6b3e..72e54375 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 4fc4176aa233588dddc277eb1ead2e66ed4c806f Mon Sep 17 00:00:00 2001 +From 7d1814de2ee7d37251cbe0111aa8e830f0b7ae16 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -297,7 +297,7 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..8507e1a7 +index 00000000..f912d101 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -345,7 +345,7 @@ index 00000000..8507e1a7 + + this.maxMindReader = new Reader(file, new CHMCache()); + } catch (final Exception exception) { -+ // Ignored ++ System.out.println("MaxMindDB was not able to download!"); + } + } + @@ -407,7 +407,7 @@ index 00000000..8507e1a7 + + return isoCode; + } -+ } catch (final IOException exception) { ++ } catch (final Exception exception) { + // Ignored + } + @@ -1198,5 +1198,5 @@ index ffea1599..6bf109f5 100644 { ch.close(); -- -2.37.0.windows.1 +2.37.3.windows.1 From b257bce1ebc4e18762be41573f8ce3be018fae62 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 Oct 2022 07:56:05 -0300 Subject: [PATCH 315/499] 1.1.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index d12643ed..567a8fec 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.3"; ++ return "1.1.4"; } public void reloadMessages() From ce6f476db4dee91740e419474781982bd1b4dcd5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:35:27 +0200 Subject: [PATCH 316/499] Show nickname on nickname check block --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 72e54375..7e3709da 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 7d1814de2ee7d37251cbe0111aa8e830f0b7ae16 Mon Sep 17 00:00:00 2001 +From bff5bba80571e7d6308ff17af33f25b0be465427 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -933,7 +933,7 @@ index 4f306660..33c40733 100644 setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", 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 7035729b..ee08bbe5 100644 +index 7035729b..7c2128dc 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -1028,7 +1028,7 @@ index 7035729b..ee08bbe5 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname", ch.getRemoteAddress() ); ++ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); From 465fa64a8c6ddfb5d36937009818e634295a39aa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 11 Oct 2022 23:55:09 +0200 Subject: [PATCH 317/499] Removed IPSet system (Bad performance) --- .../0029-Antibot-System.patch | 157 ++++++++---------- .../0030-Allow-Invalid-Names.patch | 10 +- 2 files changed, 78 insertions(+), 89 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 7e3709da..accc9d56 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From bff5bba80571e7d6308ff17af33f25b0be465427 Mon Sep 17 00:00:00 2001 +From bb700ec46e48d12ac13993e082e6fb74d6597fe9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,7 +22,7 @@ index 20edd900..5978bec6 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..dfee9bf8 +index 00000000..46968704 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ @@ -35,15 +35,15 @@ index 00000000..dfee9bf8 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class AccountsCheck { ++ private FlameCordConfiguration config; + private final AddressDataManager addressDataManager; + + public AccountsCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + + public boolean check(final SocketAddress socketAddress, final String nickname) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + final Collection nicknames = addressData.getNicknames(); @@ -64,19 +64,20 @@ index 00000000..dfee9bf8 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..cd8220d1 +index 00000000..8069efe1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,149 @@ +@@ -0,0 +1,139 @@ +package dev._2lstudios.antibot; + -+import java.io.IOException; +import java.util.Collection; +import java.util.HashSet; + +import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class AddressData { ++ private FlameCordConfiguration config; + private final Collection nicknames = new HashSet<>(); + private final String hostString; + private String lastNickname = ""; @@ -91,6 +92,7 @@ index 00000000..cd8220d1 + private int totalConnections = 0; + + public AddressData(final String hostString) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.hostString = hostString; + } + @@ -108,9 +110,7 @@ index 00000000..cd8220d1 + this.totalConnections = 1; + } + -+ if (!this.nicknames.contains(nickname)) { -+ this.nicknames.add(nickname); -+ } ++ this.nicknames.add(nickname); + } + + public long getPenultimateConnection() { @@ -177,7 +177,7 @@ index 00000000..cd8220d1 + } + + public boolean isFirewalled() { -+ return System.currentTimeMillis() - lastFirewall < FlameCord.getInstance().getFlameCordConfiguration() ++ return System.currentTimeMillis() - lastFirewall < config + .getAntibotFirewallExpire() * 1000; + } + @@ -187,16 +187,6 @@ index 00000000..cd8220d1 + + public void firewall() { + if (!hostString.equals("127.0.0.1")) { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallIpset()) { -+ Runtime runtime = Runtime.getRuntime(); -+ -+ try { -+ runtime.exec("ipset add flamecord_blacklist " + hostString); -+ } catch (IOException exception) { -+ // Ignored -+ } -+ } -+ + this.lastFirewall = System.currentTimeMillis(); + } + } @@ -219,10 +209,10 @@ index 00000000..cd8220d1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 00000000..3f6e4186 +index 00000000..af586e55 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java -@@ -0,0 +1,25 @@ +@@ -0,0 +1,29 @@ +package dev._2lstudios.antibot; + +import java.net.InetSocketAddress; @@ -233,10 +223,7 @@ index 00000000..3f6e4186 +public class AddressDataManager { + private final Map addressData = new HashMap<>(); + -+ public AddressData getAddressData(final SocketAddress address) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String addressString = iNetSocketAddress.getHostString(); -+ ++ public AddressData getAddressData(final String addressString) { + if (addressData.containsKey(addressString)) { + return addressData.get(addressString); + } else { @@ -247,13 +234,20 @@ index 00000000..3f6e4186 + return data; + } + } ++ ++ public AddressData getAddressData(final SocketAddress address) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String addressString = iNetSocketAddress.getHostString(); ++ ++ return getAddressData(addressString); ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..137ed980 +index 00000000..f2f2d535 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,40 @@ +package dev._2lstudios.antibot; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -281,14 +275,13 @@ index 00000000..137ed980 + this.accountsCheck = new AccountsCheck(addressDataManager); + this.countryCheck = new CountryCheck(addressDataManager); + this.fastChatCheck = new FastChatCheck(addressDataManager); -+ this.firewallCheck = new FirewallCheck(addressDataManager, flameCordConfiguration); ++ this.firewallCheck = new FirewallCheck(addressDataManager); + this.nicknameCheck = new NicknameCheck(addressDataManager); + this.passwordCheck = new PasswordCheck(addressDataManager); + this.ratelimitCheck = new RatelimitCheck(addressDataManager); + this.reconnectCheck = new ReconnectCheck(addressDataManager); + + this.countryCheck.load(); -+ this.firewallCheck.load(); + } + + public void unload() { @@ -297,7 +290,7 @@ index 00000000..137ed980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..f912d101 +index 00000000..66d2b980 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -321,10 +314,12 @@ index 00000000..f912d101 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class CountryCheck { ++ private FlameCordConfiguration config; + private final AddressDataManager addressDataManager; + private Reader maxMindReader; + + public CountryCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + @@ -415,8 +410,6 @@ index 00000000..f912d101 + } + + public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotCountryEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + final String addressCountry = addressData.getCountry(); @@ -443,7 +436,7 @@ index 00000000..f912d101 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..61d4ca83 +index 00000000..8e27085f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -455,15 +448,15 @@ index 00000000..61d4ca83 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class FastChatCheck { ++ private FlameCordConfiguration config; + private final AddressDataManager addressDataManager; + + public FastChatCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + + public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotFastChatEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + @@ -481,44 +474,28 @@ index 00000000..61d4ca83 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java new file mode 100644 -index 00000000..d3b77f03 +index 00000000..87747328 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,26 @@ +package dev._2lstudios.antibot; + -+import java.io.IOException; +import java.net.SocketAddress; + ++import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class FirewallCheck { + private final AddressDataManager addressDataManager; -+ private final FlameCordConfiguration flameCordConfiguration; ++ private final FlameCordConfiguration config; + -+ public FirewallCheck(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { ++ public FirewallCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; -+ this.flameCordConfiguration = flameCordConfiguration; -+ } -+ -+ public void load() { -+ if (flameCordConfiguration.isAntibotFirewallIpset()) { -+ Runtime runtime = Runtime.getRuntime(); -+ -+ try { -+ runtime.exec("iptables -D INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); -+ runtime.exec("ipset flush flamecord_blacklist"); -+ runtime.exec("ipset destroy flamecord_blacklist"); -+ runtime.exec("ipset create flamecord_blacklist hash:ip timeout " + flameCordConfiguration.getAntibotFirewallExpire()); -+ runtime.exec("iptables -I INPUT -p tcp -m set --match-set flamecord_blacklist src -j DROP"); -+ } catch (IOException exception) { -+ // Ignored -+ } -+ } + } + + public boolean check(final SocketAddress socketAddress) { -+ if (flameCordConfiguration.isAntibotFirewallEnabled()) { ++ if (config.isAntibotFirewallEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + + return addressData.isFirewalled(); @@ -529,10 +506,10 @@ index 00000000..d3b77f03 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..f9b1ad70 +index 00000000..034d3a36 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,45 @@ +package dev._2lstudios.antibot; + +import java.net.SocketAddress; @@ -541,15 +518,19 @@ index 00000000..f9b1ad70 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class NicknameCheck { ++ private FlameCordConfiguration config; + private AddressDataManager addressDataManager; + + public NicknameCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + + private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { ++ String lowerNickname = nickname.toLowerCase(); ++ + for (final String blacklisted : config.getAntibotNicknameBlacklist()) { -+ if (nickname.toLowerCase().contains(blacklisted)) { ++ if (lowerNickname.contains(blacklisted)) { + return true; + } + } @@ -558,8 +539,6 @@ index 00000000..f9b1ad70 + } + + public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotNicknameEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + final String nickname = addressData.getLastNickname(); @@ -578,7 +557,7 @@ index 00000000..f9b1ad70 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..8ffe1e21 +index 00000000..4ab1d131 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -590,12 +569,14 @@ index 00000000..8ffe1e21 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class PasswordCheck { ++ private FlameCordConfiguration config; + private AddressDataManager addressDataManager; + private String lastNickname = ""; + private String lastPassword = ""; + private int repeatCount = 0; + + public PasswordCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + @@ -615,8 +596,6 @@ index 00000000..8ffe1e21 + } + + public boolean check(final SocketAddress socketAddress, final String passwordMessage) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotPasswordEnabled()) { + if (passwordMessage.contains("/login ") || passwordMessage.contains("/l ") + || passwordMessage.contains("/register ") @@ -646,7 +625,7 @@ index 00000000..8ffe1e21 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..f9ab936b +index 00000000..912638e2 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -658,15 +637,15 @@ index 00000000..f9ab936b +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class RatelimitCheck { ++ private FlameCordConfiguration config; + private final AddressDataManager addressDataManager; + + public RatelimitCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + + public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotRatelimitEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(socketAddress); + @@ -685,7 +664,7 @@ index 00000000..f9ab936b +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..37568225 +index 00000000..efd8d2ca --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java @@ -0,0 +1,46 @@ @@ -697,17 +676,17 @@ index 00000000..37568225 +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class ReconnectCheck { ++ private FlameCordConfiguration config; + private final AddressDataManager addressDataManager; + private int connections = 0; + private long lastConnection = 0; + + public ReconnectCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + + public boolean check(final SocketAddress socketAddress) { -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ + if (config.isAntibotReconnectEnabled()) { + final long currentTime = System.currentTimeMillis(); + @@ -736,7 +715,7 @@ index 00000000..37568225 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7..4079caa5 100644 +index c78ab3a7..8591a791 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -748,7 +727,16 @@ index c78ab3a7..4079caa5 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -25,16 +27,24 @@ public class FlameCord { +@@ -18,26 +20,31 @@ public class FlameCord { + if (FlameCord.instance != null) { + instance.reload(logger); + } else { +- FlameCord.instance = new FlameCord(logger, whitelistedAddresses); ++ FlameCord.instance = new FlameCord(); ++ instance.reload(logger); + } + } + @Getter private FlameCordConfiguration flameCordConfiguration; @Getter @@ -768,16 +756,20 @@ index c78ab3a7..4079caa5 100644 this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); +- } +- +- private FlameCord(final Logger logger, final Collection whitelistedAddresses) { +- reload(logger); + this.addressDataManager = new AddressDataManager(); + this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); } - - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + } +\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 5d92c20c..85f71cf8 100644 +index 5d92c20c..e1c18ea6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,123 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,120 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -811,8 +803,6 @@ index 5d92c20c..85f71cf8 100644 + @Getter + private boolean antibotFirewallEnabled = true; + @Getter -+ private boolean antibotFirewallIpset = true; -+ @Getter + private int antibotFirewallExpire = 60; + @Getter + private boolean antibotFirewallLog = true; @@ -872,7 +862,6 @@ index 5d92c20c..85f71cf8 100644 + this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); + this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); + this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); -+ this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); @@ -901,7 +890,7 @@ index 5d92c20c..85f71cf8 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +234,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +231,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index d1c3c2d3..3409730e 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From bc70ae0d44c9229270986b0eb5735783daf869ef Mon Sep 17 00:00:00 2001 +From 3f7c5a330d893f77631db8698fd0de704597b7ec Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 85f71cf8..d09dd8bd 100644 +index e1c18ea6..58de7da1 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 85f71cf8..d09dd8bd 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -234,6 +238,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -231,6 +235,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -29,7 +29,7 @@ index 85f71cf8..d09dd8bd 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 ba605657..3af33236 100644 +index 7c2128dc..90de2d28 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 @@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -42,5 +42,5 @@ index ba605657..3af33236 100644 disconnect( bungee.getTranslation( "name_invalid" ) ); return; -- -2.37.0.windows.1 +2.37.3.windows.1 From 2654b44cfa56ba7a8dd3b0046b5f0251a5c5a562 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 11 Oct 2022 18:55:30 -0300 Subject: [PATCH 318/499] 1.1.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 567a8fec..0e1e7d85 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.4"; ++ return "1.1.5"; } public void reloadMessages() From c33f36125b33f5d5464252377052ef57c20bd6ca Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:32:06 +0200 Subject: [PATCH 319/499] Firewall will now show reason --- .../0029-Antibot-System.patch | 119 +++++++----------- 1 file changed, 48 insertions(+), 71 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index accc9d56..20c2072a 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From bb700ec46e48d12ac13993e082e6fb74d6597fe9 Mon Sep 17 00:00:00 2001 +From f531e590ce5b465457e4fda0f04b8f9fc17ad7a2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -22,7 +22,7 @@ index 20edd900..5978bec6 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..46968704 +index 00000000..da52c892 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ @@ -52,7 +52,7 @@ index 00000000..46968704 + nicknames.remove(nickname); + + if (config.isAntibotAccountsFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Too many accounts"); + } + + return true; @@ -64,10 +64,10 @@ index 00000000..46968704 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..8069efe1 +index 00000000..0dd6ca2e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,139 @@ +@@ -0,0 +1,148 @@ +package dev._2lstudios.antibot; + +import java.util.Collection; @@ -82,6 +82,7 @@ index 00000000..8069efe1 + private final String hostString; + private String lastNickname = ""; + private String country = null; ++ private String firewallReason = null; + private long lastPing = 0; + private long penultimateConnection = 0; + private long lastConnection = 0; @@ -176,21 +177,29 @@ index 00000000..8069efe1 + return totalConnections; + } + ++ public String getHostString() { ++ return hostString; ++ } ++ + public boolean isFirewalled() { + return System.currentTimeMillis() - lastFirewall < config + .getAntibotFirewallExpire() * 1000; + } + -+ public String getHostString() { -+ return hostString; -+ } -+ -+ public void firewall() { ++ public void firewall(String reason) { + if (!hostString.equals("127.0.0.1")) { + this.lastFirewall = System.currentTimeMillis(); + } + } + ++ public String getFirewallReason() { ++ if (isFirewalled()) { ++ return firewallReason; ++ } ++ ++ return null; ++ } ++ + public void setTotalConnections(final int totalConnections) { + this.totalConnections = totalConnections; + } @@ -244,10 +253,10 @@ index 00000000..af586e55 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..f2f2d535 +index 00000000..0676f897 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,37 @@ +package dev._2lstudios.antibot; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -261,8 +270,6 @@ index 00000000..f2f2d535 + @Getter + private final FastChatCheck fastChatCheck; + @Getter -+ private final FirewallCheck firewallCheck; -+ @Getter + private final NicknameCheck nicknameCheck; + @Getter + private final PasswordCheck passwordCheck; @@ -275,7 +282,6 @@ index 00000000..f2f2d535 + this.accountsCheck = new AccountsCheck(addressDataManager); + this.countryCheck = new CountryCheck(addressDataManager); + this.fastChatCheck = new FastChatCheck(addressDataManager); -+ this.firewallCheck = new FirewallCheck(addressDataManager); + this.nicknameCheck = new NicknameCheck(addressDataManager); + this.passwordCheck = new PasswordCheck(addressDataManager); + this.ratelimitCheck = new RatelimitCheck(addressDataManager); @@ -290,7 +296,7 @@ index 00000000..f2f2d535 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..66d2b980 +index 00000000..e2410468 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -424,7 +430,7 @@ index 00000000..66d2b980 + + if (country != null && isBlacklisted(config, country)) { + if (config.isAntibotCountryFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Blacklisted country"); + } + + return true; @@ -436,7 +442,7 @@ index 00000000..66d2b980 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..8e27085f +index 00000000..19763693 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -462,7 +468,7 @@ index 00000000..8e27085f + + if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { + if (config.isAntibotFastChatFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Too fast chatting"); + } + + return true; @@ -472,41 +478,9 @@ index 00000000..8e27085f + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java -new file mode 100644 -index 00000000..87747328 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FirewallCheck.java -@@ -0,0 +1,26 @@ -+package dev._2lstudios.antibot; -+ -+import java.net.SocketAddress; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class FirewallCheck { -+ private final AddressDataManager addressDataManager; -+ private final FlameCordConfiguration config; -+ -+ public FirewallCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public boolean check(final SocketAddress socketAddress) { -+ if (config.isAntibotFirewallEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); -+ -+ return addressData.isFirewalled(); -+ } -+ -+ return false; -+ } -+} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..034d3a36 +index 00000000..222aba31 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,45 @@ @@ -545,7 +519,7 @@ index 00000000..034d3a36 + + if (isBlacklisted(config, nickname)) { + if (config.isAntibotNicknameFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Blacklisted nickname [" + nickname + "]"); + } + + return true; @@ -557,7 +531,7 @@ index 00000000..034d3a36 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..4ab1d131 +index 00000000..bdc024f5 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -608,7 +582,7 @@ index 00000000..4ab1d131 + + if (repeatCount >= config.getAntibotPasswordLimit()) { + if (config.isAntibotPasswordFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Repeated password"); + } + + return true; @@ -625,7 +599,7 @@ index 00000000..4ab1d131 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..912638e2 +index 00000000..b55b4bb1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -652,7 +626,7 @@ index 00000000..912638e2 + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { + if (config.isAntibotRatelimitFirewall()) { -+ addressData.firewall(); ++ addressData.firewall("Too fast connections"); + } + + return true; @@ -1104,7 +1078,7 @@ index fa87750f..67263bca 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e..69e0b551 100644 +index e2911d5e..1e3608fa 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; @@ -1119,15 +1093,16 @@ index e2911d5e..69e0b551 100644 import net.md_5.bungee.api.Callback; @RequiredArgsConstructor -@@ -21,6 +25,14 @@ public class HttpHandler extends SimpleChannelInboundHandler +@@ -21,6 +25,15 @@ public class HttpHandler extends SimpleChannelInboundHandler @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + // Flamecord start - Antibot System -+ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getSimpleName())) ++ String reason = cause.getClass().getSimpleName(); ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) + { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getSimpleName(), ctx.channel().remoteAddress() ); ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + @@ -1135,7 +1110,7 @@ index e2911d5e..69e0b551 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 65e79eec..f1f6fae2 100644 +index 65e79eec..dda1f25a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1147,15 +1122,16 @@ index 65e79eec..f1f6fae2 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; import net.md_5.bungee.connection.InitialHandler; -@@ -148,6 +150,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -148,6 +150,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + // Flamecord start - Antibot System -+ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(cause.getClass().getSimpleName())) ++ String reason = cause.getClass().getSimpleName(); ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) + { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + cause.getClass().getSimpleName(), ctx.channel().remoteAddress() ); ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + @@ -1163,19 +1139,20 @@ index 65e79eec..f1f6fae2 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea1599..6bf109f5 100644 +index ffea1599..4bb8eb46 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 -@@ -59,6 +59,19 @@ public class PipelineUtils +@@ -59,6 +59,20 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + // FlameCord start - Antibot System -+ if ( FlameCord.getInstance().getCheckManager().getFirewallCheck().check( ch.remoteAddress() ) ) ++ String firewallReason = FlameCord.getInstance().getAddressDataManager().getAddressData(ch.remoteAddress()).getFirewallReason(); ++ if ( firewallReason != null ) + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) + { -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server", ch.remoteAddress() ); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); + } + + ch.close(); From 0bd949ed458ccf12739a4c6b986a6dfd864d0c0b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 24 Oct 2022 13:17:11 +0200 Subject: [PATCH 320/499] Add/Remove Firewall IPs --- .../0029-Antibot-System.patch | 86 +++++++++++++++++-- 1 file changed, 81 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 20c2072a..281359cf 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From f531e590ce5b465457e4fda0f04b8f9fc17ad7a2 Mon Sep 17 00:00:00 2001 +From 01aa5986ae373e9e9fdf0a9b08f412553c370e4c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -64,10 +64,10 @@ index 00000000..da52c892 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..0dd6ca2e +index 00000000..b37f114a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java -@@ -0,0 +1,148 @@ +@@ -0,0 +1,154 @@ +package dev._2lstudios.antibot; + +import java.util.Collection; @@ -189,9 +189,15 @@ index 00000000..0dd6ca2e + public void firewall(String reason) { + if (!hostString.equals("127.0.0.1")) { + this.lastFirewall = System.currentTimeMillis(); ++ this.firewallReason = reason; + } + } + ++ public void unfirewall() { ++ this.lastFirewall = 0; ++ this.firewallReason = null; ++ } ++ + public String getFirewallReason() { + if (isFirewalled()) { + return firewallReason; @@ -874,10 +880,10 @@ index 5d92c20c..e1c18ea6 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 4f306660..33c40733 100644 +index 4f306660..5faab616 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -82,6 +82,17 @@ public class MessagesConfiguration extends FlameConfig { +@@ -82,12 +82,26 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); @@ -895,6 +901,76 @@ index 4f306660..33c40733 100644 // FlameCord setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); setIfUnexistant("flamecord_help", +- "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", ++ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /flamecord help&7 >&b Shows this message!", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); ++ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); ++ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); + + configurationProvider.save(configuration, configurationFile); + +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +index cc76325b..ae5d4c73 100644 +--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -3,6 +3,7 @@ package dev._2lstudios.flamecord.commands; + import java.util.Collection; + import java.util.HashSet; + ++import dev._2lstudios.antibot.AddressDataManager; + import dev._2lstudios.flamecord.FlameCord; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import net.md_5.bungee.BungeeCord; +@@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; + + if (sender.hasPermission("flamecord.usage")) { + if (args.length > 0) { +- final String arg0 = args[0]; +- +- switch (arg0) { ++ switch (args[0]) { + case "reload": { + // FlameCord - Collect ips from servers + final Collection whitelistedAddresses = new HashSet<>(); +@@ -43,9 +42,34 @@ private final BungeeCord bungeeCord; + .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); + break; + } ++ case "firewall": { ++ if (args.length > 2) { ++ String ip = args[2]; ++ ++ switch (args[1]) { ++ case "add": { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).firewall("Blacklisted by command"); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_add", ip))); ++ break; ++ } ++ case "remove": { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).unfirewall(); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_remove", ip))); ++ break; ++ } ++ default: { ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); ++ break; ++ } ++ } ++ } else { ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); ++ } ++ ++ break; ++ } + default: { +- sender.sendMessage(TextComponent.fromLegacyText( +- messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + break; + } + } 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 7035729b..7c2128dc 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java From 0c59ffdaa71d51714d45019532d00ed68beb3d17 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 24 Oct 2022 19:05:46 +0200 Subject: [PATCH 321/499] 1.1.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 0e1e7d85..97f0b4ef 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.5"; ++ return "1.1.6"; } public void reloadMessages() From 050ef406182080017ee06f043782e3570df8570e Mon Sep 17 00:00:00 2001 From: Ismael Hanbel Date: Sat, 29 Oct 2022 02:54:10 +0200 Subject: [PATCH 322/499] Release the ByteBuf when triggers --- .../0034-Dont-frame-unreadable-connections.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch index 5d632586..5b9154b5 100644 --- a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch @@ -15,6 +15,7 @@ index 074d2437..e248daee 100644 - if ( !ctx.channel().isActive() ) + if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable { + in.release(); return; } -- From 9cc15a402f98bc31416b21ceeee273ddd93dafe4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:06:55 +0100 Subject: [PATCH 323/499] Safe bytebuf release --- ...ded-an-api-method-to-unload-Plugins.patch} | 4 +- .../0023-Always-release-packets.patch | 46 ---- ...s.patch => 0024-Apply-packet-limits.patch} | 2 +- ...em.patch => 0025-Custom-motd-system.patch} | 6 +- ...st-Open.patch => 0026-TCP-Fast-Open.patch} | 4 +- ...027-InitialHandler-Processing-State.patch} | 4 +- ...System.patch => 0028-Antibot-System.patch} | 6 +- ...s.patch => 0029-Allow-Invalid-Names.patch} | 2 +- ... 0030-Duplicate-buf-instead-of-Copy.patch} | 4 +- ...031-Disable-entity-Metadata-Rewrite.patch} | 4 +- ...t.patch => 0032-Command-List-Format.patch} | 6 +- ...3-Dont-frame-unreadable-connections.patch} | 6 +- ...> 0034-Avoid-throwing-IOOB-on-login.patch} | 2 +- .../0035-Safe-bytebuf-release.patch | 233 ++++++++++++++++++ 14 files changed, 258 insertions(+), 71 deletions(-) rename Waterfall-Proxy-Patches/{0024-Added-an-api-method-to-unload-Plugins.patch => 0023-Added-an-api-method-to-unload-Plugins.patch} (97%) delete mode 100644 Waterfall-Proxy-Patches/0023-Always-release-packets.patch rename Waterfall-Proxy-Patches/{0025-Apply-packet-limits.patch => 0024-Apply-packet-limits.patch} (97%) rename Waterfall-Proxy-Patches/{0026-Custom-motd-system.patch => 0025-Custom-motd-system.patch} (98%) rename Waterfall-Proxy-Patches/{0027-TCP-Fast-Open.patch => 0026-TCP-Fast-Open.patch} (97%) rename Waterfall-Proxy-Patches/{0028-InitialHandler-Processing-State.patch => 0027-InitialHandler-Processing-State.patch} (97%) rename Waterfall-Proxy-Patches/{0029-Antibot-System.patch => 0028-Antibot-System.patch} (99%) rename Waterfall-Proxy-Patches/{0030-Allow-Invalid-Names.patch => 0029-Allow-Invalid-Names.patch} (97%) rename Waterfall-Proxy-Patches/{0031-Duplicate-buf-instead-of-Copy.patch => 0030-Duplicate-buf-instead-of-Copy.patch} (94%) rename Waterfall-Proxy-Patches/{0032-Disable-entity-Metadata-Rewrite.patch => 0031-Disable-entity-Metadata-Rewrite.patch} (99%) rename Waterfall-Proxy-Patches/{0033-Command-List-Format.patch => 0032-Command-List-Format.patch} (94%) rename Waterfall-Proxy-Patches/{0034-Dont-frame-unreadable-connections.patch => 0033-Dont-frame-unreadable-connections.patch} (89%) rename Waterfall-Proxy-Patches/{0035-Avoid-throwing-IOOB-on-login.patch => 0034-Avoid-throwing-IOOB-on-login.patch} (93%) create mode 100644 Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch diff --git a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch similarity index 97% rename from Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch index d9eabf01..e1df098f 100644 --- a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 15a8f8edb2a5bca8b39560784ce8d20cb1f89d74 Mon Sep 17 00:00:00 2001 +From c3d43897657dc6636189621bd60f9cb86b6ac2d0 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -82,5 +82,5 @@ index 90031156..a190dfae 100644 ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] { -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0023-Always-release-packets.patch b/Waterfall-Proxy-Patches/0023-Always-release-packets.patch deleted file mode 100644 index abcbe855..00000000 --- a/Waterfall-Proxy-Patches/0023-Always-release-packets.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d355f46a5efe21ebf60fa02dc5cd36acc9b6f227 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Sat, 1 May 2021 23:28:19 -0300 -Subject: [PATCH] Always release packets - - -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 8eda3110..cef44d8a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -116,12 +116,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - return; - } - -- if ( handler != null ) -+ PacketWrapper packet = (PacketWrapper) msg; -+ -+ -+ try - { -- PacketWrapper packet = (PacketWrapper) msg; -- boolean sendPacket = handler.shouldHandle( packet ); -- try -+ if ( handler != null ) - { -+ boolean sendPacket = handler.shouldHandle( packet ); - if ( sendPacket && packet.packet != null ) - { - try -@@ -136,10 +138,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - handler.handle( packet ); - } -- } finally -- { -- packet.trySingleRelease(); - } -+ } finally -+ { -+ packet.trySingleRelease(); - } - } - --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch similarity index 97% rename from Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch index c5ba0912..16e0f136 100644 --- a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From b9e025ba81bbb80fdaf9d5dc4a52b358bfe382a9 Mon Sep 17 00:00:00 2001 +From 5bddd07166fdd36bf8f174ded2841903aca46153 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0025-Custom-motd-system.patch similarity index 98% rename from Waterfall-Proxy-Patches/0026-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0025-Custom-motd-system.patch index 4fdbab5f..77fc345a 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0025-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 547085355fe3fa7a13e2b35f5ab6a53848a2ea11 Mon Sep 17 00:00:00 2001 +From b406218a681d715b932c80458b4164e4d4cd6db5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -125,7 +125,7 @@ index c327841a..de2cc947 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 41c99bb4..5e82d29a 100644 +index 198086e0..d99cb5d0 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -200,5 +200,5 @@ index 41c99bb4..5e82d29a 100644 thisState = State.PING; -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch similarity index 97% rename from Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch rename to Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch index 51059b89..43e270d3 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch @@ -1,4 +1,4 @@ -From ca72ee92ce1d192bfd4551116eab80a9efa69bee Mon Sep 17 00:00:00 2001 +From 03547260d8d2d4445a56e83fd7e63fe0a836904b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open @@ -41,5 +41,5 @@ index a4c3bd71..ffea1599 100644 ch.config().setWriteBufferWaterMark( MARK ); -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch similarity index 97% rename from Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch rename to Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch index a233a1f3..78787cd3 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch @@ -1,4 +1,4 @@ -From c694749ccf2854172528a4d81cb2d81dfc06e635 Mon Sep 17 00:00:00 2001 +From a78ba453d6621c5287b5a3efcff0dbe012671c22 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State @@ -73,5 +73,5 @@ index d99cb5d0..7035729b 100644 this.uniqueId = uuid; } -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch similarity index 99% rename from Waterfall-Proxy-Patches/0029-Antibot-System.patch rename to Waterfall-Proxy-Patches/0028-Antibot-System.patch index 281359cf..75a8b522 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 01aa5986ae373e9e9fdf0a9b08f412553c370e4c Mon Sep 17 00:00:00 2001 +From a9f7091c77c4290c3254b9962caf0b851ccd59b3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1186,7 +1186,7 @@ index e2911d5e..1e3608fa 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 65e79eec..dda1f25a 100644 +index 14e3004f..abca28bd 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1198,7 +1198,7 @@ index 65e79eec..dda1f25a 100644 import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; import net.md_5.bungee.connection.InitialHandler; -@@ -148,6 +150,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -146,6 +148,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch similarity index 97% rename from Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch rename to Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 3409730e..1efe80fc 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From 3f7c5a330d893f77631db8698fd0de704597b7ec Mon Sep 17 00:00:00 2001 +From 84039249930540d4f36a0ae443d80b4734d64e9e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch b/Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch similarity index 94% rename from Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch rename to Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch index 7d23d5d3..b16b3041 100644 --- a/Waterfall-Proxy-Patches/0031-Duplicate-buf-instead-of-Copy.patch +++ b/Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch @@ -1,4 +1,4 @@ -From 90635c0b9afe244a66f3806d52a316f0e4fcfe45 Mon Sep 17 00:00:00 2001 +From 8c2a775eba07694db8fb29e65ddd210638ad5335 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:36:43 -0300 Subject: [PATCH] Duplicate buf instead of Copy @@ -29,5 +29,5 @@ index 3992f521..074d2437 100644 } catch (BadPacketException | IndexOutOfBoundsException e) { // Waterfall start: Additional DoS mitigations -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch similarity index 99% rename from Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch rename to Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch index b9034824..279fee4f 100644 --- a/Waterfall-Proxy-Patches/0032-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 374bddd71d06eaa3d8d6118bfb83dfe42cf8850e Mon Sep 17 00:00:00 2001 +From 04c710954eb496691660636d0dcde1382a4dd45d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -3235,5 +3235,5 @@ index caed4384..af428090 100644 } -- -2.37.2.windows.2 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0033-Command-List-Format.patch b/Waterfall-Proxy-Patches/0032-Command-List-Format.patch similarity index 94% rename from Waterfall-Proxy-Patches/0033-Command-List-Format.patch rename to Waterfall-Proxy-Patches/0032-Command-List-Format.patch index 4e01d8e0..045009fa 100644 --- a/Waterfall-Proxy-Patches/0033-Command-List-Format.patch +++ b/Waterfall-Proxy-Patches/0032-Command-List-Format.patch @@ -1,11 +1,11 @@ -From f1f00b0c2e5d89472ad23b951181797c55b92424 Mon Sep 17 00:00:00 2001 +From 3ca6b631ac234e011a2a8a09b99f42db68b81e79 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 26 Apr 2022 10:58:11 -0300 Subject: [PATCH] Command List Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ee0295c7..1ba8c8a5 100644 +index 5faab616..9ae20cbb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -35,6 +35,7 @@ public class MessagesConfiguration extends FlameConfig { @@ -30,5 +30,5 @@ index c2227110..d9c8e352 100644 { if ( !server.canAccess( sender ) ) -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch similarity index 89% rename from Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch rename to Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch index 5d632586..f7fddd72 100644 --- a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch @@ -1,11 +1,11 @@ -From 5cb2ccdb33cc1e380a97f2042bd5d50da8718665 Mon Sep 17 00:00:00 2001 +From 87b7ba071d916722920d1cbe01a36fb379fbf81a Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Thu, 4 Aug 2022 23:27:43 +0200 Subject: [PATCH] Dont frame unreadable connections diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 074d2437..e248daee 100644 +index 074d2437..9a7bf9b5 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -18,5 +18,5 @@ index 074d2437..e248daee 100644 return; } -- -2.34.1.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch similarity index 93% rename from Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch rename to Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch index b9f39089..af16bcd9 100644 --- a/Waterfall-Proxy-Patches/0035-Avoid-throwing-IOOB-on-login.patch +++ b/Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch @@ -1,4 +1,4 @@ -From 960a54fbe3fc62cc1aa2607d9efe4eb4b33b03b0 Mon Sep 17 00:00:00 2001 +From 0eb7dd9c239bb09fa8b87ad963b2203ea6f9e2eb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:41:48 -0300 Subject: [PATCH] Avoid throwing IOOB on login diff --git a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch new file mode 100644 index 00000000..21f9cfc6 --- /dev/null +++ b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch @@ -0,0 +1,233 @@ +From fe09001a7013321ec3172eee6cbe895063fbc294 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Mon, 31 Oct 2022 17:00:58 +0100 +Subject: [PATCH] Safe bytebuf release + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 9a7bf9b5..a006f502 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -31,33 +31,34 @@ public class MinecraftDecoder extends MessageToMessageDecoder + @Override + protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception + { +- // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() +- // will fire any cumulated data through the pipeline, so we want to try and stop it here. +- if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable +- { +- return; +- } ++ // FlameCord - Safe bytebuf release ++ Object packetTypeInfo = null; ++ ByteBuf slice = null; ++ try { ++ // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() ++ // will fire any cumulated data through the pipeline, so we want to try and stop it here. ++ if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable ++ { ++ return; ++ } + +- Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; +- +- // FlameCord - Check size before decoding +- if (prot == protocol.TO_SERVER) { +- final int readableBytes = in.readableBytes(); +- final int capacity = in.capacity(); +- +- if (readableBytes > 2097152) { +- throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); +- } else if (capacity > 2097152) { +- throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); ++ Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; ++ ++ // FlameCord - Check size before decoding ++ if (prot == protocol.TO_SERVER) { ++ final int readableBytes = in.readableBytes(); ++ final int capacity = in.capacity(); ++ ++ if (readableBytes > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); ++ } else if (capacity > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); ++ } + } +- } + +- // FlameCord - Duplicate buf instead of Copy +- ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( ++ // FlameCord - Duplicate buf instead of Copy ++ slice = in.duplicate(); // Can't slice this one due to EntityMap :( + +- Object packetTypeInfo = null; +- try +- { + // Waterfall start + if (in.readableBytes() == 0 && !server) { + return; +@@ -117,6 +118,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder + { + slice.release(); + } ++ ++ in.release(); + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index a63e67f1..4293e2b4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -286,10 +286,15 @@ public class ServerConnector extends PacketHandler + user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); + } else + { +- ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); +- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); +- brand.release(); ++ // FlameCord - Safe bytebuf release ++ ByteBuf brand = null; ++ try { ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); ++ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); ++ } finally { ++ if (brand != null) brand.release(); ++ } + } + // FlameCord end - 1.7.x support + } +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 +index d662c976..fbbaa1b2 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -291,13 +291,24 @@ public class DownstreamBridge extends PacketHandler + { + try + { +- ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); +- String serverBrand = DefinedPacket.readString(brand); +- brand.release(); +- brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall +- pluginMessage.setData(brand); +- brand.release(); ++ // FlameCord - Safe bytebuf release ++ ByteBuf brand = null; ++ String serverBrand; ++ try { ++ brand = Unpooled.wrappedBuffer(pluginMessage.getData()); ++ serverBrand = DefinedPacket.readString(brand); ++ } finally { ++ if (brand != null) brand.release(); ++ } ++ ++ // FlameCord - Safe bytebuf release ++ try { ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData(brand); ++ } finally { ++ if (brand != null) brand.release(); ++ } + } catch (Exception ProtocolHacksSuck) + { + return; +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index abca28bd..2fd37c2d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -84,46 +84,44 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception + { +- // FlameCord - Return if channel isn't active +- if (!ctx.channel().isActive()) { +- if (msg instanceof PacketWrapper) { +- ((PacketWrapper) msg).trySingleRelease(); ++ // FlameCord - Safe bytebuf release ++ try ++ { ++ // FlameCord - Return if channel isn't active ++ if (!ctx.channel().isActive()) { ++ return; + } + +- return; +- } +- +- if ( msg instanceof HAProxyMessage ) +- { +- HAProxyMessage proxy = (HAProxyMessage) msg; +- try ++ if ( msg instanceof HAProxyMessage ) + { +- if ( proxy.sourceAddress() != null ) ++ HAProxyMessage proxy = (HAProxyMessage) msg; ++ try + { +- InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); ++ if ( proxy.sourceAddress() != null ) ++ { ++ InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); + +- // FlameCord - Option to log haproxy +- if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] +- { +- channel.getRemoteAddress(), newAddress +- } ); ++ // FlameCord - Option to log haproxy ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); + +- channel.setRemoteAddress( newAddress ); ++ channel.setRemoteAddress( newAddress ); ++ } ++ } finally ++ { ++ proxy.release(); + } +- } finally +- { +- proxy.release(); ++ return; + } +- return; +- } + +- if ( handler != null ) +- { + PacketWrapper packet = (PacketWrapper) msg; +- boolean sendPacket = handler.shouldHandle( packet ); +- try ++ ++ if ( handler != null ) + { ++ boolean sendPacket = handler.shouldHandle( packet ); + if ( sendPacket && packet.packet != null ) + { + try +@@ -138,9 +136,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + handler.handle( packet ); + } +- } finally +- { +- packet.trySingleRelease(); ++ } ++ } finally ++ { ++ if (msg instanceof PacketWrapper) { ++ ((PacketWrapper) msg).trySingleRelease(); + } + } + } +-- +2.37.3.windows.1 + From 0f792447cfabd2371cf648bf3be17cf7e5048894 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:32:47 +0100 Subject: [PATCH 324/499] update --- .../0035-Safe-bytebuf-release.patch | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch index 21f9cfc6..492bba23 100644 --- a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch +++ b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch @@ -1,11 +1,11 @@ -From fe09001a7013321ec3172eee6cbe895063fbc294 Mon Sep 17 00:00:00 2001 +From fcbd2374afc15c2fe67dd158b6fd2ae68487ed6a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:00:58 +0100 Subject: [PATCH] Safe bytebuf release diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 9a7bf9b5..a006f502 100644 +index 9a7bf9b5..b43ebc8d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -31,33 +31,34 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -66,15 +66,6 @@ index 9a7bf9b5..a006f502 100644 // Waterfall start if (in.readableBytes() == 0 && !server) { return; -@@ -117,6 +118,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder - { - slice.release(); - } -+ -+ in.release(); - } - } - diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index a63e67f1..4293e2b4 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java From b9f8eab09e4dbcaa4df0177235d43c0b8a9c8fcf Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:35:41 +0100 Subject: [PATCH 325/499] Revert xlsm patch --- .../0034-Dont-frame-unreadable-connections.patch | 1 - 1 file changed, 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch index 5b9154b5..5d632586 100644 --- a/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0034-Dont-frame-unreadable-connections.patch @@ -15,7 +15,6 @@ index 074d2437..e248daee 100644 - if ( !ctx.channel().isActive() ) + if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable { - in.release(); return; } -- From 502bdc863bae903d49d3fc317f2fab7bb991c899 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:36:39 +0100 Subject: [PATCH 326/499] 1.1.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 97f0b4ef..126e70c6 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.6"; ++ return "1.1.7"; } public void reloadMessages() From eb2d84361ef9ed66687b3abf93dc430974901a01 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 3 Nov 2022 01:35:08 +0100 Subject: [PATCH 327/499] Fix addresses not properly handled --- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 75a8b522..8335687f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From a9f7091c77c4290c3254b9962caf0b851ccd59b3 Mon Sep 17 00:00:00 2001 +From b14935a7b331d68ef0a882c0c193e03ff04a9ec5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -224,10 +224,10 @@ index 00000000..b37f114a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 00000000..af586e55 +index 00000000..6c7b300c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,31 @@ +package dev._2lstudios.antibot; + +import java.net.InetSocketAddress; @@ -238,7 +238,9 @@ index 00000000..af586e55 +public class AddressDataManager { + private final Map addressData = new HashMap<>(); + -+ public AddressData getAddressData(final String addressString) { ++ public AddressData getAddressData(String addressString) { ++ addressString = addressString.replace("/", "").split(":")[0]; ++ + if (addressData.containsKey(addressString)) { + return addressData.get(addressString); + } else { From b9648c99998d5c734c5f7d1f75baf747265bee9d Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 3 Nov 2022 01:35:43 +0100 Subject: [PATCH 328/499] 1.1.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 126e70c6..220a9be7 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.7"; ++ return "1.1.8"; } public void reloadMessages() From 6c79fe0a371bffbbb446318cee027fa3f9d85a88 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:36:53 +0100 Subject: [PATCH 329/499] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9acb91de..c63f76a8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ FlameCord is a Waterfall modification to fix exploits, improve performance and p FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. + + ## Features From ee370fc45a65fdd3c13066c45add4e99088b5627 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:49:06 +0100 Subject: [PATCH 330/499] Update README.md --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c63f76a8..8ea261da 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -FlameCord -======= +# FlameCord -FlameCord is a Waterfall modification to fix exploits, improve performance and protect against bot attacks. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. +FlameCord is a Waterfall fork or modification that adds antibot features, exploit prevention systems, performance improvements, removal of unused features, library updates and application layer ddos mitigation. -FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. - - +## Links - + ## Features FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: * **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. -* **Bot Protection**: FlameCord brings swift bot protection for your Minecraft server to avoid extra CPU usage and crashes in your machines. + +* **Antibot Features**: FlameCord brings swift bot protection for your Minecraft server to avoid extra CPU usage and crashes in your machines. + +* **Performance Improvements**: FlameCord tries to improve performance by removing unused features and disabling exception logs. ## Why fork Waterfall? @@ -34,7 +34,8 @@ To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` -## Join us +FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. + +## Contribute * Feel free to open a PR! We accept contributions. -* Join to our [Discord Server](https://discord.gg/gF36AT3). From e56a5dbd7c94677f023fc8e5514733f8b37b242f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:50:27 +0100 Subject: [PATCH 331/499] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ea261da..8f2bdc5c 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ FlameCord will track upstream Waterfall and merge changes as needed. ## How to (Server Admins) -You can support the development of FlameCord by purchasing it at [MC-Market](https://www.mc-market.org/resources/13492/). +Just drag an drop FlameCord.jar into your server folder and run it. -FlameCord requires **Java 8** or above. +You can customize many FlameCord features in the flamecord.yml file. ## How To (Compiling from source) From a20d83bc09858a1211cc41ca79cfa305c9ef442b Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:56:29 +0100 Subject: [PATCH 332/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f2bdc5c..f22f7172 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ FlameCord is a Waterfall fork or modification that adds antibot features, exploi ## Links - + ## Features From 580e26b3777dd414e2dc6d00ff130cdcd298e43c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:07:49 +0100 Subject: [PATCH 333/499] Make detailed errors default true --- .../0022-FlameCord-logger-options.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 0f020a26..0c35a21d 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 9267227d04296ef844096cfe3a1a063ffee94643 Mon Sep 17 00:00:00 2001 +From 68b8627a3c0bb57244b19aa20ea48cec05978b03 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c8148e90..c327841a 100644 +index c8148e90..aac41c8b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,17 @@ import net.md_5.bungee.config.Configuration; @@ -21,7 +21,7 @@ index c8148e90..c327841a 100644 + @Getter + private boolean loggerHaProxy = false; + @Getter -+ private boolean loggerDetailedConnection = false; ++ private boolean loggerDetailedConnection = true; + public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { try { @@ -64,7 +64,7 @@ index e48f7713..7c0c2fff 100644 } 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 3eec7b6b..41c99bb4 100644 +index 5d8aad84..198086e0 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 @@ -393,7 +393,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -139,5 +139,5 @@ index 694ecdb0..14e3004f 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.37.0.windows.1 +2.37.3.windows.1 From 5d39eae1431540f3bc28fd2d6d396aa285911c82 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:09:47 +0100 Subject: [PATCH 334/499] 1.1.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 220a9be7..8d150edd 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 2fef94e5..15a639de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.8"; ++ return "1.1.9"; } public void reloadMessages() From 8ad569d8aa28c6a5c06f2f19a571966154637c97 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:09:04 +0100 Subject: [PATCH 335/499] Show connection fail reason --- .../0022-FlameCord-logger-options.patch | 6 ++--- .../0036-Show-connection-fail-reason.patch | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 0c35a21d..66acf8ac 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 68b8627a3c0bb57244b19aa20ea48cec05978b03 Mon Sep 17 00:00:00 2001 +From 9e92ced872601751df9e5e978065eda834d777be Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options @@ -40,7 +40,7 @@ index c8148e90..aac41c8b 100644 } catch (final IOException e) { e.printStackTrace(); 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 e48f7713..7c0c2fff 100644 +index e48f7713..90922797 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -56,7 +56,7 @@ index e48f7713..7c0c2fff 100644 private String connectionFailMessage(Throwable cause) { - bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall -+ //FlameCord - Allow for toggle the logging of connection failures ++ // FlameCord - Allow for toggle the logging of connection failures + if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { + bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall + } diff --git a/Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch b/Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch new file mode 100644 index 00000000..5884c038 --- /dev/null +++ b/Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch @@ -0,0 +1,23 @@ +From 5e0a6aa349884b190a106b2c7609d6482ee5360f Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 15 Nov 2022 18:07:27 +0100 +Subject: [PATCH] Show connection fail reason + + +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 f3d60253..999f02e5 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -406,7 +406,8 @@ public final class UserConnection implements ProxiedPlayer + if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { + bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall + } +- return ""; // Waterfall ++ // FlameCord - Show connection fail reason ++ return cause.getMessage(); + } + + @Override +-- +2.37.3.windows.1 + From 0f807dd26eac95dff54b369ccecd40258f47c37a Mon Sep 17 00:00:00 2001 From: Achsion Date: Mon, 12 Dec 2022 22:35:59 +0100 Subject: [PATCH 336/499] Only show detailed connect exception to admins --- ...ly-show-detailed-connect-exception-to-admins.patch} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename Waterfall-Proxy-Patches/{0036-Show-connection-fail-reason.patch => 0036-Only-show-detailed-connect-exception-to-admins.patch} (75%) diff --git a/Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch b/Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch similarity index 75% rename from Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch rename to Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch index 5884c038..a4e2fcb0 100644 --- a/Waterfall-Proxy-Patches/0036-Show-connection-fail-reason.patch +++ b/Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch @@ -1,11 +1,11 @@ -From 5e0a6aa349884b190a106b2c7609d6482ee5360f Mon Sep 17 00:00:00 2001 +From efa69c69e7b81b75ea1a602f07b3410cacbcc89c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 -Subject: [PATCH] Show connection fail reason +Subject: [PATCH] Only show detailed connect exception to admins 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 f3d60253..999f02e5 100644 +index f3d60253..713d9037 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -406,7 +406,8 @@ public final class UserConnection implements ProxiedPlayer @@ -14,10 +14,10 @@ index f3d60253..999f02e5 100644 } - return ""; // Waterfall + // FlameCord - Show connection fail reason -+ return cause.getMessage(); ++ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); } @Override -- -2.37.3.windows.1 +2.29.2.windows.2 From f6825d558e8febfaa0e323bbc341132a294afa2d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 12 Dec 2022 23:17:06 +0100 Subject: [PATCH 337/499] 1.19.3 --- Waterfall | 2 +- ...ferences-from-Waterfall-to-FlameCord.patch | 28 +- .../0003-FlameCord-rebrand.patch | 16 +- .../0004-1.7.x-support.patch | 256 +++++++++--------- ...ake-PlayerHandshakeEvent-cancellable.patch | 10 +- ...sable-update-checker-Use-bungee-name.patch | 19 +- ...ections-Don-t-flush-if-not-necessary.patch | 14 +- ...tom-uuids-even-if-onlineMode-is-true.patch | 8 +- ...-Don-t-declare-uuid-unless-it-s-null.patch | 8 +- .../0017-FlameCord-General-Patch.patch | 45 ++- .../0018-FlameCord-module-system.patch | 18 +- ...0019-FlameCord-message-configuration.patch | 24 +- .../0020-Fix-ByteBuf-memory-leaks.patch | 10 +- .../0022-FlameCord-logger-options.patch | 14 +- ...0027-InitialHandler-Processing-State.patch | 10 +- .../0028-Antibot-System.patch | 55 ++-- .../0029-Allow-Invalid-Names.patch | 8 +- ...0031-Disable-entity-Metadata-Rewrite.patch | 71 ++--- .../0035-Safe-bytebuf-release.patch | 12 +- 19 files changed, 303 insertions(+), 325 deletions(-) diff --git a/Waterfall b/Waterfall index 31a36117..079f3a31 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 31a361174c99f06b11420ec49ae9d99b4f5b4066 +Subproject commit 079f3a31294551fcedc92bff2943ce749bdb99b5 diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index 198ebf20..a5690f86 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -1,11 +1,11 @@ -From 6c907417fb81eab79424a93cd1d5db29ebbab197 Mon Sep 17 00:00:00 2001 +From 5b40e2e22fb37fb5aa2b34d3a6b14bd91e7e72fa Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 6 Jun 2016 13:47:46 -0600 Subject: [PATCH] Rename references from Waterfall to FlameCord diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 00ce099c..cbd16c34 100644 +index 688f1b995..b0b0d33eb 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -37,7 +37,7 @@ @@ -18,7 +18,7 @@ index 00ce099c..cbd16c34 100644 org.apache.maven.plugins diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -index a4516ed9..9838f5c5 100644 +index a4516ed96..9838f5c55 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -7,7 +7,7 @@ public class Bootstrap @@ -31,7 +31,7 @@ index a4516ed9..9838f5c5 100644 return; } diff --git a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -index d703d6d2..49dce84b 100644 +index d703d6d24..49dce84ba 100644 --- a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java +++ b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java @@ -12,7 +12,7 @@ public class LogDispatcher extends Thread @@ -44,19 +44,19 @@ index d703d6d2..49dce84b 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 9ef2b77a..2fef94e5 100644 +index e0fcd8fbe..8617cdc7a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -188,7 +188,7 @@ public class BungeeCord extends ProxyServer +@@ -189,7 +189,7 @@ public class BungeeCord extends ProxyServer public BungeeCord() throws IOException { // Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up. - Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Waterfall in directory with ! in path." ); + Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use FlameCord in directory with ! in path." ); - try - { -@@ -536,7 +536,7 @@ public class BungeeCord extends ProxyServer + reloadMessages(); + +@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer @Override public String getName() { @@ -66,7 +66,7 @@ index 9ef2b77a..2fef94e5 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 0db3d76a..25da0a65 100644 +index 96a9998d1..463bc3d53 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -63,7 +63,7 @@ public class BungeeCordLauncher @@ -79,7 +79,7 @@ index 0db3d76a..25da0a65 100644 if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index b26035cf..820f7b03 100644 +index b26035cf9..820f7b03c 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,6 @@ public class CommandBungee extends Command @@ -91,7 +91,7 @@ index b26035cf..820f7b03 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -index 720d0c3b..5ab4db18 100644 +index 720d0c3b5..5ab4db189 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -23,7 +23,7 @@ public class CommandReload extends Command @@ -105,7 +105,7 @@ index 720d0c3b..5ab4db18 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 0644b8cd..9c11ac57 100644 +index 0dd69778b..9abae0b61 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -227,7 +227,7 @@ public class YamlConfig implements ConfigurationAdapter @@ -118,5 +118,5 @@ index 0644b8cd..9c11ac57 100644 SocketAddress address = Util.getAddr( addr ); ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 8d150edd..104c3977 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 87c680c40d5cb84882e5328c9f1d0adffc86b386 Mon Sep 17 00:00:00 2001 +From 055097d6787c64aa3495fee07ab3cc4fdc6a3c56 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index e31fb00a..ff4bbf34 100644 +index da0efa36f..966d2442b 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,10 +19,10 @@ index e31fb00a..ff4bbf34 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2fef94e5..15a639de 100644 +index 8617cdc7a..19cc33b97 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -542,7 +542,7 @@ public class BungeeCord extends ProxyServer +@@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @Override public String getVersion() { @@ -30,9 +30,9 @@ index 2fef94e5..15a639de 100644 + return "1.1.9"; } - public void reloadMessages() + public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03..aeda7963 100644 +index 820f7b03c..aeda79639 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03..aeda7963 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b2b19996 100644 +index 0c1ecfb8e..b2b199969 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler @@ -59,5 +59,5 @@ index 0c1ecfb8..b2b19996 100644 listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 84815e11..4546e71f 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,14 +1,14 @@ -From 5f0853d26677fe45f76e60f61d5dcd8e82dd3371 Mon Sep 17 00:00:00 2001 +From a75405f17616b89acf9874fabd29e11c94c50977 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index 561a9522..9a26c845 100644 +index 59f2cb73d..f33ce913a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -365,4 +365,36 @@ public abstract class DefinedPacket +@@ -415,4 +415,36 @@ public abstract class DefinedPacket return 0; } // Waterfall end @@ -46,10 +46,10 @@ index 561a9522..9a26c845 100644 + // FlameCord end - 1.7.x support } 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 -index b852a24e..d94c2cdf 100644 +index 2357f3801..c9e45b915 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -64,7 +64,7 @@ public enum Protocol +@@ -66,7 +66,7 @@ public enum Protocol TO_SERVER.registerPacket( Handshake.class, Handshake::new, @@ -58,7 +58,7 @@ index b852a24e..d94c2cdf 100644 ); } }, -@@ -76,7 +76,7 @@ public enum Protocol +@@ -78,7 +78,7 @@ public enum Protocol TO_CLIENT.registerPacket( KeepAlive.class, KeepAlive::new, @@ -67,7 +67,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -90,7 +90,7 @@ public enum Protocol +@@ -93,7 +93,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, @@ -76,7 +76,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -102,7 +102,7 @@ public enum Protocol +@@ -106,7 +106,7 @@ public enum Protocol ); TO_CLIENT.registerPacket( Chat.class, Chat::new, @@ -85,7 +85,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -113,7 +113,7 @@ public enum Protocol +@@ -117,7 +117,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,7 +94,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -139,20 +139,20 @@ public enum Protocol +@@ -144,20 +144,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, @@ -118,7 +118,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -167,7 +167,7 @@ public enum Protocol +@@ -173,7 +173,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -179,7 +179,7 @@ public enum Protocol +@@ -186,7 +186,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -192,7 +192,7 @@ public enum Protocol +@@ -200,7 +200,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -145,7 +145,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -205,7 +205,7 @@ public enum Protocol +@@ -214,7 +214,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, @@ -154,7 +154,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -218,7 +218,7 @@ public enum Protocol +@@ -228,7 +228,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -231,7 +231,7 @@ public enum Protocol +@@ -242,7 +242,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -245,7 +245,7 @@ public enum Protocol +@@ -257,7 +257,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -259,7 +259,7 @@ public enum Protocol +@@ -272,7 +272,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -299,7 +299,7 @@ public enum Protocol +@@ -317,7 +317,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -316,7 +316,7 @@ public enum Protocol +@@ -335,7 +335,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -367,7 +367,7 @@ public enum Protocol +@@ -401,7 +401,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -380,7 +380,7 @@ public enum Protocol +@@ -415,7 +415,7 @@ public enum Protocol ); TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -402,7 +402,7 @@ public enum Protocol +@@ -437,7 +437,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -414,7 +414,7 @@ public enum Protocol +@@ -450,7 +450,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -425,7 +425,7 @@ public enum Protocol +@@ -462,7 +462,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index b852a24e..d94c2cdf 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -445,23 +445,23 @@ public enum Protocol +@@ -483,23 +483,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index b852a24e..d94c2cdf 100644 ); } }, -@@ -473,22 +473,22 @@ public enum Protocol +@@ -511,22 +511,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index b852a24e..d94c2cdf 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -499,12 +499,12 @@ public enum Protocol +@@ -537,12 +537,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -324,7 +324,7 @@ index b852a24e..d94c2cdf 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index aa5daf47..a6b13aa1 100644 +index 85f1b0b46..b5b3b2890 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index aa5daf47..a6b13aa1 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -46,6 +50,7 @@ public class ProtocolConstants +@@ -47,6 +51,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,7 +346,7 @@ index aa5daf47..a6b13aa1 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -60,6 +65,10 @@ public class ProtocolConstants +@@ -61,6 +66,10 @@ public class ProtocolConstants "1.19.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( @@ -358,7 +358,7 @@ index aa5daf47..a6b13aa1 100644 ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index dc986609..230018ae 100644 +index dc9866097..230018aea 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -41,6 +41,7 @@ public class Chat extends DefinedPacket @@ -378,7 +378,7 @@ index dc986609..230018ae 100644 { buf.writeByte( position ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index d7d4e6ab..570a89f0 100644 +index d7d4e6ab4..570a89f0a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -34,6 +34,12 @@ public class ClientSettings extends DefinedPacket @@ -415,7 +415,7 @@ index d7d4e6ab..570a89f0 100644 buf.writeByte( viewDistance ); if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca..86182cdd 100644 +index a29524ca8..e78519964 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java @@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket @@ -448,12 +448,12 @@ index a29524ca..86182cdd 100644 + return; + } + // FlameCord end - 1.7.x support -+ ++ writeString( serverId, buf ); writeArray( publicKey, buf ); writeArray( verifyToken, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 50bb52b1..b15f9e6a 100644 +index 545eec72f..eacdbe78a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket @@ -468,9 +468,9 @@ index 50bb52b1..b15f9e6a 100644 + return; + } + // FlameCord end - 1.7.x support -+ ++ sharedSecret = readArray( buf, 128 ); - if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19 || buf.readBoolean() ) + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19 || protocolVersion >= ProtocolConstants.MINECRAFT_1_19_3 || buf.readBoolean() ) { @@ -35,6 +44,15 @@ public class EncryptionResponse extends DefinedPacket @Override @@ -489,7 +489,7 @@ index 50bb52b1..b15f9e6a 100644 if ( verifyToken != null ) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9..0ed78a8c 100644 +index d11a9ea9d..0ed78a8c4 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -550,7 +550,7 @@ index d11a9ea9..0ed78a8c 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3a..435b8578 100644 +index 7ed2dc3ab..435b85789 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -589,7 +589,7 @@ index 7ed2dc3a..435b8578 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc41..a8c3e773 100644 +index b004bc416..a8c3e7736 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java @@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket @@ -622,7 +622,7 @@ index b004bc41..a8c3e773 100644 { buf.writeLong( randomId ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 07fb3d79..7d03cd10 100644 +index 07fb3d79a..7d03cd10a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java @@ -25,6 +25,11 @@ public class LoginSuccess extends DefinedPacket @@ -665,7 +665,7 @@ index 07fb3d79..7d03cd10 100644 + // FlameCord end - 1.7.x support } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 7dfdb58d..4050acb4 100644 +index 9b9c412da..4c50d2378 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java @@ -23,6 +23,18 @@ public class PlayerListItem extends DefinedPacket @@ -679,7 +679,7 @@ index 7dfdb58d..4050acb4 100644 + Item item = items[ 0 ] = new Item(); + item.displayName = item.username = readString( buf ); + action = !buf.readBoolean() ? Action.REMOVE_PLAYER : Action.ADD_PLAYER; -+ item.ping = buf.readShort(); ++ item.ping = (int) buf.readShort(); + return; + } + // FlameCord end - 1.7.x support @@ -706,7 +706,7 @@ index 7dfdb58d..4050acb4 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 91f71c09..57a82d29 100644 +index 91f71c095..57a82d29e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket @@ -742,7 +742,7 @@ index 91f71c09..57a82d29 100644 buf.writeBytes( data ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d5..75b371e9 100644 +index 3c7905d54..75b371e9c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket @@ -780,7 +780,7 @@ index 3c7905d5..75b371e9 100644 buf.writeByte( action ); if ( action == 0 || action == 2 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86..a812441d 100644 +index 0b27fc86b..a812441d9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java @@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket @@ -826,7 +826,7 @@ index 0b27fc86..a812441d 100644 buf.writeByte( action ); writeString( scoreName, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 80e4f85a..cab28b99 100644 +index 80e4f85af..cab28b999 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java @@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket @@ -846,7 +846,7 @@ index 80e4f85a..cab28b99 100644 { if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6a..09dc67f9 100644 +index a5555f6af..1eb458b61 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java @@ -55,12 +55,22 @@ public class Team extends DefinedPacket @@ -910,15 +910,15 @@ index a5555f6a..09dc67f9 100644 + return; + } + // FlameCord end - 1.7.x support -+ ++ writeString( name, buf ); buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d2548e07..04501b59 100644 +index 19cc33b97..9f41970ea 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -170,6 +170,14 @@ public class BungeeCord extends ProxyServer +@@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); @@ -934,7 +934,7 @@ index d2548e07..04501b59 100644 private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 1d377a65..0ea5f90b 100644 +index 1d377a655..0ea5f90b4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java @@ -183,6 +183,7 @@ public class BungeeTitle implements Title @@ -946,7 +946,7 @@ index 1d377a65..0ea5f90b 100644 sendPacket( player, reset ); sendPacket( player, times ); diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a1..6cd8ec3b 100644 +index 491cf1a16..6cd8ec3b4 100644 --- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java @@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; @@ -1000,7 +1000,7 @@ index 491cf1a1..6cd8ec3b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 8181d76b..c23c7ff9 100644 +index 8181d76bd..c23c7ff9b 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler @@ -1053,7 +1053,7 @@ index 8181d76b..c23c7ff9 100644 throw CancelSendSignal.INSTANCE; } 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 b44d13e5..2d72e26e 100644 +index b44d13e59..2d72e26ea 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer @@ -1099,7 +1099,7 @@ index b44d13e5..2d72e26e 100644 { this.compressionThreshold = compressionThreshold; 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 -index 59d204ce..a7cf0401 100644 +index 89b98b360..0ac22ad38 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; @@ -1110,7 +1110,7 @@ index 59d204ce..a7cf0401 100644 import java.util.ArrayList; import java.util.HashMap; // Waterfall import java.util.List; -@@ -185,7 +186,7 @@ public class DownstreamBridge extends PacketHandler +@@ -201,7 +202,7 @@ public class DownstreamBridge extends PacketHandler switch ( objective.getAction() ) { case 0: @@ -1119,7 +1119,7 @@ index 59d204ce..a7cf0401 100644 break; case 1: serverScoreboard.removeObjective( objective.getName() ); -@@ -195,7 +196,7 @@ public class DownstreamBridge extends PacketHandler +@@ -211,7 +212,7 @@ public class DownstreamBridge extends PacketHandler if ( oldObjective != null ) { oldObjective.setValue( objective.getValue() ); @@ -1128,7 +1128,7 @@ index 59d204ce..a7cf0401 100644 } break; default: -@@ -293,16 +294,28 @@ public class DownstreamBridge extends PacketHandler +@@ -309,16 +310,28 @@ public class DownstreamBridge extends PacketHandler if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) { @@ -1168,7 +1168,7 @@ index 59d204ce..a7cf0401 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 975b6996..77c4922d 100644 +index a19bbdd0f..de417ecae 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1208,7 +1208,7 @@ index 975b6996..77c4922d 100644 { bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd..a409d440 100644 +index 6df3f3dd9..a409d440b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; @@ -1229,25 +1229,25 @@ index 6df3f3dd..a409d440 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 6240204e..fa87750f 100644 +index d72208e75..66332af4e 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 -@@ -87,7 +87,12 @@ public class UpstreamBridge extends PacketHandler - } ); - for ( ProxiedPlayer player : con.getServer().getInfo().getPlayers() ) - { -- player.unsafe().sendPacket( packet ); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( packet ); -+ } -+ // FlameCord end - 1.7.x support +@@ -101,7 +101,12 @@ public class UpstreamBridge extends PacketHandler + player.unsafe().sendPacket( newPacket ); + } else + { +- player.unsafe().sendPacket( oldPacket ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( oldPacket ); ++ } ++ // FlameCord end - 1.7.x support + } } con.getServer().disconnect( "Quitting" ); - } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 1b639a23..b285fead 100644 +index ad951df05..68916db79 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -34,6 +34,12 @@ public abstract class EntityMap @@ -1265,7 +1265,7 @@ index 1b639a23..b285fead 100644 case ProtocolConstants.MINECRAFT_1_9: diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java new file mode 100644 -index 00000000..cdc07dc4 +index 000000000..cdc07dc45 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java @@ -0,0 +1,102 @@ @@ -1374,7 +1374,7 @@ index 00000000..cdc07dc4 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java new file mode 100644 -index 00000000..cb9174b3 +index 000000000..cb9174b35 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -0,0 +1,62 @@ @@ -1442,7 +1442,7 @@ index 00000000..cb9174b3 +// FlameCord end - 1.7.x support \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff..caed4384 100644 +index bea2bbff9..caed43849 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -8,6 +8,7 @@ import lombok.Getter; @@ -1489,7 +1489,7 @@ index bea2bbff..caed4384 100644 + // FlameCord end - 1.7.x support } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8..85bc21b9 100644 +index 5e02f8c8a..85bc21b9f 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java @@ -3,6 +3,7 @@ package net.md_5.bungee.forge; @@ -1524,17 +1524,10 @@ index 5e02f8c8..85bc21b9 100644 return WAITINGSERVERDATA; diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index daf12f74..7d053485 100644 +index f70d357a3..118c78f49 100644 --- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -@@ -4,12 +4,14 @@ import java.util.Collection; - import java.util.HashSet; - import java.util.UUID; - import net.md_5.bungee.api.connection.ProxiedPlayer; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.PlayerListItem; - - public class ServerUnique extends TabList +@@ -13,6 +13,7 @@ public class ServerUnique extends TabList { private final Collection uuids = new HashSet<>(); @@ -1542,7 +1535,7 @@ index daf12f74..7d053485 100644 public ServerUnique(ProxiedPlayer player) { -@@ -23,10 +25,26 @@ public class ServerUnique extends TabList +@@ -26,10 +27,26 @@ public class ServerUnique extends TabList { if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) { @@ -1571,55 +1564,56 @@ index daf12f74..7d053485 100644 } } player.unsafe().sendPacket( playerListItem ); -@@ -43,16 +61,46 @@ public class ServerUnique extends TabList - { - PlayerListItem packet = new PlayerListItem(); - packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); -- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; -+ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // FlameCord - 1.7.x support - int i = 0; -+ -+ // FlameCord start - 1.7.x support -+ for ( String username : usernames ) -+ { -+ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); -+ item.setUsername( username ); -+ item.setDisplayName( username ); -+ } -+ // FlameCord end - 1.7.x support -+ - for ( UUID uuid : uuids ) +@@ -79,17 +96,47 @@ public class ServerUnique extends TabList { - PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); - item.setUuid( uuid ); - } - packet.setItems( items ); -- player.unsafe().sendPacket( packet ); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( packet ); -+ } else -+ { -+ // Split up the packet -+ for ( PlayerListItem.Item item : packet.getItems() ) + PlayerListItem packet = new PlayerListItem(); + packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); +- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; ++ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // FlameCord - 1.7.x support + int i = 0; ++ ++ // FlameCord start - 1.7.x support ++ for ( String username : usernames ) + { -+ PlayerListItem p2 = new PlayerListItem(); -+ p2.setAction( packet.getAction() ); ++ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); ++ item.setUsername( username ); ++ item.setDisplayName( username ); ++ } ++ // FlameCord end - 1.7.x support + -+ p2.setItems( new PlayerListItem.Item[] -+ { -+ item -+ } ); -+ player.unsafe().sendPacket( p2 ); + for ( UUID uuid : uuids ) + { + PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); + item.setUuid( uuid ); + } + packet.setItems( items ); +- player.unsafe().sendPacket( packet ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( packet ); ++ } else ++ { ++ // Split up the packet ++ for ( PlayerListItem.Item item : packet.getItems() ) ++ { ++ PlayerListItem p2 = new PlayerListItem(); ++ p2.setAction( packet.getAction() ); ++ ++ p2.setItems( new PlayerListItem.Item[] ++ { ++ item ++ } ); ++ player.unsafe().sendPacket( p2 ); ++ } + } -+ } -+ // FlameCord end - 1.7.x support ++ // FlameCord end - 1.7.x support + } uuids.clear(); + usernames.clear(); // FlameCord - 1.7.x support } @Override -- -2.37.2.windows.2 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index eda1b0b7..8e8d9017 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,11 +1,11 @@ -From bcd1ccc0bed71e4a478d5c2a4988c6b6583df66c Mon Sep 17 00:00:00 2001 +From 2a6878cb7a8c16bb76b79012db51d81f112636c9 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9..e29b0ed3 100644 +index 2f7b38d9e..e29b0ed35 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java @@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; @@ -35,10 +35,10 @@ index 2f7b38d9..e29b0ed3 100644 /** * Connection attempting to login. 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 c6a3f1b8..b307b5ca 100644 +index de417ecae..c3543a18d 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 -@@ -361,7 +361,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -362,7 +362,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index c6a3f1b8..b307b5ca 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch index d1cd6f15..79c93927 100644 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -1,14 +1,14 @@ -From 11703076bee62715d944730066a85ed265510a55 Mon Sep 17 00:00:00 2001 +From 2edaf016d49ec4c769eebaf7383f3a7e6dccc19c Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:00:49 +0800 Subject: [PATCH] Disable update checker & Use bungee name diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 25da0a65..d4b612b3 100644 +index 463bc3d53..00243fdb9 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -45,25 +45,12 @@ public class BungeeCordLauncher +@@ -45,25 +45,10 @@ public class BungeeCordLauncher return; } @@ -23,22 +23,21 @@ index 25da0a65..d4b612b3 100644 - System.err.println( "*** Hey! This build is potentially outdated :( ***" ); - System.err.println( "*** Please check for a new build from https://papermc.io/downloads ***" ); - System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); -- System.err.println( "*** Server will start in 10 seconds ***" ); -- Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); +- //System.err.println( "*** Server will start in 10 seconds ***" ); +- //Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); - } - } -+ // FlameCord - Disable update checker - +- BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); - bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); -+ // FlameCord - Use bungee name ++ // FlameCord - Use BungeeCord name + bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); bungee.start(); if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 9c11ac57..ae4c7ac2 100644 +index 9abae0b61..e8232c0bd 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -22,6 +22,7 @@ import java.util.Locale; @@ -70,5 +69,5 @@ index 9c11ac57..ae4c7ac2 100644 int maxPlayers = get( "max_players", 1, val ); -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch index 5fb9356d..3631a4c4 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From b283b715c48392013e3f6066c6016e9876368222 Mon Sep 17 00:00:00 2001 +From b70bd30b4f028db1e399d9650cc049859d1f56bb Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 787e23f8..09a54c1c 100644 +index c3543a18d..b7be53b4c 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 @@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -58,7 +58,7 @@ index 787e23f8..09a54c1c 100644 } @Override -@@ -691,7 +711,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -692,7 +712,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -69,7 +69,7 @@ index 787e23f8..09a54c1c 100644 { ch.close(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..5c05f2b9 100644 +index 6dc5633f5..5c05f2b94 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -80,40 +80,27 @@ public class ChannelWrapper @@ -121,7 +121,7 @@ index 6dc5633f..5c05f2b9 100644 } 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 2a21243b..a95193ba 100644 +index 2a21243b9..a95193ba7 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -162,7 +162,7 @@ index 2a21243b..a95193ba 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b2b19996..b1ecb7ef 100644 +index b2b199969..b1ecb7ef5 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler @@ -175,5 +175,5 @@ index b2b19996..b1ecb7ef 100644 } -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch index d0350085..2cd30771 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From fb92fd5de29eeb570ddfb40e6ecbbd6e36ecd4ec Mon Sep 17 00:00:00 2001 +From 3ae73e4c7fbb142045ee09281fdd5c6916d91967 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 09a54c1c..0e94d411 100644 +index b7be53b4c..8715821fe 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 -@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -770,7 +770,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index 09a54c1c..0e94d411 100644 } -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch index 41f8e8b9..8e3a0d57 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From dc8d4b51d88b9f0e6086def5aa4f5c3da5e00be6 Mon Sep 17 00:00:00 2001 +From 00f2e39b27c03173abb7025317b6e2e2ec48b50e Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 0e94d411..76b10bb3 100644 +index 8715821fe..1c10b5a93 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 -@@ -558,7 +558,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -559,7 +559,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index 0e94d411..76b10bb3 100644 return; } -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch index 8bb213a9..499fcbae 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From b957e422d579add68cf389e7250903135a2ebf55 Mon Sep 17 00:00:00 2001 +From 7f109bd269421da64f19fc2f393a829b7fbe6057 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 00000000..8e69160d +index 000000000..8e69160d0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,35 @@ @@ -48,7 +48,7 @@ index 00000000..8e69160d \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java new file mode 100644 -index 00000000..cfbd55c3 +index 000000000..cfbd55c39 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -0,0 +1,38 @@ @@ -92,7 +92,7 @@ index 00000000..cfbd55c3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 00000000..c8148e90 +index 000000000..c8148e902 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,33 @@ @@ -130,7 +130,7 @@ index 00000000..c8148e90 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 4b9b80b9..aa35f870 100644 +index 4b9b80b9d..aa35f870b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -142,7 +142,7 @@ index 4b9b80b9..aa35f870 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 00000000..91d60bfb +index 000000000..91d60bfb3 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -205,7 +205,7 @@ index 00000000..91d60bfb + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 43381641..eb0f9a39 100644 +index 9f41970ea..0c04ec55d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -217,7 +217,7 @@ index 43381641..eb0f9a39 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -233,11 +235,12 @@ public class BungeeCord extends ProxyServer +@@ -242,11 +244,12 @@ public class BungeeCord extends ProxyServer // Waterfall end pluginManager = new PluginManager( this ); @@ -235,7 +235,7 @@ index 43381641..eb0f9a39 100644 if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) { -@@ -286,6 +289,15 @@ public class BungeeCord extends ProxyServer +@@ -295,6 +298,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -245,25 +245,14 @@ index 43381641..eb0f9a39 100644 + for (final ServerInfo serverInfo : getServers().values()) { + whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); + } -+ ++ + FlameCord.reload(logger, whitelistedAddresses); + if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); -@@ -574,9 +586,7 @@ public class BungeeCord extends ProxyServer - String translation = ""; - try - { -- final String string = customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ); -- -- translation = ( args.length == 0 ) ? string : MessageFormat.format( string, args ); -+ translation = MessageFormat.format( customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ), args ); - } catch ( MissingResourceException ex ) - { - } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index da688839..055a1d88 100644 +index da688839c..055a1d883 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -2,6 +2,8 @@ package net.md_5.bungee; @@ -285,7 +274,7 @@ index da688839..055a1d88 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 94702434..e48f7713 100644 +index 94702434d..e48f77131 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -319,7 +308,7 @@ index 94702434..e48f7713 100644 b.connect().addListener( listener ); } 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 74199d2e..3eec7b6b 100644 +index 1c10b5a93..164357c34 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -341,7 +330,7 @@ index 74199d2e..3eec7b6b 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index a409d440..3503c089 100644 +index a409d440b..3503c089d 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -353,7 +342,7 @@ index a409d440..3503c089 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 4820267b..694ecdb0 100644 +index 4820267b3..694ecdb01 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -366,7 +355,7 @@ index 4820267b..694ecdb0 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 a95193ba..a4c3bd71 100644 +index a95193ba7..a4c3bd710 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,8 @@ @@ -379,5 +368,5 @@ index a95193ba..a4c3bd71 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch index d2167fa9..b61a6d02 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 27bc5adef578e2afe6d9d13d9bf6c9869d5af691 Mon Sep 17 00:00:00 2001 +From 87acee89e371ebceb65cf6fa7d1557dff12b26b5 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8e69160d..ac37eaa3 100644 +index 8e69160d0..ac37eaa3e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -33,7 +33,7 @@ index 8e69160d..ac37eaa3 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 00000000..6c5bb961 +index 000000000..6c5bb9617 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,49 @@ @@ -87,7 +87,7 @@ index 00000000..6c5bb961 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 774439c5..b6ecffc3 100644 +index 0c04ec55d..d753563af 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -99,7 +99,7 @@ index 774439c5..b6ecffc3 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -88,6 +90,13 @@ import net.md_5.bungee.conf.Configuration; +@@ -90,6 +92,13 @@ import net.md_5.bungee.conf.Configuration; import net.md_5.bungee.conf.YamlConfig; import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.module.ModuleManager; @@ -113,7 +113,7 @@ index 774439c5..b6ecffc3 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -279,9 +288,10 @@ public class BungeeCord extends ProxyServer +@@ -288,9 +297,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -126,7 +126,7 @@ index 774439c5..b6ecffc3 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -314,6 +324,7 @@ public class BungeeCord extends ProxyServer +@@ -323,6 +333,7 @@ public class BungeeCord extends ProxyServer connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); } startListeners(); @@ -134,7 +134,7 @@ index 774439c5..b6ecffc3 100644 saveThread.scheduleAtFixedRate( new TimerTask() { -@@ -828,4 +839,53 @@ public class BungeeCord extends ProxyServer +@@ -854,4 +865,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -189,5 +189,5 @@ index 774439c5..b6ecffc3 100644 + } } -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch index ed50fa43..7bb64d52 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From 5307c5cb4ab7cc87761c9e2d4a7abcf27388b28e Mon Sep 17 00:00:00 2001 +From 2505fb3b13bcd83e87befef695fa5c4636149bef Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index ac37eaa3..c78ab3a7 100644 +index ac37eaa3e..c78ab3a7c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -34,7 +34,7 @@ index ac37eaa3..c78ab3a7 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 00000000..4f306660 +index 000000000..4f306660e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -0,0 +1,114 @@ @@ -154,7 +154,7 @@ index 00000000..4f306660 +} \ No newline at end of file diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index 91d60bfb..cc76325b 100644 +index 91d60bfb3..cc76325b2 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -201,26 +201,20 @@ index 91d60bfb..cc76325b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 745d8efb..e564458f 100644 +index d753563af..c30b75c4f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -594,14 +594,8 @@ public class BungeeCord extends ProxyServer +@@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { -- String translation = ""; -- try -- { -- translation = MessageFormat.format( customBundle != null && customBundle.containsKey( name ) ? customBundle.getString( name ) : baseBundle.getString( name ), args ); -- } catch ( MissingResourceException ex ) -- { -- } -- return translation; +- Format format = messageFormats.get( name ); +- return ( format != null ) ? format.format( args ) : ""; + // FlameCord - Use own translation system + return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); } @Override -- -2.36.1.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch index d07a90fb..78f39553 100644 --- a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 67ca84034f74938b704e81cd9dbe4fa15ef10f49 Mon Sep 17 00:00:00 2001 +From 8f77c4e0ca063a83214f236a87d727716197692c Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index b285fead..d4b57e5a 100644 +index 68916db79..688ff72d2 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -154,11 +154,15 @@ public abstract class EntityMap +@@ -155,11 +155,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -30,7 +30,7 @@ index b285fead..d4b57e5a 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206..8d4439ab 100644 +index cefa0206e..8d4439ab8 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -38,16 +38,22 @@ public class ForgeUtils @@ -64,5 +64,5 @@ index cefa0206..8d4439ab 100644 } -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch index 66acf8ac..68b7fde5 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 9e92ced872601751df9e5e978065eda834d777be Mon Sep 17 00:00:00 2001 +From 234c19a225886b0a27283fde38097e074537ba8f Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c8148e90..aac41c8b 100644 +index c8148e902..aac41c8b2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,17 @@ import net.md_5.bungee.config.Configuration; @@ -40,7 +40,7 @@ index c8148e90..aac41c8b 100644 } catch (final IOException e) { e.printStackTrace(); 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 e48f7713..90922797 100644 +index e48f77131..909227970 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -64,10 +64,10 @@ index e48f7713..90922797 100644 } 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 5d8aad84..198086e0 100644 +index 164357c34..8fb36e37d 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 -@@ -393,7 +393,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -394,7 +394,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -77,7 +77,7 @@ index 5d8aad84..198086e0 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -402,7 +403,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -403,7 +404,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -88,7 +88,7 @@ index 5d8aad84..198086e0 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 694ecdb0..14e3004f 100644 +index 694ecdb01..14e3004fc 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter diff --git a/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch index 78787cd3..c9240b6a 100644 --- a/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From a78ba453d6621c5287b5a3efcff0dbe012671c22 Mon Sep 17 00:00:00 2001 +From 1e5fa27a03247139aee723add5280ba00dfc901d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 d99cb5d0..7035729b 100644 +index b340c7a55..c00ab4b6a 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -46,8 +46,8 @@ index d99cb5d0..7035729b 100644 + thisState = State.PROCESSING; this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); - -@@ -478,6 +481,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); +@@ -479,6 +482,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index d99cb5d0..7035729b 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -814,14 +818,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -815,14 +819,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 8335687f..e554a73b 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,11 +1,11 @@ -From b14935a7b331d68ef0a882c0c193e03ff04a9ec5 Mon Sep 17 00:00:00 2001 +From b4ba3f3f68b4bfd4e8af4249fa30cc59ccfdde83 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd900..5978bec6 100644 +index 20edd9001..5978bec60 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,11 @@ @@ -22,7 +22,7 @@ index 20edd900..5978bec6 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java new file mode 100644 -index 00000000..da52c892 +index 000000000..da52c8924 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ @@ -64,7 +64,7 @@ index 00000000..da52c892 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java new file mode 100644 -index 00000000..b37f114a +index 000000000..b37f114a0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java @@ -0,0 +1,154 @@ @@ -224,7 +224,7 @@ index 00000000..b37f114a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java new file mode 100644 -index 00000000..6c7b300c +index 000000000..6c7b300c2 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java @@ -0,0 +1,31 @@ @@ -261,7 +261,7 @@ index 00000000..6c7b300c +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java new file mode 100644 -index 00000000..0676f897 +index 000000000..0676f897f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java @@ -0,0 +1,37 @@ @@ -304,7 +304,7 @@ index 00000000..0676f897 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java new file mode 100644 -index 00000000..e2410468 +index 000000000..e2410468d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -450,7 +450,7 @@ index 00000000..e2410468 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java new file mode 100644 -index 00000000..19763693 +index 000000000..197636935 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -488,7 +488,7 @@ index 00000000..19763693 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java new file mode 100644 -index 00000000..222aba31 +index 000000000..222aba31f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java @@ -0,0 +1,45 @@ @@ -539,7 +539,7 @@ index 00000000..222aba31 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java new file mode 100644 -index 00000000..bdc024f5 +index 000000000..bdc024f58 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -607,7 +607,7 @@ index 00000000..bdc024f5 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..b55b4bb1 +index 000000000..b55b4bb17 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -646,7 +646,7 @@ index 00000000..b55b4bb1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..efd8d2ca +index 000000000..efd8d2cac --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java @@ -0,0 +1,46 @@ @@ -697,7 +697,7 @@ index 00000000..efd8d2ca + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7..8591a791 100644 +index c78ab3a7c..8591a7918 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; @@ -748,7 +748,7 @@ index c78ab3a7..8591a791 100644 } \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 5d92c20c..e1c18ea6 100644 +index a1d23f74d..76c35626d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,120 @@ import net.md_5.bungee.config.Configuration; @@ -882,7 +882,7 @@ index 5d92c20c..e1c18ea6 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 4f306660..5faab616 100644 +index 4f306660e..5faab6166 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -82,12 +82,26 @@ public class MessagesConfiguration extends FlameConfig { @@ -914,7 +914,7 @@ index 4f306660..5faab616 100644 configurationProvider.save(configuration, configurationFile); diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b..ae5d4c73 100644 +index cc76325b2..ae5d4c73f 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -3,6 +3,7 @@ package dev._2lstudios.flamecord.commands; @@ -974,7 +974,7 @@ index cc76325b..ae5d4c73 100644 } } 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 7035729b..7c2128dc 100644 +index c00ab4b6a..089cac669 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -986,7 +986,7 @@ index 7035729b..7c2128dc 100644 import dev._2lstudios.flamecord.FlameCord; import dev._2lstudios.flamecord.configuration.FlameConfig; -@@ -438,6 +440,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -439,6 +441,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -998,7 +998,7 @@ index 7035729b..7c2128dc 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -449,6 +456,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -450,6 +457,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1021,7 +1021,7 @@ index 7035729b..7c2128dc 100644 break; case 2: // Login -@@ -460,6 +483,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +484,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1043,7 +1043,7 @@ index 7035729b..7c2128dc 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -524,6 +562,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -525,6 +563,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1103,10 +1103,10 @@ index 7035729b..7c2128dc 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 fa87750f..67263bca 100644 +index 66332af4e..7b852ff69 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,10 +4,15 @@ import com.google.common.base.Preconditions; +@@ -4,11 +4,16 @@ import com.google.common.base.Preconditions; import com.mojang.brigadier.context.StringRange; import com.mojang.brigadier.suggestion.Suggestion; import com.mojang.brigadier.suggestion.Suggestions; @@ -1117,12 +1117,13 @@ index fa87750f..67263bca 100644 import java.util.ArrayList; import java.util.LinkedList; import java.util.List; + import java.util.UUID; +import java.util.logging.Level; + import net.md_5.bungee.BungeeCord; import net.md_5.bungee.ServerConnection.KeepAliveData; import net.md_5.bungee.UserConnection; -@@ -192,6 +197,32 @@ public class UpstreamBridge extends PacketHandler +@@ -207,6 +212,32 @@ public class UpstreamBridge extends PacketHandler } Preconditions.checkArgument(!empty, "Chat message is empty"); @@ -1156,7 +1157,7 @@ index fa87750f..67263bca 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e..1e3608fa 100644 +index e2911d5e4..1e3608fa4 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; @@ -1188,7 +1189,7 @@ index e2911d5e..1e3608fa 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004f..abca28bd 100644 +index 14e3004fc..abca28bd7 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1217,7 +1218,7 @@ index 14e3004f..abca28bd 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea1599..4bb8eb46 100644 +index ffea15992..4bb8eb460 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 @@ -59,6 +59,20 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 1efe80fc..3ef65929 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 84039249930540d4f36a0ae443d80b4734d64e9e Mon Sep 17 00:00:00 2001 +From 9221f376964681108d3a1f6a899313fc860c01d9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index e1c18ea6..58de7da1 100644 +index 76c35626d..1c27409d3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -29,10 +29,10 @@ index e1c18ea6..58de7da1 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 7c2128dc..90de2d28 100644 +index 089cac669..91648b499 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 -@@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -522,7 +522,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch index 279fee4f..a3cdcd4c 100644 --- a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch @@ -1,11 +1,11 @@ -From 04c710954eb496691660636d0dcde1382a4dd45d Mon Sep 17 00:00:00 2001 +From f8422f8eaf4f3c88d6beb5752f18cc2544e2d1df Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index 469fe0e1..97bd384b 100644 +index 469fe0e12..97bd384b2 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java @@ -251,11 +251,6 @@ public interface ProxyConfig @@ -21,7 +21,7 @@ index 469fe0e1..97bd384b 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index 1defe650..608769eb 100644 +index 0c334afcf..88865b851 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -33,7 +33,7 @@ index 1defe650..608769eb 100644 import net.md_5.bungee.protocol.packet.EntityStatus; import net.md_5.bungee.protocol.packet.GameState; import net.md_5.bungee.protocol.packet.Handshake; -@@ -215,14 +213,4 @@ public abstract class AbstractPacketHandler +@@ -225,14 +223,4 @@ public abstract class AbstractPacketHandler public void handle(ServerData serverData) throws Exception { } @@ -49,7 +49,7 @@ index 1defe650..608769eb 100644 - // Waterfall end } 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 -index d94c2cdf..e10074f2 100644 +index c9e45b915..36d507847 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -61,7 +61,7 @@ index d94c2cdf..e10074f2 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -135,20 +133,6 @@ public enum Protocol +@@ -140,20 +138,6 @@ public enum Protocol map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) ); @@ -84,7 +84,7 @@ index d94c2cdf..e10074f2 100644 PlayerListItem::new, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java deleted file mode 100644 -index 0ed78a8c..00000000 +index 0ed78a8c4..000000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ /dev/null @@ -1,67 +0,0 @@ @@ -157,7 +157,7 @@ index 0ed78a8c..00000000 -} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java deleted file mode 100644 -index 435b8578..00000000 +index 435b85789..000000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ /dev/null @@ -1,45 +0,0 @@ @@ -207,7 +207,7 @@ index 435b8578..00000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 966d2442..be337a68 100644 +index 966d2442b..be337a680 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { @@ -239,7 +239,7 @@ index 966d2442..be337a68 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 055a1d88..a63e67f1 100644 +index 055a1d883..a63e67f15 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -243,11 +243,6 @@ public class ServerConnector extends PacketHandler @@ -324,7 +324,7 @@ index 055a1d88..a63e67f1 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 7c0c2fff..d37f419a 100644 +index 909227970..f3d60253f 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -365,7 +365,7 @@ index 7c0c2fff..d37f419a 100644 - // Waterfall end } 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 -index a7cf0401..d662c976 100644 +index 0ac22ad38..6e425764b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -385,7 +385,7 @@ index a7cf0401..d662c976 100644 import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; import net.md_5.bungee.protocol.packet.PlayerListItem; -@@ -148,11 +145,6 @@ public class DownstreamBridge extends PacketHandler +@@ -150,11 +147,6 @@ public class DownstreamBridge extends PacketHandler @Override public void handle(PacketWrapper packet) throws Exception { @@ -397,7 +397,7 @@ index a7cf0401..d662c976 100644 con.sendPacket( packet ); } -@@ -689,34 +681,6 @@ public class DownstreamBridge extends PacketHandler +@@ -705,34 +697,6 @@ public class DownstreamBridge extends PacketHandler } } @@ -433,10 +433,10 @@ index a7cf0401..d662c976 100644 public void handle(Respawn respawn) { 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 67263bca..bd6fe2d5 100644 +index 7b852ff69..aef8b9a8d 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 -@@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; +@@ -25,7 +25,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.SettingsChangedEvent; import net.md_5.bungee.api.event.TabCompleteEvent; @@ -444,7 +444,7 @@ index 67263bca..bd6fe2d5 100644 import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.netty.ChannelWrapper; import net.md_5.bungee.netty.PacketHandler; -@@ -130,11 +129,6 @@ public class UpstreamBridge extends PacketHandler +@@ -145,11 +144,6 @@ public class UpstreamBridge extends PacketHandler { if ( con.getServer() != null ) { @@ -458,10 +458,10 @@ index 67263bca..bd6fe2d5 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index d4b57e5a..00000000 +index 688ff72d2..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null -@@ -1,371 +0,0 @@ +@@ -1,372 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -552,6 +552,7 @@ index d4b57e5a..00000000 - case ProtocolConstants.MINECRAFT_1_19: - return EntityMap_1_16_2.INSTANCE_1_19; - case ProtocolConstants.MINECRAFT_1_19_1: +- case ProtocolConstants.MINECRAFT_1_19_3: - return EntityMap_1_16_2.INSTANCE_1_19_1; - } - throw new RuntimeException( "Version " + version + " has no entity map" ); @@ -835,7 +836,7 @@ index d4b57e5a..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java deleted file mode 100644 -index 6db530c3..00000000 +index 6db530c3a..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -1023,7 +1024,7 @@ index 6db530c3..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java deleted file mode 100644 -index 36822127..00000000 +index 368221275..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1212,7 +1213,7 @@ index 36822127..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java deleted file mode 100644 -index 38e12ce4..00000000 +index 38e12ce40..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1401,7 +1402,7 @@ index 38e12ce4..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java deleted file mode 100644 -index 5f296839..00000000 +index 5f2968394..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1590,7 +1591,7 @@ index 5f296839..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java deleted file mode 100644 -index f3372f08..00000000 +index f3372f088..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1779,7 +1780,7 @@ index f3372f08..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java deleted file mode 100644 -index 8210b0a7..00000000 +index 8210b0a7e..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -1972,7 +1973,7 @@ index 8210b0a7..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java deleted file mode 100644 -index c2cf810f..00000000 +index c2cf810f3..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2165,7 +2166,7 @@ index c2cf810f..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java deleted file mode 100644 -index c8b06707..00000000 +index c8b067071..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2358,7 +2359,7 @@ index c8b06707..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index 7241dc56..00000000 +index 7241dc56b..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null @@ -1,76 +0,0 @@ @@ -2440,7 +2441,7 @@ index 7241dc56..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java deleted file mode 100644 -index cdc07dc4..00000000 +index cdc07dc45..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +++ /dev/null @@ -1,102 +0,0 @@ @@ -2549,7 +2550,7 @@ index cdc07dc4..00000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java deleted file mode 100644 -index cb9174b3..00000000 +index cb9174b35..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ /dev/null @@ -1,62 +0,0 @@ @@ -2618,7 +2619,7 @@ index cb9174b3..00000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java deleted file mode 100644 -index 8e2dbe69..00000000 +index 8e2dbe699..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +++ /dev/null @@ -1,176 +0,0 @@ @@ -2800,7 +2801,7 @@ index 8e2dbe69..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java deleted file mode 100644 -index d61dc0cb..00000000 +index d61dc0cba..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -2988,7 +2989,7 @@ index d61dc0cb..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java deleted file mode 100644 -index bfbc8432..00000000 +index bfbc84327..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -3176,7 +3177,7 @@ index bfbc8432..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java deleted file mode 100644 -index cb81d1dd..00000000 +index cb81d1dd8..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +++ /dev/null @@ -1,30 +0,0 @@ @@ -3212,7 +3213,7 @@ index cb81d1dd..00000000 -// Waterfall end \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index caed4384..af428090 100644 +index caed43849..af4280904 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -11,7 +11,6 @@ import lombok.Setter; diff --git a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch index 492bba23..e605d493 100644 --- a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch +++ b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch @@ -1,11 +1,11 @@ -From fcbd2374afc15c2fe67dd158b6fd2ae68487ed6a Mon Sep 17 00:00:00 2001 +From 07f1032863acec085e88e6411ba2d4e1906f959e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:00:58 +0100 Subject: [PATCH] Safe bytebuf release diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 9a7bf9b5..b43ebc8d 100644 +index 9a7bf9b59..b43ebc8d6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -31,33 +31,34 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -67,7 +67,7 @@ index 9a7bf9b5..b43ebc8d 100644 if (in.readableBytes() == 0 && !server) { return; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a63e67f1..4293e2b4 100644 +index a63e67f15..4293e2b49 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -286,10 +286,15 @@ public class ServerConnector extends PacketHandler @@ -91,10 +91,10 @@ index a63e67f1..4293e2b4 100644 // FlameCord end - 1.7.x support } 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 -index d662c976..fbbaa1b2 100644 +index 6e425764b..e7fe0d02b 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -291,13 +291,24 @@ public class DownstreamBridge extends PacketHandler +@@ -307,13 +307,24 @@ public class DownstreamBridge extends PacketHandler { try { @@ -127,7 +127,7 @@ index d662c976..fbbaa1b2 100644 { return; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index abca28bd..2fd37c2d 100644 +index abca28bd7..2fd37c2dd 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -84,46 +84,44 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter From 83c1930d6c910bd0d8d1a9c30a0de9ec1ab6bf1d Mon Sep 17 00:00:00 2001 From: Achsion Date: Tue, 13 Dec 2022 00:02:43 +0100 Subject: [PATCH 338/499] only output detailed output if is enabled in config --- ...tion-fail-reason-when-defailed-logge.patch} | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename Waterfall-Proxy-Patches/{0036-Only-show-detailed-connect-exception-to-admins.patch => 0036-Only-show-connection-fail-reason-when-defailed-logge.patch} (56%) diff --git a/Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch similarity index 56% rename from Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch rename to Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch index a4e2fcb0..623f7670 100644 --- a/Waterfall-Proxy-Patches/0036-Only-show-detailed-connect-exception-to-admins.patch +++ b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch @@ -1,23 +1,23 @@ -From efa69c69e7b81b75ea1a602f07b3410cacbcc89c Mon Sep 17 00:00:00 2001 +From fffeb2e2ea577250949626c62d364261badf5560 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 -Subject: [PATCH] Only show detailed connect exception to admins +Subject: [PATCH] Only show connection fail reason when defailed logger is + enabled 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 f3d60253..713d9037 100644 +index f3d60253..c03a62ac 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -406,7 +406,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -405,6 +405,8 @@ public final class UserConnection implements ProxiedPlayer + // FlameCord - Allow for toggle the logging of connection failures if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ // FlameCord - Show connection fail reason ++ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); } -- return ""; // Waterfall -+ // FlameCord - Show connection fail reason -+ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); + return ""; // Waterfall } - - @Override -- 2.29.2.windows.2 From 6331755a35a2f8436e86b83d05f934c9d7d9002a Mon Sep 17 00:00:00 2001 From: Achsion Date: Tue, 13 Dec 2022 18:45:03 +0100 Subject: [PATCH 339/499] fixed typo --- ...Only-show-connection-fail-reason-when-detailed-logge.patch} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename Waterfall-Proxy-Patches/{0036-Only-show-connection-fail-reason-when-defailed-logge.patch => 0036-Only-show-connection-fail-reason-when-detailed-logge.patch} (94%) diff --git a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch similarity index 94% rename from Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch rename to Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch index 623f7670..801a643b 100644 --- a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-defailed-logge.patch +++ b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -1,7 +1,7 @@ From fffeb2e2ea577250949626c62d364261badf5560 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 -Subject: [PATCH] Only show connection fail reason when defailed logger is +Subject: [PATCH] Only show connection fail reason when detailed logger is enabled @@ -20,4 +20,3 @@ index f3d60253..c03a62ac 100644 } -- 2.29.2.windows.2 - From 4a331a9e2b5ee511e3e9186b57fa83db77bddefa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:42:42 +0100 Subject: [PATCH 340/499] 1.2.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 104c3977..9df5cd4a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 055097d6787c64aa3495fee07ab3cc4fdc6a3c56 Mon Sep 17 00:00:00 2001 +From c2c105d218f1681affcee2b27eaedd88143b3d2e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..19cc33b97 100644 +index 8617cdc7a..ca1dad0e5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..19cc33b97 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.1.9"; ++ return "1.2.0"; } public final void reloadMessages() From 4ebf0a7e22ed814ecee585861043a09c9b8c2227 Mon Sep 17 00:00:00 2001 From: Achsion Date: Tue, 13 Dec 2022 22:11:05 +0100 Subject: [PATCH 341/499] display cause class name as default connection fail message --- ...-connection-fail-reason-when-detailed-logge.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch index 801a643b..423a3b0e 100644 --- a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch +++ b/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -1,4 +1,4 @@ -From fffeb2e2ea577250949626c62d364261badf5560 Mon Sep 17 00:00:00 2001 +From 48878ec51074a1a90d1c4aa761a40fbec74bd8ac Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 Subject: [PATCH] Only show connection fail reason when detailed logger is @@ -6,17 +6,21 @@ Subject: [PATCH] Only show connection fail reason when detailed logger is 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 f3d60253..c03a62ac 100644 +index f3d60253..021fe839 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -405,6 +405,8 @@ public final class UserConnection implements ProxiedPlayer +@@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer // FlameCord - Allow for toggle the logging of connection failures if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall + // FlameCord - Show connection fail reason + return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); } - return ""; // Waterfall +- return ""; // Waterfall ++ return cause.getClass().getName(); // FlameCord } + + @Override -- 2.29.2.windows.2 + From 937faefdc13829cd404d051fea4483cf99d819b0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 21 Dec 2022 21:56:04 -0300 Subject: [PATCH 342/499] Antibot Packets Check --- ...-Use-duplicate-for-MinecraftDecoder.patch} | 17 +- ...ctions-Don-t-flush-if-not-necessary.patch} | 2 +- ...-Checks.patch => 0011-Packet-Checks.patch} | 12 +- ...atch => 0012-Change-default-timeout.patch} | 6 +- ...013-Don-t-allow-name-containing-dot.patch} | 6 +- ...4-Use-pipeline-to-reduce-redundancy.patch} | 6 +- ...om-uuids-even-if-onlineMode-is-true.patch} | 2 +- ...teException-to-QuietException-and-e.patch} | 6 +- ...Don-t-declare-uuid-unless-it-s-null.patch} | 2 +- ...tch => 0018-FlameCord-General-Patch.patch} | 14 +- ...tch => 0019-FlameCord-module-system.patch} | 4 +- ...020-FlameCord-message-configuration.patch} | 4 +- ...ch => 0021-Fix-ByteBuf-memory-leaks.patch} | 2 +- ...> 0022-Check-if-packetID-is-invalid.patch} | 6 +- ...ch => 0023-FlameCord-logger-options.patch} | 2 +- ...ded-an-api-method-to-unload-Plugins.patch} | 4 +- ...s.patch => 0025-Apply-packet-limits.patch} | 8 +- ...em.patch => 0026-Custom-motd-system.patch} | 10 +- ...st-Open.patch => 0027-TCP-Fast-Open.patch} | 6 +- ...028-InitialHandler-Processing-State.patch} | 2 +- ...System.patch => 0029-Antibot-System.patch} | 593 ++++++++++++++---- ...s.patch => 0030-Allow-Invalid-Names.patch} | 10 +- ...ion-fail-reason-when-detailed-logge.patch} | 6 +- .../0035-Safe-bytebuf-release.patch | 224 ------- 24 files changed, 549 insertions(+), 405 deletions(-) rename Waterfall-Proxy-Patches/{0030-Duplicate-buf-instead-of-Copy.patch => 0009-Use-duplicate-for-MinecraftDecoder.patch} (66%) rename Waterfall-Proxy-Patches/{0009-Close-connections-Don-t-flush-if-not-necessary.patch => 0010-Close-connections-Don-t-flush-if-not-necessary.patch} (99%) rename Waterfall-Proxy-Patches/{0010-Packet-Checks.patch => 0011-Packet-Checks.patch} (89%) rename Waterfall-Proxy-Patches/{0011-Change-default-timeout.patch => 0012-Change-default-timeout.patch} (86%) rename Waterfall-Proxy-Patches/{0012-Don-t-allow-name-containing-dot.patch => 0013-Don-t-allow-name-containing-dot.patch} (87%) rename Waterfall-Proxy-Patches/{0013-Use-pipeline-to-reduce-redundancy.patch => 0014-Use-pipeline-to-reduce-redundancy.patch} (96%) rename Waterfall-Proxy-Patches/{0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch => 0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch} (93%) rename Waterfall-Proxy-Patches/{0015-Change-IllegalStateException-to-QuietException-and-e.patch => 0016-Change-IllegalStateException-to-QuietException-and-e.patch} (89%) rename Waterfall-Proxy-Patches/{0016-Don-t-declare-uuid-unless-it-s-null.patch => 0017-Don-t-declare-uuid-unless-it-s-null.patch} (94%) rename Waterfall-Proxy-Patches/{0017-FlameCord-General-Patch.patch => 0018-FlameCord-General-Patch.patch} (97%) rename Waterfall-Proxy-Patches/{0018-FlameCord-module-system.patch => 0019-FlameCord-module-system.patch} (98%) rename Waterfall-Proxy-Patches/{0019-FlameCord-message-configuration.patch => 0020-FlameCord-message-configuration.patch} (99%) rename Waterfall-Proxy-Patches/{0020-Fix-ByteBuf-memory-leaks.patch => 0021-Fix-ByteBuf-memory-leaks.patch} (97%) rename Waterfall-Proxy-Patches/{0021-Check-if-packetID-is-invalid.patch => 0022-Check-if-packetID-is-invalid.patch} (91%) rename Waterfall-Proxy-Patches/{0022-FlameCord-logger-options.patch => 0023-FlameCord-logger-options.patch} (99%) rename Waterfall-Proxy-Patches/{0023-Added-an-api-method-to-unload-Plugins.patch => 0024-Added-an-api-method-to-unload-Plugins.patch} (97%) rename Waterfall-Proxy-Patches/{0024-Apply-packet-limits.patch => 0025-Apply-packet-limits.patch} (94%) rename Waterfall-Proxy-Patches/{0025-Custom-motd-system.patch => 0026-Custom-motd-system.patch} (97%) rename Waterfall-Proxy-Patches/{0026-TCP-Fast-Open.patch => 0027-TCP-Fast-Open.patch} (95%) rename Waterfall-Proxy-Patches/{0027-InitialHandler-Processing-State.patch => 0028-InitialHandler-Processing-State.patch} (98%) rename Waterfall-Proxy-Patches/{0028-Antibot-System.patch => 0029-Antibot-System.patch} (73%) rename Waterfall-Proxy-Patches/{0029-Allow-Invalid-Names.patch => 0030-Allow-Invalid-Names.patch} (90%) rename Waterfall-Proxy-Patches/{0036-Only-show-connection-fail-reason-when-detailed-logge.patch => 0035-Only-show-connection-fail-reason-when-detailed-logge.patch} (90%) delete mode 100644 Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch diff --git a/Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch b/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch similarity index 66% rename from Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch rename to Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch index b16b3041..251aaab9 100644 --- a/Waterfall-Proxy-Patches/0030-Duplicate-buf-instead-of-Copy.patch +++ b/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch @@ -1,24 +1,23 @@ -From 8c2a775eba07694db8fb29e65ddd210638ad5335 Mon Sep 17 00:00:00 2001 +From 510085f25ef21678828f5b3026662f51a94c1137 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 9 Mar 2022 14:36:43 -0300 -Subject: [PATCH] Duplicate buf instead of Copy +Date: Wed, 21 Dec 2022 21:43:05 -0300 +Subject: [PATCH] Use duplicate() for MinecraftDecoder diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 3992f521..074d2437 100644 +index ac83e3253..c31ec1ce7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -52,7 +52,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } +@@ -38,7 +38,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder } + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( -+ // FlameCord - Duplicate buf instead of Copy -+ ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( ++ ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy Object packetTypeInfo = null; try -@@ -92,7 +93,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -73,7 +73,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder in.skipBytes( in.readableBytes() ); } diff --git a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch similarity index 99% rename from Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch rename to Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 3631a4c4..7354da4f 100644 --- a/Waterfall-Proxy-Patches/0009-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From b70bd30b4f028db1e399d9650cc049859d1f56bb Mon Sep 17 00:00:00 2001 +From f3902b5c785041c3c029ed0d12d7eece40eca40b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary diff --git a/Waterfall-Proxy-Patches/0010-Packet-Checks.patch b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch similarity index 89% rename from Waterfall-Proxy-Patches/0010-Packet-Checks.patch rename to Waterfall-Proxy-Patches/0011-Packet-Checks.patch index 393cb666..af75e874 100644 --- a/Waterfall-Proxy-Patches/0010-Packet-Checks.patch +++ b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch @@ -1,18 +1,18 @@ -From 772e70bce0c9626cb3c724b7c30c4802f7311e63 Mon Sep 17 00:00:00 2001 +From cf87130274644325adbf7fabb7b95d95e976ee57 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:10:30 +0800 Subject: [PATCH] Packet Checks diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ac83e325..4b9b80b9 100644 +index c31ec1ce7..640f0ea26 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder } Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ ++ + // FlameCord - Check size before decoding + if (prot == protocol.TO_SERVER) { + final int readableBytes = in.readableBytes(); @@ -25,11 +25,11 @@ index ac83e325..4b9b80b9 100644 + } + } + - ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( + ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy Object packetTypeInfo = null; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index f8d6becd..33605007 100644 +index 29cf4b4fc..4820267b3 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -78,6 +78,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -49,5 +49,5 @@ index f8d6becd..33605007 100644 { HAProxyMessage proxy = (HAProxyMessage) msg; -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0011-Change-default-timeout.patch b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch similarity index 86% rename from Waterfall-Proxy-Patches/0011-Change-default-timeout.patch rename to Waterfall-Proxy-Patches/0012-Change-default-timeout.patch index 8ec0a616..9be72fe2 100644 --- a/Waterfall-Proxy-Patches/0011-Change-default-timeout.patch +++ b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch @@ -1,11 +1,11 @@ -From 36e054d017b32104a878faed79fb18b5d8b5c9df Mon Sep 17 00:00:00 2001 +From f790d57423c57a21d642db20b6de9d3515fd3e93 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:02 +0800 Subject: [PATCH] Change default timeout diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 85d2197a..3b5ce41e 100644 +index 8911bee85..b67195ec8 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig @@ -19,5 +19,5 @@ index 85d2197a..3b5ce41e 100644 * UUID used for metrics. */ -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch similarity index 87% rename from Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch rename to Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch index 617a5037..e6063a4c 100644 --- a/Waterfall-Proxy-Patches/0012-Don-t-allow-name-containing-dot.patch +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -1,11 +1,11 @@ -From 1110d8e2d16633d02c7839b38f800ee5cedc0a84 Mon Sep 17 00:00:00 2001 +From cbec17576f5c5472cf0037f9962ca5c806133200 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:25:51 +0800 Subject: [PATCH] Don't allow name containing dot diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -index d1cd1090..44cb1ce6 100644 +index 1a4242a2e..d947fad7d 100644 --- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java @@ -21,7 +21,8 @@ public final class AllowedCharacters @@ -19,5 +19,5 @@ index d1cd1090..44cb1ce6 100644 } -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch similarity index 96% rename from Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch rename to Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch index f4ee95a3..2a4b8ca8 100644 --- a/Waterfall-Proxy-Patches/0013-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From 290e7f633bb2ecffad78a8a2518ea9efdf890767 Mon Sep 17 00:00:00 2001 +From 64097a804bbce407306eca64329053a0105a7c8f Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 5c05f2b9..606866a5 100644 +index 5c05f2b94..606866a52 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -74,5 +74,5 @@ index 5c05f2b9..606866a5 100644 } } -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch similarity index 93% rename from Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch rename to Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 2cd30771..2b597787 100644 --- a/Waterfall-Proxy-Patches/0014-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,4 +1,4 @@ -From 3ae73e4c7fbb142045ee09281fdd5c6916d91967 Mon Sep 17 00:00:00 2001 +From 407344a066199a42e7fa17a2d1b3fc4be2d095bf Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true diff --git a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch similarity index 89% rename from Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch rename to Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch index 18be2827..6d5cf4c5 100644 --- a/Waterfall-Proxy-Patches/0015-Change-IllegalStateException-to-QuietException-and-e.patch +++ b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch @@ -1,4 +1,4 @@ -From 6545a44d71d2e9d6f08bf4f93306c12c34673b7a Mon Sep 17 00:00:00 2001 +From 0f07c38f3d16849626c28ae710616788f30b00fc Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:40:55 +0800 Subject: [PATCH] Change IllegalStateException to QuietException and explain @@ -6,7 +6,7 @@ Subject: [PATCH] Change IllegalStateException to QuietException and explain 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 f4f67b35..5293552d 100644 +index 2d72e26ea..94702434d 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -313,7 +313,8 @@ public final class UserConnection implements ProxiedPlayer @@ -20,5 +20,5 @@ index f4f67b35..5293552d 100644 return; } -- -2.34.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch similarity index 94% rename from Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch rename to Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch index 8e3a0d57..9bc71fef 100644 --- a/Waterfall-Proxy-Patches/0016-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,4 +1,4 @@ -From 00f2e39b27c03173abb7025317b6e2e2ec48b50e Mon Sep 17 00:00:00 2001 +From ac09d06618510ed85aadc83a5a6bb812bf109218 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null diff --git a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch similarity index 97% rename from Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch rename to Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 499fcbae..92d645b4 100644 --- a/Waterfall-Proxy-Patches/0017-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 7f109bd269421da64f19fc2f393a829b7fbe6057 Mon Sep 17 00:00:00 2001 +From 20e7630ff3f3f16d5f1b45c4fbe81037795088d8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -48,10 +48,10 @@ index 000000000..8e69160d0 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java new file mode 100644 -index 000000000..cfbd55c39 +index 000000000..5589ce1b7 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -0,0 +1,38 @@ +@@ -0,0 +1,42 @@ +package dev._2lstudios.flamecord.configuration; + +import java.util.ArrayList; @@ -61,6 +61,10 @@ index 000000000..cfbd55c39 +import net.md_5.bungee.config.Configuration; + +public class FlameConfig { ++ double setIfUnexistant(final String arg1, final double arg2, final Configuration configuration) { ++ return (double) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ + int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { + return (int) setIfUnexistant(arg1, (Object) arg2, configuration); + } @@ -130,7 +134,7 @@ index 000000000..c8148e902 + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 4b9b80b9d..aa35f870b 100644 +index 640f0ea26..70a1192e7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -205,7 +209,7 @@ index 000000000..91d60bfb3 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 9f41970ea..0c04ec55d 100644 +index e11e30402..8861da39d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch similarity index 98% rename from Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch rename to Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index b61a6d02..a9c2cd35 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 87acee89e371ebceb65cf6fa7d1557dff12b26b5 Mon Sep 17 00:00:00 2001 +From 598c8a3786b32bb1128ac3ab1ae1bfea6909f2cb Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -87,7 +87,7 @@ index 000000000..6c5bb9617 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0c04ec55d..d753563af 100644 +index 8861da39d..88ac66bab 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch similarity index 99% rename from Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch rename to Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 7bb64d52..8487860b 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 2505fb3b13bcd83e87befef695fa5c4636149bef Mon Sep 17 00:00:00 2001 +From dae4aa8593ae097fcc2961539dd2fc7787e8d63e Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -201,7 +201,7 @@ index 91d60bfb3..cc76325b2 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d753563af..c30b75c4f 100644 +index 88ac66bab..501aacfa0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch similarity index 97% rename from Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch rename to Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch index 78f39553..b77c30d6 100644 --- a/Waterfall-Proxy-Patches/0020-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -1,4 +1,4 @@ -From 8f77c4e0ca063a83214f236a87d727716197692c Mon Sep 17 00:00:00 2001 +From 4121bc5ef2215f0621d449c5cf2073c47ed93947 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch similarity index 91% rename from Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch rename to Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch index e836a7c4..07bc7ec1 100644 --- a/Waterfall-Proxy-Patches/0021-Check-if-packetID-is-invalid.patch +++ b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch @@ -1,11 +1,11 @@ -From c727441bc5d674eface4fa65b416aceca4477406 Mon Sep 17 00:00:00 2001 +From 7e20c899237e194fbda629aa6be4444fbe293b7d Mon Sep 17 00:00:00 2001 From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> Date: Thu, 15 Apr 2021 08:34:57 -0300 Subject: [PATCH] Check if packetID is invalid. diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index aa35f870..3992f521 100644 +index 70a1192e7..6316143f7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -23,5 +23,5 @@ index aa35f870..3992f521 100644 if ( packet != null ) { -- -2.32.0 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch similarity index 99% rename from Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch rename to Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch index 68b7fde5..859e00f7 100644 --- a/Waterfall-Proxy-Patches/0022-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -1,4 +1,4 @@ -From 234c19a225886b0a27283fde38097e074537ba8f Mon Sep 17 00:00:00 2001 +From 8edec45c116023de25620c7697ce1f887ea267ce Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch similarity index 97% rename from Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch rename to Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch index e1df098f..94640188 100644 --- a/Waterfall-Proxy-Patches/0023-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From c3d43897657dc6636189621bd60f9cb86b6ac2d0 Mon Sep 17 00:00:00 2001 +From 664f35c5a6155c5e41aa10d1cd15cf590cc011a0 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -6,7 +6,7 @@ Subject: [PATCH] Added an api method to unload Plugins Format Code to Bungee's code style diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156..a190dfae 100644 +index 90031156f..a190dfae8 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -25,6 +25,7 @@ import java.util.Set; diff --git a/Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch similarity index 94% rename from Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch rename to Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch index 16e0f136..17fe687b 100644 --- a/Waterfall-Proxy-Patches/0024-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -1,11 +1,11 @@ -From 5bddd07166fdd36bf8f174ded2841903aca46153 Mon Sep 17 00:00:00 2001 +From 2caae71d8c0bdc5a325610ef1c77775f9ba4ee69 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index 86182cdd..b28f4081 100644 +index e78519964..222285cc1 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java @@ -61,4 +61,14 @@ public class EncryptionRequest extends DefinedPacket @@ -24,7 +24,7 @@ index 86182cdd..b28f4081 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3c..b7842055 100644 +index 7dbbfd3cd..b78420556 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -51,7 +51,7 @@ index 7dbbfd3c..b7842055 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 682c8784..22a5b993 100644 +index 3224b0d2b..763d34c2f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java @@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket diff --git a/Waterfall-Proxy-Patches/0025-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch similarity index 97% rename from Waterfall-Proxy-Patches/0025-Custom-motd-system.patch rename to Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 77fc345a..99aadcf1 100644 --- a/Waterfall-Proxy-Patches/0025-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,14 +1,14 @@ -From b406218a681d715b932c80458b4164e4d4cd6db5 Mon Sep 17 00:00:00 2001 +From 617ad8e4f511a78c2151d9f92e06c34bd3f3b680 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -index cfbd55c3..360305b9 100644 +index 5589ce1b7..1e928197c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -11,6 +11,10 @@ public class FlameConfig { +@@ -15,6 +15,10 @@ public class FlameConfig { return (int) setIfUnexistant(arg1, (Object) arg2, configuration); } @@ -20,7 +20,7 @@ index cfbd55c3..360305b9 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c327841a..de2cc947 100644 +index aac41c8b2..7937af051 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,80 @@ package dev._2lstudios.flamecord.configuration; @@ -125,7 +125,7 @@ index c327841a..de2cc947 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); 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 198086e0..d99cb5d0 100644 +index 8fb36e37d..b340c7a55 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; diff --git a/Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch similarity index 95% rename from Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch rename to Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 43e270d3..d221ee72 100644 --- a/Waterfall-Proxy-Patches/0026-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 03547260d8d2d4445a56e83fd7e63fe0a836904b Mon Sep 17 00:00:00 2001 +From 7001800c9141f42b15bd9adee24319f1837a8183 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index de2cc947..5d92c20c 100644 +index 7937af051..a1d23f74d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -28,7 +28,7 @@ index de2cc947..5d92c20c 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); 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 a4c3bd71..ffea1599 100644 +index a4c3bd710..ffea15992 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 @@ -194,6 +194,8 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch similarity index 98% rename from Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch rename to Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index c9240b6a..34251427 100644 --- a/Waterfall-Proxy-Patches/0027-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,4 +1,4 @@ -From 1e5fa27a03247139aee723add5280ba00dfc901d Mon Sep 17 00:00:00 2001 +From a19efbabc81d28c8529c2c92fd351c71393bd710 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch similarity index 73% rename from Waterfall-Proxy-Patches/0028-Antibot-System.patch rename to Waterfall-Proxy-Patches/0029-Antibot-System.patch index e554a73b..e0369ddf 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,14 +1,14 @@ -From b4ba3f3f68b4bfd4e8af4249fa30cc59ccfdde83 Mon Sep 17 00:00:00 2001 +From b8c85934f332d737bf4c5d0fd3d19f9ecdfffe6b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..5978bec60 100644 +index 20edd9001..f48f1e60b 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml -@@ -30,6 +30,11 @@ +@@ -30,6 +30,17 @@ ${project.version} compile @@ -16,17 +16,74 @@ index 20edd9001..5978bec60 100644 + com.maxmind.db + maxmind-db + 2.0.0 ++ ++ ++ io.netty ++ netty-handler ++ ${netty.version} ++ compile + -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index c78ab3a7c..ec880c07d 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; + import java.util.Collection; + import java.util.logging.Logger; + ++import dev._2lstudios.flamecord.antibot.AddressDataManager; ++import dev._2lstudios.flamecord.antibot.CheckManager; + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +@@ -18,26 +20,31 @@ public class FlameCord { + if (FlameCord.instance != null) { + instance.reload(logger); + } else { +- FlameCord.instance = new FlameCord(logger, whitelistedAddresses); ++ FlameCord.instance = new FlameCord(); ++ instance.reload(logger); + } + } + + @Getter + private FlameCordConfiguration flameCordConfiguration; + @Getter ++ private AddressDataManager addressDataManager; ++ @Getter ++ private CheckManager checkManager; ++ @Getter + private ModulesConfiguration modulesConfiguration; + @Getter + private MessagesConfiguration messagesConfiguration; + + private void reload(final Logger logger) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ if (checkManager != null) checkManager.unload(); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); +- } +- +- private FlameCord(final Logger logger, final Collection whitelistedAddresses) { +- reload(logger); ++ this.addressDataManager = new AddressDataManager(); ++ this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 000000000..da52c8924 +index 000000000..5e7fa6bfb --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AccountsCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; +import java.util.Collection; @@ -62,13 +119,13 @@ index 000000000..da52c8924 + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..b37f114a0 +index 000000000..b8448bdf2 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressData.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,154 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.util.Collection; +import java.util.HashSet; @@ -222,13 +279,13 @@ index 000000000..b37f114a0 + return nicknames.contains(nickname); + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..6c7b300c2 +index 000000000..46798dee0 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/AddressDataManager.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,31 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.InetSocketAddress; +import java.net.SocketAddress; @@ -259,13 +316,13 @@ index 000000000..6c7b300c2 + return getAddressData(addressString); + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 000000000..0676f897f +index 000000000..1503ac954 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CheckManager.java -@@ -0,0 +1,37 @@ -+package dev._2lstudios.antibot; ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java +@@ -0,0 +1,40 @@ ++package dev._2lstudios.flamecord.antibot; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; +import lombok.Getter; @@ -285,6 +342,8 @@ index 000000000..0676f897f + private final RatelimitCheck ratelimitCheck; + @Getter + private final ReconnectCheck reconnectCheck; ++ @Getter ++ private final PacketsCheck packetsCheck; + + public CheckManager(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { + this.accountsCheck = new AccountsCheck(addressDataManager); @@ -294,6 +353,7 @@ index 000000000..0676f897f + this.passwordCheck = new PasswordCheck(addressDataManager); + this.ratelimitCheck = new RatelimitCheck(addressDataManager); + this.reconnectCheck = new ReconnectCheck(addressDataManager); ++ this.packetsCheck = new PacketsCheck(); + + this.countryCheck.load(); + } @@ -302,13 +362,13 @@ index 000000000..0676f897f + this.countryCheck.unload(); + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 000000000..e2410468d +index 000000000..018aacd2c --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/CountryCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,140 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.io.File; +import java.io.IOException; @@ -448,13 +508,13 @@ index 000000000..e2410468d + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 000000000..197636935 +index 000000000..682e1c314 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/FastChatCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; + @@ -486,13 +546,13 @@ index 000000000..197636935 + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 000000000..222aba31f +index 000000000..165963629 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/NicknameCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,45 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; + @@ -537,13 +597,194 @@ index 000000000..222aba31f + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java +new file mode 100644 +index 000000000..0de670b3f +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java +@@ -0,0 +1,67 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.enums.PacketsCheckResult; ++import dev._2lstudios.flamecord.enums.PacketsViolationReason; ++import dev._2lstudios.flamecord.utils.ProtocolUtil; ++import io.netty.buffer.ByteBuf; ++ ++public class PacketsCheck { ++ private Map packetsData = new HashMap<>(); ++ private long lastCalculation = System.currentTimeMillis(); ++ ++ public PacketsData getData(SocketAddress address) { ++ String ip = address.toString(); ++ ++ if (System.currentTimeMillis() - lastCalculation >= 60000) { ++ packetsData.clear(); ++ this.lastCalculation = System.currentTimeMillis(); ++ } ++ ++ PacketsData data; ++ ++ if (packetsData.containsKey(ip)) { ++ data = packetsData.get(ip); ++ } else { ++ data = new PacketsData(address); ++ packetsData.put(ip, data); ++ } ++ ++ return data; ++ } ++ ++ public PacketsCheckResult check(SocketAddress socketAddress, ByteBuf byteBuf) { ++ PacketsData addressData = getData(socketAddress); ++ FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ int length = byteBuf.readableBytes(); ++ int index = byteBuf.readerIndex(); ++ int packetId = ProtocolUtil.readVarInt(byteBuf); ++ byteBuf.readerIndex(index); ++ ++ addressData.addVls(length * config.getAntibotPacketsVlsPerByte(), PacketsViolationReason.SIZE, packetId); ++ addressData.addVls(config.getAntibotPacketsVlsPerPacket(), PacketsViolationReason.RATE, packetId); ++ ++ double vls = addressData.getPacketsVls(); ++ ++ if (vls >= config.getAntibotPacketsVlsToKick()) { ++ return PacketsCheckResult.KICK; ++ } else if (vls >= config.getAntibotPacketsVlsToCancel()) { ++ if (addressData.isCancelled()) { ++ return PacketsCheckResult.CANCEL; ++ } else { ++ addressData.setCancelled(true); ++ return PacketsCheckResult.FIRST_CANCEL; ++ } ++ } else { ++ return PacketsCheckResult.NONE; ++ } ++ } ++ ++ public void printPackets(SocketAddress remoteAddress) { ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java +new file mode 100644 +index 000000000..db1997d63 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java +@@ -0,0 +1,102 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Map.Entry; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.enums.PacketsViolationReason; ++ ++public class PacketsData { ++ // The address related to this data ++ private SocketAddress address; ++ ++ // The vls of the current address ++ private double packetsVls = 0; ++ ++ // The vls of the current address because of size ++ private double packetsVlsSize = 0; ++ ++ // The vls of the current address because of rate ++ private double packetsVlsRate = 0; ++ ++ // If this was cancelled in the last second ++ private boolean cancelled = false; ++ ++ // The last time vls was calculated ++ private long lastVlsCalculated = System.currentTimeMillis(); ++ ++ private Map vlsByPacketId = new HashMap<>(); ++ ++ public PacketsData(SocketAddress address) { ++ this.address = address; ++ } ++ ++ public double simplify(double number) { ++ return (double) (int) (number * 1000) / 1000; ++ } ++ ++ public void printPackets() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() && this.packetsVls > 0) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] debug is enabled, showing stats (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); ++ for (Entry entry : this.vlsByPacketId.entrySet()) { ++ System.out.print(entry.getKey() + "-" + simplify(entry.getValue()) + "vls, "); ++ } ++ System.out.println(""); ++ } ++ } ++ ++ public double getPacketsVls() { ++ if (System.currentTimeMillis() - lastVlsCalculated >= 1000) { ++ printPackets(); ++ ++ this.packetsVls = 0; ++ this.packetsVlsSize = 0; ++ this.packetsVlsRate = 0; ++ this.vlsByPacketId.clear(); ++ this.cancelled = false; ++ this.lastVlsCalculated = System.currentTimeMillis(); ++ } ++ ++ return packetsVls; ++ } ++ ++ public void addVls(double packetsVls, PacketsViolationReason reason, int packetId) { ++ this.packetsVls += packetsVls; ++ this.vlsByPacketId.put(packetId, this.vlsByPacketId.getOrDefault(packetId, 0.0) + packetsVls); ++ ++ switch (reason) { ++ case SIZE: { ++ this.packetsVlsSize += packetsVls; ++ break; ++ } ++ case RATE: { ++ this.packetsVlsRate += packetsVls; ++ break; ++ } ++ default: { ++ break; ++ } ++ } ++ } ++ ++ public boolean isCancelled() { ++ return cancelled; ++ } ++ ++ public void setCancelled(boolean cancelled) { ++ this.cancelled = cancelled; ++ } ++ ++ public double getPacketsVlsSize() { ++ return packetsVlsSize; ++ } ++ ++ public double getPacketsVlsRate() { ++ return packetsVlsRate; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 000000000..bdc024f58 +index 000000000..82401d240 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/PasswordCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; + @@ -605,13 +846,13 @@ index 000000000..bdc024f58 + return repeatCount; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..b55b4bb17 +index 000000000..0165d1bf8 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/RatelimitCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; + @@ -644,13 +885,13 @@ index 000000000..b55b4bb17 + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 000000000..efd8d2cac +index 000000000..68cc4c217 --- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/antibot/ReconnectCheck.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,46 @@ -+package dev._2lstudios.antibot; ++package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; + @@ -696,62 +937,11 @@ index 000000000..efd8d2cac + return false; + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7c..8591a7918 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; - import java.util.Collection; - import java.util.logging.Logger; - -+import dev._2lstudios.antibot.AddressDataManager; -+import dev._2lstudios.antibot.CheckManager; - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -18,26 +20,31 @@ public class FlameCord { - if (FlameCord.instance != null) { - instance.reload(logger); - } else { -- FlameCord.instance = new FlameCord(logger, whitelistedAddresses); -+ FlameCord.instance = new FlameCord(); -+ instance.reload(logger); - } - } - - @Getter - private FlameCordConfiguration flameCordConfiguration; - @Getter -+ private AddressDataManager addressDataManager; -+ @Getter -+ private CheckManager checkManager; -+ @Getter - private ModulesConfiguration modulesConfiguration; - @Getter - private MessagesConfiguration messagesConfiguration; - - private void reload(final Logger logger) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ if (checkManager != null) checkManager.unload(); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); - this.modulesConfiguration = new ModulesConfiguration(configurationProvider); - this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -- } -- -- private FlameCord(final Logger logger, final Collection whitelistedAddresses) { -- reload(logger); -+ this.addressDataManager = new AddressDataManager(); -+ this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); - } - } -\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a1d23f74d..76c35626d 100644 +index a1d23f74d..1bd6b2164 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,120 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,157 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -829,36 +1019,65 @@ index a1d23f74d..76c35626d 100644 + @Getter + private boolean antibotReconnectLog = true; + ++ // Antibot packets ++ @Getter ++ private boolean antibotPacketsEnabled = true; ++ @Getter ++ private boolean antibotPacketsLog = true; ++ @Getter ++ private double antibotPacketsVlsPerByte = 0.00001; ++ @Getter ++ private double antibotPacketsVlsPerPacket = 0.01; ++ @Getter ++ private double antibotPacketsVlsToKick = 100; ++ @Getter ++ private double antibotPacketsVlsToCancel = 25; ++ + public void loadAntibot(final Configuration config) { ++ // Antibot accounts + this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); + this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); + this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); + this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); ++ ++ // Antibot country + this.antibotCountryEnabled = setIfUnexistant("antibot.country.enabled", this.antibotCountryEnabled, config); + this.antibotCountryFirewall = setIfUnexistant("antibot.country.firewall", this.antibotCountryFirewall, config); + this.antibotCountryBlacklist = setIfUnexistant("antibot.country.blacklist", this.antibotCountryBlacklist, config); + this.antibotCountryLog = setIfUnexistant("antibot.country.log", this.antibotCountryLog, config); ++ ++ // Antibot fastchat + this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); + this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); + this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); + this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); ++ ++ // Antibot firewall + this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); + this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); ++ ++ // Antibot nickname + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); + this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); + this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); + this.antibotNicknameLog = setIfUnexistant("antibot.nickname.log", this.antibotNicknameLog, config); ++ ++ // Antibot password + this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); + this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); + this.antibotPasswordLimit = setIfUnexistant("antibot.password.limit", this.antibotPasswordLimit, config); + this.antibotPasswordLog = setIfUnexistant("antibot.password.log", this.antibotPasswordLog, config); ++ ++ // Antibot ratelimit + this.antibotRatelimitEnabled = setIfUnexistant("antibot.ratelimit.enabled", this.antibotRatelimitEnabled, config); + this.antibotRatelimitFirewall = setIfUnexistant("antibot.ratelimit.firewall", this.antibotRatelimitFirewall, config); + this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); + this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); + this.antibotRatelimitLog = setIfUnexistant("antibot.ratelimit.log", this.antibotRatelimitLog, config); ++ ++ // Antibot reconnect + this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); + this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); + this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); @@ -866,13 +1085,21 @@ index a1d23f74d..76c35626d 100644 + this.antibotReconnectConnectionThreshold = setIfUnexistant("antibot.reconnect.connection-threshold", this.antibotReconnectConnectionThreshold, config); + this.antibotReconnectConnectionThresholdLimit = setIfUnexistant("antibot.reconnect.connection-threshold-limit", this.antibotReconnectConnectionThresholdLimit, config); + this.antibotReconnectLog = setIfUnexistant("antibot.reconnect.log", this.antibotReconnectLog, config); ++ ++ // Antibot packets ++ this.antibotPacketsEnabled = setIfUnexistant("antibot.packets.enabled", this.antibotPacketsEnabled, config); ++ this.antibotPacketsLog = setIfUnexistant("antibot.packets.log", this.antibotPacketsLog, config); ++ this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); ++ this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); ++ this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); ++ this.antibotPacketsVlsToCancel = setIfUnexistant("antibot.packets.vls-to-cancel", this.antibotPacketsVlsToCancel, config); + } + // FlameCord end - Antibot System + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +231,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +268,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -913,18 +1140,155 @@ index 4f306660e..5faab6166 100644 configurationProvider.save(configuration, configurationFile); +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java +new file mode 100644 +index 000000000..53f1648ab +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java +@@ -0,0 +1,5 @@ ++package dev._2lstudios.flamecord.enums; ++ ++public enum PacketsCheckResult { ++ KICK, FIRST_CANCEL, CANCEL, NONE ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java +new file mode 100644 +index 000000000..c19c4965d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java +@@ -0,0 +1,5 @@ ++package dev._2lstudios.flamecord.enums; ++ ++public enum PacketsViolationReason { ++ SIZE, RATE ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java +new file mode 100644 +index 000000000..7f26e7a0d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java +@@ -0,0 +1,27 @@ ++package dev._2lstudios.flamecord.utils; ++ ++import io.netty.buffer.ByteBuf; ++ ++public class ProtocolUtil { ++ private static int SEGMENT_BITS = 0x7F; ++ private static int CONTINUE_BIT = 0x80; ++ ++ public static int readVarInt(ByteBuf byteBuf) { ++ int value = 0; ++ int position = 0; ++ byte currentByte; ++ ++ while (byteBuf.isReadable()) { ++ currentByte = byteBuf.readByte(); ++ value |= (currentByte & SEGMENT_BITS) << position; ++ ++ if ((currentByte & CONTINUE_BIT) == 0) break; ++ ++ position += 7; ++ ++ if (position >= 32) throw new RuntimeException("VarInt is too big"); ++ } ++ ++ return value; ++ } ++} +\ No newline at end of file +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 6316143f7..209e4f143 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -51,12 +51,46 @@ public class MinecraftDecoder extends MessageToMessageDecoder + throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); + } + } ++ ++ // FlameCord start - Antibot Packet Check ++ if (prot == protocol.TO_SERVER) { ++ dev._2lstudios.flamecord.enums.PacketsCheckResult result = FlameCord.getInstance().getCheckManager().getPacketsCheck() ++ .check(ctx.channel().remoteAddress(), in); ++ ++ switch (result) { ++ case KICK: ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { ++ System.out ++ .println("[FlameCord] [" + ctx.channel().remoteAddress() ++ + "] was kicked because of too many packets"); ++ } ++ ++ in.skipBytes(in.readableBytes()); ++ ctx.close(); ++ return; ++ case CANCEL: ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { ++ System.out ++ .println("[FlameCord] [" + ctx.channel().remoteAddress() ++ + "] was cancelled because of too many packets"); ++ } ++ ++ in.skipBytes(in.readableBytes()); ++ return; ++ default: ++ break; ++ } ++ } ++ // FlameCord end - Antibot Packet Check + + ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy + + Object packetTypeInfo = null; + try + { ++ // FlameCord - Duplicate buf instead of Copy ++ slice = in.duplicate(); // Can't slice this one due to EntityMap :( ++ + // Waterfall start + if (in.readableBytes() == 0 && !server) { + return; +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 +index c9e45b915..022f94b2d 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -723,4 +723,8 @@ public enum Protocol + // Waterfall end + } + } ++ ++ public DirectionData getToServer() { ++ return TO_SERVER; ++ } + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +index c0d371426..403ccba98 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +@@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.ByteToMessageDecoder; + import io.netty.handler.codec.CorruptedFrameException; ++ + import java.util.List; + + public class Varint21FrameDecoder extends ByteToMessageDecoder + { +- + private static boolean DIRECT_WARNING; + + @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..ae5d4c73f 100644 +index cc76325b2..a5b9331f6 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -3,6 +3,7 @@ package dev._2lstudios.flamecord.commands; - import java.util.Collection; +@@ -4,6 +4,7 @@ import java.util.Collection; import java.util.HashSet; -+import dev._2lstudios.antibot.AddressDataManager; import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.antibot.AddressDataManager; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.CommandSender; @@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; if (sender.hasPermission("flamecord.usage")) { @@ -974,19 +1338,20 @@ index cc76325b2..ae5d4c73f 100644 } } 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 c00ab4b6a..089cac669 100644 +index c00ab4b6a..bbf9c3dba 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 -@@ -21,6 +21,8 @@ import java.util.logging.Level; - import javax.crypto.SecretKey; +@@ -22,7 +22,8 @@ import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; -+import dev._2lstudios.antibot.AddressData; -+import dev._2lstudios.antibot.CheckManager; import dev._2lstudios.flamecord.FlameCord; - +- ++import dev._2lstudios.flamecord.antibot.AddressData; ++import dev._2lstudios.flamecord.antibot.CheckManager; import dev._2lstudios.flamecord.configuration.FlameConfig; -@@ -439,6 +441,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import lombok.Getter; +@@ -439,6 +440,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -998,7 +1363,7 @@ index c00ab4b6a..089cac669 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -450,6 +457,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -450,6 +456,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1021,7 +1386,7 @@ index c00ab4b6a..089cac669 100644 break; case 2: // Login -@@ -461,6 +484,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +483,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1043,7 +1408,7 @@ index c00ab4b6a..089cac669 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -525,6 +563,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -525,6 +562,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1103,7 +1468,7 @@ index c00ab4b6a..089cac669 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4e..7b852ff69 100644 +index 66332af4e..289cce0c3 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,11 +4,16 @@ import com.google.common.base.Preconditions; @@ -1111,8 +1476,8 @@ index 66332af4e..7b852ff69 100644 import com.mojang.brigadier.suggestion.Suggestion; import com.mojang.brigadier.suggestion.Suggestions; + -+import dev._2lstudios.antibot.CheckManager; +import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.antibot.CheckManager; import io.netty.channel.Channel; import java.util.ArrayList; import java.util.LinkedList; diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch similarity index 90% rename from Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch rename to Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 3ef65929..24eef555 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 9221f376964681108d3a1f6a899313fc860c01d9 Mon Sep 17 00:00:00 2001 +From 152a7b67bbe619c2933d6ee4c486a7a5314fd3da Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 76c35626d..1c27409d3 100644 +index 1bd6b2164..d8bc8980f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 76c35626d..1c27409d3 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -231,6 +235,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -268,6 +272,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -29,10 +29,10 @@ index 76c35626d..1c27409d3 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 089cac669..91648b499 100644 +index bbf9c3dba..952b2a363 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 -@@ -522,7 +522,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch similarity index 90% rename from Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch rename to Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch index 423a3b0e..f943b9d8 100644 --- a/Waterfall-Proxy-Patches/0036-Only-show-connection-fail-reason-when-detailed-logge.patch +++ b/Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -1,4 +1,4 @@ -From 48878ec51074a1a90d1c4aa761a40fbec74bd8ac Mon Sep 17 00:00:00 2001 +From 878867854391af17739c536b7db5c0992c8fcf84 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 Subject: [PATCH] Only show connection fail reason when detailed logger is @@ -6,7 +6,7 @@ Subject: [PATCH] Only show connection fail reason when detailed logger is 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 f3d60253..021fe839 100644 +index f3d60253f..021fe8398 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer @@ -22,5 +22,5 @@ index f3d60253..021fe839 100644 @Override -- -2.29.2.windows.2 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch b/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch deleted file mode 100644 index e605d493..00000000 --- a/Waterfall-Proxy-Patches/0035-Safe-bytebuf-release.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 07f1032863acec085e88e6411ba2d4e1906f959e Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Mon, 31 Oct 2022 17:00:58 +0100 -Subject: [PATCH] Safe bytebuf release - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 9a7bf9b59..b43ebc8d6 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -31,33 +31,34 @@ public class MinecraftDecoder extends MessageToMessageDecoder - @Override - protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception - { -- // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() -- // will fire any cumulated data through the pipeline, so we want to try and stop it here. -- if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable -- { -- return; -- } -+ // FlameCord - Safe bytebuf release -+ Object packetTypeInfo = null; -+ ByteBuf slice = null; -+ try { -+ // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() -+ // will fire any cumulated data through the pipeline, so we want to try and stop it here. -+ if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable -+ { -+ return; -+ } - -- Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -- -- // FlameCord - Check size before decoding -- if (prot == protocol.TO_SERVER) { -- final int readableBytes = in.readableBytes(); -- final int capacity = in.capacity(); -- -- if (readableBytes > 2097152) { -- throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); -- } else if (capacity > 2097152) { -- throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); -+ Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ -+ // FlameCord - Check size before decoding -+ if (prot == protocol.TO_SERVER) { -+ final int readableBytes = in.readableBytes(); -+ final int capacity = in.capacity(); -+ -+ if (readableBytes > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); -+ } else if (capacity > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); -+ } - } -- } - -- // FlameCord - Duplicate buf instead of Copy -- ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :( -+ // FlameCord - Duplicate buf instead of Copy -+ slice = in.duplicate(); // Can't slice this one due to EntityMap :( - -- Object packetTypeInfo = null; -- try -- { - // Waterfall start - if (in.readableBytes() == 0 && !server) { - return; -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index a63e67f15..4293e2b49 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -286,10 +286,15 @@ public class ServerConnector extends PacketHandler - user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); - } else - { -- ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); -- user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -- brand.release(); -+ // FlameCord - Safe bytebuf release -+ ByteBuf brand = null; -+ try { -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); -+ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ } finally { -+ if (brand != null) brand.release(); -+ } - } - // FlameCord end - 1.7.x support - } -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 -index 6e425764b..e7fe0d02b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -307,13 +307,24 @@ public class DownstreamBridge extends PacketHandler - { - try - { -- ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); -- String serverBrand = DefinedPacket.readString(brand); -- brand.release(); -- brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -- pluginMessage.setData(brand); -- brand.release(); -+ // FlameCord - Safe bytebuf release -+ ByteBuf brand = null; -+ String serverBrand; -+ try { -+ brand = Unpooled.wrappedBuffer(pluginMessage.getData()); -+ serverBrand = DefinedPacket.readString(brand); -+ } finally { -+ if (brand != null) brand.release(); -+ } -+ -+ // FlameCord - Safe bytebuf release -+ try { -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData(brand); -+ } finally { -+ if (brand != null) brand.release(); -+ } - } catch (Exception ProtocolHacksSuck) - { - return; -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index abca28bd7..2fd37c2dd 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -84,46 +84,44 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception - { -- // FlameCord - Return if channel isn't active -- if (!ctx.channel().isActive()) { -- if (msg instanceof PacketWrapper) { -- ((PacketWrapper) msg).trySingleRelease(); -+ // FlameCord - Safe bytebuf release -+ try -+ { -+ // FlameCord - Return if channel isn't active -+ if (!ctx.channel().isActive()) { -+ return; - } - -- return; -- } -- -- if ( msg instanceof HAProxyMessage ) -- { -- HAProxyMessage proxy = (HAProxyMessage) msg; -- try -+ if ( msg instanceof HAProxyMessage ) - { -- if ( proxy.sourceAddress() != null ) -+ HAProxyMessage proxy = (HAProxyMessage) msg; -+ try - { -- InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); -+ if ( proxy.sourceAddress() != null ) -+ { -+ InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); - -- // FlameCord - Option to log haproxy -- if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -- { -- channel.getRemoteAddress(), newAddress -- } ); -+ // FlameCord - Option to log haproxy -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) -+ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ { -+ channel.getRemoteAddress(), newAddress -+ } ); - -- channel.setRemoteAddress( newAddress ); -+ channel.setRemoteAddress( newAddress ); -+ } -+ } finally -+ { -+ proxy.release(); - } -- } finally -- { -- proxy.release(); -+ return; - } -- return; -- } - -- if ( handler != null ) -- { - PacketWrapper packet = (PacketWrapper) msg; -- boolean sendPacket = handler.shouldHandle( packet ); -- try -+ -+ if ( handler != null ) - { -+ boolean sendPacket = handler.shouldHandle( packet ); - if ( sendPacket && packet.packet != null ) - { - try -@@ -138,9 +136,11 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - handler.handle( packet ); - } -- } finally -- { -- packet.trySingleRelease(); -+ } -+ } finally -+ { -+ if (msg instanceof PacketWrapper) { -+ ((PacketWrapper) msg).trySingleRelease(); - } - } - } --- -2.37.3.windows.1 - From a4011634c83ca383c22cc5a66b0f76f32d03eedd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 21 Dec 2022 21:59:40 -0300 Subject: [PATCH 343/499] Fix 1.7 Connection Problems --- Waterfall-Proxy-Patches/0004-1.7.x-support.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 4546e71f..ceb18cfc 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From a75405f17616b89acf9874fabd29e11c94c50977 Mon Sep 17 00:00:00 2001 +From c6b956bee70e03b5983a6c83a083ba9426258667 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -915,7 +915,7 @@ index a5555f6af..1eb458b61 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 19cc33b97..9f41970ea 100644 +index ca1dad0e5..e11e30402 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer @@ -1524,7 +1524,7 @@ index 5e02f8c8a..85bc21b9f 100644 return WAITINGSERVERDATA; diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index f70d357a3..118c78f49 100644 +index f70d357a3..df6a4b12c 100644 --- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java @@ -13,6 +13,7 @@ public class ServerUnique extends TabList @@ -1564,7 +1564,7 @@ index f70d357a3..118c78f49 100644 } } player.unsafe().sendPacket( playerListItem ); -@@ -79,17 +96,47 @@ public class ServerUnique extends TabList +@@ -79,17 +96,48 @@ public class ServerUnique extends TabList { PlayerListItem packet = new PlayerListItem(); packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); @@ -1578,6 +1578,7 @@ index f70d357a3..118c78f49 100644 + PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); + item.setUsername( username ); + item.setDisplayName( username ); ++ item.setPing( 0 ); + } + // FlameCord end - 1.7.x support + From 125b7dffafc2262e4640b70aa4cf870477402ace Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 21 Dec 2022 22:45:30 -0300 Subject: [PATCH 344/499] Fixed errors of Packets Check --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 11 +++++++---- .../0030-Allow-Invalid-Names.patch | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index e0369ddf..45328623 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From b8c85934f332d737bf4c5d0fd3d19f9ecdfffe6b Mon Sep 17 00:00:00 2001 +From c0f61de5f384a414161976dc5b05be6a1869d090 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -938,10 +938,10 @@ index 000000000..68cc4c217 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a1d23f74d..1bd6b2164 100644 +index a1d23f74d..367c25d19 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,157 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,160 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1025,6 +1025,8 @@ index a1d23f74d..1bd6b2164 100644 + @Getter + private boolean antibotPacketsLog = true; + @Getter ++ private boolean antibotPacketsDebug = false; ++ @Getter + private double antibotPacketsVlsPerByte = 0.00001; + @Getter + private double antibotPacketsVlsPerPacket = 0.01; @@ -1089,6 +1091,7 @@ index a1d23f74d..1bd6b2164 100644 + // Antibot packets + this.antibotPacketsEnabled = setIfUnexistant("antibot.packets.enabled", this.antibotPacketsEnabled, config); + this.antibotPacketsLog = setIfUnexistant("antibot.packets.log", this.antibotPacketsLog, config); ++ this.antibotPacketsDebug = setIfUnexistant("antibot.packets.debug", this.antibotPacketsDebug, config); + this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); + this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); + this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); @@ -1099,7 +1102,7 @@ index a1d23f74d..1bd6b2164 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +268,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +271,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 24eef555..b0816fd6 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 152a7b67bbe619c2933d6ee4c486a7a5314fd3da Mon Sep 17 00:00:00 2001 +From 6872a064715964bac98a97bf498b00b98244b8b8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1bd6b2164..d8bc8980f 100644 +index 367c25d19..544ad091b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 1bd6b2164..d8bc8980f 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -268,6 +272,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -271,6 +275,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); From 04360ecae4ff25fc287814162dfbd6c781a31e57 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Thu, 22 Dec 2022 02:47:30 +0100 Subject: [PATCH 345/499] 1.2.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 9df5cd4a..81ca1d6e 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 8617cdc7a..ca1dad0e5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.0"; ++ return "1.2.1"; } public final void reloadMessages() From 856fc12bd538317584eb50d94883f7711a6249d3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 22 Dec 2022 00:16:06 -0300 Subject: [PATCH 346/499] Better Packets Check Settings --- .../0029-Antibot-System.patch | 88 +++++++++---------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 45328623..e88e3869 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From c0f61de5f384a414161976dc5b05be6a1869d090 Mon Sep 17 00:00:00 2001 +From d9165053dc58f369fa9920b7112b71fc17912cf9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -599,10 +599,10 @@ index 000000000..165963629 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 000000000..0de670b3f +index 000000000..199da2920 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java -@@ -0,0 +1,67 @@ +@@ -0,0 +1,62 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -656,12 +656,7 @@ index 000000000..0de670b3f + if (vls >= config.getAntibotPacketsVlsToKick()) { + return PacketsCheckResult.KICK; + } else if (vls >= config.getAntibotPacketsVlsToCancel()) { -+ if (addressData.isCancelled()) { -+ return PacketsCheckResult.CANCEL; -+ } else { -+ addressData.setCancelled(true); -+ return PacketsCheckResult.FIRST_CANCEL; -+ } ++ return PacketsCheckResult.CANCEL; + } else { + return PacketsCheckResult.NONE; + } @@ -672,10 +667,10 @@ index 000000000..0de670b3f +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 000000000..db1997d63 +index 000000000..c4a63e21e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java -@@ -0,0 +1,102 @@ +@@ -0,0 +1,113 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -699,14 +694,15 @@ index 000000000..db1997d63 + // The vls of the current address because of rate + private double packetsVlsRate = 0; + -+ // If this was cancelled in the last second -+ private boolean cancelled = false; -+ + // The last time vls was calculated + private long lastVlsCalculated = System.currentTimeMillis(); + ++ // The vls by packet ids + private Map vlsByPacketId = new HashMap<>(); + ++ // If cancellation was printed ++ private boolean cancelPrinted = false; ++ + public PacketsData(SocketAddress address) { + this.address = address; + } @@ -715,16 +711,34 @@ index 000000000..db1997d63 + return (double) (int) (number * 1000) / 1000; + } + ++ public void printKick() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] was kicked because of too many packets"); ++ } ++ } ++ ++ public void printCancel() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog() && !cancelPrinted) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] was cancelled because of too many packets"); ++ this.cancelPrinted = true; ++ } ++ } ++ + public void printPackets() { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() && this.packetsVls > 0) { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() ++ && simplify(this.packetsVls) > 0) { + System.out + .println("[FlameCord] [" + address + + "] debug is enabled, showing stats (Total: " + simplify(packetsVls) + "vls Size: " + + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); -+ for (Entry entry : this.vlsByPacketId.entrySet()) { -+ System.out.print(entry.getKey() + "-" + simplify(entry.getValue()) + "vls, "); -+ } -+ System.out.println(""); ++ for (Entry entry : this.vlsByPacketId.entrySet()) { ++ System.out.print(entry.getKey() + "-" + simplify(entry.getValue()) + "vls, "); ++ } ++ System.out.println(""); + } + } + @@ -732,11 +746,11 @@ index 000000000..db1997d63 + if (System.currentTimeMillis() - lastVlsCalculated >= 1000) { + printPackets(); + ++ this.cancelPrinted = false; + this.packetsVls = 0; + this.packetsVlsSize = 0; + this.packetsVlsRate = 0; + this.vlsByPacketId.clear(); -+ this.cancelled = false; + this.lastVlsCalculated = System.currentTimeMillis(); + } + @@ -762,14 +776,6 @@ index 000000000..db1997d63 + } + } + -+ public boolean isCancelled() { -+ return cancelled; -+ } -+ -+ public void setCancelled(boolean cancelled) { -+ this.cancelled = cancelled; -+ } -+ + public double getPacketsVlsSize() { + return packetsVlsSize; + } @@ -938,7 +944,7 @@ index 000000000..68cc4c217 + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a1d23f74d..367c25d19 100644 +index a1d23f74d..d42e3d75f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,160 @@ import net.md_5.bungee.config.Configuration; @@ -1027,9 +1033,9 @@ index a1d23f74d..367c25d19 100644 + @Getter + private boolean antibotPacketsDebug = false; + @Getter -+ private double antibotPacketsVlsPerByte = 0.00001; ++ private double antibotPacketsVlsPerByte = 0.0017; + @Getter -+ private double antibotPacketsVlsPerPacket = 0.01; ++ private double antibotPacketsVlsPerPacket = 0.1; + @Getter + private double antibotPacketsVlsToKick = 100; + @Getter @@ -1145,14 +1151,14 @@ index 4f306660e..5faab6166 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 000000000..53f1648ab +index 000000000..285810ea1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ +package dev._2lstudios.flamecord.enums; + +public enum PacketsCheckResult { -+ KICK, FIRST_CANCEL, CANCEL, NONE ++ KICK, CANCEL, NONE +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 @@ -1200,10 +1206,10 @@ index 000000000..7f26e7a0d +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f7..209e4f143 100644 +index 6316143f7..a1af4e09e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -51,12 +51,46 @@ public class MinecraftDecoder extends MessageToMessageDecoder +@@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); } } @@ -1215,21 +1221,13 @@ index 6316143f7..209e4f143 100644 + + switch (result) { + case KICK: -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { -+ System.out -+ .println("[FlameCord] [" + ctx.channel().remoteAddress() -+ + "] was kicked because of too many packets"); -+ } ++ FlameCord.getInstance().getCheckManager().getPacketsCheck().getData(ctx.channel().remoteAddress()).printKick(); + + in.skipBytes(in.readableBytes()); + ctx.close(); + return; + case CANCEL: -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { -+ System.out -+ .println("[FlameCord] [" + ctx.channel().remoteAddress() -+ + "] was cancelled because of too many packets"); -+ } ++ FlameCord.getInstance().getCheckManager().getPacketsCheck().getData(ctx.channel().remoteAddress()).printCancel(); + + in.skipBytes(in.readableBytes()); + return; From 802f5612b1a9221f269ff0effb23a0f267d479a0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:20:58 -0300 Subject: [PATCH 347/499] Show extra info on packets check --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index e88e3869..caa4fd79 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From d9165053dc58f369fa9920b7112b71fc17912cf9 Mon Sep 17 00:00:00 2001 +From c1528683897e609feeb96d84b3114705dea214c4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -667,10 +667,10 @@ index 000000000..199da2920 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 000000000..c4a63e21e +index 000000000..7189a7f37 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java -@@ -0,0 +1,113 @@ +@@ -0,0 +1,115 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -715,7 +715,8 @@ index 000000000..c4a63e21e + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { + System.out + .println("[FlameCord] [" + address -+ + "] was kicked because of too many packets"); ++ + "] was kicked because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); + } + } + @@ -723,7 +724,8 @@ index 000000000..c4a63e21e + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog() && !cancelPrinted) { + System.out + .println("[FlameCord] [" + address -+ + "] was cancelled because of too many packets"); ++ + "] was cancelled because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); + this.cancelPrinted = true; + } + } From 4ab5df2582274dfcc18f03332fd8959b1ba63284 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:16:22 -0300 Subject: [PATCH 348/499] Performance Improvements during BIG Bot Attacks --- .../0029-Antibot-System.patch | 10 ++-- ...0036-Optimize-Decoder-Encoder-Getter.patch | 60 +++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index caa4fd79..1428833b 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From c1528683897e609feeb96d84b3114705dea214c4 Mon Sep 17 00:00:00 2001 +From 66f5de5d3b8b5b1881a499f11bfb6433bdb6d2df Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -281,7 +281,7 @@ index 000000000..b8448bdf2 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..46798dee0 +index 000000000..97b26f938 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,31 @@ @@ -296,7 +296,7 @@ index 000000000..46798dee0 + private final Map addressData = new HashMap<>(); + + public AddressData getAddressData(String addressString) { -+ addressString = addressString.replace("/", "").split(":")[0]; ++ addressString = addressString.split(":")[0]; + + if (addressData.containsKey(addressString)) { + return addressData.get(addressString); @@ -1281,7 +1281,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..a5b9331f6 100644 +index cc76325b2..1ddae60be 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1309,7 +1309,7 @@ index cc76325b2..a5b9331f6 100644 } + case "firewall": { + if (args.length > 2) { -+ String ip = args[2]; ++ String ip = "/" + args[2]; + + switch (args[1]) { + case "add": { diff --git a/Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch b/Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch new file mode 100644 index 00000000..77559c4f --- /dev/null +++ b/Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch @@ -0,0 +1,60 @@ +From 9356c9e66746a50197da675505bc256290c0832b Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 28 Dec 2022 14:23:54 -0300 +Subject: [PATCH] Optimize Decoder/Encoder Getter + + +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 606866a52..497ca8559 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -31,26 +31,42 @@ public class ChannelWrapper + @Getter + private volatile boolean closing; + ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ MinecraftDecoder decoder; ++ MinecraftEncoder encoder; ++ // FlameCord end - Optimize Decoder/Encoder Getter ++ + public ChannelWrapper(ChannelHandlerContext ctx) + { + this.ch = ctx.channel(); + this.remoteAddress = ( this.ch.remoteAddress() == null ) ? this.ch.parent().localAddress() : this.ch.remoteAddress(); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ this.decoder = (MinecraftDecoder) ch.pipeline().get( PipelineUtils.PACKET_DECODER ); ++ this.encoder = (MinecraftEncoder) ch.pipeline().get( PipelineUtils.PACKET_ENCODER ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void setProtocol(Protocol protocol) + { + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); +- pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); +- pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ decoder.setProtocol( protocol ); ++ encoder.setProtocol( protocol ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void setVersion(int protocol) + { + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); +- pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); +- pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ decoder.setProtocolVersion( protocol ); ++ encoder.setProtocolVersion( protocol ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void write(Object packet) +-- +2.37.3.windows.1 + From 8755112cba4e9f16287467882f68a88eb02ac954 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Dec 2022 20:39:32 -0300 Subject: [PATCH 349/499] 1.2.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 81ca1d6e..7b29a9c0 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From c2c105d218f1681affcee2b27eaedd88143b3d2e Mon Sep 17 00:00:00 2001 +From 89e0f61f0bc77492820083174e0544db59301d4a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..ca1dad0e5 100644 +index 8617cdc7a..26883d2c0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..ca1dad0e5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.1"; ++ return "1.2.2"; } public final void reloadMessages() From a4d3e218ef7fbe83c75fb427df27f677fb004b4f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 31 Dec 2022 15:38:30 -0300 Subject: [PATCH 350/499] Further Optimizations --- .../0029-Antibot-System.patch | 164 ++++++++++++++++-- .../0037-Disable-fromLegacyText-Links.patch | 79 +++++++++ 2 files changed, 226 insertions(+), 17 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 1428833b..acfc7cd7 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 66f5de5d3b8b5b1881a499f11bfb6433bdb6d2df Mon Sep 17 00:00:00 2001 +From 5c22787833121046061ec3b21c14c22b21e7c90f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -27,19 +27,21 @@ index 20edd9001..f48f1e60b 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7c..ec880c07d 100644 +index c78ab3a7c..e5c8ed3e6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -3,6 +3,8 @@ package dev._2lstudios.flamecord; +@@ -3,6 +3,10 @@ package dev._2lstudios.flamecord; import java.util.Collection; import java.util.logging.Logger; +import dev._2lstudios.flamecord.antibot.AddressDataManager; +import dev._2lstudios.flamecord.antibot.CheckManager; ++import dev._2lstudios.flamecord.antibot.LoggerWrapper; ++import dev._2lstudios.flamecord.antibot.StatsData; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -18,26 +20,31 @@ public class FlameCord { +@@ -18,26 +22,37 @@ public class FlameCord { if (FlameCord.instance != null) { instance.reload(logger); } else { @@ -55,6 +57,10 @@ index c78ab3a7c..ec880c07d 100644 + private AddressDataManager addressDataManager; + @Getter + private CheckManager checkManager; ++ @Getter ++ private StatsData statsData; ++ @Getter ++ private LoggerWrapper loggerWrapper; + @Getter private ModulesConfiguration modulesConfiguration; @Getter @@ -74,6 +80,8 @@ index c78ab3a7c..ec880c07d 100644 - reload(logger); + this.addressDataManager = new AddressDataManager(); + this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); ++ this.statsData = new StatsData(); ++ this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); } } \ No newline at end of file @@ -121,10 +129,10 @@ index 000000000..5e7fa6bfb +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..b8448bdf2 +index 000000000..c3ccae2b6 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java -@@ -0,0 +1,154 @@ +@@ -0,0 +1,162 @@ +package dev._2lstudios.flamecord.antibot; + +import java.util.Collection; @@ -135,9 +143,10 @@ index 000000000..b8448bdf2 + +public class AddressData { + private FlameCordConfiguration config; -+ private final Collection nicknames = new HashSet<>(); ++ private StatsData statsData; ++ private Collection nicknames = null; + private final String hostString; -+ private String lastNickname = ""; ++ private String lastNickname = null; + private String country = null; + private String firewallReason = null; + private long lastPing = 0; @@ -151,10 +160,13 @@ index 000000000..b8448bdf2 + + public AddressData(final String hostString) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.statsData = FlameCord.getInstance().getStatsData(); + this.hostString = hostString; + } + + public Collection getNicknames() { ++ if (nicknames == null) nicknames = new HashSet<>(); ++ + return nicknames; + } + @@ -163,7 +175,9 @@ index 000000000..b8448bdf2 + } + + public void addNickname(final String nickname) { -+ if (!lastNickname.equals(nickname)) { ++ if (nicknames == null) nicknames = new HashSet<>(); ++ ++ if (lastNickname == null || !lastNickname.equals(nickname)) { + this.lastNickname = nickname; + this.totalConnections = 1; + } @@ -199,6 +213,7 @@ index 000000000..b8448bdf2 + } + + public void addPing() { ++ statsData.addPing(); + updatePingsSecond(); + lastPing = System.currentTimeMillis(); + pingsSecond++; @@ -223,6 +238,7 @@ index 000000000..b8448bdf2 + public void addConnection() { + final long currentTime = System.currentTimeMillis(); + ++ statsData.addConnection(); + updateConnectionsSecond(); + penultimateConnection = lastConnection == 0 ? currentTime : lastConnection; + lastConnection = currentTime; @@ -281,10 +297,10 @@ index 000000000..b8448bdf2 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..97b26f938 +index 000000000..9f74116b3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java -@@ -0,0 +1,31 @@ +@@ -0,0 +1,35 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.InetSocketAddress; @@ -315,6 +331,10 @@ index 000000000..97b26f938 + + return getAddressData(addressString); + } ++ ++ public int getAddresCount() { ++ return addressData.size(); ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 @@ -546,6 +566,40 @@ index 000000000..682e1c314 + return false; + } +} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java +new file mode 100644 +index 000000000..bbd84ce5c +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ ++public class LoggerWrapper { ++ private Logger logger; ++ ++ // Last time a log was done ++ private long lastLog = System.currentTimeMillis(); ++ ++ public LoggerWrapper(Logger logger) { ++ this.logger = logger; ++ } ++ ++ public void log(Level level, String msg, Object ...params) { ++ long currentTime = System.currentTimeMillis(); ++ ++ // Throttle logs by 100ms ++ if (lastLog - currentTime > 100) { ++ // Set the last log ++ lastLog = currentTime; ++ ++ // Log the text ++ logger.log(level, msg, params); ++ } ++ } ++} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 index 000000000..165963629 @@ -945,6 +999,71 @@ index 000000000..68cc4c217 + return false; + } +} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java +new file mode 100644 +index 000000000..2d60ec2b4 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java +@@ -0,0 +1,59 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++public class StatsData { ++ // Time of the last second ++ private long lastSecond = System.currentTimeMillis(); ++ ++ // Current second connections and pings ++ private int currentPings = 0; ++ private int currentConnections = 0; ++ ++ // Last second connections and pings ++ private int lastPings = 0; ++ private int lastConnections = 0; ++ ++ public void resetData() { ++ // Get current time ++ long currentTime = System.currentTimeMillis(); ++ ++ // Check if one second passed ++ if (lastSecond - currentTime > 1000) { ++ // Set the last second to this one ++ lastSecond = currentTime; ++ ++ // Reset the data ++ lastPings = currentPings; ++ lastConnections = currentConnections; ++ currentPings = 0; ++ currentConnections = 0; ++ } ++ } ++ ++ public void addPing() { ++ currentPings++; ++ } ++ ++ public void addConnection() { ++ currentConnections++; ++ } ++ ++ public int getCurrentPings() { ++ resetData(); ++ return currentPings; ++ } ++ ++ public int getCurrentConnections() { ++ resetData(); ++ return currentConnections; ++ } ++ ++ public int getLastPings() { ++ resetData(); ++ return lastPings; ++ } ++ ++ public int getLastConnections() { ++ resetData(); ++ return lastConnections; ++ } ++} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java index a1d23f74d..d42e3d75f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -1120,10 +1239,10 @@ index a1d23f74d..d42e3d75f 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 4f306660e..5faab6166 100644 +index 4f306660e..fdcd1544d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -82,12 +82,26 @@ public class MessagesConfiguration extends FlameConfig { +@@ -82,12 +82,27 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); @@ -1136,6 +1255,7 @@ index 4f306660e..5faab6166 100644 + setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_stats", "&aFlameCord Antibot Stats\n &ePings: {0}\n &eConnections: {1}", configuration); + // FlameCord end - Antibot System + // FlameCord @@ -1281,18 +1401,19 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..1ddae60be 100644 +index cc76325b2..c64e7f2e4 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -4,6 +4,7 @@ import java.util.Collection; +@@ -4,6 +4,8 @@ import java.util.Collection; import java.util.HashSet; import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.antibot.AddressDataManager; ++import dev._2lstudios.flamecord.antibot.StatsData; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; -@@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; +@@ -27,9 +29,7 @@ private final BungeeCord bungeeCord; if (sender.hasPermission("flamecord.usage")) { if (args.length > 0) { @@ -1303,10 +1424,19 @@ index cc76325b2..1ddae60be 100644 case "reload": { // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); -@@ -43,9 +42,34 @@ private final BungeeCord bungeeCord; +@@ -43,9 +43,43 @@ private final BungeeCord bungeeCord; .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); break; } ++ case "stats": { ++ StatsData statsData = FlameCord.getInstance().getStatsData(); ++ int pings = statsData.getLastPings(); ++ int connections = statsData.getLastConnections(); ++ int addressCount = FlameCord.getInstance().getAddressDataManager().getAddresCount(); ++ ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", pings, connections, addressCount))); ++ break; ++ } + case "firewall": { + if (args.length > 2) { + String ip = "/" + args[2]; diff --git a/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch b/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch new file mode 100644 index 00000000..ff53520e --- /dev/null +++ b/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch @@ -0,0 +1,79 @@ +From c109df033824883c45ec038d327ab6de14094434 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 31 Dec 2022 14:44:10 -0300 +Subject: [PATCH] Disable fromLegacyText Links + + +diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +index 4371374a9..1df68c300 100644 +--- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java ++++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +@@ -47,7 +47,6 @@ public final class TextComponent extends BaseComponent + ArrayList components = new ArrayList<>(); + StringBuilder builder = new StringBuilder(); + TextComponent component = new TextComponent(); +- Matcher matcher = url.matcher( message ); + + for ( int i = 0; i < message.length(); i++ ) + { +@@ -128,29 +127,6 @@ public final class TextComponent extends BaseComponent + { + pos = message.length(); + } +- if ( matcher.region( i, pos ).find() ) +- { //Web link handling +- +- if ( builder.length() > 0 ) +- { +- TextComponent old = component; +- component = new TextComponent( old ); +- old.setText( builder.toString() ); +- builder = new StringBuilder(); +- components.add( old ); +- } +- +- TextComponent old = component; +- component = new TextComponent( old ); +- String urlString = message.substring( i, pos ); +- component.setText( urlString ); +- component.setClickEvent( new ClickEvent( ClickEvent.Action.OPEN_URL, +- urlString.startsWith( "http" ) ? urlString : "http://" + urlString ) ); +- components.add( component ); +- i += pos - i - 1; +- component = old; +- continue; +- } + builder.append( c ); + } + +diff --git a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java +index d212d76cb..4a2c9a885 100644 +--- a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java ++++ b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java +@@ -354,23 +354,6 @@ public class ComponentsTest + + Assert.assertEquals( "Aqua RedBold", BaseComponent.toPlainText( test1 ) ); + Assert.assertEquals( ChatColor.AQUA + "Aqua " + ChatColor.RED + ChatColor.BOLD + "RedBold", BaseComponent.toLegacyText( test1 ) ); +- +- BaseComponent[] test2 = TextComponent.fromLegacyText( "Text http://spigotmc.org " + ChatColor.GREEN + "google.com/test" ); +- +- Assert.assertEquals( "Text http://spigotmc.org google.com/test", BaseComponent.toPlainText( test2 ) ); +- //The extra ChatColor instances are sometimes inserted when not needed but it doesn't change the result +- Assert.assertEquals( ChatColor.WHITE + "Text " + ChatColor.WHITE + "http://spigotmc.org" + ChatColor.WHITE +- + " " + ChatColor.GREEN + "google.com/test" + ChatColor.GREEN, BaseComponent.toLegacyText( test2 ) ); +- +- ClickEvent url1 = test2[1].getClickEvent(); +- Assert.assertNotNull( url1 ); +- Assert.assertTrue( url1.getAction() == ClickEvent.Action.OPEN_URL ); +- Assert.assertEquals( "http://spigotmc.org", url1.getValue() ); +- +- ClickEvent url2 = test2[3].getClickEvent(); +- Assert.assertNotNull( url2 ); +- Assert.assertTrue( url2.getAction() == ClickEvent.Action.OPEN_URL ); +- Assert.assertEquals( "http://google.com/test", url2.getValue() ); + } + + @Test +-- +2.37.3.windows.1 + From 2edf50c31f23fc50e087765b084569f58d77be17 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 31 Dec 2022 19:52:14 -0300 Subject: [PATCH 351/499] 1.2.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 7b29a9c0..bb895ec4 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 89e0f61f0bc77492820083174e0544db59301d4a Mon Sep 17 00:00:00 2001 +From d65330b647b0194611473e90d945534898255a03 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..26883d2c0 100644 +index 8617cdc7a..b8b4084d4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..26883d2c0 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.2"; ++ return "1.2.3"; } public final void reloadMessages() From 2ad27b517702c4a35bf2f3a96234dbcefb36f8cf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 31 Dec 2022 19:59:58 -0300 Subject: [PATCH 352/499] Better Stats Message --- .../0029-Antibot-System.patch | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index acfc7cd7..ddb585b7 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 5c22787833121046061ec3b21c14c22b21e7c90f Mon Sep 17 00:00:00 2001 +From 2e5c61bc9884a58f740118c369aba5f00d4d739f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1001,16 +1001,20 @@ index 000000000..68cc4c217 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 000000000..2d60ec2b4 +index 000000000..28bfc2c37 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java -@@ -0,0 +1,59 @@ +@@ -0,0 +1,73 @@ +package dev._2lstudios.flamecord.antibot; + +public class StatsData { + // Time of the last second + private long lastSecond = System.currentTimeMillis(); + ++ // Total pings and connections ++ private int totalPings = 0; ++ private int totalConnections = 0; ++ + // Current second connections and pings + private int currentPings = 0; + private int currentConnections = 0; @@ -1038,10 +1042,12 @@ index 000000000..2d60ec2b4 + + public void addPing() { + currentPings++; ++ totalPings++; + } + + public void addConnection() { + currentConnections++; ++ totalConnections++; + } + + public int getCurrentPings() { @@ -1063,6 +1069,14 @@ index 000000000..2d60ec2b4 + resetData(); + return lastConnections; + } ++ ++ public int getTotalPings() { ++ return totalPings; ++ } ++ ++ public int getTotalConnections() { ++ return totalConnections; ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java index a1d23f74d..d42e3d75f 100644 @@ -1239,7 +1253,7 @@ index a1d23f74d..d42e3d75f 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 4f306660e..fdcd1544d 100644 +index 4f306660e..d0d8fc391 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -82,12 +82,27 @@ public class MessagesConfiguration extends FlameConfig { @@ -1255,7 +1269,7 @@ index 4f306660e..fdcd1544d 100644 + setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_stats", "&aFlameCord Antibot Stats\n &ePings: {0}\n &eConnections: {1}", configuration); ++ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); + // FlameCord end - Antibot System + // FlameCord @@ -1401,7 +1415,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..c64e7f2e4 100644 +index cc76325b2..d513d35bd 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,8 @@ import java.util.Collection; @@ -1424,17 +1438,19 @@ index cc76325b2..c64e7f2e4 100644 case "reload": { // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); -@@ -43,9 +43,43 @@ private final BungeeCord bungeeCord; +@@ -43,9 +43,45 @@ private final BungeeCord bungeeCord; .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); break; } + case "stats": { + StatsData statsData = FlameCord.getInstance().getStatsData(); -+ int pings = statsData.getLastPings(); -+ int connections = statsData.getLastConnections(); ++ int totalPings = statsData.getTotalPings(); ++ int totalConnections = statsData.getTotalConnections(); ++ int currentPings = statsData.getLastPings(); ++ int currentConnections = statsData.getLastConnections(); + int addressCount = FlameCord.getInstance().getAddressDataManager().getAddresCount(); + -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", pings, connections, addressCount))); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, currentPings, currentConnections, addressCount))); + break; + } + case "firewall": { From 637ee46da27ba4211022124c2895a935f432ad3b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 31 Dec 2022 21:36:55 -0300 Subject: [PATCH 353/499] Fix Data Not Working --- .../0029-Antibot-System.patch | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index ddb585b7..c46b9d29 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 2e5c61bc9884a58f740118c369aba5f00d4d739f Mon Sep 17 00:00:00 2001 +From 5565c5cccbc4421eed0422dff9e497a8fbf37be1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -568,7 +568,7 @@ index 000000000..682e1c314 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 000000000..bbd84ce5c +index 000000000..df26a3634 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,28 @@ @@ -591,7 +591,7 @@ index 000000000..bbd84ce5c + long currentTime = System.currentTimeMillis(); + + // Throttle logs by 100ms -+ if (lastLog - currentTime > 100) { ++ if (currentTime - lastLog > 100) { + // Set the last log + lastLog = currentTime; + @@ -1001,10 +1001,10 @@ index 000000000..68cc4c217 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 000000000..28bfc2c37 +index 000000000..44d773abe --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java -@@ -0,0 +1,73 @@ +@@ -0,0 +1,75 @@ +package dev._2lstudios.flamecord.antibot; + +public class StatsData { @@ -1028,7 +1028,7 @@ index 000000000..28bfc2c37 + long currentTime = System.currentTimeMillis(); + + // Check if one second passed -+ if (lastSecond - currentTime > 1000) { ++ if (currentTime - lastSecond > 1000) { + // Set the last second to this one + lastSecond = currentTime; + @@ -1041,11 +1041,13 @@ index 000000000..28bfc2c37 + } + + public void addPing() { ++ resetData(); + currentPings++; + totalPings++; + } + + public void addConnection() { ++ resetData(); + currentConnections++; + totalConnections++; + } @@ -1415,7 +1417,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..d513d35bd 100644 +index cc76325b2..d739fc5c5 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,8 @@ import java.util.Collection; @@ -1446,11 +1448,11 @@ index cc76325b2..d513d35bd 100644 + StatsData statsData = FlameCord.getInstance().getStatsData(); + int totalPings = statsData.getTotalPings(); + int totalConnections = statsData.getTotalConnections(); -+ int currentPings = statsData.getLastPings(); -+ int currentConnections = statsData.getLastConnections(); ++ int lastPings = statsData.getLastPings(); ++ int lastConnections = statsData.getLastConnections(); + int addressCount = FlameCord.getInstance().getAddressDataManager().getAddresCount(); + -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, currentPings, currentConnections, addressCount))); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, lastPings, lastConnections))); + break; + } + case "firewall": { From c612a1d8da833e2c8cf9559595f1d258dc653fcf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 1 Jan 2023 13:49:49 -0300 Subject: [PATCH 354/499] Fixed FlameCord Firewall Command --- .../0029-Antibot-System.patch | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index c46b9d29..17e43df0 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 5565c5cccbc4421eed0422dff9e497a8fbf37be1 Mon Sep 17 00:00:00 2001 +From 7ba98a5d071a376c8ce5d5afeaa64acf7002c914 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -297,7 +297,7 @@ index 000000000..c3ccae2b6 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..9f74116b3 +index 000000000..98d6a457e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,35 @@ @@ -318,7 +318,7 @@ index 000000000..9f74116b3 + return addressData.get(addressString); + } else { + AddressData data = new AddressData(addressString); -+ ++ + addressData.put(addressString, data); + + return data; @@ -1417,19 +1417,18 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..d739fc5c5 100644 +index cc76325b2..05cf5b953 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -4,6 +4,8 @@ import java.util.Collection; +@@ -4,6 +4,7 @@ import java.util.Collection; import java.util.HashSet; import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.antibot.AddressDataManager; +import dev._2lstudios.flamecord.antibot.StatsData; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; -@@ -27,9 +29,7 @@ private final BungeeCord bungeeCord; +@@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; if (sender.hasPermission("flamecord.usage")) { if (args.length > 0) { @@ -1440,7 +1439,7 @@ index cc76325b2..d739fc5c5 100644 case "reload": { // FlameCord - Collect ips from servers final Collection whitelistedAddresses = new HashSet<>(); -@@ -43,9 +43,45 @@ private final BungeeCord bungeeCord; +@@ -43,9 +42,44 @@ private final BungeeCord bungeeCord; .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); break; } @@ -1450,14 +1449,13 @@ index cc76325b2..d739fc5c5 100644 + int totalConnections = statsData.getTotalConnections(); + int lastPings = statsData.getLastPings(); + int lastConnections = statsData.getLastConnections(); -+ int addressCount = FlameCord.getInstance().getAddressDataManager().getAddresCount(); -+ ++ + sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, lastPings, lastConnections))); + break; + } + case "firewall": { + if (args.length > 2) { -+ String ip = "/" + args[2]; ++ String ip = args[2]; + + switch (args[1]) { + case "add": { @@ -1489,7 +1487,7 @@ index cc76325b2..d739fc5c5 100644 } } 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 c00ab4b6a..bbf9c3dba 100644 +index c00ab4b6a..86021b71b 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; @@ -1526,7 +1524,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is pinging too fast", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is pinging too fast", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); @@ -1548,7 +1546,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is connecting too fast", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is connecting too fast", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); @@ -1574,7 +1572,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has too many accounts", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has too many accounts", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); @@ -1585,7 +1583,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); @@ -1596,7 +1594,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotReconnectLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has to reconnect to join", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has to reconnect to join", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); @@ -1607,7 +1605,7 @@ index c00ab4b6a..bbf9c3dba 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotCountryLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has his country blocked from the server", ch.getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has his country blocked from the server", ch.getRemoteAddress() ); + } + + disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); @@ -1619,7 +1617,7 @@ index c00ab4b6a..bbf9c3dba 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4e..289cce0c3 100644 +index 66332af4e..667364aea 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,11 +4,16 @@ import com.google.common.base.Preconditions; @@ -1650,7 +1648,7 @@ index 66332af4e..289cce0c3 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFastChatLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] is chatting too fast", con.getCh().getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is chatting too fast", con.getCh().getRemoteAddress() ); + } + + con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); @@ -1661,7 +1659,7 @@ index 66332af4e..289cce0c3 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotPasswordLog() ) + { -+ bungee.getLogger().log( Level.INFO, "[FlameCord] [{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); + } + + con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); @@ -1705,7 +1703,7 @@ index e2911d5e4..1e3608fa4 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..abca28bd7 100644 +index 14e3004fc..3fce5ff11 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1726,7 +1724,7 @@ index 14e3004fc..abca28bd7 100644 + if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + @@ -1734,7 +1732,7 @@ index 14e3004fc..abca28bd7 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea15992..4bb8eb460 100644 +index ffea15992..f04fdd9ce 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 @@ -59,6 +59,20 @@ public class PipelineUtils @@ -1747,7 +1745,7 @@ index ffea15992..4bb8eb460 100644 + { + if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) + { -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); + } + + ch.close(); From 43bf85782d41895354cea6872aaff919411f599b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 1 Jan 2023 14:00:31 -0300 Subject: [PATCH 355/499] Fix Packets Check Not Disabling --- .../0029-Antibot-System.patch | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 17e43df0..a119eb8f 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 7ba98a5d071a376c8ce5d5afeaa64acf7002c914 Mon Sep 17 00:00:00 2001 +From 63125008207fddc4f0dd92c69f872d013595ce86 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -653,10 +653,10 @@ index 000000000..165963629 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 000000000..199da2920 +index 000000000..a7bd9f153 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java -@@ -0,0 +1,62 @@ +@@ -0,0 +1,69 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -672,20 +672,22 @@ index 000000000..199da2920 + +public class PacketsCheck { + private Map packetsData = new HashMap<>(); -+ private long lastCalculation = System.currentTimeMillis(); ++ ++ // Time since the last clear passed ++ private long lastClear = System.currentTimeMillis(); + + public PacketsData getData(SocketAddress address) { + String ip = address.toString(); + -+ if (System.currentTimeMillis() - lastCalculation >= 60000) { ++ if (System.currentTimeMillis() - lastClear >= 60000) { + packetsData.clear(); -+ this.lastCalculation = System.currentTimeMillis(); ++ this.lastClear = System.currentTimeMillis(); + } + + PacketsData data; + + if (packetsData.containsKey(ip)) { -+ data = packetsData.get(ip); ++ data = packetsData.get(ip); + } else { + data = new PacketsData(address); + packetsData.put(ip, data); @@ -695,17 +697,22 @@ index 000000000..199da2920 + } + + public PacketsCheckResult check(SocketAddress socketAddress, ByteBuf byteBuf) { -+ PacketsData addressData = getData(socketAddress); + FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (!config.isAntibotPacketsEnabled()) { ++ return PacketsCheckResult.NONE; ++ } ++ ++ PacketsData packetsData = getData(socketAddress); + int length = byteBuf.readableBytes(); + int index = byteBuf.readerIndex(); + int packetId = ProtocolUtil.readVarInt(byteBuf); + byteBuf.readerIndex(index); + -+ addressData.addVls(length * config.getAntibotPacketsVlsPerByte(), PacketsViolationReason.SIZE, packetId); -+ addressData.addVls(config.getAntibotPacketsVlsPerPacket(), PacketsViolationReason.RATE, packetId); ++ packetsData.addVls(length * config.getAntibotPacketsVlsPerByte(), PacketsViolationReason.SIZE, packetId); ++ packetsData.addVls(config.getAntibotPacketsVlsPerPacket(), PacketsViolationReason.RATE, packetId); + -+ double vls = addressData.getPacketsVls(); ++ double vls = packetsData.getPacketsVls(); + + if (vls >= config.getAntibotPacketsVlsToKick()) { + return PacketsCheckResult.KICK; From 239dfa3e844f7bf9ed2cee6cd63d603e2941762f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 1 Jan 2023 18:18:52 -0300 Subject: [PATCH 356/499] Properly Handle Nicknames & Addresses --- .../0029-Antibot-System.patch | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index a119eb8f..e962fd2f 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 63125008207fddc4f0dd92c69f872d013595ce86 Mon Sep 17 00:00:00 2001 +From c8088b0ac08cde56846bb6aa11a841c2f6c99a91 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -129,7 +129,7 @@ index 000000000..5e7fa6bfb +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..c3ccae2b6 +index 000000000..a4e754f7e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,162 @@ @@ -146,7 +146,7 @@ index 000000000..c3ccae2b6 + private StatsData statsData; + private Collection nicknames = null; + private final String hostString; -+ private String lastNickname = null; ++ private String lastNickname = ""; + private String country = null; + private String firewallReason = null; + private long lastPing = 0; @@ -177,7 +177,7 @@ index 000000000..c3ccae2b6 + public void addNickname(final String nickname) { + if (nicknames == null) nicknames = new HashSet<>(); + -+ if (lastNickname == null || !lastNickname.equals(nickname)) { ++ if (!lastNickname.equals(nickname)) { + this.lastNickname = nickname; + this.totalConnections = 1; + } @@ -297,10 +297,10 @@ index 000000000..c3ccae2b6 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..98d6a457e +index 000000000..bd14f56a1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java -@@ -0,0 +1,35 @@ +@@ -0,0 +1,48 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.InetSocketAddress; @@ -309,18 +309,31 @@ index 000000000..98d6a457e +import java.util.Map; + +public class AddressDataManager { -+ private final Map addressData = new HashMap<>(); ++ private Map addressData = new HashMap<>(); ++ ++ public String sanitizeAddress(String text) { ++ // Remove the port ++ text = text.split(":")[0]; ++ ++ // Check if first character is a slash ++ if (text.startsWith("/")) { ++ // Remove the first character ++ text = text.substring(1); ++ } ++ ++ return text; ++ } + + public AddressData getAddressData(String addressString) { -+ addressString = addressString.split(":")[0]; ++ addressString = sanitizeAddress(addressString); + + if (addressData.containsKey(addressString)) { + return addressData.get(addressString); + } else { + AddressData data = new AddressData(addressString); -+ ++ + addressData.put(addressString, data); -+ ++ + return data; + } + } @@ -328,7 +341,7 @@ index 000000000..98d6a457e + public AddressData getAddressData(final SocketAddress address) { + final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; + final String addressString = iNetSocketAddress.getHostString(); -+ ++ + return getAddressData(addressString); + } + From 62764b4ab9f4aec376e5ab682af70a6d5af44204 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 1 Jan 2023 18:24:23 -0300 Subject: [PATCH 357/499] 1.2.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index bb895ec4..b7829449 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 8617cdc7a..b8b4084d4 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.3"; ++ return "1.2.4"; } public final void reloadMessages() From a47851543f6e689bad903e39ab0945c63690ea50 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:55 -0300 Subject: [PATCH 358/499] Dont Process Links For Kick Messages --- .../0037-Disable-fromLegacyText-Links.patch | 79 ----------- ...Dont-Process-Links-For-Kick-Messages.patch | 132 ++++++++++++++++++ 2 files changed, 132 insertions(+), 79 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch create mode 100644 Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch diff --git a/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch b/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch deleted file mode 100644 index ff53520e..00000000 --- a/Waterfall-Proxy-Patches/0037-Disable-fromLegacyText-Links.patch +++ /dev/null @@ -1,79 +0,0 @@ -From c109df033824883c45ec038d327ab6de14094434 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sat, 31 Dec 2022 14:44:10 -0300 -Subject: [PATCH] Disable fromLegacyText Links - - -diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a9..1df68c300 100644 ---- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -+++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -@@ -47,7 +47,6 @@ public final class TextComponent extends BaseComponent - ArrayList components = new ArrayList<>(); - StringBuilder builder = new StringBuilder(); - TextComponent component = new TextComponent(); -- Matcher matcher = url.matcher( message ); - - for ( int i = 0; i < message.length(); i++ ) - { -@@ -128,29 +127,6 @@ public final class TextComponent extends BaseComponent - { - pos = message.length(); - } -- if ( matcher.region( i, pos ).find() ) -- { //Web link handling -- -- if ( builder.length() > 0 ) -- { -- TextComponent old = component; -- component = new TextComponent( old ); -- old.setText( builder.toString() ); -- builder = new StringBuilder(); -- components.add( old ); -- } -- -- TextComponent old = component; -- component = new TextComponent( old ); -- String urlString = message.substring( i, pos ); -- component.setText( urlString ); -- component.setClickEvent( new ClickEvent( ClickEvent.Action.OPEN_URL, -- urlString.startsWith( "http" ) ? urlString : "http://" + urlString ) ); -- components.add( component ); -- i += pos - i - 1; -- component = old; -- continue; -- } - builder.append( c ); - } - -diff --git a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java -index d212d76cb..4a2c9a885 100644 ---- a/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java -+++ b/chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java -@@ -354,23 +354,6 @@ public class ComponentsTest - - Assert.assertEquals( "Aqua RedBold", BaseComponent.toPlainText( test1 ) ); - Assert.assertEquals( ChatColor.AQUA + "Aqua " + ChatColor.RED + ChatColor.BOLD + "RedBold", BaseComponent.toLegacyText( test1 ) ); -- -- BaseComponent[] test2 = TextComponent.fromLegacyText( "Text http://spigotmc.org " + ChatColor.GREEN + "google.com/test" ); -- -- Assert.assertEquals( "Text http://spigotmc.org google.com/test", BaseComponent.toPlainText( test2 ) ); -- //The extra ChatColor instances are sometimes inserted when not needed but it doesn't change the result -- Assert.assertEquals( ChatColor.WHITE + "Text " + ChatColor.WHITE + "http://spigotmc.org" + ChatColor.WHITE -- + " " + ChatColor.GREEN + "google.com/test" + ChatColor.GREEN, BaseComponent.toLegacyText( test2 ) ); -- -- ClickEvent url1 = test2[1].getClickEvent(); -- Assert.assertNotNull( url1 ); -- Assert.assertTrue( url1.getAction() == ClickEvent.Action.OPEN_URL ); -- Assert.assertEquals( "http://spigotmc.org", url1.getValue() ); -- -- ClickEvent url2 = test2[3].getClickEvent(); -- Assert.assertNotNull( url2 ); -- Assert.assertTrue( url2.getAction() == ClickEvent.Action.OPEN_URL ); -- Assert.assertEquals( "http://google.com/test", url2.getValue() ); - } - - @Test --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch new file mode 100644 index 00000000..6e5ab2b5 --- /dev/null +++ b/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch @@ -0,0 +1,132 @@ +From 1fb283c83e68a1f4450cd6e09848e71f62197a20 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 10 Jan 2023 16:37:13 -0300 +Subject: [PATCH] Dont Process Links For Kick Messages + + +diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +index 4371374a9..2b2918051 100644 +--- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java ++++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +@@ -160,6 +160,105 @@ public final class TextComponent extends BaseComponent + return components.toArray( new BaseComponent[ 0 ] ); + } + ++ public static BaseComponent[] fromLegacyTextFast(String message) ++ { ++ return fromLegacyTextFast( message, ChatColor.WHITE ); ++ } ++ ++ public static BaseComponent[] fromLegacyTextFast(String message, ChatColor defaultColor) ++ { ++ ArrayList components = new ArrayList<>(); ++ StringBuilder builder = new StringBuilder(); ++ TextComponent component = new TextComponent(); ++ ++ for ( int i = 0; i < message.length(); i++ ) ++ { ++ char c = message.charAt( i ); ++ if ( c == ChatColor.COLOR_CHAR ) ++ { ++ if ( ++i >= message.length() ) ++ { ++ break; ++ } ++ c = message.charAt( i ); ++ if ( c >= 'A' && c <= 'Z' ) ++ { ++ c += 32; ++ } ++ ChatColor format; ++ if ( c == 'x' && i + 12 < message.length() ) ++ { ++ StringBuilder hex = new StringBuilder( "#" ); ++ for ( int j = 0; j < 6; j++ ) ++ { ++ hex.append( message.charAt( i + 2 + ( j * 2 ) ) ); ++ } ++ try ++ { ++ format = ChatColor.of( hex.toString() ); ++ } catch ( IllegalArgumentException ex ) ++ { ++ format = null; ++ } ++ ++ i += 12; ++ } else ++ { ++ format = ChatColor.getByChar( c ); ++ } ++ if ( format == null ) ++ { ++ continue; ++ } ++ if ( builder.length() > 0 ) ++ { ++ TextComponent old = component; ++ component = new TextComponent( old ); ++ old.setText( builder.toString() ); ++ builder = new StringBuilder(); ++ components.add( old ); ++ } ++ if ( format == ChatColor.BOLD ) ++ { ++ component.setBold( true ); ++ } else if ( format == ChatColor.ITALIC ) ++ { ++ component.setItalic( true ); ++ } else if ( format == ChatColor.UNDERLINE ) ++ { ++ component.setUnderlined( true ); ++ } else if ( format == ChatColor.STRIKETHROUGH ) ++ { ++ component.setStrikethrough( true ); ++ } else if ( format == ChatColor.MAGIC ) ++ { ++ component.setObfuscated( true ); ++ } else ++ { ++ if ( format == ChatColor.RESET ) ++ { ++ format = defaultColor; ++ } ++ component = new TextComponent(); ++ component.setColor( format ); ++ component.setReset( true ); ++ } ++ continue; ++ } ++ int pos = message.indexOf( ' ', i ); ++ if ( pos == -1 ) ++ { ++ pos = message.length(); ++ } ++ builder.append( c ); ++ } ++ ++ component.setText( builder.toString() ); ++ components.add( component ); ++ ++ return components.toArray( new BaseComponent[ 0 ] ); ++ } ++ + /** + * The text of the component that will be displayed to the client + */ +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 c2733d6e3..f83715cf4 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 +@@ -846,7 +846,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( canSendKickMessage() ) + { +- disconnect( TextComponent.fromLegacyText( reason ) ); ++ disconnect( TextComponent.fromLegacyTextFast( reason ) ); + } else + { + ch.close(); +-- +2.37.3.windows.1 + From 5fa16dc9791b00b84fe134ef30e036b63a860c74 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:41:13 -0300 Subject: [PATCH 359/499] Add comments to latest patch --- ...0037-Dont-Process-Links-For-Kick-Messages.patch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch index 6e5ab2b5..829fe780 100644 --- a/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch @@ -1,22 +1,23 @@ -From 1fb283c83e68a1f4450cd6e09848e71f62197a20 Mon Sep 17 00:00:00 2001 +From 2d29fee2a16ea7e57cec199acf6930a9e3880e90 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a9..2b2918051 100644 +index 4371374a9..2bb27e670 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -@@ -160,6 +160,105 @@ public final class TextComponent extends BaseComponent +@@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent return components.toArray( new BaseComponent[ 0 ] ); } ++ // FlameCord start - Dont Process Links For Kick Messages + public static BaseComponent[] fromLegacyTextFast(String message) + { + return fromLegacyTextFast( message, ChatColor.WHITE ); + } -+ ++ + public static BaseComponent[] fromLegacyTextFast(String message, ChatColor defaultColor) + { + ArrayList components = new ArrayList<>(); @@ -110,12 +111,13 @@ index 4371374a9..2b2918051 100644 + + return components.toArray( new BaseComponent[ 0 ] ); + } ++ // FlameCord end - Dont Process Links For Kick Messages + /** * The text of the component that will be displayed to the client */ 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 c2733d6e3..f83715cf4 100644 +index c2733d6e3..69b260b93 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 @@ -846,7 +846,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -123,7 +125,7 @@ index c2733d6e3..f83715cf4 100644 if ( canSendKickMessage() ) { - disconnect( TextComponent.fromLegacyText( reason ) ); -+ disconnect( TextComponent.fromLegacyTextFast( reason ) ); ++ disconnect( TextComponent.fromLegacyTextFast( reason ) ); // FlameCord - Dont Process Links For Kick Messages } else { ch.close(); From 6196b27464172fbc28218cec02efbdb2bc5db3f2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:45:16 -0300 Subject: [PATCH 360/499] Fixed RedisBungee Replacements --- .../0019-FlameCord-module-system.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index a9c2cd35..57f8496e 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 598c8a3786b32bb1128ac3ab1ae1bfea6909f2cb Mon Sep 17 00:00:00 2001 +From 4df365428e2d873bb158be4b5800be554803cb8a Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -87,7 +87,7 @@ index 000000000..6c5bb9617 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8861da39d..88ac66bab 100644 +index 447cbae7c..9489659a2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -126,14 +126,14 @@ index 8861da39d..88ac66bab 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -323,6 +333,7 @@ public class BungeeCord extends ProxyServer - connectionThrottle = new ConnectionThrottle( config.getThrottle(), config.getThrottleLimit() ); - } - startListeners(); +@@ -316,6 +326,7 @@ public class BungeeCord extends ProxyServer + + isRunning = true; + + loadModules(); + pluginManager.enablePlugins(); - saveThread.scheduleAtFixedRate( new TimerTask() - { + if ( config.getThrottle() > 0 ) @@ -854,4 +865,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); From 4c8385ef73d135468f24dc61b0c106333f3b973f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 18:02:44 -0300 Subject: [PATCH 361/499] 1.2.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b7829449..52321b8c 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From d65330b647b0194611473e90d945534898255a03 Mon Sep 17 00:00:00 2001 +From 4cbf852666fc0337b93f92c5ad2c30a2ccdc2ae7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..b8b4084d4 100644 +index 8617cdc7a..764c271bf 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..b8b4084d4 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.4"; ++ return "1.2.5"; } public final void reloadMessages() From 3b4c000ddb685638e38dd469cf35d3df184b32ed Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:18:38 -0300 Subject: [PATCH 362/499] Bungee Plugins Command --- .../0038-Bungee-Plugins-Command.patch | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch diff --git a/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch new file mode 100644 index 00000000..c39712a7 --- /dev/null +++ b/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch @@ -0,0 +1,97 @@ +From ab055556001fcc9e5278a383ff187e05499937ba Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 11 Jan 2023 10:14:12 -0300 +Subject: [PATCH] Bungee Plugins Command + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index 2ecbf29d5..3d4fede4f 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -95,6 +95,11 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); + // FlameCord end - Antibot System + ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); ++ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); ++ + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java +new file mode 100644 +index 000000000..2e20e9dca +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java +@@ -0,0 +1,45 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import java.util.Collection; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.plugin.Command; ++import net.md_5.bungee.api.plugin.Plugin; ++ ++public class BungeePluginsCommand extends Command { ++ public BungeePluginsCommand() { ++ super("bplugins"); ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); ++ ++ if (sender.hasPermission("flamecord.usage")) { ++ Collection plugins = BungeeCord.getInstance().getPluginManager().getPlugins(); ++ int amount = plugins.size(); ++ String header = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_header", amount); ++ String separator = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_separator"); ++ StringBuilder stringBuilder = new StringBuilder(header); ++ boolean first = true; ++ ++ for (Plugin plugin : plugins) { ++ stringBuilder.append((first ? "" : separator) + plugin.getDescription().getName()); ++ ++ if (first) { ++ first = false; ++ } ++ } ++ ++ sender.sendMessage(TextComponent.fromLegacyText(stringBuilder.toString())); ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bplugins_nopermission"))); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 8edaa3026..e09e32c94 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -11,6 +11,7 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.BungeePluginsCommand; + import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +@@ -913,5 +914,8 @@ public class BungeeCord extends ProxyServer + + // Flamecord - Commands (Had to make it like this because of maven limitations) + pluginManager.registerCommand(null, new FlameCordCommand(this)); ++ ++ // FlameCord - Bungee Plugins Command ++ pluginManager.registerCommand(null, new BungeePluginsCommand()); + } + } +-- +2.37.3.windows.1 + From e1f9da41ce78c7adaf85c48abb3cd342138716bf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:13:23 -0300 Subject: [PATCH 363/499] Bungee IP Command --- .../0039-Bungee-IP-Command.patch | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch diff --git a/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch new file mode 100644 index 00000000..051da8d1 --- /dev/null +++ b/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch @@ -0,0 +1,98 @@ +From 97e6fb1e2fcdb45f9bd000c29a87e3cd5fea9cc6 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 15 Jan 2023 10:12:45 -0300 +Subject: [PATCH] Bungee IP Command + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index 3d4fede4f..2b9e7f5b9 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -100,6 +100,12 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); + setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); + ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); ++ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); ++ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); ++ + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java +new file mode 100644 +index 000000000..85313491e +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java +@@ -0,0 +1,45 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.connection.ProxiedPlayer; ++import net.md_5.bungee.api.plugin.Command; ++ ++public class BungeeIPCommand extends Command { ++ public BungeeIPCommand() { ++ super("bip"); ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); ++ ++ if (sender.hasPermission("flamecord.bip")) { ++ if (args.length > 0) { ++ ProxiedPlayer player = BungeeCord.getInstance().getPlayer(args[0]); ++ ++ if (player != null) { ++ String message = messagesConfiguration.getTranslation("flamecord_bip", player.getDisplayName(), ++ player.getUniqueId(), player.getSocketAddress(), player.getPing(), player.getLocale(), ++ player.getViewDistance(), player.getServer().getInfo().getName()); ++ ++ sender.sendMessage(TextComponent.fromLegacyText(message)); ++ } else { ++ sender.sendMessage( ++ TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_offline"))); ++ } ++ } else { ++ sender.sendMessage( ++ TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_usage"))); ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_nopermission"))); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index e09e32c94..4e75d5a22 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -11,6 +11,7 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.BungeeIPCommand; + import dev._2lstudios.flamecord.commands.BungeePluginsCommand; + import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +@@ -917,5 +918,8 @@ public class BungeeCord extends ProxyServer + + // FlameCord - Bungee Plugins Command + pluginManager.registerCommand(null, new BungeePluginsCommand()); ++ ++ // FlameCord - Bungee IP Command ++ pluginManager.registerCommand(null, new BungeeIPCommand()); + } + } +-- +2.37.3.windows.1 + From a62af547b823520d802fb16db2f68438bd33c5af Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:53:10 -0300 Subject: [PATCH 364/499] Config to Whitelist IPs --- .../0029-Antibot-System.patch | 18 ++++++++++++------ .../0030-Allow-Invalid-Names.patch | 8 ++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index e962fd2f..5558cf58 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From c8088b0ac08cde56846bb6aa11a841c2f6c99a91 Mon Sep 17 00:00:00 2001 +From 9467398af7f325e2d0188efa4981b2240c70a507 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -129,7 +129,7 @@ index 000000000..5e7fa6bfb +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..a4e754f7e +index 000000000..e8c80ad08 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,162 @@ @@ -260,7 +260,7 @@ index 000000000..a4e754f7e + } + + public void firewall(String reason) { -+ if (!hostString.equals("127.0.0.1")) { ++ if (!FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewallWhitelist().contains(hostString)) { + this.lastFirewall = System.currentTimeMillis(); + this.firewallReason = reason; + } @@ -1101,10 +1101,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a1d23f74d..d42e3d75f 100644 +index a1d23f74d..8b8b4915a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,160 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,166 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1135,6 +1135,8 @@ index a1d23f74d..d42e3d75f 100644 + private int antibotFastChatTime = 1000; + @Getter + private boolean antibotFastChatLog = true; ++ ++ // Antibot firewall + @Getter + private boolean antibotFirewallEnabled = true; + @Getter @@ -1142,6 +1144,9 @@ index a1d23f74d..d42e3d75f 100644 + @Getter + private boolean antibotFirewallLog = true; + @Getter ++ private Collection antibotFirewallWhitelist = Arrays.asList("127.0.0.1"); ++ ++ @Getter + private boolean antibotNicknameEnabled = true; + @Getter + private boolean antibotNicknameFirewall = true; @@ -1222,6 +1227,7 @@ index a1d23f74d..d42e3d75f 100644 + this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); ++ this.antibotFirewallWhitelist = setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config); + + // Antibot nickname + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); @@ -1265,7 +1271,7 @@ index a1d23f74d..d42e3d75f 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +271,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -117,6 +277,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index b0816fd6..5b1a0a12 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 6872a064715964bac98a97bf498b00b98244b8b8 Mon Sep 17 00:00:00 2001 +From 9b2f04b355233c50456f0a9bca394ebbcd56520e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 367c25d19..544ad091b 100644 +index 8b8b4915a..655cf32b2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 367c25d19..544ad091b 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -271,6 +275,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -277,6 +281,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -29,7 +29,7 @@ index 367c25d19..544ad091b 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 bbf9c3dba..952b2a363 100644 +index 86021b71b..c2733d6e3 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 @@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection From a9e49551a0ee9d9e6cde21590dcdd6c2a9c1285a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 11:07:46 -0300 Subject: [PATCH 365/499] Hex Colored MOTD --- .../0026-Custom-motd-system.patch | 56 ++++++++++++++++--- .../0027-TCP-Fast-Open.patch | 12 ++-- .../0029-Antibot-System.patch | 16 +++--- .../0030-Allow-Invalid-Names.patch | 8 +-- 4 files changed, 66 insertions(+), 26 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 99aadcf1..97aa3d81 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,9 +1,39 @@ -From 617ad8e4f511a78c2151d9f92e06c34bd3f3b680 Mon Sep 17 00:00:00 2001 +From 6789f1f803c62e12933cd749edff6d93fd294ba8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +index 20edd9001..d1e8291e2 100644 +--- a/flamecord/pom.xml ++++ b/flamecord/pom.xml +@@ -17,6 +17,13 @@ + Waterfall-FlameCord + FlameCord adds security essentials and new configuration options + ++ ++ ++ iridiumdevelopment ++ https://nexus.iridiumdevelopment.net/repository/maven-releases/ ++ ++ ++ + + + io.github.waterfallmc +@@ -30,6 +37,11 @@ + ${project.version} + compile + ++ ++ com.iridium ++ IridiumColorAPI ++ LATEST ++ + + + diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java index 5589ce1b7..1e928197c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -20,10 +50,10 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aac41c8b2..7937af051 100644 +index aac41c8b2..d902feeba 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,80 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,90 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -33,6 +63,8 @@ index aac41c8b2..7937af051 100644 import java.util.HashSet; +import java.util.List; +import java.util.Random; ++ ++import com.iridium.iridiumcolorapi.IridiumColorAPI; import lombok.Getter; +import net.md_5.bungee.api.ChatColor; @@ -40,9 +72,17 @@ index aac41c8b2..7937af051 100644 import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { -+ private List colors(final List strings) { ++ private List color(final List strings) { + for (int i = 0; i < strings.size(); i++) { -+ strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); ++ String text = strings.get(i); ++ ++ if (text != null) { ++ String coloredText = ChatColor.translateAlternateColorCodes('&', text); ++ ++ if (coloredText != null) { ++ strings.set(i, IridiumColorAPI.process(coloredText)); ++ } ++ } + } + + return strings; @@ -104,14 +144,14 @@ index aac41c8b2..7937af051 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +101,19 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +111,19 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } + this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.motds = colors(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); ++ this.motds = color(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); + this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.samples = colors(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); ++ this.samples = color(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); + this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); + this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); + this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index d221ee72..a3ffb5fa 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,14 +1,14 @@ -From 7001800c9141f42b15bd9adee24319f1837a8183 Mon Sep 17 00:00:00 2001 +From dde3fd93db29113d7f296b0c05df86080336b3b1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 7937af051..a1d23f74d 100644 +index d902feeba..1fd11f501 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; +@@ -18,6 +18,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -16,10 +16,10 @@ index 7937af051..a1d23f74d 100644 + @Getter + private int tcpFastOpen = 3; + - private List colors(final List strings) { + private List color(final List strings) { for (int i = 0; i < strings.size(); i++) { - strings.set(i, ChatColor.translateAlternateColorCodes('&', strings.get(i))); -@@ -113,6 +117,7 @@ public class FlameCordConfiguration extends FlameConfig { + String text = strings.get(i); +@@ -123,6 +127,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 5558cf58..ee6b2bab 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,16 +1,16 @@ -From 9467398af7f325e2d0188efa4981b2240c70a507 Mon Sep 17 00:00:00 2001 +From 5f58554e02332e3985f19083f90c7e548a27d90f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..f48f1e60b 100644 +index d1e8291e2..0085c7398 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml -@@ -30,6 +30,17 @@ - ${project.version} - compile +@@ -42,6 +42,17 @@ + IridiumColorAPI + LATEST + + com.maxmind.db @@ -1101,10 +1101,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a1d23f74d..8b8b4915a 100644 +index 1fd11f501..8cfb197e8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,166 @@ import net.md_5.bungee.config.Configuration; +@@ -18,6 +18,166 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1271,7 +1271,7 @@ index a1d23f74d..8b8b4915a 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -117,6 +277,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +287,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 5b1a0a12..a6a6e7ee 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From 9b2f04b355233c50456f0a9bca394ebbcd56520e Mon Sep 17 00:00:00 2001 +From f93a1b115b200c18866a60acab830073caa3a3a8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8b8b4915a..655cf32b2 100644 +index 8cfb197e8..7c534400c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; +@@ -18,6 +18,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index 8b8b4915a..655cf32b2 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -277,6 +281,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -287,6 +291,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); From 6cc983ea547081546fa777235c045af9f4b42013 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 11:15:21 -0300 Subject: [PATCH 366/499] Custom MOTD Hex Color Support (IridiumAPI) --- Waterfall-Proxy-Patches/0026-Custom-motd-system.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 97aa3d81..f77fc766 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 6789f1f803c62e12933cd749edff6d93fd294ba8 Mon Sep 17 00:00:00 2001 +From 08d4b15bc1b46c26b895563b19d9e2b3991bff5e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -50,7 +50,7 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aac41c8b2..d902feeba 100644 +index aac41c8b2..3c2129d28 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,90 @@ package dev._2lstudios.flamecord.configuration; @@ -116,17 +116,17 @@ index aac41c8b2..d902feeba 100644 + @Getter + private boolean motdEnabled = false; + @Getter -+ private List motds = Collections.singletonList("&eDefault &cFlameCord&e custom motd!\n&eChange me in &cflamecord.yml&e file!"); ++ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server\n&eEdit this on &cflamecord.yml&e file &7(IridiumColorAPI HEX Support)"); + + @Getter + private boolean sampleEnabled = false; + @Getter -+ private List samples = Collections.singletonList("&eDefault &cFlameCord&e sample!\n&eChange me in &cflamecord.yml&e file!"); ++ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server\n&eEdit this on &cflamecord.yml&e file &7(IridiumColorAPI HEX Support)"); + + @Getter + private boolean protocolEnabled = false; + @Getter -+ private String protocolName = "FlameCord 1.7-1.18"; ++ private String protocolName = "FlameCord 1.7-1.19"; + + @Getter + private boolean maxPlayersEnabled = false; From 2737ae35ab527df2ddd650b152a2d3ab80a35094 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 12:17:48 -0300 Subject: [PATCH 367/499] HEX: Nearest Color For Old Versions --- .../0026-Custom-motd-system.patch | 550 ++++++++++++++++-- .../0027-TCP-Fast-Open.patch | 14 +- .../0029-Antibot-System.patch | 18 +- .../0030-Allow-Invalid-Names.patch | 10 +- 4 files changed, 507 insertions(+), 85 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index f77fc766..dd06bf2b 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,39 +1,9 @@ -From 08d4b15bc1b46c26b895563b19d9e2b3991bff5e Mon Sep 17 00:00:00 2001 +From 2deed84f7aa7722cb648f94f46df605ce33ee912 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system -diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..d1e8291e2 100644 ---- a/flamecord/pom.xml -+++ b/flamecord/pom.xml -@@ -17,6 +17,13 @@ - Waterfall-FlameCord - FlameCord adds security essentials and new configuration options - -+ -+ -+ iridiumdevelopment -+ https://nexus.iridiumdevelopment.net/repository/maven-releases/ -+ -+ -+ - - - io.github.waterfallmc -@@ -30,6 +37,11 @@ - ${project.version} - compile - -+ -+ com.iridium -+ IridiumColorAPI -+ LATEST -+ - - - diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java index 5589ce1b7..1e928197c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -50,10 +20,10 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aac41c8b2..3c2129d28 100644 +index aac41c8b2..a80a9eae3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,90 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,76 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -63,41 +33,27 @@ index aac41c8b2..3c2129d28 100644 import java.util.HashSet; +import java.util.List; +import java.util.Random; -+ -+import com.iridium.iridiumcolorapi.IridiumColorAPI; ++import dev._2lstudios.flamecord.utils.ColorUtil; import lombok.Getter; -+import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { -+ private List color(final List strings) { -+ for (int i = 0; i < strings.size(); i++) { -+ String text = strings.get(i); ++ public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { ++ String motd = motds.get(new Random().nextInt(motds.size())); + -+ if (text != null) { -+ String coloredText = ChatColor.translateAlternateColorCodes('&', text); ++ motd = motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); + -+ if (coloredText != null) { -+ strings.set(i, IridiumColorAPI.process(coloredText)); -+ } -+ } -+ } -+ -+ return strings; ++ return ColorUtil.hex(motd, protocol); + } + -+ public String getMOTD(final int maxPlayers, final int onlinePlayers) { -+ final String motd = motds.get(new Random().nextInt(motds.size())); -+ -+ return motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); -+ } ++ public String[] getSample(int maxPlayers, int onlinePlayers, int protocol) { ++ String sample = samples.get(new Random().nextInt(samples.size())); + -+ public String[] getSample(final int maxPlayers, final int onlinePlayers) { -+ final String sample = samples.get(new Random().nextInt(samples.size())); ++ sample = sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); + -+ return sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)).split("\n"); ++ return ColorUtil.hex(sample, protocol).split("\n"); + } + + public int getFakePlayersAmount(final int players) { @@ -116,12 +72,12 @@ index aac41c8b2..3c2129d28 100644 + @Getter + private boolean motdEnabled = false; + @Getter -+ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server\n&eEdit this on &cflamecord.yml&e file &7(IridiumColorAPI HEX Support)"); ++ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); + + @Getter + private boolean sampleEnabled = false; + @Getter -+ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server\n&eEdit this on &cflamecord.yml&e file &7(IridiumColorAPI HEX Support)"); ++ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); + + @Getter + private boolean protocolEnabled = false; @@ -144,14 +100,14 @@ index aac41c8b2..3c2129d28 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +111,19 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +97,19 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } + this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.motds = color(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); ++ this.motds = ColorUtil.color(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); + this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.samples = color(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); ++ this.samples = ColorUtil.color(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); + this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); + this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); + this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); @@ -164,8 +120,474 @@ index aac41c8b2..3c2129d28 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java +new file mode 100644 +index 000000000..9587bccda +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java +@@ -0,0 +1,48 @@ ++package dev._2lstudios.flamecord.utils; ++ ++import java.util.List; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++import net.md_5.bungee.api.ChatColor; ++ ++public class ColorUtil { ++ public static String color(String text) { ++ return ChatColor.translateAlternateColorCodes('&', text); ++ } ++ ++ public static List color(final List texts) { ++ for (int i = 0; i < texts.size(); i++) { ++ texts.set(i, color(texts.get(i))); ++ } ++ ++ return texts; ++ } ++ ++ public static String hex(String text, int protocol) { ++ if (text == null) { ++ return text; ++ } ++ ++ return IridiumColorAPI.process(text, protocol); ++ } ++ ++ public static String hexColor(String text, int protocol) { ++ if (text != null) { ++ text = color(text); ++ ++ if (text != null) { ++ text = hex(text, protocol); ++ } ++ } ++ ++ return text; ++ } ++ ++ public static List hexColor(final List texts, int protocol) { ++ for (int i = 0; i < texts.size(); i++) { ++ texts.set(i, hexColor(texts.get(i), protocol)); ++ } ++ ++ return texts; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java +new file mode 100644 +index 000000000..6c386e16f +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java +@@ -0,0 +1,275 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi; ++ ++import java.awt.Color; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.List; ++import java.util.Map; ++import java.util.stream.Collectors; ++ ++import javax.annotation.Nonnull; ++ ++import com.google.common.collect.ImmutableMap; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.GradientPattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.Pattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.RainbowPattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.SolidPattern; ++import net.md_5.bungee.api.ChatColor; ++ ++public class IridiumColorAPI { ++ ++ /** ++ * Cached result if the server version is after the v1.16 RGB update. ++ * ++ * @since 1.0.0 ++ */ ++ private static final boolean SUPPORTS_RGB(int protocol) { ++ return protocol >= 735; ++ } ++ ++ private static final List SPECIAL_COLORS = Arrays.asList("&l", "&n", "&o", "&k", "&m", "§l", "§n", "§o", "§k", "§m"); ++ ++ /** ++ * Cached result of all legacy colors. ++ * ++ * @since 1.0.0 ++ */ ++ private static final Map COLORS = ImmutableMap.builder() ++ .put(new Color(0), ChatColor.getByChar('0')) ++ .put(new Color(170), ChatColor.getByChar('1')) ++ .put(new Color(43520), ChatColor.getByChar('2')) ++ .put(new Color(43690), ChatColor.getByChar('3')) ++ .put(new Color(11141120), ChatColor.getByChar('4')) ++ .put(new Color(11141290), ChatColor.getByChar('5')) ++ .put(new Color(16755200), ChatColor.getByChar('6')) ++ .put(new Color(11184810), ChatColor.getByChar('7')) ++ .put(new Color(5592405), ChatColor.getByChar('8')) ++ .put(new Color(5592575), ChatColor.getByChar('9')) ++ .put(new Color(5635925), ChatColor.getByChar('a')) ++ .put(new Color(5636095), ChatColor.getByChar('b')) ++ .put(new Color(16733525), ChatColor.getByChar('c')) ++ .put(new Color(16733695), ChatColor.getByChar('d')) ++ .put(new Color(16777045), ChatColor.getByChar('e')) ++ .put(new Color(16777215), ChatColor.getByChar('f')).build(); ++ ++ /** ++ * Cached result of patterns. ++ * ++ * @since 1.0.2 ++ */ ++ private static final List PATTERNS = Arrays.asList(new GradientPattern(), new SolidPattern(), new RainbowPattern()); ++ ++ /** ++ * Processes a string to add color to it. ++ * Thanks to Distressing for helping with the regex <3 ++ * ++ * @param string The string we want to process ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String process(@Nonnull String string, int protocol) { ++ for (Pattern pattern : PATTERNS) { ++ string = pattern.process(string, protocol); ++ } ++ ++ string = ChatColor.translateAlternateColorCodes('&', string); ++ return string; ++ } ++ ++ /** ++ * Processes multiple strings in a collection. ++ * ++ * @param strings The collection of the strings we are processing ++ * @return The list of processed strings ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ public static List process(@Nonnull Collection strings, int protocol) { ++ return strings.stream() ++ .map(s -> IridiumColorAPI.process(s, protocol)) ++ .collect(Collectors.toList()); ++ } ++ ++ /** ++ * Colors a String. ++ * ++ * @param string The string we want to color ++ * @param color The color we want to set it to ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String color(@Nonnull String string, @Nonnull Color color, int protocol) { ++ return (SUPPORTS_RGB(protocol) ? ChatColor.of(color) : getClosestColor(color)) + string; ++ } ++ ++ /** ++ * Colors a String with a gradiant. ++ * ++ * @param string The string we want to color ++ * @param start The starting gradiant ++ * @param end The ending gradiant ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String color(@Nonnull String string, @Nonnull Color start, @Nonnull Color end, int protocol) { ++ String originalString = string; ++ ++ ChatColor[] colors = createGradient(start, end, withoutSpecialChar(string).length(), protocol); ++ return apply(originalString, colors); ++ } ++ ++ /** ++ * Colors a String with rainbow colors. ++ * ++ * @param string The string which should have rainbow colors ++ * @param saturation The saturation of the rainbow colors ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ public static String rainbow(@Nonnull String string, float saturation, int protocol) { ++ String originalString = string; ++ ++ ChatColor[] colors = createRainbow(withoutSpecialChar(string).length(), saturation, protocol); ++ return apply(originalString, colors); ++ } ++ ++ /** ++ * Gets a color from hex code. ++ * ++ * @param string The hex code of the color ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static ChatColor getColor(@Nonnull String string, int protocol) { ++ return SUPPORTS_RGB(protocol) ? ChatColor.of(new Color(Integer.parseInt(string, 16))) ++ : getClosestColor(new Color(Integer.parseInt(string, 16))); ++ } ++ ++ /** ++ * Removes all color codes from the provided String, including IridiumColorAPI ++ * patterns. ++ * ++ * @param string The String which should be stripped ++ * @return The stripped string without color codes ++ * @since 1.0.5 ++ */ ++ @Nonnull ++ public static String stripColorFormatting(@Nonnull String string) { ++ return string.replaceAll("<#[0-9A-F]{6}>|[&§][a-f0-9lnokm]|<[/]?[A-Z]{5,8}(:[0-9A-F]{6})?[0-9]*>", ""); ++ } ++ ++ @Nonnull ++ private static String apply(@Nonnull String source, ChatColor[] colors) { ++ StringBuilder specialColors = new StringBuilder(); ++ StringBuilder stringBuilder = new StringBuilder(); ++ String[] characters = source.split(""); ++ int outIndex = 0; ++ for (int i = 0; i < characters.length; i++) { ++ if (characters[i].equals("&") || characters[i].equals("§")) { ++ if (i + 1 < characters.length) { ++ if (characters[i + 1].equals("r")) { ++ specialColors.setLength(0); ++ } else { ++ specialColors.append(characters[i]); ++ specialColors.append(characters[i + 1]); ++ } ++ i++; ++ } else ++ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); ++ } else ++ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); ++ } ++ return stringBuilder.toString(); ++ } ++ ++ @Nonnull ++ private static String withoutSpecialChar(@Nonnull String source) { ++ String workingString = source; ++ for (String color : SPECIAL_COLORS) { ++ if (workingString.contains(color)) { ++ workingString = workingString.replace(color, ""); ++ } ++ } ++ return workingString; ++ } ++ ++ /** ++ * Returns a rainbow array of chat colors. ++ * ++ * @param step How many colors we return ++ * @param saturation The saturation of the rainbow ++ * @return The array of colors ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ private static ChatColor[] createRainbow(int step, float saturation, int protocol) { ++ ChatColor[] colors = new ChatColor[step]; ++ double colorStep = (1.00 / step); ++ ++ for (int i = 0; i < step; i++) { ++ Color color = Color.getHSBColor((float) (colorStep * i), saturation, saturation); ++ if (SUPPORTS_RGB(protocol)) { ++ colors[i] = ChatColor.of(color); ++ } else { ++ colors[i] = getClosestColor(color); ++ } ++ } ++ ++ return colors; ++ } ++ ++ /** ++ * Returns a gradient array of chat colors. ++ * ++ * @param start The starting color. ++ * @param end The ending color. ++ * @param step How many colors we return. ++ * @author TheViperShow ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color end, int step, int protocol) { ++ ChatColor[] colors = new ChatColor[step]; ++ int stepR = Math.abs(start.getRed() - end.getRed()) / (step - 1); ++ int stepG = Math.abs(start.getGreen() - end.getGreen()) / (step - 1); ++ int stepB = Math.abs(start.getBlue() - end.getBlue()) / (step - 1); ++ int[] direction = new int[] { ++ start.getRed() < end.getRed() ? +1 : -1, ++ start.getGreen() < end.getGreen() ? +1 : -1, ++ start.getBlue() < end.getBlue() ? +1 : -1 ++ }; ++ ++ for (int i = 0; i < step; i++) { ++ Color color = new Color(start.getRed() + ((stepR * i) * direction[0]), start.getGreen() + ((stepG * i) * direction[1]), start.getBlue() + ((stepB * i) * direction[2])); ++ if (SUPPORTS_RGB(protocol)) { ++ colors[i] = ChatColor.of(color); ++ } else { ++ colors[i] = getClosestColor(color); ++ } ++ } ++ ++ return colors; ++ } ++ ++ /** ++ * Returns the closest legacy color from an rgb color ++ * ++ * @param color The color we want to transform ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ private static ChatColor getClosestColor(Color color) { ++ Color nearestColor = null; ++ double nearestDistance = Integer.MAX_VALUE; ++ ++ for (Color constantColor : COLORS.keySet()) { ++ double distance = Math.pow(color.getRed() - constantColor.getRed(), 2) + Math.pow(color.getGreen() - constantColor.getGreen(), 2) + Math.pow(color.getBlue() - constantColor.getBlue(), 2); ++ if (nearestDistance > distance) { ++ nearestColor = constantColor; ++ nearestDistance = distance; ++ } ++ } ++ return COLORS.get(nearestColor); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java +new file mode 100644 +index 000000000..c1f05cd0a +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java +@@ -0,0 +1,33 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.awt.*; ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++/** ++ * Represents a gradient color pattern which can be applied to a String. ++ */ ++public class GradientPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); ++ ++ /** ++ * Applies a gradient pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String start = matcher.group(1); ++ String end = matcher.group(3); ++ String content = matcher.group(2); ++ string = string.replace(matcher.group(), IridiumColorAPI.color(content, new Color(Integer.parseInt(start, 16)), new Color(Integer.parseInt(end, 16)), protocol)); ++ } ++ return string; ++ } ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java +new file mode 100644 +index 000000000..5457ead64 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java +@@ -0,0 +1,17 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++/** ++ * Represents a color pattern which can be applied to a String. ++ */ ++public interface Pattern { ++ ++ /** ++ * Applies this pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ String process(String string, int protocol); ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java +new file mode 100644 +index 000000000..792e9f987 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++public class RainbowPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); ++ ++ /** ++ * Applies a rainbow pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String saturation = matcher.group(1); ++ String content = matcher.group(2); ++ string = string.replace(matcher.group(), IridiumColorAPI.rainbow(content, Float.parseFloat(saturation), protocol)); ++ } ++ return string; ++ } ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java +new file mode 100644 +index 000000000..0b039c797 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java +@@ -0,0 +1,29 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++public class SolidPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("|#\\{([0-9A-Fa-f]{6})}"); ++ ++ /** ++ * Applies a solid RGB color to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String color = matcher.group(1); ++ if (color == null) color = matcher.group(2); ++ ++ string = string.replace(matcher.group(), IridiumColorAPI.getColor(color, protocol) + ""); ++ } ++ return string; ++ } ++ ++} 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 8fb36e37d..b340c7a55 100644 +index 8fb36e37d..bfefdf822 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -210,7 +632,7 @@ index 8fb36e37d..b340c7a55 100644 + } + + if (config.isMotdEnabled()) { -+ motd = config.getMOTD(maxPlayers, onlinePlayers); ++ motd = config.getMOTD(maxPlayers, onlinePlayers, protocol); + } else { + motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); + } @@ -223,7 +645,7 @@ index 8fb36e37d..b340c7a55 100644 + + if (config.isSampleEnabled()) { + final UUID fakeUuid = new UUID(0, 0); -+ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers); ++ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers, protocol); + + sample = new ServerPing.PlayerInfo[sampleString.length]; + diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index a3ffb5fa..7aa8268e 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,14 +1,14 @@ -From dde3fd93db29113d7f296b0c05df86080336b3b1 Mon Sep 17 00:00:00 2001 +From 5cb2916ba8f22c74e10427554ce253e89d2a0291 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index d902feeba..1fd11f501 100644 +index a80a9eae3..aa1c8eb24 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -18,6 +18,10 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -16,10 +16,10 @@ index d902feeba..1fd11f501 100644 + @Getter + private int tcpFastOpen = 3; + - private List color(final List strings) { - for (int i = 0; i < strings.size(); i++) { - String text = strings.get(i); -@@ -123,6 +127,7 @@ public class FlameCordConfiguration extends FlameConfig { + public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { + String motd = motds.get(new Random().nextInt(motds.size())); + +@@ -109,6 +113,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index ee6b2bab..dec109a0 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,16 +1,16 @@ -From 5f58554e02332e3985f19083f90c7e548a27d90f Mon Sep 17 00:00:00 2001 +From 4cd6feb0cf58cb1028f8cac63cf4524b2a03e6c5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index d1e8291e2..0085c7398 100644 +index 20edd9001..f48f1e60b 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml -@@ -42,6 +42,17 @@ - IridiumColorAPI - LATEST +@@ -30,6 +30,17 @@ + ${project.version} + compile + + com.maxmind.db @@ -1101,10 +1101,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1fd11f501..8cfb197e8 100644 +index aa1c8eb24..aa26af32d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -18,6 +18,166 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,166 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1271,7 +1271,7 @@ index 1fd11f501..8cfb197e8 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +287,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -113,6 +273,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1513,7 +1513,7 @@ index cc76325b2..05cf5b953 100644 } } 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 c00ab4b6a..86021b71b 100644 +index f6681e240..c530c8b2c 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index a6a6e7ee..f4c3b9c8 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From f93a1b115b200c18866a60acab830073caa3a3a8 Mon Sep 17 00:00:00 2001 +From 878971d7cb3640202811677aa8e54b34cea4393e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8cfb197e8..7c534400c 100644 +index aa26af32d..e2315e83f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -18,6 +18,10 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index 8cfb197e8..7c534400c 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -287,6 +291,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -273,6 +277,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -29,7 +29,7 @@ index 8cfb197e8..7c534400c 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 86021b71b..c2733d6e3 100644 +index c530c8b2c..9978b9db1 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 @@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection From b305ac5e15561ea32e4890c889db123c18927953 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 12:39:00 -0300 Subject: [PATCH 368/499] Performance Improvements for HEX Colors --- .../0026-Custom-motd-system.patch | 38 +++++++++++++------ .../0027-TCP-Fast-Open.patch | 8 ++-- .../0029-Antibot-System.patch | 6 +-- .../0030-Allow-Invalid-Names.patch | 6 +-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index dd06bf2b..b76e6c9a 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 2deed84f7aa7722cb648f94f46df605ce33ee912 Mon Sep 17 00:00:00 2001 +From c41b5bb4984efeb62f1ef8669e0913a2177dacf1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,10 +20,10 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aac41c8b2..a80a9eae3 100644 +index aac41c8b2..22a8ac39d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,76 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -41,19 +41,31 @@ index aac41c8b2..a80a9eae3 100644 public class FlameCordConfiguration extends FlameConfig { + public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { -+ String motd = motds.get(new Random().nextInt(motds.size())); ++ String motd; ++ ++ if (protocol >= 735) { ++ motd = hexMotds.get(new Random().nextInt(hexMotds.size())); ++ } else { ++ motd = motds.get(new Random().nextInt(motds.size())); ++ } + + motd = motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); + -+ return ColorUtil.hex(motd, protocol); ++ return motd; + } + + public String[] getSample(int maxPlayers, int onlinePlayers, int protocol) { -+ String sample = samples.get(new Random().nextInt(samples.size())); ++ String sample; ++ ++ if (protocol >= 735) { ++ sample = hexSamples.get(new Random().nextInt(hexMotds.size())); ++ } else { ++ sample = samples.get(new Random().nextInt(motds.size())); ++ } + + sample = sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); + -+ return ColorUtil.hex(sample, protocol).split("\n"); ++ return sample.split("\n"); + } + + public int getFakePlayersAmount(final int players) { @@ -71,13 +83,13 @@ index aac41c8b2..a80a9eae3 100644 + + @Getter + private boolean motdEnabled = false; -+ @Getter + private List motds = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List hexMotds; + + @Getter + private boolean sampleEnabled = false; -+ @Getter + private List samples = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List hexSamples; + + @Getter + private boolean protocolEnabled = false; @@ -100,14 +112,16 @@ index aac41c8b2..a80a9eae3 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +97,19 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +109,21 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } + this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.motds = ColorUtil.color(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration))); ++ this.hexMotds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 735); ++ this.motds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 734); + this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.samples = ColorUtil.color(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration))); ++ this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); ++ this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); + this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); + this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); + this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 7aa8268e..03127f54 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 5cb2916ba8f22c74e10427554ce253e89d2a0291 Mon Sep 17 00:00:00 2001 +From 7f3a1472da95624a579d8355541ff63df5dd735f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index a80a9eae3..aa1c8eb24 100644 +index 22a8ac39d..9912fc25c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -17,9 +17,9 @@ index a80a9eae3..aa1c8eb24 100644 + private int tcpFastOpen = 3; + public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { - String motd = motds.get(new Random().nextInt(motds.size())); + String motd; -@@ -109,6 +113,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -123,6 +127,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index dec109a0..dbdc7313 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 4cd6feb0cf58cb1028f8cac63cf4524b2a03e6c5 Mon Sep 17 00:00:00 2001 +From a680ab172db4764d038ffbfadc9d1c454440ded9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1101,7 +1101,7 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aa1c8eb24..aa26af32d 100644 +index 9912fc25c..9b0c542aa 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,166 @@ import net.md_5.bungee.config.Configuration; @@ -1271,7 +1271,7 @@ index aa1c8eb24..aa26af32d 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -113,6 +273,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +287,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index f4c3b9c8..a8992bfe 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 878971d7cb3640202811677aa8e54b34cea4393e Mon Sep 17 00:00:00 2001 +From beef7acd3f06cbd730035f5807a94545970b88e1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aa26af32d..e2315e83f 100644 +index 9b0c542aa..b017baf25 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index aa26af32d..e2315e83f 100644 // FlameCord start - Antibot System @Getter private boolean antibotAccountsEnabled = true; -@@ -273,6 +277,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -287,6 +291,8 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); From a8046caf4898aefc11e56c8f1ec867c8819b6efa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 17:19:58 -0300 Subject: [PATCH 369/499] Customizable server command hover players --- ...0020-FlameCord-message-configuration.patch | 24 +++++++++++++++---- .../0029-Antibot-System.patch | 6 ++--- .../0038-Bungee-Plugins-Command.patch | 6 ++--- .../0039-Bungee-IP-Command.patch | 6 ++--- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 8487860b..f202d2f4 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From dae4aa8593ae097fcc2961539dd2fc7787e8d63e Mon Sep 17 00:00:00 2001 +From 6eae2c1a46011d8e4aabaf919279a9d941c403f1 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -34,10 +34,10 @@ index ac37eaa3e..c78ab3a7c 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 000000000..4f306660e +index 000000000..70d5d61fe --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,114 @@ +@@ -0,0 +1,115 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; @@ -109,6 +109,7 @@ index 000000000..4f306660e + "&cAn error occurred while parsing your message. (Hover for details)", configuration); + setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", + configuration); ++ setIfUnexistant("server_command_hover_players", "{0} players", configuration); + setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); + setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); + setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); @@ -153,6 +154,21 @@ index 000000000..4f306660e + } +} \ No newline at end of file +diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +index 698b420f4..e4ad7e389 100644 +--- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java ++++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +@@ -50,7 +50,9 @@ public class CommandServer extends Command implements TabExecutor + int count = server.getPlayers().size(); + serverTextComponent.setHoverEvent( new HoverEvent( + HoverEvent.Action.SHOW_TEXT, +- new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) ++ // FlameCord - FlameCord messages configuration ++ // Make player count customizable ++ new ComponentBuilder( ProxyServer.getInstance().getTranslation( "server_command_hover_players", count ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) + ); + serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); + serverList.append( serverTextComponent ); diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java index 91d60bfb3..cc76325b2 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -201,7 +217,7 @@ index 91d60bfb3..cc76325b2 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 88ac66bab..501aacfa0 100644 +index 7cbac8937..8edaa3026 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index dbdc7313..57793dbf 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From a680ab172db4764d038ffbfadc9d1c454440ded9 Mon Sep 17 00:00:00 2001 +From fec0949f3ebda6711d1dddfdfb8774917e9849e3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1281,10 +1281,10 @@ index 9912fc25c..9b0c542aa 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 4f306660e..d0d8fc391 100644 +index 70d5d61fe..731833f31 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -82,12 +82,27 @@ public class MessagesConfiguration extends FlameConfig { +@@ -83,12 +83,27 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); diff --git a/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch index c39712a7..b9f2aea8 100644 --- a/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch @@ -1,14 +1,14 @@ -From ab055556001fcc9e5278a383ff187e05499937ba Mon Sep 17 00:00:00 2001 +From 10210edef9cec9b3892205d79d9701ba5d9980df Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 2ecbf29d5..3d4fede4f 100644 +index 84b907e28..ca3dd2397 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -95,6 +95,11 @@ public class MessagesConfiguration extends FlameConfig { +@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); // FlameCord end - Antibot System diff --git a/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch index 051da8d1..051c727a 100644 --- a/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch @@ -1,14 +1,14 @@ -From 97e6fb1e2fcdb45f9bd000c29a87e3cd5fea9cc6 Mon Sep 17 00:00:00 2001 +From cf2b0add184a3df3dfdc9bf47c9b278117a4cd4c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 3d4fede4f..2b9e7f5b9 100644 +index ca3dd2397..d3d279d27 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -100,6 +100,12 @@ public class MessagesConfiguration extends FlameConfig { +@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); From 13db713b1d49bdc5608efa7ea63aca2a0cd2e362 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 18:17:16 -0300 Subject: [PATCH 370/499] Fix Query Closing On Incorrect Magic --- ...010-Close-connections-Don-t-flush-if-not-necessary.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 7354da4f..cb2f681f 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From f3902b5c785041c3c029ed0d12d7eece40eca40b Mon Sep 17 00:00:00 2001 +From 2350677d6e3b948d9c20e34a1c047f5b355b3bb4 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -162,7 +162,7 @@ index 2a21243b9..a95193ba7 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b2b199969..b1ecb7ef5 100644 +index b2b199969..ba130a5df 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler @@ -170,7 +170,7 @@ index b2b199969..b1ecb7ef5 100644 { bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); + // FlameCord - Close on incorrect magic -+ ctx.close(); ++ ctx.channel().close(); return; } From 58e98646fd02f3aa8d0dd76ad5b4d956bbebca8b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 18:26:37 -0300 Subject: [PATCH 371/499] 1.2.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 52321b8c..e43145ca 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 4cbf852666fc0337b93f92c5ad2c30a2ccdc2ae7 Mon Sep 17 00:00:00 2001 +From a864f5c2836ec41b9269c9b2dc1e4137bf33b6f8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..764c271bf 100644 +index 8617cdc7a..863e9f8c0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..764c271bf 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.5"; ++ return "1.2.6"; } public final void reloadMessages() From e9951787e066f48acb598d934720d9086bde76a8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:57 -0300 Subject: [PATCH 372/499] Organize Patches --- .../0018-FlameCord-General-Patch.patch | 153 +++++++++++++++- ...0020-FlameCord-message-configuration.patch | 173 ++++++------------ .../0029-Antibot-System.patch | 56 +++--- .../0030-Allow-Invalid-Names.patch | 17 +- ...2-Dont-frame-unreadable-connections.patch} | 4 +- ...> 0033-Avoid-throwing-IOOB-on-login.patch} | 4 +- ...ion-fail-reason-when-detailed-logge.patch} | 2 +- ...035-Optimize-Decoder-Encoder-Getter.patch} | 2 +- ...ont-Process-Links-For-Kick-Messages.patch} | 4 +- ...atch => 0037-Bungee-Plugins-Command.patch} | 25 ++- ...and.patch => 0038-Bungee-IP-Command.patch} | 16 +- ...t.patch => 0039-List-Command-Format.patch} | 31 ++-- 12 files changed, 294 insertions(+), 193 deletions(-) rename Waterfall-Proxy-Patches/{0033-Dont-frame-unreadable-connections.patch => 0032-Dont-frame-unreadable-connections.patch} (90%) rename Waterfall-Proxy-Patches/{0034-Avoid-throwing-IOOB-on-login.patch => 0033-Avoid-throwing-IOOB-on-login.patch} (89%) rename Waterfall-Proxy-Patches/{0035-Only-show-connection-fail-reason-when-detailed-logge.patch => 0034-Only-show-connection-fail-reason-when-detailed-logge.patch} (94%) rename Waterfall-Proxy-Patches/{0036-Optimize-Decoder-Encoder-Getter.patch => 0035-Optimize-Decoder-Encoder-Getter.patch} (97%) rename Waterfall-Proxy-Patches/{0037-Dont-Process-Links-For-Kick-Messages.patch => 0036-Dont-Process-Links-For-Kick-Messages.patch} (98%) rename Waterfall-Proxy-Patches/{0038-Bungee-Plugins-Command.patch => 0037-Bungee-Plugins-Command.patch} (82%) rename Waterfall-Proxy-Patches/{0039-Bungee-IP-Command.patch => 0038-Bungee-IP-Command.patch} (91%) rename Waterfall-Proxy-Patches/{0032-Command-List-Format.patch => 0039-List-Command-Format.patch} (56%) diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 92d645b4..0bd3f42f 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 20e7630ff3f3f16d5f1b45c4fbe81037795088d8 Mon Sep 17 00:00:00 2001 +From e491e4797924fec05301ae3e1ef8b734c834a7f4 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -133,6 +133,155 @@ index 000000000..c8148e902 + } + } +} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +new file mode 100644 +index 000000000..00b074aaf +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -0,0 +1,142 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.text.MessageFormat; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Logger; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class MessagesConfiguration extends FlameConfig { ++ private final Logger logger; ++ private final Map messages = new HashMap<>(); ++ ++ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { ++ this.logger = logger; ++ ++ try { ++ final String fileName = "./messages.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list_format", "&aServers:&r", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); ++ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); ++ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("server_command_hover_players", "{0} players", configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); ++ ++ // FlameCord start - Antibot System ++ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); ++ // FlameCord end - Antibot System ++ ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); ++ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); ++ ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); ++ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); ++ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); ++ ++ // FlameCord ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); ++ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); ++ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); ++ ++ configurationProvider.save(configuration, configurationFile); ++ ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); ++ ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); ++ } ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ public String getTranslation(final String name, final Object... args) { ++ if (!messages.containsKey(name)) { ++ logger.warning("[FlameCord] Tried to get translation '" + name ++ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); ++ } ++ ++ return MessageFormat.format(messages.getOrDefault(name, ""), args); ++ } ++} +\ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java index 640f0ea26..70a1192e7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -209,7 +358,7 @@ index 000000000..91d60bfb3 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e11e30402..8861da39d 100644 +index 031b21084..1dd53660a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index f202d2f4..886aa90b 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 6eae2c1a46011d8e4aabaf919279a9d941c403f1 Mon Sep 17 00:00:00 2001 +From 4d10d73b8ebc26a61300da52764739815a151492 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -33,127 +33,56 @@ index ac37eaa3e..c78ab3a7c 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -new file mode 100644 -index 000000000..70d5d61fe ---- /dev/null +index 00b074aaf..207cd1b1d 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,115 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.text.MessageFormat; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class MessagesConfiguration extends FlameConfig { -+ private final Logger logger; -+ private final Map messages = new HashMap<>(); -+ -+ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { -+ this.logger = logger; -+ -+ try { -+ final String fileName = "./messages.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); -+ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); -+ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("server_command_hover_players", "{0} players", configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); -+ -+ // FlameCord -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -+ -+ configurationProvider.save(configuration, configurationFile); -+ -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public String getTranslation(final String name, final Object... args) { -+ if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name -+ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); -+ } -+ -+ return MessageFormat.format(messages.getOrDefault(name, ""), args); -+ } -+} -\ No newline at end of file +@@ -35,7 +35,6 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); + setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); + setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); +- setIfUnexistant("command_list_format", "&aServers:&r", configuration); + setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); + setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); + setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); +@@ -84,38 +83,12 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + +- // FlameCord start - Antibot System +- setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); +- setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); +- // FlameCord end - Antibot System +- +- // FlameCord - Bungee Plugins Command +- setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); +- setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); +- setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); +- +- // FlameCord - Bungee Plugins Command +- setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); +- setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); +- setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); +- setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); +- + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", + "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); +- setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); +- setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); +- setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); + + configurationProvider.save(configuration, configurationFile); + diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java index 698b420f4..e4ad7e389 100644 --- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java @@ -217,7 +146,7 @@ index 91d60bfb3..cc76325b2 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 7cbac8937..8edaa3026 100644 +index b17e3b0c1..1fb7bb2a7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 57793dbf..be08aa0f 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From fec0949f3ebda6711d1dddfdfb8774917e9849e3 Mon Sep 17 00:00:00 2001 +From 4638e35491b0721cf1ab99b44f45a993a0271af0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1101,14 +1101,14 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9912fc25c..9b0c542aa 100644 +index 9912fc25c..9834c8efa 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,166 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,175 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { -+ // FlameCord start - Antibot System ++ // Antibot accounts + @Getter + private boolean antibotAccountsEnabled = true; + @Getter @@ -1117,6 +1117,8 @@ index 9912fc25c..9b0c542aa 100644 + private int antibotAccountsLimit = 3; + @Getter + private boolean antibotAccountsLog = true; ++ ++ // Antibot country + @Getter + private boolean antibotCountryEnabled = true; + @Getter @@ -1127,6 +1129,8 @@ index 9912fc25c..9b0c542aa 100644 + private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException", "QuietException", "IllegalStateConfig", "FastException"); + @Getter + private boolean antibotCountryLog = true; ++ ++ // Antibot fastchat + @Getter + private boolean antibotFastChatEnabled = true; + @Getter @@ -1146,6 +1150,7 @@ index 9912fc25c..9b0c542aa 100644 + @Getter + private Collection antibotFirewallWhitelist = Arrays.asList("127.0.0.1"); + ++ // Antibot nickname + @Getter + private boolean antibotNicknameEnabled = true; + @Getter @@ -1154,6 +1159,8 @@ index 9912fc25c..9b0c542aa 100644 + private Collection antibotNicknameBlacklist = Arrays.asList("mcstorm", "mcdown", "mcbot", "theresa_bot", "dropbot", "kingbot"); + @Getter + private boolean antibotNicknameLog = true; ++ ++ // Antibot password + @Getter + private boolean antibotPasswordEnabled = true; + @Getter @@ -1162,6 +1169,8 @@ index 9912fc25c..9b0c542aa 100644 + private int antibotPasswordLimit = 3; + @Getter + private boolean antibotPasswordLog = true; ++ ++ // Antibot ratelimit + @Getter + private boolean antibotRatelimitEnabled = true; + @Getter @@ -1172,6 +1181,8 @@ index 9912fc25c..9b0c542aa 100644 + private int antibotRatelimitPingsPerSecond = 8; + @Getter + private boolean antibotRatelimitLog = true; ++ ++ // Antibot reconnect + @Getter + private boolean antibotReconnectEnabled = true; + @Getter @@ -1264,29 +1275,36 @@ index 9912fc25c..9b0c542aa 100644 + this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); + this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); + this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); -+ this.antibotPacketsVlsToCancel = setIfUnexistant("antibot.packets.vls-to-cancel", this.antibotPacketsVlsToCancel, config); + } -+ // FlameCord end - Antibot System + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +287,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +296,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); -+ loadAntibot(configuration); + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); +@@ -135,6 +305,9 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + ++ // FlameCord - Antibot System ++ loadAntibot(configuration); ++ + configurationProvider.save(configuration, configurationFile); + } catch (final IOException e) { + e.printStackTrace(); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 70d5d61fe..731833f31 100644 +index 207cd1b1d..a39b4be62 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -83,12 +83,27 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); - setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); +@@ -90,6 +90,22 @@ public class MessagesConfiguration extends FlameConfig { + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + // FlameCord start - Antibot System + setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); @@ -1298,21 +1316,15 @@ index 70d5d61fe..731833f31 100644 + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -+ // FlameCord end - Antibot System -+ - // FlameCord - setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); - setIfUnexistant("flamecord_help", -- "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord help&7 >&b Shows this message!", -+ "&aFlameCord&b {0}&a by&b LinsaFTW&a &&b Sammwy&r\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /flamecord help&7 >&b Shows this message!", - configuration); - setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ + setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); + setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); + setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); - ++ // FlameCord end - Antibot System ++ configurationProvider.save(configuration, configurationFile); + for (final String key : configuration.getKeys()) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 index 000000000..285810ea1 diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index a8992bfe..590753fc 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From beef7acd3f06cbd730035f5807a94545970b88e1 Mon Sep 17 00:00:00 2001 +From fa07b114703cd16e45b39ab3ea9772858249086c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9b0c542aa..b017baf25 100644 +index 9834c8efa..d9d3d6047 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -16,18 +16,19 @@ index 9b0c542aa..b017baf25 100644 + @Getter + private boolean allowInvalidNames = false; + - // FlameCord start - Antibot System + // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -287,6 +291,8 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); - this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); +@@ -305,6 +309,9 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + ++ // FlameCord - Allow Invalid Names + this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); + + // FlameCord - Antibot System loadAntibot(configuration); - this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); 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 c530c8b2c..9978b9db1 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java diff --git a/Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch similarity index 90% rename from Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch rename to Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch index f7fddd72..0622382f 100644 --- a/Waterfall-Proxy-Patches/0033-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch @@ -1,11 +1,11 @@ -From 87b7ba071d916722920d1cbe01a36fb379fbf81a Mon Sep 17 00:00:00 2001 +From b35a4719080e02355b7e5651ac302d38ba093f19 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Thu, 4 Aug 2022 23:27:43 +0200 Subject: [PATCH] Dont frame unreadable connections diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 074d2437..9a7bf9b5 100644 +index a1af4e09e..c06e506a6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder diff --git a/Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch similarity index 89% rename from Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch rename to Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch index af16bcd9..bf18ece0 100644 --- a/Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch +++ b/Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch @@ -1,11 +1,11 @@ -From 0eb7dd9c239bb09fa8b87ad963b2203ea6f9e2eb Mon Sep 17 00:00:00 2001 +From b529f3bea516105b004b0f408a542309bdf6d157 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:41:48 -0300 Subject: [PATCH] Avoid throwing IOOB on login diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 22a5b993..78a2d569 100644 +index 763d34c2f..57e50a8b6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java @@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket diff --git a/Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch similarity index 94% rename from Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch rename to Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch index f943b9d8..b2bf1789 100644 --- a/Waterfall-Proxy-Patches/0035-Only-show-connection-fail-reason-when-detailed-logge.patch +++ b/Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -1,4 +1,4 @@ -From 878867854391af17739c536b7db5c0992c8fcf84 Mon Sep 17 00:00:00 2001 +From 8bfc6056ed2800af6d48d1a1a8c8a2c532578a7d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 Subject: [PATCH] Only show connection fail reason when detailed logger is diff --git a/Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch b/Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch similarity index 97% rename from Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch rename to Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch index 77559c4f..4ae1b9d2 100644 --- a/Waterfall-Proxy-Patches/0036-Optimize-Decoder-Encoder-Getter.patch +++ b/Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch @@ -1,4 +1,4 @@ -From 9356c9e66746a50197da675505bc256290c0832b Mon Sep 17 00:00:00 2001 +From 26e41d9fe50272a8da3ab5ee4b2579f445ec9780 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 28 Dec 2022 14:23:54 -0300 Subject: [PATCH] Optimize Decoder/Encoder Getter diff --git a/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch similarity index 98% rename from Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch rename to Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch index 829fe780..173c8fba 100644 --- a/Waterfall-Proxy-Patches/0037-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 2d29fee2a16ea7e57cec199acf6930a9e3880e90 Mon Sep 17 00:00:00 2001 +From 5b31050702cfdc5cb9f7c0b821083e783067ed8b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,7 +117,7 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 c2733d6e3..69b260b93 100644 +index 9978b9db1..816e318fe 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 @@ -846,7 +846,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch similarity index 82% rename from Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch rename to Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch index b9f2aea8..ea5a5bf0 100644 --- a/Waterfall-Proxy-Patches/0038-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch @@ -1,25 +1,32 @@ -From 10210edef9cec9b3892205d79d9701ba5d9980df Mon Sep 17 00:00:00 2001 +From c3f0d477f364a0671d26222ad2b1d76c38db31da Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 84b907e28..ca3dd2397 100644 +index a39b4be62..190c00ea8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { +@@ -100,11 +100,17 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); +- ++ ++ // Firewall + setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); + setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); + setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); // FlameCord end - Antibot System - ++ + // FlameCord - Bungee Plugins Command + setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); + setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); + setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -+ - // FlameCord - setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); - setIfUnexistant("flamecord_help", + + configurationProvider.save(configuration, configurationFile); + diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java new file mode 100644 index 000000000..2e20e9dca @@ -72,7 +79,7 @@ index 000000000..2e20e9dca + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8edaa3026..e09e32c94 100644 +index 1fb7bb2a7..5e9c7a98b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch similarity index 91% rename from Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch rename to Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch index 051c727a..f6f46257 100644 --- a/Waterfall-Proxy-Patches/0039-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch @@ -1,26 +1,26 @@ -From cf2b0add184a3df3dfdc9bf47c9b278117a4cd4c Mon Sep 17 00:00:00 2001 +From d789141493f79f24fadf8f0700e8b8330d5b54e5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ca3dd2397..d3d279d27 100644 +index 190c00ea8..5af35f897 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { +@@ -112,6 +112,12 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -+ // FlameCord - Bungee Plugins Command ++ // FlameCord - Bungee IP Command + setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); + setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); + setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); + setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); + - // FlameCord - setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); - setIfUnexistant("flamecord_help", + configurationProvider.save(configuration, configurationFile); + + for (final String key : configuration.getKeys()) { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java new file mode 100644 index 000000000..85313491e @@ -73,7 +73,7 @@ index 000000000..85313491e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e09e32c94..4e75d5a22 100644 +index 5e9c7a98b..88c146573 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0032-Command-List-Format.patch b/Waterfall-Proxy-Patches/0039-List-Command-Format.patch similarity index 56% rename from Waterfall-Proxy-Patches/0032-Command-List-Format.patch rename to Waterfall-Proxy-Patches/0039-List-Command-Format.patch index 045009fa..804a2685 100644 --- a/Waterfall-Proxy-Patches/0032-Command-List-Format.patch +++ b/Waterfall-Proxy-Patches/0039-List-Command-Format.patch @@ -1,30 +1,33 @@ -From 3ca6b631ac234e011a2a8a09b99f42db68b81e79 Mon Sep 17 00:00:00 2001 +From 2554e3976ae6b01337b4a65785d257f91a30947d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 26 Apr 2022 10:58:11 -0300 -Subject: [PATCH] Command List Format +Date: Sun, 15 Jan 2023 19:03:34 -0300 +Subject: [PATCH] List Command Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 5faab616..9ae20cbb 100644 +index 5af35f897..3f261ca69 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -35,6 +35,7 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); - setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); - setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); +@@ -118,6 +118,9 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); + setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); + ++ // FlameCord - List Command Format + setIfUnexistant("command_list_format", "&aServers:&r", configuration); - setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); - setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); - setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ + configurationProvider.save(configuration, configurationFile); + + for (final String key : configuration.getKeys()) { diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c2227110..d9c8e352 100644 +index c22271105..0a5899319 100644 --- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -@@ -25,6 +25,8 @@ public class CommandList extends Command +@@ -25,6 +25,9 @@ public class CommandList extends Command @Override public void execute(CommandSender sender, String[] args) { -+ sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format" ) ); ++ // FlameCord - List Command Format ++ sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format") ); + for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) { From 3e89573d619b23163a3bd730b643df6558a588cc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:09:50 -0300 Subject: [PATCH 373/499] Organize Patches --- .../0018-FlameCord-General-Patch.patch | 151 +--------------- ...0020-FlameCord-message-configuration.patch | 171 +++++++++++++----- .../0029-Antibot-System.patch | 8 +- 3 files changed, 126 insertions(+), 204 deletions(-) diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 0bd3f42f..52755910 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From e491e4797924fec05301ae3e1ef8b734c834a7f4 Mon Sep 17 00:00:00 2001 +From e56721a653fcc36270c483df6052d7aab8c91804 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -133,155 +133,6 @@ index 000000000..c8148e902 + } + } +} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -new file mode 100644 -index 000000000..00b074aaf ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,142 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.text.MessageFormat; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class MessagesConfiguration extends FlameConfig { -+ private final Logger logger; -+ private final Map messages = new HashMap<>(); -+ -+ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { -+ this.logger = logger; -+ -+ try { -+ final String fileName = "./messages.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); -+ -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list_format", "&aServers:&r", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); -+ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); -+ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("server_command_hover_players", "{0} players", configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); -+ -+ // FlameCord start - Antibot System -+ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -+ // FlameCord end - Antibot System -+ -+ // FlameCord - Bungee Plugins Command -+ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); -+ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -+ -+ // FlameCord - Bungee Plugins Command -+ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); -+ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); -+ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); -+ -+ // FlameCord -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); -+ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); -+ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); -+ -+ configurationProvider.save(configuration, configurationFile); -+ -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } -+ } -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public String getTranslation(final String name, final Object... args) { -+ if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name -+ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); -+ } -+ -+ return MessageFormat.format(messages.getOrDefault(name, ""), args); -+ } -+} -\ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java index 640f0ea26..70a1192e7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 886aa90b..8d7da76a 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From 4d10d73b8ebc26a61300da52764739815a151492 Mon Sep 17 00:00:00 2001 +From a1873b7a1b8f50da2d8941c0384f7f4c4b22e18c Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -33,56 +33,127 @@ index ac37eaa3e..c78ab3a7c 100644 private FlameCord(final Logger logger, final Collection whitelistedAddresses) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 00b074aaf..207cd1b1d 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +new file mode 100644 +index 000000000..21381bb45 +--- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -35,7 +35,6 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); - setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); - setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -- setIfUnexistant("command_list_format", "&aServers:&r", configuration); - setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); - setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); - setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -@@ -84,38 +83,12 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); - setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); - -- // FlameCord start - Antibot System -- setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -- setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -- // FlameCord end - Antibot System -- -- // FlameCord - Bungee Plugins Command -- setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); -- setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); -- setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -- -- // FlameCord - Bungee Plugins Command -- setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); -- setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); -- setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); -- setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); -- - // FlameCord - setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); - setIfUnexistant("flamecord_help", - "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", - configuration); - setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -- setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); -- setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); -- setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); - - configurationProvider.save(configuration, configurationFile); - +@@ -0,0 +1,115 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.text.MessageFormat; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Logger; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class MessagesConfiguration extends FlameConfig { ++ private final Logger logger; ++ private final Map messages = new HashMap<>(); ++ ++ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { ++ this.logger = logger; ++ ++ try { ++ final String fileName = "./messages.yml"; ++ final File configurationFile = new File(fileName); ++ final Configuration configuration; ++ final boolean configurationExists = configurationFile.exists(); ++ ++ if (!configurationExists) { ++ configuration = new Configuration(); ++ } else { ++ configuration = configurationProvider.load(configurationFile); ++ } ++ ++ // FlameCord ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); ++ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); ++ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("server_command_hover_players", "{0} players", configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); ++ ++ configurationProvider.save(configuration, configurationFile); ++ ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); ++ ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); ++ } ++ } ++ } catch (final IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ public String getTranslation(final String name, final Object... args) { ++ if (!messages.containsKey(name)) { ++ logger.warning("[FlameCord] Tried to get translation '" + name ++ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); ++ } ++ ++ return MessageFormat.format(messages.getOrDefault(name, ""), args); ++ } ++} +\ No newline at end of file diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java index 698b420f4..e4ad7e389 100644 --- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index be08aa0f..8e170563 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 4638e35491b0721cf1ab99b44f45a993a0271af0 Mon Sep 17 00:00:00 2001 +From 015e6e1229bf68c3d1ba0be143c97b0f55047ce7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1299,12 +1299,12 @@ index 9912fc25c..9834c8efa 100644 } catch (final IOException e) { e.printStackTrace(); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 207cd1b1d..a39b4be62 100644 +index 21381bb45..37bccaebd 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -90,6 +90,22 @@ public class MessagesConfiguration extends FlameConfig { - configuration); - setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + // FlameCord start - Antibot System + setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); From f7c70077e83cc8baa8f7478d5edcf460f91fd755 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:35:52 -0300 Subject: [PATCH 374/499] Organize Patches --- .../0018-FlameCord-General-Patch.patch | 66 +++++++---------- .../0019-FlameCord-module-system.patch | 50 ++++++++----- ...0020-FlameCord-message-configuration.patch | 29 ++++---- .../0023-FlameCord-logger-options.patch | 12 ++-- .../0026-Custom-motd-system.patch | 10 +-- ...0028-InitialHandler-Processing-State.patch | 14 ++-- .../0029-Antibot-System.patch | 72 ++++++++----------- .../0030-Allow-Invalid-Names.patch | 12 ++-- ...0031-Disable-entity-Metadata-Rewrite.patch | 14 ++-- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +- .../0037-Bungee-Plugins-Command.patch | 10 +-- .../0038-Bungee-IP-Command.patch | 8 +-- 12 files changed, 149 insertions(+), 154 deletions(-) diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 52755910..c15f30f1 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From e56721a653fcc36270c483df6052d7aab8c91804 Mon Sep 17 00:00:00 2001 +From e111096039ff281b653c35f76b1295330eb5ee79 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,7 +6,7 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 000000000..8e69160d0 +index 000000000..7b1f07c7e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,35 @@ @@ -24,9 +24,9 @@ index 000000000..8e69160d0 + @Getter + private static FlameCord instance; + -+ public static void reload(final Logger logger, final Collection whitelistedAddresses) { ++ public static void initialize(final Logger logger, final Collection whitelistedAddresses) { + if (FlameCord.instance != null) { -+ instance.reload(logger); ++ instance.reload(logger, whitelistedAddresses); + } else { + FlameCord.instance = new FlameCord(logger, whitelistedAddresses); + } @@ -35,14 +35,14 @@ index 000000000..8e69160d0 + @Getter + private FlameCordConfiguration flameCordConfiguration; + -+ private void reload(final Logger logger) { -+ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); ++ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { ++ reload(logger, whitelistedAddresses); + } + -+ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { -+ reload(logger); ++ public void reload(final Logger logger, final Collection whitelistedAddresses) { ++ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); + } +} \ No newline at end of file @@ -96,7 +96,7 @@ index 000000000..5589ce1b7 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..c8148e902 +index 000000000..114bbf877 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,33 @@ @@ -114,7 +114,7 @@ index 000000000..c8148e902 +import net.md_5.bungee.config.ConfigurationProvider; + +public class FlameCordConfiguration extends FlameConfig { -+ public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { ++ public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { + try { + final String fileName = "./flamecord.yml"; + final File configurationFile = new File(fileName); @@ -146,7 +146,7 @@ index 640f0ea26..70a1192e7 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 000000000..91d60bfb3 +index 000000000..021b38d43 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -188,7 +188,7 @@ index 000000000..91d60bfb3 + whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); + } + -+ FlameCord.reload(bungeeCord.getLogger(), whitelistedAddresses); ++ FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); + sender.sendMessage(TextComponent + .fromLegacyText("flamecord_reload")); + break; @@ -209,7 +209,7 @@ index 000000000..91d60bfb3 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 031b21084..1dd53660a 100644 +index 031b21084..39986d522 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -221,25 +221,7 @@ index 031b21084..1dd53660a 100644 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -242,11 +244,12 @@ public class BungeeCord extends ProxyServer - // Waterfall end - - pluginManager = new PluginManager( this ); -- getPluginManager().registerCommand( null, new CommandReload() ); -- getPluginManager().registerCommand( null, new CommandEnd() ); -- getPluginManager().registerCommand( null, new CommandIP() ); -- getPluginManager().registerCommand( null, new CommandBungee() ); -- getPluginManager().registerCommand( null, new CommandPerms() ); -+ // FlameCord - We register commands in our new method -+ //getPluginManager().registerCommand( null, new CommandReload() ); -+ //getPluginManager().registerCommand( null, new CommandEnd() ); -+ //getPluginManager().registerCommand( null, new CommandIP() ); -+ //getPluginManager().registerCommand( null, new CommandBungee() ); -+ //getPluginManager().registerCommand( null, new CommandPerms() ); - - if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) - { -@@ -295,6 +298,15 @@ public class BungeeCord extends ProxyServer +@@ -295,6 +297,15 @@ public class BungeeCord extends ProxyServer pluginManager.loadPlugins(); config.load(); @@ -250,13 +232,13 @@ index 031b21084..1dd53660a 100644 + whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); + } + -+ FlameCord.reload(logger, whitelistedAddresses); ++ FlameCord.initialize(logger, whitelistedAddresses); + if ( config.isForgeSupport() ) { registerChannel( ForgeConstants.FML_TAG ); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index da688839c..055a1d883 100644 +index da688839c..3a07c7c8a 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -2,6 +2,8 @@ package net.md_5.bungee; @@ -268,11 +250,13 @@ index da688839c..055a1d883 100644 import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import java.net.InetSocketAddress; -@@ -165,7 +167,7 @@ public class ServerConnector extends PacketHandler +@@ -165,7 +167,9 @@ public class ServerConnector extends PacketHandler { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - FlameCord General Patch ++ // More specific invalid packet exceptions + throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); } } @@ -312,7 +296,7 @@ index 94702434d..e48f77131 100644 b.connect().addListener( listener ); } 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 1c10b5a93..164357c34 100644 +index 1c10b5a93..3e5a337e0 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -324,12 +308,14 @@ index 1c10b5a93..164357c34 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -159,7 +161,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -159,7 +161,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( packet.packet == null ) { - throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); -+ throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump(packet.buf, 16) ); ++ // FlameCord - FlameCord General Patch ++ // More specific invalid packet exceptions ++ throw new QuietException( "Unexpected packet received during initial handler process!\n" + BufUtil.dump(packet.buf, 16) ); } } diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 57f8496e..4a3bbac4 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 4df365428e2d873bb158be4b5800be554803cb8a Mon Sep 17 00:00:00 2001 +From 86a81c612f510e0df4de517b16e945e2dc7c0658 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 8e69160d0..ac37eaa3e 100644 +index 7b1f07c7e..e5a1464a3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -16,21 +16,27 @@ index 8e69160d0..ac37eaa3e 100644 import lombok.Getter; import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.YamlConfiguration; -@@ -22,11 +23,14 @@ public class FlameCord { - +@@ -23,6 +24,10 @@ public class FlameCord { @Getter private FlameCordConfiguration flameCordConfiguration; + ++ // FlameCord - Module System + @Getter + private ModulesConfiguration modulesConfiguration; - - private void reload(final Logger logger) { ++ + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + reload(logger, whitelistedAddresses); + } +@@ -31,5 +36,8 @@ public class FlameCord { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); ++ ++ // FlameCord - Module System + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); } - - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + } +\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 index 000000000..6c5bb9617 @@ -87,7 +93,7 @@ index 000000000..6c5bb9617 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 447cbae7c..9489659a2 100644 +index 39986d522..0eb9ae146 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -113,7 +119,19 @@ index 447cbae7c..9489659a2 100644 import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; -@@ -288,9 +297,10 @@ public class BungeeCord extends ProxyServer +@@ -244,11 +253,6 @@ public class BungeeCord extends ProxyServer + // Waterfall end + + pluginManager = new PluginManager( this ); +- getPluginManager().registerCommand( null, new CommandReload() ); +- getPluginManager().registerCommand( null, new CommandEnd() ); +- getPluginManager().registerCommand( null, new CommandIP() ); +- getPluginManager().registerCommand( null, new CommandBungee() ); +- getPluginManager().registerCommand( null, new CommandPerms() ); + + if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) + { +@@ -287,9 +291,10 @@ public class BungeeCord extends ProxyServer bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); @@ -126,7 +144,7 @@ index 447cbae7c..9489659a2 100644 pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); -@@ -316,6 +326,7 @@ public class BungeeCord extends ProxyServer +@@ -315,6 +320,7 @@ public class BungeeCord extends ProxyServer isRunning = true; @@ -134,12 +152,12 @@ index 447cbae7c..9489659a2 100644 pluginManager.enablePlugins(); if ( config.getThrottle() > 0 ) -@@ -854,4 +865,53 @@ public class BungeeCord extends ProxyServer +@@ -853,4 +859,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } + -+ // FlameCord - Method to simplify module registering ++ // FlameCord - FlameCord Module System + public void loadModules() { + final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); + @@ -184,7 +202,7 @@ index 447cbae7c..9489659a2 100644 + } + } + -+ // Flamecord - Commands (Had to make it like this because of maven limitations) ++ // Flamecord Command + pluginManager.registerCommand(null, new FlameCordCommand(this)); + } } diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 8d7da76a..ce1d23bb 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From a1873b7a1b8f50da2d8941c0384f7f4c4b22e18c Mon Sep 17 00:00:00 2001 +From f004c19ff82a40117dc6f990d11f817df7db9f38 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index ac37eaa3e..c78ab3a7c 100644 +index e5a1464a3..4585406a7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -16,22 +16,23 @@ index ac37eaa3e..c78ab3a7c 100644 import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import lombok.Getter; import net.md_5.bungee.config.ConfigurationProvider; -@@ -25,12 +26,15 @@ public class FlameCord { - private FlameCordConfiguration flameCordConfiguration; +@@ -27,6 +28,8 @@ public class FlameCord { + // FlameCord - Module System @Getter private ModulesConfiguration modulesConfiguration; + @Getter + private MessagesConfiguration messagesConfiguration; - private void reload(final Logger logger) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + reload(logger, whitelistedAddresses); +@@ -39,5 +42,6 @@ public class FlameCord { + + // FlameCord - Module System this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); } - - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + } +\ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 index 000000000..21381bb45 @@ -170,7 +171,7 @@ index 698b420f4..e4ad7e389 100644 serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); serverList.append( serverTextComponent ); diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index 91d60bfb3..cc76325b2 100644 +index 021b38d43..fb81adee0 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -191,7 +192,7 @@ index 91d60bfb3..cc76325b2 100644 if (args.length > 0) { @@ -38,21 +40,22 @@ private final BungeeCord bungeeCord; - FlameCord.reload(bungeeCord.getLogger(), whitelistedAddresses); + FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); sender.sendMessage(TextComponent - .fromLegacyText("flamecord_reload")); + .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); @@ -217,10 +218,10 @@ index 91d60bfb3..cc76325b2 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b17e3b0c1..1fb7bb2a7 100644 +index 0eb9ae146..857b0b622 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer +@@ -620,8 +620,8 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name, Object... args) { diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch index 859e00f7..dbc9a811 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 8edec45c116023de25620c7697ce1f887ea267ce Mon Sep 17 00:00:00 2001 +From 368bddfcbf0018aeca7eaa72769d9b31c1dfc229 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c8148e902..aac41c8b2 100644 +index 114bbf877..edecc1e55 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -12,6 +12,17 @@ import net.md_5.bungee.config.Configuration; @@ -23,7 +23,7 @@ index c8148e902..aac41c8b2 100644 + @Getter + private boolean loggerDetailedConnection = true; + - public FlameCordConfiguration(final ConfigurationProvider configurationProvider) { + public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { try { final String fileName = "./flamecord.yml"; @@ -25,6 +36,12 @@ public class FlameCordConfiguration extends FlameConfig { @@ -64,10 +64,10 @@ index e48f77131..909227970 100644 } 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 164357c34..8fb36e37d 100644 +index 3e5a337e0..abed08d4f 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 -@@ -394,7 +394,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -396,7 +396,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -77,7 +77,7 @@ index 164357c34..8fb36e37d 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -403,7 +404,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -405,7 +406,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index b76e6c9a..fcad17b6 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From c41b5bb4984efeb62f1ef8669e0913a2177dacf1 Mon Sep 17 00:00:00 2001 +From acfaf3a65cf5cefe3b043c9f33c75e8238f6ad41 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,7 +20,7 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index aac41c8b2..22a8ac39d 100644 +index edecc1e55..0ceddd4eb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; @@ -601,7 +601,7 @@ index 000000000..0b039c797 + +} 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 8fb36e37d..bfefdf822 100644 +index abed08d4f..031c007db 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -613,7 +613,7 @@ index 8fb36e37d..bfefdf822 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -273,7 +275,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); @@ -621,7 +621,7 @@ index 8fb36e37d..bfefdf822 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -336,7 +337,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -338,7 +339,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 34251427..ffd11350 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From a19efbabc81d28c8529c2c92fd351c71393bd710 Mon Sep 17 00:00:00 2001 +From c1d3520f305de336c57904f742e2cd035cfd009f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 b340c7a55..c00ab4b6a 100644 +index 031c007db..afc790048 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -23,7 +23,7 @@ index b340c7a55..c00ab4b6a 100644 } @Override -@@ -273,6 +273,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -275,6 +275,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -31,7 +31,7 @@ index b340c7a55..c00ab4b6a 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -395,6 +396,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -397,6 +398,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index b340c7a55..c00ab4b6a 100644 unsafe.sendPacket( ping ); -@@ -406,6 +408,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -408,6 +410,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index b340c7a55..c00ab4b6a 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -479,6 +482,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -481,6 +484,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index b340c7a55..c00ab4b6a 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -815,14 +819,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -817,14 +821,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 8e170563..c7e263a5 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 015e6e1229bf68c3d1ba0be143c97b0f55047ce7 Mon Sep 17 00:00:00 2001 +From 0c10165a6a2d73b6deae77f79eab6b029ff183c8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -27,7 +27,7 @@ index 20edd9001..f48f1e60b 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index c78ab3a7c..e5c8ed3e6 100644 +index 4585406a7..10708f4db 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,10 @@ package dev._2lstudios.flamecord; @@ -41,19 +41,12 @@ index c78ab3a7c..e5c8ed3e6 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -18,26 +22,37 @@ public class FlameCord { - if (FlameCord.instance != null) { - instance.reload(logger); - } else { -- FlameCord.instance = new FlameCord(logger, whitelistedAddresses); -+ FlameCord.instance = new FlameCord(); -+ instance.reload(logger); - } - } - - @Getter - private FlameCordConfiguration flameCordConfiguration; +@@ -31,6 +35,16 @@ public class FlameCord { @Getter + private MessagesConfiguration messagesConfiguration; + ++ // FlameCord - Antibot System ++ @Getter + private AddressDataManager addressDataManager; + @Getter + private CheckManager checkManager; @@ -61,23 +54,17 @@ index c78ab3a7c..e5c8ed3e6 100644 + private StatsData statsData; + @Getter + private LoggerWrapper loggerWrapper; -+ @Getter - private ModulesConfiguration modulesConfiguration; - @Getter - private MessagesConfiguration messagesConfiguration; - - private void reload(final Logger logger) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ if (checkManager != null) checkManager.unload(); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider); ++ + private FlameCord(final Logger logger, final Collection whitelistedAddresses) { + reload(logger, whitelistedAddresses); + } +@@ -43,5 +57,12 @@ public class FlameCord { + // FlameCord - Module System this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -- } -- -- private FlameCord(final Logger logger, final Collection whitelistedAddresses) { -- reload(logger); ++ ++ // FlameCord - Antibot System ++ if (checkManager != null) checkManager.unload(); + this.addressDataManager = new AddressDataManager(); + this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); + this.statsData = new StatsData(); @@ -1101,10 +1088,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9912fc25c..9834c8efa 100644 +index 10a07821a..4271fc078 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,175 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,178 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1214,7 +1201,7 @@ index 9912fc25c..9834c8efa 100644 + @Getter + private double antibotPacketsVlsToCancel = 25; + -+ public void loadAntibot(final Configuration config) { ++ public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { + // Antibot accounts + this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); + this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); @@ -1240,6 +1227,9 @@ index 9912fc25c..9834c8efa 100644 + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); + this.antibotFirewallWhitelist = setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config); + ++ // Add local server ips to whitelist ++ this.antibotFirewallWhitelist.addAll(whitelistedAddresses); ++ + // Antibot nickname + this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); + this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); @@ -1280,7 +1270,7 @@ index 9912fc25c..9834c8efa 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +296,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +299,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1288,12 +1278,12 @@ index 9912fc25c..9834c8efa 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -135,6 +305,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -135,6 +308,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + // FlameCord - Antibot System -+ loadAntibot(configuration); ++ loadAntibot(configuration, whitelistedAddresses); + configurationProvider.save(configuration, configurationFile); } catch (final IOException e) { @@ -1455,7 +1445,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index cc76325b2..05cf5b953 100644 +index fb81adee0..173b47f33 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1525,7 +1515,7 @@ index cc76325b2..05cf5b953 100644 } } 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 f6681e240..c530c8b2c 100644 +index afc790048..4a560c080 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; @@ -1538,7 +1528,7 @@ index f6681e240..c530c8b2c 100644 import dev._2lstudios.flamecord.configuration.FlameConfig; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; -@@ -439,6 +440,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -441,6 +442,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1550,7 +1540,7 @@ index f6681e240..c530c8b2c 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -450,6 +456,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -452,6 +458,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1573,7 +1563,7 @@ index f6681e240..c530c8b2c 100644 break; case 2: // Login -@@ -461,6 +483,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -463,6 +485,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1595,7 +1585,7 @@ index f6681e240..c530c8b2c 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -525,6 +562,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +564,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 590753fc..05f97608 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From fa07b114703cd16e45b39ab3ea9772858249086c Mon Sep 17 00:00:00 2001 +From 310d53ea2c39ebbd29e640f171b009fd6d6d38b1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9834c8efa..d9d3d6047 100644 +index 4271fc078..0d2013508 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9834c8efa..d9d3d6047 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -305,6 +309,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -308,6 +312,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -27,13 +27,13 @@ index 9834c8efa..d9d3d6047 100644 + this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); + // FlameCord - Antibot System - loadAntibot(configuration); + loadAntibot(configuration, whitelistedAddresses); 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 c530c8b2c..9978b9db1 100644 +index 4a560c080..143ec97c9 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 -@@ -521,7 +521,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -523,7 +523,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch index a3cdcd4c..9f151e57 100644 --- a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From f8422f8eaf4f3c88d6beb5752f18cc2544e2d1df Mon Sep 17 00:00:00 2001 +From f293b6e489e70340e1f7fd46146bfa75e468a2d1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -49,7 +49,7 @@ index 0c334afcf..88865b851 100644 - // Waterfall end } 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 -index c9e45b915..36d507847 100644 +index 022f94b2d..970011e8f 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -239,10 +239,10 @@ index 966d2442b..be337a680 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 055a1d883..a63e67f15 100644 +index 3a07c7c8a..f51c668d7 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -243,11 +243,6 @@ public class ServerConnector extends PacketHandler +@@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler ch.write( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:register" : "REGISTER", Joiner.on( "\0" ).join( registeredChannels ).getBytes( StandardCharsets.UTF_8 ), false ) ); } @@ -254,7 +254,7 @@ index 055a1d883..a63e67f15 100644 if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla { user.getForgeClientHandler().setHandshakeComplete(); -@@ -306,20 +301,6 @@ public class ServerConnector extends PacketHandler +@@ -308,20 +303,6 @@ public class ServerConnector extends PacketHandler user.getTabListHandler().onServerChange(); Scoreboard serverScoreboard = user.getServerSentScoreboard(); @@ -275,7 +275,7 @@ index 055a1d883..a63e67f15 100644 serverScoreboard.clear(); for ( UUID bossbar : user.getSentBossBars() ) -@@ -338,33 +319,27 @@ public class ServerConnector extends PacketHandler +@@ -340,33 +321,27 @@ public class ServerConnector extends PacketHandler } user.setDimensionChange( true ); @@ -433,7 +433,7 @@ index 0ac22ad38..6e425764b 100644 public void handle(Respawn respawn) { 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 7b852ff69..aef8b9a8d 100644 +index 667364aea..10e46779f 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 @@ -25,7 +25,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; diff --git a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch index 173c8fba..f0c5e687 100644 --- a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 5b31050702cfdc5cb9f7c0b821083e783067ed8b Mon Sep 17 00:00:00 2001 +From 872ee5166ec9b7eef7e0567540ef44d711ef9b4d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 9978b9db1..816e318fe 100644 +index 143ec97c9..25e3311d7 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 -@@ -846,7 +846,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -848,7 +848,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch index ea5a5bf0..267f9027 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch @@ -1,11 +1,11 @@ -From c3f0d477f364a0671d26222ad2b1d76c38db31da Mon Sep 17 00:00:00 2001 +From 52db599859d1d0386b83e99022f3852dd6ebef78 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index a39b4be62..190c00ea8 100644 +index 37bccaebd..af3d90788 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -100,11 +100,17 @@ public class MessagesConfiguration extends FlameConfig { @@ -79,7 +79,7 @@ index 000000000..2e20e9dca + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 1fb7bb2a7..5e9c7a98b 100644 +index 857b0b622..71cc494d7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -90,9 +90,9 @@ index 1fb7bb2a7..5e9c7a98b 100644 import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -@@ -913,5 +914,8 @@ public class BungeeCord extends ProxyServer +@@ -907,5 +908,8 @@ public class BungeeCord extends ProxyServer - // Flamecord - Commands (Had to make it like this because of maven limitations) + // Flamecord Command pluginManager.registerCommand(null, new FlameCordCommand(this)); + + // FlameCord - Bungee Plugins Command diff --git a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch index f6f46257..9edede95 100644 --- a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch @@ -1,11 +1,11 @@ -From d789141493f79f24fadf8f0700e8b8330d5b54e5 Mon Sep 17 00:00:00 2001 +From e54a7fe3282e6e230dc34b04df738055041063cf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 190c00ea8..5af35f897 100644 +index af3d90788..34b4a6305 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -112,6 +112,12 @@ public class MessagesConfiguration extends FlameConfig { @@ -73,7 +73,7 @@ index 000000000..85313491e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 5e9c7a98b..88c146573 100644 +index 71cc494d7..992584d4f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -84,7 +84,7 @@ index 5e9c7a98b..88c146573 100644 import dev._2lstudios.flamecord.commands.BungeePluginsCommand; import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -917,5 +918,8 @@ public class BungeeCord extends ProxyServer +@@ -911,5 +912,8 @@ public class BungeeCord extends ProxyServer // FlameCord - Bungee Plugins Command pluginManager.registerCommand(null, new BungeePluginsCommand()); From 7c57a46e0a6d5a8fe7684c4fc62f9b7755de8cb4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:48:59 -0300 Subject: [PATCH 375/499] Fix Startup Errors --- .../0018-FlameCord-General-Patch.patch | 18 +++++++----------- .../0019-FlameCord-module-system.patch | 11 ++++------- .../0020-FlameCord-message-configuration.patch | 10 +++++----- .../0029-Antibot-System.patch | 12 ++++++------ 4 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index c15f30f1..c771e9f4 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From e111096039ff281b653c35f76b1295330eb5ee79 Mon Sep 17 00:00:00 2001 +From 2346ffd53c8afc4ae29f33687baa539157fadd2f Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -6,10 +6,10 @@ Subject: [PATCH] FlameCord General Patch diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 000000000..7b1f07c7e +index 000000000..f3d5c0290 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,35 @@ +@@ -0,0 +1,31 @@ +package dev._2lstudios.flamecord; + +import java.util.Collection; @@ -25,20 +25,16 @@ index 000000000..7b1f07c7e + private static FlameCord instance; + + public static void initialize(final Logger logger, final Collection whitelistedAddresses) { -+ if (FlameCord.instance != null) { -+ instance.reload(logger, whitelistedAddresses); -+ } else { -+ FlameCord.instance = new FlameCord(logger, whitelistedAddresses); ++ if (FlameCord.instance == null) { ++ FlameCord.instance = new FlameCord(); + } ++ ++ instance.reload(logger, whitelistedAddresses); + } + + @Getter + private FlameCordConfiguration flameCordConfiguration; + -+ private FlameCord(final Logger logger, final Collection whitelistedAddresses) { -+ reload(logger, whitelistedAddresses); -+ } -+ + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 4a3bbac4..7dad962b 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 86a81c612f510e0df4de517b16e945e2dc7c0658 Mon Sep 17 00:00:00 2001 +From 3f5bcf44e1f1e2d0ea733170d0b22b91dab2111a Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 7b1f07c7e..e5a1464a3 100644 +index f3d5c0290..fb3d8ca2e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -16,7 +16,7 @@ index 7b1f07c7e..e5a1464a3 100644 import lombok.Getter; import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.YamlConfiguration; -@@ -23,6 +24,10 @@ public class FlameCord { +@@ -23,9 +24,16 @@ public class FlameCord { @Getter private FlameCordConfiguration flameCordConfiguration; @@ -24,10 +24,7 @@ index 7b1f07c7e..e5a1464a3 100644 + @Getter + private ModulesConfiguration modulesConfiguration; + - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { - reload(logger, whitelistedAddresses); - } -@@ -31,5 +36,8 @@ public class FlameCord { + public void reload(final Logger logger, final Collection whitelistedAddresses) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index ce1d23bb..a7d205c7 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From f004c19ff82a40117dc6f990d11f817df7db9f38 Mon Sep 17 00:00:00 2001 +From fbf8efb44cceaa714da0ca83a04695ad4ba1c4e3 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index e5a1464a3..4585406a7 100644 +index fb3d8ca2e..676ba95b9 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -23,9 +23,9 @@ index e5a1464a3..4585406a7 100644 + @Getter + private MessagesConfiguration messagesConfiguration; - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { - reload(logger, whitelistedAddresses); -@@ -39,5 +42,6 @@ public class FlameCord { + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); +@@ -35,5 +38,6 @@ public class FlameCord { // FlameCord - Module System this.modulesConfiguration = new ModulesConfiguration(configurationProvider); diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index c7e263a5..1c47a73c 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 0c10165a6a2d73b6deae77f79eab6b029ff183c8 Mon Sep 17 00:00:00 2001 +From de84936f395fac9bb4a6f478ce4a4e71b5c0db38 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -27,7 +27,7 @@ index 20edd9001..f48f1e60b 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 4585406a7..10708f4db 100644 +index 676ba95b9..13e90af77 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,10 @@ package dev._2lstudios.flamecord; @@ -55,10 +55,10 @@ index 4585406a7..10708f4db 100644 + @Getter + private LoggerWrapper loggerWrapper; + - private FlameCord(final Logger logger, final Collection whitelistedAddresses) { - reload(logger, whitelistedAddresses); - } -@@ -43,5 +57,12 @@ public class FlameCord { + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + +@@ -39,5 +53,12 @@ public class FlameCord { // FlameCord - Module System this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); From d977687532591642aca76c6a741fad7479050c10 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:52:09 -0300 Subject: [PATCH 376/499] Fix Reload Error --- Waterfall-Proxy-Patches/0029-Antibot-System.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 1c47a73c..7bf4d32c 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From de84936f395fac9bb4a6f478ce4a4e71b5c0db38 Mon Sep 17 00:00:00 2001 +From 090bae19f543a83278921718a15bd51d2f91581e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1088,7 +1088,7 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 10a07821a..4271fc078 100644 +index 10a07821a..92772d84a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,178 @@ import net.md_5.bungee.config.Configuration; @@ -1225,7 +1225,7 @@ index 10a07821a..4271fc078 100644 + this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); -+ this.antibotFirewallWhitelist = setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config); ++ this.antibotFirewallWhitelist = new HashSet<>( setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config )); + + // Add local server ips to whitelist + this.antibotFirewallWhitelist.addAll(whitelistedAddresses); From c51561a33126a9d27772b7362c8b5c09b9818648 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:59:20 -0300 Subject: [PATCH 377/499] 1.2.6 From 8bb038fa79045122d7d4dc2f709d527ac0789869 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:19:59 -0300 Subject: [PATCH 378/499] When custom motd protocol is used, set protocol to -1 --- .../0026-Custom-motd-system.patch | 37 ++++++---- ...0028-InitialHandler-Processing-State.patch | 14 ++-- .../0029-Antibot-System.patch | 70 +++++++++---------- .../0030-Allow-Invalid-Names.patch | 8 +-- ...Dont-Process-Links-For-Kick-Messages.patch | 8 +-- 5 files changed, 73 insertions(+), 64 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index fcad17b6..2d3797c3 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From acfaf3a65cf5cefe3b043c9f33c75e8238f6ad41 Mon Sep 17 00:00:00 2001 +From 5d1c639bff7f441f38b883b3003de1a1db6892b3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -index 5589ce1b7..1e928197c 100644 +index 5589ce1b..1e928197 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -15,6 +15,10 @@ public class FlameConfig { @@ -20,7 +20,7 @@ index 5589ce1b7..1e928197c 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e55..0ceddd4eb 100644 +index edecc1e5..0ceddd4e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; @@ -136,7 +136,7 @@ index edecc1e55..0ceddd4eb 100644 this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java new file mode 100644 -index 000000000..9587bccda +index 00000000..9587bccd --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java @@ -0,0 +1,48 @@ @@ -190,7 +190,7 @@ index 000000000..9587bccda +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java new file mode 100644 -index 000000000..6c386e16f +index 00000000..6c386e16 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java @@ -0,0 +1,275 @@ @@ -471,7 +471,7 @@ index 000000000..6c386e16f +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java new file mode 100644 -index 000000000..c1f05cd0a +index 00000000..c1f05cd0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java @@ -0,0 +1,33 @@ @@ -510,7 +510,7 @@ index 000000000..c1f05cd0a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java new file mode 100644 -index 000000000..5457ead64 +index 00000000..5457ead6 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java @@ -0,0 +1,17 @@ @@ -533,7 +533,7 @@ index 000000000..5457ead64 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java new file mode 100644 -index 000000000..792e9f987 +index 00000000..792e9f98 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java @@ -0,0 +1,28 @@ @@ -567,7 +567,7 @@ index 000000000..792e9f987 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java new file mode 100644 -index 000000000..0b039c797 +index 00000000..0b039c79 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java @@ -0,0 +1,29 @@ @@ -601,7 +601,7 @@ index 000000000..0b039c797 + +} 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 abed08d4f..031c007db 100644 +index abed08d4..ea5ffb11 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -613,20 +613,26 @@ index abed08d4f..031c007db 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -275,8 +277,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); +- final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); ++ ++ // FlameCord - Custom motd system ++ // Make the protocol not final ++ int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -338,7 +339,52 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { +@@ -338,7 +342,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { - pingBack.done( getPingInfo( motd, protocol ), null ); -+ // FlameCord - Custom MOTD ++ // FlameCord - Custom motd system ++ // Get the configuration + final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); + + String motd; @@ -653,6 +659,9 @@ index abed08d4f..031c007db 100644 + + if (config.isProtocolEnabled()) { + protocolName = config.getProtocolName(); ++ ++ // Set the protocol to -1 to show up protocol name ++ protocol = -1; + } else { + protocolName = bungee.getName() + " " + bungee.getGameVersion(); + } diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index ffd11350..7f6e5339 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From c1d3520f305de336c57904f742e2cd035cfd009f Mon Sep 17 00:00:00 2001 +From 7d0b3d549c1ce54e990b92deffd9e902f371b932 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 031c007db..afc790048 100644 +index ea5ffb11..7d654e7f 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -30,8 +30,8 @@ index 031c007db..afc790048 100644 + thisState = State.PROCESSING; ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -397,6 +398,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + +@@ -404,6 +405,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index 031c007db..afc790048 100644 unsafe.sendPacket( ping ); -@@ -408,6 +410,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -415,6 +417,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index 031c007db..afc790048 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -481,6 +484,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -488,6 +491,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index 031c007db..afc790048 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -817,14 +821,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -824,14 +828,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 7bf4d32c..3a05f4c0 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,11 +1,11 @@ -From 090bae19f543a83278921718a15bd51d2f91581e Mon Sep 17 00:00:00 2001 +From 7ef9d2d1d78b4097f5659b7c39339cd2f54fc5cc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..f48f1e60b 100644 +index 20edd900..f48f1e60 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,17 @@ @@ -27,7 +27,7 @@ index 20edd9001..f48f1e60b 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b9..13e90af77 100644 +index 676ba95b..13e90af7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -3,6 +3,10 @@ package dev._2lstudios.flamecord; @@ -74,7 +74,7 @@ index 676ba95b9..13e90af77 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 000000000..5e7fa6bfb +index 00000000..5e7fa6bf --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,36 @@ @@ -116,7 +116,7 @@ index 000000000..5e7fa6bfb +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..e8c80ad08 +index 00000000..e8c80ad0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,162 @@ @@ -284,7 +284,7 @@ index 000000000..e8c80ad08 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..bd14f56a1 +index 00000000..bd14f56a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,48 @@ @@ -338,7 +338,7 @@ index 000000000..bd14f56a1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 000000000..1503ac954 +index 00000000..1503ac95 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java @@ -0,0 +1,40 @@ @@ -384,7 +384,7 @@ index 000000000..1503ac954 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 000000000..018aacd2c +index 00000000..018aacd2 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,140 @@ @@ -530,7 +530,7 @@ index 000000000..018aacd2c +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 000000000..682e1c314 +index 00000000..682e1c31 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,32 @@ @@ -568,7 +568,7 @@ index 000000000..682e1c314 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 000000000..df26a3634 +index 00000000..df26a363 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,28 @@ @@ -602,7 +602,7 @@ index 000000000..df26a3634 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 000000000..165963629 +index 00000000..16596362 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,45 @@ @@ -653,7 +653,7 @@ index 000000000..165963629 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 000000000..a7bd9f153 +index 00000000..a7bd9f15 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java @@ -0,0 +1,69 @@ @@ -728,7 +728,7 @@ index 000000000..a7bd9f153 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 000000000..7189a7f37 +index 00000000..7189a7f3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java @@ -0,0 +1,115 @@ @@ -849,7 +849,7 @@ index 000000000..7189a7f37 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 000000000..82401d240 +index 00000000..82401d24 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,62 @@ @@ -917,7 +917,7 @@ index 000000000..82401d240 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..0165d1bf8 +index 00000000..0165d1bf --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,33 @@ @@ -956,7 +956,7 @@ index 000000000..0165d1bf8 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 000000000..68cc4c217 +index 00000000..68cc4c21 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,46 @@ @@ -1008,7 +1008,7 @@ index 000000000..68cc4c217 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 000000000..44d773abe +index 00000000..44d773ab --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java @@ -0,0 +1,75 @@ @@ -1088,7 +1088,7 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 10a07821a..92772d84a 100644 +index 10a07821..92772d84 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,178 @@ import net.md_5.bungee.config.Configuration; @@ -1289,7 +1289,7 @@ index 10a07821a..92772d84a 100644 } catch (final IOException e) { e.printStackTrace(); diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 21381bb45..37bccaebd 100644 +index 21381bb4..37bccaeb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -90,6 +90,22 @@ public class MessagesConfiguration extends FlameConfig { @@ -1317,7 +1317,7 @@ index 21381bb45..37bccaebd 100644 for (final String key : configuration.getKeys()) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 000000000..285810ea1 +index 00000000..285810ea --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ @@ -1328,7 +1328,7 @@ index 000000000..285810ea1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 -index 000000000..c19c4965d +index 00000000..c19c4965 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java @@ -0,0 +1,5 @@ @@ -1339,7 +1339,7 @@ index 000000000..c19c4965d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 000000000..7f26e7a0d +index 00000000..7f26e7a0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1372,7 +1372,7 @@ index 000000000..7f26e7a0d +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f7..a1af4e09e 100644 +index 6316143f..a1af4e09 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1415,7 +1415,7 @@ index 6316143f7..a1af4e09e 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c9e45b915..022f94b2d 100644 +index c9e45b91..022f94b2 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -723,4 +723,8 @@ public enum Protocol @@ -1428,7 +1428,7 @@ index c9e45b915..022f94b2d 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d371426..403ccba98 100644 +index c0d37142..403ccba9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1445,7 +1445,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee0..173b47f33 100644 +index fb81adee..173b47f3 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1515,7 +1515,7 @@ index fb81adee0..173b47f33 100644 } } 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 afc790048..4a560c080 100644 +index 7d654e7f..e493babc 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; @@ -1528,7 +1528,7 @@ index afc790048..4a560c080 100644 import dev._2lstudios.flamecord.configuration.FlameConfig; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; -@@ -441,6 +442,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -448,6 +449,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1540,7 +1540,7 @@ index afc790048..4a560c080 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -452,6 +458,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -459,6 +465,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1563,7 +1563,7 @@ index afc790048..4a560c080 100644 break; case 2: // Login -@@ -463,6 +485,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -470,6 +492,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1585,7 +1585,7 @@ index afc790048..4a560c080 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -527,6 +564,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -534,6 +571,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1645,7 +1645,7 @@ index afc790048..4a560c080 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4e..667364aea 100644 +index 66332af4..667364ae 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,11 +4,16 @@ import com.google.common.base.Preconditions; @@ -1699,7 +1699,7 @@ index 66332af4e..667364aea 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e4..1e3608fa4 100644 +index e2911d5e..1e3608fa 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; @@ -1731,7 +1731,7 @@ index e2911d5e4..1e3608fa4 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..3fce5ff11 100644 +index 14e3004f..3fce5ff1 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1760,7 +1760,7 @@ index 14e3004fc..3fce5ff11 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea15992..f04fdd9ce 100644 +index ffea1599..f04fdd9c 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 @@ -59,6 +59,20 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 05f97608..944a34f5 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 310d53ea2c39ebbd29e640f171b009fd6d6d38b1 Mon Sep 17 00:00:00 2001 +From ba4fc7fab09928f0c8dacc872e12c4c580ffcf3f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 4271fc078..0d2013508 100644 +index 92772d84..45cedb88 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -30,10 +30,10 @@ index 4271fc078..0d2013508 100644 loadAntibot(configuration, whitelistedAddresses); 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 4a560c080..143ec97c9 100644 +index e493babc..91608a62 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 -@@ -523,7 +523,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -530,7 +530,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch index f0c5e687..b82443bd 100644 --- a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch @@ -1,11 +1,11 @@ -From 872ee5166ec9b7eef7e0567540ef44d711ef9b4d Mon Sep 17 00:00:00 2001 +From 05eccf5906fa6f137b08ded2215473c786826a6f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a9..2bb27e670 100644 +index 4371374a..2bb27e67 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent @@ -117,10 +117,10 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 143ec97c9..25e3311d7 100644 +index 91608a62..c2546d80 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 -@@ -848,7 +848,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -855,7 +855,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { From ec0272de13709cc4e25978daa8a3fba8ae0df87f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:21:14 -0300 Subject: [PATCH 379/499] 1.2.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index e43145ca..84808b5b 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From a864f5c2836ec41b9269c9b2dc1e4137bf33b6f8 Mon Sep 17 00:00:00 2001 +From 43583869d931d5c6105737405ecef62fc08bec8e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36f..966d2442b 100644 +index da0efa36..966d2442 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..863e9f8c0 100644 +index 8617cdc7..9d5676fe 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,12 +27,12 @@ index 8617cdc7a..863e9f8c0 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.6"; ++ return "1.2.7"; } public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03c..aeda79639 100644 +index 820f7b03..aeda7963 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03c..aeda79639 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b2b199969 100644 +index 0c1ecfb8..b2b19996 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler From 2bb8478252096ebf1dd7caf68df66e1d90828a0a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:27:35 -0300 Subject: [PATCH 380/499] Fix compilation errors --- .../0026-Custom-motd-system.patch | 20 ++++++------------- ...0028-InitialHandler-Processing-State.patch | 14 ++++++------- .../0029-Antibot-System.patch | 12 +++++------ .../0030-Allow-Invalid-Names.patch | 6 +++--- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +++--- 5 files changed, 25 insertions(+), 33 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 2d3797c3..d580b03e 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 5d1c639bff7f441f38b883b3003de1a1db6892b3 Mon Sep 17 00:00:00 2001 +From 6a0de8838bbeae629fa93f378c5de9a96a77e567 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -601,7 +601,7 @@ index 00000000..0b039c79 + +} 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 abed08d4..ea5ffb11 100644 +index abed08d4..17a6d422 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -613,20 +613,15 @@ index abed08d4..ea5ffb11 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -275,8 +277,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); -- final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -+ -+ // FlameCord - Custom motd system -+ // Make the protocol not final -+ int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() - { -@@ -338,7 +342,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -338,7 +339,53 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { @@ -659,9 +654,6 @@ index abed08d4..ea5ffb11 100644 + + if (config.isProtocolEnabled()) { + protocolName = config.getProtocolName(); -+ -+ // Set the protocol to -1 to show up protocol name -+ protocol = -1; + } else { + protocolName = bungee.getName() + " " + bungee.getGameVersion(); + } @@ -678,7 +670,7 @@ index abed08d4..ea5ffb11 100644 + } + + pingBack.done( new ServerPing( -+ new ServerPing.Protocol( protocolName, protocol ), ++ new ServerPing.Protocol( protocolName, config.isProtocolEnabled() ? -1 : protocol ), + new ServerPing.Players( maxPlayers, onlinePlayers, sample ), + motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); } diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index 7f6e5339..e5ed7f67 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 7d0b3d549c1ce54e990b92deffd9e902f371b932 Mon Sep 17 00:00:00 2001 +From 55a4cd7ea03250f77adbb6a4db54e5b6806a561e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 ea5ffb11..7d654e7f 100644 +index 17a6d422..76186242 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -30,8 +30,8 @@ index ea5ffb11..7d654e7f 100644 + thisState = State.PROCESSING; ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - -@@ -404,6 +405,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); +@@ -398,6 +399,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -39,7 +39,7 @@ index ea5ffb11..7d654e7f 100644 unsafe.sendPacket( ping ); -@@ -415,6 +417,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -409,6 +411,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -47,7 +47,7 @@ index ea5ffb11..7d654e7f 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -488,6 +491,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -482,6 +485,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -55,7 +55,7 @@ index ea5ffb11..7d654e7f 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -824,14 +828,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -818,14 +822,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 3a05f4c0..68c80b4d 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 7ef9d2d1d78b4097f5659b7c39339cd2f54fc5cc Mon Sep 17 00:00:00 2001 +From 90614978e2607cb8f7002ca92f86eef141f07513 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1515,7 +1515,7 @@ index fb81adee..173b47f3 100644 } } 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 7d654e7f..e493babc 100644 +index 76186242..fb059af6 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; @@ -1528,7 +1528,7 @@ index 7d654e7f..e493babc 100644 import dev._2lstudios.flamecord.configuration.FlameConfig; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; -@@ -448,6 +449,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -442,6 +443,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1540,7 +1540,7 @@ index 7d654e7f..e493babc 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -459,6 +465,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +459,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1563,7 +1563,7 @@ index 7d654e7f..e493babc 100644 break; case 2: // Login -@@ -470,6 +492,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -464,6 +486,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1585,7 +1585,7 @@ index 7d654e7f..e493babc 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -534,6 +571,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -528,6 +565,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 944a34f5..6343f63b 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From ba4fc7fab09928f0c8dacc872e12c4c580ffcf3f Mon Sep 17 00:00:00 2001 +From 225edfb76492efe4a8da98c8c409833e55dd29a2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -30,10 +30,10 @@ index 92772d84..45cedb88 100644 loadAntibot(configuration, whitelistedAddresses); 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 e493babc..91608a62 100644 +index fb059af6..e7d9615b 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 -@@ -530,7 +530,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,7 +524,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); thisState = State.PROCESSING_USERNAME; diff --git a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch index b82443bd..0abd9af0 100644 --- a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 05eccf5906fa6f137b08ded2215473c786826a6f Mon Sep 17 00:00:00 2001 +From 2a2888ef82e36588d5b507ff0c2bd7542fead254 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 91608a62..c2546d80 100644 +index e7d9615b..b26015da 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 -@@ -855,7 +855,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -849,7 +849,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { From bcf3cb1c92704602958f1b339ac9364ef2beff18 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:35:42 -0300 Subject: [PATCH 381/499] Apply colors to protocol name --- Waterfall-Proxy-Patches/0026-Custom-motd-system.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index d580b03e..f6d8cde3 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 6a0de8838bbeae629fa93f378c5de9a96a77e567 Mon Sep 17 00:00:00 2001 +From 12e8cf7f28a7ceb0533ffc1c51a42e203f374a4f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,7 +20,7 @@ index 5589ce1b..1e928197 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e5..0ceddd4e 100644 +index edecc1e5..c81dc002 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; @@ -94,7 +94,7 @@ index edecc1e5..0ceddd4e 100644 + @Getter + private boolean protocolEnabled = false; + @Getter -+ private String protocolName = "FlameCord 1.7-1.19"; ++ private String protocolName = "&c&lMaintenance"; + + @Getter + private boolean maxPlayersEnabled = false; @@ -123,7 +123,7 @@ index edecc1e5..0ceddd4e 100644 + this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); + this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); + this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); -+ this.protocolName = setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration); ++ this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); + this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); + this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); + this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); From 010004ada5b928825d259f7be9e8233b5cf45c21 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:36:36 -0300 Subject: [PATCH 382/499] 1.2.7 From dbb1423f4943ef98b406faa8503bea02931ab16e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 18 Jan 2023 21:58:34 -0300 Subject: [PATCH 383/499] Fix Sample IndexOutOfBounds Exception --- Waterfall-Proxy-Patches/0026-Custom-motd-system.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index f6d8cde3..c63073c7 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 12e8cf7f28a7ceb0533ffc1c51a42e203f374a4f Mon Sep 17 00:00:00 2001 +From 44e41f7854f933e40371fc85cefdf2991e2fb255 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,7 +20,7 @@ index 5589ce1b..1e928197 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e5..c81dc002 100644 +index edecc1e5..b148a717 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; @@ -58,9 +58,9 @@ index edecc1e5..c81dc002 100644 + String sample; + + if (protocol >= 735) { -+ sample = hexSamples.get(new Random().nextInt(hexMotds.size())); ++ sample = hexSamples.get(new Random().nextInt(hexSamples.size())); + } else { -+ sample = samples.get(new Random().nextInt(motds.size())); ++ sample = samples.get(new Random().nextInt(samples.size())); + } + + sample = sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); From 4342ee8952b505e9d67eefb337a407c2577db03a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 18 Jan 2023 23:51:21 -0300 Subject: [PATCH 384/499] Re-add delayedClose() to show kick message --- ...ections-Don-t-flush-if-not-necessary.patch | 45 ++++--------------- ...14-Use-pipeline-to-reduce-redundancy.patch | 6 +-- ...tom-uuids-even-if-onlineMode-is-true.patch | 6 +-- ...0028-InitialHandler-Processing-State.patch | 6 +-- 4 files changed, 17 insertions(+), 46 deletions(-) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index cb2f681f..540e0e85 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From 2350677d6e3b948d9c20e34a1c047f5b355b3bb4 Mon Sep 17 00:00:00 2001 +From 716258911e93c1acca2ec1d9dc12aad0a8b736c5 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 c3543a18d..b7be53b4c 100644 +index c3543a18..8ed26e5c 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 @@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -58,21 +58,11 @@ index c3543a18d..b7be53b4c 100644 } @Override -@@ -692,7 +712,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - if ( canSendKickMessage() ) - { -- ch.delayedClose( new Kick( ComponentSerializer.toString( reason ) ) ); -+ // FlameCord - Changed delayedClose to close -+ ch.close( new Kick( ComponentSerializer.toString( reason ) ) ); - } else - { - ch.close(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f5..5c05f2b94 100644 +index 6dc5633f..4e59a9c9 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -80,40 +80,27 @@ public class ChannelWrapper +@@ -80,15 +80,17 @@ public class ChannelWrapper if ( packet != null && ch.isActive() ) { @@ -88,30 +78,11 @@ index 6dc5633f5..5c05f2b94 100644 } } -+ // FlameCord - Deprecate and "disable" delayedClose because it doesn't have a reason to exist + @Deprecated public void delayedClose(final Kick kick) { -- if ( !closing ) -- { -- closing = true; -- -- // Minecraft client can take some time to switch protocols. -- // Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it. -- // Delay 250ms to ensure that the protocol switch (if any) has definitely taken place. -- ch.eventLoop().schedule( new Runnable() -- { -- -- @Override -- public void run() -- { -- close( kick ); -- } -- }, 250, TimeUnit.MILLISECONDS ); -- } -+ close(kick); - } - + if ( !closing ) +@@ -113,7 +115,7 @@ public class ChannelWrapper public void addBefore(String baseName, String name, ChannelHandler handler) { Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); @@ -121,7 +92,7 @@ index 6dc5633f5..5c05f2b94 100644 } 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 2a21243b9..a95193ba7 100644 +index 2a21243b..a95193ba 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -162,7 +133,7 @@ index 2a21243b9..a95193ba7 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b2b199969..ba130a5df 100644 +index b2b19996..ba130a5d 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch index 2a4b8ca8..9547d663 100644 --- a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From 64097a804bbce407306eca64329053a0105a7c8f Mon Sep 17 00:00:00 2001 +From 87453f17739226749f746f68240c40b2e7925390 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 5c05f2b94..606866a52 100644 +index 4e59a9c9..92617f88 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -40,7 +40,7 @@ index 5c05f2b94..606866a52 100644 } public void write(Object packet) -@@ -111,25 +117,27 @@ public class ChannelWrapper +@@ -126,25 +132,27 @@ public class ChannelWrapper public void setCompressionThreshold(int compressionThreshold) { diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 2b597787..7bc2ea29 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 407344a066199a42e7fa17a2d1b3fc4be2d095bf Mon Sep 17 00:00:00 2001 +From 047ea04ae1cf8277e6c2eed87dc0d5fd901efe91 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 b7be53b4c..8715821fe 100644 +index 8ed26e5c..4242b9c8 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 -@@ -770,7 +770,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch index e5ed7f67..37a2b9ab 100644 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 55a4cd7ea03250f77adbb6a4db54e5b6806a561e Mon Sep 17 00:00:00 2001 +From 71ecdb3b03100bce3909c27fe835458e252d8ee0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:28:31 -0300 Subject: [PATCH] InitialHandler Processing State 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 17a6d422..76186242 100644 +index 11496f05..97928f32 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 @@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -55,7 +55,7 @@ index 17a6d422..76186242 100644 if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -818,14 +822,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -817,14 +821,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void setOnlineMode(boolean onlineMode) { From 78eb708ce7d281e34343f8733d0bf034d9eb1bf4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 18 Jan 2023 23:53:13 -0300 Subject: [PATCH 385/499] Dont close on incorrect magic --- ...connections-Don-t-flush-if-not-necessary.patch | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 540e0e85..d2f7b0cf 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 716258911e93c1acca2ec1d9dc12aad0a8b736c5 Mon Sep 17 00:00:00 2001 +From ca4c3aa2c642d3aebd6c87780902eb2ea272167d Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -132,19 +132,6 @@ index 2a21243b..a95193ba 100644 + } } } -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index b2b19996..ba130a5d 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -71,6 +71,8 @@ public class QueryHandler extends SimpleChannelInboundHandler - if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) - { - bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); -+ // FlameCord - Close on incorrect magic -+ ctx.channel().close(); - return; - } - -- 2.37.3.windows.1 From 0d6105717c19bc59049804676246341d64eff562 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 19 Jan 2023 11:10:59 -0300 Subject: [PATCH 386/499] Reuse Getter Objects --- .../0029-Antibot-System.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 68c80b4d..0f83dc73 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From 90614978e2607cb8f7002ca92f86eef141f07513 Mon Sep 17 00:00:00 2001 +From c635b80415955f5991853168099b9db34b4a6bd6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1088,7 +1088,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 10a07821..92772d84 100644 +index 3789d6b5..24ae600b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,178 @@ import net.md_5.bungee.config.Configuration; @@ -1372,7 +1372,7 @@ index 00000000..7f26e7a0 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f..a1af4e09 100644 +index 6316143f..aa538f74 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1382,18 +1382,18 @@ index 6316143f..a1af4e09 100644 + + // FlameCord start - Antibot Packet Check + if (prot == protocol.TO_SERVER) { -+ dev._2lstudios.flamecord.enums.PacketsCheckResult result = FlameCord.getInstance().getCheckManager().getPacketsCheck() -+ .check(ctx.channel().remoteAddress(), in); ++ dev._2lstudios.flamecord.antibot.PacketsCheck packetsCheck = FlameCord.getInstance().getCheckManager().getPacketsCheck(); ++ dev._2lstudios.flamecord.enums.PacketsCheckResult result = packetsCheck.check(ctx.channel().remoteAddress(), in); + + switch (result) { + case KICK: -+ FlameCord.getInstance().getCheckManager().getPacketsCheck().getData(ctx.channel().remoteAddress()).printKick(); ++ packetsCheck.getData(ctx.channel().remoteAddress()).printKick(); + + in.skipBytes(in.readableBytes()); + ctx.close(); + return; + case CANCEL: -+ FlameCord.getInstance().getCheckManager().getPacketsCheck().getData(ctx.channel().remoteAddress()).printCancel(); ++ packetsCheck.getData(ctx.channel().remoteAddress()).printCancel(); + + in.skipBytes(in.readableBytes()); + return; @@ -1515,7 +1515,7 @@ index fb81adee..173b47f3 100644 } } 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 76186242..fb059af6 100644 +index 97928f32..e0546840 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; From 832fc5b4f863f85e4281567da634a13e8978b098 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:00:27 -0300 Subject: [PATCH 387/499] Remove deprecation from delayed Close --- ...-connections-Don-t-flush-if-not-necessary.patch | 14 ++++---------- .../0014-Use-pipeline-to-reduce-redundancy.patch | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index d2f7b0cf..1922c3a8 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From ca4c3aa2c642d3aebd6c87780902eb2ea272167d Mon Sep 17 00:00:00 2001 +From 9c6dd2dc6ee18d5429d098b5a5d1963cfd404856 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -59,10 +59,10 @@ index c3543a18..8ed26e5c 100644 @Override diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..4e59a9c9 100644 +index 6dc5633f..8b0fac0a 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -80,15 +80,17 @@ public class ChannelWrapper +@@ -80,10 +80,11 @@ public class ChannelWrapper if ( packet != null && ch.isActive() ) { @@ -76,13 +76,7 @@ index 6dc5633f..4e59a9c9 100644 ch.close(); } } - } - -+ @Deprecated - public void delayedClose(final Kick kick) - { - if ( !closing ) -@@ -113,7 +115,7 @@ public class ChannelWrapper +@@ -113,7 +114,7 @@ public class ChannelWrapper public void addBefore(String baseName, String name, ChannelHandler handler) { Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch index 9547d663..d056e727 100644 --- a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -1,11 +1,11 @@ -From 87453f17739226749f746f68240c40b2e7925390 Mon Sep 17 00:00:00 2001 +From 33c937b0b20e6ad8994c21258841d5330443c2fe Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:30:07 +0800 Subject: [PATCH] Use pipeline to reduce redundancy diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 4e59a9c9..92617f88 100644 +index 8b0fac0a..b3fa4835 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -5,6 +5,8 @@ import io.netty.channel.Channel; @@ -40,7 +40,7 @@ index 4e59a9c9..92617f88 100644 } public void write(Object packet) -@@ -126,25 +132,27 @@ public class ChannelWrapper +@@ -125,25 +131,27 @@ public class ChannelWrapper public void setCompressionThreshold(int compressionThreshold) { From f91f82aff32278f748c564c8074b800a84ccc0c5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 19 Jan 2023 15:43:43 -0300 Subject: [PATCH 388/499] 1.2.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 84808b5b..78b24c0a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 43583869d931d5c6105737405ecef62fc08bec8e Mon Sep 17 00:00:00 2001 +From 507a1abb6dd83065dbb2bd3eca85ee9d3f1895e8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..9d5676fe 100644 +index 8617cdc7..ec3b250f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..9d5676fe 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.7"; ++ return "1.2.8"; } public final void reloadMessages() From 6d15d6dc3b7fd3e69e8b2358687b4c1085b76cf2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 21 Jan 2023 20:45:10 -0300 Subject: [PATCH 389/499] Return the IPSet system --- .../0029-Antibot-System.patch | 158 ++++++++++++++++-- .../0030-Allow-Invalid-Names.patch | 8 +- .../0037-Bungee-Plugins-Command.patch | 10 +- .../0038-Bungee-IP-Command.patch | 10 +- 4 files changed, 161 insertions(+), 25 deletions(-) diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0029-Antibot-System.patch index 0f83dc73..a924194b 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0029-Antibot-System.patch @@ -1,4 +1,4 @@ -From c635b80415955f5991853168099b9db34b4a6bd6 Mon Sep 17 00:00:00 2001 +From 52f2f75fe7a9da5fef08f526301f33acfdd996ab Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -27,11 +27,17 @@ index 20edd900..f48f1e60 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..13e90af7 100644 +index 676ba95b..1d2fbbde 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -3,6 +3,10 @@ package dev._2lstudios.flamecord; +@@ -1,8 +1,16 @@ + package dev._2lstudios.flamecord; + ++import java.io.IOException; import java.util.Collection; ++import java.util.Iterator; ++import java.util.concurrent.ConcurrentHashMap; ++import java.util.logging.Level; import java.util.logging.Logger; +import dev._2lstudios.flamecord.antibot.AddressDataManager; @@ -41,7 +47,21 @@ index 676ba95b..13e90af7 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import dev._2lstudios.flamecord.configuration.MessagesConfiguration; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -31,6 +35,16 @@ public class FlameCord { +@@ -13,8 +21,13 @@ import net.md_5.bungee.config.YamlConfiguration; + public class FlameCord { + @Getter + private static FlameCord instance; ++ private static Runtime runtime; + + public static void initialize(final Logger logger, final Collection whitelistedAddresses) { ++ if (FlameCord.runtime == null) { ++ FlameCord.runtime = Runtime.getRuntime(); ++ } ++ + if (FlameCord.instance == null) { + FlameCord.instance = new FlameCord(); + } +@@ -31,6 +44,16 @@ public class FlameCord { @Getter private MessagesConfiguration messagesConfiguration; @@ -58,7 +78,7 @@ index 676ba95b..13e90af7 100644 public void reload(final Logger logger, final Collection whitelistedAddresses) { final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -@@ -39,5 +53,12 @@ public class FlameCord { +@@ -39,5 +62,106 @@ public class FlameCord { // FlameCord - Module System this.modulesConfiguration = new ModulesConfiguration(configurationProvider); this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); @@ -69,6 +89,100 @@ index 676ba95b..13e90af7 100644 + this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); + this.statsData = new StatsData(); + this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); ++ ++ // Initialize antibot firewall ipset ++ if (flameCordConfiguration.isAntibotFirewallIpset()) { ++ runLinuxCommand("apt install iptables -y"); // Install iptables ++ runLinuxCommand("apt install ipset -y"); // Install ipset ++ runLinuxCommand("ipset destroy flamecord-firewall"); // Delete old FlameCord set ++ runLinuxCommand("ipset create flamecord-firewall hash:ip timeout 60"); // Create new FlameCord set ++ runLinuxCommand("iptables -I INPUT -m set --match-set flamecord-firewall src -j DROP"); // Create iptables rule to DROP ++ ++ // Thread to run queued firewall linux commands ++ new Thread(() -> { ++ FlameCord flameCord = FlameCord.getInstance(); ++ ++ while (!flameCord.isShuttingDown()) { ++ flameCord.runQueuedLinuxCommands(); ++ ++ try { ++ Thread.sleep(1000); ++ } catch (InterruptedException e) { ++ // Ignore ++ } ++ } ++ }).start(); ++ } ++ } ++ ++ private boolean shutdown = false; ++ ++ public boolean isShuttingDown() { ++ return shutdown; ++ } ++ ++ public void shutdown() { ++ this.shutdown = true; ++ } ++ ++ /** ++ * Utility to run a Linux commands for iptables. ++ * @param command ++ */ ++ public void runLinuxCommand(String command) { ++ try { ++ runtime.exec("/bin/sh -c " + command); ++ } catch (IOException e) { ++ /* ++ * Windows throws exception. ++ */ ++ } ++ } ++ ++ // Commands to execute in the queue ++ private Collection commandQueue = ConcurrentHashMap.newKeySet(); ++ ++ // Boolean for when the commands are processing ++ private boolean processing = false; ++ ++ /** ++ * Add command to the linux command queue ++ * @param command ++ */ ++ public void queueLinuxCommand(String command) { ++ commandQueue.add(command); ++ } ++ ++ /** ++ * Run the queued linux commands ++ */ ++ public void runQueuedLinuxCommands() { ++ if (!commandQueue.isEmpty() && !processing) { ++ processing = true; ++ ++ try { ++ Iterator iterator = commandQueue.iterator(); ++ StringBuilder commands = new StringBuilder(); ++ int ranCommands = 0; ++ ++ while (iterator.hasNext()) { ++ String command = iterator.next(); ++ ++ if (ranCommands++ > 0) { ++ commands.append(" && "); ++ } ++ ++ commands.append(command); ++ iterator.remove(); ++ } ++ ++ runLinuxCommand(commands.toString()); ++ ++ getLoggerWrapper().log(Level.INFO, "Blacklisted " + ranCommands + " ips from the kernel with IPSet"); ++ } finally { ++ processing = false; ++ } ++ } } } \ No newline at end of file @@ -116,10 +230,10 @@ index 00000000..5e7fa6bf +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 00000000..e8c80ad0 +index 00000000..7c789983 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java -@@ -0,0 +1,162 @@ +@@ -0,0 +1,165 @@ +package dev._2lstudios.flamecord.antibot; + +import java.util.Collection; @@ -250,6 +364,9 @@ index 00000000..e8c80ad0 + if (!FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewallWhitelist().contains(hostString)) { + this.lastFirewall = System.currentTimeMillis(); + this.firewallReason = reason; ++ ++ // Queue the firewall as a ipset linux command ++ FlameCord.getInstance().queueLinuxCommand("ipset add flamecord-firewall " + hostString); + } + } + @@ -1088,10 +1205,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 3789d6b5..24ae600b 100644 +index 3789d6b5..53cd4386 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,178 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,181 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1135,6 +1252,8 @@ index 3789d6b5..24ae600b 100644 + @Getter + private boolean antibotFirewallLog = true; + @Getter ++ private boolean antibotFirewallIpset = true; ++ @Getter + private Collection antibotFirewallWhitelist = Arrays.asList("127.0.0.1"); + + // Antibot nickname @@ -1226,6 +1345,7 @@ index 3789d6b5..24ae600b 100644 + this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); + this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); + this.antibotFirewallWhitelist = new HashSet<>( setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config )); ++ this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); + + // Add local server ips to whitelist + this.antibotFirewallWhitelist.addAll(whitelistedAddresses); @@ -1270,7 +1390,7 @@ index 3789d6b5..24ae600b 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +299,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +302,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1278,7 +1398,7 @@ index 3789d6b5..24ae600b 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -135,6 +308,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -135,6 +311,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -1514,6 +1634,22 @@ index fb81adee..173b47f3 100644 break; } } +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index c9f1acac..44e28adc 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer + } catch (InterruptedException ignored) {} + } + ++ // FlameCord start - Antibot System ++ FlameCord.getInstance().shutdown(); ++ getLogger().info( "Shutting down FlameCord linux command thread" ); ++ // FlameCord end - Antibot System ++ + getLogger().info( "Thank you and goodbye" ); + // Need to close loggers after last message! + org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 97928f32..e0546840 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch index 6343f63b..82eff89a 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 225edfb76492efe4a8da98c8c409833e55dd29a2 Mon Sep 17 00:00:00 2001 +From 54cee231a4b229c684159e1d3ad28e00ae8a0468 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 92772d84..45cedb88 100644 +index 53cd4386..378372ec 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 92772d84..45cedb88 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -308,6 +312,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -311,6 +315,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -30,7 +30,7 @@ index 92772d84..45cedb88 100644 loadAntibot(configuration, whitelistedAddresses); 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 fb059af6..e7d9615b 100644 +index e0546840..c4d962f3 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 @@ -524,7 +524,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch index 267f9027..83aa9b58 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch @@ -1,11 +1,11 @@ -From 52db599859d1d0386b83e99022f3852dd6ebef78 Mon Sep 17 00:00:00 2001 +From 0b23f1413bc1a65fd96bdbae435039ab59b30b0d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 37bccaebd..af3d90788 100644 +index 37bccaeb..af3d9078 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -100,11 +100,17 @@ public class MessagesConfiguration extends FlameConfig { @@ -29,7 +29,7 @@ index 37bccaebd..af3d90788 100644 diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java new file mode 100644 -index 000000000..2e20e9dca +index 00000000..2e20e9dc --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java @@ -0,0 +1,45 @@ @@ -79,7 +79,7 @@ index 000000000..2e20e9dca + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 857b0b622..71cc494d7 100644 +index 44e28adc..705196d5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -90,7 +90,7 @@ index 857b0b622..71cc494d7 100644 import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -@@ -907,5 +908,8 @@ public class BungeeCord extends ProxyServer +@@ -912,5 +913,8 @@ public class BungeeCord extends ProxyServer // Flamecord Command pluginManager.registerCommand(null, new FlameCordCommand(this)); diff --git a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch index 9edede95..c32fdef8 100644 --- a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch @@ -1,11 +1,11 @@ -From e54a7fe3282e6e230dc34b04df738055041063cf Mon Sep 17 00:00:00 2001 +From c4d231e86a3042c7e116ab273826237619e7cadb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index af3d90788..34b4a6305 100644 +index af3d9078..34b4a630 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -112,6 +112,12 @@ public class MessagesConfiguration extends FlameConfig { @@ -23,7 +23,7 @@ index af3d90788..34b4a6305 100644 for (final String key : configuration.getKeys()) { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java new file mode 100644 -index 000000000..85313491e +index 00000000..85313491 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java @@ -0,0 +1,45 @@ @@ -73,7 +73,7 @@ index 000000000..85313491e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 71cc494d7..992584d4f 100644 +index 705196d5..64fef85f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -84,7 +84,7 @@ index 71cc494d7..992584d4f 100644 import dev._2lstudios.flamecord.commands.BungeePluginsCommand; import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -911,5 +912,8 @@ public class BungeeCord extends ProxyServer +@@ -916,5 +917,8 @@ public class BungeeCord extends ProxyServer // FlameCord - Bungee Plugins Command pluginManager.registerCommand(null, new BungeePluginsCommand()); From 33805e43fe4f5e74e18240961dd26a0a217f8e80 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 10:08:57 -0300 Subject: [PATCH 390/499] Improvements to processing state --- ...System.patch => 0028-Antibot-System.patch} | 61 ++++++++- ...0028-InitialHandler-Processing-State.patch | 77 ----------- ...s.patch => 0029-Allow-Invalid-Names.patch} | 8 +- ...030-Disable-entity-Metadata-Rewrite.patch} | 56 ++++---- ...1-Dont-frame-unreadable-connections.patch} | 4 +- ...> 0032-Avoid-throwing-IOOB-on-login.patch} | 4 +- ...ion-fail-reason-when-detailed-logge.patch} | 4 +- ...034-Optimize-Decoder-Encoder-Getter.patch} | 4 +- ...ont-Process-Links-For-Kick-Messages.patch} | 6 +- ...atch => 0036-Bungee-Plugins-Command.patch} | 2 +- ...and.patch => 0037-Bungee-IP-Command.patch} | 2 +- ...t.patch => 0038-List-Command-Format.patch} | 6 +- ...0039-InitialHandler-Processing-State.patch | 124 ++++++++++++++++++ 13 files changed, 227 insertions(+), 131 deletions(-) rename Waterfall-Proxy-Patches/{0029-Antibot-System.patch => 0028-Antibot-System.patch} (96%) delete mode 100644 Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch rename Waterfall-Proxy-Patches/{0030-Allow-Invalid-Names.patch => 0029-Allow-Invalid-Names.patch} (91%) rename Waterfall-Proxy-Patches/{0031-Disable-entity-Metadata-Rewrite.patch => 0030-Disable-entity-Metadata-Rewrite.patch} (99%) rename Waterfall-Proxy-Patches/{0032-Dont-frame-unreadable-connections.patch => 0031-Dont-frame-unreadable-connections.patch} (90%) rename Waterfall-Proxy-Patches/{0033-Avoid-throwing-IOOB-on-login.patch => 0032-Avoid-throwing-IOOB-on-login.patch} (89%) rename Waterfall-Proxy-Patches/{0034-Only-show-connection-fail-reason-when-detailed-logge.patch => 0033-Only-show-connection-fail-reason-when-detailed-logge.patch} (92%) rename Waterfall-Proxy-Patches/{0035-Optimize-Decoder-Encoder-Getter.patch => 0034-Optimize-Decoder-Encoder-Getter.patch} (96%) rename Waterfall-Proxy-Patches/{0036-Dont-Process-Links-For-Kick-Messages.patch => 0035-Dont-Process-Links-For-Kick-Messages.patch} (96%) rename Waterfall-Proxy-Patches/{0037-Bungee-Plugins-Command.patch => 0036-Bungee-Plugins-Command.patch} (98%) rename Waterfall-Proxy-Patches/{0038-Bungee-IP-Command.patch => 0037-Bungee-IP-Command.patch} (98%) rename Waterfall-Proxy-Patches/{0039-List-Command-Format.patch => 0038-List-Command-Format.patch} (93%) create mode 100644 Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch diff --git a/Waterfall-Proxy-Patches/0029-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch similarity index 96% rename from Waterfall-Proxy-Patches/0029-Antibot-System.patch rename to Waterfall-Proxy-Patches/0028-Antibot-System.patch index a924194b..be873680 100644 --- a/Waterfall-Proxy-Patches/0029-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 52f2f75fe7a9da5fef08f526301f33acfdd996ab Mon Sep 17 00:00:00 2001 +From ebaf26bfedd5d3b94dd0a5d68a6b49653fd6265d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1651,7 +1651,7 @@ index c9f1acac..44e28adc 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 97928f32..e0546840 100644 +index 11496f05..58afe04f 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 @@ -22,7 +22,8 @@ import javax.crypto.SecretKey; @@ -1664,7 +1664,30 @@ index 97928f32..e0546840 100644 import dev._2lstudios.flamecord.configuration.FlameConfig; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; -@@ -442,6 +443,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -409,6 +410,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(Handshake handshake) throws Exception + { + Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); ++ ++ // FlameCord start - Antibot System ++ // Close and firewall on invalid protocol ++ int protocol = handshake.getRequestedProtocol(); ++ ++ if (protocol != 1 && protocol != 2) { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Invalid handshake protocol"); ++ } ++ ++ ch.close(); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + this.handshake = handshake; + ch.setVersion( handshake.getProtocolVersion() ); + ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); +@@ -439,6 +456,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1676,7 +1699,7 @@ index 97928f32..e0546840 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -453,6 +459,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -450,6 +472,27 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1691,6 +1714,11 @@ index 97928f32..e0546840 100644 + FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is pinging too fast", ch.getRemoteAddress() ); + } + ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Too many pings"); ++ } ++ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); + return; + } @@ -1699,7 +1727,7 @@ index 97928f32..e0546840 100644 break; case 2: // Login -@@ -464,6 +486,21 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +504,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1713,6 +1741,11 @@ index 97928f32..e0546840 100644 + FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is connecting too fast", ch.getRemoteAddress() ); + } + ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Too many connections"); ++ } ++ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } @@ -1721,7 +1754,7 @@ index 97928f32..e0546840 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -528,6 +565,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,6 +587,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1866,6 +1899,22 @@ index e2911d5e..1e3608fa 100644 try { callback.done( null, cause ); +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index b3fa4835..6f1d8336 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -154,4 +154,11 @@ public class ChannelWrapper + pipeline.remove( "decompress" ); + } + } ++ ++ // FlameCord start - Antibot System ++ // Make the channel accessible ++ public Channel getChannel() { ++ return ch; ++ } ++ // FlameCord end - Antibot System + } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index 14e3004f..3fce5ff1 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java diff --git a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch deleted file mode 100644 index 37a2b9ab..00000000 --- a/Waterfall-Proxy-Patches/0028-InitialHandler-Processing-State.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 71ecdb3b03100bce3909c27fe835458e252d8ee0 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 25 Feb 2022 12:28:31 -0300 -Subject: [PATCH] InitialHandler Processing State - - -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 11496f05..97928f32 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 -@@ -132,12 +132,12 @@ public class InitialHandler extends PacketHandler implements PendingConnection - private enum State - { - -- HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; -+ PROCESSING, PROCESSING_USERNAME, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; - } - - private boolean canSendKickMessage() - { -- return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -+ return thisState == State.PROCESSING_USERNAME || thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; - } - - @Override -@@ -275,6 +275,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(StatusRequest statusRequest) throws Exception - { - Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); -+ thisState = State.PROCESSING; - - ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -398,6 +399,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - // FlameCord - Never accept invalid packets - Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); -+ thisState = State.PROCESSING; - - unsafe.sendPacket( ping ); - -@@ -409,6 +411,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(Handshake handshake) throws Exception - { - Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ thisState = State.PROCESSING; - this.handshake = handshake; - ch.setVersion( handshake.getProtocolVersion() ); - ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -482,6 +485,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(LoginRequest loginRequest) throws Exception - { - Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); -+ thisState = State.PROCESSING_USERNAME; - - if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) - { -@@ -817,14 +821,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void setOnlineMode(boolean onlineMode) - { -- Preconditions.checkState( thisState == State.USERNAME, "Can only set online mode status whilst state is username" ); -+ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set online mode status whilst state is username" ); - this.onlineMode = onlineMode; - } - - @Override - public void setUniqueId(UUID uuid) - { -- Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); -+ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set uuid while state is username" ); - // FlameCord - Allow custom uuids even if onlineMode is true - this.uniqueId = uuid; - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch similarity index 91% rename from Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch rename to Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 82eff89a..e8b13af0 100644 --- a/Waterfall-Proxy-Patches/0030-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From 54cee231a4b229c684159e1d3ad28e00ae8a0468 Mon Sep 17 00:00:00 2001 +From 2e875b7b56563eca73b62d90ac4b008d5ef894d4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -30,12 +30,12 @@ index 53cd4386..378372ec 100644 loadAntibot(configuration, whitelistedAddresses); 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 e0546840..c4d962f3 100644 +index 58afe04f..86bbe3f4 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 -@@ -524,7 +524,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -546,7 +546,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); - thisState = State.PROCESSING_USERNAME; - if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) diff --git a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch similarity index 99% rename from Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch rename to Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index 9f151e57..b428f5c3 100644 --- a/Waterfall-Proxy-Patches/0031-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,11 +1,11 @@ -From f293b6e489e70340e1f7fd46146bfa75e468a2d1 Mon Sep 17 00:00:00 2001 +From ac8c95238cb74349f3a464b0c5545122d1537878 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index 469fe0e12..97bd384b2 100644 +index 469fe0e1..97bd384b 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java @@ -251,11 +251,6 @@ public interface ProxyConfig @@ -21,7 +21,7 @@ index 469fe0e12..97bd384b2 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index 0c334afcf..88865b851 100644 +index 0c334afc..88865b85 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -49,7 +49,7 @@ index 0c334afcf..88865b851 100644 - // Waterfall end } 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 -index 022f94b2d..970011e8f 100644 +index 022f94b2..970011e8 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -84,7 +84,7 @@ index 022f94b2d..970011e8f 100644 PlayerListItem::new, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java deleted file mode 100644 -index 0ed78a8c4..000000000 +index 0ed78a8c..00000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ /dev/null @@ -1,67 +0,0 @@ @@ -157,7 +157,7 @@ index 0ed78a8c4..000000000 -} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java deleted file mode 100644 -index 435b85789..000000000 +index 435b8578..00000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ /dev/null @@ -1,45 +0,0 @@ @@ -207,7 +207,7 @@ index 435b85789..000000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 966d2442b..be337a680 100644 +index 966d2442..be337a68 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { @@ -239,7 +239,7 @@ index 966d2442b..be337a680 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a07c7c8a..f51c668d7 100644 +index 3a07c7c8..f51c668d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler @@ -324,7 +324,7 @@ index 3a07c7c8a..f51c668d7 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 909227970..f3d60253f 100644 +index 90922797..f3d60253 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -365,7 +365,7 @@ index 909227970..f3d60253f 100644 - // Waterfall end } 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 -index 0ac22ad38..6e425764b 100644 +index 0ac22ad3..6e425764 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -433,7 +433,7 @@ index 0ac22ad38..6e425764b 100644 public void handle(Respawn respawn) { 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 667364aea..10e46779f 100644 +index 667364ae..10e46779 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 @@ -25,7 +25,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -458,7 +458,7 @@ index 667364aea..10e46779f 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index 688ff72d2..000000000 +index 688ff72d..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null @@ -1,372 +0,0 @@ @@ -836,7 +836,7 @@ index 688ff72d2..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java deleted file mode 100644 -index 6db530c3a..000000000 +index 6db530c3..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -1024,7 +1024,7 @@ index 6db530c3a..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java deleted file mode 100644 -index 368221275..000000000 +index 36822127..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1213,7 +1213,7 @@ index 368221275..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java deleted file mode 100644 -index 38e12ce40..000000000 +index 38e12ce4..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1402,7 +1402,7 @@ index 38e12ce40..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java deleted file mode 100644 -index 5f2968394..000000000 +index 5f296839..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1591,7 +1591,7 @@ index 5f2968394..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java deleted file mode 100644 -index f3372f088..000000000 +index f3372f08..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1780,7 +1780,7 @@ index f3372f088..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java deleted file mode 100644 -index 8210b0a7e..000000000 +index 8210b0a7..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -1973,7 +1973,7 @@ index 8210b0a7e..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java deleted file mode 100644 -index c2cf810f3..000000000 +index c2cf810f..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2166,7 +2166,7 @@ index c2cf810f3..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java deleted file mode 100644 -index c8b067071..000000000 +index c8b06707..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2359,7 +2359,7 @@ index c8b067071..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index 7241dc56b..000000000 +index 7241dc56..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null @@ -1,76 +0,0 @@ @@ -2441,7 +2441,7 @@ index 7241dc56b..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java deleted file mode 100644 -index cdc07dc45..000000000 +index cdc07dc4..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +++ /dev/null @@ -1,102 +0,0 @@ @@ -2550,7 +2550,7 @@ index cdc07dc45..000000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java deleted file mode 100644 -index cb9174b35..000000000 +index cb9174b3..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ /dev/null @@ -1,62 +0,0 @@ @@ -2619,7 +2619,7 @@ index cb9174b35..000000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java deleted file mode 100644 -index 8e2dbe699..000000000 +index 8e2dbe69..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +++ /dev/null @@ -1,176 +0,0 @@ @@ -2801,7 +2801,7 @@ index 8e2dbe699..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java deleted file mode 100644 -index d61dc0cba..000000000 +index d61dc0cb..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -2989,7 +2989,7 @@ index d61dc0cba..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java deleted file mode 100644 -index bfbc84327..000000000 +index bfbc8432..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -3177,7 +3177,7 @@ index bfbc84327..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java deleted file mode 100644 -index cb81d1dd8..000000000 +index cb81d1dd..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +++ /dev/null @@ -1,30 +0,0 @@ @@ -3213,7 +3213,7 @@ index cb81d1dd8..000000000 -// Waterfall end \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index caed43849..af4280904 100644 +index caed4384..af428090 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -11,7 +11,6 @@ import lombok.Setter; diff --git a/Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch similarity index 90% rename from Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch rename to Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch index 0622382f..cb483b30 100644 --- a/Waterfall-Proxy-Patches/0032-Dont-frame-unreadable-connections.patch +++ b/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch @@ -1,11 +1,11 @@ -From b35a4719080e02355b7e5651ac302d38ba093f19 Mon Sep 17 00:00:00 2001 +From c3a0de08b9d4d728fe488f5d3b83e19e2766f6ae Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Thu, 4 Aug 2022 23:27:43 +0200 Subject: [PATCH] Dont frame unreadable connections diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index a1af4e09e..c06e506a6 100644 +index aa538f74..99d203c7 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder diff --git a/Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch similarity index 89% rename from Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch rename to Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch index bf18ece0..68aa8311 100644 --- a/Waterfall-Proxy-Patches/0033-Avoid-throwing-IOOB-on-login.patch +++ b/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch @@ -1,11 +1,11 @@ -From b529f3bea516105b004b0f408a542309bdf6d157 Mon Sep 17 00:00:00 2001 +From 8a2c6364c6c2e36eaa918195ca370382a37debee Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:41:48 -0300 Subject: [PATCH] Avoid throwing IOOB on login diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 763d34c2f..57e50a8b6 100644 +index 763d34c2..57e50a8b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java @@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket diff --git a/Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch similarity index 92% rename from Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch rename to Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch index b2bf1789..6df0d6cf 100644 --- a/Waterfall-Proxy-Patches/0034-Only-show-connection-fail-reason-when-detailed-logge.patch +++ b/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -1,4 +1,4 @@ -From 8bfc6056ed2800af6d48d1a1a8c8a2c532578a7d Mon Sep 17 00:00:00 2001 +From 981d25c1f3b03e1c2f10427811c7690c64c2e967 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:27 +0100 Subject: [PATCH] Only show connection fail reason when detailed logger is @@ -6,7 +6,7 @@ Subject: [PATCH] Only show connection fail reason when detailed logger is 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 f3d60253f..021fe8398 100644 +index f3d60253..021fe839 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer diff --git a/Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch b/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch similarity index 96% rename from Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch rename to Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch index 4ae1b9d2..e4bd12bc 100644 --- a/Waterfall-Proxy-Patches/0035-Optimize-Decoder-Encoder-Getter.patch +++ b/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch @@ -1,11 +1,11 @@ -From 26e41d9fe50272a8da3ab5ee4b2579f445ec9780 Mon Sep 17 00:00:00 2001 +From 69f3e68d5a12bcaf0423d2c18da6b51a8d38d998 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 28 Dec 2022 14:23:54 -0300 Subject: [PATCH] Optimize Decoder/Encoder Getter diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 606866a52..497ca8559 100644 +index 6f1d8336..b98ee6a7 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -31,26 +31,42 @@ public class ChannelWrapper diff --git a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch similarity index 96% rename from Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch rename to Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index 0abd9af0..5de5b505 100644 --- a/Waterfall-Proxy-Patches/0036-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 2a2888ef82e36588d5b507ff0c2bd7542fead254 Mon Sep 17 00:00:00 2001 +From 683c324fe88f0888354197969cf5ae3b866ee5aa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 e7d9615b..b26015da 100644 +index 86bbe3f4..f6ee8962 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 -@@ -849,7 +849,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -871,7 +871,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch similarity index 98% rename from Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch rename to Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch index 83aa9b58..02340bcf 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch @@ -1,4 +1,4 @@ -From 0b23f1413bc1a65fd96bdbae435039ab59b30b0d Mon Sep 17 00:00:00 2001 +From 67d06f64115453c920b0a596c59301a6167a93aa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch similarity index 98% rename from Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch rename to Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch index c32fdef8..23f01332 100644 --- a/Waterfall-Proxy-Patches/0038-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch @@ -1,4 +1,4 @@ -From c4d231e86a3042c7e116ab273826237619e7cadb Mon Sep 17 00:00:00 2001 +From 7c646bd7d69fcef97ee37642bc4ea3269a53eff5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/Waterfall-Proxy-Patches/0039-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch similarity index 93% rename from Waterfall-Proxy-Patches/0039-List-Command-Format.patch rename to Waterfall-Proxy-Patches/0038-List-Command-Format.patch index 804a2685..f1bac330 100644 --- a/Waterfall-Proxy-Patches/0039-List-Command-Format.patch +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -1,11 +1,11 @@ -From 2554e3976ae6b01337b4a65785d257f91a30947d Mon Sep 17 00:00:00 2001 +From f217a96188ebda80c60e8d83e1bf4795cedc6ad2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:34 -0300 Subject: [PATCH] List Command Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 5af35f897..3f261ca69 100644 +index 34b4a630..febf19b4 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -118,6 +118,9 @@ public class MessagesConfiguration extends FlameConfig { @@ -19,7 +19,7 @@ index 5af35f897..3f261ca69 100644 for (final String key : configuration.getKeys()) { diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c22271105..0a5899319 100644 +index c2227110..0a589931 100644 --- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java @@ -25,6 +25,9 @@ public class CommandList extends Command diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch new file mode 100644 index 00000000..ba4c934e --- /dev/null +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -0,0 +1,124 @@ +From dcc971086c035a9a81d1e0a1fdaa3372b7734e0c Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 22 Jan 2023 09:41:36 -0300 +Subject: [PATCH] InitialHandler Processing State + + +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 f6ee8962..ea1a120b 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 +@@ -136,6 +136,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; + } + ++ // FlameCord start - InitialHandler Processing State ++ private boolean processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + private boolean canSendKickMessage() + { + return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; +@@ -276,6 +280,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(StatusRequest statusRequest) throws Exception + { + Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request STATUS while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); +@@ -390,6 +398,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + thisState = State.PING; ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State + } + + private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); +@@ -399,6 +410,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + // FlameCord - Never accept invalid packets + Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request PING while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + unsafe.sendPacket( ping ); + +@@ -410,7 +425,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(Handshake handshake) throws Exception + { + Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); +- ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request HANDSHAKE while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State ++ + // FlameCord start - Antibot System + // Close and firewall on invalid protocol + int protocol = handshake.getRequestedProtocol(); +@@ -493,6 +512,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + // FlameCord end - Antibot System + ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + break; + case 2: + // Login +@@ -535,6 +558,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + return; + } ++ ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + break; + default: + throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); +@@ -545,6 +573,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(LoginRequest loginRequest) throws Exception + { + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request USERNAME while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + { +@@ -672,6 +704,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.FINISHING; + finish(); + } ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State + } + }; + +@@ -685,6 +720,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); + Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); + thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request ENCRYPT while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + // Waterfall start +-- +2.37.3.windows.1 + From 5890df587b2465e3fd881ce1dbbe45bc6d03ca4d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 10:49:18 -0300 Subject: [PATCH 391/499] Accounts Check Whitelist + Performance Improvements --- .../0028-Antibot-System.patch | 220 ++++++++++-------- .../0029-Allow-Invalid-Names.patch | 10 +- ...0030-Disable-entity-Metadata-Rewrite.patch | 8 +- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +- ...0039-InitialHandler-Processing-State.patch | 24 +- 5 files changed, 141 insertions(+), 127 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index be873680..8d6747aa 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From ebaf26bfedd5d3b94dd0a5d68a6b49653fd6265d Mon Sep 17 00:00:00 2001 +From ec86380c37a0c8ed6e2fbe626939287c33908e4c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -188,34 +188,45 @@ index 676ba95b..1d2fbbde 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..5e7fa6bf +index 00000000..11ee4574 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java -@@ -0,0 +1,36 @@ +@@ -0,0 +1,47 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; +import java.util.Collection; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class AccountsCheck { + private FlameCordConfiguration config; -+ private final AddressDataManager addressDataManager; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; + + public AccountsCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); + this.addressDataManager = addressDataManager; + } + -+ public boolean check(final SocketAddress socketAddress, final String nickname) { ++ public boolean check(final SocketAddress remoteAddress, final String nickname) { + if (config.isAntibotAccountsEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final Collection nicknames = addressData.getNicknames(); + ++ if (config.getAntibotAccountsWhitelist().contains(addressData.getHostString())) { ++ return false; ++ } ++ + if (nicknames.size() > config.getAntibotAccountsLimit()) { + nicknames.remove(nickname); ++ ++ if ( config.isAntibotAccountsLog() ) ++ { ++ logger.log( Level.INFO, "[FlameCord] [{0}] has too many accounts", remoteAddress ); ++ } + + if (config.isAntibotAccountsFirewall()) { + addressData.firewall("Too many accounts"); @@ -501,10 +512,10 @@ index 00000000..1503ac95 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 00000000..018aacd2 +index 00000000..fdfd9c8d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java -@@ -0,0 +1,140 @@ +@@ -0,0 +1,148 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.File; @@ -515,6 +526,7 @@ index 00000000..018aacd2 +import java.net.SocketAddress; +import java.net.URL; +import java.nio.file.Files; ++import java.util.logging.Level; + +import com.maxmind.db.CHMCache; +import com.maxmind.db.MaxMindDbConstructor; @@ -526,11 +538,13 @@ index 00000000..018aacd2 + +public class CountryCheck { + private FlameCordConfiguration config; -+ private final AddressDataManager addressDataManager; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; + private Reader maxMindReader; + + public CountryCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + @@ -620,20 +634,25 @@ index 00000000..018aacd2 + return null; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress remoteAddress) { + if (config.isAntibotCountryEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final String addressCountry = addressData.getCountry(); + final String country; + + if (addressCountry != null) { + country = addressCountry; + } else { -+ country = getIsoCode(((InetSocketAddress) socketAddress).getAddress()); ++ country = getIsoCode(((InetSocketAddress) remoteAddress).getAddress()); + addressData.setCountry(country); + } + + if (country != null && isBlacklisted(config, country)) { ++ if (config.isAntibotCountryLog()) { ++ logger.log(Level.INFO, ++ "[FlameCord] [{0}] has his country blocked from the server", remoteAddress); ++ } ++ + if (config.isAntibotCountryFirewall()) { + addressData.firewall("Blacklisted country"); + } @@ -647,31 +666,38 @@ index 00000000..018aacd2 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 00000000..682e1c31 +index 00000000..e2140887 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,39 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class FastChatCheck { + private FlameCordConfiguration config; ++ private LoggerWrapper logger; + private final AddressDataManager addressDataManager; + + public FastChatCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress remoteAddress) { + if (config.isAntibotFastChatEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + + if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { ++ if (config.isAntibotFastChatLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is chatting too fast", remoteAddress); ++ } ++ + if (config.isAntibotFastChatFirewall()) { + addressData.firewall("Too fast chatting"); + } @@ -719,23 +745,26 @@ index 00000000..df26a363 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 00000000..16596362 +index 00000000..1b35fba5 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,52 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class NicknameCheck { + private FlameCordConfiguration config; ++ private LoggerWrapper logger; + private AddressDataManager addressDataManager; + + public NicknameCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + @@ -751,12 +780,16 @@ index 00000000..16596362 + return false; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress remoteAddress) { + if (config.isAntibotNicknameEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final String nickname = addressData.getLastNickname(); + + if (isBlacklisted(config, nickname)) { ++ if (config.isAntibotNicknameLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", remoteAddress); ++ } ++ + if (config.isAntibotNicknameFirewall()) { + addressData.firewall("Blacklisted nickname [" + nickname + "]"); + } @@ -966,13 +999,14 @@ index 00000000..7189a7f3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 00000000..82401d24 +index 00000000..68555de3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java -@@ -0,0 +1,62 @@ +@@ -0,0 +1,69 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -980,12 +1014,14 @@ index 00000000..82401d24 +public class PasswordCheck { + private FlameCordConfiguration config; + private AddressDataManager addressDataManager; ++ private LoggerWrapper logger; + private String lastNickname = ""; + private String lastPassword = ""; + private int repeatCount = 0; + + public PasswordCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + @@ -1004,18 +1040,22 @@ index 00000000..82401d24 + lastPassword = password; + } + -+ public boolean check(final SocketAddress socketAddress, final String passwordMessage) { ++ public boolean check(final SocketAddress remoteAddress, final String passwordMessage) { + if (config.isAntibotPasswordEnabled()) { + if (passwordMessage.contains("/login ") || passwordMessage.contains("/l ") + || passwordMessage.contains("/register ") + || passwordMessage.contains("/reg ")) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final String nickname = addressData.getLastNickname(); + final String password = passwordMessage.split(" ")[1]; + + updatePassword(config, nickname, password); + + if (repeatCount >= config.getAntibotPasswordLimit()) { ++ if (config.isAntibotPasswordLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has entered a repeated password", remoteAddress); ++ } ++ + if (config.isAntibotPasswordFirewall()) { + addressData.firewall("Repeated password"); + } @@ -1034,34 +1074,49 @@ index 00000000..82401d24 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..0165d1bf +index 00000000..7ca2662c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,48 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class RatelimitCheck { + private FlameCordConfiguration config; -+ private final AddressDataManager addressDataManager; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; + + public RatelimitCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress remoteAddress, int protocol) { + if (config.isAntibotRatelimitEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ AddressData addressData = addressDataManager.getAddressData(remoteAddress); + + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { ++ if (config.isAntibotRatelimitLog()) { ++ if (protocol == 1) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is pinging too fast", remoteAddress); ++ } else { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is connecting too fast", remoteAddress); ++ } ++ } ++ + if (config.isAntibotRatelimitFirewall()) { -+ addressData.firewall("Too fast connections"); ++ if (protocol == 1) { ++ addressData.firewall("Too many pings"); ++ } else { ++ addressData.firewall("Too many connections"); ++ } + } + + return true; @@ -1073,29 +1128,32 @@ index 00000000..0165d1bf +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..68cc4c21 +index 00000000..d38ffc9e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java -@@ -0,0 +1,46 @@ +@@ -0,0 +1,53 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class ReconnectCheck { + private FlameCordConfiguration config; -+ private final AddressDataManager addressDataManager; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; + private int connections = 0; + private long lastConnection = 0; + + public ReconnectCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + -+ public boolean check(final SocketAddress socketAddress) { ++ public boolean check(final SocketAddress remoteAddress) { + if (config.isAntibotReconnectEnabled()) { + final long currentTime = System.currentTimeMillis(); + @@ -1105,13 +1163,17 @@ index 00000000..68cc4c21 + } + + if (++connections > config.getAntibotReconnectConnectionThreshold()) { -+ final AddressData addressData = addressDataManager.getAddressData(socketAddress); ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() + || addressData.getTotalPings() < config.getAntibotReconnectPings(); + final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config + .getAntibotReconnectMaxTime(); + + if (tooSlow) { ++ if (config.isAntibotReconnectLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has to reconnect to join", remoteAddress); ++ } ++ + addressData.setTotalConnections(0); + return true; + } else { @@ -1205,10 +1267,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 3789d6b5..53cd4386 100644 +index 3789d6b5..4d84e005 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,181 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,183 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1221,6 +1283,8 @@ index 3789d6b5..53cd4386 100644 + private int antibotAccountsLimit = 3; + @Getter + private boolean antibotAccountsLog = true; ++ @Getter ++ private Collection antibotAccountsWhitelist = Arrays.asList("127.0.0.1"); + + // Antibot country + @Getter @@ -1390,7 +1454,7 @@ index 3789d6b5..53cd4386 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +302,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +304,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1398,7 +1462,7 @@ index 3789d6b5..53cd4386 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -135,6 +311,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -135,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -1651,20 +1715,21 @@ index c9f1acac..44e28adc 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 11496f05..58afe04f 100644 +index 11496f05..19857535 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 -@@ -22,7 +22,8 @@ import javax.crypto.SecretKey; +@@ -22,8 +22,8 @@ import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import dev._2lstudios.flamecord.FlameCord; - +-import dev._2lstudios.flamecord.configuration.FlameConfig; +import dev._2lstudios.flamecord.antibot.AddressData; +import dev._2lstudios.flamecord.antibot.CheckManager; - import dev._2lstudios.flamecord.configuration.FlameConfig; import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; -@@ -409,6 +410,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection + import lombok.RequiredArgsConstructor; +@@ -409,6 +409,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -1687,7 +1752,7 @@ index 11496f05..58afe04f 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -439,6 +456,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -439,6 +455,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1699,7 +1764,7 @@ index 11496f05..58afe04f 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -450,6 +472,27 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -450,6 +471,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1707,18 +1772,8 @@ index 11496f05..58afe04f 100644 + // FlameCord start - Antibot System + addressData.addPing(); + -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is pinging too fast", ch.getRemoteAddress() ); -+ } -+ -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Too many pings"); -+ } -+ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); + return; + } @@ -1727,25 +1782,15 @@ index 11496f05..58afe04f 100644 break; case 2: // Login -@@ -461,6 +504,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +493,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); + // FlameCord start - Antibot System + addressData.addConnection(); + -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress() ) ) ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is connecting too fast", ch.getRemoteAddress() ); -+ } -+ -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Too many connections"); -+ } -+ + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } @@ -1754,7 +1799,7 @@ index 11496f05..58afe04f 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -524,6 +587,58 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,6 +566,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1767,44 +1812,24 @@ index 11496f05..58afe04f 100644 + + if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress(), nickname ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotAccountsLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has too many accounts", ch.getRemoteAddress() ); -+ } -+ + disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); + return; + } + + if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotNicknameLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", ch.getRemoteAddress() ); -+ } -+ + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); + return; + } + + if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotReconnectLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has to reconnect to join", ch.getRemoteAddress() ); -+ } -+ + disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); + return; + } + + if ( checkManager.getCountryCheck().check( ch.getRemoteAddress() ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotCountryLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has his country blocked from the server", ch.getRemoteAddress() ); -+ } -+ + disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); + return; + } @@ -1814,10 +1839,10 @@ index 11496f05..58afe04f 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4..667364ae 100644 +index 66332af4..c16e28c8 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,11 +4,16 @@ import com.google.common.base.Preconditions; +@@ -4,11 +4,15 @@ import com.google.common.base.Preconditions; import com.mojang.brigadier.context.StringRange; import com.mojang.brigadier.suggestion.Suggestion; import com.mojang.brigadier.suggestion.Suggestions; @@ -1829,12 +1854,11 @@ index 66332af4..667364ae 100644 import java.util.LinkedList; import java.util.List; import java.util.UUID; -+import java.util.logging.Level; + import net.md_5.bungee.BungeeCord; import net.md_5.bungee.ServerConnection.KeepAliveData; import net.md_5.bungee.UserConnection; -@@ -207,6 +212,32 @@ public class UpstreamBridge extends PacketHandler +@@ -207,6 +211,22 @@ public class UpstreamBridge extends PacketHandler } Preconditions.checkArgument(!empty, "Chat message is empty"); @@ -1843,22 +1867,12 @@ index 66332af4..667364ae 100644 + + if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFastChatLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is chatting too fast", con.getCh().getRemoteAddress() ); -+ } -+ + con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); + throw CancelSendSignal.INSTANCE; + } + + if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), message ) ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotPasswordLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] has entered a repeated password", con.getCh().getRemoteAddress() ); -+ } -+ + con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); + throw CancelSendSignal.INSTANCE; + } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index e8b13af0..a2130a07 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 2e875b7b56563eca73b62d90ac4b008d5ef894d4 Mon Sep 17 00:00:00 2001 +From 943f4183247b6ffee0599c3c7ea1b66e20e800e0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 53cd4386..378372ec 100644 +index 4d84e005..4853e8c0 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 53cd4386..378372ec 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -311,6 +315,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -313,6 +317,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -30,10 +30,10 @@ index 53cd4386..378372ec 100644 loadAntibot(configuration, whitelistedAddresses); 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 58afe04f..86bbe3f4 100644 +index 19857535..d485dff0 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 -@@ -546,7 +546,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -525,7 +525,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index b428f5c3..d80f3dbc 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From ac8c95238cb74349f3a464b0c5545122d1537878 Mon Sep 17 00:00:00 2001 +From 1a4b10d4833f4c2c0f827ed75897f5187e6ec8ed Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -433,10 +433,10 @@ index 0ac22ad3..6e425764 100644 public void handle(Respawn respawn) { 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 667364ae..10e46779 100644 +index c16e28c8..5a7f3880 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 -@@ -25,7 +25,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; +@@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.SettingsChangedEvent; import net.md_5.bungee.api.event.TabCompleteEvent; @@ -444,7 +444,7 @@ index 667364ae..10e46779 100644 import net.md_5.bungee.forge.ForgeConstants; import net.md_5.bungee.netty.ChannelWrapper; import net.md_5.bungee.netty.PacketHandler; -@@ -145,11 +144,6 @@ public class UpstreamBridge extends PacketHandler +@@ -144,11 +143,6 @@ public class UpstreamBridge extends PacketHandler { if ( con.getServer() != null ) { diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index 5de5b505..ac403bad 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 683c324fe88f0888354197969cf5ae3b866ee5aa Mon Sep 17 00:00:00 2001 +From 90ffabd55d91789d1b92d98c7f19fc01ac4141c3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 86bbe3f4..f6ee8962 100644 +index d485dff0..7efed17f 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 -@@ -871,7 +871,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -830,7 +830,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index ba4c934e..ee7d7aff 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,14 +1,14 @@ -From dcc971086c035a9a81d1e0a1fdaa3372b7734e0c Mon Sep 17 00:00:00 2001 +From d5ab702a2db2b7c1b0868f5c4a4cd37514420e28 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 f6ee8962..ea1a120b 100644 +index 7efed17f..a2a11e81 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 -@@ -136,6 +136,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; } @@ -19,7 +19,7 @@ index f6ee8962..ea1a120b 100644 private boolean canSendKickMessage() { return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -@@ -276,6 +280,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -275,6 +279,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -30,7 +30,7 @@ index f6ee8962..ea1a120b 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -390,6 +398,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -389,6 +397,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.PING; @@ -40,7 +40,7 @@ index f6ee8962..ea1a120b 100644 } private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); -@@ -399,6 +410,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -398,6 +409,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -51,7 +51,7 @@ index f6ee8962..ea1a120b 100644 unsafe.sendPacket( ping ); -@@ -410,7 +425,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -409,7 +424,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -64,7 +64,7 @@ index f6ee8962..ea1a120b 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -493,6 +512,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -482,6 +501,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection } // FlameCord end - Antibot System @@ -75,7 +75,7 @@ index f6ee8962..ea1a120b 100644 break; case 2: // Login -@@ -535,6 +558,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -514,6 +537,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index f6ee8962..ea1a120b 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -545,6 +573,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -524,6 +552,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index f6ee8962..ea1a120b 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -672,6 +704,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -631,6 +663,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index f6ee8962..ea1a120b 100644 } }; -@@ -685,6 +720,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -644,6 +679,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) From 98dce5518b93257b4c95e63ba08bb84fbdc5818c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:50:33 -0300 Subject: [PATCH 392/499] 1.2.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 78b24c0a..605dcc2a 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 507a1abb6dd83065dbb2bd3eca85ee9d3f1895e8 Mon Sep 17 00:00:00 2001 +From 4c4c77b0dadd3ea07e7a3104db9e1410c70d2561 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..ec3b250f 100644 +index 8617cdc7..e7ada9d7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..ec3b250f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.8"; ++ return "1.2.9"; } public final void reloadMessages() From 629495bd3c96fb7e6d3b5e3649ee3402393cab77 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:50:24 -0300 Subject: [PATCH 393/499] Fix error caused during some bot attacks --- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 8d6747aa..6689b7d5 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From ec86380c37a0c8ed6e2fbe626939287c33908e4c Mon Sep 17 00:00:00 2001 +From e6541dfb457e9cbb487d7cab094e9274bfea5651 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -27,7 +27,7 @@ index 20edd900..f48f1e60 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..1d2fbbde 100644 +index 676ba95b..3824cc53 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -85,10 +85,10 @@ index 676ba95b..1d2fbbde 100644 + + // FlameCord - Antibot System + if (checkManager != null) checkManager.unload(); ++ this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); + this.addressDataManager = new AddressDataManager(); + this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); + this.statsData = new StatsData(); -+ this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); + + // Initialize antibot firewall ipset + if (flameCordConfiguration.isAntibotFirewallIpset()) { @@ -1699,7 +1699,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c9f1acac..44e28adc 100644 +index 8d56997e..d892c23c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer From 59a31e05e23cfb552d642dd46436fe637cadf988 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 13:25:33 -0300 Subject: [PATCH 394/499] Antibot Accounts Name Whitelist --- .../0028-Antibot-System.patch | 23 ++++++++++--------- .../0029-Allow-Invalid-Names.patch | 6 ++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 6689b7d5..6459b3fd 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From e6541dfb457e9cbb487d7cab094e9274bfea5651 Mon Sep 17 00:00:00 2001 +From a4ab09bf04f96ed3bf0d8c1aa0142a08ab20f0c9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -188,7 +188,7 @@ index 676ba95b..3824cc53 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..11ee4574 +index 00000000..2fbc230f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,47 @@ @@ -212,14 +212,14 @@ index 00000000..11ee4574 + } + + public boolean check(final SocketAddress remoteAddress, final String nickname) { ++ if (config.getAntibotAccountsWhitelist().contains(nickname)) { ++ return false; ++ } ++ + if (config.isAntibotAccountsEnabled()) { + final AddressData addressData = addressDataManager.getAddressData(remoteAddress); + final Collection nicknames = addressData.getNicknames(); + -+ if (config.getAntibotAccountsWhitelist().contains(addressData.getHostString())) { -+ return false; -+ } -+ + if (nicknames.size() > config.getAntibotAccountsLimit()) { + nicknames.remove(nickname); + @@ -1267,10 +1267,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 3789d6b5..4d84e005 100644 +index 3789d6b5..1fbcde9d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,183 @@ import net.md_5.bungee.config.Configuration; +@@ -16,6 +16,184 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1284,7 +1284,7 @@ index 3789d6b5..4d84e005 100644 + @Getter + private boolean antibotAccountsLog = true; + @Getter -+ private Collection antibotAccountsWhitelist = Arrays.asList("127.0.0.1"); ++ private Collection antibotAccountsWhitelist = Arrays.asList("Nickname"); + + // Antibot country + @Getter @@ -1390,6 +1390,7 @@ index 3789d6b5..4d84e005 100644 + this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); + this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); + this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); ++ this.antibotAccountsWhitelist = setIfUnexistant("antibot.accounts.whitelist", this.antibotAccountsWhitelist, config); + + // Antibot country + this.antibotCountryEnabled = setIfUnexistant("antibot.country.enabled", this.antibotCountryEnabled, config); @@ -1454,7 +1455,7 @@ index 3789d6b5..4d84e005 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +304,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +305,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1462,7 +1463,7 @@ index 3789d6b5..4d84e005 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -135,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -135,6 +314,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index a2130a07..86692b89 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 943f4183247b6ffee0599c3c7ea1b66e20e800e0 Mon Sep 17 00:00:00 2001 +From a33ddde478bbde2b3a44887d67ca9a810d19f61d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 4d84e005..4853e8c0 100644 +index 1fbcde9d..266c2ad9 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 4d84e005..4853e8c0 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -313,6 +317,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -314,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); From 8e47ac27312852b19e9f273adacf51cabd1a3a55 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 13:51:20 -0300 Subject: [PATCH 395/499] Placeholders for Protocol Name feature Custom Motd --- .../0026-Custom-motd-system.patch | 16 ++++++++++------ Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch | 8 ++++---- .../0028-Antibot-System.patch | 10 +++++----- .../0029-Allow-Invalid-Names.patch | 8 ++++---- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index c63073c7..e10d8a79 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 44e41f7854f933e40371fc85cefdf2991e2fb255 Mon Sep 17 00:00:00 2001 +From 6b240a4dfee02eb3762994affbce94c84c829a8f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,10 +20,10 @@ index 5589ce1b..1e928197 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e5..b148a717 100644 +index edecc1e5..b920cf63 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,88 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,92 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -68,6 +68,10 @@ index edecc1e5..b148a717 100644 + return sample.split("\n"); + } + ++ public String getProtocolName(int maxPlayers, int onlinePlayers) { ++ return protocolName.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ } ++ + public int getFakePlayersAmount(final int players) { + switch (fakePlayersMode) { + case "STATIC": @@ -112,7 +116,7 @@ index edecc1e5..b148a717 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +109,21 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +113,21 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -601,7 +605,7 @@ index 00000000..0b039c79 + +} 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 abed08d4..17a6d422 100644 +index 66a34754..23b488d1 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -653,7 +657,7 @@ index abed08d4..17a6d422 100644 + } + + if (config.isProtocolEnabled()) { -+ protocolName = config.getProtocolName(); ++ protocolName = config.getProtocolName(maxPlayers, onlinePlayers); + } else { + protocolName = bungee.getName() + " " + bungee.getGameVersion(); + } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 03127f54..6c3b122d 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 7f3a1472da95624a579d8355541ff63df5dd735f Mon Sep 17 00:00:00 2001 +From 35bab2c97710ecdb12d8d46b216702b833dcfb12 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 22a8ac39d..9912fc25c 100644 +index b920cf63..38e40429 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 22a8ac39d..9912fc25c 100644 public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { String motd; -@@ -123,6 +127,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -127,6 +131,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -28,7 +28,7 @@ index 22a8ac39d..9912fc25c 100644 this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); 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 a4c3bd710..ffea15992 100644 +index a4c3bd71..ffea1599 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 @@ -194,6 +194,8 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 6459b3fd..b83afd16 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From a4ab09bf04f96ed3bf0d8c1aa0142a08ab20f0c9 Mon Sep 17 00:00:00 2001 +From 495e5daadc5dd7bb0a10540acea0a721e233aa0d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1267,7 +1267,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 3789d6b5..1fbcde9d 100644 +index 38e40429..49f831cc 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,184 @@ import net.md_5.bungee.config.Configuration; @@ -1455,7 +1455,7 @@ index 3789d6b5..1fbcde9d 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -127,6 +305,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -131,6 +309,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1463,7 +1463,7 @@ index 3789d6b5..1fbcde9d 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -135,6 +314,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -139,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -1716,7 +1716,7 @@ index 8d56997e..d892c23c 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 11496f05..19857535 100644 +index 23b488d1..e41e94e4 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 86692b89..4e344daf 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From a33ddde478bbde2b3a44887d67ca9a810d19f61d Mon Sep 17 00:00:00 2001 +From ef413893bd49dbd42542cd7aeeaa5426d99cbf86 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1fbcde9d..266c2ad9 100644 +index 49f831cc..b76adb32 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 1fbcde9d..266c2ad9 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -314,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -318,6 +322,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -30,7 +30,7 @@ index 1fbcde9d..266c2ad9 100644 loadAntibot(configuration, whitelistedAddresses); 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 19857535..d485dff0 100644 +index e41e94e4..e478ab9e 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 @@ -525,7 +525,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection From 3a5d644206469223ec69bc71b1fc43fcba1f9775 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:17:07 -0300 Subject: [PATCH 396/499] Always Show Option For Protocol Name Custom Motd --- .../0026-Custom-motd-system.patch | 22 ++++++++++++------- .../0027-TCP-Fast-Open.patch | 6 ++--- .../0028-Antibot-System.patch | 20 ++++++++--------- .../0029-Allow-Invalid-Names.patch | 10 ++++----- ...Dont-Process-Links-For-Kick-Messages.patch | 6 ++--- ...0039-InitialHandler-Processing-State.patch | 20 ++++++++--------- 6 files changed, 45 insertions(+), 39 deletions(-) diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index e10d8a79..1737547c 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,4 +1,4 @@ -From 6b240a4dfee02eb3762994affbce94c84c829a8f Mon Sep 17 00:00:00 2001 +From 40db55725460874e6f2129bdbfa60478bba3fb69 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system @@ -20,10 +20,10 @@ index 5589ce1b..1e928197 100644 return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e5..b920cf63 100644 +index edecc1e5..ab33e071 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,92 @@ package dev._2lstudios.flamecord.configuration; +@@ -3,15 +3,94 @@ package dev._2lstudios.flamecord.configuration; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -99,6 +99,8 @@ index edecc1e5..b920cf63 100644 + private boolean protocolEnabled = false; + @Getter + private String protocolName = "&c&lMaintenance"; ++ @Getter ++ private boolean protocolAlwaysShow = false; + + @Getter + private boolean maxPlayersEnabled = false; @@ -116,7 +118,7 @@ index edecc1e5..b920cf63 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +113,21 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -36,6 +115,22 @@ public class FlameCordConfiguration extends FlameConfig { configuration = configurationProvider.load(configurationFile); } @@ -128,6 +130,7 @@ index edecc1e5..b920cf63 100644 + this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); + this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); + this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); ++ this.protocolAlwaysShow = setIfUnexistant("custom-motd.protocol.always-show", this.protocolAlwaysShow, configuration); + this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); + this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); + this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); @@ -605,7 +608,7 @@ index 00000000..0b039c79 + +} 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 66a34754..23b488d1 100644 +index 66a34754..58be68b0 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -625,7 +628,7 @@ index 66a34754..23b488d1 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -338,7 +339,53 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -338,7 +339,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { @@ -662,6 +665,8 @@ index 66a34754..23b488d1 100644 + protocolName = bungee.getName() + " " + bungee.getGameVersion(); + } + ++ int customProtocol = config.isProtocolEnabled() && config.isProtocolAlwaysShow() ? -1 : protocol; ++ + if (config.isSampleEnabled()) { + final UUID fakeUuid = new UUID(0, 0); + final String[] sampleString = config.getSample(maxPlayers, onlinePlayers, protocol); @@ -671,12 +676,13 @@ index 66a34754..23b488d1 100644 + for (int i = 0; i < sampleString.length; i++) { + sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); + } -+ } ++ } + + pingBack.done( new ServerPing( -+ new ServerPing.Protocol( protocolName, config.isProtocolEnabled() ? -1 : protocol ), ++ new ServerPing.Protocol( protocolName, customProtocol ), + new ServerPing.Players( maxPlayers, onlinePlayers, sample ), + motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); ++ // FlameCord end - Custom motd system } thisState = State.PING; diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 6c3b122d..b327e797 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 35bab2c97710ecdb12d8d46b216702b833dcfb12 Mon Sep 17 00:00:00 2001 +From 6fbdfc541f535fb0b4d18d09f7fb7bd15f0c91d8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b920cf63..38e40429 100644 +index ab33e071..9a3c78e2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index b920cf63..38e40429 100644 public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { String motd; -@@ -127,6 +131,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -130,6 +134,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index b83afd16..0d975eab 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 495e5daadc5dd7bb0a10540acea0a721e233aa0d Mon Sep 17 00:00:00 2001 +From 59fcde54dc18fe434a0782545337603cf6c9305d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1267,7 +1267,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 38e40429..49f831cc 100644 +index 9a3c78e2..8acfb6eb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,184 @@ import net.md_5.bungee.config.Configuration; @@ -1455,7 +1455,7 @@ index 38e40429..49f831cc 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -131,6 +309,7 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -134,6 +312,7 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); @@ -1463,7 +1463,7 @@ index 38e40429..49f831cc 100644 this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -139,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -142,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -1716,7 +1716,7 @@ index 8d56997e..d892c23c 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 23b488d1..e41e94e4 100644 +index 58be68b0..b88e6452 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1730,7 +1730,7 @@ index 23b488d1..e41e94e4 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; import lombok.RequiredArgsConstructor; -@@ -409,6 +409,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -412,6 +412,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -1753,7 +1753,7 @@ index 23b488d1..e41e94e4 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -439,6 +455,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -1765,7 +1765,7 @@ index 23b488d1..e41e94e4 100644 switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -450,6 +471,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1783,7 +1783,7 @@ index 23b488d1..e41e94e4 100644 break; case 2: // Login -@@ -461,6 +493,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -464,6 +496,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1800,7 +1800,7 @@ index 23b488d1..e41e94e4 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -524,6 +566,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +569,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 4e344daf..61ffd6ed 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From ef413893bd49dbd42542cd7aeeaa5426d99cbf86 Mon Sep 17 00:00:00 2001 +From 80933081e2983627c9f8488cf034316c1571f512 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 49f831cc..b76adb32 100644 +index 8acfb6eb..05f7da1d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 49f831cc..b76adb32 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -318,6 +322,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -321,6 +325,9 @@ public class FlameCordConfiguration extends FlameConfig { this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); @@ -30,10 +30,10 @@ index 49f831cc..b76adb32 100644 loadAntibot(configuration, whitelistedAddresses); 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 e41e94e4..e478ab9e 100644 +index b88e6452..e8c14c55 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 -@@ -525,7 +525,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -528,7 +528,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index ac403bad..ef5d401a 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From 90ffabd55d91789d1b92d98c7f19fc01ac4141c3 Mon Sep 17 00:00:00 2001 +From ab1e5d100f2d678f1471fa83226dc9a5af2d370b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 d485dff0..7efed17f 100644 +index e8c14c55..6d0719a0 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 -@@ -830,7 +830,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -833,7 +833,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index ee7d7aff..00c27323 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From d5ab702a2db2b7c1b0868f5c4a4cd37514420e28 Mon Sep 17 00:00:00 2001 +From 477817bdc183b430c925b7b3841e5b51ac632852 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 7efed17f..a2a11e81 100644 +index 6d0719a0..8beed72f 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -30,7 +30,7 @@ index 7efed17f..a2a11e81 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -389,6 +397,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -392,6 +400,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.PING; @@ -40,7 +40,7 @@ index 7efed17f..a2a11e81 100644 } private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); -@@ -398,6 +409,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -401,6 +412,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -51,7 +51,7 @@ index 7efed17f..a2a11e81 100644 unsafe.sendPacket( ping ); -@@ -409,7 +424,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -412,7 +427,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); @@ -64,7 +64,7 @@ index 7efed17f..a2a11e81 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -482,6 +501,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection } // FlameCord end - Antibot System @@ -75,7 +75,7 @@ index 7efed17f..a2a11e81 100644 break; case 2: // Login -@@ -514,6 +537,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -517,6 +540,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index 7efed17f..a2a11e81 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -524,6 +552,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +555,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index 7efed17f..a2a11e81 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -631,6 +663,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -634,6 +666,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index 7efed17f..a2a11e81 100644 } }; -@@ -644,6 +679,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -647,6 +682,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) From 4a4dfdb5b5f12a2f86ae544643e3b3a23be0a04d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:21:36 -0300 Subject: [PATCH 397/499] 1.3.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 605dcc2a..d7e425e0 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 4c4c77b0dadd3ea07e7a3104db9e1410c70d2561 Mon Sep 17 00:00:00 2001 +From 024d33c01dd5a314a1ced1554e6cf13afc8044cc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..e7ada9d7 100644 +index 8617cdc7..0380b689 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..e7ada9d7 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.2.9"; ++ return "1.3.0"; } public final void reloadMessages() From 66847cc801714268b580749134a6f958f68c3edb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 21:09:27 -0300 Subject: [PATCH 398/499] Show Logs/Message on Accounts Limit --- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 0d975eab..9f1ff710 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 59fcde54dc18fe434a0782545337603cf6c9305d Mon Sep 17 00:00:00 2001 +From 808f0c6dff3f8b0944f699680daa9b22b01ac087 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -188,10 +188,10 @@ index 676ba95b..3824cc53 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..2fbc230f +index 00000000..0295ea89 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java -@@ -0,0 +1,47 @@ +@@ -0,0 +1,48 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -208,6 +208,7 @@ index 00000000..2fbc230f + + public AccountsCheck(final AddressDataManager addressDataManager) { + this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + this.addressDataManager = addressDataManager; + } + @@ -1700,7 +1701,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8d56997e..d892c23c 100644 +index 0c559fb0..5889d419 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer From e7aa60273de206bfdecbc8a110ad91bf5872e8eb Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 25 Jan 2023 21:10:31 -0300 Subject: [PATCH 399/499] 1.3.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index d7e425e0..0cc241a4 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 8617cdc7..0380b689 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.0"; ++ return "1.3.1"; } public final void reloadMessages() From d837d28b2fd7e1aecf20faa6ff07fa92a9b8b364 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:14:16 +0100 Subject: [PATCH 400/499] Implement libdeflate compressor --- .../0040-Implement-libdeflate.patch | 2627 +++++++++++++++++ 1 file changed, 2627 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch new file mode 100644 index 00000000..0d290e9f --- /dev/null +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -0,0 +1,2627 @@ +From c637708bcd56e66aa8da77b6bf67bed16348ae6c Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Fri, 27 Jan 2023 14:12:44 +0100 +Subject: [PATCH] Implement libdeflate + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 05f7da1d..1ef7f6a7 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -60,6 +60,8 @@ public class FlameCordConfiguration extends FlameConfig { + @Getter + private int antibotFirewallExpire = 60; + @Getter ++ private int compressionLevel = 6; ++ @Getter + private boolean antibotFirewallLog = true; + @Getter + private boolean antibotFirewallIpset = true; +@@ -318,6 +320,7 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ this.compressionLevel = setIfUnexistant("compression-level", this.compressionLevel, configuration); + + this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); + this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); +diff --git a/native/compile-linux.sh b/native/compile-linux.sh +new file mode 100644 +index 00000000..5442dce9 +--- /dev/null ++++ b/native/compile-linux.sh +@@ -0,0 +1,25 @@ ++#!/bin/bash ++ ++if [ ! "$CC" ]; then ++ # The libdeflate authors recommend that we build using GCC as it produces "slightly faster binaries": ++ # https://github.com/ebiggers/libdeflate#for-unix ++ export CC=gcc ++fi ++ ++if [ ! -d libdeflate ]; then ++ echo "Cloning libdeflate..." ++ git clone https://github.com/ebiggers/libdeflate.git ++fi ++ ++echo "Compiling libdeflate..." ++cd libdeflate || exit ++CFLAGS="-fPIC -O2 -fomit-frame-pointer" make ++cd .. ++ ++CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer" ++ARCH=$(uname -m) ++mkdir -p src/main/resources/linux_$ARCH ++$CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ ++ libdeflate/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so ++$CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_openssl.c \ ++ -o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto +\ No newline at end of file +diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c +new file mode 100644 +index 00000000..aa7d1aba +--- /dev/null ++++ b/native/src/main/c/jni_cipher_macos.c +@@ -0,0 +1,66 @@ ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++typedef unsigned char byte; ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, ++ jclass clazz, ++ jbyteArray key, ++ jboolean encrypt) ++{ ++ jsize keyLen = (*env)->GetArrayLength(env, key); ++ if (keyLen != 16) { ++ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); ++ return 0; ++ } ++ ++ // Since we know the array size is always bounded, we can just use GetArrayRegion ++ // and save ourselves some error-checking headaches. ++ jbyte keyBytes[16]; ++ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); ++ if ((*env)->ExceptionCheck(env)) { ++ return 0; ++ } ++ ++ CCCryptorRef cryptor = NULL; ++ CCCryptorStatus result = CCCryptorCreateWithMode(encrypt ? kCCEncrypt : kCCDecrypt, ++ kCCModeCFB8, ++ kCCAlgorithmAES128, ++ ccNoPadding, ++ keyBytes, ++ keyBytes, ++ 16, ++ NULL, ++ 0, ++ 0, ++ 0, ++ &cryptor); ++ if (result != kCCSuccess) { ++ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); ++ return 0; ++ } ++ return (jlong) cryptor; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, ++ jclass clazz, ++ jlong ptr) ++{ ++ CCCryptorRelease((CCCryptorRef) ptr); ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, ++ jclass clazz, ++ jlong ptr, ++ jlong source, ++ jint len, ++ jlong dest) ++{ ++ CCCryptorUpdate((CCCryptorRef) ptr, (byte*) source, len, (byte*) dest, len, NULL); ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c +new file mode 100644 +index 00000000..83515be5 +--- /dev/null ++++ b/native/src/main/c/jni_cipher_openssl.c +@@ -0,0 +1,62 @@ ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++typedef unsigned char byte; ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, ++ jclass clazz, ++ jbyteArray key, ++ jboolean encrypt) ++{ ++ jsize keyLen = (*env)->GetArrayLength(env, key); ++ if (keyLen != 16) { ++ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); ++ return 0; ++ } ++ ++ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); ++ if (ctx == NULL) { ++ throwException(env, "java/lang/OutOfMemoryError", "allocate cipher"); ++ return 0; ++ } ++ ++ // Since we know the array size is always bounded, we can just use GetArrayRegion ++ // and save ourselves some error-checking headaches. ++ jbyte keyBytes[16]; ++ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); ++ if ((*env)->ExceptionCheck(env)) { ++ return 0; ++ } ++ ++ int result = EVP_CipherInit(ctx, EVP_aes_128_cfb8(), (byte*) keyBytes, (byte*) keyBytes, ++ encrypt); ++ if (result != 1) { ++ EVP_CIPHER_CTX_free(ctx); ++ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); ++ return 0; ++ } ++ return (jlong) ctx; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, ++ jclass clazz, ++ jlong ptr) ++{ ++ EVP_CIPHER_CTX_free((EVP_CIPHER_CTX *) ptr); ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, ++ jclass clazz, ++ jlong ptr, ++ jlong source, ++ jint len, ++ jlong dest) ++{ ++ EVP_CipherUpdate((EVP_CIPHER_CTX*) ptr, (byte*) dest, &len, (byte*) source, len); ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c +new file mode 100644 +index 00000000..1e2b6bd8 +--- /dev/null ++++ b/native/src/main/c/jni_util.c +@@ -0,0 +1,12 @@ ++#include ++#include "jni_util.h" ++ ++void JNICALL ++throwException(JNIEnv *env, const char *type, const char *msg) ++{ ++ jclass klazz = (*env)->FindClass(env, type); ++ ++ if (klazz != 0) { ++ (*env)->ThrowNew(env, klazz, msg); ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h +new file mode 100644 +index 00000000..8938b26c +--- /dev/null ++++ b/native/src/main/c/jni_util.h +@@ -0,0 +1,4 @@ ++#include ++ ++JNIEXPORT void JNICALL ++throwException(JNIEnv *env, const char *type, const char *msg); +\ No newline at end of file +diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c +new file mode 100644 +index 00000000..809a7f85 +--- /dev/null ++++ b/native/src/main/c/jni_zlib_deflate.c +@@ -0,0 +1,43 @@ ++#include ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_init(JNIEnv *env, ++ jclass clazz, ++ jint level) ++{ ++ struct libdeflate_compressor *compressor = libdeflate_alloc_compressor(level); ++ if (compressor == NULL) { ++ // Out of memory! ++ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate compressor"); ++ return 0; ++ } ++ return (jlong) compressor; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_free(JNIEnv *env, ++ jclass clazz, ++ jlong ctx) ++{ ++ libdeflate_free_compressor((struct libdeflate_compressor *) ctx); ++} ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_process(JNIEnv *env, ++ jclass clazz, ++ jlong ctx, ++ jlong sourceAddress, ++ jint sourceLength, ++ jlong destinationAddress, ++ jint destinationLength) ++{ ++ struct libdeflate_compressor *compressor = (struct libdeflate_compressor *) ctx; ++ size_t produced = libdeflate_zlib_compress(compressor, (void *) sourceAddress, sourceLength, ++ (void *) destinationAddress, destinationLength); ++ return (jlong) produced; ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c +new file mode 100644 +index 00000000..d9131908 +--- /dev/null ++++ b/native/src/main/c/jni_zlib_inflate.c +@@ -0,0 +1,61 @@ ++#include ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_init(JNIEnv *env, ++ jclass clazz) ++{ ++ struct libdeflate_decompressor *decompress = libdeflate_alloc_decompressor(); ++ if (decompress == NULL) { ++ // Out of memory! ++ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate decompressor"); ++ return 0; ++ } ++ ++ return (jlong) decompress; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_free(JNIEnv *env, ++ jclass clazz, ++ jlong ctx) ++{ ++ libdeflate_free_decompressor((struct libdeflate_decompressor *) ctx); ++} ++ ++JNIEXPORT jboolean JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_process(JNIEnv *env, ++ jclass clazz, ++ jlong ctx, ++ jlong sourceAddress, ++ jint sourceLength, ++ jlong destinationAddress, ++ jint destinationLength, ++ jlong maximumSize) ++{ ++ struct libdeflate_decompressor *decompress = (struct libdeflate_decompressor *) ctx; ++ enum libdeflate_result result = libdeflate_zlib_decompress(decompress, (void *) sourceAddress, ++ sourceLength, (void *) destinationAddress, destinationLength, NULL); ++ ++ switch (result) { ++ case LIBDEFLATE_SUCCESS: ++ // We are happy ++ return JNI_TRUE; ++ case LIBDEFLATE_BAD_DATA: ++ throwException(env, "java/util/zip/DataFormatException", "inflate data is bad"); ++ return JNI_FALSE; ++ case LIBDEFLATE_SHORT_OUTPUT: ++ case LIBDEFLATE_INSUFFICIENT_SPACE: ++ // These cases are the same for us. We expect the full uncompressed size to be known. ++ throwException(env, "java/util/zip/DataFormatException", "uncompressed size is inaccurate"); ++ return JNI_FALSE; ++ default: ++ // Unhandled case ++ throwException(env, "java/util/zip/DataFormatException", "unknown libdeflate return code"); ++ return JNI_FALSE; ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java +new file mode 100644 +index 00000000..4ba41fc1 +--- /dev/null ++++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java +@@ -0,0 +1,15 @@ ++package com.velocitypowered.natives.compression; ++ ++/** ++ * Represents a native interface for zlib's deflate functions. ++ */ ++ ++//TODO Need refactor and recompile native! ++public class NativeZlibDeflate { ++ ++ public static native long init(int level); ++ ++ public static native long free(long ctx); ++ ++ public static native int process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength); ++} +diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java +new file mode 100644 +index 00000000..81d92e75 +--- /dev/null ++++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java +@@ -0,0 +1,17 @@ ++package com.velocitypowered.natives.compression; ++ ++import java.util.zip.DataFormatException; ++ ++/** ++ * Represents a native interface for zlib's inflate functions. ++ */ ++ ++//TODO Need refactor and recompile native! ++public class NativeZlibInflate { ++ ++ public static native long init(); ++ ++ public static native long free(long ctx); ++ ++ public static native boolean process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength) throws DataFormatException; ++} +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java +new file mode 100644 +index 00000000..a16a2584 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import dev._2lstudios.flamecord.natives.compress.Compressor; ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.ByteBufAllocator; ++ ++public class MoreByteBufUtils { ++ ++ public static ByteBuf ensureCompatible(ByteBufAllocator alloc, Compressor nativeStuff, ByteBuf buf) { ++ if (isCompatible(nativeStuff, buf)) { ++ return buf.retain(); ++ } ++ ++ // It's not, so we must make a direct copy. ++ ByteBuf newBuf = alloc.directBuffer(buf.readableBytes()); ++ newBuf.writeBytes(buf); ++ return newBuf; ++ } ++ ++ private static boolean isCompatible(Compressor nativeStuff, ByteBuf buf) { ++ if (nativeStuff.isNeedDirectBuffer()) { ++ return buf.hasMemoryAddress(); ++ } ++ ++ return true; ++ } ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java +new file mode 100644 +index 00000000..50f042bd +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java +@@ -0,0 +1,36 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.Unpooled; ++ ++public final class NativeEnvironmentDetector { ++ ++ private static final boolean IS_AMD64; ++ private static final boolean IS_AARCH64; ++ private static final boolean CAN_GET_MEMORYADDRESS; ++ ++ static { ++ ByteBuf test = Unpooled.directBuffer(); ++ try { ++ CAN_GET_MEMORYADDRESS = test.hasMemoryAddress(); ++ } ++ finally { ++ test.release(); ++ } ++ ++ String osArch = System.getProperty("os.arch", ""); ++ // HotSpot on Intel macOS prefers x86_64, but OpenJ9 on macOS and HotSpot/OpenJ9 elsewhere ++ // give amd64. ++ IS_AMD64 = osArch.equals("amd64") || osArch.equals("x86_64"); ++ IS_AARCH64 = osArch.equals("aarch64") || osArch.equals("arm64"); ++ } ++ ++ public static boolean isLinux_X86_64() { ++ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AMD64; ++ } ++ ++ public static boolean isLinux_AARCH64() { ++ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AARCH64; ++ } ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java +new file mode 100644 +index 00000000..a6709a86 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java +@@ -0,0 +1,138 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import dev._2lstudios.flamecord.natives.compress.Compressor; ++import dev._2lstudios.flamecord.natives.compress.CompressorFactory; ++import dev._2lstudios.flamecord.natives.compress.JavaCompressor; ++import dev._2lstudios.flamecord.natives.compress.LibdeflateCompressor; ++ ++import java.io.IOException; ++import java.io.InputStream; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.nio.file.StandardCopyOption; ++import java.util.Arrays; ++import java.util.List; ++ ++public class Natives { ++ ++ private static final CompressorFactory COMPRESSOR_FACTORY = loadAvailableCompressFactory(); ++ ++ public static CompressorFactory getCompressorFactory() { ++ return COMPRESSOR_FACTORY; ++ } ++ ++ public static List getAvailableCompressorFactories() { ++ return Arrays.asList(new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Libdeflate (linux_x86_64)"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return NativeEnvironmentDetector.isLinux_X86_64(); ++ } ++ ++ @Override ++ public String getNativePath() { ++ return "/libdeflate_x86_64.so"; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new LibdeflateCompressor(level); ++ } ++ }, new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Libdeflate (linux_aarch64)"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return NativeEnvironmentDetector.isLinux_AARCH64(); ++ } ++ ++ @Override ++ public String getNativePath() { ++ return "/libdeflate_aarch64.so"; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new LibdeflateCompressor(level); ++ } ++ }, new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Java"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return true; ++ } ++ ++ @Override ++ public String getNativePath() { ++ return null; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new JavaCompressor(level); ++ } ++ }); ++ } ++ ++ public static CompressorFactory loadAvailableCompressFactory() { ++ for (CompressorFactory factory : getAvailableCompressorFactories()) { ++ if (factory.isCorrectEnvironment()) { ++ String nativePath = factory.getNativePath(); ++ if (nativePath != null) { ++ try { ++ copyAndLoadNative(nativePath); ++ } ++ catch (Exception ignored) { ++ continue; ++ } ++ } ++ ++ return factory; ++ } ++ } ++ ++ throw new IllegalStateException("None of the compress factories recognized the environment!"); ++ } ++ ++ //Too good method to rewrite ++ private static void copyAndLoadNative(String path) { ++ try { ++ InputStream nativeLib = Natives.class.getResourceAsStream(path); ++ if (nativeLib == null) { ++ throw new IllegalStateException("Native library " + path + " not found."); ++ } ++ ++ Path tempFile = Files.createTempFile("native-", path.substring(path.lastIndexOf('.'))); ++ Files.copy(nativeLib, tempFile, StandardCopyOption.REPLACE_EXISTING); ++ Runtime.getRuntime().addShutdownHook(new Thread(() -> { ++ try { ++ Files.deleteIfExists(tempFile); ++ } ++ catch (IOException ignored) { ++ // Well, it doesn't matter... ++ } ++ })); ++ ++ try { ++ System.load(tempFile.toAbsolutePath().toString()); ++ } ++ catch (UnsatisfiedLinkError e) { ++ throw new RuntimeException("Unable to load native " + tempFile.toAbsolutePath(), e); ++ } ++ } ++ catch (IOException e) { ++ throw new RuntimeException("Unable to copy natives", e); ++ } ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java +new file mode 100644 +index 00000000..f28ae314 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java +@@ -0,0 +1,16 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import io.netty.buffer.ByteBuf; ++ ++import java.io.Closeable; ++import java.util.zip.DataFormatException; ++ ++public interface Compressor extends Closeable { ++ ++ void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException; ++ ++ void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException; ++ ++ boolean isNeedDirectBuffer(); ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java +new file mode 100644 +index 00000000..3aed690a +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java +@@ -0,0 +1,13 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++public interface CompressorFactory { ++ ++ String getName(); ++ ++ boolean isCorrectEnvironment(); ++ ++ String getNativePath(); ++ ++ Compressor create(int level); ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java +new file mode 100644 +index 00000000..7d99eb02 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java +@@ -0,0 +1,90 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import io.netty.buffer.ByteBuf; ++ ++import java.util.zip.DataFormatException; ++import java.util.zip.Deflater; ++import java.util.zip.Inflater; ++ ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkState; ++ ++public class JavaCompressor implements Compressor { ++ ++ private final byte[] buffer = new byte[8192]; //NullCordX ++ ++ private final Deflater deflater; ++ private final Inflater inflater; ++ private boolean disposed = false; ++ ++ public JavaCompressor(int level) { ++ this.deflater = new Deflater(level); ++ this.inflater = new Inflater(); ++ } ++ ++ @Override ++ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException { ++ ensureNotDisposed(); ++ ++ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. ++ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); ++ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); ++ ++ try { ++ byte[] inData = new byte[source.readableBytes()]; ++ source.readBytes(inData); ++ ++ this.inflater.setInput(inData); ++ ++ while (!this.inflater.finished() && this.inflater.getTotalIn() < inData.length) { ++ int count = this.inflater.inflate(this.buffer); ++ destination.writeBytes(this.buffer, 0, count); ++ } ++ ++ } ++ finally { ++ this.inflater.reset(); ++ } ++ } ++ ++ @Override ++ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { ++ ensureNotDisposed(); ++ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. ++ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); ++ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); ++ ++ try { ++ byte[] inData = new byte[source.readableBytes()]; ++ source.readBytes(inData); ++ ++ this.deflater.setInput(inData); ++ this.deflater.finish(); ++ ++ while (!this.deflater.finished()) { ++ int count = this.deflater.deflate(this.buffer); ++ destination.writeBytes(this.buffer, 0, count); ++ } ++ } ++ finally { ++ this.deflater.reset(); ++ } ++ } ++ ++ @Override ++ public void close() { ++ this.disposed = true; ++ this.deflater.end(); ++ this.inflater.end(); ++ } ++ ++ private void ensureNotDisposed() { ++ checkState(!this.disposed, "Object already disposed"); ++ } ++ ++ @Override ++ public boolean isNeedDirectBuffer() { ++ return false; ++ } ++ ++} +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java +new file mode 100644 +index 00000000..fd9f9007 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java +@@ -0,0 +1,83 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import com.google.common.base.Preconditions; ++import com.velocitypowered.natives.compression.NativeZlibDeflate; ++import com.velocitypowered.natives.compression.NativeZlibInflate; ++import io.netty.buffer.ByteBuf; ++ ++import java.util.zip.DataFormatException; ++ ++public class LibdeflateCompressor implements Compressor { ++ ++ private final long inflateCtx; ++ private final long deflateCtx; ++ private boolean disposed = false; ++ ++ public LibdeflateCompressor(int level) { ++ int correctedLevel = level == -1 ? 6 : level; ++ if (correctedLevel > 12 || correctedLevel < 1) { ++ throw new IllegalArgumentException("Invalid compression level " + level); ++ } ++ ++ this.inflateCtx = NativeZlibInflate.init(); ++ this.deflateCtx = NativeZlibDeflate.init(correctedLevel); ++ } ++ ++ @Override ++ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) ++ throws DataFormatException { ++ ensureNotDisposed(); ++ ++ destination.ensureWritable(uncompressedSize); ++ ++ long sourceAddress = source.memoryAddress() + source.readerIndex(); ++ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); ++ ++ NativeZlibInflate.process(this.inflateCtx, sourceAddress, source.readableBytes(), destinationAddress, ++ uncompressedSize); ++ destination.writerIndex(destination.writerIndex() + uncompressedSize); ++ } ++ ++ @Override ++ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { ++ ensureNotDisposed(); ++ ++ while (true) { ++ long sourceAddress = source.memoryAddress() + source.readerIndex(); ++ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); ++ ++ int produced = NativeZlibDeflate.process(this.deflateCtx, sourceAddress, source.readableBytes(), ++ destinationAddress, destination.writableBytes()); ++ if (produced > 0) { ++ destination.writerIndex(destination.writerIndex() + produced); ++ break; ++ } ++ else if (produced == 0) { ++ // Insufficient room - enlarge the buffer. ++ destination.capacity(destination.capacity() * 2); ++ } ++ else { ++ throw new DataFormatException("libdeflate returned unknown code " + produced); ++ } ++ } ++ } ++ ++ private void ensureNotDisposed() { ++ Preconditions.checkState(!this.disposed, "Object already disposed"); ++ } ++ ++ @Override ++ public void close() { ++ if (!this.disposed) { ++ NativeZlibInflate.free(this.inflateCtx); ++ NativeZlibDeflate.free(this.deflateCtx); ++ } ++ this.disposed = true; ++ } ++ ++ @Override ++ public boolean isNeedDirectBuffer() { ++ return true; ++ } ++ ++} +diff --git a/native/src/main/resources/libdeflate_aarch64.so b/native/src/main/resources/libdeflate_aarch64.so +new file mode 100644 +index 0000000000000000000000000000000000000000..284450dd1c3632601b58628619dabee4ea57fa91 +GIT binary patch +literal 74880 +zcmb@v3w%`7x%a>J-jigK3FN|6Kr)j=l<}@ug4Jecf)El#Nz#8k+H-Of4Ge-2-_w9- +zCKoL@s7&P?d#G=dfG8PDYcHOYoWB2(fTcogtKsx^&Up_r3AZp<5e-W=$fVy{|xmn>eDNw%=iQI@=x!Ysz9ai(uf=XA&MIEJ)RxQ<`Z)GH^l_~I#QEEL?0!f5oOn+z<-L*kdn57p66fAH +znTfMKR*kZ8mgBAX^NY{<@p6f?l$C$?9DeKp`R(kqEUVeF;y+Q#GP5<)iXTSX|iyV0_ +zZOMCbqj^!1Q&V%Caxa@>636;=>zm7-UGw~Z)(k9CZ(jHG-Pd3HwDaTH;RAuI!#w`N +ze}+m`SEYXbv7sibYIR{CtpcfBN_!XooAL$sg+AxSg}Gk9k$Z{znO{&(&KKO*zu^9@ +zUvOXe=e$I_N4a;Ye&v5bJ=c6eJ+r@{{8z2|9m?s5HGWU*q<#uP*~+1ANRQokJ%0ZL +zXSv@SFFzxG|K@o4Q2c&D{QfuM_nq;268f_vUeD|C@`?Ko#P2^6zkgf29#vKK(8H@% +zR;_-l=F!Khs#MjY%Dbu_So-MFhnB5=Z0VzwcNMQ#wQ^}?P3?-Mv1gZlQdQSjQ}y7o +zl{G7ttzD`ftABLWH|}VxTl&aj%T}#ar8R$FQ&qR>;i|u1x?)w`vd7juvg#YO@Ickd +zn#Y#?{nFL)?2$*8u3k;ys>Rm5`&KNgoxk+K6*Z47ty;En*<*ig9S=Ubbm?DP$0Luf +zs)NY?ztt>S`PX+RQO94?okSgp?mWEo;nhnYQ=IA^S)(4VS-}{|)x)d)eyLjZ$kLVS +z(WNyHASX*7eRSojDxNYzjB4GARjZdO#;NYQ)vK=il3IA@B2RJEP1oHxHz8U&wnXDd +z{1^Kz|JOeApOlw7Cb}f{L;k%O_(#m1u1dKl{}TSjh#T(AxEvpg`<2A~-n3Zx_b$NJB=#@x3IcC5Ji{h0f460IkpG55#E +z%gQNXZ^gBzjJaPQr$_F`RXqMQMz0P%;v*9O?D6t)Kh7fSQRbNY3Es+ssblVsrQbQ` +z{#bgh8goBkQ>307#@rw4QVPc0j}M6ySLT@eWBF4u=Kk3J-ZSR@IID)(|Lz@gKV!`O +z!aUtjO&3YFUY@#B3vc5$!QsQT@gV(NX$ysy;zS)VK%%^WNYIQ5+0<~WVt +zB#ul?ZOYQkQT&tj%(_nII(N)<8rPmN*WZa +zI+tr*`?UR8T<4Ctc603+bA27xwXy3EeN!hEj+#pS_+s(yqVg`K`g6}W9Vkj~_Pfp(z0gPbLEiPezi_nH +zdRM>juCx~$m!DbVa>k)XCs1GYV9`8NQ@2>O9$Gl+<2~zl@7%!mqR|(B$Kh1I^6Eit +z-Wi8E`tjqtFN|eXzVVy?pkIkTovHX)*I7dko-tHVSLUc^syX@z?U<_Yx3uw-I>s{0 +zvrnjJ(3ltu854qMDt7OvD=m3z7R4}f=SSum!mf4*i-|? +zq!RwPh2P6GRq3*;CCG%ggx{a(uQN5^^4SAsjE3?{@}whHW^TNU@Z_^~*sVIQk3T=j +z^D`Acg5OE*v(WX?YFpPw@O`UIWqokJ*7ZTF7Vw;X^1z4IcuWeOtJAyAA)6yca!`Zb +zQLoYUC;B)_pFg=;jn1atBgS<1pfM#F)|36hpW=yTLC4yW92bp +zg1cjFeK-1Wib>UfcG&*NC?aX!^nD&#&$a$UFQ)o=^&U@j7Y5%0F +zo~UEu?6VJ6dxmN>-HF{(1KilUG4-2PH74LWMZXCcDJi35uXh?nPoP%;F>*|z4x^kdf6S1*L2tB?Vh&4 +zrj~41hU4e=&FS8&CZ@IP%3JhFv{LH#AV<=Fz3IsVVPkTzSJ(YQ$19&iU!3}QPKA__ +z{y1s-gZqoR&eeIkM!m&dAFZC>^~u$um%p-fZ%e%V*85g>5B@27i_|CeBJ@@3DWPP^+5(;m_dv(v^Slg4OQ_A7EUw +z{* +zoce-mmvX^ve=^OitE&25<#&OGII*|Kkn7>1i@%6;5Och^C0?|s*F{}TOLM1L!f +zN8bodxpTJ2Wz;}s(YJ?qHdt}zY?0v#ehcpvWxt63KiAb9XkU^`87b$X|5YlB7M;P6zv^GXW!vmWFW_sKg;h? +zbn-B=D|8leE#q;f;wN40-?N=MiJpu8e?!^)$G>lTS9E`#(*32)ty^Y4q~5K1K%JW1 +z+`MH3TVdG_?8G$mC}vaAg6DZ(ni`N&Pu9)Tu7Js@#dc +z@J%j05T=|HU)P#;`Au)2yE|R~w&h>63Bj{zT19)BYA~-=l|QkoTk6u)lIj`72XfT3 +zh;fCgG!50?N%>qu>#s^zrykB%mAN)^jSIcsw!FGAWaPT_+f;Uw)9G!_Ltk%3#$}w< +zjQ$*FZp6DtRXTZhcvo^)6Z~3{t11WaJGZC_{*W;v`1_BeFAnco(Djlr!7u%j{!IB( +z%9ngIiw}(O{2cXtWMl-x{)JuV7n-A0hKiIpRpnOvSP8Us=ypFbcRxOC^tQXzPtuL) +z{W6{#4K+H75Z{-g0#$kH)Q*{|a&xZA^37D)Isd5|u7a+RF)3JROp1iiGYz}?0laoP +z|80wuTdl))#!O_PZ-%PW9A@A#cys2H;sZ|KWAi$S)f{!@!#%t7)JQ%wx7>XHpW2+g +zTiR^uT|HG*cEI;$_#vHO|!?*ZA$Xl^p1F_HC)rUC*>ad+E0y=yB!0wZ&zcj{Wl*=QcH}hS^_M +zm7d#64(xF5-?Co2>KUJr(ZBJE{afr;?B3!iDs?nzD)K%2fKR1A(_HNGi%hf_j(%yk +z>2lTZ7SEcJkO6G|Vq%U~!{M)04uAb<(}CyU<8x(KkF4bWVtBl=-aE3m{^}8rvis{e +z3Y8wY3LSVxPb)i*j8>*zepAt;;sZg~{w>n)3N1Y-eHT6nkM@j2D-XkyWO$K~(_vjz +zc0!ZLX$LYY^67$4E;S+OR5puG2_EV2=;r+1Ez0)DTw`5kg)eF3OCobQYDPqTNn~wO +zf9n)gAo5@TakMfq-aF!UJ2B?In;6qejCrE`K4c<{oJ#u_w{4#P#+QsaB?ojFPiT;G +z9_OAdwR-L|rufA8cnYmT<7&n<^rz@t(SPUgs=2$JyXjl*GlS5r7+(*%;-pV?80aSW +z`S$gyQaNt+E5OXJ)W%Jd;yA_F2PQeO*W?8^Ve7AJC$!#m%@zP6wbqEpz}V5?#H +zugo_KQu0-S$7arJNm28p{apI2PgDii{fO9ou_NC_&YO`9>5I=$^AvtCA&)Oy(YwXz +z7@0e0qz7L@mrl@E^gHN`G=0guseZ2Tf!O6+I`2B+flqTjL%w@~2O`r_N5_>TbItH7 +ztDZz1*!(Fn24dqx??f-g>gW#SGGt5*?$W15`WTOdE{k70cD?zr*yKz5*taboTWra) +z8g1RC0-g>PC{cemvOYzPmiRamQs1cdoP9YX@@_qJeT6>J?!1;(6{uU6@}1TU)zzAzb%~w~ABk2Lr>m~w +zbgj$dle|uktY-{vwD>BQHDSF4_uOqF%!lgb046R8towyDPc#DHsJ +z@d3q{iGB+2>+F}`RHD?Tr_xnca#5NU^Zf#Ou1N#ZBUW3D?K_GrY5i9g_e^YD?gH#+BIC5)^#;L0@@!v_UfXplV3AO&G(5byk?KV`{C7Q +z&xe#hcD?%8Zc`aHr8z`qMzHN47?%-CtKhklsl?fa`y<2V9^RGKb*xH_X5kwOP2!t$ +zRarP6e?K0-gxwF%Qd!mXcWAuIx~gpMdFk`!@oLEw;=#hQ+=9X~S3#38#k+_+!?G1~ +zR6{+sr9+=;`P>c1i5rZV?eEjI{;9;XV)Mn;3y-U(J$b-sU?bix>albzZXXKa+4_&7 +zm9Db61?PyVqzyav>)gpjT_O50ysNZpls+A+GDkn4e_{GBdLw$EztA?I4BbBnFS6n7 +zhh^rdM!UtkHH()=h*J-1zH%GK=`X9%;a#a+zdax0Y3OjY^7NOny)QpCFi4##&?e<& +zEQF86yN!Un`vAwj_&dY97InGaBF05-6FRwLC|X(Pgm>t>_}91Ili2T4{&mk5DJQ%T +z|N6UdbWVskY>++=r@?>tek@yM)g`NJXIXW@<}|g$2~Spk;yK`i|AUiNma}Yj!Cc0} +z$yhkcuHwio_zrc|PUD^8xqiHuZR2x74v(*Q`1UC@;3G8ah88 +zv&QV1I;`$i#d^TSS>o2AL!8n3t(*_@uQ58s)b0`+)pw~hX2_=eS=z+Yrs_}LeaW1Qk6;jQ?$MU*>( +zZ}~3^TH>=X`oS$nylo;h~&!hQdxx@C!ae +zp7fKNnJRF`n9xs5>K~+iC*!Z<9}@TivNn+TEp7HfpR}RyBd#&+2tFgvrM+UG7BFv6 +zqct`)nz)~!_b|41KDJBcNA@Ep4LRax56VG +zTEd1cD7 +zce_gRwrzT9+7a-Pz3}`9_(-9$TmE&bLoEsCX@SrLEg-qRtE9lnKW)nFam-iUUd=}Q +zr$xlCifoBIhZ`Rhd?=7hU4xCYy4T<5>dsM<-^6I6->Z#?ov2zAW{wd!1HsoQc~(Bh6h0E>%jt&`H@thUR`slbkn} +zOB?hd3Hn<#)$=!$D+EIbGk#|(O#GO`oru>ynQo54%Yg7ya^f?L!&&$l%XN+5ht!K) +zTCr?`hqU*iZ<3lLyv6sq1@G%1Mogh?cs?NGWaGdVlwSrPjwAmfYMpS0`tSPV7Mb>+W0Hz1^;|YI#=2GY>}{vQoRY28<*#%agCNJ<4#`u62P0 +zs6doD_kpjx0)L|_*}EH@BT>K9y`H+r1G928&AUERRYuU6#Fp;`h}SJwn%|Xp;Eh2(o$3nC!-% +z20}&*R}{=~GV-S*OGl7D6aIu2sva$aTz_qCx1!zZwYl9n8LHvu@G1}9p`&hf?~@0x +zPyROgL%-kM(^%VG2d@p$dB$0Bzn8HN>mzf8CUad{g~(SMXCM97D<|J9JOd|*+m6ZZ +zL)aY;b@XCa_Fz|9!Hp7iN*iPAt@$|mr9S%<{}BDrp;`3QiQFT{bI36q4-sp`>&sfo +z_->~kua;g>P^G}@kWDa(cd5If2Knnl-zaOvw9#TU>Wbr-Kc{~!;*Y>Hwu55|)>Ma$ +zEC$OgBu5f`IEx?DkS}S!V|h)%VMCR*G*)*PtKR$QOIBU}&!@FCI=k!Q^3kqqmdz4B +zF7ht2ex@Sk!)46Zqc1XkhmlVi>ttj=#(NL865X0ot%JdW$1*ODcI)H=nctq)2wvA+ +z>MW2tBa}(l|1%YDbR9=eBqxj692M+FH1u_O;!(Wz(XzvLa=Js6C?!&&T% +zS%H1y9cXqJQJ%4XH=lQMe6|L$ea>R1KMY-CX})drvowWY`C89&l`R9I;MaN%>*M|O +z`|fdtEdwL^IO5`@po<(GEVld+jz4Dj%IA}(+{hvEmc(CbPwQW)L*60VI!EM>|P%<@6_yNcE^?eok=S2 +zpnaTQ7ugZrLS7!i{x^Z2*C3JMrgUE)oeSAtu*K@Ra^!s1y`Bk&TSH6KGwiL(S0+rRwJc3cbvOou8fsf21 +z8ID;~_37l6r(EzMi}4Dzqz2C3ZH`_!^M{LbQ~GXuI@{d2S=RzZFWawwO8>9hJTKc< +zIbY6PmG^Sy_04UsEWU@cdgkk)a&wPEcjK9m)cU$tE=FU9Y +zOv)_U36>qGefpKf)lx6**U_ejw$w{MUVJmZUEKH3p0r&|d)2h-q|KVPt&1~hv;67K +z#Z?lI(5^{4LxT^`%j7J43KQ?tsbt5mG%YY|ZVP^J*347i$_%Kde>ndABi9CUXQ-@` +z%pYNE9KuUY;v@JbbdH0U$?$Y&S#`lx*zUb*oTH9Ic-v>QPp`Gxr{_GTPDu>*JZ;JQ +zC!4i^y?#|eowvH+X~tpPBy6CvTkq7^lBaJ?O`e|9s7{IB-xF;wpQSdH_ks%~tJfbb +zRz7^3qpZ%ZvKJev{c7DS-}(FW$qsdX)dBp8qjx+sI%OV0_Zpj8tXOTI%mX1ubxGuh +zFPc58#u3*bOUIItGn;M60%+O`j)7h*aXI_93}wnZMS4&hUsqh|OQ8AksjsVZCeA2BlBxzHf|>|0g~-lhU!av~Rc;6e|CCNDHg`%(IJ48BC| +zs-Xy7JnC$oCVV~FtOC{GO-GUQ@zfOtYj&wj$JLKqp3S^kwribHQHQP(`$ismeajXj +zzkiFg*U`AL`z|A;|5w-tEz|r~W~Ry>rfsz@sbY4L8Hl85{_vtl3T79T&hy?;-ZNX% +z9WIsXsCDh$B6Tb0zAe&sR$&Bl^NSBusd15ErTatBBJE!J!&qDG+Ia5{Y|AR_8Ts{+ +zAy0Wv)p@PKv+22M*x9VR$+?F-**$hG!_hiX$6wpa_F$i?t^(Jfzm|QY&$Is!tvvaa +z@*WTUv%`};_}!C?>&dUkySgKHvhLnZe6fq%?zEBOmgjb!{~#57>G4OqE!+3_P2J#9 +zJ<|U{?BkJJp#|IN*|cez#Lwm6S4VD@`m!CK`so$mt2ZS>Pc8Huga*OsUZsAKv8$4h +zEik1IqwND{k*#lFzq0A03x3X~ZB+=Spwya>;dDD~YK_>;5IL1#zN_`A{vGF{FQzkI +zscNcU;`69JA<{7$939!No~^P*^a=er#^i`AmAV+isR#aX3$aF4%K$kn?|7X3(>yBO +zeGrU(8~8hMz`UkOsv#9#7bdBB2l4fXp{o{NRl^4tZ5iZad|IzwRmOCwJki+GsCe+5?-&VZ~>6{Ef=~-V;+Qb}gCtsFT?UnOgnn06>*l=G*(y*wP*t#qXR8LQ3dlG8KSx$Y +zUj~TB-c%WWJ2Y0Gt}58BD(BfX&C$mB-zc}6*mXNL>er2{y4#5HdMRI?+qb1zuf!g_ +zwdJtu=UY4~8=LVa`jCV^U=NfHduasoLKIk(VRM;U2TY*G$# +z+TozzspdRvM}VBcFErOtPFdv)$rCKvoQ(S*v=u{J4&&}-4*V$Pg)ZUaHOXqu9plV3 +zhxBwmbM=Au($f81K3l*{HP`&wd4+$qmhNAldGEYZmkQ{mOAD@EyR=()cewf9c`uJH +z>A`K3?Q2|S@y`SAnq%z;^IdOkDYk6L&*7O3o@qhhQPEY!2W0FIS@vptM0i#NE#E{Q +z$Bw@X95;d<35`ES&WGS-Dq|T$Hxqo7v6XpMiRpUPz4P8y^Pxv~XtYZpmMuE95nCqx +z-l!Qt_~1VQ4foO3#w+@^NW7ewd;gxUMqf))J^z}fh>44=dHFLH{nlK87k%GJJ6`nk +zHO?Vo-$aZXBCh=^*pkGe)trSEuUum{nvw5A$L|eXjf}Tt-okniEpU81G=K|~4&NIP +z+w3E+D9yShkl_@1Q!Aq6&b`RA*e`Mk_c1-ge^^iQ+p*W%Z>tTwpO)cI&ANBq_s#k9 +z?0;Hf+3a_lZGi!GonNP~kE~hQeMQO2f@0*Pq~+duZHNzX6Yq(hNE=&e<9f#N2z-@sl`$P0^LvEff5N8z1Lrdp +z|I%d}A%=O`c6SU5P{DtG+6+kUGDb5=v*ItoK$?jW|7EWk=wN)$QNH`!=JIpQnUgb<7hM)){<-|?)Y-jv +z+oQ)GB8LJm?`SatA@Um;uWDm*f8Qf511{BZT5y*Te&cOyRtOAzWAk^mXuPj?_y$hQ +zRikIAv*1H8$DER`81)eY={_l5KWZ-}>Z%*J$e*@vMqu62i$w@|Q +zny+7TP^Ef*3IBbJRbKyt-B<6K<=1SzYm)I_RbU<_vPT@@g(;QJ{u-XU{8gIrhL{`j +zO*RW;{=Oqk`8B77>ttz8)zd-VEjGFXzuT^-M|Oi(>{2O_7S7ei#Qq$c?bPfn-q$Z< +z-rsC+AuBQ_wsdo+ZY$c^mR`NMj>E&@;;^NIRf9z{Hi4+Dqrhj(%QGd-c+C|_*dGyt%JNjK#e+_Rh_sGZa<;uNaBq}+W+qt~101UNZ1H8eXEdfWYz$RxA +zXJ(Brttog0T%`~Ht@2r~W2CYEK>2@=cAdY=sR9o8g&oOqz^^jxvi?vfwhEqwI&D2W +z?P`ti@cZd%%`UJ7_4Q=8@Ul=%h^&B)YT_H>RIt2kZz`CS@J{6IFXf-tWiHvvnm4bO +zR>m1DT6aH9?7te>snyaP=H+I0r#`{|0+{s`zLRSda9`H?D&3ze{R>nIq9!=|1L)RpHB;)=x<8I}- +zjC&p9{xsumU6U8o6&3Nk$hs~8+0tdm>bOWBGz^28;#+Ae&1$RNNcC>uK5?WQENx=Dp}hN$0e5|M +z!7%)3B_Bg>0-~!<+A7qNz4hps&?S75^-b0EyOn;6KKRgQi^t^aCeNfV%hJJY>z8$J +zSiY>gN=xDVCfRPAjWX^a&75SYNU^OP^VeMbE!Ku(jhULO5MLf +zFpe?0HCscsple5(s(coj!p1na%wvnZ$#_1flK1bW{9bf%FSO{r##S{Wmu +zy*fcV>({b))*9zwHRJUh<0XDw18bGBsI$h)i1RSnJ3A~kCfO}~SxNp1wt0bf2jQJ7 +zB;%#5@shkCVGG_m7`12?J_+5%rRcpOM(=rI5v9iOKhC)oS^BR_mAxlc_7r8Bp??`= +z5;*r~*Z%FZVhxL*l)Dr^yFL)wwEiJvL*z^7`w!}^VGKmpT=3KdPbDARLp&+AOUeyU +z=5suMBt}<1Ok3-OAVAndaMIzUt&#mZq3wD2Nn(m*E4HN8oJ~pgfH>~*&Cw6oO +z^oqUGc;DHJd|2a`8u4K#t-2Y%w|VvqJetp$ykP%ZoM&SX@8K-6QZgE?{2%;2Q}NHN +zi?lHOpov`-KR>ym*7EUxLVgBMY%Xt69gj+WroaG913Rli%Xw +zZLG71&HdkUz4-gVl+4+z5%aDuW_^#ER_5FB4+9?<)7;hR9j9Gtl3$P98&G%N>i67m +zO8~siUzD!-b@h6=-ln?6pZB3}A;T8beS(wt%1h2hUzEA5`@o#J9;o)#Sa}X8gIpbGEK@wRNnN`kN`^1TWI3<4?h1a+GRFp4dJu +z=Qgcj$1SRIE^$JLI6;}&0afx~K^5x)Qmp9NePmykX&SL%ct+ur{#SqX+7Ujp@UHSzlM6R?MhS1zMJGZLZ|>fhzE# +zBHHYjSsc)Yz?(ZJ2PQFA(}rdTrq^8;Q13r+U`E?F2a+WxXWYWA_AWJaWni+A?AKbe +z1L4+W=9i`hFMHsd12WI{M)oZMS!exqTgU0Y;W)(l$P>izA=XA@&Hv`WA$*wR@=JI| +zK4xLhcOc(YYEndzKlwscjT@LhXzi_PJcR#S&{oy$%60nHy;CZbQaAO1t6V{x3{QKu +zqvi)0=yh-~KneLtL-S`NZlo{Jq3hj!e_ypR?HIpSA9Z +z16L|L>t2~p;n{+EnZGl8s|hpi=IiYu#ol&RhpN1^U6ASQK%V_POyRm?L`uI +zv93&FP~^4z+h?LLo?r}Q4s9d3ekT5=bZXYeQPg<7q+vmw+{LS!s(9DKyDoAl +z7w;w8hY&CxT9y|5?jELHz|-zdnp_( +z%O32m;n<73=ud3@j_Zle?-XN;XtUq7sTDj!^B?SpVZ6o@UEis-8UEUI-S2sS!GU7V +zP4<+?Zq^brUJkJvVl%{cXxI%|7bv#FRK2$|cfMHJzOu^1hE!ogYS8CoY)A)t0FK4& +zNGe#9*pdC4RtVk~=Wm)rFrZ#+ih^e~U?vKi;#^c+K>Q)NGI{`SDO24Tw-?wKiBrGG +zzBJ3cX57Y%eSfUI>Er!F_{OSC)v$rwr7B-F>>#GhnW!4J!Z&=+maX#Kp?jsB(3S05 +zSkvjRwdwvl+P*fgi)TmKvrx=+lvu_NkH*?n;S2LVkrrYo;gw}yFYu{wRl?RL_;fLk +zgg?9ClgQ0heo{zP^(m%2N3H$3o_N1;>aDG{r +zSBL$riN7~i?li`Yxu7W`o6_$=*4vn>>3~Nya(vo<)`(20ratjm_wrlt`!A9Y5B)YP +zU3V+yGh%Xb`vp01(OxQY@{0XaIZ2Dli8C-pPAoY{Mh?K`1HuR0UyZEH692<9bJ2q_ +zd4Z0YycnO67tzDRWB9TCfka*+P +z)3LbW3^);M7aIoSWycGj; +zvYDrBs%0R5Q`?qklj^Dld#T38Rx6#u;IMHdaU}1oE?_-cvib==jl7Y$3)-HAjonrs +zi?5R3$}4EcMy-br#H)9+PA4GkY1sK(=G0^k&BUIo%-WSIv*tREm8=(9j4h4`ebvNR +z)t23!HM5Y|>MeYilYMRqye<}7)mX8Wo%^Eysd5(m=Pdf)$-9cRLiEjAqax$oe9=9j +z`wzskGQQ#XGuihc>shW-*iWadPqx+xu@+Se3a-UMT7MrHR>%Nr2LF*bxR5yadg9!^ +zz04P>94ii%IM>3k?!Oqrip7w+YQ^8`e!htD?(dR|0>@>q1bEiJw@d^}niTwq`p+BV +zgCTIJUa+qCUXk*@fu@s!YY{8=>P3MNYhisxQh)fw=7IBIT|rQa$FwbSYwZXOliDlb(PrcK;MPiNDunUY~d5E~mWFCA3T)<>b+??RM{oudqqlYu> +zU5BQmc15mE>soy(`r^Pev*&O|N!Or}?GCY~RWL8v-xo5Hf~-A!kzB`pC}&ZZ`J`46 +zxw^C~#QgMO)(!lT*h=JJYm!3{wR3F?iPu))!ksUvGrUMcjJ$$ptBPh(j?~Q +zxy$yY>+#$8DT&KFS9*xcv2#{jZc@gI$t4#5Tks#`#f7}Mh{dlhVGjQ*s^M56a+0kY +z?3{OHf#cKXonRP3kB>bSVdmb2H^LV$cKTqF?NrzO#4BnNIWpJ>*ckIdl?rU{7;$eh +z_+H@z=EaEdLz!mxHt@)8V2>+qZ8~84y2{=+YmWbIaQoRsrpzBrzn=1KoWtN3&w>Bt +zRhxl{tgm$OI|Q!yJow*6aGdKoXCNECTr+D~O1l3A?o}^z`ft#Dqv17qjhSGDGG}H7 +zr#VP&wiA5egfgvpG&N6EcI;o-{r%n72`*fk^L6tyR;03)z7{IV{vEW^)(~SSZLsfp +zVt7rcQJ&q!8Vusd2F3a1{Waar0`pr68oPG8{Oy{}+lOxEg7e56S``@2qK8yvJ{Zp+ +zm_)l`tzQ+_U_66h5^`-;tI9T|?{6VyY9se;Blo5M6|&#(5ZEd4m3I)o>!KYO?G&vE +z$LQdmMF;0$a!P(L5#05VO7&k)`_F0GyBpuB>V6rzHgPX=psG7ZPxtnU{v%(B`ugJa +z{SrCbmZYq;N*BK)KH-P-^?mqPsAqazTt~rLHr%BuH_)#W9EDnXr06oP>DLJkxi+s; +zm9w?<{Tu1qY_0d-XJ>IR=e!Xdze=ThccXtH`k2G-W%uzL*(cs|UrgJ3l-r}!oJ2pR +zkJ7i_Vv9mbmF?1W?+(hyc=s`mId-#Q5%Lyht;|uw9?a#F9Zu$p`_f!~Wy@juQ+MYQ +z!z(-Mza*w7PR}Kl*PVCtXhtIEP3m!Szo;S>>lan19%W!xz`5YdD>A(voKJXWKSwTQ@n84un~%;S|6ye4Mr6L(u=lf0=~U`m +zY@{}+KZW@t?3a5na@K^7cW}QB9e*&c-y6`WA>`wG==b-~?`7!sBk1>===VN7)!$~C +zfz|8ME&a}XGTqYeYvTI-*przR&0w{n)2UBpRXh(?+h*x?s^7IXud!}nzJCJuMYm-R +z;NUpy6ms8=UXKGaegFNcZn;-&BE$PvbboL6HGV@kN}JH@BJ9}8xL%K2pehfEUbE)s +zyK%kld;CyLpKgom6Xzcw>-p$gTU@Vm^bAX{^UK2p{T{W&;z4*Pn=zPyoZ2E?`= +zVIDzzlGxX)eiK{AdpmU|#+yhIXQ(wf4loAI9!V$9zLRwtJCNCp$hV5m%MGbX;QcAV6Yygn_F)I| +zJP{wT5?L1=ka}4I@4kD6+1-nLi(OX8_jPM-Zank1D*NOU_UW0(^Xez<({EVgY8;O| +zpJo5WYGk-w(<2>>hv-l<*n*6`*yF!+{PP%F<{2e#ANb#lx%j~vbWVKWBi_yt@qc2g +zj+(RlBN9_!v)2DRYoD=8!`OwYS*%;h!^g80ql0=9K0bwKf28kXGfw;>TKNO6H-ML) +z;1HXxE|1%EWZBQNg}f_%Gi=!zY|4MJ2Mpe`&h2$s8_~?T69Z%?#(sm-%CncWG5(6V +zC+5|&+K_``!^Zj(Th^Ot`IamQk7W)jj4X(ab|DLQg0TxOH6B@DJy6zoWWk4>dJb8T +z>*tV#eB@v}HasRPNj)D*Cf5CI$cOE} +zqI1L!i479lBl6F9Ejb9C;ZRjUD`S5Q8T@Pfwv4;wuPy&J9{-o>-Y}8*GUR2Dw#B!V +z>;qrnIrHvr@o$!IQ<}GiyhwarSmpxJchS{O_JfIB$og8LH=lXm+)K>+<}>e`%e=2k +z$-HlDowV5Nv9|iHz2E_ipXip2ev2(^Ll@f6g%u?a6#SI?AvL~iKe@HVbINXG>^z(w +z=9npKGc3BtyO}>?4&k|JA!yCv{s!hQPH>2>hKT7bU&Gu*2hTR~ZW4BEL&=JfQyhg_ +zR-_0yJi+?DO!fvAA``jf5`{*(H}%I+#xUI-s9#oa0^YsPnYoUD761K6%A{KJ0ocu~ +zXQ_L(mbL$zoKNESR$wbcW_;LJi+*f{%$e=FT=q?VYHLoMk4_OgkkEfcnN%&kOmLS? +z;H3Y~H974jE2qVdh+Ppm7T$sVS$iQge9CFcTXFl_$TK=CHcYPhHce#<<*MTRTswvb +zD@s<4%v`hzI%h_jiO)`cjt3duMeLP5feb%czoOtIyvSU(qCotF=uQpujlw6H6Or|O +z^8JI8uhVyUFMY3uuU6mTz046?F+Q}UK*L6D=6=4ZGUXTKR3eLSK%c}4gTgm*0w;de +zDi7a2f=9xO-&0-%A4@nDo8bZZVf!L!y6 +zqm|vzun}5iA48kU*uR6b_$T?k&Y6lI^Zlb3R+7L@#I7XP`v`X8ar&%p<;XgqLa>vo +z`jdhnNQvJmoIx6-?zc>lQv@uhJ-UuOr~w +zQyAC%Eh->ugJd4m!c@Rcj+2{US4NeVZQ&=!{u}(Hh&k4a@slLp6P(}!u$nvZ;ew;c +z{1kS1r^Kz+o`M8^vMr_SH0zXxn8P~sLR!}ea2wZq%#S=oyv|(6Y35Y~KlwGdieM>% +zFAXx@Q(2D@0e3jOZDCjF39VxI1+bLwsGbvGE}`T7>0)b +z+jz>cCy1A^RS7)hYGRt`?c^zssmdrgik)*)98d9rrwBbtOXu4o*%$DXjo>M}z*AEJ8N?ic*-#NLkDZ7wi35&B{q5X%S{LN&$`+FOZIV;f~6SbUSOir +zZ?NJO&0WXuTy%H>SV|{(m&x%u`PReWCiie&$N4yVepkvk|6;I%<;0V(lW!F-bo+bP +z_IHGF0m$iD8iZ%qZ +z39SvqXyBej19tSdkz(!NdJlTH>1qBOX#4x{<6+{IR%mKaY5p6*QVR8P-VW?RqOM-> +zA?XkMSSnkNEBg?{3a-L+b_DWT`oVaTzeX7#NMT$IJ6L;;T +zPjc;iP*s*{%^yzolq)uHcYtm9I3`NGX^8v;f3}s)P_1%(rAD}~jNi62lK8vAf_-)C}G-5J* +zTO31~6d49HNMI<1#NxGFE6NInvJbl*L^lLOsS@0T>v6oNB92!cCXANs%GeCxOET1w#@1ZtJkW^(_qSb +z@vG9t2b^Ur!`!Rhvv94*ZOKW#j|Gp`gPDl!YBEy1smQqCgr~upPg5pBE|`1Gy%lU!auCTgM3__-4tKIgt-;da4DVf6;>*8d_6Qal +zT04ZS^Zx%6)0=9}e&pIfuj-&_lcl?k3%Vm&FWZbayHaX&|=NcI|EWJ&R_?C;_ +zChreiq_;P+uclC+?yaS~)Gz#&Hkkix&yJZw|!2ZG;MqrVB= +zt>>QoUGfcW+yxvop(in0K%Xws-?8tA{{92~+yT#a>2^zho5-C~;oXDuZ3o9e+1Fge +zHGSK`A=e80XRoqb`a5>b*iJ2(zJ02{i{Qcg=6i2`p})tF_t#k? +zU8tvc4Qx^#n2es?d!JKJDPygDnaNzAthc|D{TE6bZ^`EHV(fu7vHuO$P>O7dT=s&M +ziCiv-%Vih+_<{3NA0zT7vL|wR3Yw7Zx#OnW4)$q%!(6jfe3XWnAwt)?YiTUpW8|`%AB!iuZomv2PBG(JRPG-5- +zQ!oADIu{znj_dGGu65{jeLcm^KAWDrRJF!EPOT|SWgipvINgD*X8-Z4$N>B1tu^2h +z(_;I;P?CZ{e5PP1uf{QyyO1N$dB+oHosuFi{W!ZW~}jt-!lHW@H8O<(tq)H$~vna +zzD+u%8r$8BUYX!{_l&{u-Y{?R4;#tgc#|Ua;0NLxODsQ?;q~<0zt-c7+2{A+_bKH2 +zXFRiF2Kpd#^fDfQ?t1mH{E?V*EOt@_$d*K-GwaWIzEk`#+DcR8^Hd)hD|8c9hUu- +z{kvj=XJ4->z1ZKK_po-Fn90SwpBMYP^PSkWf4|d7&j;8Ck0dg +z|MHU?u)*RZgVGOVyoi2@j|@sbxbD44{AAkxXD;%SrJ6xMrh9X5{31UI{qzyK8?-Y~ +z>}F-& +z84T=ZjcpRLza5!QLgvl*9s!d*0w(e=vTkBqoEO;^g>8}8kbQ(}^5V8d}Q}=S(`y=BZI&tSFd>d^n2iw}ontRD-I?xl#Hi2)w%`@?32_JSh +zcI&IuA-SW(*!Jzw%Ga75=^x +z8z03OTH`~1{()zu;H4h={A|1*Ua;GD!ET$tuU+JYC!rU>9gJ~YydN3fW$((~%M5oz +zy%+4(;r`_^Z-MNAlz6-O9qEVT0(R@84f#%Ji24(H@lPL#j!xP?kv@9CwpUXo0H!D3 +zS6k2dhny33ll24vkVH#l?-iPv7@U6H?Qq20nHxc?v2`z-Gt;C(CK;oh6pb8I@l +zWlrrj9*2knwZW6z6$tOsR0#OI8U`y9rj4*H70R$t}0wChBUtaf?! +zGVNX(Z~mpVhFAJ0`jA)h(8$ixhj<@9jqFN1UTTeBZ2wRpdf)Y^>{&{2U&~s(qs+ks +zqX01RKe(6UQ&ShPqium_A@%1T?e!=tC+e~gZd{ihgz +zkwe+DdL!Q^lpNc5Dq6V`ny@=r*85=lA5u=f`F@Rxt@n%VQ&rYlzZib41zkC2Pa0VD +z*tLGHUy!3)F=v{ESzlQ12c9f`4&B*F4lhSQ){`}3+eDvc5{JCYcZ_aLVeQ`CkNwDr +zFTW2Q`?l7Jfnl(l&?+_RZ2fe--`AYJ@>7qebcMjeod)lCWA%qv@7JoO_8$V@_OZUN +ziI_q5JSNurZI?rQPw3r2@Jnkm;!o)D^R50so +zx0m%kCx5{Dz#o@%If%y&@$HQq)*>Hg&5x`Ll<)t^et=zINVD-Z+x5x)tQ&Oi66{E> +z$@T>MI~UpwUm1D5=~rX_|QodpZ- +z1v{#5xqi(<;JIimp$1MM9?!OOibPq=pd3Xu7pim`wuSNF04~{AK +zdf9Kd8~nEq{C9U8J92UFA^632RK0iddmDScUMR6J#ly@&_=uZX=P)Ys2t$-*Zp*?H +z4625g^&bP-;%0Vmv#7FL +zIa?07TMPNskfDQn+b`s73A&!eUe}PbjqR88NpNqW`@M*a`y}3#zGu57Z&QyCT79|} +zxh3{#2(fP9E$G+5A3b1Qd*H`G&2HhFVR%#szA1dHp)XtM3v+gnK4R?}`m&Y2$aM$T +z>_@TYCC2V?WN!+6A%_RIlerIBD{SE)7QQKSBuQ4@)(0IfvSb}w +zWIZE3xPxcbzOdg#Zwak}N0w|l+!9yHnjdtyT%B*4w~2CMR}=EEh&6z((T0q9BBzpZ +zep=ch2HHUkByDvh+9E!2^Xxh5lXz%BN&UzVOY12UTNiQ+8}}>XvV+f^mNd?Puk$MOS_mnqb}S7q&&eb3JkYslQar317l>m_RF +z|5o}h`Vm6@t!MPVfM=JEBY$PZk=t~=UvypiE#D)rp>JF1o796Jh}A>iX7Q{g-nSZJ +z&K<;@h4jA}-^JhDaf4T6RjF9tqMUa_e;EC#udgBI)ZAN_$M$OEu+}j=D1D3Vft8qZ +zg49i){>a&djdF07ah6yK89O!19DibdpFg2AAbTTD#IhlEm!+gi2n3(EHj#{6YmCyOrv=o0)Nz(y|p^ma=q-&31&Q_mF3Dzxv+TI(`rH^PzdNcdaN; +zgzdWnn4i3p%55d17VwZI6 +z0N-Wv=WDE!RSxfQ;>E6Hm1 +z&Btc*CHVt#&3CUWUC?2(>P+*>dW{`cozGmT(@&WYF$);rnnR4y5HXYDcSud?SM&9X +zsGbtp#u&Bh<0GxifrOExKK@2Y60|3C$lnT+Jm@5AbBg$z3wdDj*uJ0(T;9bz4&MWG +zyO@_LGBkf)d>$qb9CB<7*{qxM&asCy#P`rxpA-!9J(=xO)h%cF9U_hsImw;HI)B+? +zuO?aFb=i8wr}5>YZ03WJ#f`eMV$61#tA-aMdm?j9Tt9n4Y)rZpXRaKMeWSh)%va}I +z%@TWRe5YB(ztc=4^0Cf$n&mqiMcCh#l+xLu`|;;WceJOZ%@+C9(&w{R4qL)K_F(qp +z@C`WG-!A1vw$CE_Lbr>xY_V7pT#ontym&I(iYJ>~<|(G52C4(TEu-+6ares_A<>r| +z#2^R3;z#gNzx|efn&?gm_hg**Fy9tpoFsQWL~btfUp+rIW+HnsZr{Rg()TRG(92|= +zcoFuymGxuaEv+RNo*AhDE7bGByvE$?BaYYSfA*eB?mh6?dy><`zbx@>$R>4GTXlvR +zGnw;@+5f3A-=?N|Yth3&WYeI0j-h)ufTe$zeWX&hb$RT&hX={KW4XTa)=^$$UgTde +z);cwF|JXGr>AXj{=$-DJd%MS$;b)2H@o2W-(IS2Cc +z2YmSv_U9j@?BTiX(+)C+%X;W(+m*)O>>3}*BkmPFC{)Q_JL?e-g2{)mYsV<_T<$Et +zV0$I~SNTORiiqP{i1A$a)PnKb+=lCp9+7pC^Ew;+cO~_-61U0kR^qliv%&hEXWrN& +zdLcSt>BG_JoIYZ<6O834Eu{`@#|%xT!9 +z6l~oQ?4rnHFgeZtYI2HS)|ZOUJd2E<`f*B^*hCNImRR;H)q9L_3MT8=#0}GG$rYr& +zAhvKXHnE!XjeBza8E`eSTw92)7SKdS0C>3&G_YPCvt5$vMFVy#1 +z+#Z^=c@{pO`Z4R~TX0c|nFQ?HL&S`Ato2@Rst#XEO`6FX+uF4$k +z1P>Csb&7tRWA0b%KpuMl#6}%MC&R16Cug{ajd8(euvvn`9FjFMjGx#eDK9qZDEBUH +zms0;CyVOK|VwZ-Xk$p<;bI>8*TbFss%;veT@rH~0)NpMKSdlg+@I3rN;P+$WBrfV&StyX +znU}@it;l4ZA-Q}p-xFxP?MC(ysGSlMNi0+azM~I)Hir3RkZbrd+`kaoOlV`>JpJkX +z*J$N`7pp49IoztbeJ +z?_-+1U)`><#je&+PZ--0;#*fAf!U>_$G_Io%VeLP*wpJwSBz|C&39De+rHS;^n8^y +z_8ziQnLhus_cXcpz-RA~%T=bg#cZmx^s$lWOCB3xEl@-Qvp*YOL))%Rwrpy_Yna1eW#%DwBCR~KxokLd^BbgC44$lNM)av$B1HPa`xiTh77S9_AV+LO%H +zhO~6YhujyQ4#s)96`smIDv6i>Qokl~y7;vvo5Zi#f&rD~7n`)6ob8~ltVMJbA#xekos3Ky+8f?vUTF5gk@- +z>|;fb#|zCD=^=j$FethxdKe;J7G3NZivA?rx~NOWxR$@;lBTqN@|Us@e!+#kF-x5N +z@-0lkPs7v)W)8*}(ctL3PA4Y{o+ckSXXPc?);{c6=)>2HDgI&X%UGRrCYd{j(Pg1uzANeDJ0y|| +zTuSE(pHN+ePw=;+veanRHz}l5H!heY?m!l(N$5He!F_t$oh9XOH$lt5|Bm+$O2I3mlIGjcIa`IKf +z+u&W=olg%GY1a338pg@mDw}WM^&`<2t&)=%3fmOaLIITf*THQ(lJ +zzmD|^%&{oGD^WvkH5iS)kADd$C$V3A4}UG+@=W2In@K(`P(5CK+yZ?vREd25gjYkj?ZgNRt9wnYW1 +z`G&ZOeU!hYCjE5sT?Wao`Y7wc +z+_NUP`SzMw&9{#&_ZZ*x?L%JfH+}P#`S+Do@IXi**_+prCZN7sZEXx?>(P*X8-&% +zz9}KRc}Lkk{|q}Z_Srk?o~tj^xi;~P90WQ)^Gx>dSo}V}@N>^r@Ju_;zB%N-h8XW8 +z`M&5t@0sXNMEHaS<9=V!&<4P)hm3LpxRE;}sP>nwdMPIzanB=cA`2IBXn*2>C`MYQz@LmdhlD)S3_@1-B@d@qwdUzNGE5svOEZ_(Af4&H0dR^4Ok`YB~s97a~`tgGbj>d5#F +zF_)9848N4GqWx5Ivg+CXf!@qlPxt=o?@xC;d*rldUGI0y^QH3reZMPT1)TWH#QSF| +ze%kea+Pn7nsH!`E?!5Azgd{*9kqi*z=@1?YDwfGi0zn`|Km}iu$;>1fm`8SI0s#?Y +zq&})`gLwmuL8WW0-DS7<=&oI(;x65Gw^Tr}t88d#rE0sVZG~3Iet+klGnq^h=|{VN +z?frc|-}#;UJHPY0=lss^o^$TpnR_l3V*bfxAN>gJosM^!(f@Pse){aCxS#5SYys+Z +zsgRFFvp!k(y4oiNrN@>Q;D6T`7f&1dZhJbbdF^D(LFLK&!_*h&@%xnb7Op-vW5?5b +zlP^{so5qq?8jWRX2X+|NJ&kv^8x`Y9ywiLozW<*!u!My%X0N}H&n|SQ;=R3yCwm_I +z*{`rK(rG+bqJI7Z)+c||o1XdX48OK!_3PNxw_tCr6FOQOV=utzG*6Fz#)7(@R9M>- +z^zG!$4KGek?z@fVfYb2H2JGKu!#yAQlw#~cKL0Py1?r0<@GbGzd0dHooss`)!toDr +zEcYX$-#|Q`hkZ!lBL@GgdmX*RuLs)iNUb;R$1=Eg3+)w!@2xxaa}i@$zdVex`ky|s +zmflH&@7C6zM-2C)9iEBoXY|fhdN!kx# +zrKFPcGEQXv3|v!s^fT@GM&Bj(VJ$t&+_E<9`Q|s?$Nmp9FFn4Nbd6Y(yv))*IB@il +zJ=2--kprLEj~y_uL(^!lGUQLe?~k#6&+aRaIu{q=Kd<-=aT?w|i1)dh((J%g{Kgc& +zkHIm$2i=f{-osY +zXBU^I`M6MjyyH} +zy}}=wZ!b{Oj~2dUzRjYhHy8f1d1H~9zOnG1%o}E?>6wK;FyA^yO(z$=XuhSm?}mX% +zFPKkFdfxmL*2BL*8%$VxJdXZQz<0Ggv3thU53LrdaL;|C1iS0u&}$+1pYKNgRaW +zkZ)-+6*%b|@Yx4sTnm +z9&cQt@(s4W8z_$SB8Dh_D5fZe8Va7QzSfS6i25K +zM-2P+ytnIx3j40-@jkf&NI!@4A*7$G_~ouAk^X*#0sZbqycyB=CiHz1`reMb1G~O$ +zHc$*8-+{a*kS;|&-c4u5|AhINLNQXc>nZd7hzp7jiWQ1GO1oPSdkOKP;D1kljd+oL +z`eoyzS&UhqtotGM)?>41&Q|9e-80YQcSLW#zx+ZUo~2yMVHa#Vw(wP?U%|~j1MvNB +z3#+_(x0}u0?PNPX=JO}!L^o^Nb16ri=cg{F@1t^``DEQ|Pt$*Ln6B_mJTPga=Y3eC +z9eNEm+>2@7Of`?@9*WgZ);)_o(bRXM;amrq&A^}CeTw=id>z3q)Sja6md-DtdY{LB +zc4HyO`^(;-`G10?>5VCP-@KyFeFXO~v+AKszYPjt{(er!(q6_px}L=~duXSvmGY%- +zjnMlL^FuGLJ33}~E>MW~x;4>viO{_XGMe+{nu^vmpR7C1=ftP%*z*SKQhI0XF04`9 +zl|_#vVUbW+hkHiYJB>BB-G=wrGW`dAIJOyV-zl`Qj}(j(uORON{PJA3VdZ_e_k0ev +z=)ZZB>vtTZdMbG4LeFO=;QT*=-lfb*=TE!w-J}EmpT_;c_c7m|#=YJX=r@Z&!MwWT +zV?8UJUzOD~aVgt|^dylEA$^5N`#)B&?~MgIxc8lJ+rfTtDan4Gk3CcMCoW>2)Qfty +z`y%#2eHq6jM}IKCuiE3S@w=j4i_7m1xhdfe1?t1zNF)?yY?Et?Yp&lFtev~2A-bk! +zwKot7Zz~IjDQ~p$9&fw_RnHexPvUV!T^3)&Qtk5a3~s+6>hsUt?yH|$iri(PaKIHU +zYjk_-qrMO(1WpY>Y18YmM10%5WW*PAx!nz6)R{E|HwQyogO<4VguT&*a1gEWc!d$L +ztTEXvIVr`IYD_bv>oas_C37${mcm^HCIZYu0KTbXcw)lvOBnnRmtoP2cU%Ff0EP*c +z4rBnBUKrWR0>%K@0MSre3T!E`qk|0{%ITr2XA^K1jIL}Ra!UXg&UPR03N#gbm3W_$ +zj2EQ>`V^)Z0299VN(S&(BP9#SOJ|A&D9&Jt4XBbp1)5L?KnLgn17HM9KoXD)qyVWv +z8jucT0A?T)$O6Uyc=W(>fLvfKFb)_Goz#9dJFc1h@hC3a}Kg0VRMP +zZ~&!18L$jk4wM5cfE$68z$#!hPyws~DuJ7TwZJ-HJ#aH{3ves20oVxK2HXzZ0o)1P +z1vr5!zy(wTZomV0ff}F|r~`b!CSWt*2LeD42m$rL-vD7C0z`oZU<-2JlUw1=tNd2DAcgKs(R@ +zbOK#KH?RlT3+w~F1@r)q1HHh0;0fSK;3?n$@NM94fv17*0M7v51)c@I2mBrI_rO8m +zAAo-Zz7HG%o&%l-UI1PMegOOv@Xx?Yzz>0c0bU0BfLDN5f!Bb;!0W)j0{;da0e%Gh +zJMd%RC%}II{|WpQI12m>cmp^F90yJSZvt-tCxN$tp9B8|yaT)ooC5wE=m$;%zW{y- +zoB@6X{2F)s~eYway-%1f?WFlU*8z +zfE$Pa_XAG?uK~XVC^F)S4t0PYkP%8fPLWCHrE^XICIj<;62JxA2fP9(3etcABMOY* +zeiySNfbdq*fh-^oumHt?4X9#qMA5)Qg@T2`MWqx$sR@*pKU5X6Jzr-u{iPbV=+I!;7igKUy{^bPEJlrGI64DWK^Po<}ze5 +zjk8=iyLiDh*Is{vt;A8btbE0dD_5;vQ(1Y_+I8!1zWJ70H*DCr@wVGgs%;O`A4t-n`il3V?#aU&Dyf +zxC;$-duwXze4Eglfgt)2y@!6I4x^r;2Hkx(+H%i5XvV$wq6Mfv>P{6$tx;vFF4dH3 +zNj2oPqnhzb@e1*}@LIHR+Rf=PPOU1nacWnoLr|xnE +z1(?AmVrI$1Y&MRKWx1HyvN79aVWu-<=1IqzC>66%GS*5atZEFHp|F1lvn~C~4NI=S +z?%KtRuDN>Qg8B1`=UT6tGkey|8Pl(vRy1|WWJ}?sD+=-_PRJWSZftH&_L!_pb4Gev +zYD#jF$!O5)l)3fckb7>#>#v#XYG~ZTlzjd5`_R7mXkanEs?4B7>5`!&jemx5C0&f9d41V~%fq^dYqu>X@d(WaC;CV0z(6ke +zLj3UF173+QuNuJ*gFgk{5B?&!;T-%;!3(0eB~rHI=TnW7l>Bu3TLZ^fQm|+({6d)^ +zlFb2HAX`ELP!V7QUV^L=oRwTvVzzwC(4)7v>MBmXd&~?8#8kEpI0HRYmlN6A0rbbp +znk}t{Hho!-t~~Ylu~TN|NV9XU>eH(3SxVN4^Ou;jT6H~2S?Vb|O&Xo!Cx8X{@*E`V +z2MQpQt3u+x2WCLF7@P?^rEzw05tHR{b}Xb1St(=(sf>tTV4`d};T%J!2g`*}5&%%Kv)j?VrDO^2D3e0-ZBaLO$z- +z&3$;_UYW*i_9?A-ZQ~uCxm`Jq?(98dmbZ`V80*-ZwJ)>0$E=^N7|S!(n97$YTGH)6 +z#!gdt2<%Q%c_1-g?W1&DLrq%|8#oma`OgAbJ!I)z0$+kJgscuS>O<+j71Rx&T!6li +zZ;Z1;aGC; +z5y{R#_B3Q|T%yX(LpGxkI0qSC_(kpNOR=|iC>`xeX=|6#)~S?swkch$ +zilgT-MYrq}b=$Gyyv?Oh$Foe9j2~1i1gElUKT+>2>&bR><#guio;mrJ1AWeWTPRRI +z^<_`?O()-CHWZ~Vt3ShdbCeujVm_#}j%yq1=*;dKQ{JB2k<*>ECv(|e^S+Fpbp6Y^ +z;oZn>9EXjE9>&;!u>>|+l-BIFF^=}Ej!Z{)`ku7Xy{Y?B$~(q#}1r|6dsv17vDMoZEx +zC|U(O&+b8gkWcOACf(Ll$|~ib5G?_AL1*7yT-S6nG{kpn$T<|}6yXT)Q~Jc(+EC;$ +z%6C1Bv3DFVe^hCm*fzn@p4Tznu{V3)n9}atJvrr_wu3MY6|mG&r(cHOcQrSYs!rj8Kpg@byNfDoaG&9?dguLl+IMgo}}*Nsy9!RoP4X~=Wol? +z@dEAX9ci7ZT`Aqkdy;xgC8=+ouydu7v~sCW*B;G#OYi~|sy-3PqL9sjEPkAR2(lu` +zC?1IJ0QNyv3E4umo|UbsZ7KF1{f)Ao3Q$@F7Sw~WP@_JO@ZK^`2smn<9ZBOn< +zqI9=`Do2vHOVUb2ijPyD(K)dpy&T)$!OLDZEI*g7^Lzmv( +zqmI;a+*aqxa+EoQGJM>@oYJFnz?W)!J;-|zc_+yph{m->$aZ1=r?HMLGuw>i$;K5) +z4&#j`BYros%3xfrH&*C$52cz`n95BRrd6iZrW;Kwse5iRGl*8uAs1JWPmjRf5&W=_ +z)=xw;fOjCHwMCQ!CFbH*Q=8GzZs?#%wvwDkLyWyiGA&Z4fVj-JWOyQge?n<7p)!`#PpNQE@Ir}RvQ9a>A&!Pa@$szRC~ +zw#RS__YWOvq$YTG!JMV&^(}dK=Xj+0nG!N +z2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk4`?3HJfL|%^MK|7%>$YT +zG!JMV&^(}dK=Xj+0nG!N2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk +z4`?3HJfL|%^MK|7%>$YTG!JMV&^++}*8|vmic_C>U-r3+^fFAmFPnej-Lc|*oAMo^ +z{Qa@WqgTKZ?b@w!+T(+$UzDf)MTqcPOimL8KP&PJ#Iel(!=-@`iOz`=;}x!)=zZlx +zc$F!qVo@JaU3RlL7R})A;v_|SO)=5g0o9;TV-{gwzCRhS5amRBq7c!0LW!hYCS*O6 +zMR|ISE)l)^ljzcbTK|4g(E)KR)EQn$&fE8QA|Lz9@nhLe)yiM*^StnLqQxCddLl7r +zdn$90w&%PVf4X_+_QT5O$XnO{7Ae(}P23oJ9%Vhg!)S5#zN +zRXh_#sDJ1^u@tz=ONx{QF6<>Bf}~XNk#uA{FBa__Nk_(bi-`4+bSlL;@A%XG7%~tak)I>ao*= +zWq-V;n$}|vioPdCl4r%n$M{^@Lr{*3L*>~_j>kjgIc%isTaULszbMALq55NE+D$64 +ze^vSL{-PR=e%=%&uN`g{AJUGzUZkA%#v0vD8k5(%)Srz6)jv^A`$LetNlsXzfQ|Fv +z{p%3=ay}O7Y$Fm%T))W6)y5Tu$B&om50^g*In_tb`@A?lY&s#$;_bmsfZ)_${X)+7-heC%0YGvL9h~_78A#dqQ3h*y +zj3;6rv!PFW1WGyW14mRLe2nu~0=flUPZhqcDx#}UfqZh!`gII{6{20QfjHO7bnQC +z5b{bPm))~S$m@k%xSQQ1PiJB8e`N0m3KjCD$VA&0X#eOJo& +zsmGN<|9K%lC*&p^6WRD@ChJXz!yhC6^RA175AuSs4{2w^cVZ%*c=s}P&OJ0#U)njE +zVCT1&vD5$XP&=POpW;W#Pm1g$j0Ys|`X&*E +zS4)JQZwvXs0#(58p^$uD$oqs`&I?DmeE7QSO`%^T=Eo{w|5G7v5q5CMDHk`sRG)KS +zRgde%by^HLt#hQ`q(1FEqhN=(#P#q-VQ0OtFQ?C~Lf$9hHdmatL&z%=>hpq-7mEQ# +z>c1uANAFV&SVV2bZU@gQ7k- +zJ2-i0jJv^3VI`~$itjY +zPsmy84^_MTPERxxjySP1BXfrW^?q;E>#-J(tl_Nj1$|CeIPBWy^ai8hZLB8j3V5BK +zhCpB&io_i`p&1>bx(P)aqCUUX%_zCu@2hrtyfuDT)Eh7I1*J%2LWwFC_C_Mmt8Vc5 +zJzV7RI-{;?zZZ?#FzFY;#5$ +zs-w_j=pt{>@@<(Eg3%E9WoplX0H33)9NsWl*)c6}B +zb*h1wOrFqL<3e0S27MH&kNN_>?Ovge&~i6W=Qsntpfli#y6eb&!|nK8+qaD@oj+V$ +zi-vhdP!D=tVJEMF%O5KxyC$*MVhY~IXxQbHYSljUoAj%ig_5;Vcwl&r=-(kZLObFQ +z4SFR`=B#!_27N0Gkn*S*j9f>xN1Ta}bczsiha#x0xCmsQAcnXk?%3t=d&3LnBS)m1 +zwcemN>>E4|dPBijCLQ3~j$+GI5A*mU^}OFi(U_JG*Ew_7H#lp&u4n^-8|EW!L=WxH +zYITQ#5i(GZT4OLl4AM~IbS_(4vbxM!R#ED7#)rD}xU96ZI@A#K#A{I0#~-`=zS^MI +zgP@{|gz-@&K3@zS7_j217_Y!DqrqVz6pqhKtWSKNE1X~y17RfOtaAn7=6FSEWbh>M +zxkEZ>czcHzc6uA*%hSjb@CHKRZBFh27lz>Ye0A`U4o%2Y10r5MA&TO&q^o%sI7>HH +zl&oIih*wA`n@~};B7;sCT9sNfLsk-lDI$G~*N;HKBM4_%xrmqY(zOt+U+oZ)<6ORK +zjlE=*bIr14>&n(U*O%B=l?{ofAsMoLkyAE&MicgWKFK+q?nW0~Dd^GdLn@-WCBAB* +zdT%iP7_~>l#Y?`VTX-~mNgH&Lf6?xdPL$n)g-v9LPn^!$00J@+bz#1AVwK_@lKlm% +zE>FvwANIOD@h;_^H%ixe!{K1ai2&q_j`&i{irE~?81QIV<#jR@3}Izd8*H%hHP2N( +z593F5u1FoTdbR~oQsvRGnzO|lj!+zNHF4lXUfAn*Q2~*v$HK_U-EWOznq*d5)gdqB +zaYbFs>a7#&xH=EY$|JRex}Z}_$TXFrQ@{YPjw^u4$y$p!ls>HdY^vpITuGQ+0s*WY +z)k^Y~SzXa+*jL?v)kysE`U|J&IXZ4Ra4)5jd`>5Mk&sI!@2BLk6^TFMS+guJpXW(# +z6N>mchm&02i$mo7^l-xpvK~#S_x2!+Oh&%x0$?~!1lGG`n +zWKm&xepz0&KL{NvZzpAte10jpC9eEf%I8{xzbk0OF{$9TnUlPqmR#QVifn!^nI=wA +z7++pK50$*1l;TL5ZPnMV8Q=J#( +z`-K0b-(PtV!@*g2V=TB^>EHB3|sW03qtTXl}WQd`L +zt2BxFKP@yYvVbs=GSC^USvZ*&caa;%l2&+j&9pQI)Nh{|PC? +ZQ9^b2<4NheI5jq>K-J7jD3EZ-{uco)TXz5e + +literal 0 +HcmV?d00001 + +diff --git a/native/src/main/resources/libdeflate_x86_64.so b/native/src/main/resources/libdeflate_x86_64.so +new file mode 100644 +index 0000000000000000000000000000000000000000..cda376fa2c627f3457d3fb5ef79b2791f47118d7 +GIT binary patch +literal 61176 +zcmeFadwdnux$wUy*+8Pvi4rxnD8X(|iMJ9DShj%8;NCFX?f@z%tyr~c6zhdT0@zYb +zoSlT#aWwVXi>LLRdfxihp4XnEKSWW;=8^#30#rb)8mLN!2m)3JDCGS&|M^V +z)nlS;$_F(!$bCyoP~phyAHx1}*W7oP@}0o>pZ&|B{j#vXFT=~Ou)o|jeAMGBp|gDc +zpEzk+XJ>EW^-=$X98WyT8yQ#GQOXOMhojXO +zxQOte+e7_^^ClSUx3eCr7VOhV8V6?c~aD2+Qlj@?1NSYp%KJwmWXWW=_p@ +zvum!oCUQ+`YSlG2+&KHjn`X|bxpDT?s*7*EY2A+ +zck9d_-59C4dG;OilJl>>aaPUDJ8q9$a^2kPuDSk>+pd{=AJS-+1Hyw2fJ_ +z@3Kdp#@nu+b!UXjoEvK*w_SHDb0kl<-7)vZ2-9%= +zd2{YK?}Et0bZY#?*PMS|#mL^<^UoUvRlzX&|9t)p?hT|w-+#R3&*0rqUgzZ1LqB^2 +zF_IrC56fy#omnXDjFcw$%gOZ|{f-FfwltL6x$<3MgQGk2XOUca?z!@a@>%Bx^`;+D +zzU%)4j>_oTx4_ZZ+J&=C*@i%hc8C-E0=eF`}-RP{)U0SVc>5V_!|cP +zhJpY8W59MkDzM!F@4Oy~*bOZ;c|Gm6v$9}C@4$LSZRJ(ZneX$jIkb{HdA?cR`yD;} +zo%xnLi}~TV>*w|IEGCfOqMz5wvzQwGANBJ+JXbgKtp99p+?y2G-T?W|j(69b1UM7q +z9&ieKI?SPUQgKCirT+ic^+)}aT*?pG*+coZ+GS@uzhxV(_PRqgB{XnS*g!!~N3}UL +z(f57bxS70))P7@{?Tp(iPQ9%@s424Dac5E9c{Lz*-poI(11z46t8@M4uKtgCS$&>4 +zG$T+&ny1<7jmvHIS%AkuJyS*q++VTX!M1wOR;{*s$t=OBt+rovbSMir?01~tzJv3HU5QNPer;IL`|&~Vz2AE$eI@9B_doRO +z|I>rH{@cIUe*sP9zSr&d!cZK*kgQnK={ypNINe6gd20D$p`M2IHK#cT^5&ldR*}B4- +zW=)-zP^*$^wT7_%qn`sq+PfiEoOb^ZYnKQ2q1a}w-}cg(Xj+AI)J6%wIW18;o~_-j +z)(h=)iNjgmO85~5t|~t@M@~%>^IEJ_-G_zdDfwnmySiNyqZiw+M61iUeVH= +zaO1Xni*gSL2brzd_&r+-R`Di#dK-JUu?2(Ny$UYI(?y=AxpD+{C?85?-ZIZK(xGaMNZa +z6h(IYKy3#!Iwj>zO-2%9rp5})CWltcdoui+aBq#3ES5%-4Li(+m*vIKhy}}lzofe$ +z^LetNr{-hp#QG*+~AK1?F +zJoC9r4pBMj4!PGdK1-+}jurp3w#8B(3E9M3=fpIBCe&72y=ytGM$&lS&Th?v7zTIl +zJF75i2LS0u~ZOyQ*w!UXwv!ajxEN_C5Qmt+}Q*6asOy_edHms=u$W@C) +zTvn-WOTDiAD)pDNTE3xUUpxF?B-25~h;Cl_%cSOpjsR5wA0(LKqNLiDP#;?5w3bZ{ +z^EZ5G#rK;HcY@H|2$Q@}+pX-Df~2uJnICnPZ*36rC`cIVgx@T+#@IbUMcw%7d7mWI +zZra=Mq1p{4CE~uB8A8X23V*50g89-KXZO(Z*TPEPBvAUQRrsmpd~BEvKcJ?}uQ$m^ +zxC`zrPN~=Q{Q8&iq7NTxJLrUbVnxOdK_|pnpi%nU{XIPb*I_dbbrm(NF*A!0hiP@d +z?}69*$T^_oBT3jFtp$Q#%{NKm0bz2>OZ8}E3Nci)B;xDLh9ni71+fxsSg!f-q;@{)mCf6Rx5sB-uui-LcLz-3l3B^yQTP8xnb%PMtj|> +zEvje3Yd>^EJT!C15#VlZqDqg3kq*I^c>}S6<>pjkH&C +za!S2!U6E3UtZ7y14Qpyj{dL;q=%t%Q;S9IWJ)2>q>bvD)n-j9ObKonss)^Y)(2bBf +zr73UxHeR)+DVb97cEt`G)R##oT4$wIXS%$@cDe_djbA^O#@uL3y=iagunRk-Lb2NH +zygWMFnNQ)qcBf-d%2;W;Gh)T|x-RE0`Oar~X66y(V8h#H<~1#@ +zh8+oS>^Jl`wXk>HXQ!Kuf8d6;Q*GLqN~uq!iH_8U9kf!uBDJrbW^C1-9@d&JZ>MKt +zA6mz}f0`cDIeJh4wlO`d6I&@|Y_d0epx%Uz8)Za(e!6f+m3qh7GALF4YL)Sk(=*6y +zs^D9v2d%S9Blm)|7yXv4&bN&N@~>BPVb^he{A#=B+p5BLM_!mVmfLD%JZ)rC@z>{V +z(}vNdMo9Q)UdXJWgr8~_J$Ab@=bQ( +z&Xn=Ft@haJQ+wEQ%Po1tT(nkgD&GLM82aAUO0(ffa0DZ(`2@hyV;01Qo0&K0f*!1e +z-%6p5!j9%WYP&VDGWBNNXWyJV%r~HrX3Jbu5=%KNjbNsoY(d@rZ<?L<~g7xXXVZPq`9_BTnwk>!>K;pR+ntH-ANr>JGesJmvnO7#dR0gZm!*_ +z_@;TU_?tzn1bpcD`C`wNF(=NJq1YC)AGXU^!vei*lYf_Ena|xC%hN`{zBj6^G3Uer +zxhh`{H=o;)F7LMEtIYd12_h6TzFI%pP#*TDw!OGX$I3dV{Z;HY?o!6by=m@ZRnbn^*z`3hTYP8%Ke*$I&ZgKX!;*yBtt +z{8tYKZTB(#m{#3V12K`0^jS(9z4|!Y3Hd_Q(1ks07xN{w3Bl9yh8@C2Z^J#d+6QtC +z7|d1&g+DTX0J^;^%glz?m}r%?1NI6U%lZZOhHdt~P4=*Tw$XiLgLf0&)Ss^AQ)yYZ +z>VH?u#E8Aj2>;AQ$J^%9ujl*@bqpYs>A9474Ck=ZFVTXXp(3fQ)`zRMtfJ0)-UFwJVBkMd@UZ~^yI>#f$8}2+7G7+wd3*8*pGp}ysxlOtZq@m9Qj?)U3HJ8s^HwDQyCTWn`P2>%oPrrfbw +zLv2%U2GY_lJeXFmgG0OgbuE^BXUpA|d+&XE+#7b3znt}po&BcSG)jd1MnU|-q6_F@ +z-mj57qi>0%jlG~r1b#xj)r0!9o;SggwHR&@%y~b`3P04+R9*sydXe_(4jPJe+p3R1Qj3xh4K5iBR$L7Yn1cP9`H#;A@1e^VM +zXB&jMBhTr|yLe&I$qDZ=BfRQoY=`hM>MS21w~XUtujC^CH7&9#BhH6+t97(6$mtrC +zHgA`Cmh&>;uhMXR-an8!r%YJug*X?aZ7-gxJ +zYFily4}_)&6eYdtU)ynMc=g5erw@3%|$80_U55P?#{CoPBxyvOPhBfMbzL2;JCWE +z?z1z^Mn$K+LeO# +zhd++$h_~1NHRU}bYiC-{v_=ZW&$JPQlsA_4mgk|w!us~&g7A+oE2)uEx+3+P5I)RqFF@hII&I5kKE>+Tw;o#(>#Cn|BSzhZ9sbv4 +zz_4~`vYg?cL0f?x0ux6=y6w<(yGrQxt0CPo0OtU7JBbEzbZaXbvN3Us{eKqikMRxx +z1C0L|V9`G;m +z?mZ!(mj(9~2%SUikhze%KLj4q(D@^UX2ndzCJ>sO)k`dzKyuV^I7MB?=lUc0;vzwr +z9%KvBu%acf2On-RTKoyX*nEV)V=WaWW=%_}gGabLrC;juRB97S`!xMs9y{mq6w{)f +z@!@F<^PJ1G1W}Exr1q^Gzh&Q$m<**eKULVJ-bLNp0+2MsF+#*<$DlO&eKY{2RZChG#b8QNbtvpI%S|^#4h#2HMpkb9WZ$at +zmvMXW!xz2_hCMB_q_M$*&oPaeGdjmV +zeIzjV`e6D2xG0={yU_2Qd|Rzf4{Nd9L_ +zt`>Jli@6_&-FGzqrr(q|J3Fn1MTSq%I{Q`7to@Xb*7NUL@wOU*L-&*{ +zv+z}B<9E)&@0=}ur`ed)0<(w!W+kKjuYQl;8qr2ioya+JQH1`>?4>!k37@IeR^x$U +zJP?eh_whlmuLHdB*kJgSR-q+3!#^$ +z%MYN~&HHb{rNfkZ!*U;bSmcV@q&6aPFkJSwB8)x+l`FS)e)?+phLu}i-nVAu)~Fu*1~y)%p`IVqEKB}g=%fDtbzxjACU!n;cv*4c8M$oatd*v&D!$Tl<`;p +zF${*o&{YY`Y_5`T-*I+|yO^KKb{=Q7HUw^G$56}ZFwwpx+SRl?JF21xwVbPo!GpVo +zpCbh)(3iC^i8>pfnR=>a{lK_q5nBi37=tmX&3YsoX`Ou=A2NG8B;_~Pd76r_)Xwd +zSF9)Gn-6CE`v9*WMAglX_@g($)}cQts}YC$qls~mUWYWe$0L;+aY=&$eA3_sr!=_1 +zD-CXBfVzPK?U%|uB`48jKhN~sv|88enf?d}MC+lN3tyF>G3ry!ChtNv+w78)V0`b +zOik#crX87~ooV&)kv^(?SKPUP@4kzV+HV>fzJ<-^J2V5oi@!RbTkWr|%lWJ6<0AbX +zRvr`HC3vjC4K6D;mfD>w2%J_aTbMoxOkU*ws}|o0DCsc2)&H;ft+&xevqTV!yUyru +z9~WsmT=eT2lq-{hex3Jq(XE6xgXp2z^aS2jpnCBj``nXeF~f`f6iw44@M-_62|bTg +z5iNn^wG-c~*!l2VE4Qxxl(oitj}PqVv{&H2ib>nAHSi~tF%rtyrQXFN5-km7d^jjo +zz8l*|Tl&};f!V~g<9^x0e4O4~ZFEtuDEe^F!o2Xi!OTzq-_iXqEr0O88Up`od*1*L +z_rD&FK#~0bu5Lcu4{H!V?C|$r;*ULCNzIhfAJDHjS)pIo-yhQgL;GWRVk636ZY>tt +zqA~fvAArmU$-*!lptt+eRkkQ%ZGx4r5KXf~{FD07KhlQP*SnJa06fCJ((}Jc<{wY& +zPcr{GPwWZW$j!g_I>qYUlk6yZ9&EHdF=5iu8U +ztW=Lhc!|jz8|yro+10*K8mqHRY{ycKSm9pMUB+kNyZnHc1coJpZ| +zDR~MyAEvY~UxW7r%Z8sDiF8Uru#GJU^e4U`B^7(YV`tZ&Wei!&c>pe0;eS;$N^iPF +zGx;)q=wHxt=JLaybvA;x;G2VbPWo3~RP;#urtK{#9c1r&+aC6wttMj0b@%3n5Qjh3 +zcJJ=)IrC2HH?Qc2Yi-}DaWg5m)u``sSxRHt^S-R3{hwr#1b+O5rg^PjTY +zPqhdxZ#C2==k>h3**r6GpnePW3u@0Jb70`yYxUZV`A@35{&h_7y5pp+x^0G;=vL!O +z=phFets5-j4P?DN}`iY$m&PQz!K{<*Y8)yP}Npt|y!8B|E3?DmAX{ +zDZs^lkzTilRl6286T~#uUp~o;K5Dt8@r`p%?@DXFSM5?3e|gS0uLM<45Z^OzELjRr +zwO7=HpX3(CH_rWY!W(a3u~D@t>6TjYm*=(-wWw0r;N#gVEL9rhnN+b(CHL0UgnP}D +zv^RNp!o6wgw97B{&KZ(yc;C!40;l*9ys3D*Z-NtU<#4wkX+FKeGM|1Wp_b#(mak2g +zFSp{WEpz;O4E3n7Ast^``$lr++pB2=PqmQxf381demxSIcUt|y9#+%mowPVorlZ8= +zotV_iQ3l6Z#)|CDB0W_J^XU&0#$OWgx96M-6n*`>#ci}n=F$}L38K=`N9vBL6)kNO +zr%1UhTlJ?AyZ$4Q*%d7*wg34t?$TZ&w$QFWBpLT<)keT}ncT9ld&q9sYi7{zI!}Wj +zGC`&mqcu^qP%>TS;peAg3sdBQ*xrk=h0^HWu0dfwjPV+FbL}1-xpNLpo_8kvZPkhU +z5FOzhFz21*9Ei>>bq*BHJIm=F@B$`Z#GJUC#0ddzh0`5eWn4Nrk{ +z$ecIKITW3HnscadUQs`I0Hn9a{y_E5=eUB%R!Xg|XpwdFbz~V`;+;c2RwQz{@-fuF +zcb$gsFDws%+{(SHqBR5CWEhd8_Z>tBDt^HzP@IvXNFrVeg_;wHVzxxp8YgfDRHCsHMG>OZ;c)UarV{SB4zM{$-S!by~S9!O8Zms*M +z#_okrZB_4L?R8#{J7hT@8MQkCe%x%i$2(nc+s7$S6zaQfu_EwyvQC}o97Sz{TD6;* +zV!?;%%&n*PCr<1c?S?g#K@hfgzs)6_=YYxuDQ%T8L6i-pZ@0Y{>>sKK;Z^V7rq(LR +zS}#60A9mYq_skNilA3MzR8mR)%JOYKtwM6{&no@OuMfnFU7lf|0 +z>bFXHGQMZ_47JB;&6E1MLSxSaH|D0iOAV`jg)oLy|9%fKuVmrY397_R$BC+#nN5J1 +zQtJ}l?PT@b8Y`Nkj?w{Zi;~$z9?-Yt?Z^j{?%&ax^c}B>70oVId+0a-CK2B{_q_To +zx+i0+YD*LnnJci|lk2xiS)%YQD8auDU&JkWCio<%Z5itmYG+X0x8!~PneqksVIWKk +z0WJU9C=*Xh5gw_JEs^dW)>^OczVr01StyEnrv-n#*x8Q!`xrJVcB1up +z4L$Rxx+P0gdoaRm=P~38@vr2?kz_@N)iH^}wW?%EBED+g3#zlLFyLGA&%7x;!1FUE +zfL6%_{HW`RK6%cYii(!L=b*|^)^iO~@G2v!4H@i?T~fbIBYR=dw;02A;=WO5hfxb3 +zSW!X2wX(>6Edzp$rp9izjn}#gHGN?~M)L#7u|u6@$2ZpQkkqkKj2Um-P;wTn#Ylfy +zbO_{;*rVTcr)I9j#*tOSgyP;@w48Mfao5SFI3?RrP}q* +zzpB^IQ7xoSH3&fdh@dcNf12&x7ZGlk1%O>xLnNJiw)A-FEfbSn%&*RckenD-w&#@* +z+OfR{MTDfi2Dx0dR2Ed1mGRHj{`aVPm_bCoQ^={>&~iSS?luWK>ntYkr;^(R^V#+L +zZ~9#{vRM8xC$3H`Ovfg(WY=^&Vw&8Ob$ap7Hue)G{tWECT+lZ^ZFPx%xt_iwb;zay +z$r0Uwm@c!u9}l2Za;3sf(vPE>E} +z{61B85~|K@%A*Qub}1Kh{lwOa(BE^Pbwmmp`^=|zF(RXU&p1g8ox81J{bGUHwA%?O +zHvJ4H$!^Pw6EhpPhQ=$+2guA>ghfndHo+rfm$`^#eVIXWd9qt6*#iMw3B4SX%pe#a +zqXFA>pc3Lw;9(E_Q1nNZ#0^@1=oW!E{m`K&n(JeRC>GS9@A +zcqTTJFEBe9=W%%^qFD2H?)WH)k)4Go4<=bso7;3MaKIjXEpf-U97mYL5a(~WmhPR8 +z5cqR$joC)+v2_b#lTj~OV60gGd^;B{7wK;Bd=}PJE7Vb$*=r`U5QrvEA&~k55uvI# +z1Db59Sie*}p{~KiKNG+Wjz|$iRua6dUoK>CE_z6}msxKnHX7|TsxpTWXsZzD^Yj=I +z#S{@aTVgJHcJR+xH`M*_Hg@T+4yV#hkPI%O+3*w=210RqKjpW0Dy_jTqib1|7H#I= +zjXYdj$X$S?Lu9H9rbr|};~~Mxp+d7swz6aNE@gJKDDZdbFzK&qC~%(|i|K^PVtY%( +z8cTb>6|<_3pWNqO`GJbKX3Bi}6a1D}Q)*ADd@TlXs(cq*OdvC5PQVOpi>8b(Lvz_C>!U!%*4TEu^RTg|;_xjUC@-Hp#qH8T2|bl_I&J@l{ajjeX#7 +zi6QjsYI)(6TxJ{~l~7&!xrmPKeWD}1Ku|KO;YZ-v1ke5DM#2rIM9UAaGHUXVX(iC3OxMZoy?Sn#B`;IgC=eE#J?{v(*M~yzQ5k(N+#>(H +zOyzb^oFB-*Y-iq)AaC+_5Gca`(F^9HA^bN9)7sv|GTXa*xK?JcdbiA?-PW{A{f{UH#V-@seTALUa#HRhmJai +z0Xm*X-*gQQ{eu4Uspm07#=7lC;9_Gqhpr&=xL*6_h93dgj-13-L%`Qd6VW5!EyCF{CLMMD +z&IM-TDOVEMAkBND-T{*{g3|6?rJ|W+K5W|^D3P=g@=)MTD3B;ysfvK=1Cd&M^c4>y|u<)QYq@Pn;5oh}mW~v{Mi~59Jwxe}sa?av#Y1 +zx(g$o-BUYQtyZplWn*5C6Tw;gLEVz)q&3@nN(Ax?WxC}jrDg8ShHp^V=EyT)6KXxP +zh}zG~z3@{VDT0^wm<>azr5==8wzJbv>zo5d?O(zs#|0pMh+yRNZW1W*-d_?5ww9pn +zDO@7QXxKzoy$7GrccMwO8Anb{!gY1K<@*!)0qkv#G$MakcVqcL{+w(&p#5}U2((x9 +zq|`ojKpi4*a#BRpeu5rV`}hmf10uD@sEytgh816jBToFPygP#-_e~hca=P=)rdzo~ +z1D-){ShoDoWCB{YSM$ecGnPiwav~T5P~NWEU1}41K5Bm<>9@o|r;3Th?V*kEkr@R +zQ4h?HL@xHyspAPMiQFDL5S^MY9T*49rwIlDl31w5I%1B4Yu^<%scv=`JXj`bR7gim +zJM-y%UbNfTjRtR)0bv(vyt~gncrAL*T=e4L0{RcC9`Z)+HFja=I|pXfzGE(0GM`r! +zd!3d+73&FCN9NM^>y@PUbsd-EfAn_IiPGVnR7IgYsEwD`2nO!LhNk>^4JJ0hZpv00 +zsKNuM)vh51AT1uMfu{pI3_*4b^^X;7h+-0>N9+oNtkMC}9RIf)`&bEg_Mcwco^Xf6 +zUcdzC!N{p((~t!7ixcHY)j3eiw`Ro!x5c%l2=e>%5Y6@piQi +z-5h`2bZ*tCNW>;ePM5aLyk~^N6Yf(&9AqI|-nR|AaJk;U6+GtKh3)Qx!n^g`wV}^0 +z7Vp~_swDBZxtc*CfuQbjb|E@pIT5DMgMt(I*j)7BE0aQGW)ou*33ey(GFBS{40i5R>YO(`<1 +zY@cwlYvc7tpgAnmb3Q6gqrd>m5-UXhJW+S#uZo}G?4FT;Ur<) +zX!v2i{>oW^7pc9ff?s-}!L9%q%ID{N3AXP*!wx*3w=;+qi#I8x;Tee(HFbX$S +zF1*OuKVWV_>jVRtF(HqAc-0A2W|Q(jVg)Ic>h&t)!)i4pFRiwAR+E!k(NnSJ5^rQ# +zI{t~7sep=7>d%XNU1{I98cjA6*joZR7AOxmP3uv#SpfsS_`* +zKo!OOCiH_lHin6hLiCJ;96O|Of_m&hk&ojS-aDAA_XyiXja2;s?HT`z%_g@}P#=w% +znI2fdCZ(c45-Lm8y5^*NBQ5_0^k%zGA-2_XcSH?|S^HLg&YhW&^kipy6jL+h-TFwh +ztCWP0Dz%?oZmIJ95N;~Ilg%282M#!y|G#IXFppr$?;QgEhfWq?+0(=Qy{GH@A-@)8 +z)%TXM7Fm!q*1&403`ea=8mm*XDeEozNEfcBsVjOWxJ8e^R5EBCtnUB*@7V+$bG% +zAT$Iz-3J|DLztQKK)sBINLW^&1UP|1k04#xuB)+gtvIN51%#Rf1^MF{bs*`e9pJ$- +z1YUpzNId9Zk!ZxfqJ$LoMg!_=5Xb_swGtElto3}IJ +z8@48ltVXSb%m8eH`_QlJ&?&*2R3YB#bIIuVv!gg*r_JRPDo4KxH3x&xXryD2hCqNg +zL`-3{%W#B_nQCKW%2`$5uaz}n!Rg!n)wm3y{0Ok@e+%?7e8WF6xXJSixgomXHbwvj +zp|_#KTy$SV!`K1=s6jaytj$rp212n$8|zwWGcD|+$QyK7+}AS0R-@s`w3=V6<`*2{ +z4MUb-&p(rBBm63Am4%i8k%>jczZQWsb?sY_nkF8?lYl29$~IgNm$1qk~pjJ0X< +zLWp&Kg9cM-XV>qw>=T<6@wbpqLc@Hqn9qR)UM7SZ*y&_Vk=x)u#XtQbu=pPYP1$R@ +z&-NZ|IVC^RKN=gXm(<@qL?VpU<{bmR1@2|qOBYLtIbq@uiPO%fq{Q}`TEr6JUdQpx +zaxwlY&GO22{_o&_!VT@UokZkXPKgpEljxH-%DY8G?fdc>rmRz@)xf**c&!f8axZ#NUG;~w<^F&VqaC*eu5{fh-qdHr*qHJ!kk +zQ2vtc6{VsXDidnGEcz|o!t9!N9QVi%AZ9lf1HO?0pDh?2F5}mUAyx5rX8*k~==6lz +z*!dl_2zxW_v&kdNeNdWa6|sCXQ>F*aK^}OZdZ;9McG}t#WZN(X1*jZ}rXdEz3FTh-b}AhT&GncbWJ7j{2ax>uc4`XQFlm-pm96NxxOBj##+MX6A10(&n<3l(E?w +zQ(U_NTopTh6rPDX`-hs1`|;sY?)+%VokmD~liBbKdZ3_)f+8u%oJtL-8B9g&iUUOO +zUR;mfG)iJjUP&Bt$0=kGM*(7w3`qmg$z5MO5d25WkjV*kLu|xX)<||wnX{!M>88gW +zwAANLHU@OFEYkhD{!ZxSC`~IGlvRv+uADnyo6Fj5>wM`Gjzn-}h__1-4e7eJO5^NH}$7$&tKpG4wHR9m3SWc!< +zgbu-I7{qckn;Q7*Y1Un*n2qlh(6QH8c|Pm#abY3nRZ6V-rNYjlMCOiy@@11(B{>>R +z%+_66{RLd2pE>?!LF`)fX{Ys0PY+8g4WrOB!npn{Sq&3Gy5epVXz{8AgNX)++)OCKoI0445n)47mS=u5lr6Q=lLrjgI@W6 +z6#A4!1o*_v{E-{P0lUcGw8q41{{&qWJ0C{@dY01zuRK;P+<#}(?iB}gLjk8Dh2r3B +z)>4rJ){-2rh%~T_4T&)`gnEjAym227vQ<;B#vj%vn^2j +z!LcTlXg`Lg{6zVh#F!zm*=Lw9O^rp(moVqwJ$qz~qh_2vLy5yg|0oXl{TrEoP2I9% +zKU8j)0*_EPn>f?nZF!Kk1dw~_`m2Kur|UU9{}1Ro@BbxT@5|BkMsO=U1GU$b1vGth +zf*!2bM$=ee?ZSCK&>G?576pu6Cx<2=i{_``w`s=JulA9 +zeL&Cc3D#Pn=O{w<3lnbMw}atndVZgq{`4#dhJ2Bp+mi0oZ~Z&;{0mwUdj46^?2+_* +zHOs4kJ`;Lg&`ZxZ4oJthnGF~7RY1=-9w!BvUqayNifu=s=k{KDew^`YdTu|;@FY7x +z;4!!+Q~-UiKGT!546z-e=vi(>j--^2vz9j0o{T+-eKM7!mvcIGBitd8SbUtVTtP?Du}O1t+DU407bfK&`J8 +zfwVwbXFEFyE2M~s#cTecTz#y1jw2Bi7z+rm!2$dS`Yic=*$)scgM9% +zm6tflz|vLQyRIglCE2%!RwU`l%Eo+zXTH +z^JGpbv7bWB(D${9BDLGfesluIJJj4hE>cH)`!@nEYGQdUz6|2Enp^0@PW?mvaVXeDbWlLK&Za5cg2Vrym$!;49|FSFv6@ +z4ND_+vatovp{bRv#5i|RrZ(cAD0?A#?IX<}+nDN*KmIKA1%D6#$T7z{0-U}2T5BF@ +z$gkJyaYuoFGw_xM^D|xGm*?rs&vb!bKLG!9fnPrW|8(u^_QEfxRuxAz{AN=GaG^7p +zwPKBbt@Nq!q$P%iV~v2KbhD#{onV}_|4K3j;ixTZx{03ZUgIRtV!G9d8X=b^_8+FQbK@Bo! +zk08aLr$NpLHAO_kA=vyK#7V?|K(v=&s+4F`WhfJ*2}ZX!g_&$lO0LJFv>e#)zorIe +zHEh`9KSvXs2Z%ex92R$-rso;!^b&XMsgvCqr*Yubdn||Dc#>9C8I2!QRWKfiu{nr#`$Gx5X?T@izRrK1Xk4ggu??{i +zkqpIMLj*rb^#I^%(SHU{eon?V-Ch7b(1V8G@eZ>*x*2Xs|@HI +z22@Is#il1|E5JW*V|qM^3vZC|>;(`kaf@A^@B6-ns!ryqPY;E(AE=^ndS(Mv6e^;o +zM}SC{ibs`QA=6%Te4unjqIBSlfE|e1_ft8CMCBm-zo>O~SplVs(iucjyZIa*Rob%) +zs+B#kTFocwqcx7+4&xlkHyfW}-B$RZR2D_ND-Nd1x9dH!pI~x&S9~rW8zFGfNGWfD +zXd*%}h>`&tzQg*$wav0@pjuE!Des&~qL2viqLUueI*I(Te-3rh6O(lOA))?33UFG~ +zD?up4BEh&%Be8Q$6cTAzX68yD2$a$;Fgkh(v16c%X0HE(0uq42wA`U_vW5 +zCH{&XLXU(3hQO~wG{5RC$r1{XAC2*MeJuQ=4wY~8jX-24WZpIX2}6A~puayse`ic~ +zV_(W&mGOq=4gXgR2y8?-mJ-%%xJ;s(gUCTdUki`=S7O5UF}Z)5 +zJoZ{D?9{sg=}V{#VLz=z`x5s8SOB7yX6+xz`#Xuggzt}|Weu}_y$pnfuTRpS|0;aF +zSihbnv+{-Pb@1Ik)>0HJm(xF^{{4&vUlU1pGcGEKUI<124$7W3M7O>UvlUt2VxemKMMVTEs;mu76`0kIZP}`35f+pR|&9=B~x&@QF-BllMwr7%Nw=9im!+5PUj&6 +z_B6p}!|&?;*vW9qu*3D51F}$)_MX<^a`wTo +zxn(o2B@wnxTipX5AkeMXRTfJL8G`M4)y7uO#uiIWb#H97T#Y^93Qw?}GnEw)Sqd5$ +zfwX7nWt{>lXJU_2nIrJNY+;AAXBKjj6+NAAzRYNlGV%dd`gB=>sq+3UE&Fdop;J<$Ts&{?#V0Ks3TGUoI)*Q_ReD67s4)AP%V6_?kTMo_sYb +z>0A%ogX!#oVJ(UCMTx0c?!|^!?PU7FJ{PmXgU6UbFz2OF)fRuk9@EVc0RM7>GMyDTb1@*)En$TgG9<65x;0u)S^N$v(vng +z63MCr7dI1!H)trItCdH_e8VtsufG$hXSok*P9+=6Ig@T#psoC8He&?qC4(ucKOjpb +zPj4yZ6RKVgz>P;rnf6!_P;q9#7hRLUU}JexiQFa3qCZz$J%1XV>MvZ!VHCvW}aI +zudMY2KoW2RnV_YFf1sYwd4eS{RwNGj{NW=e#@egf!62}mW77%Oqx{JNr-wZ{#$&1*mU_fh&doE*8lSWf}cy}aH8yr +z<^KN)t5)(G5kX2C0ml{^oH^EJq2y;v&kmCK<77{g)4W~KmXmRpFqoqMe!&BpJ+ +zUoJU)N}pd`kZ`|Un(&%MT;}osvaonCR(VXMQRSAh=@ttbHJ9P)+t+Wj +z^Vxkx%281sIbUN3B}VVBnNBK2p#RvAJ9_`@Cuuj(ENJRlWX=lm{SIq)xwO0B$rl7U +z&&xmbf3k>!%4$_5s$jS;IdCl25>nWbD9`GQgauGgQng*;7F{?A6FM!wPY~DD<`-6} +z?!(H51?49kSzZ{Ff91$>y*}?%4(mD{}ZB2SL_%0xQ5gnj@x1>sl#;S_iUKyz8UsU2jaF2IWK|a +z(SYeGx=lQUUe4ZL-3(t#eC9-CbfsB-nW#f~zKnSEW!wZ0@bzUKxd-_AGWdEee66EB +zPz1b%S|=rTLOZ*=PLYvK3AwH50pySsU&#QbC(MZ*{yjX~6o +z5Idnh)TDy?#th?$2=A|47{>gerU1do5hI`N5FiDpP@l-xdm-JiPeH(9qhLK$TA)g +z1uyvdRwLx9|aSI^XfU9-{~-9;X`ce&Pn7gi*}n& +zP(@Zop4BdtPJi0hS@DXz%xJ&^AA*T%(cM+jpMa&BSF;;WjFOKnw^4x0HEpRz*~!=W +z*wUbp$N4U3L`W&X40rQ`a}(pZDV!=D1S!Pt>$l4g;fEQDiWQJK*(d7Ch&bvoAb&RS +z@>mwK05tCZRzghT)5ww!W3OP#e>ib1dZK0K{NF*$s@vbg+%aLy7Bk4S$&vEfnFFNx +zGB>$dl~Wvl4rC;MeGggyX{3Y(_LJR~g{Z*Q46!d);U}GaYixdKe>`_FKQHh)o0M5` +zZ?lchSU2Px33x3xC#+1#oUk$#;*OM*&BAcSolj?br-xccOwR*r4h0p3469XHcf;>C%eRbc#ypli^!0D3C%6u*i=CieTKErvGp|;RR +zb6Xz&Vn;3~!K=M?H;0YOIT)O5&X%S&O##9CZQZH1q}=k;6pgvVEo|9Z$;IHF>wC{@Y*lCQ|zfQUO68h$fcF4OT%@&hf94 +z@q0}{ekYzq%9{vaeFLG +zVT>N9rH4z5%t`XmxSJt8R?4UgPTYs|2J`T~8VnX(uIoL;-13*ONv?+R5KjLzWG` +zm`1slv=clkhBXts=`_lBk^xwszUEW79E&zKF3EIA4CcG;UzMT5=~{u=r5*QY8jx@EekA1bD5-D+5|C3uKYWw2ma5cTNap3 +z2_;tjGT}y@Zh3)7?Xx8pIZU@avyVx1x+OnXhzDV*zjm&BCdjvZQ=QM2)A^X7A3=G3G}2v(X2vrwIu_3K9KF +z2;_&N@zSCz%d={=WYgJZ({yH$%?~V2Uc?=9%>qnx3=_Dhr$+;g=5WaUVaYm!bX1A0P`SBg;j~&^0%u~9 +z6y{mpcx>z018r}1LEHEOz^1#)Nh4h+PQm?$cqSG3kP^#wKz1w??xl~-BLkJsE4#iY +z`i%&_ULR#Y#T^p3U~%-Jc_Q9O*!iuNb`#YT0n;UeEb@eV)_)}6(wxC{Td+3zYd!N! +zdPbm&gjRKbzgq0?UcXvDV1IuhUq}1Zdfvl)o%M&UkIINx*V% +zufm$s?F9J%*OT9X4B5s2H38{0u;*BGZHDY;NQy&@o-6iZdcA-|=vgNJh&duU*j&W1 +zIsR72kNJ>}_k#2#xGC!*G9q|Vn`AxE +zcE^s9vr{I^0b|}Jq>8MW`@X0>Ee$5{DLX(2(H0etE*eaVxwPe7W^@hKWx^L1rU!!# +zIog3E8(9bZ&@bkm?)`(%g7reIx8vXRvmnF$LE#V4@pEU^)U@}z7LFv*2Zzq@XFQ$} +z7ve%n9%ejh3$LH?SPDE4DI-cj3`@+Oq&-+hyV^zIn&Dw0Q0f5m +zVZDnr!jF&YJvhi<{=}6o^MAvg=!t~)Qwg@r{I($mlQ1Gts;{yUMX!V}RXfRZUxa81 +z)?F<1fVRYv@zr;Yt}>TBv`Au3q{O!q?91qfG$z5AQ_ai@I;c*@*WOjk>-D+P0jNiF +z(O~szsB|AG%W2b6(~;PeEJ2l-&KS8xG!zH82$rHAmqPUx87V=)&uq9zvo%8fNO|{P +zjW?t@ZFyy?KG1Xgu9V=!--fmUA?G+dqsX)o&LIpNNf%0M!-h?In1l_VA)_e3u(`NM +z3Nmj2WmQG@(jpM>NtO8`KSI%&pD``4S%OD-1 +z>eL?Z_MS;zba2`mH)LcaG7&|03PYwRv*`!YpLbgHd{m7r=vaY@yVyy9OIYP%C-aC_ +zZ#2VZ>{Akj#ia3|zzDCgEW;U3Y6|*mNDtTdT@_&SNs~j|0?rFMV7O +z8HRY~bFUCtpW_4QSfa12eP=7p@=GP2BhQx-&$(2zo_;`|Tq^M#{XjhD(p~BJmR|f? +z^?sy|AbwSkRi5QwvSV>wM=m8d=#hZ7)I&>!s`xQWeL!fnf`}uLnWKe3vmcWSw7T{+ +z0;>2n1$g5qAjg*9fmjhJjeF!216hsK){p2L5%G-Pu2LQ1fyX}+O@oN*9I-@uHUmmW +zfztSA0KD4F6fwbp&bbcx*Ni*QEIcv-pEj2bENDN)&oEQy51DC^f&K}>Gck;FIFcc1 +z-uE>c0*q_bMp6JK?1O@?^)CXpK<f%J6die`d*YzOvnh`R1T}6JxE*O`3)xRA~^wt-sHGYz!v$PVs +zc!=f`QQp#kRwf(3wXP>AH0KcCyFsF^2|UhE({A)E+db#(RJ_w{_+NaaUL#Z5ioZVR +zFS;_sc>_O*YBv6gHb4Vm%5(C@k3NUBB1MUa&zlqM`6sKG{qI#Qeo-Smrf2-rRB3VMO93eHzYTGO7yw2;#prb_A|SgKdzTUFNe||5!aAPuPgWS_qRX-OMV^VL +z6@R&QyJ${%>witA!o5YKPLryv#_HBI8QnzNxvU@PsH>EGymzYl6VQFsC#N;Z$s$Qe +z2)t1*Nn&f`H~BWHHiMv|{E5(p*&vAkNyMX&(1@8atE>OvjVFzLyW~mJKH?yqHn%$S~ +zZ?^6KH~X6pibeJtwhbqbopNO +zs_d96>)Y0R5n&`9brY?Reqgr?6^5IQ5Ap&xZn9T&6C0Z+{%1Be7fTH8O0h59%P~Cu +zl-t*QSo*H)YkosAc>6XrZ#~QZ0ZQQe}}uAKQ1AZGWD@6!QFgh`0ZA`jroXuj6o=X +zVAg#xG5_MVw}2D&}kHfD19 +zW!sm;-x`0-aEZThHqlYWC)_OH8~`N@NQd8UM4kooEpav2VfcS0uvVH2wrFwBnwi;n +zP$GYQfi;|iE=u|b)<%VawZr!@2V8OZKIS_g58`T1(}J+6UxyOO&4(tYZ$SM)#PLk- +z;G`IFs*pgwbU*WIk=ewnm`Jrbp?5Ktu?c$wTV}w5a}dQVKNZXt=CVkcSnl!@U`wF( +zh&~#Qs$lpQYG^!(d|>|*n`baX2Q;2VaUXxLWi~B$aw$Vjup=z(T}7(O-gSQ8?oRo= +z?_4;Ytu~Fa>s!ni!s$1`%q*oL$i1S8gw#nF&?glv*4DPA*tskx6%fu5hQ3=E+H%LR +zxBh55#AJh*>Xsa~G~8e?@bHocuvHoNz-^=Q36ITnP~hwHHV+pv9= +zYqOXC^86Irpd0=VT~NSY{>zV*g3J{n7%J9&Sy+8Dqc{rXXDQYIEaoPZKk)VNGN$j= +zuMpX|feq4!?@PVFp{KQeu1wo_Xj=kvvgd2IDGx-AOOagPq{y4 +zNErGhd_)05`Y}T~XlBlk8f;HKdR#r=>wf_cUm90`3z8IY)^j~9t{%qU!npF3fX|`U +z|8`tCB?oNCa(k~fS}J~bppu$yBitj)XE02}|E*?O?4uz5cNKmLGR&00%l->(b$=6k +zv)OXBW|v6T&645Zo%U7?`LtbJW#my={bzw2E&BrS3%yZG&R`Bn;1Aqr;YGxe1d9n= +zIhjX;Nb!2-Ac5lLWYIh<@bKak9ViY0%1U>sI%ShhK4y&h939C98{3;zkS>3#T1}67 +zS04%;ZZDayH`GW>!<)t~*UjQzgU&k!-2ZpNrHR2tqI_2x4w%7tn|=E`bK&B9ZxYUh +zlYbv_@*gzQ_U-Q^T>Me*dRTvTY-MFV?2G$5i~IJI0EUEw|6B3ma6Z3ef2WQY%l^*( +z@#3_>?`_r)-(oqQNPi*raX?q7dSV_H~Kws8*Aqx5+5LU2PK)j37gH5r4*w+T~pi +zTJIR}4OoHw!zT-U$w7`_a!S`Vnyd8mLJ*qsy6E#O=Z5JS15EW{8ljvV!8cZdjI4kcgR<@9rk1T +z3%5_ob`$(hs&aG;XU4FXDOf8gxsdIXW6XvhQli%i4&Uz;?4L|rI91jQs-%vr7ktio +zK_w5NKGG@x8OORBMB2yS$VCm_EcGTibXI)3dCwZgYrX_+n=cWD+!zw7oHwx(I&}68 +zEkEFu{F`%tb0^-XK`mPS-^xe**BSft!GBMFwD-<$g+#7mxpl@1m^R{UY(AdMWXt}3 +zSpbdY_T`P_H{tt_5B)%J;40Qh&<}UOj9NeF;J_)8H^kO7Q?BkU?8N%7}UUz^UG3ch(gQL)KW>$J&psUJdrKo^!U| +z##%>z{HO=9971Cs^{1ifjMxlaqu%;3Uc`D(X?uf{z$L5Pas4gd~ta +z5y}sYP_ga4RN1R$>dCBa4pHY|H6%#w@kpf +zLs36%^R_SM*L+hJqqEeacL#47;s&gn`9&KVHpJTbIu;I1FTq^LD>RmD@@cZCp +zNhD$CSjSRT9OsQQy0292GOfzw?X*k%Mq0`kAQ`3EI@yGHLmMxXH`= +z#?4+PIh^9jX3UTyto`GWo4EPbs*j_2+kF`~=T~K&`&1pS3YGtDm*W^4mAm +zrYygaZsE@MPvuN6yh*0Nprr2a_nTdrK2&&#Ol +zkGK-n(z0m&F8BtpZ~FmH|f@IU>#ulHFMVUHp9kO>=(7Fm-uEixb1J5 +zXRSE{&65D{`Rzlkl0i~VW4|{};ul}_^8FV2oxLA~9cm3n-)d`E=i=?W>GZ}{sf|0H +zR^N``W!hg#XUVD$pAtILw|u~J;uqsS-$Kp>PfC&8S!-sZ%YM?8mc)MQ#v8bP)aN7Q +zTQo)Nuam6o{dF(b@GEciZHdnDd6OjV5?+VA#iCxsI +zdLt)+BTb;xz0U;hVJstXpb2C*j>WarPWgr%c=%ndwoBlj?7+X9KzS77F)4py2d*`N +z+!$Eg+u3Ss?ZE4KCAhrAH_|tlC|EK|;2U3@U?;&hp5oB<4ScY3{o~*E58j7Eww*q* +zacvuS*0%d!b(a)S+&^K-#f*QO(&ALBZ%RuXB}O;KjOOito6?4O<*dQo{tS`qc}{4J +zS`D-HBslcQN5UKC$FbWlQM!?E8Y!H$NzAv}Luf#6*~XshK*}$zOC5Zc)KLdda%k59 +z-t*t=AC#Xg9p$&}mzDX~eKXX`yc#RKS>vusOsHQ%2HEw8;}(?5?(W2ijq)LFj(Fzr +zVHQ6uC0Kr(sV27J!D=!oOT|gmmob5kTl&|UK{?E6>o<7KT7`UaGhOO3kLUNYki2}r +z&^!3gEcElYJNuI)8PVL4i2i!+pvjFxNwYZ%t+}7`JjT{DDQ2xS60d`nUrLVKQnjJs +zz0^C{KA#oCEA9lwH6|Y1W|+v-p%DhW$9JF+HWXa^r3Y)Ck(W{DSs}F*H7{%V +zupGDiaDdJG4WGUw&A0n^3=O{JgA=x}z4^A>rF%p5d@wyad-y+c8*bu70aUf4b{W6x +z{~5EOPx~kIW#tFz=GIYVD*QzG>Z|(P>+Tn1tf4d%ppNY9mmN9c)5@_6`;2Hd;qv{z +zu>PQi>J(D(ROvMJr84=Q#dEdT%{TuR^m(rKS~-eYSjCgN0YkGJXAkA=vKuq_ +z&KVob!@Fe_RIaOI>=0GxEZ6$oPvKDso4G*A=+1{9bB4D$s+-1;9!P&7xU)Z~hNu&{ +ze7UmrJ-+@^`v5gDp|yRHa!TUwiQ9d<3@)O#zB$%WR=Gd$&A?4I$z#Lm4d3EXjY9@y +zu|~E;-gA_CaAQKk(tR9p{my3PWB9)Mwo|i*znnAf9lqj?yeK`P;=G1|wAc%>Z&Oas +zypz+SgfE-rxs+(RglezSbf36H)d$c;VUmiV}|gi-Y$>&Hkc*e1TLifvuXntLkP<1G#C?nxO3mOjW +zVNbuDyh@~_n~D-DxAKDmrMq2%zv6|_lF@E5`jGXgHaMlY`NOQn&}CRxd0+%D=tg*; +zVKZl6MEMS34^eyxH@9cF+Sh%Sz^4M!OJ3g3a6=e3e~8%TT(U(;c<*2X-&5lEpIgL( +z$9)jG)E@WhH?kf(A?$NCqd#lh*L>fvp?R&;@S#u9pcV4?d$Z$QHg8@tXI)#OZ?jcjxy*)U +zWHo#uAE=o|cBitb4p+))*q$qU{cy3%vxl$adx8l|Zbsg6Q^k1;871Lo-VOJ?P=^n- +zeEVfHl9L~_Lk9jCp0#OxGk)fK&UP=mJUI<-w7mJ{-j;RZUo9kgt>s9?0XRPd68BQd +zj#TW@-t{Hk<>MQx;#{g<5nJu0foHe1v>g3c%ie?ATWSvO+psQp^n;f7kM3;Qo4>tf +zZ*gnOYe&9nIgsDla-eu~%cV!ww~RirrDfZZcJZZWTUx3P#cuFjdZ1;)y4(Zb(4RK= +zMjv=}!@7*4hg-g_*h;wxIJ$qs&YQ-4?Aowy#(~dpsFv4`9%|WtbSwVU+_LTH7cJjb +ze#lSTLzktJW}C#_>uUMi(GOeNk8W%E_U2uLe}hYHvw-prD|p3fruj^7-Wz3(LKZe5-Fz<&IadzbHRBa8JrJNzz8rBi~<*c +z(O?X?5R3)mz(wF*ommBftg?yxEfpoW`jB4THpuyAOPlq0#FEopa{$Z#h?US2j+uPPzK6D1*inq +zgDOxBLZAjL01H7aSOgY>8^Dd=CU7&j1=N9C!EK-(ECEZwGH^S%12lj;!E&$yG=jUp +z-Jl8F1AYwd1^0oUfS-cOeRz&qewupRsjya)acc7XT62jCx|4SWbb +z0z1LS;1lpE*adcjcJLYa9P9ym!5835un+79UxBZ|H{bv`2o8b6;9Kxd@Sosc;0QPh +z!gbav3vz>K5CdXCFAxWM14a>x5rnbGWhH>)7?=8k!QdotDyh!^=YUb*Vl<_JX`ld9 +zqqQD94Az64=#)nZ2ArbRIR+lf4#pqi^#%Qa2PA+*a2z-ubf+ZVwe|KF;cz_og15ZA +z37!V`gT-JDSjOAS`hsD^iPX?rQCwWFUa^W|zKf#2pCa|g#t!nHbxz8tG2<@2G}V`u +zF(E5^;-sA1DS3HUOr17;#*8bknmKdUtgElNX7=nkbFTIK^Yilqfw^-F3JMAfgTY`? +zQPI44#l^)X&~?{cH-G;8Qm70nFE6ivDuu3xs)VYALP9k{3luFBs#Uberp1bGu<1sd +zZqjtKO}A*OGjyw=+YHrr(2@>X+Cj@Sl_e&6ho_7lcS-8_jLhswIg_Q}QfvxMnXje9 +zs=SoeE~^w&6;qedE}t%(T{0<_DU_6`qd2N4svxQqstk4kZ0l{)wcWPS+F)bu?V9e; +z)S&53L(2`VFx1#VcXiU;9n>_(>rEM#nvtE8H+9BUv#yzaEd?$J7R@UzxsKK>E2j-< +zJ=#qgOj=3`bi)ml<))h`#x1u{0?fyDF&wKgS_O8lrOKi$( +zO<7&JFYb=4&BGom-kr2^=Jv5`Y7a**N#8K^k;0D$+&BI03!V;r(|1MA)^ndI-81BY +z**h+I;l_VO-8TN^(|rb&f7Kk +z{;S@-@GlDwCEPvbjq{(Z`0~_;{QtQ8rCYj*>>m|sS@qoZSDWc2C<#c8q! +zw%)z_L{NML_5B{|_dVqKft2tA$)bji@85p_G!Po3X|SfG2s$BxPW&D^>3e9%52TZS +zAc?2A@PL?DT3%W^K3*DB8ciBTDmPKnahi_T)L)ZSos*;*on)%ia8tF0N7Qh)(})`H +zcKSUnaN_s1Kxb#sM=n=Xlv{TS=@6z``pL8+f_j>nNDq{mkwll7#|hvxFar2M0Ne`J +z0hfzo;EDoFv*aTPE~Z%AuyJ<=n7+7@fET2IRFH3VBNr3}xgnWl$TUPEefP}Go-v7? +zGE)*;`-8#YBycJ?1Dpd!fr~*Jm<9?!HK+#t98RQW +zlE`h4HP9MB&c|axB9?flxxUQh`cR8;%r)hUaM6?`O3eeiXtz?W%dN|Jt@9;Vcab&D +zO0mwjlCATsbFuntYq&Mmy3iV9jkYeJ1S4sIVb+hVv#c|%p_J@&S|!q+$owPii?qje +zlKbK(DDwrFmCp{7%^a_W%TwvPyl^;l>Qcs`r!cEFohqdFIVZfyyNZ-h6!9u9AX=dnmRgpN}A3HHEO +z^X`q+@Mic1cq@E6Jdqb@?1OuE^RTNA_Q7YvE8+58$d<-7zq7M_a +zzHF^e7L4C^=u_oK){5*-QKsyOn%Kt^mk~dU|C#Z##N-@;(up?~AMcHiSmQm3cSmJ- +zlJ0Vk_jntl$9smYi1B$+mc?dz#@6?m=xKGiuZ`;C8H>#48AhD(o+Q$Y_ry(-CRqvY +zL*Lt_hyiu1xrNi5uhM +z=n5pW;65aC;CY-+)aUMx#JUOHtn#_?zuyS-QOs6Zbyi(oGd{ +zNwMUos!hmbyti;mye?bXSbS?3VG^H9j)W!7CqVpA#-k^YOVbO9Y&x>X9J)nTjO-DI +zO!B)C*(zjbb8P!pvFZg9e~;^mby#))8piZ@63bEYRw>QCM@wTkd<5>DH$h@x$mxqTjQeRR}1RfD*x +z-ABg~cX~xQ{EEcQ^sID6J%}n_{8aVdu7}ygu`0vi1ri5J1(nE3k&Va4C6BwJCVG+@ +z#kW^P(;t?_WP4KTV{<&Kd%F`|o|H7tFtYFHBDUVA(NW9T{}3vKqz`UJ7R|VxNf~Xw +z%<7>JX4`$R&E>8VPwL(W$4hMu1xYk$G~@nMj%{C>EWR{dTq5a8PvRshLh?-|-X+94 +zO1;?mVr;j*ulj1Hr^)4RjqWjDdY4^}CiLyOiR(#6-^USk-|rktI`#dn&v)xE#?IW{->t6|eK{|(%HPo*T(+EJXO?5^TGj?Eyj-te;5z-1 +zJT6n^RpXr++at!}OsT)9HTont?jxyDxwcKuUC0dCDag-h^t>V6M>miJo#67 +zX8JsNY8-t4y{+gq*K-*&S0mej>?|>Wp@W9VkufQsQ<+2UBkVN^o7!<5j<{|rUrP6+ +zM$NR_lP#64MI(-UJmyqrbwp_?>yR55Zo|M)vHlxwKBAO)MxcV?9 +z%Z-mpgRS4VmBM+6wuUqt_%3Au$M&^@DlNC?NIB@0Hrzp+#GRe>CsF^8{&&?tik<-M +zlLm#PiwT`7z5>Z*LXi%aX_-*%lQx%OUnubdo6CKy5M4#liJB+raG56vnQ%T}Q6cB~ +zIzKZ;$n{@{;a1Tq9WKMTP^vzc>za`C9U-|qD{8Zuj;8vrNMxK5VyIK3=3*Re*8(G# +zabC#SsWyCaj>{`D`LQiR*}qE1XTym)H}$wrpV#Vee%ztLO*yr?|7Xmr+aWT;F}i&x +zXnv*UMVgOovr|-#j7({t@B4$zGt<&8@(xQ6&MgU)d&ee^N=`X%%y9dl=Y$Ta8}A!y +z8mx;vs>44VV%pkm8NcW%kG72ebd|?grX9MkaUK5BRW1XfQ(_;x +zd9vc|Q66tq_9*Xb)%7Uv*U|5sxwvKRZM9Qk@=dUsn|qQcT9q&NBZhBeUKb$e`V>i#8thS!ygDm4;&QK(AtuN*@z%_`;HrzRGRV|oDEujOU{RnG*F$)}!O;#Ys<1nO@yYowNY#Q;d|QG~LM +zT*t3dQg&2m`6?sV<9ZEpWzSGMqPpMbuu;d4%=c*>-;6&ETK@(We~^{hW(&-C{WkKR +z>QnZyx_APb7ZG1xCoA%-2)R5@>`4!AsOwRFHge@xGGT)%ZDw7h<=)Y@K-~j#I7iEQ +zXsSrsPe^t}O8qzMdd{=O)-^hQtB$`w%WJeePaG9e_rLJlw0zZACAJ>2ne{6zPaS6q +z)O{_7FCdqEQ=iijsTU!6W37~{=@R>Vs?DrVwS1qJtNT>Kj%YpJzt|CD^@aI(xYGZU +zEk9Z7IakZ;UbF>juFqkrmN%`n<)`TQS0h*clVJ>o;iX#Mw9J;P`%Dh6H1Y4YrYL#$>+B5VGX58~*@j@AqU*Jue65F5 +zMR#d=%5Us*bx+OV<4RBW>)l^;eD#AO;tjTwS=+SS()F*0Z|fT)k0{qb3Mlo^rsWA* +z&uA@A{FN_z{6a0aerpTP((+rhyjkl%PRs8{?&@JaAoD6^&trB( +zqkpZIr)WJXTF(wGuhZ>l>iLM4@6+*hcePIGB?-IFb4DN+f6H&viZ#1b$-B=(rXd$Q +zQ*?RNJw9nlwY*a2iy4Xz;lQ#dG;+Rovx)zx9gk*G^fTngOS|X_GxgA>BkI{!n0UX^=uj#uL4Pn$l255SzYb6ScoISYGX~ +z3|5uZgaWcPJ9*^DaVe~F+M$vWk=P(k+G?w!sHi#^GI<$kX-Nnzk~?t_p43rb4xH}L9nV?wQYx@ZV@|mDD`Znx2={G((r!WN(B|wj{JhPp{jtG +zJ1OiaZ))61Avrhe_>*T0MDYNkD| +zm<%Gq?1plxi)dwMkf}*k!~XPHlYP0_Y0d}{X(J4^4e2aLS5xLu3}YlCIo*0eu+*ts +zU4XhZmfxQ_d4@kDOZ!U}U!(Q=r{|_=&+%vGOd0RX@lTmBVOqv?|8(E@oQy91)TQ>F +z+1cZ(pQ_2We?FwfVJ_RjU}|b+PWJdT|H$N#$)l}MaaF~_&Yvv#v!~~BF*36UDoExI +z)7AAB=fQ`%CjWtDQy%gIbx3>v(8@7&?Dx+r!>71haar?Ql(?XBQD=!qTwvMF-6@hf +z{2vy;w2Z0*vMQ@s5YafQHF|6dzrUb1AVU;=ZE-{@E13&2QzUq(%I3x9sJtQ+OrBR> +zldR@b=am#%>Z~|WU2G*6E-ELb%|lgoh+LHAw`?k!KJgP)6)X)%0)14;q$^pqL^6lT +z^SGWShq&}v$ue~$Qic3{%}Ndy>&aqqAxg}doz$K++9}L2IRwf|3dp`9B$_c!>6uH1 +zNTyGfF&#DY-yg_jU58s0?s;r7&*=>xs^x~6`!;i)%mHr%sxayE^?~83IwFrz6q)(I +zK4o8_y?4^2U!@NWUnvg~Ajww_P5LAeLa9J>oAhRV!0=QPKpY{h&OYIP7Lc_a6V0q6 +z7=F5rY3w)g44*-`tQDDav)*91x&Mu{U#qnWIgl`u-mFU)Zq}zv{*mP`*XhS=g=W3W +z@O&+o^xPeHt3P@EC3Rx%e>?7b6A?n@d4+vu+iH%5R|98yuTE!po-;DXI=F-19Fg9v +zn;34&Yt)!?!*7pBU#BxL{NOK5N}HSfjkGZ$y;=V>oZHSWByHuSdpVKvoA&EiuUT!! +zYL3XzYl}Pn|AHfD`sQXk$Z**c>!is1e@mbqLpK +z+c6^Jn{&hEd5t`aGU?5FQqsSf{#DY7@0s*w-N~!dH|z47a+`cjwcbWriDJ^5^{KWu +z5JFz{zw@6-Z}{5;In!HhI&Q1YWqfjyNoV-`1Ul1?ZL?#K)#-;h6LW0R8SzdnGxq1V +z*&+ElePn!74<`L?4kZ5+BhcKWH|z2ySmFvfd57=XLF#{<&cC*=EtK{C8er@(NzDWkm|OHp0wH4w7_34-tboV_ +zfhGflCajj0e$|dGpVvP02FJEk5yGQ9u6h~4qM*R|Xqf=k^ebM`(w@8a*=vWx$o{@L +z|FeH<@3r6O?6YUzPffkAn|iH@IZO`@Axz!XS2)c%UlmcQjN%Gn3pd&L1%pk$4r_h6 +zh}ZW$pI+}FTZCRu5L~L!_Xsqp8-!imAr(x@q(q`NqP87St(>wwEYkQRbPBI1hAB{B +za?7j+hg(f^rmYL*#;Z4H#_s)B)b@>?pS}Crx~V65o<#id=0@Q!8h;kWHrw|M>$Evs +zozJ)--aIWc3vn*~CgP8WeEb#QuMmGz;34zO=v|wFdme*FUWPs9lIZc#zm78xu519O +zDIJE)CCV1aiYitfhyTFqe!Ndp{-j@f^y?aag-}!p^skMAWJ{x$`^G?>%YI{KEQ!Ul +zl6iv12w|Nj!QB-CJk6Vc!Ae{$5%GmW*edKL?uU^d-Ygz|N4&pL#J#mb8SfvSp)*ea +z+5T#(kj)|Z86nI~oH+&fRh-aQP`IBU?=TE=F&z(nD!7+;slZjHc;=ukl?Bh1HN9J;JWCly +zQHwij1Q>_uc-ThiZPc=Mf!P;SA@_6vCSaV0sl+?@ka_VZ$80Vcf;5)Pqj+-0PRR;U +ziytFLVOemINOz4Y#E9#27EM-RX2;1tn_ +z;|=_VfhQPvG!@KyO;!r}yP~}5y&}~}lr%#In}JhT>(+b&r?J<0iGfq+=)BUvX;SLk +zA-I?Ef-O1{7ndQ!WCM2_c)o$pH*ns2GI$I;OG4Ck16TDqPsR>|fmcd~H3lx%CAW1N +zc(zQ8+HK%+*txmaz++{4J_mkcFpQH1RKJ1CY0b?q8n|3foc9|zJpnmp`wTo&C*m@I +zT%UuywK)dE2}6cS1|BqUTo%LOeFGmqOc@Iq_!t8Z-{NH~*+%*Z7=6!Es|HF(m`UZXLbK_ixE?ba4w}9u#{PAKgtE);d|F(c>;tG>8Hn1u` +zOEJYcR!egRrac3DZZHVf19L;(?yY&nOo_onlu~z%^y3k^~=2X-dz(rfGw}{I{k# +zeaEgIa2~j*Y1-A_hqIvJu0ACJF5cx)UWS=P0n^u?!1bazN+HZDeny!D$BGXq?Xacf +z)2zpFJbdR5@)hjr8NCc+uAYjeToP(eln#W?z}C{dQ7?sf5d*Fs%O-fObixQ5CI~Nr +zOQnmmpTik5?7*@eW9VQn7vbRR5VVz*#yp80&=AUj=gKli+>Q3|dN@?pnlXSg8cY5i +zmxOPfz%*C!7E8{7>hcQZCFm&6Oq+X2(|qR}e1B{3X|Ch7xs|-@!pmS!d1-VVE?!qp +zCW8y*4=UYIG1Xo9F!sZifz_X2mABRA#^G(MtEcANSjK977!UvWf~M7S%K;lU9DNEL +zgg2(nu#LgYqOD({=X&Mn;NF{>)*HSLGhyxafVJY$Ag?aW0)6`5@S)M+&Ay*Ag!`!~}u82-?!yER}=>NsG +zVyAS$|JlE-L_vM!x)FEd(>uHxPF7YGoKNM}l=o1?$S2eWv1z540t=dPUeg*Ee}*6l +zCRgPsMKHH2XVOp4@fIg+Nx;dA^I(Bq&5C5K_?*SLFW%Qv`xveYOB?L2%2UR}!K(bR +zmiMtEo1D!&*RHQMt-<%PK7wC{e*>oKdrUXphkL8Dt5)Me#>%WjF;*soajeW)bkex^ +zQ`ffDxwhB%X2IqAywP_VYw#gFU!9>Gg8kLDJR7F+9p(k~;5!G6r!aSeaszw45`S(L +z(Kt}1=P571r0MmsefUuE-JhEuJ_75eS2SLDkGE-mF5kH7QzHB(5`BgYUb-O%xb7^D +zYSfo9TFIkdePfVU!p-U96r3e9HZHvflQiHwQyYDM8ch3_riFt@L`C1wSDd94Ya%L| +zjurLrieAG^tO?|DtrI#4@MySckJG|i8yqP~h6LcPi32Q)1mN5+9#f*Lxc +zX?&z?hc)eos2_!+BMFPVL4`elXaZH1i1GIqFzTWIjLz=qVPTX +zwx+E|?MLlJEjg`eAyfzIb<_b=w*~EIuprbR_VW$YAsozF+)@N_vh<>M;w-$5>cOSr +zz;~wlS550j^`O2r5?_=-ya^%bz&FHA)FD(AcUzvTnwF2+i#h}TIDe8-0w2wvWDR3a +zsn{_x@K@nN{DmN^DJ^CG>zXF_8?{Kg@pnHoHq}*ph?a>MW8aEbzi(O?kFNFC=rzOdg$C3p?B!@U*)+Fc{y|NnZxVga+m4pa$jT`-ug!X7{orgKld>Nz?PS5{0o#L? +zbXe9rR+#}?nl~xY5VPPu<+sqYpg3kK+E3tUyo)ir>E=;5w%}e+o1?7!<7^y`glr10 +zP#dyzNLg5?r+5`(E*u+~Vm^0;tQM9me9)4MBh(Iu7S6NqF=SwExzF+z-UVSU_ +zj?o`$bJ_L-#!JroM_Sj7` +zn|N39iKb;C<$>o=aWXUnUTU2jKU;nw$S(ryQa$jm5FUm%ZZqMtlsl|))7SW&F_p=reglOqn+ +zt>{9hPE)G4#3m9rNZq6!(hky2(q2+OX+P-zX^=ETIz-B{m>yJ8n@}$+A>bf&lX^%y +zNIOY;N&Te#qywZu(h%tosr&{L)nKe{)~sq$m3Zk=T7Mpn4Bc~u3jcF +z^C{?&v0G}!BPe;Gb&K-$C9$Af_6CEQjT!#lHDFAi%;fhjaZ$b*_we!@?e+|*On&d) +z&T)g%Yb4^{%vWUJow$|R?#SWykC%HR`iOreoAB&K&Ar_dp9GxC1u3m|yixGHLYAPA +z;a;78qsiliQzNkDyaf(&MD=IMI#-$JVUfOs+~pDXFTI^l +z)45k=4l;Ns13zR_aFIBc2rxjrg*c=14&r=M!_(U$3f@RO6jAU_$=lEYUm6~A^h;@2 +zEWiNq0C7LhfWe_(89PGUL+NFUFUs^0{Bz>$JHi2fw}_=_5-k`YgIshfaa#np5%)hN +z9C?JWQppL(3b}}fh|BcNCN@%Z^+Ry@$zp3j_>m*JLC=PBH2|?|ij_X7UQ=WmS^DEcq+7W!3;+xe* +zDW#aj*{;n2_pB{4F(<5AyU4`m!0ENc^|>OE+~K@NX**^L-cLS)(npa1@)Y$lad!pG +zURRXSd$%yl(_lMxAU{?fD1e>o7G*>p3jdtU?&%Qw)VF@nw+sbXxWtvPS+#(@vZf24+9)GsW1a +zvBgDY<#v1EL+=Y_=!?yO?oD;DI#vz5x#?|_G6cK7Uz`}idB%g(b~uMr?k=U?0Bct< +zba$!BB53L=j`7o;)en7L_LvaGLhug8pAGsBZuAmR)X=g2w!IUy_<5GRVzR6EyjXW94&X#yr^Rv&VSIsRvH` +z>?%Fby|{wK!&n$f<6Com=fPmc9W_--_8bK+-mQ939Dr_@fs- +ziW&p$+p=PMso+k?>Pm$dk;n(oMmW9AE@SFONZLL#dZS2P2=8F_N4Mum;DX)T?J?aw +V!n_vFZMVlN^j;mUKt|X2{|D$~Sdst$ + +delta 7376 +zcmZvh3v^V~xySdJ$%G`tWWp;CLNmbx0w_tukOaZZkVpmyG87O*9@86C9wCHY^;&8( +z69~#cvsU1vf(RN5_ex#1H=0$86mdW*c)eU>X?@^>v2bO=qlDYl3W}cl-)Db29R~MW +zXa0NtzWsikefG5f-nM_Itvx$qps<`@Qk4!*{c$^ukYSV`|Kt5yrh@tO3Og<*%Ilhy~J2V +zFC=7=J0Z)MZuy$v+a`U+ZtM3!>(@u`C)65uTQN!;m4R$z49C4I*4u>`Aku`hTJdBh +zqQR!Pn=AG+*#@|5=1!Lt6bqGzAETROK9R`^(B)=FI6}o=E5TrbPQ5Nw>ZQt3(KyDdqRmY +zIiubx1s-GmJKaO06}ZH_9xC(i;Z{E{&W$MQWcpvesgw~8~0>Vkiu_(g;*$6RoQ +zcq)nKxqt|d@luX{ow=`Afli3k#s(fs-`&cvgA2&u0y=q46n1%%erluclze(FIgwu8 +zn%_!lZj7dpX83LHvfk6uX;Gp=RS(zyxuKaB!=^g-Qv-pm|%HijRsjh_0tgly1K(UP@*e +zy=}LI5c0N_Jt-x<=6Gp1`Zs#XQ`rARL>3YDwmJ6DDNkOa8xf+-WP0j{AHrPd%fRt6 +zLdf8KDJp}UFQ|2LY4UdD0D~x?Lz9OkE`~k2i@un=BqxHoijw~_TM)LuO-bMKXL|D-dt0V3hxka+oWqlg{TQ39R1yArdcB`hg@hl@>IB&KC7AN8i&NHt=X8( +zQ;nlNuUt3H_UK9^LhX)H*zl?Q1|MWxYs~yi#`jlLwlx~~y`k;kaa?!1yV7O9IwJ9>xO4p|NbB<+M{c%u= +z>W>r{(I2DfUu(;3bB58D>a3x4191%jI^{(g;{BmfK+C;r +z6BlD&j&7qKZ{?`3he+$-uOMpV(`&lXv{{IOf)<`K%^CHV0PdjaQ*SlyrPWh!9eLnm +z*{A6n(lL244}NM@v+PdP?cVx=ebd`&R$&!5TIuzvg*fA#o?0}t@FR5O{hkFf)ze>_ +zW?kqn)(CzTeV2w$n{3Pam>!xoymA|sC@QlB5?dL8%Aqp@-89Hs +zD7P-xz$~e2dFWpdr4IAVIV1Fkp3HAeGujKHD*A@C;v50gL{&5k74^%CrUFehj(O5Y +zEfV;7(AhHvlMJ(@0=r+d@y{rB1o8sNlVB0KX53M6c>uhH($@NSUBiF;3Bmuori15X +z@IzGCny+fgpQKGQhI;!UU3y*+H4=YI|H0Rr9Vrh9u_65E=-K<_#*qHY(s1aO|9cQ@ +z(nb6pb9{+k%kqox18=40)ySdRFsZxi(u_=-v9HVFOR?Jq-%S~_3yc@L#?St*RPsAr +zulo1)3&GR-6mj~nWOMh=^1 +z6V!FYG+Uv5=niNQ`ZBZ^8itmpD@h^ +zsOyiWc~FL-SvXO&pF}~>PV`Y2+KmxR#R;JkGh{y0kEwSM>c;v=!W*aef6)-A`%BZ@ +z2JM9IgZl6mINA>@tQ($>WP}T**$ZugCeS;}MjCFqvTS7bRrE~kfdaF^IzabQ>GI6M +z%YJW~`uKou7aQ>`rA5nY%Pzt)0wHlvn)6B9!Zdk4lW8wXcF;5nrLwDoCZJcd=;P%x +zM=g8PG}W6_9c7lmvJGq;$CkBu0xV3kRty~c->~4#XgO>GLXJ`q{ba>ZqmF*DV!e?? +z*(;|T2Wj`p;^aGFKaSo%i%_{E^$(`mNRt{yZf(d-mR0bf|8JwphT7!$2z4N|kajoB +zb6kfnNY@%>JLX^{vS`+->5jedMd^iAwT@o+4$`GnwaF7P9=`WYvy-l@Dxe=VmODB? +zcG2#}TE|8BN~ouCWndvjr|EO7XOtmkra9N!>eG^@yk(u*9*1o&Y)hpLPB!T0U;-~3 +z>s!E^=Cf}yQqqz<{be`ogRK>>vd7?;PIj;y{a!Hr(IUBw`zLVk8FPr4FA1E4QNX2V +zFos>ToJ-QC>65-b*`qHlw--GiU8)k57JhwR%B@xgY`>OsHq(OUJfoS`HjmAB%Atot +zQI`9NGn20=>ALBiW*5#B=bOi7xH(5mM9T$fRG=6$@%})bEz+OX2A)Eu9@~&WiL5=G +zo7KnaXKi8)vbM8!uy(SBS-V*yti7z(RRzj%W?01um(qYJVc=%7=Bj)&65_MC67lDyv<7 +zS_WfdYK~>w@_js8xW1RuYwO1a;`&H_|Jra{;*@JT#>v$yxn82$R1S|J{#k-vx>GEE +zQs&U-&+v_~6eD-dSh#k@l%fOA{F +zLcGP?&+&D^pX>N>{4#U#LzRJi+o*MiceZSCm<{b*fRni^j=Pw5%u*5k9KTd^p8~o< +zUgikHjcIJUqUN3jt%IojY}54 +zwc_5qF&we@%^T0V;PRe4e#iTq^KrK5oRyxpc;ALJrqB8yUb{AdcdfGzDGwI3yp6@F +zWO8V%EmA^14lTAtCea^5#Z!6D(I-23Q7Gfa-dD;@x|zH1{Vkoo4?V}+T}ab5jm?R_ +z*DXf}%Iw0~v~|(v>O^yP5ah(=z{ndHjv_1?Ej|6;Yqr +z5-?~3I4y*h{5&Jz=6l0S%|Tzm|Fo!4MTivgv}Fz-fm53tf%v~n+{{Hz*V?v_EqQ!}s2_XBxbc-;sqOz^#|?Hr +zIzdxtRZ4o-_-zN|CDWCsi!=1;Mr#F?ZZFQzhe@s7v<6h4b+j&^SGE@?yZN~4rk?HP +z$w3a`NV%gtSsygrw0uWJvR)fbdI>fTxtw$!Aw3QQX!J9EA?E;E@l3gMplZK9-&E2o +z&lIQVrJq|(=aGW<6yc-MJIkHC`Riq!OKWx(575UKt=ALj)t$x3%_?_iBc0z_u0vUk +zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh +dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh + +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 +index f33ce913..01b208ed 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +@@ -30,6 +30,22 @@ public abstract class DefinedPacket + writeString( s, buf, Short.MAX_VALUE ); + } + ++ //Velocity start ++ private static final int[] VARINT_EXACT_BYTE_LENGTHS = new int[33]; ++ ++ static { ++ for (int i = 0; i <= 32; ++i) { ++ VARINT_EXACT_BYTE_LENGTHS[i] = (int) Math.ceil((31d - (i - 1)) / 7d); ++ } ++ VARINT_EXACT_BYTE_LENGTHS[32] = 1; // Special case for the number 0. ++ } ++ ++ public static int varIntBytes(int value) { ++ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)]; ++ } ++ //Velocity end ++ ++ + public static void writeString(String s, ByteBuf buf, int maxLength) + { + if ( s.length() > maxLength ) +@@ -198,6 +214,12 @@ public abstract class DefinedPacket + } + } + ++ public static void write21BitVarInt(ByteBuf buf, int value) { ++ // See https://steinborn.me/posts/performance/how-fast-can-you-write-a-varint/ ++ int w = (value & 0x7F | 0x80) << 16 | ((value >>> 7) & 0x7F | 0x80) << 8 | (value >>> 14); ++ buf.writeMedium(w); ++ } ++ + public static int readVarShort(ByteBuf buf) + { + int low = buf.readUnsignedShort(); +diff --git a/proxy/pom.xml b/proxy/pom.xml +index 10fe411d..f6daaea4 100644 +--- a/proxy/pom.xml ++++ b/proxy/pom.xml +@@ -165,6 +165,12 @@ + ${project.version} + compile + ++ ++ io.github.waterfallmc ++ waterfall-native ++ ${project.version} ++ compile ++ + + io.github.waterfallmc + waterfall-module-cmd-alert +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 4c6d9eb9..d91c2819 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; ++import dev._2lstudios.flamecord.natives.Natives; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; + import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException; + import io.netty.bootstrap.ServerBootstrap; +@@ -256,23 +257,7 @@ public class BungeeCord extends ProxyServer + + pluginManager = new PluginManager( this ); + +- if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) +- { +- if ( EncryptionUtil.nativeFactory.load() ) +- { +- logger.info( "Using mbed TLS based native cipher." ); +- } else +- { +- logger.info( "Using standard Java JCE cipher." ); +- } +- if ( CompressFactory.zlib.load() ) +- { +- logger.info( "Using zlib based native compressor." ); +- } else +- { +- logger.info( "Using standard Java compressor." ); +- } +- } ++ logger.log(Level.INFO, "FlameCord is using " + Natives.compress.getLoadedVariant() + " compression and " + Natives.cipher.getLoadedVariant() + " ciphers"); + } + + /** +diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +index d07cf462..24184796 100644 +--- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java ++++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +@@ -1,45 +1,84 @@ + package net.md_5.bungee.compress; + ++import dev._2lstudios.flamecord.natives.MoreByteBufUtils; ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import io.netty.buffer.ByteBuf; ++import io.netty.buffer.ByteBufAllocator; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.MessageToByteEncoder; ++ ++import java.util.zip.DataFormatException; + import java.util.zip.Deflater; + import lombok.Setter; + import net.md_5.bungee.jni.zlib.BungeeZlib; + import net.md_5.bungee.protocol.DefinedPacket; + +-public class PacketCompressor extends MessageToByteEncoder +-{ ++public class PacketCompressor extends MessageToByteEncoder { ++ ++ private final Compressor compressor; + +- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); + @Setter + private int threshold = 256; + +- @Override +- public void handlerAdded(ChannelHandlerContext ctx) throws Exception +- { +- zlib.init( true, Deflater.DEFAULT_COMPRESSION ); ++ public PacketCompressor(Compressor compressor) { ++ this.compressor = compressor; + } + + @Override +- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception +- { +- zlib.free(); ++ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { ++ compressor.close(); + } + + @Override +- protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception +- { ++ protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { + int origSize = msg.readableBytes(); +- if ( origSize < threshold ) +- { +- DefinedPacket.writeVarInt( 0, out ); +- out.writeBytes( msg ); +- } else +- { +- DefinedPacket.writeVarInt( origSize, out ); +- +- zlib.process( msg, out ); ++ if (origSize < threshold) { ++ // Under the threshold, there is nothing to do. ++ DefinedPacket.writeVarInt(origSize + 1, out); ++ DefinedPacket.writeVarInt(0, out); ++ out.writeBytes(msg); ++ return; ++ } ++ ++ int uncompressed = msg.readableBytes(); ++ ++ DefinedPacket.write21BitVarInt(out, 0); // Dummy packet length ++ DefinedPacket.writeVarInt(uncompressed, out); ++ ByteBuf compatibleIn = MoreByteBufUtils.ensureCompatible(ctx.alloc(), compressor, msg); ++ ++ int startCompressed = out.writerIndex(); ++ try { ++ compressor.deflate(compatibleIn, out); ++ } finally { ++ compatibleIn.release(); ++ } ++ int compressedLength = out.writerIndex() - startCompressed; ++ if (compressedLength >= 1 << 21) { ++ throw new DataFormatException("The server sent a very large (over 2MiB compressed) packet."); + } ++ ++ int writerIndex = out.writerIndex(); ++ int packetLength = out.readableBytes() - 3; ++ out.writerIndex(0); ++ DefinedPacket.write21BitVarInt(out, packetLength); // Rewrite packet length ++ out.writerIndex(writerIndex); ++ } ++ ++ @Override ++ protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception { ++ return allocateByteBufForCompression(ctx.alloc(), msg, threshold); ++ } ++ ++ public static ByteBuf allocateByteBufForCompression(ByteBufAllocator allocator, ByteBuf msg, int threshold) { ++ int uncompressed = msg.readableBytes(); ++ if (uncompressed < threshold) { ++ int finalBufferSize = uncompressed + 1; ++ finalBufferSize += DefinedPacket.varIntBytes(finalBufferSize); ++ return allocator.directBuffer(finalBufferSize); ++ } ++ ++ // (maximum data length after compression) + packet length varint + uncompressed data varint ++ int initialBufferSize = (uncompressed - 1) + 3 + DefinedPacket.varIntBytes(uncompressed); ++ return allocator.directBuffer(initialBufferSize); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +index eaedf4bc..066bdafc 100644 +--- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java ++++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +@@ -1,5 +1,6 @@ + package net.md_5.bungee.compress; + ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import lombok.*; + + import com.google.common.base.Preconditions; +@@ -8,53 +9,75 @@ import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.MessageToMessageDecoder; + import java.util.List; + import net.md_5.bungee.jni.zlib.BungeeZlib; ++import net.md_5.bungee.protocol.BadPacketException; + import net.md_5.bungee.protocol.DefinedPacket; + ++import static dev._2lstudios.flamecord.natives.MoreByteBufUtils.ensureCompatible; ++ ++ + @RequiredArgsConstructor +-public class PacketDecompressor extends MessageToMessageDecoder +-{ ++public class PacketDecompressor extends MessageToMessageDecoder { ++ private static final int VANILLA_MAXIMUM_UNCOMPRESSED_SIZE = 8 * 1024 * 1024; // 8MiB ++ private static final int MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING = ((100 * 4) + Short.MAX_VALUE) + 5 + 5; //((100 chars channel tag) + max data size) + string varint + packet id varint + +- private final int compressionThreshold; +- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); ++ @Setter ++ private boolean checking = false; + +- @Override +- public void handlerAdded(ChannelHandlerContext ctx) throws Exception +- { +- zlib.init( false, 0 ); +- } ++ private final Compressor compressor; ++ private final int threshold; + + @Override +- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception +- { +- zlib.free(); ++ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { ++ compressor.close(); + } + + @Override +- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception +- { +- int size = DefinedPacket.readVarInt( in ); +- if ( size == 0 ) +- { +- out.add( in.retain() ); +- } else +- { +- Preconditions.checkArgument( size >= compressionThreshold, "Decompressed size %s less than compression threshold %s", size, compressionThreshold); +- ByteBuf decompressed = ctx.alloc().directBuffer(); +- +- try +- { +- zlib.process( in, decompressed ); +- Preconditions.checkArgument( decompressed.readableBytes() == size, "Decompressed size %s is not equal to actual decompressed bytes", size, decompressed.readableBytes()); +- +- out.add( decompressed ); +- decompressed = null; +- } finally +- { +- if ( decompressed != null ) +- { +- decompressed.release(); +- } +- } ++ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { ++ int size = DefinedPacket.readVarInt(in); ++ if (size == 0) { ++ out.add(in.retain()); ++ return; ++ } ++ ++ //Velocity start ++ if (threshold != -1 && size < threshold) { ++ throw new BadPacketException( ++ "Uncompressed size " + size + " is less than threshold " + threshold ++ ); ++ } ++ ++ if (size > VANILLA_MAXIMUM_UNCOMPRESSED_SIZE) { ++ throw new BadPacketException("" + ++ "Uncompressed size " + size + " exceeds threshold of " + VANILLA_MAXIMUM_UNCOMPRESSED_SIZE ++ ); ++ } ++ ++ if (checking && size > MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING) { ++ throw new BadPacketException( ++ "Uncompressed size " + size + " exceeds threshold of " + MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING + " (While checking)" ++ ); ++ } ++ //Velocity end ++ ++ ByteBuf compatibleIn = ensureCompatible(ctx.alloc(), compressor, in); ++ ByteBuf uncompressed; ++ if (checking) { ++ uncompressed = ctx.alloc().directBuffer(size, size); ++ } ++ else { ++ uncompressed = ctx.alloc().directBuffer(size); ++ } ++ ++ try { ++ compressor.inflate(compatibleIn, uncompressed, size); ++ out.add(uncompressed); ++ } ++ catch (Exception e) { ++ uncompressed.release(); ++ throw e; ++ } ++ finally { ++ compatibleIn.release(); + } + } +-} ++} +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index 8d4439ab..79b4eec5 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -44,8 +44,8 @@ public class ForgeUtils + if ( discriminator == 2 ) // ModList + { + ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ int modCount = DefinedPacket.readVarInt( buffer); //FlameCord - Remove length check for compression ++ for ( int i = 0; i < modCount; i++ ) + { + modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index b98ee6a7..39149f21 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -1,6 +1,10 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.natives.Natives; ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandler; +@@ -145,32 +149,30 @@ public class ChannelWrapper + return ch; + } + +- public void setCompressionThreshold(int compressionThreshold) +- { +- // FlameCord - Use pipeline to reduce redundancy +- final ChannelPipeline pipeline = ch.pipeline(); +- if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) +- { +- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); ++ public void setCompressionThreshold(int compressionThreshold) { ++ Compressor compressor = Natives.getCompressorFactory().create(FlameCord.getInstance().getFlameCordConfiguration().getCompressionLevel()); ++ ++ if (ch.pipeline().get(PacketCompressor.class) == null && compressionThreshold != -1) { ++ addBefore(PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor(compressor)); ++ ch.pipeline().remove(PipelineUtils.FRAME_PREPENDER); //NullCordX + } +- if ( compressionThreshold != -1 ) +- { +- pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); +- } else +- { +- pipeline.remove( "compress" ); ++ if (compressionThreshold != -1) { ++ ch.pipeline().get(PacketCompressor.class).setThreshold(compressionThreshold); ++ } else { ++ ch.pipeline().remove("compress"); ++ addBefore(PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, PipelineUtils.framePrepender); //NullCordX + } + +- if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) +- { +- addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); ++ if (ch.pipeline().get(PacketDecompressor.class) == null && compressionThreshold != -1) { ++ PacketDecompressor packetDecompressor = new PacketDecompressor(compressor, compressionThreshold); //BotFilter ++ addBefore(PipelineUtils.PACKET_DECODER, "decompress", packetDecompressor); + } +- if ( compressionThreshold == -1 ) +- { +- pipeline.remove( "decompress" ); ++ if (compressionThreshold == -1) { ++ ch.pipeline().remove("decompress"); + } + } + ++ + // FlameCord start - Antibot System + // Make the channel accessible + public Channel getChannel() { +-- +2.38.1.windows.1 + From f28fa1172c33676b7a6e3c9e96d7663ca4c2d779 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 29 Jan 2023 00:12:28 -0300 Subject: [PATCH 401/499] Fix Libdeflate Patch --- .../0040-Implement-libdeflate.patch | 63 +++++++++++-------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 0d290e9f..a58d83d3 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,4 +1,4 @@ -From c637708bcd56e66aa8da77b6bf67bed16348ae6c Mon Sep 17 00:00:00 2001 +From aa08f9e4f6efc5834310e4070287147461f25a0b Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate @@ -2270,7 +2270,7 @@ index 10fe411d..f6daaea4 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4c6d9eb9..d91c2819 100644 +index 4c6d9eb9..b1d2a71f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2302,7 +2302,7 @@ index 4c6d9eb9..d91c2819 100644 - logger.info( "Using standard Java compressor." ); - } - } -+ logger.log(Level.INFO, "FlameCord is using " + Natives.compress.getLoadedVariant() + " compression and " + Natives.cipher.getLoadedVariant() + " ciphers"); ++ logger.log(Level.INFO, "FlameCord is using " + Natives.getCompressorFactory().getName() + " compression"); } /** @@ -2558,7 +2558,7 @@ index 8d4439ab..79b4eec5 100644 modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a7..39149f21 100644 +index b98ee6a7..27dc4a73 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2572,49 +2572,44 @@ index b98ee6a7..39149f21 100644 import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; -@@ -145,32 +149,30 @@ public class ChannelWrapper +@@ -145,32 +149,32 @@ public class ChannelWrapper return ch; } - public void setCompressionThreshold(int compressionThreshold) - { -- // FlameCord - Use pipeline to reduce redundancy -- final ChannelPipeline pipeline = ch.pipeline(); -- if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) -- { -- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); + public void setCompressionThreshold(int compressionThreshold) { -+ Compressor compressor = Natives.getCompressorFactory().create(FlameCord.getInstance().getFlameCordConfiguration().getCompressionLevel()); ++ Compressor compressor = Natives.getCompressorFactory().create( FlameCord.getInstance().getFlameCordConfiguration().getCompressionLevel() ); + -+ if (ch.pipeline().get(PacketCompressor.class) == null && compressionThreshold != -1) { -+ addBefore(PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor(compressor)); -+ ch.pipeline().remove(PipelineUtils.FRAME_PREPENDER); //NullCordX + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); + if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + { +- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); ++ addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor( compressor ) ); ++ pipeline.remove( PipelineUtils.FRAME_PREPENDER ); // FlameCord - Implement Libdeflate } - if ( compressionThreshold != -1 ) - { -- pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); ++ if ( compressionThreshold != -1 ) { + pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); - } else - { -- pipeline.remove( "compress" ); -+ if (compressionThreshold != -1) { -+ ch.pipeline().get(PacketCompressor.class).setThreshold(compressionThreshold); + } else { -+ ch.pipeline().remove("compress"); -+ addBefore(PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, PipelineUtils.framePrepender); //NullCordX + pipeline.remove( "compress" ); ++ addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, PipelineUtils.framePrepender ); // FlameCord - Implement Libdeflate } - if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) - { - addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); -+ if (ch.pipeline().get(PacketDecompressor.class) == null && compressionThreshold != -1) { -+ PacketDecompressor packetDecompressor = new PacketDecompressor(compressor, compressionThreshold); //BotFilter -+ addBefore(PipelineUtils.PACKET_DECODER, "decompress", packetDecompressor); ++ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) { ++ addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor( compressor, compressionThreshold ) ); // FlameCord - Implement Libdeflate } - if ( compressionThreshold == -1 ) - { -- pipeline.remove( "decompress" ); -+ if (compressionThreshold == -1) { -+ ch.pipeline().remove("decompress"); ++ if ( compressionThreshold == -1 ) { + pipeline.remove( "decompress" ); } } @@ -2622,6 +2617,20 @@ index b98ee6a7..39149f21 100644 // FlameCord start - Antibot System // Make the channel accessible public Channel getChannel() { +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 f04fdd9c..9aebc9e1 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 +@@ -126,7 +126,8 @@ public class PipelineUtils + }; + public static final Base BASE = new Base(); + private static final KickStringWriter legacyKicker = new KickStringWriter(); +- private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); ++ // FlameCord - Implement Libdeflate ++ public static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); + public static final String TIMEOUT_HANDLER = "timeout"; + public static final String PACKET_DECODER = "packet-decoder"; + public static final String PACKET_ENCODER = "packet-encoder"; -- -2.38.1.windows.1 +2.37.3.windows.1 From 039590e92f98255f9ce793c079c81029495b540d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:06:54 -0300 Subject: [PATCH 402/499] 1.3.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 0cc241a4..633c685b 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 024d33c01dd5a314a1ced1554e6cf13afc8044cc Mon Sep 17 00:00:00 2001 +From 3a1123579da3cf8ba3507ed1e08b31e5f532ee19 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..0380b689 100644 +index 8617cdc7..3c6856d3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..0380b689 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.1"; ++ return "1.3.2"; } public final void reloadMessages() From be5d445956a637276376fbbaf12079c9efcff462 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 31 Jan 2023 12:08:32 -0300 Subject: [PATCH 403/499] Fix GeyserMC Compatibility --- .../0040-Implement-libdeflate.patch | 104 ++++++------------ 1 file changed, 36 insertions(+), 68 deletions(-) diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index a58d83d3..f2acd4ff 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From aa08f9e4f6efc5834310e4070287147461f25a0b Mon Sep 17 00:00:00 2001 +From 399efc5e03c0f56de56a570ab879b3acbb724c3c Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 05f7da1d..1ef7f6a7 100644 +index 05f7da1d4..1ef7f6a72 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -60,6 +60,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -27,7 +27,7 @@ index 05f7da1d..1ef7f6a7 100644 this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); diff --git a/native/compile-linux.sh b/native/compile-linux.sh new file mode 100644 -index 00000000..5442dce9 +index 000000000..5442dce9d --- /dev/null +++ b/native/compile-linux.sh @@ -0,0 +1,25 @@ @@ -59,7 +59,7 @@ index 00000000..5442dce9 \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c new file mode 100644 -index 00000000..aa7d1aba +index 000000000..aa7d1aba3 --- /dev/null +++ b/native/src/main/c/jni_cipher_macos.c @@ -0,0 +1,66 @@ @@ -132,7 +132,7 @@ index 00000000..aa7d1aba \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c new file mode 100644 -index 00000000..83515be5 +index 000000000..83515be52 --- /dev/null +++ b/native/src/main/c/jni_cipher_openssl.c @@ -0,0 +1,62 @@ @@ -201,7 +201,7 @@ index 00000000..83515be5 \ No newline at end of file diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c new file mode 100644 -index 00000000..1e2b6bd8 +index 000000000..1e2b6bd8c --- /dev/null +++ b/native/src/main/c/jni_util.c @@ -0,0 +1,12 @@ @@ -220,7 +220,7 @@ index 00000000..1e2b6bd8 \ No newline at end of file diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h new file mode 100644 -index 00000000..8938b26c +index 000000000..8938b26c8 --- /dev/null +++ b/native/src/main/c/jni_util.h @@ -0,0 +1,4 @@ @@ -231,7 +231,7 @@ index 00000000..8938b26c \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c new file mode 100644 -index 00000000..809a7f85 +index 000000000..809a7f857 --- /dev/null +++ b/native/src/main/c/jni_zlib_deflate.c @@ -0,0 +1,43 @@ @@ -281,7 +281,7 @@ index 00000000..809a7f85 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c new file mode 100644 -index 00000000..d9131908 +index 000000000..d91319089 --- /dev/null +++ b/native/src/main/c/jni_zlib_inflate.c @@ -0,0 +1,61 @@ @@ -349,7 +349,7 @@ index 00000000..d9131908 \ No newline at end of file diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java new file mode 100644 -index 00000000..4ba41fc1 +index 000000000..4ba41fc11 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java @@ -0,0 +1,15 @@ @@ -370,7 +370,7 @@ index 00000000..4ba41fc1 +} diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java new file mode 100644 -index 00000000..81d92e75 +index 000000000..81d92e75b --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java @@ -0,0 +1,17 @@ @@ -393,7 +393,7 @@ index 00000000..81d92e75 +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java new file mode 100644 -index 00000000..a16a2584 +index 000000000..a16a25844 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java @@ -0,0 +1,28 @@ @@ -428,7 +428,7 @@ index 00000000..a16a2584 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java new file mode 100644 -index 00000000..50f042bd +index 000000000..50f042bdf --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java @@ -0,0 +1,36 @@ @@ -471,7 +471,7 @@ index 00000000..50f042bd \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java new file mode 100644 -index 00000000..a6709a86 +index 000000000..a6709a869 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java @@ -0,0 +1,138 @@ @@ -616,7 +616,7 @@ index 00000000..a6709a86 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java new file mode 100644 -index 00000000..f28ae314 +index 000000000..f28ae3145 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java @@ -0,0 +1,16 @@ @@ -639,7 +639,7 @@ index 00000000..f28ae314 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java new file mode 100644 -index 00000000..3aed690a +index 000000000..3aed690ad --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java @@ -0,0 +1,13 @@ @@ -659,7 +659,7 @@ index 00000000..3aed690a \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java new file mode 100644 -index 00000000..7d99eb02 +index 000000000..7d99eb02b --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java @@ -0,0 +1,90 @@ @@ -755,7 +755,7 @@ index 00000000..7d99eb02 +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java new file mode 100644 -index 00000000..fd9f9007 +index 000000000..fd9f9007d --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java @@ -0,0 +1,83 @@ @@ -2213,7 +2213,7 @@ zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh 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 -index f33ce913..01b208ed 100644 +index f33ce913a..01b208ed2 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -30,6 +30,22 @@ public abstract class DefinedPacket @@ -2253,7 +2253,7 @@ index f33ce913..01b208ed 100644 { int low = buf.readUnsignedShort(); diff --git a/proxy/pom.xml b/proxy/pom.xml -index 10fe411d..f6daaea4 100644 +index 10fe411d8..f6daaea4d 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -165,6 +165,12 @@ @@ -2270,7 +2270,7 @@ index 10fe411d..f6daaea4 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4c6d9eb9..b1d2a71f 100644 +index 15c48f83e..b2122e801 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2307,10 +2307,10 @@ index 4c6d9eb9..b1d2a71f 100644 /** diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf462..24184796 100644 +index d07cf4627..11c454c40 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -@@ -1,45 +1,84 @@ +@@ -1,35 +1,36 @@ package net.md_5.bungee.compress; +import dev._2lstudios.flamecord.natives.MoreByteBufUtils; @@ -2357,45 +2357,15 @@ index d07cf462..24184796 100644 - { + protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { int origSize = msg.readableBytes(); -- if ( origSize < threshold ) -- { -- DefinedPacket.writeVarInt( 0, out ); -- out.writeBytes( msg ); -- } else -- { -- DefinedPacket.writeVarInt( origSize, out ); -- + if ( origSize < threshold ) + { +@@ -39,7 +40,25 @@ public class PacketCompressor extends MessageToByteEncoder + { + DefinedPacket.writeVarInt( origSize, out ); + - zlib.process( msg, out ); -+ if (origSize < threshold) { -+ // Under the threshold, there is nothing to do. -+ DefinedPacket.writeVarInt(origSize + 1, out); -+ DefinedPacket.writeVarInt(0, out); -+ out.writeBytes(msg); -+ return; ++ compressor.deflate( msg, out ); + } -+ -+ int uncompressed = msg.readableBytes(); -+ -+ DefinedPacket.write21BitVarInt(out, 0); // Dummy packet length -+ DefinedPacket.writeVarInt(uncompressed, out); -+ ByteBuf compatibleIn = MoreByteBufUtils.ensureCompatible(ctx.alloc(), compressor, msg); -+ -+ int startCompressed = out.writerIndex(); -+ try { -+ compressor.deflate(compatibleIn, out); -+ } finally { -+ compatibleIn.release(); -+ } -+ int compressedLength = out.writerIndex() - startCompressed; -+ if (compressedLength >= 1 << 21) { -+ throw new DataFormatException("The server sent a very large (over 2MiB compressed) packet."); - } -+ -+ int writerIndex = out.writerIndex(); -+ int packetLength = out.readableBytes() - 3; -+ out.writerIndex(0); -+ DefinedPacket.write21BitVarInt(out, packetLength); // Rewrite packet length -+ out.writerIndex(writerIndex); + } + + @Override @@ -2409,7 +2379,7 @@ index d07cf462..24184796 100644 + int finalBufferSize = uncompressed + 1; + finalBufferSize += DefinedPacket.varIntBytes(finalBufferSize); + return allocator.directBuffer(finalBufferSize); -+ } + } + + // (maximum data length after compression) + packet length varint + uncompressed data varint + int initialBufferSize = (uncompressed - 1) + 3 + DefinedPacket.varIntBytes(uncompressed); @@ -2417,7 +2387,7 @@ index d07cf462..24184796 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -index eaedf4bc..066bdafc 100644 +index eaedf4bc4..066bdafc8 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java @@ -1,5 +1,6 @@ @@ -2543,7 +2513,7 @@ index eaedf4bc..066bdafc 100644 +} \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab..79b4eec5 100644 +index 8d4439ab8..79b4eec5f 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -44,8 +44,8 @@ public class ForgeUtils @@ -2558,7 +2528,7 @@ index 8d4439ab..79b4eec5 100644 modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a7..27dc4a73 100644 +index b98ee6a75..df95173a9 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2572,7 +2542,7 @@ index b98ee6a7..27dc4a73 100644 import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; -@@ -145,32 +149,32 @@ public class ChannelWrapper +@@ -145,32 +149,30 @@ public class ChannelWrapper return ch; } @@ -2587,7 +2557,6 @@ index b98ee6a7..27dc4a73 100644 { - addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); + addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor( compressor ) ); -+ pipeline.remove( PipelineUtils.FRAME_PREPENDER ); // FlameCord - Implement Libdeflate } - if ( compressionThreshold != -1 ) - { @@ -2597,7 +2566,6 @@ index b98ee6a7..27dc4a73 100644 - { + } else { pipeline.remove( "compress" ); -+ addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.PACKET_ENCODER, PipelineUtils.framePrepender ); // FlameCord - Implement Libdeflate } - if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) @@ -2618,7 +2586,7 @@ index b98ee6a7..27dc4a73 100644 // Make the channel accessible public Channel getChannel() { 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 f04fdd9c..9aebc9e1 100644 +index f04fdd9ce..9aebc9e1a 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 @@ -126,7 +126,8 @@ public class PipelineUtils From 80d3662e443db68595fcabb3ff7d7501ec6d7ee6 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:23:30 -0300 Subject: [PATCH 404/499] 1.3.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 633c685b..07ea39ff 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 8617cdc7..3c6856d3 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.2"; ++ return "1.3.3"; } public final void reloadMessages() From 34f516ab9760ce73a2bdf402bcac8dfd5d9175fe Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:53:00 -0300 Subject: [PATCH 405/499] Simplify Prepender --- .../0041-Simplify-Prepender.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch diff --git a/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch b/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch new file mode 100644 index 00000000..28c6d78d --- /dev/null +++ b/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch @@ -0,0 +1,48 @@ +From ac36572ecaec29b5916d7c1a24e9e648cb2e4ef9 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 5 Feb 2023 21:47:39 -0300 +Subject: [PATCH] Simplify Prepender + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java +index d4c3df44a..c6ea401d5 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java +@@ -12,32 +12,8 @@ public class Varint21LengthFieldPrepender extends MessageToByteEncoder + @Override + protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception + { +- int bodyLen = msg.readableBytes(); +- int headerLen = varintSize( bodyLen ); +- out.ensureWritable( headerLen + bodyLen ); +- +- DefinedPacket.writeVarInt( bodyLen, out ); ++ // FlameCord - Simplify Prepender ++ DefinedPacket.writeVarInt( msg.readableBytes(), out ); + out.writeBytes( msg ); + } +- +- private static int varintSize(int paramInt) +- { +- if ( ( paramInt & 0xFFFFFF80 ) == 0 ) +- { +- return 1; +- } +- if ( ( paramInt & 0xFFFFC000 ) == 0 ) +- { +- return 2; +- } +- if ( ( paramInt & 0xFFE00000 ) == 0 ) +- { +- return 3; +- } +- if ( ( paramInt & 0xF0000000 ) == 0 ) +- { +- return 4; +- } +- return 5; +- } + } +-- +2.37.3.windows.1 + From 1163dfbb5babf92c2a529720035fdc98388d9869 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:53:07 -0300 Subject: [PATCH 406/499] 1.3.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 07ea39ff..90d587f1 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 3a1123579da3cf8ba3507ed1e08b31e5f532ee19 Mon Sep 17 00:00:00 2001 +From 78b8463eb66bd547505a1f5763e4f5b30522b1b9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36..966d2442 100644 +index da0efa36f..966d2442b 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..3c6856d3 100644 +index 8617cdc7a..8c8dd3bc3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,12 +27,12 @@ index 8617cdc7..3c6856d3 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.3"; ++ return "1.3.4"; } public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03..aeda7963 100644 +index 820f7b03c..aeda79639 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03..aeda7963 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b2b19996 100644 +index 0c1ecfb8e..b2b199969 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler From d8797d51dbdae30861b629df9f859e88b408a41d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:59:43 -0300 Subject: [PATCH 407/499] Syntax Fixes --- .../0040-Implement-libdeflate.patch | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index f2acd4ff..fd785d51 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,4 +1,4 @@ -From 399efc5e03c0f56de56a570ab879b3acbb724c3c Mon Sep 17 00:00:00 2001 +From eff4044e14b781c1350fdd1a14727a4e7f191cf2 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate @@ -2270,7 +2270,7 @@ index 10fe411d8..f6daaea4d 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 15c48f83e..b2122e801 100644 +index d67519484..f7a3952a2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2513,7 +2513,7 @@ index eaedf4bc4..066bdafc8 100644 +} \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab8..79b4eec5f 100644 +index 8d4439ab8..95ed34416 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -44,8 +44,8 @@ public class ForgeUtils @@ -2522,13 +2522,13 @@ index 8d4439ab8..79b4eec5f 100644 ByteBuf buffer = payload.slice(); - int modCount = DefinedPacket.readVarInt( buffer, 2 ); - for ( int i = 0; i < modCount; i++ ) -+ int modCount = DefinedPacket.readVarInt( buffer); //FlameCord - Remove length check for compression ++ int modCount = DefinedPacket.readVarInt( buffer ); // FlameCord - Remove length check for compression + for ( int i = 0; i < modCount; i++ ) { modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a75..df95173a9 100644 +index b98ee6a75..ffe038168 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2542,7 +2542,7 @@ index b98ee6a75..df95173a9 100644 import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; -@@ -145,32 +149,30 @@ public class ChannelWrapper +@@ -145,15 +149,16 @@ public class ChannelWrapper return ch; } @@ -2559,25 +2559,20 @@ index b98ee6a75..df95173a9 100644 + addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor( compressor ) ); } - if ( compressionThreshold != -1 ) -- { -+ if ( compressionThreshold != -1 ) { ++ if ( compressionThreshold != -1 ) + { pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); -- } else -- { -+ } else { - pipeline.remove( "compress" ); - } + } else +@@ -163,7 +168,7 @@ public class ChannelWrapper -- if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) -- { + if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + { - addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); -+ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) { + addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor( compressor, compressionThreshold ) ); // FlameCord - Implement Libdeflate } -- if ( compressionThreshold == -1 ) -- { -+ if ( compressionThreshold == -1 ) { - pipeline.remove( "decompress" ); + if ( compressionThreshold == -1 ) + { +@@ -171,6 +176,7 @@ public class ChannelWrapper } } From b95e9e3915afc6fd937e0be7f4eb68d073c650d5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:09:47 -0300 Subject: [PATCH 408/499] Make uncompilable due to abuse --- .gitignore | 4 +++- pom.xml | 25 ------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index e9b9b106..a9f790e6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ FlameCord-Proxy out/ .project -.settings \ No newline at end of file +.settings + +pom.xml \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index a1167dd0..00000000 --- a/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - 4.0.0 - - io.github.waterfallmc - waterfall-super - dev-SNAPSHOT - pom - - Waterfall-Super - Super project for FlameCord. - https://github.com/2lstudios-mc/FlameCord - - - FlameCord-Proxy - - - - clean install - - - - UTF-8 - - From 5699916e491b46db280652984012477e6758c070 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 20 Feb 2023 22:57:07 -0300 Subject: [PATCH 409/499] Fix Optimized Compression System (LibDeflate) --- .../0040-Implement-libdeflate.patch | 56 +++++++++++++------ .../0041-Simplify-Prepender.patch | 48 ---------------- 2 files changed, 39 insertions(+), 65 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index fd785d51..f6cd4f70 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,4 +1,4 @@ -From eff4044e14b781c1350fdd1a14727a4e7f191cf2 Mon Sep 17 00:00:00 2001 +From 80d41a1e52de99ccfac9d98bd64c0176caac13e1 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate @@ -2307,23 +2307,23 @@ index d67519484..f7a3952a2 100644 /** diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf4627..11c454c40 100644 +index d07cf4627..10cb0430c 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -@@ -1,35 +1,36 @@ +@@ -1,45 +1,74 @@ package net.md_5.bungee.compress; ++import java.util.zip.DataFormatException; ++ +import dev._2lstudios.flamecord.natives.MoreByteBufUtils; +import dev._2lstudios.flamecord.natives.compress.Compressor; import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; -+ -+import java.util.zip.DataFormatException; - import java.util.zip.Deflater; +-import java.util.zip.Deflater; import lombok.Setter; - import net.md_5.bungee.jni.zlib.BungeeZlib; +-import net.md_5.bungee.jni.zlib.BungeeZlib; import net.md_5.bungee.protocol.DefinedPacket; -public class PacketCompressor extends MessageToByteEncoder @@ -2357,16 +2357,38 @@ index d07cf4627..11c454c40 100644 - { + protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { int origSize = msg.readableBytes(); - if ( origSize < threshold ) - { -@@ -39,7 +40,25 @@ public class PacketCompressor extends MessageToByteEncoder - { - DefinedPacket.writeVarInt( origSize, out ); - +- if ( origSize < threshold ) +- { +- DefinedPacket.writeVarInt( 0, out ); +- out.writeBytes( msg ); +- } else +- { +- DefinedPacket.writeVarInt( origSize, out ); +- - zlib.process( msg, out ); -+ compressor.deflate( msg, out ); ++ if (origSize < threshold) { ++ // Under the threshold, there is nothing to do. ++ DefinedPacket.writeVarInt(0, out); ++ out.writeBytes(msg); ++ return; + } -+ } ++ ++ int uncompressed = msg.readableBytes(); ++ ++ DefinedPacket.writeVarInt(uncompressed, out); ++ ByteBuf compatibleIn = MoreByteBufUtils.ensureCompatible(ctx.alloc(), compressor, msg); ++ ++ int startCompressed = out.writerIndex(); ++ try { ++ compressor.deflate(compatibleIn, out); ++ } finally { ++ compatibleIn.release(); ++ } ++ int compressedLength = out.writerIndex() - startCompressed; ++ if (compressedLength >= 1 << 21) { ++ throw new DataFormatException("The server sent a very large (over 2MiB compressed) packet."); + } + } + + @Override + protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception { @@ -2379,12 +2401,12 @@ index d07cf4627..11c454c40 100644 + int finalBufferSize = uncompressed + 1; + finalBufferSize += DefinedPacket.varIntBytes(finalBufferSize); + return allocator.directBuffer(finalBufferSize); - } ++ } + + // (maximum data length after compression) + packet length varint + uncompressed data varint + int initialBufferSize = (uncompressed - 1) + 3 + DefinedPacket.varIntBytes(uncompressed); + return allocator.directBuffer(initialBufferSize); - } ++ } } diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java index eaedf4bc4..066bdafc8 100644 diff --git a/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch b/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch deleted file mode 100644 index 28c6d78d..00000000 --- a/Waterfall-Proxy-Patches/0041-Simplify-Prepender.patch +++ /dev/null @@ -1,48 +0,0 @@ -From ac36572ecaec29b5916d7c1a24e9e648cb2e4ef9 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sun, 5 Feb 2023 21:47:39 -0300 -Subject: [PATCH] Simplify Prepender - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -index d4c3df44a..c6ea401d5 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21LengthFieldPrepender.java -@@ -12,32 +12,8 @@ public class Varint21LengthFieldPrepender extends MessageToByteEncoder - @Override - protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception - { -- int bodyLen = msg.readableBytes(); -- int headerLen = varintSize( bodyLen ); -- out.ensureWritable( headerLen + bodyLen ); -- -- DefinedPacket.writeVarInt( bodyLen, out ); -+ // FlameCord - Simplify Prepender -+ DefinedPacket.writeVarInt( msg.readableBytes(), out ); - out.writeBytes( msg ); - } -- -- private static int varintSize(int paramInt) -- { -- if ( ( paramInt & 0xFFFFFF80 ) == 0 ) -- { -- return 1; -- } -- if ( ( paramInt & 0xFFFFC000 ) == 0 ) -- { -- return 2; -- } -- if ( ( paramInt & 0xFFE00000 ) == 0 ) -- { -- return 3; -- } -- if ( ( paramInt & 0xF0000000 ) == 0 ) -- { -- return 4; -- } -- return 5; -- } - } --- -2.37.3.windows.1 - From 9af7e49bbe6744cb4b5b93d090b66cce6d7d499a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 20 Feb 2023 22:57:56 -0300 Subject: [PATCH 410/499] 1.3.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 90d587f1..80111eca 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 78b8463eb66bd547505a1f5763e4f5b30522b1b9 Mon Sep 17 00:00:00 2001 +From a88ec20b6c42b6356eb3b11c1e96584263dedff4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..8c8dd3bc3 100644 +index 8617cdc7a..ff47cbb12 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..8c8dd3bc3 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.4"; ++ return "1.3.5"; } public final void reloadMessages() From 3da7f18f2bbc7c1343b711e238f191cff1f9e0cc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 21 Feb 2023 11:15:12 -0300 Subject: [PATCH 411/499] Simplify Configuration Load/Save System --- .../0018-FlameCord-General-Patch.patch | 65 ++++++++----- .../0023-FlameCord-logger-options.patch | 31 +++---- .../0026-Custom-motd-system.patch | 81 +++++++--------- .../0027-TCP-Fast-Open.patch | 23 ++--- .../0028-Antibot-System.patch | 92 +++++++++---------- .../0029-Allow-Invalid-Names.patch | 24 ++--- .../0040-Implement-libdeflate.patch | 24 ++--- 7 files changed, 168 insertions(+), 172 deletions(-) diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index c771e9f4..396cf54d 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,4 +1,4 @@ -From 2346ffd53c8afc4ae29f33687baa539157fadd2f Mon Sep 17 00:00:00 2001 +From f4ab4a93d462da9ff8375c432ea7824a189ca59a Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch @@ -44,19 +44,47 @@ index 000000000..f3d5c0290 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java new file mode 100644 -index 000000000..5589ce1b7 +index 000000000..e6c660d15 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,74 @@ +package dev._2lstudios.flamecord.configuration; + ++import java.io.File; ++import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; + +import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++import net.md_5.bungee.config.YamlConfiguration; + +public class FlameConfig { ++ Configuration load(File file) { ++ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ if (file.exists() && file.isFile()) { ++ try { ++ return configurationProvider.load(file); ++ } catch (IOException ex) { ++ // Failed to load, do nothing ++ } ++ } ++ ++ return new Configuration(); ++ } ++ ++ void save(Configuration config, File file) { ++ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ try { ++ configurationProvider.save(config, file); ++ } catch (IOException ex) { ++ // Failed to save, do nothing ++ } ++ } ++ + double setIfUnexistant(final String arg1, final double arg2, final Configuration configuration) { + return (double) setIfUnexistant(arg1, (Object) arg2, configuration); + } @@ -65,6 +93,10 @@ index 000000000..5589ce1b7 + return (int) setIfUnexistant(arg1, (Object) arg2, configuration); + } + ++ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ + boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { + return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); + } @@ -92,14 +124,13 @@ index 000000000..5589ce1b7 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..114bbf877 +index 000000000..241e8ed9c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,20 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; -+import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; @@ -111,22 +142,10 @@ index 000000000..114bbf877 + +public class FlameCordConfiguration extends FlameConfig { + public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { -+ try { -+ final String fileName = "./flamecord.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); ++ final File configurationFile = new File("./flamecord.yml"); ++ final Configuration configuration = load(configurationFile); + -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ configurationProvider.save(configuration, configurationFile); -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } ++ save(configuration, configurationFile); + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -205,7 +224,7 @@ index 000000000..021b38d43 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 031b21084..39986d522 100644 +index 27d41dd00..0d8f02d25 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -292,7 +311,7 @@ index 94702434d..e48f77131 100644 b.connect().addListener( listener ); } 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 1c10b5a93..3e5a337e0 100644 +index 3b1bffe6c..22688a045 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch index dbc9a811..6f49bf56 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -1,14 +1,14 @@ -From 368bddfcbf0018aeca7eaa72769d9b31c1dfc229 Mon Sep 17 00:00:00 2001 +From 1d9ee842e043c343a64b8fe7ef6962ee0fb53041 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 114bbf877..edecc1e55 100644 +index 241e8ed9c..b563cbced 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -12,6 +12,17 @@ import net.md_5.bungee.config.Configuration; +@@ -11,10 +11,27 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -24,21 +24,18 @@ index 114bbf877..edecc1e55 100644 + private boolean loggerDetailedConnection = true; + public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { - try { - final String fileName = "./flamecord.yml"; -@@ -25,6 +36,12 @@ public class FlameCordConfiguration extends FlameConfig { - configuration = configurationProvider.load(configurationFile); - } + final File configurationFile = new File("./flamecord.yml"); + final Configuration configuration = load(configurationFile); -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -+ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -+ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); ++ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + - configurationProvider.save(configuration, configurationFile); - } catch (final IOException e) { - e.printStackTrace(); + save(configuration, configurationFile); + } + } 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 e48f77131..909227970 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -64,7 +61,7 @@ index e48f77131..909227970 100644 } 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 3e5a337e0..abed08d4f 100644 +index 22688a045..66a347542 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 @@ -396,7 +396,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 1737547c..2ecfe04a 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,31 +1,16 @@ -From 40db55725460874e6f2129bdbfa60478bba3fb69 Mon Sep 17 00:00:00 2001 +From 2072d8d33f059abfdb95c16158792887f3f701d3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -index 5589ce1b..1e928197 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -15,6 +15,10 @@ public class FlameConfig { - return (int) setIfUnexistant(arg1, (Object) arg2, configuration); - } - -+ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ - boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { - return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); - } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index edecc1e5..ab33e071 100644 +index b563cbced..b41ee92cc 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -3,15 +3,94 @@ package dev._2lstudios.flamecord.configuration; +@@ -2,15 +2,94 @@ package dev._2lstudios.flamecord.configuration; + import java.io.File; - import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.Arrays; @@ -118,32 +103,32 @@ index edecc1e5..ab33e071 100644 @Getter private boolean loggerInitialhandler = false; @Getter -@@ -36,6 +115,22 @@ public class FlameCordConfiguration extends FlameConfig { - configuration = configurationProvider.load(configurationFile); - } +@@ -32,6 +111,22 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); -+ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.hexMotds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 735); -+ this.motds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 734); -+ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); -+ this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); -+ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); -+ this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); -+ this.protocolAlwaysShow = setIfUnexistant("custom-motd.protocol.always-show", this.protocolAlwaysShow, configuration); -+ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); -+ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); -+ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); -+ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); -+ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); -+ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); -+ - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); - this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); ++ this.hexMotds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 735); ++ this.motds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 734); ++ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); ++ this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); ++ this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); ++ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); ++ this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); ++ this.protocolAlwaysShow = setIfUnexistant("custom-motd.protocol.always-show", this.protocolAlwaysShow, configuration); ++ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); ++ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); ++ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); ++ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); ++ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); ++ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); ++ + save(configuration, configurationFile); + } + } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java new file mode 100644 -index 00000000..9587bccd +index 000000000..9587bccda --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java @@ -0,0 +1,48 @@ @@ -197,7 +182,7 @@ index 00000000..9587bccd +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java new file mode 100644 -index 00000000..6c386e16 +index 000000000..6c386e16f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java @@ -0,0 +1,275 @@ @@ -478,7 +463,7 @@ index 00000000..6c386e16 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java new file mode 100644 -index 00000000..c1f05cd0 +index 000000000..c1f05cd0a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java @@ -0,0 +1,33 @@ @@ -517,7 +502,7 @@ index 00000000..c1f05cd0 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java new file mode 100644 -index 00000000..5457ead6 +index 000000000..5457ead64 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java @@ -0,0 +1,17 @@ @@ -540,7 +525,7 @@ index 00000000..5457ead6 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java new file mode 100644 -index 00000000..792e9f98 +index 000000000..792e9f987 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java @@ -0,0 +1,28 @@ @@ -574,7 +559,7 @@ index 00000000..792e9f98 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java new file mode 100644 -index 00000000..0b039c79 +index 000000000..0b039c797 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java @@ -0,0 +1,29 @@ @@ -608,7 +593,7 @@ index 00000000..0b039c79 + +} 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 66a34754..58be68b0 100644 +index 66a347542..58be68b02 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index b327e797..5e56fbf5 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,14 +1,14 @@ -From 6fbdfc541f535fb0b4d18d09f7fb7bd15f0c91d8 Mon Sep 17 00:00:00 2001 +From 62bf8051431b5035171c900d729a1c175fcda639 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index ab33e071..9a3c78e2 100644 +index b41ee92cc..14665b1f6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,16 +19,17 @@ index ab33e071..9a3c78e2 100644 public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { String motd; -@@ -130,6 +134,7 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); - this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); -+ this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); +@@ -127,6 +131,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ + save(configuration, configurationFile); + } + } 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 a4c3bd71..ffea1599 100644 +index a4c3bd710..ffea15992 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 @@ -194,6 +194,8 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 9f1ff710..92f032e2 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,11 +1,11 @@ -From 808f0c6dff3f8b0944f699680daa9b22b01ac087 Mon Sep 17 00:00:00 2001 +From 802403a3d743e4b95d3b9b4845b9ff2302303b20 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd900..f48f1e60 100644 +index 20edd9001..f48f1e60b 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,17 @@ @@ -27,7 +27,7 @@ index 20edd900..f48f1e60 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..3824cc53 100644 +index 676ba95b9..3824cc533 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -188,7 +188,7 @@ index 676ba95b..3824cc53 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..0295ea89 +index 000000000..0295ea89d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,48 @@ @@ -242,7 +242,7 @@ index 00000000..0295ea89 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 00000000..7c789983 +index 000000000..7c7899830 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,165 @@ @@ -413,7 +413,7 @@ index 00000000..7c789983 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 00000000..bd14f56a +index 000000000..bd14f56a1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,48 @@ @@ -467,7 +467,7 @@ index 00000000..bd14f56a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 00000000..1503ac95 +index 000000000..1503ac954 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java @@ -0,0 +1,40 @@ @@ -513,7 +513,7 @@ index 00000000..1503ac95 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 00000000..fdfd9c8d +index 000000000..fdfd9c8d7 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,148 @@ @@ -667,7 +667,7 @@ index 00000000..fdfd9c8d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 00000000..e2140887 +index 000000000..e21408873 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,39 @@ @@ -712,7 +712,7 @@ index 00000000..e2140887 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 00000000..df26a363 +index 000000000..df26a3634 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,28 @@ @@ -746,7 +746,7 @@ index 00000000..df26a363 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 00000000..1b35fba5 +index 000000000..1b35fba5d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,52 @@ @@ -804,7 +804,7 @@ index 00000000..1b35fba5 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 00000000..a7bd9f15 +index 000000000..a7bd9f153 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java @@ -0,0 +1,69 @@ @@ -879,7 +879,7 @@ index 00000000..a7bd9f15 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 00000000..7189a7f3 +index 000000000..7189a7f37 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java @@ -0,0 +1,115 @@ @@ -1000,7 +1000,7 @@ index 00000000..7189a7f3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 00000000..68555de3 +index 000000000..68555de34 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,69 @@ @@ -1075,7 +1075,7 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..7ca2662c +index 000000000..7ca2662cc --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,48 @@ @@ -1129,7 +1129,7 @@ index 00000000..7ca2662c +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..d38ffc9e +index 000000000..d38ffc9e3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,53 @@ @@ -1188,7 +1188,7 @@ index 00000000..d38ffc9e +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 00000000..44d773ab +index 000000000..44d773abe --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java @@ -0,0 +1,75 @@ @@ -1268,10 +1268,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9a3c78e2..8acfb6eb 100644 +index 14665b1f6..179bb1c3e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,184 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,184 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1456,26 +1456,18 @@ index 9a3c78e2..8acfb6eb 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -134,6 +312,7 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); - this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); -+ - this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); +@@ -132,6 +310,9 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -@@ -142,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { - this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); - this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ ++ // FlameCord - Antibot System ++ loadAntibot(configuration, whitelistedAddresses); -+ // FlameCord - Antibot System -+ loadAntibot(configuration, whitelistedAddresses); -+ - configurationProvider.save(configuration, configurationFile); - } catch (final IOException e) { - e.printStackTrace(); + save(configuration, configurationFile); + } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 21381bb4..37bccaeb 100644 +index 21381bb45..37bccaebd 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -90,6 +90,22 @@ public class MessagesConfiguration extends FlameConfig { @@ -1503,7 +1495,7 @@ index 21381bb4..37bccaeb 100644 for (final String key : configuration.getKeys()) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 00000000..285810ea +index 000000000..285810ea1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ @@ -1514,7 +1506,7 @@ index 00000000..285810ea +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 -index 00000000..c19c4965 +index 000000000..c19c4965d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java @@ -0,0 +1,5 @@ @@ -1525,7 +1517,7 @@ index 00000000..c19c4965 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 00000000..7f26e7a0 +index 000000000..7f26e7a0d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1558,7 +1550,7 @@ index 00000000..7f26e7a0 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f..aa538f74 100644 +index 6316143f7..aa538f748 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1601,7 +1593,7 @@ index 6316143f..aa538f74 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c9e45b91..022f94b2 100644 +index c9e45b915..022f94b2d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -723,4 +723,8 @@ public enum Protocol @@ -1614,7 +1606,7 @@ index c9e45b91..022f94b2 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d37142..403ccba9 100644 +index c0d371426..403ccba98 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1631,7 +1623,7 @@ index c0d37142..403ccba9 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee..173b47f3 100644 +index fb81adee0..173b47f33 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1701,7 +1693,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0c559fb0..5889d419 100644 +index 8994454c7..62712330e 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1717,7 +1709,7 @@ index 0c559fb0..5889d419 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 58be68b0..b88e6452 100644 +index 58be68b02..b88e64526 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1841,7 +1833,7 @@ index 58be68b0..b88e6452 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4..c16e28c8 100644 +index 66332af4e..c16e28c80 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,11 +4,15 @@ import com.google.common.base.Preconditions; @@ -1884,7 +1876,7 @@ index 66332af4..c16e28c8 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e..1e3608fa 100644 +index e2911d5e4..1e3608fa4 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; @@ -1916,7 +1908,7 @@ index e2911d5e..1e3608fa 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b3fa4835..6f1d8336 100644 +index b3fa48355..6f1d8336d 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -154,4 +154,11 @@ public class ChannelWrapper @@ -1932,7 +1924,7 @@ index b3fa4835..6f1d8336 100644 + // FlameCord end - Antibot System } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004f..3fce5ff1 100644 +index 14e3004fc..3fce5ff11 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1961,7 +1953,7 @@ index 14e3004f..3fce5ff1 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea1599..f04fdd9c 100644 +index ffea15992..f04fdd9ce 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 @@ -59,6 +59,20 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 61ffd6ed..bb31b48a 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,14 +1,14 @@ -From 80933081e2983627c9f8488cf034316c1571f512 Mon Sep 17 00:00:00 2001 +From a753d95f4e54be610ccaca37e5bd02a863cee933 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 8acfb6eb..05f7da1d 100644 +index 179bb1c3e..c84cf3cca 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -16,6 +16,10 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -19,18 +19,18 @@ index 8acfb6eb..05f7da1d 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -321,6 +325,9 @@ public class FlameCordConfiguration extends FlameConfig { - this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); - this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); +@@ -314,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { + // FlameCord - Antibot System + loadAntibot(configuration, whitelistedAddresses); -+ // FlameCord - Allow Invalid Names -+ this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); ++ // FlameCord - Allow Invalid Names ++ this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); + - // FlameCord - Antibot System - loadAntibot(configuration, whitelistedAddresses); - + save(configuration, configurationFile); + } + } 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 b88e6452..e8c14c55 100644 +index b88e64526..e8c14c552 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 @@ -528,7 +528,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index f6cd4f70..e631bf46 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,14 +1,14 @@ -From 80d41a1e52de99ccfac9d98bd64c0176caac13e1 Mon Sep 17 00:00:00 2001 +From e1191a593b1aa81cc8519f6c7fa7192713cc98e3 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 05f7da1d4..1ef7f6a72 100644 +index c84cf3cca..034fb37e4 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -60,6 +60,8 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @Getter private int antibotFirewallExpire = 60; @Getter @@ -17,14 +17,16 @@ index 05f7da1d4..1ef7f6a72 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -318,6 +320,7 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); +@@ -321,6 +323,9 @@ public class FlameCordConfiguration extends FlameConfig { + // FlameCord - Allow Invalid Names + this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); - this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); -+ this.compressionLevel = setIfUnexistant("compression-level", this.compressionLevel, configuration); - - this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); - this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ // FlameCord - Implement libdeflate ++ this.compressionLevel = setIfUnexistant("compression-level", this.compressionLevel, configuration); ++ + save(configuration, configurationFile); + } + } diff --git a/native/compile-linux.sh b/native/compile-linux.sh new file mode 100644 index 000000000..5442dce9d @@ -2270,7 +2272,7 @@ index 10fe411d8..f6daaea4d 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d67519484..f7a3952a2 100644 +index f5059666e..dba21bcc7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; From b11d198ca4c2070f2eb2cff47fc00c5af6ca24ee Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 21 Feb 2023 11:23:56 -0300 Subject: [PATCH 412/499] Simplify/Improve Module/Messages configuration system --- .../0019-FlameCord-module-system.patch | 46 ++---- ...0020-FlameCord-message-configuration.patch | 153 ++++++++---------- .../0028-Antibot-System.patch | 46 +++--- .../0036-Bungee-Plugins-Command.patch | 35 ++-- .../0037-Bungee-IP-Command.patch | 28 ++-- .../0038-List-Command-Format.patch | 20 +-- 6 files changed, 147 insertions(+), 181 deletions(-) diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 7dad962b..57217719 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,4 +1,4 @@ -From 3f5bcf44e1f1e2d0ea733170d0b22b91dab2111a Mon Sep 17 00:00:00 2001 +From 681805834a7f83cccb8de7878b8ffacbdb4b6d0d Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system @@ -36,14 +36,13 @@ index f3d5c0290..fb3d8ca2e 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 000000000..6c5bb9617 +index 000000000..a6cb2638f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -@@ -0,0 +1,49 @@ +@@ -0,0 +1,35 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; -+import java.io.IOException; + +import net.md_5.bungee.config.Configuration; +import net.md_5.bungee.config.ConfigurationProvider; @@ -60,37 +59,24 @@ index 000000000..6c5bb9617 + public boolean serverEnabled = true; + + public ModulesConfiguration(final ConfigurationProvider configurationProvider) { -+ try { -+ final String fileName = "./modules.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); ++ final File configurationFile = new File("./modules.yml"); ++ final Configuration configuration = load(configurationFile); + -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } ++ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); ++ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); ++ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); ++ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); ++ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); ++ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); ++ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); ++ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); ++ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, configuration); + -+ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); -+ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); -+ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); -+ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); -+ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); -+ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); -+ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); -+ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); -+ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, -+ configuration); -+ -+ configurationProvider.save(configuration, configurationFile); -+ } catch (final IOException e) { -+ e.printStackTrace(); -+ } ++ save(configuration, configurationFile); + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 39986d522..0eb9ae146 100644 +index 0d8f02d25..d58227fd9 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index a7d205c7..9d030c6c 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,4 +1,4 @@ -From fbf8efb44cceaa714da0ca83a04695ad4ba1c4e3 Mon Sep 17 00:00:00 2001 +From 168e63822c7f19251ff48a96fb341b230d662143 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration @@ -35,14 +35,13 @@ index fb3d8ca2e..676ba95b9 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 000000000..21381bb45 +index 000000000..ae1794385 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,115 @@ +@@ -0,0 +1,102 @@ +package dev._2lstudios.flamecord.configuration; + +import java.io.File; -+import java.io.IOException; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.Map; @@ -59,90 +58,78 @@ index 000000000..21381bb45 + public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { + this.logger = logger; + -+ try { -+ final String fileName = "./messages.yml"; -+ final File configurationFile = new File(fileName); -+ final Configuration configuration; -+ final boolean configurationExists = configurationFile.exists(); ++ final File configurationFile = new File("./messages.yml"); ++ final Configuration configuration = load(configurationFile); + -+ if (!configurationExists) { -+ configuration = new Configuration(); -+ } else { -+ configuration = configurationProvider.load(configurationFile); -+ } -+ -+ // FlameCord -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ // FlameCord ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); -+ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); -+ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("server_command_hover_players", "{0} players", configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); ++ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); ++ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("server_command_hover_players", "{0} players", configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + -+ configurationProvider.save(configuration, configurationFile); ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); + -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); + } -+ } catch (final IOException e) { -+ e.printStackTrace(); + } ++ ++ save(configuration, configurationFile); + } + + public String getTranslation(final String name, final Object... args) { @@ -218,7 +205,7 @@ index 021b38d43..fb81adee0 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0eb9ae146..857b0b622 100644 +index d58227fd9..8994454c7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -620,8 +620,8 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 92f032e2..cf34571b 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 802403a3d743e4b95d3b9b4845b9ff2302303b20 Mon Sep 17 00:00:00 2001 +From 1c5bedd68d8b2f9d2fa1b221be26a852df25b970 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1467,32 +1467,32 @@ index 14665b1f6..179bb1c3e 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 21381bb45..37bccaebd 100644 +index ae1794385..6175d8e2d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -90,6 +90,22 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); - setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); +@@ -80,6 +80,22 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); -+ // FlameCord start - Antibot System -+ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -+ -+ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); -+ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); -+ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); -+ // FlameCord end - Antibot System -+ - configurationProvider.save(configuration, configurationFile); ++ // FlameCord start - Antibot System ++ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); ++ ++ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); ++ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); ++ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); ++ // FlameCord end - Antibot System ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); - for (final String key : configuration.getKeys()) { diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 index 000000000..285810ea1 diff --git a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch index 02340bcf..a40ebcc6 100644 --- a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch @@ -1,35 +1,28 @@ -From 67d06f64115453c920b0a596c59301a6167a93aa Mon Sep 17 00:00:00 2001 +From f37bca815bffe22461c5b2760596ef18d56a1070 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 37bccaeb..af3d9078 100644 +index 6175d8e2d..2ea33a94b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -100,11 +100,17 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); - setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); - setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -- -+ -+ // Firewall - setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); - setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); - setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); - // FlameCord end - Antibot System -+ -+ // FlameCord - Bungee Plugins Command -+ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); -+ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); +@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); + // FlameCord end - Antibot System - configurationProvider.save(configuration, configurationFile); ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); ++ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java new file mode 100644 -index 00000000..2e20e9dc +index 000000000..2e20e9dca --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java @@ -0,0 +1,45 @@ @@ -79,7 +72,7 @@ index 00000000..2e20e9dc + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 44e28adc..705196d5 100644 +index 62712330e..ec5fd4af2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch index 23f01332..0bc48e2d 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch @@ -1,29 +1,29 @@ -From 7c646bd7d69fcef97ee37642bc4ea3269a53eff5 Mon Sep 17 00:00:00 2001 +From 79f33268f3f154170f55362decf8fcc8b99a68f8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index af3d9078..34b4a630 100644 +index 2ea33a94b..e42bb29d5 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -112,6 +112,12 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); - setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); +@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); + setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -+ // FlameCord - Bungee IP Command -+ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); -+ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); -+ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); ++ // FlameCord - Bungee IP Command ++ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); ++ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); ++ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); + - configurationProvider.save(configuration, configurationFile); + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); - for (final String key : configuration.getKeys()) { diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java new file mode 100644 -index 00000000..85313491 +index 000000000..85313491e --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java @@ -0,0 +1,45 @@ @@ -73,7 +73,7 @@ index 00000000..85313491 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 705196d5..64fef85f 100644 +index ec5fd4af2..f5059666e 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch index f1bac330..5abacdb9 100644 --- a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -1,25 +1,25 @@ -From f217a96188ebda80c60e8d83e1bf4795cedc6ad2 Mon Sep 17 00:00:00 2001 +From daefdd3d718eecc9ac09fbece9e7baff22e1c195 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:34 -0300 Subject: [PATCH] List Command Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 34b4a630..febf19b4 100644 +index e42bb29d5..555319a7f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -118,6 +118,9 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); - setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); +@@ -107,6 +107,9 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); + setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); -+ // FlameCord - List Command Format -+ setIfUnexistant("command_list_format", "&aServers:&r", configuration); ++ // FlameCord - List Command Format ++ setIfUnexistant("command_list_format", "&aServers:&r", configuration); + - configurationProvider.save(configuration, configurationFile); + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); - for (final String key : configuration.getKeys()) { diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c2227110..0a589931 100644 +index c22271105..0a5899319 100644 --- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java @@ -25,6 +25,9 @@ public class CommandList extends Command From 8d4c8d3cb3891e67743c2d9a3dd967adc381f2ca Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 21 Feb 2023 11:30:41 -0300 Subject: [PATCH 413/499] Whitelist for Packets check --- .../0028-Antibot-System.patch | 19 +++++++++++++------ .../0029-Allow-Invalid-Names.patch | 6 +++--- .../0040-Implement-libdeflate.patch | 6 +++--- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index cf34571b..ca0779d9 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 1c5bedd68d8b2f9d2fa1b221be26a852df25b970 Mon Sep 17 00:00:00 2001 +From 405f365b733a8d8a322b0426ef103cdc7774cffe Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1075,10 +1075,10 @@ index 000000000..68555de34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..7ca2662cc +index 000000000..51c1866ec --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java -@@ -0,0 +1,48 @@ +@@ -0,0 +1,52 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -1102,6 +1102,10 @@ index 000000000..7ca2662cc + if (config.isAntibotRatelimitEnabled()) { + AddressData addressData = addressDataManager.getAddressData(remoteAddress); + ++ if (config.getAntibotRatelimitWhitelist().contains(addressData.getHostString())) { ++ return false; ++ } ++ + if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { + if (config.isAntibotRatelimitLog()) { @@ -1268,10 +1272,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f6..179bb1c3e 100644 +index 14665b1f6..0f12f4ae6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,184 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,187 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1352,6 +1356,8 @@ index 14665b1f6..179bb1c3e 100644 + private int antibotRatelimitPingsPerSecond = 8; + @Getter + private boolean antibotRatelimitLog = true; ++ @Getter ++ private Collection antibotRatelimitWhitelist = Arrays.asList("127.0.0.1"); + + // Antibot reconnect + @Getter @@ -1434,6 +1440,7 @@ index 14665b1f6..179bb1c3e 100644 + this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); + this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); + this.antibotRatelimitLog = setIfUnexistant("antibot.ratelimit.log", this.antibotRatelimitLog, config); ++ this.antibotRatelimitWhitelist = new HashSet<>( setIfUnexistant("antibot.ratelimit.whitelist", this.antibotRatelimitWhitelist, config )); + + // Antibot reconnect + this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); @@ -1456,7 +1463,7 @@ index 14665b1f6..179bb1c3e 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +310,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index bb31b48a..2f46e925 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From a753d95f4e54be610ccaca37e5bd02a863cee933 Mon Sep 17 00:00:00 2001 +From 1e3a2975964623026cc90326efc27ccafb47ae51 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 179bb1c3e..c84cf3cca 100644 +index 0f12f4ae6..6f463b9c6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 179bb1c3e..c84cf3cca 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -314,6 +318,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -317,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index e631bf46..5619559b 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From e1191a593b1aa81cc8519f6c7fa7192713cc98e3 Mon Sep 17 00:00:00 2001 +From c2ca35b27ef725cf2ce710726aee0ea1efb84723 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c84cf3cca..034fb37e4 100644 +index 6f463b9c6..6ec047ed7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index c84cf3cca..034fb37e4 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -321,6 +323,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -324,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); From fee8907629e069d139139f6140c10be64e77be00 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:02:57 -0300 Subject: [PATCH 414/499] 1.3.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 80111eca..29c2ad9e 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From a88ec20b6c42b6356eb3b11c1e96584263dedff4 Mon Sep 17 00:00:00 2001 +From 84cae2e73501b000c7f15d260d4ec736d7025ea3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..ff47cbb12 100644 +index 8617cdc7a..0ed479c8d 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..ff47cbb12 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.5"; ++ return "1.3.6"; } public final void reloadMessages() From 761f01c9d85ed6729e0a89d32a4a070b1b3c8ca5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Feb 2023 17:23:58 -0300 Subject: [PATCH 415/499] Closed source --- .../0001-FlameCord-POM-Changes.patch | 146 - ...ferences-from-Waterfall-to-FlameCord.patch | 122 - .../0003-FlameCord-rebrand.patch | 63 - .../0004-1.7.x-support.patch | 1620 --------- ...ake-PlayerHandshakeEvent-cancellable.patch | 56 - .../0006-Make-a-getter-for-the-callback.patch | 23 - ...sable-update-checker-Use-bungee-name.patch | 73 - .../0008-Change-replaceAll-to-replace.patch | 23 - ...9-Use-duplicate-for-MinecraftDecoder.patch | 32 - ...ections-Don-t-flush-if-not-necessary.patch | 131 - .../0011-Packet-Checks.patch | 53 - .../0012-Change-default-timeout.patch | 23 - ...0013-Don-t-allow-name-containing-dot.patch | 23 - ...14-Use-pipeline-to-reduce-redundancy.patch | 78 - ...tom-uuids-even-if-onlineMode-is-true.patch | 22 - ...ateException-to-QuietException-and-e.patch | 24 - ...-Don-t-declare-uuid-unless-it-s-null.patch | 25 - .../0018-FlameCord-General-Patch.patch | 377 -- .../0019-FlameCord-module-system.patch | 194 - ...0020-FlameCord-message-configuration.patch | 224 -- .../0021-Fix-ByteBuf-memory-leaks.patch | 68 - .../0022-Check-if-packetID-is-invalid.patch | 27 - .../0023-FlameCord-logger-options.patch | 140 - ...dded-an-api-method-to-unload-Plugins.patch | 86 - .../0025-Apply-packet-limits.patch | 69 - .../0026-Custom-motd-system.patch | 676 ---- .../0027-TCP-Fast-Open.patch | 46 - .../0028-Antibot-System.patch | 1989 ---------- .../0029-Allow-Invalid-Names.patch | 47 - ...0030-Disable-entity-Metadata-Rewrite.patch | 3240 ----------------- ...31-Dont-frame-unreadable-connections.patch | 22 - .../0032-Avoid-throwing-IOOB-on-login.patch | 23 - ...tion-fail-reason-when-detailed-logge.patch | 26 - ...0034-Optimize-Decoder-Encoder-Getter.patch | 60 - ...Dont-Process-Links-For-Kick-Messages.patch | 134 - .../0036-Bungee-Plugins-Command.patch | 97 - .../0037-Bungee-IP-Command.patch | 98 - .../0038-List-Command-Format.patch | 37 - ...0039-InitialHandler-Processing-State.patch | 124 - .../0040-Implement-libdeflate.patch | 2623 ------------- 40 files changed, 12964 deletions(-) delete mode 100644 Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch delete mode 100644 Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch delete mode 100644 Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch delete mode 100644 Waterfall-Proxy-Patches/0004-1.7.x-support.patch delete mode 100644 Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch delete mode 100644 Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch delete mode 100644 Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch delete mode 100644 Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch delete mode 100644 Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch delete mode 100644 Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch delete mode 100644 Waterfall-Proxy-Patches/0011-Packet-Checks.patch delete mode 100644 Waterfall-Proxy-Patches/0012-Change-default-timeout.patch delete mode 100644 Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch delete mode 100644 Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch delete mode 100644 Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch delete mode 100644 Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch delete mode 100644 Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch delete mode 100644 Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch delete mode 100644 Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch delete mode 100644 Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch delete mode 100644 Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch delete mode 100644 Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch delete mode 100644 Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch delete mode 100644 Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch delete mode 100644 Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch delete mode 100644 Waterfall-Proxy-Patches/0026-Custom-motd-system.patch delete mode 100644 Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch delete mode 100644 Waterfall-Proxy-Patches/0028-Antibot-System.patch delete mode 100644 Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch delete mode 100644 Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch delete mode 100644 Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch delete mode 100644 Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch delete mode 100644 Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch delete mode 100644 Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch delete mode 100644 Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch delete mode 100644 Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch delete mode 100644 Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch delete mode 100644 Waterfall-Proxy-Patches/0038-List-Command-Format.patch delete mode 100644 Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch delete mode 100644 Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch deleted file mode 100644 index 2da0b2fa..00000000 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 01758bf18170f703930757151d86c9440e8793da Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 17:59:15 +0800 -Subject: [PATCH] FlameCord POM Changes - - -diff --git a/flamecord/pom.xml b/flamecord/pom.xml -new file mode 100644 -index 00000000..20edd900 ---- /dev/null -+++ b/flamecord/pom.xml -@@ -0,0 +1,44 @@ -+ -+ 4.0.0 -+ -+ -+ io.github.waterfallmc -+ waterfall-parent -+ 1.19-R0.1-SNAPSHOT -+ ../pom.xml -+ -+ -+ dev._2lstudios -+ waterfall-flamecord -+ 1.19-R0.1-SNAPSHOT -+ jar -+ -+ Waterfall-FlameCord -+ FlameCord adds security essentials and new configuration options -+ -+ -+ -+ io.github.waterfallmc -+ waterfall-config -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-chat -+ ${project.version} -+ compile -+ -+ -+ -+ -+ ${project.name} -+ -+ -+ true -+ ${basedir}/src/main/resources -+ -+ -+ -+ -diff --git a/pom.xml b/pom.xml -index 2b544c23..d940b21c 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -63,6 +63,7 @@ - query - - native -+ flamecord - - - -diff --git a/protocol/pom.xml b/protocol/pom.xml -index 93ae5952..d6222d16 100644 ---- a/protocol/pom.xml -+++ b/protocol/pom.xml -@@ -64,5 +64,14 @@ - 1.3.0 - compile - -+ -+ -+ -+ dev._2lstudios -+ waterfall-flamecord -+ ${project.version} -+ compile -+ -+ - - -diff --git a/proxy/pom.xml b/proxy/pom.xml -index 1036a2e7..10fe411d 100644 ---- a/proxy/pom.xml -+++ b/proxy/pom.xml -@@ -157,6 +157,51 @@ - runtime - - -+ -+ -+ -+ dev._2lstudios -+ waterfall-flamecord -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-module-cmd-alert -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-module-cmd-find -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-module-cmd-list -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-module-cmd-send -+ ${project.version} -+ compile -+ -+ -+ io.github.waterfallmc -+ waterfall-module-cmd-server -+ ${project.version} -+ compile -+ -+ -+ net.md-5 -+ bungeecord-module-reconnect-yaml -+ ${project.version} -+ compile -+ -+ - - - --- -2.37.0.windows.1 - diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch deleted file mode 100644 index a5690f86..00000000 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 5b40e2e22fb37fb5aa2b34d3a6b14bd91e7e72fa Mon Sep 17 00:00:00 2001 -From: Techcable -Date: Mon, 6 Jun 2016 13:47:46 -0600 -Subject: [PATCH] Rename references from Waterfall to FlameCord - - -diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 688f1b995..b0b0d33eb 100644 ---- a/bootstrap/pom.xml -+++ b/bootstrap/pom.xml -@@ -37,7 +37,7 @@ - - - -- Waterfall -+ FlameCord - - - org.apache.maven.plugins -diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -index a4516ed96..9838f5c55 100644 ---- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -+++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -@@ -7,7 +7,7 @@ public class Bootstrap - { - if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 ) - { -- System.err.println( "*** ERROR *** Waterfall requires Java 8 or above to function! Please download and install it!" ); -+ System.err.println( "*** ERROR *** FlameCord requires Java 8 or above to function! Please download and install it!" ); - System.out.println( "You can check your Java version with the command: java -version" ); - return; - } -diff --git a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -index d703d6d24..49dce84ba 100644 ---- a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -+++ b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java -@@ -12,7 +12,7 @@ public class LogDispatcher extends Thread - - public LogDispatcher(BungeeLogger logger) - { -- super( "Waterfall Logger Thread" ); -+ super( "FlameCord Logger Thread" ); - this.logger = logger; - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e0fcd8fbe..8617cdc7a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -189,7 +189,7 @@ public class BungeeCord extends ProxyServer - public BungeeCord() throws IOException - { - // Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up. -- Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Waterfall in directory with ! in path." ); -+ Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use FlameCord in directory with ! in path." ); - - reloadMessages(); - -@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer - @Override - public String getName() - { -- return "Waterfall"; -+ return "FlameCord"; - } - - @Override -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 96a9998d1..463bc3d53 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -63,7 +63,7 @@ public class BungeeCordLauncher - - BungeeCord bungee = new BungeeCord(); - ProxyServer.setInstance( bungee ); -- bungee.getLogger().info( "Enabled Waterfall version " + bungee.getVersion() ); -+ bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); - bungee.start(); - - if ( !options.has( "noconsole" ) ) -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index b26035cf9..820f7b03c 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -@@ -16,6 +16,6 @@ public class CommandBungee extends Command - @Override - public void execute(CommandSender sender, String[] args) - { -- sender.sendMessage( ChatColor.BLUE + "This server is running Waterfall version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -index 720d0c3b5..5ab4db189 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java -@@ -23,7 +23,7 @@ public class CommandReload extends Command - BungeeCord.getInstance().startListeners(); - BungeeCord.getInstance().getPluginManager().callEvent( new ProxyReloadEvent( sender ) ); - -- sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "Waterfall has been reloaded." -- + " This is NOT advisable and you will not be supported with any issues that arise! Please restart Waterfall ASAP." ); -+ sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "FlameCord has been reloaded." -+ + " This is NOT advisable and you will not be supported with any issues that arise! Please restart FlameCord ASAP." ); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 0dd69778b..9abae0b61 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -@@ -227,7 +227,7 @@ public class YamlConfig implements ConfigurationAdapter - Map val = entry.getValue(); - String name = entry.getKey(); - String addr = get( "address", "localhost:25565", val ); -- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Waterfall - Forced Host", val ) ); -+ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); - boolean restricted = get( "restricted", false, val ); - SocketAddress address = Util.getAddr( addr ); - ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch deleted file mode 100644 index 29c2ad9e..00000000 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 84cae2e73501b000c7f15d260d4ec736d7025ea3 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 8 Jun 2021 22:24:27 -0300 -Subject: [PATCH] FlameCord rebrand - - -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36f..966d2442b 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { - YamlConfig config = new YamlConfig(new File("waterfall.yml")); - config.load(false); // Load, but no permissions - logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); -- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); -+ // FlameCord - Make the version look better -+ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); - useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); - // Throttling options - tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..0ed479c8d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer - @Override - public String getVersion() - { -- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.6"; - } - - public final void reloadMessages() -diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03c..aeda79639 100644 ---- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -+++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -@@ -16,6 +16,7 @@ public class CommandBungee extends Command - @Override - public void execute(CommandSender sender, String[] args) - { -- sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); -+ // FlameCord - Use custom version message -+ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); - } - } -diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b2b199969 100644 ---- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -+++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -@@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler - // Waterfall start - List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); - -- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", -+ // FlameCord - Rebrand -+ ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "FlameCord_Proxy", - bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), - listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); - QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch deleted file mode 100644 index ceb18cfc..00000000 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ /dev/null @@ -1,1620 +0,0 @@ -From c6b956bee70e03b5983a6c83a083ba9426258667 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 30 Sep 2021 19:54:33 -0300 -Subject: [PATCH] 1.7.x support - - -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 -index 59f2cb73d..f33ce913a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -415,4 +415,36 @@ public abstract class DefinedPacket - return 0; - } - // Waterfall end -+ -+ // FlameCord start - 1.7.x support -+ public static byte[] v17readArray(ByteBuf buf) -+ { -+ // Read in a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) -+ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. -+ int len = readVarShort( buf ); -+ -+ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit -+ Preconditions.checkArgument( len <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot receive array longer than 2097050 (got %s bytes)", len ); -+ -+ byte[] ret = new byte[ len ]; -+ buf.readBytes( ret ); -+ return ret; -+ } -+ -+ public static void v17writeArray(byte[] b, ByteBuf buf, boolean allowExtended) -+ { -+ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit -+ if ( allowExtended ) -+ { -+ Preconditions.checkArgument( b.length <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot send array longer than 2097050 (got %s bytes)", b.length ); -+ } else -+ { -+ Preconditions.checkArgument( b.length <= Short.MAX_VALUE, "Cannot send array longer than Short.MAX_VALUE (got %s bytes)", b.length ); -+ } -+ // Write a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) -+ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. -+ writeVarShort( buf, b.length ); -+ buf.writeBytes( b ); -+ } -+ // FlameCord end - 1.7.x support - } -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 -index 2357f3801..c9e45b915 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -66,7 +66,7 @@ public enum Protocol - TO_SERVER.registerPacket( - Handshake.class, - Handshake::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support - ); - } - }, -@@ -78,7 +78,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - KeepAlive.class, - KeepAlive::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), - map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), - map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -93,7 +93,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Login.class, - Login::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), - map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -106,7 +106,7 @@ public enum Protocol - ); - TO_CLIENT.registerPacket( Chat.class, - Chat::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), - map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), - map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -117,7 +117,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Respawn.class, - Respawn::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x07 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x07 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -144,20 +144,20 @@ public enum Protocol - TO_CLIENT.registerPacket( - EntityEffect.class, - EntityEffect::new, -- map(ProtocolConstants.MINECRAFT_1_8, 0x1D), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support - map(ProtocolConstants.MINECRAFT_1_9, -1) - ); - TO_CLIENT.registerPacket( - EntityRemoveEffect.class, - EntityRemoveEffect::new, -- map(ProtocolConstants.MINECRAFT_1_8, 0x1E), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support - map(ProtocolConstants.MINECRAFT_1_9, -1) - ); - // Waterfall end - TO_CLIENT.registerPacket( - PlayerListItem.class, // PlayerInfo - PlayerListItem::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x38 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x38 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), - map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -173,7 +173,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - TabCompleteResponse.class, - TabCompleteResponse::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3A ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3A ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), - map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), - map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -186,7 +186,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardObjective.class, - ScoreboardObjective::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3B ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3B ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), - map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -200,7 +200,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardScore.class, - ScoreboardScore::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3C ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3C ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -214,7 +214,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - ScoreboardDisplay.class, - ScoreboardDisplay::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3D ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3D ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -228,7 +228,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Team.class, - Team::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3E ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3E ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -242,7 +242,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - PluginMessage.class, - PluginMessage::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x3F ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3F ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), - map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -257,7 +257,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Kick.class, - Kick::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x40 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x40 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), - map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), - map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -272,7 +272,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - Title.class, - Title::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x45 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x45 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), - map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -317,7 +317,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - PlayerListHeaderFooter.class, - PlayerListHeaderFooter::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x47 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x47 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), - map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -335,7 +335,7 @@ public enum Protocol - TO_CLIENT.registerPacket( - EntityStatus.class, - EntityStatus::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x1A ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1A ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), - map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), - map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -401,7 +401,7 @@ public enum Protocol - TO_SERVER.registerPacket( - KeepAlive.class, - KeepAlive::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), - map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -415,7 +415,7 @@ public enum Protocol - ); - TO_SERVER.registerPacket( Chat.class, - Chat::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -437,7 +437,7 @@ public enum Protocol - TO_SERVER.registerPacket( - TabCompleteRequest.class, - TabCompleteRequest::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x14 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x14 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -450,7 +450,7 @@ public enum Protocol - TO_SERVER.registerPacket( - ClientSettings.class, - ClientSettings::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x15 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x15 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -462,7 +462,7 @@ public enum Protocol - TO_SERVER.registerPacket( - PluginMessage.class, - PluginMessage::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x17 ), -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x17 ), // FlameCord - 1.7.x support - map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), - map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), - map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -483,23 +483,23 @@ public enum Protocol - TO_CLIENT.registerPacket( - StatusResponse.class, - StatusResponse::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support - ); - TO_CLIENT.registerPacket( - PingPacket.class, - PingPacket::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support - ); - - TO_SERVER.registerPacket( - StatusRequest.class, - StatusRequest::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support - ); - TO_SERVER.registerPacket( - PingPacket.class, - PingPacket::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support - ); - } - }, -@@ -511,22 +511,22 @@ public enum Protocol - TO_CLIENT.registerPacket( - Kick.class, - Kick::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support - ); - TO_CLIENT.registerPacket( - EncryptionRequest.class, - EncryptionRequest::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support - ); - TO_CLIENT.registerPacket( - LoginSuccess.class, - LoginSuccess::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ) // FlameCord - 1.7.x support - ); - TO_CLIENT.registerPacket( - SetCompression.class, - SetCompression::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x03 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x03 ) // FlameCord - 1.7.x support - ); - TO_CLIENT.registerPacket( - LoginPayloadRequest.class, -@@ -537,12 +537,12 @@ public enum Protocol - TO_SERVER.registerPacket( - LoginRequest.class, - LoginRequest::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support - ); - TO_SERVER.registerPacket( - EncryptionResponse.class, - EncryptionResponse::new, -- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) -+ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support - ); - TO_SERVER.registerPacket( - LoginPayloadResponse.class, -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 -index 85f1b0b46..b5b3b2890 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java -@@ -7,6 +7,10 @@ public class ProtocolConstants - { - - private static final boolean SNAPSHOT_SUPPORT = Boolean.getBoolean( "net.md_5.bungee.protocol.snapshot" ); -+ // FlameCord start - 1.7.x support -+ public static final int MINECRAFT_1_7_2 = 4; -+ public static final int MINECRAFT_1_7_6 = 5; -+ // FlameCord end - 1.7.x support - public static final int MINECRAFT_1_8 = 47; - public static final int MINECRAFT_1_9 = 107; - public static final int MINECRAFT_1_9_1 = 108; -@@ -47,6 +51,7 @@ public class ProtocolConstants - static - { - ImmutableList.Builder supportedVersions = ImmutableList.builder().add( -+ "1.7.x", // FlameCord - 1.7.x support - "1.8.x", - "1.9.x", - "1.10.x", -@@ -61,6 +66,10 @@ public class ProtocolConstants - "1.19.x" - ); - ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( -+ // FlameCord start - 1.7.x support -+ ProtocolConstants.MINECRAFT_1_7_2, -+ ProtocolConstants.MINECRAFT_1_7_6, -+ // FlameCord end - 1.7.x support - ProtocolConstants.MINECRAFT_1_8, - ProtocolConstants.MINECRAFT_1_9, - ProtocolConstants.MINECRAFT_1_9_1, -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index dc9866097..230018aea 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -@@ -41,6 +41,7 @@ public class Chat extends DefinedPacket - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { - message = readString( buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); -+ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support - if ( direction == ProtocolConstants.Direction.TO_CLIENT ) - { - position = buf.readByte(); -@@ -55,6 +56,7 @@ public class Chat extends DefinedPacket - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { - writeString( message, buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); -+ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support - if ( direction == ProtocolConstants.Direction.TO_CLIENT ) - { - buf.writeByte( position ); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index d7d4e6ab4..570a89f0a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -@@ -34,6 +34,12 @@ public class ClientSettings extends DefinedPacket - chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); - chatColours = buf.readBoolean(); - skinParts = buf.readByte(); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ difficulty = buf.readByte(); -+ } -+ // FlameCord end - 1.7.x support - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) - { - mainHand = DefinedPacket.readVarInt( buf ); -@@ -51,6 +57,19 @@ public class ClientSettings extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( locale, buf ); -+ buf.writeByte( viewDistance ); -+ buf.writeByte( chatFlags ); -+ buf.writeBoolean( chatColours ); -+ buf.writeByte( skinParts ); -+ buf.writeByte( difficulty ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( locale, buf ); - buf.writeByte( viewDistance ); - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca8..e78519964 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -@@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ serverId = readString( buf ); -+ publicKey = v17readArray( buf ); -+ verifyToken = v17readArray( buf ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - serverId = readString( buf ); - publicKey = readArray( buf ); - verifyToken = readArray( buf ); -@@ -31,6 +41,16 @@ public class EncryptionRequest extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( serverId, buf ); -+ v17writeArray( publicKey, buf, false ); -+ v17writeArray( verifyToken, buf, false ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( serverId, buf ); - writeArray( publicKey, buf ); - writeArray( verifyToken, buf ); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 545eec72f..eacdbe78a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -@@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket - - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ sharedSecret = v17readArray( buf ); -+ verifyToken = v17readArray( buf ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - sharedSecret = readArray( buf, 128 ); - if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19 || protocolVersion >= ProtocolConstants.MINECRAFT_1_19_3 || buf.readBoolean() ) - { -@@ -35,6 +44,15 @@ public class EncryptionResponse extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ v17writeArray( sharedSecret, buf, false ); -+ v17writeArray( verifyToken, buf, false ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeArray( sharedSecret, buf ); - if ( verifyToken != null ) - { -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9d..0ed78a8c4 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; - import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor -@@ -21,20 +22,41 @@ public class EntityEffect extends DefinedPacket { - private boolean hideParticles; - - @Override -- public void read(ByteBuf buf) { -- this.entityId = readVarInt(buf); -+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support - this.effectId = buf.readUnsignedByte(); - this.amplifier = buf.readUnsignedByte(); -- this.duration = readVarInt(buf); -- this.hideParticles = buf.readBoolean(); -+ this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support -+ // FlameCord start - 1.7.x support -+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) -+ { -+ this.hideParticles = buf.readBoolean(); -+ } -+ // FlameCord end - 1.7.x support - } - - @Override -- public void write(ByteBuf buf) { -- writeVarInt(this.entityId, buf); -+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ // FlameCord start - 1.7.x support -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -+ { -+ writeVarInt(this.entityId, buf); -+ } else -+ { -+ buf.writeInt(effectId); -+ } -+ // FlameCord end - 1.7.x support - buf.writeByte(this.effectId); - buf.writeByte(this.amplifier); -- writeVarInt(this.duration, buf); -+ // FlameCord start - 1.7.x support -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -+ { -+ writeVarInt(this.duration, buf); -+ } else -+ { -+ buf.writeShort(duration); -+ } -+ // FlameCord end - 1.7.x support - buf.writeBoolean(this.hideParticles); - } - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3ab..435b85789 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; - import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor -@@ -18,14 +19,22 @@ public class EntityRemoveEffect extends DefinedPacket { - private int effectId; - - @Override -- public void read(ByteBuf buf) { -- this.entityId = readVarInt(buf); -+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support - this.effectId = buf.readUnsignedByte(); - } - - @Override -- public void write(ByteBuf buf) { -- writeVarInt(this.entityId, buf); -+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ // FlameCord start - 1.7.x support -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -+ { -+ writeVarInt(this.entityId, buf); -+ } else -+ { -+ buf.writeInt(entityId); -+ } -+ // FlameCord end - 1.7.x support - buf.writeByte(effectId); - } - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc416..a8c3e7736 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -@@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ randomId = buf.readInt(); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - randomId = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) ? buf.readLong() : readVarInt( buf ); - } - - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ buf.writeInt((int) randomId); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) - { - buf.writeLong( randomId ); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 07fb3d79a..7d03cd10a 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -@@ -25,6 +25,11 @@ public class LoginSuccess extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { -+ uuid = readUndashedUUID( buf ); -+ } else -+ // FlameCord end - 1.7.x support - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) - { - uuid = readUUID( buf ); -@@ -42,6 +47,11 @@ public class LoginSuccess extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { -+ writeUndashedUUID( uuid.toString(), buf ); -+ } else -+ // FlameCord end - 1.7.x support - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) - { - writeUUID( uuid, buf ); -@@ -61,4 +71,14 @@ public class LoginSuccess extends DefinedPacket - { - handler.handle( this ); - } -+ -+ // FlameCord start - 1.7.x support -+ private static UUID readUndashedUUID(ByteBuf buf) { -+ return UUID.fromString( new StringBuilder( readString( buf ) ).insert( 20, '-' ).insert( 16, '-' ).insert( 12, '-' ).insert( 8, '-' ).toString() ); -+ } -+ -+ private static void writeUndashedUUID(String uuid, ByteBuf buf) { -+ writeString( new StringBuilder( 32 ).append( uuid, 0, 8 ).append( uuid, 9, 13 ).append( uuid, 14, 18 ).append( uuid, 19, 23 ).append( uuid, 24, 36 ).toString(), buf ); -+ } -+ // FlameCord end - 1.7.x support - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 9b9c412da..4c50d2378 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -@@ -23,6 +23,18 @@ public class PlayerListItem extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ items = new Item[ 1 ]; -+ Item item = items[ 0 ] = new Item(); -+ item.displayName = item.username = readString( buf ); -+ action = !buf.readBoolean() ? Action.REMOVE_PLAYER : Action.ADD_PLAYER; -+ item.ping = (int) buf.readShort(); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - action = Action.values()[DefinedPacket.readVarInt( buf )]; - items = new Item[ DefinedPacket.readVarInt( buf ) ]; - for ( int i = 0; i < items.length; i++ ) -@@ -63,6 +75,17 @@ public class PlayerListItem extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ Item item = items[0]; // Only one at a time -+ writeString( item.displayName, buf ); // TODO: Server unique only! -+ buf.writeBoolean( action != Action.REMOVE_PLAYER ); -+ buf.writeShort( item.ping ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - DefinedPacket.writeVarInt( action.ordinal(), buf ); - DefinedPacket.writeVarInt( items.length, buf ); - for ( Item item : items ) -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 91f71c095..57a82d29e 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -@@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ tag = readString( buf ); -+ data = v17readArray( buf ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); - int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000; - Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" ); -@@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( tag, buf ); -+ v17writeArray( data, buf, allowExtendedPacket ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); - buf.writeBytes( data ); - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d54..75b371e9c 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -@@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ name = readString( buf ); -+ value = readString( buf ); -+ action = buf.readByte(); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - name = readString( buf ); - action = buf.readByte(); - if ( action == 0 || action == 2 ) -@@ -46,6 +56,16 @@ public class ScoreboardObjective extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( name, buf ); -+ writeString( value, buf ); -+ buf.writeByte( action ); -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( name, buf ); - buf.writeByte( action ); - if ( action == 0 || action == 2 ) -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86b..a812441d9 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -@@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket - @Override - public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ itemName = readString( buf ); -+ action = buf.readByte(); -+ if ( action != 1 ) -+ { -+ scoreName = readString( buf ); -+ value = buf.readInt(); -+ } -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - itemName = readString( buf ); - action = buf.readByte(); - scoreName = readString( buf ); -@@ -39,6 +53,20 @@ public class ScoreboardScore extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( itemName, buf ); -+ buf.writeByte( action ); -+ if ( action != 1 ) -+ { -+ writeString( scoreName, buf ); -+ buf.writeInt( value ); -+ } -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( itemName, buf ); - buf.writeByte( action ); - writeString( scoreName, buf ); -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 80e4f85af..cab28b999 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -@@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket - } - cursor = readString( buf, ( protocolVersion > ProtocolConstants.MINECRAFT_1_13 ? 32500 : ( protocolVersion == ProtocolConstants.MINECRAFT_1_13 ? 256 : 32767 ) ) ); - -+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support - if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) - { - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) -@@ -66,6 +67,7 @@ public class TabCompleteRequest extends DefinedPacket - } - writeString( cursor, buf ); - -+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support - if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) - { - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..1eb458b61 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -@@ -55,12 +55,22 @@ public class Team extends DefinedPacket - suffix = readString( buf ); - } - friendlyFire = buf.readByte(); -- nameTagVisibility = readString( buf ); -+ // FlameCord start - 1.7.x support -+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) -+ { -+ nameTagVisibility = readString( buf ); -+ } -+ // FlameCord end - 1.7.x support - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) - { - collisionRule = readString( buf ); - } -- color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); -+ // FlameCord start - 1.7.x support -+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) -+ { -+ color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); -+ } -+ // FlameCord end - 1.7.x support - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) - { - prefix = readString( buf ); -@@ -69,7 +79,7 @@ public class Team extends DefinedPacket - } - if ( mode == 0 || mode == 3 || mode == 4 ) - { -- int len = readVarInt( buf ); -+ int len = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt( buf ) : buf.readShort(); // FlameCord - 1.7.x support - players = new String[ len ]; - for ( int i = 0; i < len; i++ ) - { -@@ -81,6 +91,30 @@ public class Team extends DefinedPacket - @Override - public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) - { -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ writeString( name, buf ); -+ buf.writeByte( mode ); -+ if ( mode == 0 || mode == 2 ) -+ { -+ writeString( displayName, buf ); -+ writeString( prefix, buf ); -+ writeString( suffix, buf ); -+ buf.writeByte( friendlyFire ); -+ } -+ if ( mode == 0 || mode == 3 || mode == 4 ) -+ { -+ buf.writeShort( players.length ); -+ for ( String player : players ) -+ { -+ writeString( player, buf ); -+ } -+ } -+ return; -+ } -+ // FlameCord end - 1.7.x support -+ - writeString( name, buf ); - buf.writeByte( mode ); - if ( mode == 0 || mode == 2 ) -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ca1dad0e5..e11e30402 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer - .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) - .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) - .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ // FlameCord start - 1.7.x support -+ public final Gson gsonLegacy = new GsonBuilder() -+ .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) -+ .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) -+ .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) -+ .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer( ProtocolConstants.MINECRAFT_1_7_2 ) ) -+ .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); -+ // FlameCord end - 1.7.x support - @Getter - private ConnectionThrottle connectionThrottle; - private final ModuleManager moduleManager = new ModuleManager(); -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 1d377a655..0ea5f90b4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -@@ -183,6 +183,7 @@ public class BungeeTitle implements Title - @Override - public Title send(ProxiedPlayer player) - { -+ if ( ProtocolConstants.isBeforeOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return this; // FlameCord - 1.7.x support - sendPacket( player, clear ); - sendPacket( player, reset ); - sendPacket( player, times ); -diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a16..6cd8ec3b4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -+++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -@@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; - import java.lang.reflect.Type; - import java.util.UUID; - import net.md_5.bungee.api.ServerPing; -+import net.md_5.bungee.protocol.ProtocolConstants; - - public class PlayerInfoSerializer implements JsonSerializer, JsonDeserializer - { -+ // FlameCord start - 1.7.x support -+ private final int protocol; -+ -+ public PlayerInfoSerializer() -+ { -+ this.protocol = ProtocolConstants.MINECRAFT_1_7_6; -+ } -+ -+ public PlayerInfoSerializer(int protocol) -+ { -+ this.protocol = protocol; -+ } -+ // FlameCord end - 1.7.x support - - @Override - public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException -@@ -20,7 +34,7 @@ public class PlayerInfoSerializer implements JsonSerializer= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -- brand.release(); -+ // FlameCord start - 1.7.x support -+ String brandString = bungee.getName() + " (" + bungee.getVersion() + ")"; -+ -+ if ( ProtocolConstants.isBeforeOrEq( user.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); -+ } else -+ { -+ ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); -+ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); -+ brand.release(); -+ } -+ // FlameCord end - 1.7.x support - } - - user.setDimension( login.getDimension() ); -@@ -296,7 +306,7 @@ public class ServerConnector extends PacketHandler - if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall - for ( Objective objective : serverScoreboard.getObjectives() ) - { -- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); -+ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support - } - for ( Score score : serverScoreboard.getScores() ) - { -@@ -466,7 +476,13 @@ public class ServerConnector extends PacketHandler - if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) - { - this.handshakeHandler.handle( pluginMessage ); -- -+ // FlameCord start - 1.7.x support -+ if ( user.getForgeClientHandler().checkUserOutdated() ) -+ { -+ ch.close(); -+ user.getPendingConnects().remove(target); -+ } -+ // FlameCord end - 1.7.x support - // We send the message as part of the handler, so don't send it here. - throw CancelSendSignal.INSTANCE; - } -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 b44d13e59..2d72e26ea 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer - public void setDisplayName(String name) - { - Preconditions.checkNotNull( name, "displayName" ); -+ // Its "spigot" responsability to choose wether to support 1.7 or not. -+ //Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // FlameCord - 1.7.x support - displayName = name; - } - -@@ -524,7 +526,7 @@ public final class UserConnection implements ProxiedPlayer - // transform score components - message = ChatComponentTransformer.getInstance().transform( this, true, message ); - -- if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) -+ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support - { - // Versions older than 1.11 cannot send the Action bar with the new JSON formattings - // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 -@@ -720,6 +722,7 @@ public final class UserConnection implements ProxiedPlayer - @Override - public void setTabHeader(BaseComponent header, BaseComponent footer) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord - header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; - footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; - -@@ -732,6 +735,7 @@ public final class UserConnection implements ProxiedPlayer - @Override - public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord - header = ChatComponentTransformer.getInstance().transform( this, true, header ); - footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); - -@@ -761,6 +765,7 @@ public final class UserConnection implements ProxiedPlayer - - public void setCompressionThreshold(int compressionThreshold) - { -+ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord - if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) - { - this.compressionThreshold = compressionThreshold; -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 -index 89b98b360..0ac22ad38 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; - import io.netty.channel.unix.DomainSocketAddress; - import java.io.DataInput; - import java.net.InetSocketAddress; -+import java.nio.charset.StandardCharsets; - import java.util.ArrayList; - import java.util.HashMap; // Waterfall - import java.util.List; -@@ -201,7 +202,7 @@ public class DownstreamBridge extends PacketHandler - switch ( objective.getAction() ) - { - case 0: -- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType().toString() ) ); -+ serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // FlameCord - 1.7.x support - break; - case 1: - serverScoreboard.removeObjective( objective.getName() ); -@@ -211,7 +212,7 @@ public class DownstreamBridge extends PacketHandler - if ( oldObjective != null ) - { - oldObjective.setValue( objective.getValue() ); -- oldObjective.setType( objective.getType().toString() ); -+ oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // FlameCord - 1.7.x support - } - break; - default: -@@ -309,16 +310,28 @@ public class DownstreamBridge extends PacketHandler - - if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) - { -- ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- String serverBrand = DefinedPacket.readString( brand ); -- brand.release(); -- -- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); -- -- brand = ByteBufAllocator.DEFAULT.heapBuffer(); -- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -- pluginMessage.setData( brand ); -- brand.release(); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ try -+ { -+ ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); -+ String serverBrand = DefinedPacket.readString(brand); -+ brand.release(); -+ brand = ByteBufAllocator.DEFAULT.heapBuffer(); -+ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall -+ pluginMessage.setData(brand); -+ brand.release(); -+ } catch (Exception ProtocolHacksSuck) -+ { -+ return; -+ } -+ } else -+ { -+ String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); -+ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord - 1.7.x support -+ } -+ // FlameCord end - 1.7.x support - // changes in the packet are ignored so we need to send it manually - con.unsafe().sendPacket( pluginMessage ); - throw CancelSendSignal.INSTANCE; -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 a19bbdd0f..de417ecae 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 -@@ -3,6 +3,9 @@ package net.md_5.bungee.connection; - import com.google.common.base.Charsets; - import com.google.common.base.Preconditions; - import com.google.gson.Gson; -+import com.google.gson.JsonElement; -+import com.google.gson.JsonObject; -+ - import java.math.BigInteger; - import java.net.InetSocketAddress; - import java.net.SocketAddress; -@@ -280,8 +283,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void done(ProxyPingEvent pingResult, Throwable error) - { -- Gson gson = BungeeCord.getInstance().gson; -- unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); -+ // FlameCord start - 1.7.x support -+ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; -+ if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ // Minecraft < 1.9 doesn't send string server descriptions as chat components. Older 1.7+ // clients even crash when encountering a chat component instead of a string. To be on the -+ // safe side, always send legacy descriptions for < 1.9 clients. -+ JsonElement element = gson.toJsonTree(pingResult.getResponse()); -+ Preconditions.checkArgument(element.isJsonObject(), "Response is not a JSON object"); -+ JsonObject object = element.getAsJsonObject(); -+ object.addProperty("description", pingResult.getResponse().getDescription()); -+ -+ unsafe.sendPacket(new StatusResponse(gson.toJson(element))); -+ } else -+ { -+ unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); -+ } -+ // FlameCord end - 1.7.x support - if ( bungee.getConnectionThrottle() != null ) - { - bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd9..a409d440b 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; - import net.md_5.bungee.protocol.MinecraftEncoder; - import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.Protocol; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.Handshake; - import net.md_5.bungee.protocol.packet.StatusRequest; - import net.md_5.bungee.protocol.packet.StatusResponse; -@@ -65,7 +66,7 @@ public class PingHandler extends PacketHandler - @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") - public void handle(StatusResponse statusResponse) throws Exception - { -- Gson gson = BungeeCord.getInstance().gson; -+ Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // FlameCord - 1.7.x support - ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class ); - ( (BungeeServerInfo) target ).cachePing( serverPing ); - callback.done( serverPing, null ); -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 d72208e75..66332af4e 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 -@@ -101,7 +101,12 @@ public class UpstreamBridge extends PacketHandler - player.unsafe().sendPacket( newPacket ); - } else - { -- player.unsafe().sendPacket( oldPacket ); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( oldPacket ); -+ } -+ // FlameCord end - 1.7.x support - } - } - con.getServer().disconnect( "Quitting" ); -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index ad951df05..68916db79 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -34,6 +34,12 @@ public abstract class EntityMap - // Waterfall end - switch ( version ) - { -+ // FlameCord start - 1.7.x support -+ case ProtocolConstants.MINECRAFT_1_7_2: -+ return EntityMap_1_7_2.INSTANCE; -+ case ProtocolConstants.MINECRAFT_1_7_6: -+ return EntityMap_1_7_6.INSTANCE; -+ // FlameCord end - 1.7.x support - case ProtocolConstants.MINECRAFT_1_8: - return EntityMap_1_8.INSTANCE; - case ProtocolConstants.MINECRAFT_1_9: -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -new file mode 100644 -index 000000000..cdc07dc45 ---- /dev/null -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -@@ -0,0 +1,102 @@ -+// FlameCord start - 1.7.x support -+package net.md_5.bungee.entitymap; -+ -+import io.netty.buffer.ByteBuf; -+import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; -+ -+class EntityMap_1_7_2 extends EntityMap -+{ -+ -+ static final EntityMap INSTANCE = new EntityMap_1_7_2(); -+ -+ EntityMap_1_7_2() -+ { -+ addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment -+ addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed -+ addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation -+ addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player -+ addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item -+ addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object -+ addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob -+ addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting -+ addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb -+ addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity -+ addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity -+ addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move -+ addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look -+ addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move -+ addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport -+ addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look -+ addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status -+ addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity -+ addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata -+ addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect -+ addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect -+ addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties -+ addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation -+ addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity -+ -+ addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity -+ addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation -+ addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action -+ } -+ -+ @Override -+ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -+ { -+ super.rewriteClientbound( packet, oldId, newId ); -+ -+ //Special cases -+ int readerIndex = packet.readerIndex(); -+ int packetId = DefinedPacket.readVarInt( packet ); -+ int packetIdLength = packet.readerIndex() - readerIndex; -+ if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) -+ { -+ rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -+ } else if ( packetId == 0x13 /* Destroy Entities */ ) -+ { -+ int count = packet.getByte( packetIdLength ); -+ for ( int i = 0; i < count; i++ ) -+ { -+ rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); -+ } -+ } else if ( packetId == 0x0E /* Spawn Object */ ) -+ { -+ DefinedPacket.readVarInt( packet ); -+ int type = packet.readUnsignedByte(); -+ -+ if ( type == 60 || type == 90 ) -+ { -+ packet.skipBytes( 14 ); -+ int position = packet.readerIndex(); -+ int readId = packet.readInt(); -+ int changedId = -1; -+ if ( readId == oldId ) -+ { -+ packet.setInt( position, newId ); -+ changedId = newId; -+ } else if ( readId == newId ) -+ { -+ packet.setInt( position, oldId ); -+ changedId = oldId; -+ } -+ if ( changedId != -1 ) -+ { -+ if ( changedId == 0 && readId != 0 ) -+ { // Trim off the extra data -+ packet.readerIndex( readerIndex ); -+ packet.writerIndex( packet.readableBytes() - 6 ); -+ } else if ( changedId != 0 && readId == 0 ) -+ { // Add on the extra data -+ packet.readerIndex( readerIndex ); -+ packet.capacity( packet.readableBytes() + 6 ); -+ packet.writerIndex( packet.readableBytes() + 6 ); -+ } -+ } -+ } -+ } -+ packet.readerIndex( readerIndex ); -+ } -+} -+// FlameCord end - 1.7.x support -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -new file mode 100644 -index 000000000..cb9174b35 ---- /dev/null -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -@@ -0,0 +1,62 @@ -+// FlameCord start - 1.7.x support -+package net.md_5.bungee.entitymap; -+ -+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -+import io.netty.buffer.ByteBuf; -+import net.md_5.bungee.BungeeCord; -+import net.md_5.bungee.UserConnection; -+import net.md_5.bungee.connection.LoginResult; -+import net.md_5.bungee.protocol.DefinedPacket; -+ -+class EntityMap_1_7_6 extends EntityMap_1_7_2 -+{ -+ -+ static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); -+ -+ @Override -+ @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -+ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -+ { -+ super.rewriteClientbound( packet, oldId, newId ); -+ -+ int readerIndex = packet.readerIndex(); -+ int packetId = DefinedPacket.readVarInt( packet ); -+ int packetIdLength = packet.readerIndex() - readerIndex; -+ if ( packetId == 0x0C /* Spawn Player */ ) -+ { -+ DefinedPacket.readVarInt( packet ); -+ int idLength = packet.readerIndex() - readerIndex - packetIdLength; -+ String uuid = DefinedPacket.readString( packet ); -+ String username = DefinedPacket.readString( packet ); -+ int props = DefinedPacket.readVarInt( packet ); -+ if ( props == 0 ) -+ { -+ UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); -+ if ( player != null ) -+ { -+ LoginResult profile = player.getPendingConnection().getLoginProfile(); -+ if ( profile != null && profile.getProperties() != null -+ && profile.getProperties().length >= 1 ) -+ { -+ ByteBuf rest = packet.copy(); -+ packet.readerIndex( readerIndex ); -+ packet.writerIndex( readerIndex + packetIdLength + idLength ); -+ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -+ DefinedPacket.writeString( username, packet ); -+ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -+ for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) -+ { -+ DefinedPacket.writeString( property.getName(), packet ); -+ DefinedPacket.writeString( property.getValue(), packet ); -+ DefinedPacket.writeString( property.getSignature(), packet ); -+ } -+ packet.writeBytes( rest ); -+ rest.release(); -+ } -+ } -+ } -+ } -+ packet.readerIndex( readerIndex ); -+ } -+} -+// FlameCord end - 1.7.x support -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff9..caed43849 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -@@ -8,6 +8,7 @@ import lombok.Getter; - import lombok.NonNull; - import lombok.RequiredArgsConstructor; - import lombok.Setter; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.UserConnection; - import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.EntityRemoveEffect; -@@ -23,6 +24,12 @@ public class ForgeClientHandler - @NonNull - private final UserConnection con; - -+ // FlameCord start - 1.7.x support -+ @Getter -+ @Setter(AccessLevel.PACKAGE) -+ private boolean forgeOutdated = false; -+ // FlameCord end - 1.7.x support -+ - /** - * The users' mod list. - */ -@@ -175,4 +182,21 @@ public class ForgeClientHandler - { - return fmlTokenInHandshake || clientModList != null; - } -+ -+ // FlameCord start - 1.7.x support -+ /** -+ * Checks to see if a user is using an outdated FML build, and takes -+ * appropriate action on the User side. This should only be called during a -+ * server connection, by the ServerConnector -+ * -+ * @return true if the user's FML build is outdated, otherwise -+ * false -+ */ -+ public boolean checkUserOutdated() { -+ if (forgeOutdated) { -+ con.disconnect( BungeeCord.getInstance().getTranslation("connect_kick_outdated_forge") ); -+ } -+ return forgeOutdated; -+ } -+ // FlameCord end - 1.7.x support - } -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8a..85bc21b9f 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -@@ -3,6 +3,7 @@ package net.md_5.bungee.forge; - import java.util.Map; - import net.md_5.bungee.ServerConnector; - import net.md_5.bungee.UserConnection; -+import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.PluginMessage; - - /** -@@ -84,6 +85,22 @@ enum ForgeClientHandshakeState implements IForgeClientPacketHandler clientModList = ForgeUtils.readModList( message ); - con.getForgeClientHandler().setClientModList( clientModList ); -+ // FlameCord start - 1.7.x support -+ // If the user is below 1.8, we need to check the version of FML - it's not always an OK version. -+ if ( ProtocolConstants.isBeforeOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) -+ { -+ // Get the version from the mod list. -+ int buildNumber = ForgeUtils.getFmlBuildNumber( clientModList ); -+ -+ // If we get 0, we're probably using a testing build, so let it though. Otherwise, check the build number. -+ if ( buildNumber < ForgeConstants.FML_MIN_BUILD_VERSION && buildNumber != 0 ) -+ { -+ // Mark the user as an old Forge user. This will then cause any Forge ServerConnectors to cancel any -+ // connections to it. -+ con.getForgeClientHandler().setForgeOutdated( true ); -+ } -+ } -+ // FlameCord end - 1.7.x support - } - - return WAITINGSERVERDATA; -diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index f70d357a3..df6a4b12c 100644 ---- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -+++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -@@ -13,6 +13,7 @@ public class ServerUnique extends TabList - { - - private final Collection uuids = new HashSet<>(); -+ private final Collection usernames = new HashSet<>(); // FlameCord - 1.7.x support - - public ServerUnique(ProxiedPlayer player) - { -@@ -26,10 +27,26 @@ public class ServerUnique extends TabList - { - if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) - { -- uuids.add( item.getUuid() ); -+ // FlameCord start - 1.7.x support -+ if ( item.getUuid() != null ) -+ { -+ uuids.add( item.getUuid() ); -+ } else -+ { -+ usernames.add( item.getUsername() ); -+ } -+ // FlameCord end - 1.7.x support - } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) - { -- uuids.remove( item.getUuid() ); -+ // FlameCord start - 1.7.x support -+ if ( item.getUuid() != null ) -+ { -+ uuids.remove( item.getUuid() ); -+ } else -+ { -+ usernames.remove( item.getUsername() ); -+ } -+ // FlameCord end - 1.7.x support - } - } - player.unsafe().sendPacket( playerListItem ); -@@ -79,17 +96,48 @@ public class ServerUnique extends TabList - { - PlayerListItem packet = new PlayerListItem(); - packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); -- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; -+ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // FlameCord - 1.7.x support - int i = 0; -+ -+ // FlameCord start - 1.7.x support -+ for ( String username : usernames ) -+ { -+ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); -+ item.setUsername( username ); -+ item.setDisplayName( username ); -+ item.setPing( 0 ); -+ } -+ // FlameCord end - 1.7.x support -+ - for ( UUID uuid : uuids ) - { - PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); - item.setUuid( uuid ); - } - packet.setItems( items ); -- player.unsafe().sendPacket( packet ); -+ // FlameCord start - 1.7.x support -+ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) -+ { -+ player.unsafe().sendPacket( packet ); -+ } else -+ { -+ // Split up the packet -+ for ( PlayerListItem.Item item : packet.getItems() ) -+ { -+ PlayerListItem p2 = new PlayerListItem(); -+ p2.setAction( packet.getAction() ); -+ -+ p2.setItems( new PlayerListItem.Item[] -+ { -+ item -+ } ); -+ player.unsafe().sendPacket( p2 ); -+ } -+ } -+ // FlameCord end - 1.7.x support - } - uuids.clear(); -+ usernames.clear(); // FlameCord - 1.7.x support - } - - @Override --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch deleted file mode 100644 index 8e8d9017..00000000 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 2a6878cb7a8c16bb76b79012db51d81f112636c9 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 17:57:23 +0800 -Subject: [PATCH] Make PlayerHandshakeEvent cancellable - - -diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9e..e29b0ed35 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -@@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; - - import lombok.Data; - import lombok.EqualsAndHashCode; -+import lombok.Getter; -+import lombok.Setter; - import lombok.ToString; - import net.md_5.bungee.api.connection.PendingConnection; -+import net.md_5.bungee.api.plugin.Cancellable; - import net.md_5.bungee.api.plugin.Event; - import net.md_5.bungee.protocol.packet.Handshake; - -@@ -14,8 +17,11 @@ import net.md_5.bungee.protocol.packet.Handshake; - @Data - @ToString(callSuper = false) - @EqualsAndHashCode(callSuper = false) --public class PlayerHandshakeEvent extends Event --{ -+// FlameCord - Implement cancellable -+public class PlayerHandshakeEvent extends Event implements Cancellable { -+ @Getter -+ @Setter -+ private boolean cancelled = false; - - /** - * Connection attempting to login. -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 de417ecae..c3543a18d 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 -@@ -362,7 +362,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - - this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); - -- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); -+ // FlameCord - Make PlayerHandshakeEvent cancellable -+ if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { -+ ch.close(); -+ return; -+ } - - switch ( handshake.getRequestedProtocol() ) - { --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch deleted file mode 100644 index f3bb0749..00000000 --- a/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch +++ /dev/null @@ -1,23 +0,0 @@ -From c44b23dcab5a544424e6835060638e1bbf053ae2 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 17:58:18 +0800 -Subject: [PATCH] Make a getter for the callback - - -diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -index cf85ca06..8a945a99 100644 ---- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -+++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java -@@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; - @EqualsAndHashCode(callSuper = true) - public class AsyncEvent extends Event - { -- -+ // FlameCord - Make a getter for the callback -+ @Getter - private final Callback done; - private final Map intents = new ConcurrentHashMap<>(); - private final AtomicBoolean fired = new AtomicBoolean(); --- -2.32.0 - diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch deleted file mode 100644 index 79c93927..00000000 --- a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 2edaf016d49ec4c769eebaf7383f3a7e6dccc19c Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:00:49 +0800 -Subject: [PATCH] Disable update checker & Use bungee name - - -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -index 463bc3d53..00243fdb9 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java -@@ -45,25 +45,10 @@ public class BungeeCordLauncher - return; - } - -- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) -- { -- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); -- -- Calendar deadline = Calendar.getInstance(); -- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); -- if ( buildDate.before( deadline.getTime() ) ) -- { -- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); -- System.err.println( "*** Please check for a new build from https://papermc.io/downloads ***" ); -- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); -- //System.err.println( "*** Server will start in 10 seconds ***" ); -- //Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); -- } -- } -- - BungeeCord bungee = new BungeeCord(); - ProxyServer.setInstance( bungee ); -- bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); -+ // FlameCord - Use BungeeCord name -+ bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); - bungee.start(); - - if ( !options.has( "noconsole" ) ) -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -index 9abae0b61..e8232c0bd 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java -@@ -22,6 +22,7 @@ import java.util.Locale; - import java.util.Map; - import java.util.logging.Level; - import lombok.RequiredArgsConstructor; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.Util; - import net.md_5.bungee.api.ChatColor; - import net.md_5.bungee.api.ProxyServer; -@@ -227,7 +228,8 @@ public class YamlConfig implements ConfigurationAdapter - Map val = entry.getValue(); - String name = entry.getKey(); - String addr = get( "address", "localhost:25565", val ); -- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); -+ // FlameCord - Use Bungee name instead -+ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); - boolean restricted = get( "restricted", false, val ); - SocketAddress address = Util.getAddr( addr ); - ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); -@@ -253,7 +255,8 @@ public class YamlConfig implements ConfigurationAdapter - - for ( Map val : base ) - { -- String motd = get( "motd", "&1Another Bungee server", val ); -+ // FlameCord - Use Bungee name instead -+ String motd = get( "motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val ); - motd = ChatColor.translateAlternateColorCodes( '&', motd ); - - int maxPlayers = get( "max_players", 1, val ); --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch deleted file mode 100644 index bc20733d..00000000 --- a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch +++ /dev/null @@ -1,23 +0,0 @@ -From dca52858df4acbd78c9128f6e40e447b86824150 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:01:37 +0800 -Subject: [PATCH] Change replaceAll() to replace() - - -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index d672c8ef..9067b806 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -129,7 +129,8 @@ public class ServerConnector extends PacketHandler - newp[newp.length - 2] = new net.md_5.bungee.protocol.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); - - // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. -- newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); -+ // FlameCord - Change replaceAll() to replace() -+ newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); - - // All done. - properties = newp; --- -2.36.1.windows.1 - diff --git a/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch b/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch deleted file mode 100644 index 251aaab9..00000000 --- a/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 510085f25ef21678828f5b3026662f51a94c1137 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 21 Dec 2022 21:43:05 -0300 -Subject: [PATCH] Use duplicate() for MinecraftDecoder - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index ac83e3253..c31ec1ce7 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -38,7 +38,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - - Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( -+ ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy - - Object packetTypeInfo = null; - try -@@ -73,7 +73,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder - in.skipBytes( in.readableBytes() ); - } - -- out.add( new PacketWrapper( packet, slice ) ); -+ // FlameCord - Duplicate buf instead of Copy -+ out.add( new PacketWrapper( packet, slice.retain() ) ); - slice = null; - } catch (BadPacketException | IndexOutOfBoundsException e) { - // Waterfall start: Additional DoS mitigations --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch deleted file mode 100644 index 1922c3a8..00000000 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 9c6dd2dc6ee18d5429d098b5a5d1963cfd404856 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:06:17 +0800 -Subject: [PATCH] Close connections & Don't flush if not necessary - - -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 c3543a18..8ed26e5c 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 -@@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - - ServerPing legacy = result.getResponse(); -+ -+ // FlameCord - Close and return if legacy == null -+ if (legacy == null) { -+ ch.close(); -+ return; -+ } -+ - String kickMessage; - - if ( v1_5 ) -@@ -283,6 +290,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void done(ProxyPingEvent pingResult, Throwable error) - { -+ // FlameCord - Close if response is null -+ if (pingResult.getResponse() == null) { -+ ch.close(); -+ return; -+ } -+ -+ // FlameCord - Return if connection is closed -+ if (ch.isClosed()) { -+ return; -+ } -+ - // FlameCord start - 1.7.x support - Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; - if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -327,11 +345,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection - @Override - public void handle(PingPacket ping) throws Exception - { -- if (!ACCEPT_INVALID_PACKETS) { -- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); -- } -+ // FlameCord - Never accept invalid packets -+ Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); -+ - unsafe.sendPacket( ping ); -- disconnect( "" ); -+ -+ // FlameCord - Close instead of disconnect -+ ch.close(); - } - - @Override -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6dc5633f..8b0fac0a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -80,10 +80,11 @@ public class ChannelWrapper - - if ( packet != null && ch.isActive() ) - { -- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); -+ // FlameCord - Remove the firing of exceptions on failure -+ ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.CLOSE ); - } else - { -- ch.flush(); -+ // FlameCord - Don't flush just close - ch.close(); - } - } -@@ -113,7 +114,7 @@ public class ChannelWrapper - public void addBefore(String baseName, String name, ChannelHandler handler) - { - Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); -- ch.pipeline().flush(); -+ // FlameCord - Don't flush if not necessary - ch.pipeline().addBefore( baseName, name, handler ); - } - -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 2a21243b..a95193ba 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 -@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; - import io.netty.buffer.PooledByteBufAllocator; - import io.netty.channel.Channel; - import io.netty.channel.ChannelException; -+import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInitializer; - import io.netty.channel.ChannelOption; - import io.netty.channel.EventLoopGroup; -@@ -98,6 +99,14 @@ public class PipelineUtils - - BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); - } -+ -+ // FlameCord - Close on exception caught -+ @Override -+ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -+ cause.printStackTrace(); -+ -+ ctx.close(); -+ } - }; - public static final Base BASE = new Base(); - private static final KickStringWriter legacyKicker = new KickStringWriter(); -@@ -192,5 +201,13 @@ public class PipelineUtils - - ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); - } -+ -+ // FlameCord - Close on exception caught -+ @Override -+ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { -+ cause.printStackTrace(); -+ -+ ctx.close(); -+ } - } - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch deleted file mode 100644 index af75e874..00000000 --- a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch +++ /dev/null @@ -1,53 +0,0 @@ -From cf87130274644325adbf7fabb7b95d95e976ee57 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:10:30 +0800 -Subject: [PATCH] Packet Checks - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index c31ec1ce7..640f0ea26 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder - } - - Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; -+ -+ // FlameCord - Check size before decoding -+ if (prot == protocol.TO_SERVER) { -+ final int readableBytes = in.readableBytes(); -+ final int capacity = in.capacity(); -+ -+ if (readableBytes > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); -+ } else if (capacity > 2097152) { -+ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); -+ } -+ } -+ - ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy - - Object packetTypeInfo = null; -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 29cf4b4fc..4820267b3 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -78,6 +78,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception - { -+ // FlameCord - Return if channel isn't active -+ if (!ctx.channel().isActive()) { -+ if (msg instanceof PacketWrapper) { -+ ((PacketWrapper) msg).trySingleRelease(); -+ } -+ -+ return; -+ } -+ - if ( msg instanceof HAProxyMessage ) - { - HAProxyMessage proxy = (HAProxyMessage) msg; --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch deleted file mode 100644 index 9be72fe2..00000000 --- a/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch +++ /dev/null @@ -1,23 +0,0 @@ -From f790d57423c57a21d642db20b6de9d3515fd3e93 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:14:02 +0800 -Subject: [PATCH] Change default timeout - - -diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -index 8911bee85..b67195ec8 100644 ---- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -+++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java -@@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig - /** - * Time before users are disconnected due to no network activity. - */ -- private int timeout = 30000; -+ // FlameCord - Modify default timeout -+ private int timeout = 17000; - /** - * UUID used for metrics. - */ --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch deleted file mode 100644 index e6063a4c..00000000 --- a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch +++ /dev/null @@ -1,23 +0,0 @@ -From cbec17576f5c5472cf0037f9962ca5c806133200 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:25:51 +0800 -Subject: [PATCH] Don't allow name containing dot - - -diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -index 1a4242a2e..d947fad7d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -+++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java -@@ -21,7 +21,8 @@ public final class AllowedCharacters - } else - { - // Don't allow spaces, Yaml config doesn't support them -- return isChatAllowedCharacter( c ) && c != ' '; -+ // FlameCord - Don't allow dots -+ return isChatAllowedCharacter( c ) && c != ' ' && c != '.'; - } - } - --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch deleted file mode 100644 index d056e727..00000000 --- a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 33c937b0b20e6ad8994c21258841d5330443c2fe Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:30:07 +0800 -Subject: [PATCH] Use pipeline to reduce redundancy - - -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 8b0fac0a..b3fa4835 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -5,6 +5,8 @@ import io.netty.channel.Channel; - import io.netty.channel.ChannelFutureListener; - import io.netty.channel.ChannelHandler; - import io.netty.channel.ChannelHandlerContext; -+import io.netty.channel.ChannelPipeline; -+ - import java.net.SocketAddress; - import java.util.concurrent.TimeUnit; - import lombok.Getter; -@@ -37,14 +39,18 @@ public class ChannelWrapper - - public void setProtocol(Protocol protocol) - { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); -+ pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); - } - - public void setVersion(int protocol) - { -- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -+ pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); - } - - public void write(Object packet) -@@ -125,25 +131,27 @@ public class ChannelWrapper - - public void setCompressionThreshold(int compressionThreshold) - { -- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) -+ // FlameCord - Use pipeline to reduce redundancy -+ final ChannelPipeline pipeline = ch.pipeline(); -+ if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) - { - addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); - } - if ( compressionThreshold != -1 ) - { -- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); -+ pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); - } else - { -- ch.pipeline().remove( "compress" ); -+ pipeline.remove( "compress" ); - } - -- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) -+ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) - { - addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); - } - if ( compressionThreshold == -1 ) - { -- ch.pipeline().remove( "decompress" ); -+ pipeline.remove( "decompress" ); - } - } - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch deleted file mode 100644 index 7bc2ea29..00000000 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 047ea04ae1cf8277e6c2eed87dc0d5fd901efe91 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:35:33 +0800 -Subject: [PATCH] Allow custom uuids even if onlineMode is true - - -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 8ed26e5c..4242b9c8 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 -@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void setUniqueId(UUID uuid) - { - Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); -- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); -+ // FlameCord - Allow custom uuids even if onlineMode is true - this.uniqueId = uuid; - } - --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch deleted file mode 100644 index 6d5cf4c5..00000000 --- a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0f07c38f3d16849626c28ae710616788f30b00fc Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:40:55 +0800 -Subject: [PATCH] Change IllegalStateException to QuietException and explain - that is a plugin - - -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 2d72e26ea..94702434d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -313,7 +313,8 @@ public final class UserConnection implements ProxiedPlayer - - if ( getServer() == null && !ch.isClosing() ) - { -- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); -+ // FlameCord - Change IllegalStateException to QuietException and explain that is a plugin -+ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); - } - return; - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch deleted file mode 100644 index 9bc71fef..00000000 --- a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ac09d06618510ed85aadc83a5a6bb812bf109218 Mon Sep 17 00:00:00 2001 -From: foss-mc <69294560+foss-mc@users.noreply.github.com> -Date: Wed, 16 Dec 2020 18:43:17 +0800 -Subject: [PATCH] Don't declare uuid unless it's null - - -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 8715821fe..1c10b5a93 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 -@@ -559,7 +559,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - loginProfile = obj; - name = obj.getName(); -- uniqueId = Util.getUUID( obj.getId() ); -+ // FlameCord - Don't declare uuid unless it's null -+ if (uniqueId == null) { -+ uniqueId = Util.getUUID(obj.getId()); -+ } - finish(); - return; - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch deleted file mode 100644 index 396cf54d..00000000 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ /dev/null @@ -1,377 +0,0 @@ -From f4ab4a93d462da9ff8375c432ea7824a189ca59a Mon Sep 17 00:00:00 2001 -From: Juan Cruz Linsalata -Date: Mon, 12 Oct 2020 15:40:53 -0300 -Subject: [PATCH] FlameCord General Patch - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -new file mode 100644 -index 000000000..f3d5c0290 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -0,0 +1,31 @@ -+package dev._2lstudios.flamecord; -+ -+import java.util.Collection; -+import java.util.logging.Logger; -+ -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import lombok.Getter; -+import net.md_5.bungee.config.ConfigurationProvider; -+import net.md_5.bungee.config.YamlConfiguration; -+ -+public class FlameCord { -+ @Getter -+ private static FlameCord instance; -+ -+ public static void initialize(final Logger logger, final Collection whitelistedAddresses) { -+ if (FlameCord.instance == null) { -+ FlameCord.instance = new FlameCord(); -+ } -+ -+ instance.reload(logger, whitelistedAddresses); -+ } -+ -+ @Getter -+ private FlameCordConfiguration flameCordConfiguration; -+ -+ public void reload(final Logger logger, final Collection whitelistedAddresses) { -+ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); -+ } -+} -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -new file mode 100644 -index 000000000..e6c660d15 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java -@@ -0,0 +1,74 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Collection; -+import java.util.HashSet; -+ -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+import net.md_5.bungee.config.YamlConfiguration; -+ -+public class FlameConfig { -+ Configuration load(File file) { -+ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ if (file.exists() && file.isFile()) { -+ try { -+ return configurationProvider.load(file); -+ } catch (IOException ex) { -+ // Failed to load, do nothing -+ } -+ } -+ -+ return new Configuration(); -+ } -+ -+ void save(Configuration config, File file) { -+ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -+ -+ try { -+ configurationProvider.save(config, file); -+ } catch (IOException ex) { -+ // Failed to save, do nothing -+ } -+ } -+ -+ double setIfUnexistant(final String arg1, final double arg2, final Configuration configuration) { -+ return (double) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { -+ return (int) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { -+ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { -+ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); -+ } -+ -+ Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, arg2); -+ -+ return arg2; -+ } else { -+ return configuration.get(arg1); -+ } -+ } -+ -+ Collection setIfUnexistant(final String arg1, final Collection arg2, -+ final Configuration configuration) { -+ if (!configuration.contains(arg1)) { -+ configuration.set(arg1, new ArrayList<>(arg2)); -+ -+ return arg2; -+ } else { -+ return new HashSet<>(configuration.getStringList(arg1)); -+ } -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -new file mode 100644 -index 000000000..241e8ed9c ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -0,0 +1,20 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.Collection; -+import java.util.HashSet; -+ -+import lombok.Getter; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class FlameCordConfiguration extends FlameConfig { -+ public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { -+ final File configurationFile = new File("./flamecord.yml"); -+ final Configuration configuration = load(configurationFile); -+ -+ save(configuration, configurationFile); -+ } -+} -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 640f0ea26..70a1192e7 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.protocol; - -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufUtil; - import io.netty.channel.ChannelHandlerContext; -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -new file mode 100644 -index 000000000..021b38d43 ---- /dev/null -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -0,0 +1,58 @@ -+package dev._2lstudios.flamecord.commands; -+ -+import java.util.Collection; -+import java.util.HashSet; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import net.md_5.bungee.BungeeCord; -+import net.md_5.bungee.api.CommandSender; -+import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.config.ServerInfo; -+import net.md_5.bungee.api.plugin.Command; -+ -+public class FlameCordCommand extends Command { -+private final BungeeCord bungeeCord; -+ -+ public FlameCordCommand(final BungeeCord bungeeCord) { -+ super("flamecord"); -+ -+ this.bungeeCord = bungeeCord; -+ } -+ -+ @Override -+ public void execute(final CommandSender sender, final String[] args) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ -+ if (sender.hasPermission("flamecord.usage")) { -+ if (args.length > 0) { -+ final String arg0 = args[0]; -+ -+ switch (arg0) { -+ case "reload": { -+ // FlameCord - Collect ips from servers -+ final Collection whitelistedAddresses = new HashSet<>(); -+ -+ for (final ServerInfo serverInfo : bungeeCord.getServers().values()) { -+ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); -+ } -+ -+ FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); -+ sender.sendMessage(TextComponent -+ .fromLegacyText("flamecord_reload")); -+ break; -+ } -+ default: { -+ sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); -+ break; -+ } -+ } -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText("flamecord_help")); -+ } -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText("flamecord_nopermission")); -+ } -+ } -+} -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 27d41dd00..0d8f02d25 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -9,6 +9,8 @@ import com.google.common.collect.Sets; - import com.google.common.util.concurrent.ThreadFactoryBuilder; - import com.google.gson.Gson; - import com.google.gson.GsonBuilder; -+ -+import dev._2lstudios.flamecord.FlameCord; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; - import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -295,6 +297,15 @@ public class BungeeCord extends ProxyServer - pluginManager.loadPlugins(); - config.load(); - -+ // FlameCord - Renew and register modules -+ final Collection whitelistedAddresses = new HashSet<>(); -+ -+ for (final ServerInfo serverInfo : getServers().values()) { -+ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); -+ } -+ -+ FlameCord.initialize(logger, whitelistedAddresses); -+ - if ( config.isForgeSupport() ) - { - registerChannel( ForgeConstants.FML_TAG ); -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index da688839c..3a07c7c8a 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -2,6 +2,8 @@ package net.md_5.bungee; - - import com.google.common.base.Joiner; - import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufAllocator; - import java.net.InetSocketAddress; -@@ -165,7 +167,9 @@ public class ServerConnector extends PacketHandler - { - if ( packet.packet == null ) - { -- throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - FlameCord General Patch -+ // More specific invalid packet exceptions -+ throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); - } - } - -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 94702434d..e48f77131 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; - import net.md_5.bungee.api.Title; - import net.md_5.bungee.api.chat.BaseComponent; - import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.config.ListenerInfo; - import net.md_5.bungee.api.config.ServerInfo; - import net.md_5.bungee.api.connection.ProxiedPlayer; - import net.md_5.bungee.api.event.PermissionCheckEvent; -@@ -66,6 +67,7 @@ import net.md_5.bungee.tab.ServerUnique; - import net.md_5.bungee.tab.TabList; - import net.md_5.bungee.util.CaseInsensitiveSet; - import net.md_5.bungee.util.ChatComponentTransformer; -+import net.md_5.bungee.util.QuietException; - - @RequiredArgsConstructor - public final class UserConnection implements ProxiedPlayer -@@ -393,9 +395,11 @@ public final class UserConnection implements ProxiedPlayer - .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) - .remoteAddress( target.getAddress() ); - // Windows is bugged, multi homed users will just have to live with random connecting IPs -- if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) -+ // FlameCord - Use listenerInfo -+ final ListenerInfo listenerInfo = getPendingConnection().getListener(); -+ if ( listenerInfo.isSetLocalAddress() && !PlatformDependent.isWindows() && listenerInfo.getSocketAddress() instanceof InetSocketAddress ) - { -- b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); -+ b.localAddress( listenerInfo.getHost().getHostString(), 0 ); - } - b.connect().addListener( listener ); - } -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 3b1bffe6c..22688a045 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 -@@ -21,6 +21,8 @@ import java.util.logging.Level; - import javax.crypto.SecretKey; - import javax.crypto.spec.SecretKeySpec; - -+import dev._2lstudios.flamecord.FlameCord; -+ - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -@@ -159,7 +161,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - if ( packet.packet == null ) - { -- throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); -+ // FlameCord - FlameCord General Patch -+ // More specific invalid packet exceptions -+ throw new QuietException( "Unexpected packet received during initial handler process!\n" + BufUtil.dump(packet.buf, 16) ); - } - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index a409d440b..3503c089d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -@@ -1,6 +1,7 @@ - package net.md_5.bungee.connection; - - import com.google.gson.Gson; -+ - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 4820267b3..694ecdb01 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -1,6 +1,8 @@ - package net.md_5.bungee.netty; - - import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.channel.ChannelHandlerContext; - import io.netty.channel.ChannelInboundHandlerAdapter; - import io.netty.handler.codec.CorruptedFrameException; -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 a95193ba7..a4c3bd710 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,8 @@ - package net.md_5.bungee.netty; - - import com.google.common.base.Preconditions; -+ -+import dev._2lstudios.flamecord.FlameCord; - import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; - import io.netty.buffer.PooledByteBufAllocator; - import io.netty.channel.Channel; --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch deleted file mode 100644 index 57217719..00000000 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 681805834a7f83cccb8de7878b8ffacbdb4b6d0d Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Sat, 1 May 2021 14:17:48 -0300 -Subject: [PATCH] FlameCord module system - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index f3d5c0290..fb3d8ca2e 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -4,6 +4,7 @@ import java.util.Collection; - import java.util.logging.Logger; - - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; - import lombok.Getter; - import net.md_5.bungee.config.ConfigurationProvider; - import net.md_5.bungee.config.YamlConfiguration; -@@ -23,9 +24,16 @@ public class FlameCord { - @Getter - private FlameCordConfiguration flameCordConfiguration; - -+ // FlameCord - Module System -+ @Getter -+ private ModulesConfiguration modulesConfiguration; -+ - public void reload(final Logger logger, final Collection whitelistedAddresses) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - - this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); -+ -+ // FlameCord - Module System -+ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); - } - } -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -new file mode 100644 -index 000000000..a6cb2638f ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java -@@ -0,0 +1,35 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+ -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class ModulesConfiguration extends FlameConfig { -+ public boolean reconnectEnabled = false; -+ public boolean alertEnabled = true; -+ public boolean findEnabled = true; -+ public boolean ipEnabled = true; -+ public boolean listEnabled = true; -+ public boolean permsEnabled = true; -+ public boolean reloadEnabled = true; -+ public boolean sendEnabled = true; -+ public boolean serverEnabled = true; -+ -+ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { -+ final File configurationFile = new File("./modules.yml"); -+ final Configuration configuration = load(configurationFile); -+ -+ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); -+ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); -+ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); -+ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); -+ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); -+ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); -+ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); -+ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); -+ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, configuration); -+ -+ save(configuration, configurationFile); -+ } -+} -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0d8f02d25..d58227fd9 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -11,6 +11,8 @@ import com.google.gson.Gson; - import com.google.gson.GsonBuilder; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.commands.FlameCordCommand; -+import dev._2lstudios.flamecord.configuration.ModulesConfiguration; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; - import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; -@@ -90,6 +92,13 @@ import net.md_5.bungee.conf.Configuration; - import net.md_5.bungee.conf.YamlConfig; - import net.md_5.bungee.forge.ForgeConstants; - import net.md_5.bungee.module.ModuleManager; -+import net.md_5.bungee.module.cmd.alert.CommandAlert; -+import net.md_5.bungee.module.cmd.alert.CommandAlertRaw; -+import net.md_5.bungee.module.cmd.find.CommandFind; -+import net.md_5.bungee.module.cmd.list.CommandList; -+import net.md_5.bungee.module.cmd.send.CommandSend; -+import net.md_5.bungee.module.cmd.server.CommandServer; -+import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; - import net.md_5.bungee.netty.PipelineUtils; - import net.md_5.bungee.protocol.DefinedPacket; - import net.md_5.bungee.protocol.ProtocolConstants; -@@ -244,11 +253,6 @@ public class BungeeCord extends ProxyServer - // Waterfall end - - pluginManager = new PluginManager( this ); -- getPluginManager().registerCommand( null, new CommandReload() ); -- getPluginManager().registerCommand( null, new CommandEnd() ); -- getPluginManager().registerCommand( null, new CommandIP() ); -- getPluginManager().registerCommand( null, new CommandBungee() ); -- getPluginManager().registerCommand( null, new CommandPerms() ); - - if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) - { -@@ -287,9 +291,10 @@ public class BungeeCord extends ProxyServer - bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); - workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); - -- File moduleDirectory = new File( "modules" ); -+ // FlameCord - Use own module system -+ /* File moduleDirectory = new File( "modules" ); - moduleManager.load( this, moduleDirectory ); -- pluginManager.detectPlugins( moduleDirectory ); -+ pluginManager.detectPlugins( moduleDirectory ); */ - - pluginsFolder.mkdir(); - pluginManager.detectPlugins( pluginsFolder ); -@@ -315,6 +320,7 @@ public class BungeeCord extends ProxyServer - - isRunning = true; - -+ loadModules(); - pluginManager.enablePlugins(); - - if ( config.getThrottle() > 0 ) -@@ -853,4 +859,53 @@ public class BungeeCord extends ProxyServer - { - return new BungeeTitle(); - } -+ -+ // FlameCord - FlameCord Module System -+ public void loadModules() { -+ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); -+ -+ // Bungeecord Commands -+ pluginManager.registerCommand(null, new CommandEnd()); -+ pluginManager.registerCommand(null, new CommandBungee()); -+ -+ if (modulesConfiguration.reloadEnabled) { -+ pluginManager.registerCommand(null, new CommandReload()); -+ } -+ if (modulesConfiguration.ipEnabled) { -+ pluginManager.registerCommand(null, new CommandIP()); -+ } -+ if (modulesConfiguration.permsEnabled) { -+ pluginManager.registerCommand(null, new CommandPerms()); -+ } -+ -+ // Modules Commands -+ if (modulesConfiguration.alertEnabled) { -+ pluginManager.registerCommand(null, new CommandAlert()); -+ pluginManager.registerCommand(null, new CommandAlertRaw()); -+ } -+ if (modulesConfiguration.findEnabled) { -+ pluginManager.registerCommand(null, new CommandFind()); -+ } -+ if (modulesConfiguration.listEnabled) { -+ pluginManager.registerCommand(null, new CommandList()); -+ } -+ if (modulesConfiguration.sendEnabled) { -+ pluginManager.registerCommand(null, new CommandSend()); -+ } -+ if (modulesConfiguration.serverEnabled) { -+ pluginManager.registerCommand(null, new CommandServer()); -+ } -+ -+ if (modulesConfiguration.reconnectEnabled) { -+ for (ListenerInfo info : getConfig().getListeners()) { -+ if (!info.isForceDefault() && getReconnectHandler() == null) { -+ setReconnectHandler(new YamlReconnectHandler()); -+ break; -+ } -+ } -+ } -+ -+ // Flamecord Command -+ pluginManager.registerCommand(null, new FlameCordCommand(this)); -+ } - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch deleted file mode 100644 index 9d030c6c..00000000 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 168e63822c7f19251ff48a96fb341b230d662143 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Sat, 1 May 2021 13:40:39 -0300 -Subject: [PATCH] FlameCord message configuration - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index fb3d8ca2e..676ba95b9 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -4,6 +4,7 @@ import java.util.Collection; - import java.util.logging.Logger; - - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; - import lombok.Getter; - import net.md_5.bungee.config.ConfigurationProvider; -@@ -27,6 +28,8 @@ public class FlameCord { - // FlameCord - Module System - @Getter - private ModulesConfiguration modulesConfiguration; -+ @Getter -+ private MessagesConfiguration messagesConfiguration; - - public void reload(final Logger logger, final Collection whitelistedAddresses) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); -@@ -35,5 +38,6 @@ public class FlameCord { - - // FlameCord - Module System - this.modulesConfiguration = new ModulesConfiguration(configurationProvider); -+ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); - } - } -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -new file mode 100644 -index 000000000..ae1794385 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -0,0 +1,102 @@ -+package dev._2lstudios.flamecord.configuration; -+ -+import java.io.File; -+import java.text.MessageFormat; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.config.Configuration; -+import net.md_5.bungee.config.ConfigurationProvider; -+ -+public class MessagesConfiguration extends FlameConfig { -+ private final Logger logger; -+ private final Map messages = new HashMap<>(); -+ -+ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { -+ this.logger = logger; -+ -+ final File configurationFile = new File("./messages.yml"); -+ final Configuration configuration = load(configurationFile); -+ -+ // FlameCord -+ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); -+ setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", -+ configuration); -+ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); -+ -+ // BungeeCord -+ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); -+ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); -+ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); -+ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); -+ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); -+ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); -+ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); -+ setIfUnexistant("fallback_kick", -+ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); -+ setIfUnexistant("fallback_lobby", -+ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); -+ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); -+ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", -+ configuration); -+ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); -+ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); -+ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", -+ configuration); -+ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); -+ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); -+ setIfUnexistant("proxy_full", "Server is full!", configuration); -+ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); -+ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); -+ setIfUnexistant("server_went_down", -+ "&cThe server you were previously on went down, you have been connected to a fallback server", -+ configuration); -+ setIfUnexistant("total_players", "Total players online: {0}", configuration); -+ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); -+ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); -+ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); -+ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); -+ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); -+ setIfUnexistant("error_occurred_player", -+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); -+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", -+ configuration); -+ setIfUnexistant("server_command_hover_players", "{0} players", configuration); -+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); -+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); -+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); -+ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); -+ setIfUnexistant("send_cmd_usage", -+ "&cNot enough arguments, usage: /send ", configuration); -+ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); -+ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); -+ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); -+ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); -+ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); -+ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); -+ -+ for (final String key : configuration.getKeys()) { -+ final Object value = configuration.get(key); -+ -+ if (value instanceof String) { -+ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); -+ } -+ } -+ -+ save(configuration, configurationFile); -+ } -+ -+ public String getTranslation(final String name, final Object... args) { -+ if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name -+ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); -+ } -+ -+ return MessageFormat.format(messages.getOrDefault(name, ""), args); -+ } -+} -\ No newline at end of file -diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java -index 698b420f4..e4ad7e389 100644 ---- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java -+++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java -@@ -50,7 +50,9 @@ public class CommandServer extends Command implements TabExecutor - int count = server.getPlayers().size(); - serverTextComponent.setHoverEvent( new HoverEvent( - HoverEvent.Action.SHOW_TEXT, -- new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) -+ // FlameCord - FlameCord messages configuration -+ // Make player count customizable -+ new ComponentBuilder( ProxyServer.getInstance().getTranslation( "server_command_hover_players", count ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) - ); - serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); - serverList.append( serverTextComponent ); -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index 021b38d43..fb81adee0 100644 ---- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -4,6 +4,7 @@ import java.util.Collection; - import java.util.HashSet; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.api.CommandSender; - import net.md_5.bungee.api.chat.TextComponent; -@@ -22,6 +23,7 @@ private final BungeeCord bungeeCord; - @Override - public void execute(final CommandSender sender, final String[] args) { - final FlameCord flameCord = FlameCord.getInstance(); -+ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); - - if (sender.hasPermission("flamecord.usage")) { - if (args.length > 0) { -@@ -38,21 +40,22 @@ private final BungeeCord bungeeCord; - - FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); - sender.sendMessage(TextComponent -- .fromLegacyText("flamecord_reload")); -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); - break; - } - default: { -- sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); -+ sender.sendMessage(TextComponent.fromLegacyText( -+ messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); - break; - } - } - } else { - sender.sendMessage(TextComponent -- .fromLegacyText("flamecord_help")); -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); - } - } else { - sender.sendMessage(TextComponent -- .fromLegacyText("flamecord_nopermission")); -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); - } - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d58227fd9..8994454c7 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -620,8 +620,8 @@ public class BungeeCord extends ProxyServer - @Override - public String getTranslation(String name, Object... args) - { -- Format format = messageFormats.get( name ); -- return ( format != null ) ? format.format( args ) : ""; -+ // FlameCord - Use own translation system -+ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); - } - - @Override --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch deleted file mode 100644 index b77c30d6..00000000 --- a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 4121bc5ef2215f0621d449c5cf2073c47ed93947 Mon Sep 17 00:00:00 2001 -From: linsaftw -Date: Sat, 20 Mar 2021 12:36:25 -0300 -Subject: [PATCH] Fix ByteBuf memory leaks - - -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 68916db79..688ff72d2 100644 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -155,11 +155,15 @@ public abstract class EntityMap - if ( readId == oldId || readId == newId ) - { - ByteBuf data = packet.copy(); -- packet.readerIndex( offset ); -- packet.writerIndex( offset ); -- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -- packet.writeBytes( data ); -- data.release(); -+ -+ try { -+ packet.readerIndex( offset ); -+ packet.writerIndex( offset ); -+ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -+ packet.writeBytes( data ); -+ } finally { -+ data.release(); -+ } - } - } - -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206e..8d4439ab8 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -@@ -38,16 +38,22 @@ public class ForgeUtils - { - Map modTags = new HashMap<>(); - ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); -- byte discriminator = payload.readByte(); -- if ( discriminator == 2 ) // ModList -- { -- ByteBuf buffer = payload.slice(); -- int modCount = DefinedPacket.readVarInt( buffer, 2 ); -- for ( int i = 0; i < modCount; i++ ) -+ -+ try { -+ byte discriminator = payload.readByte(); -+ if ( discriminator == 2 ) // ModList - { -- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ ByteBuf buffer = payload.slice(); -+ int modCount = DefinedPacket.readVarInt( buffer, 2 ); -+ for ( int i = 0; i < modCount; i++ ) -+ { -+ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); -+ } - } -+ } finally { -+ payload.release(); - } -+ - return modTags; - } - --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch deleted file mode 100644 index 07bc7ec1..00000000 --- a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7e20c899237e194fbda629aa6be4444fbe293b7d Mon Sep 17 00:00:00 2001 -From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> -Date: Thu, 15 Apr 2021 08:34:57 -0300 -Subject: [PATCH] Check if packetID is invalid. - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 70a1192e7..6316143f7 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder - - int packetId = DefinedPacket.readVarInt( in ); - packetTypeInfo = packetId; -- -+ // FlameCord Start - Check if packetId is invalid. -+ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) -+ { -+ throw new FastDecoderException( "[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId ); -+ } -+ // Flamecord End - DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); - if ( packet != null ) - { --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch deleted file mode 100644 index 6f49bf56..00000000 --- a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 1d9ee842e043c343a64b8fe7ef6962ee0fb53041 Mon Sep 17 00:00:00 2001 -From: linsaftw <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 30 Apr 2021 23:51:51 -0300 -Subject: [PATCH] FlameCord logger options - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 241e8ed9c..b563cbced 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -11,10 +11,27 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration extends FlameConfig { -+ @Getter -+ private boolean loggerInitialhandler = false; -+ @Getter -+ private boolean loggerExceptions = false; -+ @Getter -+ private boolean loggerDump = false; -+ @Getter -+ private boolean loggerHaProxy = false; -+ @Getter -+ private boolean loggerDetailedConnection = true; -+ - public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { - final File configurationFile = new File("./flamecord.yml"); - final Configuration configuration = load(configurationFile); - -+ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); -+ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); -+ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); -+ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); -+ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); -+ - save(configuration, configurationFile); - } - } -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 e48f77131..909227970 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; - import com.google.common.collect.HashMultimap; - import com.google.common.collect.ImmutableMap; - import com.google.common.collect.Multimap; -+import dev._2lstudios.flamecord.FlameCord; - import io.netty.bootstrap.Bootstrap; - import io.netty.channel.Channel; - import io.netty.channel.ChannelFuture; -@@ -406,7 +407,10 @@ public final class UserConnection implements ProxiedPlayer - - private String connectionFailMessage(Throwable cause) - { -- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall -+ // FlameCord - Allow for toggle the logging of connection failures -+ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { -+ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall -+ } - return ""; // Waterfall - } - -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 22688a045..66a347542 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 -@@ -396,7 +396,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - case 1: - // Ping -- if ( bungee.getConfig().isLogPings() ) -+ // FlameCord - Option to log initialhandler -+ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); - } -@@ -405,7 +406,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection - break; - case 2: - // Login -- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall -+ // FlameCord - Option to log initialhandler -+ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall - { - bungee.getLogger().log( Level.INFO, "{0} has connected", this ); - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 694ecdb01..14e3004fc 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel = new ChannelWrapper( ctx ); - handler.connected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Option to log initialhandler -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); - } -@@ -61,7 +62,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - channel.markClosed(); - handler.disconnected( channel ); - -- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) -+ // FlameCord - Option to log initialhandler -+ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) - { - ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); - } -@@ -98,10 +100,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); - -- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -- { -- channel.getRemoteAddress(), newAddress -- } ); -+ // FlameCord - Option to log haproxy -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) -+ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] -+ { -+ channel.getRemoteAddress(), newAddress -+ } ); - - channel.setRemoteAddress( newAddress ); - } -@@ -146,6 +150,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - { - boolean logExceptions = !( handler instanceof PingHandler ); - -+ // FlameCord - Option to log exceptions -+ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; -+ - if ( logExceptions ) - { - if ( cause instanceof ReadTimeoutException ) --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch deleted file mode 100644 index 94640188..00000000 --- a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 664f35c5a6155c5e41aa10d1cd15cf590cc011a0 Mon Sep 17 00:00:00 2001 -From: abhiram -Date: Thu, 13 May 2021 01:05:03 +0530 -Subject: [PATCH] Added an api method to unload Plugins - -Format Code to Bungee's code style - -diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156f..a190dfae8 100644 ---- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -+++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -@@ -25,6 +25,7 @@ import java.util.Set; - import java.util.Stack; - import java.util.jar.JarEntry; - import java.util.jar.JarFile; -+import java.util.logging.Handler; - import java.util.logging.Level; - import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; // Waterfall - import io.github.waterfallmc.waterfall.exception.ProxyCommandException; // Waterfall -@@ -63,6 +64,7 @@ public final class PluginManager - private Map toLoad = new HashMap<>(); - private final Multimap commandsByPlugin = ArrayListMultimap.create(); - private final Multimap listenersByPlugin = ArrayListMultimap.create(); -+ private final HashMap pluginloaders = new HashMap<>(); - - @SuppressWarnings("unchecked") - public PluginManager(ProxyServer proxy) -@@ -291,6 +293,45 @@ public final class PluginManager - return plugins.get( name ); - } - -+ -+ /** -+ * This will Unload the given plugin -+ * -+ * @param plugin to unload -+ */ -+ // FlameCord start - Adds a method to unload plugin from proxy -+ public void unloadPlugin(Plugin plugin) -+ { -+ plugin.onDisable(); -+ this.unregisterListeners( plugin ); -+ this.unregisterCommands( plugin ); -+ this.proxy.getScheduler().cancel( plugin ); -+ -+ for ( Handler handler : plugin.getLogger().getHandlers() ) -+ { -+ handler.close(); -+ } -+ -+ try -+ { -+ pluginloaders.get( plugin.getDescription().getName() ).close(); -+ }catch (Exception exception) -+ { -+ exception.printStackTrace(); -+ } -+ -+ if( this.plugins.containsKey( plugin.getDescription().getName() ) ) -+ { -+ this.plugins.remove( plugin.getDescription().getName() ); -+ } -+ -+ if( this.pluginloaders.containsKey( plugin.getDescription().getName() ) ) -+ { -+ this.pluginloaders.remove( plugin.getDescription().getName() ); -+ } -+ } -+ // FlameCord end -+ - public void loadPlugins() - { - Map pluginStatuses = new HashMap<>(); -@@ -395,6 +436,9 @@ public final class PluginManager - Plugin clazz = (Plugin) main.getDeclaredConstructor().newInstance(); - - plugins.put( plugin.getName(), clazz ); -+ // FlameCord start - cache url classloaders to unload plugins -+ pluginloaders.put( plugin.getName(),loader ); -+ // FlameCord end - clazz.onLoad(); - ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] - { --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch deleted file mode 100644 index 17fe687b..00000000 --- a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 2caae71d8c0bdc5a325610ef1c77775f9ba4ee69 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 10 Jun 2021 11:30:19 -0300 -Subject: [PATCH] Apply packet limits - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index e78519964..222285cc1 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -@@ -61,4 +61,14 @@ public class EncryptionRequest extends DefinedPacket - { - handler.handle( this ); - } -+ -+ @Override -+ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 20 + 256 + 256; // FlameCord - Apply packet limits -+ } -+ -+ @Override -+ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 20 + 1 + 1; // FlameCord - Apply packet limits -+ } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -index 7dbbfd3cd..b78420556 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java -@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; - import lombok.NoArgsConstructor; - import net.md_5.bungee.protocol.AbstractPacketHandler; - import net.md_5.bungee.protocol.DefinedPacket; -+import net.md_5.bungee.protocol.ProtocolConstants; - - @Data - @NoArgsConstructor -@@ -43,4 +44,14 @@ public class Handshake extends DefinedPacket - { - handler.handle( this ); - } -+ -+ @Override -+ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 1036 + 256; // FlameCord - Apply packet limits -+ } -+ -+ @Override -+ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -+ return 5; // FlameCord - Apply packet limits -+ } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 3224b0d2b..763d34c2f 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -@@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket - public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - // Accommodate the rare (but likely malicious) use of UTF-8 usernames, since it is technically - // legal on the protocol level. -- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return -1; -+ // FlameCord - Apply packet limits -+ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 1024; - return 1 + (16 * 4); - } - // Waterfall end --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch deleted file mode 100644 index 2ecfe04a..00000000 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ /dev/null @@ -1,676 +0,0 @@ -From 2072d8d33f059abfdb95c16158792887f3f701d3 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 7 Oct 2021 21:37:24 -0300 -Subject: [PATCH] Custom motd system - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b563cbced..b41ee92cc 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -2,15 +2,94 @@ package dev._2lstudios.flamecord.configuration; - - import java.io.File; - import java.util.ArrayList; -+import java.util.Collections; - import java.util.Arrays; - import java.util.Collection; - import java.util.HashSet; -+import java.util.List; -+import java.util.Random; - -+import dev._2lstudios.flamecord.utils.ColorUtil; - import lombok.Getter; - import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration extends FlameConfig { -+ public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { -+ String motd; -+ -+ if (protocol >= 735) { -+ motd = hexMotds.get(new Random().nextInt(hexMotds.size())); -+ } else { -+ motd = motds.get(new Random().nextInt(motds.size())); -+ } -+ -+ motd = motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); -+ -+ return motd; -+ } -+ -+ public String[] getSample(int maxPlayers, int onlinePlayers, int protocol) { -+ String sample; -+ -+ if (protocol >= 735) { -+ sample = hexSamples.get(new Random().nextInt(hexSamples.size())); -+ } else { -+ sample = samples.get(new Random().nextInt(samples.size())); -+ } -+ -+ sample = sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); -+ -+ return sample.split("\n"); -+ } -+ -+ public String getProtocolName(int maxPlayers, int onlinePlayers) { -+ return protocolName.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); -+ } -+ -+ public int getFakePlayersAmount(final int players) { -+ switch (fakePlayersMode) { -+ case "STATIC": -+ return fakePlayersAmount; -+ case "RANDOM": -+ return (int) (Math.floor(Math.random() * fakePlayersAmount) + 1); -+ case "DIVISION": -+ return players / fakePlayersAmount; -+ default: -+ return 0; -+ } -+ } -+ -+ @Getter -+ private boolean motdEnabled = false; -+ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); -+ private List hexMotds; -+ -+ @Getter -+ private boolean sampleEnabled = false; -+ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); -+ private List hexSamples; -+ -+ @Getter -+ private boolean protocolEnabled = false; -+ @Getter -+ private String protocolName = "&c&lMaintenance"; -+ @Getter -+ private boolean protocolAlwaysShow = false; -+ -+ @Getter -+ private boolean maxPlayersEnabled = false; -+ @Getter -+ private int maxPlayersAmount = 1000; -+ @Getter -+ private boolean maxPlayersOneMore = false; -+ -+ @Getter -+ private boolean fakePlayersEnabled = false; -+ @Getter -+ private int fakePlayersAmount = 3; -+ private String fakePlayersMode = "DIVISION"; -+ - @Getter - private boolean loggerInitialhandler = false; - @Getter -@@ -32,6 +111,22 @@ public class FlameCordConfiguration extends FlameConfig { - this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); - this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); - -+ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); -+ this.hexMotds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 735); -+ this.motds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 734); -+ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); -+ this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); -+ this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); -+ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); -+ this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); -+ this.protocolAlwaysShow = setIfUnexistant("custom-motd.protocol.always-show", this.protocolAlwaysShow, configuration); -+ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); -+ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); -+ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); -+ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); -+ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); -+ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); -+ - save(configuration, configurationFile); - } - } -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java -new file mode 100644 -index 000000000..9587bccda ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java -@@ -0,0 +1,48 @@ -+package dev._2lstudios.flamecord.utils; -+ -+import java.util.List; -+ -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; -+import net.md_5.bungee.api.ChatColor; -+ -+public class ColorUtil { -+ public static String color(String text) { -+ return ChatColor.translateAlternateColorCodes('&', text); -+ } -+ -+ public static List color(final List texts) { -+ for (int i = 0; i < texts.size(); i++) { -+ texts.set(i, color(texts.get(i))); -+ } -+ -+ return texts; -+ } -+ -+ public static String hex(String text, int protocol) { -+ if (text == null) { -+ return text; -+ } -+ -+ return IridiumColorAPI.process(text, protocol); -+ } -+ -+ public static String hexColor(String text, int protocol) { -+ if (text != null) { -+ text = color(text); -+ -+ if (text != null) { -+ text = hex(text, protocol); -+ } -+ } -+ -+ return text; -+ } -+ -+ public static List hexColor(final List texts, int protocol) { -+ for (int i = 0; i < texts.size(); i++) { -+ texts.set(i, hexColor(texts.get(i), protocol)); -+ } -+ -+ return texts; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java -new file mode 100644 -index 000000000..6c386e16f ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java -@@ -0,0 +1,275 @@ -+package dev._2lstudios.flamecord.utils.iridiumcolorapi; -+ -+import java.awt.Color; -+import java.util.Arrays; -+import java.util.Collection; -+import java.util.List; -+import java.util.Map; -+import java.util.stream.Collectors; -+ -+import javax.annotation.Nonnull; -+ -+import com.google.common.collect.ImmutableMap; -+ -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.GradientPattern; -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.Pattern; -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.RainbowPattern; -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.SolidPattern; -+import net.md_5.bungee.api.ChatColor; -+ -+public class IridiumColorAPI { -+ -+ /** -+ * Cached result if the server version is after the v1.16 RGB update. -+ * -+ * @since 1.0.0 -+ */ -+ private static final boolean SUPPORTS_RGB(int protocol) { -+ return protocol >= 735; -+ } -+ -+ private static final List SPECIAL_COLORS = Arrays.asList("&l", "&n", "&o", "&k", "&m", "§l", "§n", "§o", "§k", "§m"); -+ -+ /** -+ * Cached result of all legacy colors. -+ * -+ * @since 1.0.0 -+ */ -+ private static final Map COLORS = ImmutableMap.builder() -+ .put(new Color(0), ChatColor.getByChar('0')) -+ .put(new Color(170), ChatColor.getByChar('1')) -+ .put(new Color(43520), ChatColor.getByChar('2')) -+ .put(new Color(43690), ChatColor.getByChar('3')) -+ .put(new Color(11141120), ChatColor.getByChar('4')) -+ .put(new Color(11141290), ChatColor.getByChar('5')) -+ .put(new Color(16755200), ChatColor.getByChar('6')) -+ .put(new Color(11184810), ChatColor.getByChar('7')) -+ .put(new Color(5592405), ChatColor.getByChar('8')) -+ .put(new Color(5592575), ChatColor.getByChar('9')) -+ .put(new Color(5635925), ChatColor.getByChar('a')) -+ .put(new Color(5636095), ChatColor.getByChar('b')) -+ .put(new Color(16733525), ChatColor.getByChar('c')) -+ .put(new Color(16733695), ChatColor.getByChar('d')) -+ .put(new Color(16777045), ChatColor.getByChar('e')) -+ .put(new Color(16777215), ChatColor.getByChar('f')).build(); -+ -+ /** -+ * Cached result of patterns. -+ * -+ * @since 1.0.2 -+ */ -+ private static final List PATTERNS = Arrays.asList(new GradientPattern(), new SolidPattern(), new RainbowPattern()); -+ -+ /** -+ * Processes a string to add color to it. -+ * Thanks to Distressing for helping with the regex <3 -+ * -+ * @param string The string we want to process -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ public static String process(@Nonnull String string, int protocol) { -+ for (Pattern pattern : PATTERNS) { -+ string = pattern.process(string, protocol); -+ } -+ -+ string = ChatColor.translateAlternateColorCodes('&', string); -+ return string; -+ } -+ -+ /** -+ * Processes multiple strings in a collection. -+ * -+ * @param strings The collection of the strings we are processing -+ * @return The list of processed strings -+ * @since 1.0.3 -+ */ -+ @Nonnull -+ public static List process(@Nonnull Collection strings, int protocol) { -+ return strings.stream() -+ .map(s -> IridiumColorAPI.process(s, protocol)) -+ .collect(Collectors.toList()); -+ } -+ -+ /** -+ * Colors a String. -+ * -+ * @param string The string we want to color -+ * @param color The color we want to set it to -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ public static String color(@Nonnull String string, @Nonnull Color color, int protocol) { -+ return (SUPPORTS_RGB(protocol) ? ChatColor.of(color) : getClosestColor(color)) + string; -+ } -+ -+ /** -+ * Colors a String with a gradiant. -+ * -+ * @param string The string we want to color -+ * @param start The starting gradiant -+ * @param end The ending gradiant -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ public static String color(@Nonnull String string, @Nonnull Color start, @Nonnull Color end, int protocol) { -+ String originalString = string; -+ -+ ChatColor[] colors = createGradient(start, end, withoutSpecialChar(string).length(), protocol); -+ return apply(originalString, colors); -+ } -+ -+ /** -+ * Colors a String with rainbow colors. -+ * -+ * @param string The string which should have rainbow colors -+ * @param saturation The saturation of the rainbow colors -+ * @since 1.0.3 -+ */ -+ @Nonnull -+ public static String rainbow(@Nonnull String string, float saturation, int protocol) { -+ String originalString = string; -+ -+ ChatColor[] colors = createRainbow(withoutSpecialChar(string).length(), saturation, protocol); -+ return apply(originalString, colors); -+ } -+ -+ /** -+ * Gets a color from hex code. -+ * -+ * @param string The hex code of the color -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ public static ChatColor getColor(@Nonnull String string, int protocol) { -+ return SUPPORTS_RGB(protocol) ? ChatColor.of(new Color(Integer.parseInt(string, 16))) -+ : getClosestColor(new Color(Integer.parseInt(string, 16))); -+ } -+ -+ /** -+ * Removes all color codes from the provided String, including IridiumColorAPI -+ * patterns. -+ * -+ * @param string The String which should be stripped -+ * @return The stripped string without color codes -+ * @since 1.0.5 -+ */ -+ @Nonnull -+ public static String stripColorFormatting(@Nonnull String string) { -+ return string.replaceAll("<#[0-9A-F]{6}>|[&§][a-f0-9lnokm]|<[/]?[A-Z]{5,8}(:[0-9A-F]{6})?[0-9]*>", ""); -+ } -+ -+ @Nonnull -+ private static String apply(@Nonnull String source, ChatColor[] colors) { -+ StringBuilder specialColors = new StringBuilder(); -+ StringBuilder stringBuilder = new StringBuilder(); -+ String[] characters = source.split(""); -+ int outIndex = 0; -+ for (int i = 0; i < characters.length; i++) { -+ if (characters[i].equals("&") || characters[i].equals("§")) { -+ if (i + 1 < characters.length) { -+ if (characters[i + 1].equals("r")) { -+ specialColors.setLength(0); -+ } else { -+ specialColors.append(characters[i]); -+ specialColors.append(characters[i + 1]); -+ } -+ i++; -+ } else -+ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); -+ } else -+ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); -+ } -+ return stringBuilder.toString(); -+ } -+ -+ @Nonnull -+ private static String withoutSpecialChar(@Nonnull String source) { -+ String workingString = source; -+ for (String color : SPECIAL_COLORS) { -+ if (workingString.contains(color)) { -+ workingString = workingString.replace(color, ""); -+ } -+ } -+ return workingString; -+ } -+ -+ /** -+ * Returns a rainbow array of chat colors. -+ * -+ * @param step How many colors we return -+ * @param saturation The saturation of the rainbow -+ * @return The array of colors -+ * @since 1.0.3 -+ */ -+ @Nonnull -+ private static ChatColor[] createRainbow(int step, float saturation, int protocol) { -+ ChatColor[] colors = new ChatColor[step]; -+ double colorStep = (1.00 / step); -+ -+ for (int i = 0; i < step; i++) { -+ Color color = Color.getHSBColor((float) (colorStep * i), saturation, saturation); -+ if (SUPPORTS_RGB(protocol)) { -+ colors[i] = ChatColor.of(color); -+ } else { -+ colors[i] = getClosestColor(color); -+ } -+ } -+ -+ return colors; -+ } -+ -+ /** -+ * Returns a gradient array of chat colors. -+ * -+ * @param start The starting color. -+ * @param end The ending color. -+ * @param step How many colors we return. -+ * @author TheViperShow -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color end, int step, int protocol) { -+ ChatColor[] colors = new ChatColor[step]; -+ int stepR = Math.abs(start.getRed() - end.getRed()) / (step - 1); -+ int stepG = Math.abs(start.getGreen() - end.getGreen()) / (step - 1); -+ int stepB = Math.abs(start.getBlue() - end.getBlue()) / (step - 1); -+ int[] direction = new int[] { -+ start.getRed() < end.getRed() ? +1 : -1, -+ start.getGreen() < end.getGreen() ? +1 : -1, -+ start.getBlue() < end.getBlue() ? +1 : -1 -+ }; -+ -+ for (int i = 0; i < step; i++) { -+ Color color = new Color(start.getRed() + ((stepR * i) * direction[0]), start.getGreen() + ((stepG * i) * direction[1]), start.getBlue() + ((stepB * i) * direction[2])); -+ if (SUPPORTS_RGB(protocol)) { -+ colors[i] = ChatColor.of(color); -+ } else { -+ colors[i] = getClosestColor(color); -+ } -+ } -+ -+ return colors; -+ } -+ -+ /** -+ * Returns the closest legacy color from an rgb color -+ * -+ * @param color The color we want to transform -+ * @since 1.0.0 -+ */ -+ @Nonnull -+ private static ChatColor getClosestColor(Color color) { -+ Color nearestColor = null; -+ double nearestDistance = Integer.MAX_VALUE; -+ -+ for (Color constantColor : COLORS.keySet()) { -+ double distance = Math.pow(color.getRed() - constantColor.getRed(), 2) + Math.pow(color.getGreen() - constantColor.getGreen(), 2) + Math.pow(color.getBlue() - constantColor.getBlue(), 2); -+ if (nearestDistance > distance) { -+ nearestColor = constantColor; -+ nearestDistance = distance; -+ } -+ } -+ return COLORS.get(nearestColor); -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java -new file mode 100644 -index 000000000..c1f05cd0a ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java -@@ -0,0 +1,33 @@ -+package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; -+ -+import java.awt.*; -+import java.util.regex.Matcher; -+ -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; -+ -+/** -+ * Represents a gradient color pattern which can be applied to a String. -+ */ -+public class GradientPattern implements Pattern { -+ -+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); -+ -+ /** -+ * Applies a gradient pattern to the provided String. -+ * Output might me the same as the input if this pattern is not present. -+ * -+ * @param string The String to which this pattern should be applied to -+ * @return The new String with applied pattern -+ */ -+ public String process(String string, int protocol) { -+ Matcher matcher = pattern.matcher(string); -+ while (matcher.find()) { -+ String start = matcher.group(1); -+ String end = matcher.group(3); -+ String content = matcher.group(2); -+ string = string.replace(matcher.group(), IridiumColorAPI.color(content, new Color(Integer.parseInt(start, 16)), new Color(Integer.parseInt(end, 16)), protocol)); -+ } -+ return string; -+ } -+ -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java -new file mode 100644 -index 000000000..5457ead64 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java -@@ -0,0 +1,17 @@ -+package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; -+ -+/** -+ * Represents a color pattern which can be applied to a String. -+ */ -+public interface Pattern { -+ -+ /** -+ * Applies this pattern to the provided String. -+ * Output might me the same as the input if this pattern is not present. -+ * -+ * @param string The String to which this pattern should be applied to -+ * @return The new String with applied pattern -+ */ -+ String process(String string, int protocol); -+ -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java -new file mode 100644 -index 000000000..792e9f987 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java -@@ -0,0 +1,28 @@ -+package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; -+ -+import java.util.regex.Matcher; -+ -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; -+ -+public class RainbowPattern implements Pattern { -+ -+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); -+ -+ /** -+ * Applies a rainbow pattern to the provided String. -+ * Output might me the same as the input if this pattern is not present. -+ * -+ * @param string The String to which this pattern should be applied to -+ * @return The new String with applied pattern -+ */ -+ public String process(String string, int protocol) { -+ Matcher matcher = pattern.matcher(string); -+ while (matcher.find()) { -+ String saturation = matcher.group(1); -+ String content = matcher.group(2); -+ string = string.replace(matcher.group(), IridiumColorAPI.rainbow(content, Float.parseFloat(saturation), protocol)); -+ } -+ return string; -+ } -+ -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java -new file mode 100644 -index 000000000..0b039c797 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java -@@ -0,0 +1,29 @@ -+package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; -+ -+import java.util.regex.Matcher; -+ -+import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; -+ -+public class SolidPattern implements Pattern { -+ -+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("|#\\{([0-9A-Fa-f]{6})}"); -+ -+ /** -+ * Applies a solid RGB color to the provided String. -+ * Output might me the same as the input if this pattern is not present. -+ * -+ * @param string The String to which this pattern should be applied to -+ * @return The new String with applied pattern -+ */ -+ public String process(String string, int protocol) { -+ Matcher matcher = pattern.matcher(string); -+ while (matcher.find()) { -+ String color = matcher.group(1); -+ if (color == null) color = matcher.group(2); -+ -+ string = string.replace(matcher.group(), IridiumColorAPI.getColor(color, protocol) + ""); -+ } -+ return string; -+ } -+ -+} -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 66a347542..58be68b02 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 -@@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; - - import dev._2lstudios.flamecord.FlameCord; - -+import dev._2lstudios.flamecord.configuration.FlameConfig; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import lombok.Getter; - import lombok.RequiredArgsConstructor; - import net.md_5.bungee.BungeeCord; -@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection - Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); - - ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); -- final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); - - Callback pingBack = new Callback() -@@ -338,7 +339,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection - ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); - } else - { -- pingBack.done( getPingInfo( motd, protocol ), null ); -+ // FlameCord - Custom motd system -+ // Get the configuration -+ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ -+ String motd; -+ String protocolName; -+ -+ ServerPing.PlayerInfo[] sample = null; -+ -+ int maxPlayers = listener.getMaxPlayers(); -+ int onlinePlayers = bungee.getOnlineCount(); -+ -+ if (config.isFakePlayersEnabled()) { -+ onlinePlayers += config.getFakePlayersAmount(onlinePlayers); -+ } -+ -+ if (config.isMaxPlayersEnabled()) { -+ maxPlayers = config.isMaxPlayersOneMore() ? onlinePlayers + 1 : config.getMaxPlayersAmount(); -+ } -+ -+ if (config.isMotdEnabled()) { -+ motd = config.getMOTD(maxPlayers, onlinePlayers, protocol); -+ } else { -+ motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); -+ } -+ -+ if (config.isProtocolEnabled()) { -+ protocolName = config.getProtocolName(maxPlayers, onlinePlayers); -+ } else { -+ protocolName = bungee.getName() + " " + bungee.getGameVersion(); -+ } -+ -+ int customProtocol = config.isProtocolEnabled() && config.isProtocolAlwaysShow() ? -1 : protocol; -+ -+ if (config.isSampleEnabled()) { -+ final UUID fakeUuid = new UUID(0, 0); -+ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers, protocol); -+ -+ sample = new ServerPing.PlayerInfo[sampleString.length]; -+ -+ for (int i = 0; i < sampleString.length; i++) { -+ sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); -+ } -+ } -+ -+ pingBack.done( new ServerPing( -+ new ServerPing.Protocol( protocolName, customProtocol ), -+ new ServerPing.Players( maxPlayers, onlinePlayers, sample ), -+ motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); -+ // FlameCord end - Custom motd system - } - - thisState = State.PING; --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch deleted file mode 100644 index 5e56fbf5..00000000 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 62bf8051431b5035171c900d729a1c175fcda639 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 24 Feb 2022 23:41:57 -0300 -Subject: [PATCH] TCP Fast Open - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b41ee92cc..14665b1f6 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration extends FlameConfig { -+ // FlameCord - TCP Fast Open -+ @Getter -+ private int tcpFastOpen = 3; -+ - public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { - String motd; - -@@ -127,6 +131,8 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); - -+ this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); -+ - save(configuration, configurationFile); - } - } -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 a4c3bd710..ffea15992 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 -@@ -194,6 +194,8 @@ public class PipelineUtils - // IP_TOS is not supported (Windows XP / Windows Server 2003) - } - ch.config().setOption( ChannelOption.TCP_NODELAY, true ); -+ // FlameCord - TCP Fast Open -+ ch.config().setOption( ChannelOption.TCP_FASTOPEN, FlameCord.getInstance().getFlameCordConfiguration().getTcpFastOpen() ); - ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); - ch.config().setWriteBufferWaterMark( MARK ); - --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch deleted file mode 100644 index ca0779d9..00000000 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ /dev/null @@ -1,1989 +0,0 @@ -From 405f365b733a8d8a322b0426ef103cdc7774cffe Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 4 Mar 2022 13:35:53 -0300 -Subject: [PATCH] Antibot System - - -diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..f48f1e60b 100644 ---- a/flamecord/pom.xml -+++ b/flamecord/pom.xml -@@ -30,6 +30,17 @@ - ${project.version} - compile - -+ -+ com.maxmind.db -+ maxmind-db -+ 2.0.0 -+ -+ -+ io.netty -+ netty-handler -+ ${netty.version} -+ compile -+ - - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b9..3824cc533 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -@@ -1,8 +1,16 @@ - package dev._2lstudios.flamecord; - -+import java.io.IOException; - import java.util.Collection; -+import java.util.Iterator; -+import java.util.concurrent.ConcurrentHashMap; -+import java.util.logging.Level; - import java.util.logging.Logger; - -+import dev._2lstudios.flamecord.antibot.AddressDataManager; -+import dev._2lstudios.flamecord.antibot.CheckManager; -+import dev._2lstudios.flamecord.antibot.LoggerWrapper; -+import dev._2lstudios.flamecord.antibot.StatsData; - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -13,8 +21,13 @@ import net.md_5.bungee.config.YamlConfiguration; - public class FlameCord { - @Getter - private static FlameCord instance; -+ private static Runtime runtime; - - public static void initialize(final Logger logger, final Collection whitelistedAddresses) { -+ if (FlameCord.runtime == null) { -+ FlameCord.runtime = Runtime.getRuntime(); -+ } -+ - if (FlameCord.instance == null) { - FlameCord.instance = new FlameCord(); - } -@@ -31,6 +44,16 @@ public class FlameCord { - @Getter - private MessagesConfiguration messagesConfiguration; - -+ // FlameCord - Antibot System -+ @Getter -+ private AddressDataManager addressDataManager; -+ @Getter -+ private CheckManager checkManager; -+ @Getter -+ private StatsData statsData; -+ @Getter -+ private LoggerWrapper loggerWrapper; -+ - public void reload(final Logger logger, final Collection whitelistedAddresses) { - final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); - -@@ -39,5 +62,106 @@ public class FlameCord { - // FlameCord - Module System - this.modulesConfiguration = new ModulesConfiguration(configurationProvider); - this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); -+ -+ // FlameCord - Antibot System -+ if (checkManager != null) checkManager.unload(); -+ this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); -+ this.addressDataManager = new AddressDataManager(); -+ this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); -+ this.statsData = new StatsData(); -+ -+ // Initialize antibot firewall ipset -+ if (flameCordConfiguration.isAntibotFirewallIpset()) { -+ runLinuxCommand("apt install iptables -y"); // Install iptables -+ runLinuxCommand("apt install ipset -y"); // Install ipset -+ runLinuxCommand("ipset destroy flamecord-firewall"); // Delete old FlameCord set -+ runLinuxCommand("ipset create flamecord-firewall hash:ip timeout 60"); // Create new FlameCord set -+ runLinuxCommand("iptables -I INPUT -m set --match-set flamecord-firewall src -j DROP"); // Create iptables rule to DROP -+ -+ // Thread to run queued firewall linux commands -+ new Thread(() -> { -+ FlameCord flameCord = FlameCord.getInstance(); -+ -+ while (!flameCord.isShuttingDown()) { -+ flameCord.runQueuedLinuxCommands(); -+ -+ try { -+ Thread.sleep(1000); -+ } catch (InterruptedException e) { -+ // Ignore -+ } -+ } -+ }).start(); -+ } -+ } -+ -+ private boolean shutdown = false; -+ -+ public boolean isShuttingDown() { -+ return shutdown; -+ } -+ -+ public void shutdown() { -+ this.shutdown = true; -+ } -+ -+ /** -+ * Utility to run a Linux commands for iptables. -+ * @param command -+ */ -+ public void runLinuxCommand(String command) { -+ try { -+ runtime.exec("/bin/sh -c " + command); -+ } catch (IOException e) { -+ /* -+ * Windows throws exception. -+ */ -+ } -+ } -+ -+ // Commands to execute in the queue -+ private Collection commandQueue = ConcurrentHashMap.newKeySet(); -+ -+ // Boolean for when the commands are processing -+ private boolean processing = false; -+ -+ /** -+ * Add command to the linux command queue -+ * @param command -+ */ -+ public void queueLinuxCommand(String command) { -+ commandQueue.add(command); -+ } -+ -+ /** -+ * Run the queued linux commands -+ */ -+ public void runQueuedLinuxCommands() { -+ if (!commandQueue.isEmpty() && !processing) { -+ processing = true; -+ -+ try { -+ Iterator iterator = commandQueue.iterator(); -+ StringBuilder commands = new StringBuilder(); -+ int ranCommands = 0; -+ -+ while (iterator.hasNext()) { -+ String command = iterator.next(); -+ -+ if (ranCommands++ > 0) { -+ commands.append(" && "); -+ } -+ -+ commands.append(command); -+ iterator.remove(); -+ } -+ -+ runLinuxCommand(commands.toString()); -+ -+ getLoggerWrapper().log(Level.INFO, "Blacklisted " + ranCommands + " ips from the kernel with IPSet"); -+ } finally { -+ processing = false; -+ } -+ } - } - } -\ No newline at end of file -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java -new file mode 100644 -index 000000000..0295ea89d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java -@@ -0,0 +1,48 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.Collection; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class AccountsCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private AddressDataManager addressDataManager; -+ -+ public AccountsCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress, final String nickname) { -+ if (config.getAntibotAccountsWhitelist().contains(nickname)) { -+ return false; -+ } -+ -+ if (config.isAntibotAccountsEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ final Collection nicknames = addressData.getNicknames(); -+ -+ if (nicknames.size() > config.getAntibotAccountsLimit()) { -+ nicknames.remove(nickname); -+ -+ if ( config.isAntibotAccountsLog() ) -+ { -+ logger.log( Level.INFO, "[FlameCord] [{0}] has too many accounts", remoteAddress ); -+ } -+ -+ if (config.isAntibotAccountsFirewall()) { -+ addressData.firewall("Too many accounts"); -+ } -+ -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java -new file mode 100644 -index 000000000..7c7899830 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java -@@ -0,0 +1,165 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.util.Collection; -+import java.util.HashSet; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class AddressData { -+ private FlameCordConfiguration config; -+ private StatsData statsData; -+ private Collection nicknames = null; -+ private final String hostString; -+ private String lastNickname = ""; -+ private String country = null; -+ private String firewallReason = null; -+ private long lastPing = 0; -+ private long penultimateConnection = 0; -+ private long lastConnection = 0; -+ private long lastFirewall = 0; -+ private int pingsSecond = 0; -+ private int totalPings = 0; -+ private int connectionsSecond = 0; -+ private int totalConnections = 0; -+ -+ public AddressData(final String hostString) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.statsData = FlameCord.getInstance().getStatsData(); -+ this.hostString = hostString; -+ } -+ -+ public Collection getNicknames() { -+ if (nicknames == null) nicknames = new HashSet<>(); -+ -+ return nicknames; -+ } -+ -+ public String getLastNickname() { -+ return lastNickname; -+ } -+ -+ public void addNickname(final String nickname) { -+ if (nicknames == null) nicknames = new HashSet<>(); -+ -+ if (!lastNickname.equals(nickname)) { -+ this.lastNickname = nickname; -+ this.totalConnections = 1; -+ } -+ -+ this.nicknames.add(nickname); -+ } -+ -+ public long getPenultimateConnection() { -+ return penultimateConnection; -+ } -+ -+ public long getTimeSincePenultimateConnection() { -+ return System.currentTimeMillis() - penultimateConnection; -+ } -+ -+ public long getLastConnection() { -+ return lastConnection; -+ } -+ -+ public long getTimeSinceLastConnection() { -+ return System.currentTimeMillis() - lastConnection; -+ } -+ -+ private void updatePingsSecond() { -+ if (System.currentTimeMillis() - lastPing >= 1000) { -+ pingsSecond = 0; -+ } -+ } -+ -+ public int getPingsSecond() { -+ updatePingsSecond(); -+ return pingsSecond; -+ } -+ -+ public void addPing() { -+ statsData.addPing(); -+ updatePingsSecond(); -+ lastPing = System.currentTimeMillis(); -+ pingsSecond++; -+ totalPings++; -+ } -+ -+ public int getTotalPings() { -+ return totalPings; -+ } -+ -+ private void updateConnectionsSecond() { -+ if (System.currentTimeMillis() - lastConnection >= 1000) { -+ connectionsSecond = 0; -+ } -+ } -+ -+ public int getConnectionsSecond() { -+ updateConnectionsSecond(); -+ return connectionsSecond; -+ } -+ -+ public void addConnection() { -+ final long currentTime = System.currentTimeMillis(); -+ -+ statsData.addConnection(); -+ updateConnectionsSecond(); -+ penultimateConnection = lastConnection == 0 ? currentTime : lastConnection; -+ lastConnection = currentTime; -+ connectionsSecond++; -+ totalConnections++; -+ } -+ -+ public int getTotalConnections() { -+ return totalConnections; -+ } -+ -+ public String getHostString() { -+ return hostString; -+ } -+ -+ public boolean isFirewalled() { -+ return System.currentTimeMillis() - lastFirewall < config -+ .getAntibotFirewallExpire() * 1000; -+ } -+ -+ public void firewall(String reason) { -+ if (!FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewallWhitelist().contains(hostString)) { -+ this.lastFirewall = System.currentTimeMillis(); -+ this.firewallReason = reason; -+ -+ // Queue the firewall as a ipset linux command -+ FlameCord.getInstance().queueLinuxCommand("ipset add flamecord-firewall " + hostString); -+ } -+ } -+ -+ public void unfirewall() { -+ this.lastFirewall = 0; -+ this.firewallReason = null; -+ } -+ -+ public String getFirewallReason() { -+ if (isFirewalled()) { -+ return firewallReason; -+ } -+ -+ return null; -+ } -+ -+ public void setTotalConnections(final int totalConnections) { -+ this.totalConnections = totalConnections; -+ } -+ -+ public String setCountry(final String country) { -+ return this.country = country; -+ } -+ -+ public String getCountry() { -+ return country; -+ } -+ -+ public boolean hasNickname(final String nickname) { -+ return nicknames.contains(nickname); -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java -new file mode 100644 -index 000000000..bd14f56a1 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java -@@ -0,0 +1,48 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.util.HashMap; -+import java.util.Map; -+ -+public class AddressDataManager { -+ private Map addressData = new HashMap<>(); -+ -+ public String sanitizeAddress(String text) { -+ // Remove the port -+ text = text.split(":")[0]; -+ -+ // Check if first character is a slash -+ if (text.startsWith("/")) { -+ // Remove the first character -+ text = text.substring(1); -+ } -+ -+ return text; -+ } -+ -+ public AddressData getAddressData(String addressString) { -+ addressString = sanitizeAddress(addressString); -+ -+ if (addressData.containsKey(addressString)) { -+ return addressData.get(addressString); -+ } else { -+ AddressData data = new AddressData(addressString); -+ -+ addressData.put(addressString, data); -+ -+ return data; -+ } -+ } -+ -+ public AddressData getAddressData(final SocketAddress address) { -+ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; -+ final String addressString = iNetSocketAddress.getHostString(); -+ -+ return getAddressData(addressString); -+ } -+ -+ public int getAddresCount() { -+ return addressData.size(); -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -new file mode 100644 -index 000000000..1503ac954 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -@@ -0,0 +1,40 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import lombok.Getter; -+ -+public class CheckManager { -+ @Getter -+ private final AccountsCheck accountsCheck; -+ @Getter -+ private final CountryCheck countryCheck; -+ @Getter -+ private final FastChatCheck fastChatCheck; -+ @Getter -+ private final NicknameCheck nicknameCheck; -+ @Getter -+ private final PasswordCheck passwordCheck; -+ @Getter -+ private final RatelimitCheck ratelimitCheck; -+ @Getter -+ private final ReconnectCheck reconnectCheck; -+ @Getter -+ private final PacketsCheck packetsCheck; -+ -+ public CheckManager(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { -+ this.accountsCheck = new AccountsCheck(addressDataManager); -+ this.countryCheck = new CountryCheck(addressDataManager); -+ this.fastChatCheck = new FastChatCheck(addressDataManager); -+ this.nicknameCheck = new NicknameCheck(addressDataManager); -+ this.passwordCheck = new PasswordCheck(addressDataManager); -+ this.ratelimitCheck = new RatelimitCheck(addressDataManager); -+ this.reconnectCheck = new ReconnectCheck(addressDataManager); -+ this.packetsCheck = new PacketsCheck(); -+ -+ this.countryCheck.load(); -+ } -+ -+ public void unload() { -+ this.countryCheck.unload(); -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java -new file mode 100644 -index 000000000..fdfd9c8d7 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java -@@ -0,0 +1,148 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.io.File; -+import java.io.IOException; -+import java.io.InputStream; -+import java.net.InetAddress; -+import java.net.InetSocketAddress; -+import java.net.SocketAddress; -+import java.net.URL; -+import java.nio.file.Files; -+import java.util.logging.Level; -+ -+import com.maxmind.db.CHMCache; -+import com.maxmind.db.MaxMindDbConstructor; -+import com.maxmind.db.MaxMindDbParameter; -+import com.maxmind.db.Reader; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class CountryCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private AddressDataManager addressDataManager; -+ private Reader maxMindReader; -+ -+ public CountryCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public void download(final URL url, final File file) throws Exception { -+ try (InputStream in = url.openStream()) { -+ Files.copy(in, file.toPath()); -+ } -+ } -+ -+ public void load() { -+ final File file = new File("GeoLite2-Country.mmdb"); -+ -+ try { -+ if (!file.exists()) { -+ System.out.println("Starting download of MaxMindDB (This will take some seconds...)"); -+ download(new URL("https://git.io/GeoLite2-Country.mmdb"), file); -+ } -+ -+ this.maxMindReader = new Reader(file, new CHMCache()); -+ } catch (final Exception exception) { -+ System.out.println("MaxMindDB was not able to download!"); -+ } -+ } -+ -+ public void unload() { -+ try { -+ if (this.maxMindReader != null) { -+ this.maxMindReader.close(); -+ } -+ } catch (final IOException ex) { -+ // Ignored -+ } -+ } -+ -+ private boolean isBlacklisted(final FlameCordConfiguration config, final String isoCode) { -+ for (final String blacklisted : config.getAntibotCountryBlacklist()) { -+ if (isoCode.contains(blacklisted)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public static class LookupResult { -+ private final Country country; -+ -+ @MaxMindDbConstructor -+ public LookupResult(@MaxMindDbParameter(name = "country") final Country country) { -+ this.country = country; -+ } -+ -+ public Country getCountry() { -+ return this.country; -+ } -+ } -+ -+ public static class Country { -+ private final String isoCode; -+ -+ @MaxMindDbConstructor -+ public Country(@MaxMindDbParameter(name = "iso_code") final String isoCode) { -+ this.isoCode = isoCode; -+ } -+ -+ public String getIsoCode() { -+ return this.isoCode; -+ } -+ } -+ -+ public String getIsoCode(final InetAddress address) { -+ try { -+ final LookupResult lookupResult = maxMindReader.get(address, LookupResult.class); -+ -+ if (lookupResult == null) { -+ return "LOCAL"; -+ } else { -+ final Country country = lookupResult.getCountry(); -+ final String isoCode = country.getIsoCode(); -+ -+ return isoCode; -+ } -+ } catch (final Exception exception) { -+ // Ignored -+ } -+ -+ return null; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress) { -+ if (config.isAntibotCountryEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ final String addressCountry = addressData.getCountry(); -+ final String country; -+ -+ if (addressCountry != null) { -+ country = addressCountry; -+ } else { -+ country = getIsoCode(((InetSocketAddress) remoteAddress).getAddress()); -+ addressData.setCountry(country); -+ } -+ -+ if (country != null && isBlacklisted(config, country)) { -+ if (config.isAntibotCountryLog()) { -+ logger.log(Level.INFO, -+ "[FlameCord] [{0}] has his country blocked from the server", remoteAddress); -+ } -+ -+ if (config.isAntibotCountryFirewall()) { -+ addressData.firewall("Blacklisted country"); -+ } -+ -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java -new file mode 100644 -index 000000000..e21408873 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java -@@ -0,0 +1,39 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class FastChatCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private final AddressDataManager addressDataManager; -+ -+ public FastChatCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress) { -+ if (config.isAntibotFastChatEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ -+ if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { -+ if (config.isAntibotFastChatLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is chatting too fast", remoteAddress); -+ } -+ -+ if (config.isAntibotFastChatFirewall()) { -+ addressData.firewall("Too fast chatting"); -+ } -+ -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java -new file mode 100644 -index 000000000..df26a3634 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java -@@ -0,0 +1,28 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.util.logging.Level; -+import java.util.logging.Logger; -+ -+public class LoggerWrapper { -+ private Logger logger; -+ -+ // Last time a log was done -+ private long lastLog = System.currentTimeMillis(); -+ -+ public LoggerWrapper(Logger logger) { -+ this.logger = logger; -+ } -+ -+ public void log(Level level, String msg, Object ...params) { -+ long currentTime = System.currentTimeMillis(); -+ -+ // Throttle logs by 100ms -+ if (currentTime - lastLog > 100) { -+ // Set the last log -+ lastLog = currentTime; -+ -+ // Log the text -+ logger.log(level, msg, params); -+ } -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java -new file mode 100644 -index 000000000..1b35fba5d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java -@@ -0,0 +1,52 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class NicknameCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private AddressDataManager addressDataManager; -+ -+ public NicknameCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { -+ String lowerNickname = nickname.toLowerCase(); -+ -+ for (final String blacklisted : config.getAntibotNicknameBlacklist()) { -+ if (lowerNickname.contains(blacklisted)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress) { -+ if (config.isAntibotNicknameEnabled()) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ final String nickname = addressData.getLastNickname(); -+ -+ if (isBlacklisted(config, nickname)) { -+ if (config.isAntibotNicknameLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", remoteAddress); -+ } -+ -+ if (config.isAntibotNicknameFirewall()) { -+ addressData.firewall("Blacklisted nickname [" + nickname + "]"); -+ } -+ -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java -new file mode 100644 -index 000000000..a7bd9f153 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java -@@ -0,0 +1,69 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.HashMap; -+import java.util.Map; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.enums.PacketsCheckResult; -+import dev._2lstudios.flamecord.enums.PacketsViolationReason; -+import dev._2lstudios.flamecord.utils.ProtocolUtil; -+import io.netty.buffer.ByteBuf; -+ -+public class PacketsCheck { -+ private Map packetsData = new HashMap<>(); -+ -+ // Time since the last clear passed -+ private long lastClear = System.currentTimeMillis(); -+ -+ public PacketsData getData(SocketAddress address) { -+ String ip = address.toString(); -+ -+ if (System.currentTimeMillis() - lastClear >= 60000) { -+ packetsData.clear(); -+ this.lastClear = System.currentTimeMillis(); -+ } -+ -+ PacketsData data; -+ -+ if (packetsData.containsKey(ip)) { -+ data = packetsData.get(ip); -+ } else { -+ data = new PacketsData(address); -+ packetsData.put(ip, data); -+ } -+ -+ return data; -+ } -+ -+ public PacketsCheckResult check(SocketAddress socketAddress, ByteBuf byteBuf) { -+ FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); -+ -+ if (!config.isAntibotPacketsEnabled()) { -+ return PacketsCheckResult.NONE; -+ } -+ -+ PacketsData packetsData = getData(socketAddress); -+ int length = byteBuf.readableBytes(); -+ int index = byteBuf.readerIndex(); -+ int packetId = ProtocolUtil.readVarInt(byteBuf); -+ byteBuf.readerIndex(index); -+ -+ packetsData.addVls(length * config.getAntibotPacketsVlsPerByte(), PacketsViolationReason.SIZE, packetId); -+ packetsData.addVls(config.getAntibotPacketsVlsPerPacket(), PacketsViolationReason.RATE, packetId); -+ -+ double vls = packetsData.getPacketsVls(); -+ -+ if (vls >= config.getAntibotPacketsVlsToKick()) { -+ return PacketsCheckResult.KICK; -+ } else if (vls >= config.getAntibotPacketsVlsToCancel()) { -+ return PacketsCheckResult.CANCEL; -+ } else { -+ return PacketsCheckResult.NONE; -+ } -+ } -+ -+ public void printPackets(SocketAddress remoteAddress) { -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java -new file mode 100644 -index 000000000..7189a7f37 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java -@@ -0,0 +1,115 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.Map.Entry; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.enums.PacketsViolationReason; -+ -+public class PacketsData { -+ // The address related to this data -+ private SocketAddress address; -+ -+ // The vls of the current address -+ private double packetsVls = 0; -+ -+ // The vls of the current address because of size -+ private double packetsVlsSize = 0; -+ -+ // The vls of the current address because of rate -+ private double packetsVlsRate = 0; -+ -+ // The last time vls was calculated -+ private long lastVlsCalculated = System.currentTimeMillis(); -+ -+ // The vls by packet ids -+ private Map vlsByPacketId = new HashMap<>(); -+ -+ // If cancellation was printed -+ private boolean cancelPrinted = false; -+ -+ public PacketsData(SocketAddress address) { -+ this.address = address; -+ } -+ -+ public double simplify(double number) { -+ return (double) (int) (number * 1000) / 1000; -+ } -+ -+ public void printKick() { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { -+ System.out -+ .println("[FlameCord] [" + address -+ + "] was kicked because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " -+ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); -+ } -+ } -+ -+ public void printCancel() { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog() && !cancelPrinted) { -+ System.out -+ .println("[FlameCord] [" + address -+ + "] was cancelled because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " -+ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); -+ this.cancelPrinted = true; -+ } -+ } -+ -+ public void printPackets() { -+ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() -+ && simplify(this.packetsVls) > 0) { -+ System.out -+ .println("[FlameCord] [" + address -+ + "] debug is enabled, showing stats (Total: " + simplify(packetsVls) + "vls Size: " -+ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); -+ for (Entry entry : this.vlsByPacketId.entrySet()) { -+ System.out.print(entry.getKey() + "-" + simplify(entry.getValue()) + "vls, "); -+ } -+ System.out.println(""); -+ } -+ } -+ -+ public double getPacketsVls() { -+ if (System.currentTimeMillis() - lastVlsCalculated >= 1000) { -+ printPackets(); -+ -+ this.cancelPrinted = false; -+ this.packetsVls = 0; -+ this.packetsVlsSize = 0; -+ this.packetsVlsRate = 0; -+ this.vlsByPacketId.clear(); -+ this.lastVlsCalculated = System.currentTimeMillis(); -+ } -+ -+ return packetsVls; -+ } -+ -+ public void addVls(double packetsVls, PacketsViolationReason reason, int packetId) { -+ this.packetsVls += packetsVls; -+ this.vlsByPacketId.put(packetId, this.vlsByPacketId.getOrDefault(packetId, 0.0) + packetsVls); -+ -+ switch (reason) { -+ case SIZE: { -+ this.packetsVlsSize += packetsVls; -+ break; -+ } -+ case RATE: { -+ this.packetsVlsRate += packetsVls; -+ break; -+ } -+ default: { -+ break; -+ } -+ } -+ } -+ -+ public double getPacketsVlsSize() { -+ return packetsVlsSize; -+ } -+ -+ public double getPacketsVlsRate() { -+ return packetsVlsRate; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java -new file mode 100644 -index 000000000..68555de34 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java -@@ -0,0 +1,69 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class PasswordCheck { -+ private FlameCordConfiguration config; -+ private AddressDataManager addressDataManager; -+ private LoggerWrapper logger; -+ private String lastNickname = ""; -+ private String lastPassword = ""; -+ private int repeatCount = 0; -+ -+ public PasswordCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ private void updatePassword(final FlameCordConfiguration config, final String nickname, final String password) { -+ if (!nickname.equals(lastNickname)) { -+ if (password.equals(lastPassword)) { -+ if (repeatCount < config.getAntibotPasswordLimit()) { -+ repeatCount++; -+ } -+ } else if (repeatCount > 0) { -+ repeatCount--; -+ } -+ } -+ -+ lastNickname = nickname; -+ lastPassword = password; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress, final String passwordMessage) { -+ if (config.isAntibotPasswordEnabled()) { -+ if (passwordMessage.contains("/login ") || passwordMessage.contains("/l ") -+ || passwordMessage.contains("/register ") -+ || passwordMessage.contains("/reg ")) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ final String nickname = addressData.getLastNickname(); -+ final String password = passwordMessage.split(" ")[1]; -+ -+ updatePassword(config, nickname, password); -+ -+ if (repeatCount >= config.getAntibotPasswordLimit()) { -+ if (config.isAntibotPasswordLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has entered a repeated password", remoteAddress); -+ } -+ -+ if (config.isAntibotPasswordFirewall()) { -+ addressData.firewall("Repeated password"); -+ } -+ -+ return true; -+ } -+ } -+ } -+ -+ return false; -+ } -+ -+ public int getRepeatCount() { -+ return repeatCount; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java -new file mode 100644 -index 000000000..51c1866ec ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java -@@ -0,0 +1,52 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class RatelimitCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private AddressDataManager addressDataManager; -+ -+ public RatelimitCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress, int protocol) { -+ if (config.isAntibotRatelimitEnabled()) { -+ AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ -+ if (config.getAntibotRatelimitWhitelist().contains(addressData.getHostString())) { -+ return false; -+ } -+ -+ if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() -+ || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { -+ if (config.isAntibotRatelimitLog()) { -+ if (protocol == 1) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is pinging too fast", remoteAddress); -+ } else { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is connecting too fast", remoteAddress); -+ } -+ } -+ -+ if (config.isAntibotRatelimitFirewall()) { -+ if (protocol == 1) { -+ addressData.firewall("Too many pings"); -+ } else { -+ addressData.firewall("Too many connections"); -+ } -+ } -+ -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java -new file mode 100644 -index 000000000..d38ffc9e3 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java -@@ -0,0 +1,53 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+import java.net.SocketAddress; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+ -+public class ReconnectCheck { -+ private FlameCordConfiguration config; -+ private LoggerWrapper logger; -+ private AddressDataManager addressDataManager; -+ private int connections = 0; -+ private long lastConnection = 0; -+ -+ public ReconnectCheck(final AddressDataManager addressDataManager) { -+ this.config = FlameCord.getInstance().getFlameCordConfiguration(); -+ this.logger = FlameCord.getInstance().getLoggerWrapper(); -+ this.addressDataManager = addressDataManager; -+ } -+ -+ public boolean check(final SocketAddress remoteAddress) { -+ if (config.isAntibotReconnectEnabled()) { -+ final long currentTime = System.currentTimeMillis(); -+ -+ if (currentTime - lastConnection > config.getAntibotReconnectConnectionThresholdLimit()) { -+ lastConnection = currentTime; -+ connections = 0; -+ } -+ -+ if (++connections > config.getAntibotReconnectConnectionThreshold()) { -+ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); -+ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() -+ || addressData.getTotalPings() < config.getAntibotReconnectPings(); -+ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config -+ .getAntibotReconnectMaxTime(); -+ -+ if (tooSlow) { -+ if (config.isAntibotReconnectLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has to reconnect to join", remoteAddress); -+ } -+ -+ addressData.setTotalConnections(0); -+ return true; -+ } else { -+ return needsAttempts; -+ } -+ } -+ } -+ -+ return false; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java -new file mode 100644 -index 000000000..44d773abe ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java -@@ -0,0 +1,75 @@ -+package dev._2lstudios.flamecord.antibot; -+ -+public class StatsData { -+ // Time of the last second -+ private long lastSecond = System.currentTimeMillis(); -+ -+ // Total pings and connections -+ private int totalPings = 0; -+ private int totalConnections = 0; -+ -+ // Current second connections and pings -+ private int currentPings = 0; -+ private int currentConnections = 0; -+ -+ // Last second connections and pings -+ private int lastPings = 0; -+ private int lastConnections = 0; -+ -+ public void resetData() { -+ // Get current time -+ long currentTime = System.currentTimeMillis(); -+ -+ // Check if one second passed -+ if (currentTime - lastSecond > 1000) { -+ // Set the last second to this one -+ lastSecond = currentTime; -+ -+ // Reset the data -+ lastPings = currentPings; -+ lastConnections = currentConnections; -+ currentPings = 0; -+ currentConnections = 0; -+ } -+ } -+ -+ public void addPing() { -+ resetData(); -+ currentPings++; -+ totalPings++; -+ } -+ -+ public void addConnection() { -+ resetData(); -+ currentConnections++; -+ totalConnections++; -+ } -+ -+ public int getCurrentPings() { -+ resetData(); -+ return currentPings; -+ } -+ -+ public int getCurrentConnections() { -+ resetData(); -+ return currentConnections; -+ } -+ -+ public int getLastPings() { -+ resetData(); -+ return lastPings; -+ } -+ -+ public int getLastConnections() { -+ resetData(); -+ return lastConnections; -+ } -+ -+ public int getTotalPings() { -+ return totalPings; -+ } -+ -+ public int getTotalConnections() { -+ return totalConnections; -+ } -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f6..0f12f4ae6 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,187 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration extends FlameConfig { -+ // Antibot accounts -+ @Getter -+ private boolean antibotAccountsEnabled = true; -+ @Getter -+ private boolean antibotAccountsFirewall = true; -+ @Getter -+ private int antibotAccountsLimit = 3; -+ @Getter -+ private boolean antibotAccountsLog = true; -+ @Getter -+ private Collection antibotAccountsWhitelist = Arrays.asList("Nickname"); -+ -+ // Antibot country -+ @Getter -+ private boolean antibotCountryEnabled = true; -+ @Getter -+ private boolean antibotCountryFirewall = true; -+ @Getter -+ private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); -+ @Getter -+ private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException", "QuietException", "IllegalStateConfig", "FastException"); -+ @Getter -+ private boolean antibotCountryLog = true; -+ -+ // Antibot fastchat -+ @Getter -+ private boolean antibotFastChatEnabled = true; -+ @Getter -+ private boolean antibotFastChatFirewall = true; -+ @Getter -+ private int antibotFastChatTime = 1000; -+ @Getter -+ private boolean antibotFastChatLog = true; -+ -+ // Antibot firewall -+ @Getter -+ private boolean antibotFirewallEnabled = true; -+ @Getter -+ private int antibotFirewallExpire = 60; -+ @Getter -+ private boolean antibotFirewallLog = true; -+ @Getter -+ private boolean antibotFirewallIpset = true; -+ @Getter -+ private Collection antibotFirewallWhitelist = Arrays.asList("127.0.0.1"); -+ -+ // Antibot nickname -+ @Getter -+ private boolean antibotNicknameEnabled = true; -+ @Getter -+ private boolean antibotNicknameFirewall = true; -+ @Getter -+ private Collection antibotNicknameBlacklist = Arrays.asList("mcstorm", "mcdown", "mcbot", "theresa_bot", "dropbot", "kingbot"); -+ @Getter -+ private boolean antibotNicknameLog = true; -+ -+ // Antibot password -+ @Getter -+ private boolean antibotPasswordEnabled = true; -+ @Getter -+ private boolean antibotPasswordFirewall = true; -+ @Getter -+ private int antibotPasswordLimit = 3; -+ @Getter -+ private boolean antibotPasswordLog = true; -+ -+ // Antibot ratelimit -+ @Getter -+ private boolean antibotRatelimitEnabled = true; -+ @Getter -+ private boolean antibotRatelimitFirewall = true; -+ @Getter -+ private int antibotRatelimitConnectionsPerSecond = 3; -+ @Getter -+ private int antibotRatelimitPingsPerSecond = 8; -+ @Getter -+ private boolean antibotRatelimitLog = true; -+ @Getter -+ private Collection antibotRatelimitWhitelist = Arrays.asList("127.0.0.1"); -+ -+ // Antibot reconnect -+ @Getter -+ private boolean antibotReconnectEnabled = true; -+ @Getter -+ private int antibotReconnectAttempts = 2; -+ @Getter -+ private int antibotReconnectPings = 0; -+ @Getter -+ private int antibotReconnectMaxTime = 10000; -+ @Getter -+ private int antibotReconnectConnectionThreshold = 1; -+ @Getter -+ private int antibotReconnectConnectionThresholdLimit = 8000; -+ @Getter -+ private boolean antibotReconnectLog = true; -+ -+ // Antibot packets -+ @Getter -+ private boolean antibotPacketsEnabled = true; -+ @Getter -+ private boolean antibotPacketsLog = true; -+ @Getter -+ private boolean antibotPacketsDebug = false; -+ @Getter -+ private double antibotPacketsVlsPerByte = 0.0017; -+ @Getter -+ private double antibotPacketsVlsPerPacket = 0.1; -+ @Getter -+ private double antibotPacketsVlsToKick = 100; -+ @Getter -+ private double antibotPacketsVlsToCancel = 25; -+ -+ public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { -+ // Antibot accounts -+ this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); -+ this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); -+ this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); -+ this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); -+ this.antibotAccountsWhitelist = setIfUnexistant("antibot.accounts.whitelist", this.antibotAccountsWhitelist, config); -+ -+ // Antibot country -+ this.antibotCountryEnabled = setIfUnexistant("antibot.country.enabled", this.antibotCountryEnabled, config); -+ this.antibotCountryFirewall = setIfUnexistant("antibot.country.firewall", this.antibotCountryFirewall, config); -+ this.antibotCountryBlacklist = setIfUnexistant("antibot.country.blacklist", this.antibotCountryBlacklist, config); -+ this.antibotCountryLog = setIfUnexistant("antibot.country.log", this.antibotCountryLog, config); -+ -+ // Antibot fastchat -+ this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); -+ this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); -+ this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); -+ this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); -+ -+ // Antibot firewall -+ this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); -+ this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); -+ this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); -+ this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); -+ this.antibotFirewallWhitelist = new HashSet<>( setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config )); -+ this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); -+ -+ // Add local server ips to whitelist -+ this.antibotFirewallWhitelist.addAll(whitelistedAddresses); -+ -+ // Antibot nickname -+ this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); -+ this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); -+ this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); -+ this.antibotNicknameLog = setIfUnexistant("antibot.nickname.log", this.antibotNicknameLog, config); -+ -+ // Antibot password -+ this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); -+ this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); -+ this.antibotPasswordLimit = setIfUnexistant("antibot.password.limit", this.antibotPasswordLimit, config); -+ this.antibotPasswordLog = setIfUnexistant("antibot.password.log", this.antibotPasswordLog, config); -+ -+ // Antibot ratelimit -+ this.antibotRatelimitEnabled = setIfUnexistant("antibot.ratelimit.enabled", this.antibotRatelimitEnabled, config); -+ this.antibotRatelimitFirewall = setIfUnexistant("antibot.ratelimit.firewall", this.antibotRatelimitFirewall, config); -+ this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); -+ this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); -+ this.antibotRatelimitLog = setIfUnexistant("antibot.ratelimit.log", this.antibotRatelimitLog, config); -+ this.antibotRatelimitWhitelist = new HashSet<>( setIfUnexistant("antibot.ratelimit.whitelist", this.antibotRatelimitWhitelist, config )); -+ -+ // Antibot reconnect -+ this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); -+ this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); -+ this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); -+ this.antibotReconnectMaxTime = setIfUnexistant("antibot.reconnect.max-time", this.antibotReconnectMaxTime, config); -+ this.antibotReconnectConnectionThreshold = setIfUnexistant("antibot.reconnect.connection-threshold", this.antibotReconnectConnectionThreshold, config); -+ this.antibotReconnectConnectionThresholdLimit = setIfUnexistant("antibot.reconnect.connection-threshold-limit", this.antibotReconnectConnectionThresholdLimit, config); -+ this.antibotReconnectLog = setIfUnexistant("antibot.reconnect.log", this.antibotReconnectLog, config); -+ -+ // Antibot packets -+ this.antibotPacketsEnabled = setIfUnexistant("antibot.packets.enabled", this.antibotPacketsEnabled, config); -+ this.antibotPacketsLog = setIfUnexistant("antibot.packets.log", this.antibotPacketsLog, config); -+ this.antibotPacketsDebug = setIfUnexistant("antibot.packets.debug", this.antibotPacketsDebug, config); -+ this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); -+ this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); -+ this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); -+ } -+ - // FlameCord - TCP Fast Open - @Getter - private int tcpFastOpen = 3; -@@ -132,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); - - this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); -+ -+ // FlameCord - Antibot System -+ loadAntibot(configuration, whitelistedAddresses); - - save(configuration, configurationFile); - } -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae1794385..6175d8e2d 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -80,6 +80,22 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); - setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); - -+ // FlameCord start - Antibot System -+ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -+ -+ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); -+ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); -+ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); -+ // FlameCord end - Antibot System -+ - for (final String key : configuration.getKeys()) { - final Object value = configuration.get(key); - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java -new file mode 100644 -index 000000000..285810ea1 ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java -@@ -0,0 +1,5 @@ -+package dev._2lstudios.flamecord.enums; -+ -+public enum PacketsCheckResult { -+ KICK, CANCEL, NONE -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java -new file mode 100644 -index 000000000..c19c4965d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java -@@ -0,0 +1,5 @@ -+package dev._2lstudios.flamecord.enums; -+ -+public enum PacketsViolationReason { -+ SIZE, RATE -+} -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java -new file mode 100644 -index 000000000..7f26e7a0d ---- /dev/null -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java -@@ -0,0 +1,27 @@ -+package dev._2lstudios.flamecord.utils; -+ -+import io.netty.buffer.ByteBuf; -+ -+public class ProtocolUtil { -+ private static int SEGMENT_BITS = 0x7F; -+ private static int CONTINUE_BIT = 0x80; -+ -+ public static int readVarInt(ByteBuf byteBuf) { -+ int value = 0; -+ int position = 0; -+ byte currentByte; -+ -+ while (byteBuf.isReadable()) { -+ currentByte = byteBuf.readByte(); -+ value |= (currentByte & SEGMENT_BITS) << position; -+ -+ if ((currentByte & CONTINUE_BIT) == 0) break; -+ -+ position += 7; -+ -+ if (position >= 32) throw new RuntimeException("VarInt is too big"); -+ } -+ -+ return value; -+ } -+} -\ No newline at end of file -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f7..aa538f748 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder - throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); - } - } -+ -+ // FlameCord start - Antibot Packet Check -+ if (prot == protocol.TO_SERVER) { -+ dev._2lstudios.flamecord.antibot.PacketsCheck packetsCheck = FlameCord.getInstance().getCheckManager().getPacketsCheck(); -+ dev._2lstudios.flamecord.enums.PacketsCheckResult result = packetsCheck.check(ctx.channel().remoteAddress(), in); -+ -+ switch (result) { -+ case KICK: -+ packetsCheck.getData(ctx.channel().remoteAddress()).printKick(); -+ -+ in.skipBytes(in.readableBytes()); -+ ctx.close(); -+ return; -+ case CANCEL: -+ packetsCheck.getData(ctx.channel().remoteAddress()).printCancel(); -+ -+ in.skipBytes(in.readableBytes()); -+ return; -+ default: -+ break; -+ } -+ } -+ // FlameCord end - Antibot Packet Check - - ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy - - Object packetTypeInfo = null; - try - { -+ // FlameCord - Duplicate buf instead of Copy -+ slice = in.duplicate(); // Can't slice this one due to EntityMap :( -+ - // Waterfall start - if (in.readableBytes() == 0 && !server) { - return; -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 -index c9e45b915..022f94b2d 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -723,4 +723,8 @@ public enum Protocol - // Waterfall end - } - } -+ -+ public DirectionData getToServer() { -+ return TO_SERVER; -+ } - } -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d371426..403ccba98 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -@@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; - import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.ByteToMessageDecoder; - import io.netty.handler.codec.CorruptedFrameException; -+ - import java.util.List; - - public class Varint21FrameDecoder extends ByteToMessageDecoder - { -- - private static boolean DIRECT_WARNING; - - @Override -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee0..173b47f33 100644 ---- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -@@ -4,6 +4,7 @@ import java.util.Collection; - import java.util.HashSet; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.antibot.StatsData; - import dev._2lstudios.flamecord.configuration.MessagesConfiguration; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.api.CommandSender; -@@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; - - if (sender.hasPermission("flamecord.usage")) { - if (args.length > 0) { -- final String arg0 = args[0]; -- -- switch (arg0) { -+ switch (args[0]) { - case "reload": { - // FlameCord - Collect ips from servers - final Collection whitelistedAddresses = new HashSet<>(); -@@ -43,9 +42,44 @@ private final BungeeCord bungeeCord; - .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); - break; - } -+ case "stats": { -+ StatsData statsData = FlameCord.getInstance().getStatsData(); -+ int totalPings = statsData.getTotalPings(); -+ int totalConnections = statsData.getTotalConnections(); -+ int lastPings = statsData.getLastPings(); -+ int lastConnections = statsData.getLastConnections(); -+ -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, lastPings, lastConnections))); -+ break; -+ } -+ case "firewall": { -+ if (args.length > 2) { -+ String ip = args[2]; -+ -+ switch (args[1]) { -+ case "add": { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).firewall("Blacklisted by command"); -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_add", ip))); -+ break; -+ } -+ case "remove": { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).unfirewall(); -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_remove", ip))); -+ break; -+ } -+ default: { -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); -+ break; -+ } -+ } -+ } else { -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); -+ } -+ -+ break; -+ } - default: { -- sender.sendMessage(TextComponent.fromLegacyText( -- messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); -+ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); - break; - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8994454c7..62712330e 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer - } catch (InterruptedException ignored) {} - } - -+ // FlameCord start - Antibot System -+ FlameCord.getInstance().shutdown(); -+ getLogger().info( "Shutting down FlameCord linux command thread" ); -+ // FlameCord end - Antibot System -+ - getLogger().info( "Thank you and goodbye" ); - // Need to close loggers after last message! - org.apache.logging.log4j.LogManager.shutdown(); // Waterfall -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 58be68b02..b88e64526 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 -@@ -22,8 +22,8 @@ import javax.crypto.SecretKey; - import javax.crypto.spec.SecretKeySpec; - - import dev._2lstudios.flamecord.FlameCord; -- --import dev._2lstudios.flamecord.configuration.FlameConfig; -+import dev._2lstudios.flamecord.antibot.AddressData; -+import dev._2lstudios.flamecord.antibot.CheckManager; - import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; - import lombok.Getter; - import lombok.RequiredArgsConstructor; -@@ -412,6 +412,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(Handshake handshake) throws Exception - { - Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ -+ // FlameCord start - Antibot System -+ // Close and firewall on invalid protocol -+ int protocol = handshake.getRequestedProtocol(); -+ -+ if (protocol != 1 && protocol != 2) { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Invalid handshake protocol"); -+ } -+ -+ ch.close(); -+ return; -+ } -+ // FlameCord end - Antibot System -+ - this.handshake = handshake; - ch.setVersion( handshake.getProtocolVersion() ); - ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - return; - } - -+ // FlameCord start - Antibot System -+ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); -+ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); -+ // FlameCord end - Antibot System -+ - switch ( handshake.getRequestedProtocol() ) - { - case 1: -@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - thisState = State.STATUS; - ch.setProtocol( Protocol.STATUS ); -+ -+ // FlameCord start - Antibot System -+ addressData.addPing(); -+ -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); -+ return; -+ } -+ // FlameCord end - Antibot System -+ - break; - case 2: - // Login -@@ -464,6 +496,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection - thisState = State.USERNAME; - ch.setProtocol( Protocol.LOGIN ); - -+ // FlameCord start - Antibot System -+ addressData.addConnection(); -+ -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); -+ return; -+ } -+ // FlameCord end - Antibot System -+ - if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) - { - if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -527,6 +569,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection - return; - } - -+ // FlameCord start - Antibot System -+ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); -+ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); -+ String nickname = loginRequest.getData(); -+ -+ addressData.addNickname( nickname ); -+ -+ if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress(), nickname ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); -+ return; -+ } -+ -+ if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); -+ return; -+ } -+ -+ if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); -+ return; -+ } -+ -+ if ( checkManager.getCountryCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); -+ return; -+ } -+ // FlameCord end - Antibot System -+ - // If offline mode and they are already on, don't allow connect - // We can just check by UUID here as names are based on UUID - if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) -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 66332af4e..c16e28c80 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,11 +4,15 @@ 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 dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.antibot.CheckManager; - import io.netty.channel.Channel; - import java.util.ArrayList; - import java.util.LinkedList; - import java.util.List; - import java.util.UUID; -+ - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.ServerConnection.KeepAliveData; - import net.md_5.bungee.UserConnection; -@@ -207,6 +211,22 @@ public class UpstreamBridge extends PacketHandler - } - Preconditions.checkArgument(!empty, "Chat message is empty"); - -+ // FlameCord start - Antibot System -+ final CheckManager checkManager = FlameCord.getInstance().getCheckManager(); -+ -+ if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) -+ { -+ con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); -+ throw CancelSendSignal.INSTANCE; -+ } -+ -+ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), message ) ) -+ { -+ con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); -+ throw CancelSendSignal.INSTANCE; -+ } -+ // FlameCord end - Antibot System -+ - ChatEvent chatEvent = new ChatEvent( con, con.getServer(), message ); - if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) - { -diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e4..1e3608fa4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -@@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; - import io.netty.handler.codec.http.HttpResponseStatus; - import io.netty.handler.codec.http.LastHttpContent; - import java.nio.charset.Charset; -+import java.util.logging.Level; -+ -+import dev._2lstudios.flamecord.FlameCord; - import lombok.RequiredArgsConstructor; -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.api.Callback; - - @RequiredArgsConstructor -@@ -21,6 +25,15 @@ public class HttpHandler extends SimpleChannelInboundHandler - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception - { -+ // Flamecord start - Antibot System -+ String reason = cause.getClass().getSimpleName(); -+ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); -+ } -+ // Flamecord end - Antibot System -+ - try - { - callback.done( null, cause ); -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b3fa48355..6f1d8336d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -154,4 +154,11 @@ public class ChannelWrapper - pipeline.remove( "decompress" ); - } - } -+ -+ // FlameCord start - Antibot System -+ // Make the channel accessible -+ public Channel getChannel() { -+ return ch; -+ } -+ // FlameCord end - Antibot System - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..3fce5ff11 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; - import java.io.IOException; - import java.net.InetSocketAddress; - import java.util.logging.Level; -+ -+import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.api.ProxyServer; - import net.md_5.bungee.connection.CancelSendSignal; - import net.md_5.bungee.connection.InitialHandler; -@@ -146,6 +148,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception - { -+ // Flamecord start - Antibot System -+ String reason = cause.getClass().getSimpleName(); -+ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) -+ { -+ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); -+ } -+ // Flamecord end - Antibot System -+ - if ( ctx.channel().isActive() ) - { - boolean logExceptions = !( handler instanceof PingHandler ); -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 ffea15992..f04fdd9ce 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 -@@ -59,6 +59,20 @@ public class PipelineUtils - { - SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); - -+ // FlameCord start - Antibot System -+ String firewallReason = FlameCord.getInstance().getAddressDataManager().getAddressData(ch.remoteAddress()).getFirewallReason(); -+ if ( firewallReason != null ) -+ { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) -+ { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); -+ } -+ -+ ch.close(); -+ return; -+ } -+ // FlameCord end - Antibot System -+ - if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) - { - ch.close(); --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch deleted file mode 100644 index 2f46e925..00000000 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 1e3a2975964623026cc90326efc27ccafb47ae51 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Fri, 4 Mar 2022 14:09:35 -0300 -Subject: [PATCH] Allow Invalid Names - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 0f12f4ae6..6f463b9c6 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; - import net.md_5.bungee.config.ConfigurationProvider; - - public class FlameCordConfiguration extends FlameConfig { -+ // FlameCord - Allow Invalid Names -+ @Getter -+ private boolean allowInvalidNames = false; -+ - // Antibot accounts - @Getter - private boolean antibotAccountsEnabled = true; -@@ -317,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { - // FlameCord - Antibot System - loadAntibot(configuration, whitelistedAddresses); - -+ // FlameCord - Allow Invalid Names -+ this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); -+ - save(configuration, configurationFile); - } - } -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 b88e64526..e8c14c552 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 -@@ -528,7 +528,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); - -- if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) -+ if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) - { - disconnect( bungee.getTranslation( "name_invalid" ) ); - return; --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch deleted file mode 100644 index d80f3dbc..00000000 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ /dev/null @@ -1,3240 +0,0 @@ -From 1a4b10d4833f4c2c0f827ed75897f5187e6ec8ed Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Thu, 10 Mar 2022 20:23:55 -0300 -Subject: [PATCH] Disable entity Metadata Rewrite - - -diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index 469fe0e1..97bd384b 100644 ---- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -+++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -@@ -251,11 +251,6 @@ public interface ProxyConfig - */ - boolean isDisableModernTabLimiter(); - -- /** -- * @return Should we disable entity metadata rewriting? -- */ -- boolean isDisableEntityMetadataRewrite(); -- - /** - * Whether tablist rewriting should be disabled or not - * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise -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 -index 0c334afc..88865b85 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java -@@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; - import net.md_5.bungee.protocol.packet.Commands; - import net.md_5.bungee.protocol.packet.EncryptionRequest; - import net.md_5.bungee.protocol.packet.EncryptionResponse; --import net.md_5.bungee.protocol.packet.EntityEffect; // Waterfall --import net.md_5.bungee.protocol.packet.EntityRemoveEffect; // Waterfall - import net.md_5.bungee.protocol.packet.EntityStatus; - import net.md_5.bungee.protocol.packet.GameState; - import net.md_5.bungee.protocol.packet.Handshake; -@@ -225,14 +223,4 @@ public abstract class AbstractPacketHandler - public void handle(ServerData serverData) throws Exception - { - } -- -- // Waterfall start -- public void handle(EntityEffect entityEffect) throws Exception -- { -- } -- -- public void handle(EntityRemoveEffect removeEffect) throws Exception -- { -- } -- // Waterfall end - } -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 -index 022f94b2..970011e8 100644 ---- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; - import net.md_5.bungee.protocol.packet.EncryptionResponse; - import net.md_5.bungee.protocol.packet.EntityStatus; - import net.md_5.bungee.protocol.packet.GameState; --import net.md_5.bungee.protocol.packet.EntityEffect; --import net.md_5.bungee.protocol.packet.EntityRemoveEffect; - import net.md_5.bungee.protocol.packet.Handshake; - import net.md_5.bungee.protocol.packet.KeepAlive; - import net.md_5.bungee.protocol.packet.Kick; -@@ -140,20 +138,6 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), - map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) - ); -- // Waterfall start -- TO_CLIENT.registerPacket( -- EntityEffect.class, -- EntityEffect::new, -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support -- map(ProtocolConstants.MINECRAFT_1_9, -1) -- ); -- TO_CLIENT.registerPacket( -- EntityRemoveEffect.class, -- EntityRemoveEffect::new, -- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support -- map(ProtocolConstants.MINECRAFT_1_9, -1) -- ); -- // Waterfall end - TO_CLIENT.registerPacket( - PlayerListItem.class, // PlayerInfo - PlayerListItem::new, -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -deleted file mode 100644 -index 0ed78a8c..00000000 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -+++ /dev/null -@@ -1,67 +0,0 @@ --package net.md_5.bungee.protocol.packet; -- --import io.netty.buffer.ByteBuf; --import lombok.AllArgsConstructor; --import lombok.Data; --import lombok.EqualsAndHashCode; --import lombok.NoArgsConstructor; --import net.md_5.bungee.protocol.AbstractPacketHandler; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --@Data --@NoArgsConstructor --@AllArgsConstructor --@EqualsAndHashCode(callSuper = false) --public class EntityEffect extends DefinedPacket { -- -- private int entityId; -- private int effectId; -- private int amplifier; -- private int duration; -- private boolean hideParticles; -- -- @Override -- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support -- this.effectId = buf.readUnsignedByte(); -- this.amplifier = buf.readUnsignedByte(); -- this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support -- // FlameCord start - 1.7.x support -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) -- { -- this.hideParticles = buf.readBoolean(); -- } -- // FlameCord end - 1.7.x support -- } -- -- @Override -- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -- // FlameCord start - 1.7.x support -- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -- { -- writeVarInt(this.entityId, buf); -- } else -- { -- buf.writeInt(effectId); -- } -- // FlameCord end - 1.7.x support -- buf.writeByte(this.effectId); -- buf.writeByte(this.amplifier); -- // FlameCord start - 1.7.x support -- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -- { -- writeVarInt(this.duration, buf); -- } else -- { -- buf.writeShort(duration); -- } -- // FlameCord end - 1.7.x support -- buf.writeBoolean(this.hideParticles); -- } -- -- @Override -- public void handle(AbstractPacketHandler handler) throws Exception { -- handler.handle(this); -- } --} -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -deleted file mode 100644 -index 435b8578..00000000 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -+++ /dev/null -@@ -1,45 +0,0 @@ --package net.md_5.bungee.protocol.packet; -- --import io.netty.buffer.ByteBuf; --import lombok.AllArgsConstructor; --import lombok.Data; --import lombok.EqualsAndHashCode; --import lombok.NoArgsConstructor; --import net.md_5.bungee.protocol.AbstractPacketHandler; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --@Data --@NoArgsConstructor --@AllArgsConstructor --@EqualsAndHashCode(callSuper = false) --public class EntityRemoveEffect extends DefinedPacket { -- -- private int entityId; -- private int effectId; -- -- @Override -- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support -- this.effectId = buf.readUnsignedByte(); -- } -- -- @Override -- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { -- // FlameCord start - 1.7.x support -- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) -- { -- writeVarInt(this.entityId, buf); -- } else -- { -- buf.writeInt(entityId); -- } -- // FlameCord end - 1.7.x support -- buf.writeByte(effectId); -- } -- -- @Override -- public void handle(AbstractPacketHandler handler) throws Exception { -- handler.handle(this); -- } --} -diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 966d2442..be337a68 100644 ---- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { - private int tabThrottle = 1000; - private boolean disableModernTabLimiter = true; - -- private boolean disableEntityMetadataRewrite = false; - private boolean disableTabListRewrite = true; - - /* -@@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { - // Throttling options - tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); - disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter); -- disableEntityMetadataRewrite = config.getBoolean("disable_entity_metadata_rewrite", disableEntityMetadataRewrite); - disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite); - pluginChannelLimit = config.getInt("registered_plugin_channels_limit", pluginChannelLimit); - pluginChannelNameLimit = config.getInt("plugin_channel_name_limit", pluginChannelNameLimit); -@@ -105,11 +103,6 @@ public class WaterfallConfiguration extends Configuration { - return disableModernTabLimiter; - } - -- @Override -- public boolean isDisableEntityMetadataRewrite() { -- return disableEntityMetadataRewrite; -- } -- - @Override - public boolean isDisableTabListRewrite() { - return disableTabListRewrite; -diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a07c7c8..f51c668d 100644 ---- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler - ch.write( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:register" : "REGISTER", Joiner.on( "\0" ).join( registeredChannels ).getBytes( StandardCharsets.UTF_8 ), false ) ); - } - -- if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null ) -- { -- ch.write( user.getSettings() ); -- } -- - if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla - { - user.getForgeClientHandler().setHandshakeComplete(); -@@ -308,20 +303,6 @@ public class ServerConnector extends PacketHandler - user.getTabListHandler().onServerChange(); - - Scoreboard serverScoreboard = user.getServerSentScoreboard(); -- if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall -- for ( Objective objective : serverScoreboard.getObjectives() ) -- { -- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support -- } -- for ( Score score : serverScoreboard.getScores() ) -- { -- user.unsafe().sendPacket( new ScoreboardScore( score.getItemName(), (byte) 1, score.getScoreName(), score.getValue() ) ); -- } -- for ( Team team : serverScoreboard.getTeams() ) -- { -- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.Team( team.getName() ) ); -- } -- } // Waterfall - serverScoreboard.clear(); - - for ( UUID bossbar : user.getSentBossBars() ) -@@ -340,33 +321,27 @@ public class ServerConnector extends PacketHandler - } - - user.setDimensionChange( true ); -- if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer -- { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -- } - - user.setServerEntityId( login.getEntityId() ); - - // Waterfall start -- if ( user.isDisableEntityMetadataRewrite() ) { -- // Ensure that we maintain consistency -- user.setClientEntityId( login.getEntityId() ); -+ // Ensure that we maintain consistency -+ user.setClientEntityId( login.getEntityId() ); - -- // Only send if we are not in the same dimension -- if ( login.getDimension() != user.getDimension() ) // Waterfall - defer -- { -- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -- } -+ // Only send if we are not in the same dimension -+ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer -+ { -+ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -+ } - -- Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); -- user.unsafe().sendPacket(modLogin); -+ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); -+ user.unsafe().sendPacket(modLogin); - -- // Only send if we're in the same dimension -- if ( login.getDimension() == user.getDimension() ) // Waterfall - defer -- { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -- } -+ // Only send if we're in the same dimension -+ if ( login.getDimension() == user.getDimension() ) // Waterfall - defer -+ { -+ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); - } - // Waterfall end - user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -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 90922797..f3d60253 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; - import net.md_5.bungee.api.score.Scoreboard; - import net.md_5.bungee.chat.ComponentSerializer; - import net.md_5.bungee.connection.InitialHandler; --import net.md_5.bungee.entitymap.EntityMap; - import net.md_5.bungee.forge.ForgeClientHandler; - import net.md_5.bungee.forge.ForgeConstants; - import net.md_5.bungee.forge.ForgeServerHandler; -@@ -137,8 +136,6 @@ public final class UserConnection implements ProxiedPlayer - /*========================================================================*/ - @Getter - private String displayName; -- @Getter -- private EntityMap entityRewrite; - private Locale locale; - /*========================================================================*/ - @Getter -@@ -159,8 +156,6 @@ public final class UserConnection implements ProxiedPlayer - - public void init() - { -- this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); -- - this.displayName = name; - - tabListHandler = new ServerUnique( this ); -@@ -794,10 +789,4 @@ public final class UserConnection implements ProxiedPlayer - { - return serverSentScoreboard; - } -- -- // Waterfall start -- public boolean isDisableEntityMetadataRewrite() { -- return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE; -- } -- // Waterfall end - } -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 -index 0ac22ad3..6e425764 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java -@@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; - import net.md_5.bungee.api.score.Scoreboard; - import net.md_5.bungee.api.score.Team; - import net.md_5.bungee.chat.ComponentSerializer; --import net.md_5.bungee.entitymap.EntityMap; - import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.PacketHandler; - import net.md_5.bungee.protocol.DefinedPacket; -@@ -54,8 +53,6 @@ import net.md_5.bungee.protocol.PacketWrapper; - import net.md_5.bungee.protocol.ProtocolConstants; - import net.md_5.bungee.protocol.packet.BossBar; - import net.md_5.bungee.protocol.packet.Commands; --import net.md_5.bungee.protocol.packet.EntityEffect; --import net.md_5.bungee.protocol.packet.EntityRemoveEffect; - import net.md_5.bungee.protocol.packet.KeepAlive; - import net.md_5.bungee.protocol.packet.Kick; - import net.md_5.bungee.protocol.packet.PlayerListItem; -@@ -150,11 +147,6 @@ public class DownstreamBridge extends PacketHandler - @Override - public void handle(PacketWrapper packet) throws Exception - { -- EntityMap rewrite = con.getEntityRewrite(); -- if ( rewrite != null ) -- { -- rewrite.rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId(), con.getPendingConnection().getVersion() ); -- } - con.sendPacket( packet ); - } - -@@ -705,34 +697,6 @@ public class DownstreamBridge extends PacketHandler - } - } - -- // Waterfall start -- @Override -- public void handle(EntityEffect entityEffect) throws Exception -- { -- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall -- // Don't send any potions when switching between servers (which involves a handshake), which can trigger a race -- // condition on the client. -- if (this.con.getForgeClientHandler().isForgeUser() && !this.con.getForgeClientHandler().isHandshakeComplete()) { -- throw CancelSendSignal.INSTANCE; -- } -- con.getPotions().put(rewriteEntityId(entityEffect.getEntityId()), entityEffect.getEffectId()); -- } -- -- @Override -- public void handle(EntityRemoveEffect removeEffect) throws Exception -- { -- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall -- con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId()); -- } -- -- private int rewriteEntityId(int entityId) { -- if (entityId == con.getServerEntityId()) { -- return con.getClientEntityId(); -- } -- return entityId; -- } -- // Waterfall end -- - @Override - public void handle(Respawn respawn) - { -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 c16e28c8..5a7f3880 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 -@@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; - import net.md_5.bungee.api.event.PluginMessageEvent; - import net.md_5.bungee.api.event.SettingsChangedEvent; - import net.md_5.bungee.api.event.TabCompleteEvent; --import net.md_5.bungee.entitymap.EntityMap; - import net.md_5.bungee.forge.ForgeConstants; - import net.md_5.bungee.netty.ChannelWrapper; - import net.md_5.bungee.netty.PacketHandler; -@@ -144,11 +143,6 @@ public class UpstreamBridge extends PacketHandler - { - if ( con.getServer() != null ) - { -- EntityMap rewrite = con.getEntityRewrite(); -- if ( rewrite != null ) -- { -- rewrite.rewriteServerbound( packet.buf, con.getClientEntityId(), con.getServerEntityId(), con.getPendingConnection().getVersion() ); -- } - con.getServer().getCh().write( packet ); - } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -deleted file mode 100644 -index 688ff72d..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -+++ /dev/null -@@ -1,372 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import io.netty.buffer.ByteBufInputStream; --import java.io.DataInputStream; --import lombok.AccessLevel; --import lombok.NoArgsConstructor; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; --import se.llbit.nbt.NamedTag; --import se.llbit.nbt.Tag; -- --/** -- * Class to rewrite integers within packets. -- */ --@NoArgsConstructor(access = AccessLevel.PACKAGE) --public abstract class EntityMap --{ -- -- private final boolean[] clientboundInts = new boolean[ 256 ]; -- private final boolean[] clientboundVarInts = new boolean[ 256 ]; -- -- private final boolean[] serverboundInts = new boolean[ 256 ]; -- private final boolean[] serverboundVarInts = new boolean[ 256 ]; -- -- // Returns the correct entity map for the protocol version -- public static EntityMap getEntityMap(int version) -- { -- // Waterfall start -- if (net.md_5.bungee.api.ProxyServer.getInstance().getConfig().isDisableEntityMetadataRewrite()) { -- return EntityMap_Dummy.INSTANCE; -- } -- // Waterfall end -- switch ( version ) -- { -- // FlameCord start - 1.7.x support -- case ProtocolConstants.MINECRAFT_1_7_2: -- return EntityMap_1_7_2.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_7_6: -- return EntityMap_1_7_6.INSTANCE; -- // FlameCord end - 1.7.x support -- case ProtocolConstants.MINECRAFT_1_8: -- return EntityMap_1_8.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_9: -- case ProtocolConstants.MINECRAFT_1_9_1: -- case ProtocolConstants.MINECRAFT_1_9_2: -- return EntityMap_1_9.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_9_4: -- return EntityMap_1_9_4.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_10: -- return EntityMap_1_10.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_11: -- case ProtocolConstants.MINECRAFT_1_11_1: -- return EntityMap_1_11.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_12: -- return EntityMap_1_12.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_12_1: -- case ProtocolConstants.MINECRAFT_1_12_2: -- return EntityMap_1_12_1.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_13: -- case ProtocolConstants.MINECRAFT_1_13_1: -- case ProtocolConstants.MINECRAFT_1_13_2: -- return EntityMap_1_13.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_14: -- case ProtocolConstants.MINECRAFT_1_14_1: -- case ProtocolConstants.MINECRAFT_1_14_2: -- case ProtocolConstants.MINECRAFT_1_14_3: -- case ProtocolConstants.MINECRAFT_1_14_4: -- return EntityMap_1_14.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_15: -- case ProtocolConstants.MINECRAFT_1_15_1: -- case ProtocolConstants.MINECRAFT_1_15_2: -- return EntityMap_1_15.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_16: -- case ProtocolConstants.MINECRAFT_1_16_1: -- return EntityMap_1_16.INSTANCE; -- case ProtocolConstants.MINECRAFT_1_16_2: -- case ProtocolConstants.MINECRAFT_1_16_3: -- case ProtocolConstants.MINECRAFT_1_16_4: -- return EntityMap_1_16_2.INSTANCE_1_16_2; -- case ProtocolConstants.MINECRAFT_1_17: -- case ProtocolConstants.MINECRAFT_1_17_1: -- return EntityMap_1_16_2.INSTANCE_1_17; -- case ProtocolConstants.MINECRAFT_1_18: -- case ProtocolConstants.MINECRAFT_1_18_2: -- return EntityMap_1_16_2.INSTANCE_1_18; -- case ProtocolConstants.MINECRAFT_1_19: -- return EntityMap_1_16_2.INSTANCE_1_19; -- case ProtocolConstants.MINECRAFT_1_19_1: -- case ProtocolConstants.MINECRAFT_1_19_3: -- return EntityMap_1_16_2.INSTANCE_1_19_1; -- } -- throw new RuntimeException( "Version " + version + " has no entity map" ); -- } -- -- protected void addRewrite(int id, ProtocolConstants.Direction direction, boolean varint) -- { -- if ( direction == ProtocolConstants.Direction.TO_CLIENT ) -- { -- if ( varint ) -- { -- clientboundVarInts[id] = true; -- } else -- { -- clientboundInts[id] = true; -- } -- } else if ( varint ) -- { -- serverboundVarInts[id] = true; -- } else -- { -- serverboundInts[id] = true; -- } -- } -- -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- rewrite( packet, oldId, newId, serverboundInts, serverboundVarInts ); -- } -- -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- rewriteServerbound( packet, oldId, newId ); -- } -- -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- rewrite( packet, oldId, newId, clientboundInts, clientboundVarInts ); -- } -- -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- rewriteClientbound( packet, oldId, newId ); -- } -- -- protected static void rewriteInt(ByteBuf packet, int oldId, int newId, int offset) -- { -- int readId = packet.getInt( offset ); -- if ( readId == oldId ) -- { -- packet.setInt( offset, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( offset, oldId ); -- } -- } -- -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- protected static void rewriteVarInt(ByteBuf packet, int oldId, int newId, int offset) -- { -- // Need to rewrite the packet because VarInts are variable length -- int readId = DefinedPacket.readVarInt( packet ); -- int readIdLength = packet.readerIndex() - offset; -- if ( readId == oldId || readId == newId ) -- { -- ByteBuf data = packet.copy(); -- -- try { -- packet.readerIndex( offset ); -- packet.writerIndex( offset ); -- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); -- packet.writeBytes( data ); -- } finally { -- data.release(); -- } -- } -- } -- -- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex) -- { -- rewriteMetaVarInt( packet, oldId, newId, metaIndex, -1 ); -- } -- -- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex, int protocolVersion) -- { -- int readerIndex = packet.readerIndex(); -- -- short index; -- while ( ( index = packet.readUnsignedByte() ) != 0xFF ) -- { -- int type = DefinedPacket.readVarInt( packet ); -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) -- { -- switch ( type ) -- { -- case 5: // optional chat -- if ( packet.readBoolean() ) -- { -- DefinedPacket.readString( packet ); -- } -- continue; -- case 15: // particle -- int particleId = DefinedPacket.readVarInt( packet ); -- -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 ) -- { -- switch ( particleId ) -- { -- case 3: // minecraft:block -- case 23: // minecraft:falling_dust -- DefinedPacket.readVarInt( packet ); // block state -- break; -- case 14: // minecraft:dust -- packet.skipBytes( 16 ); // float, float, float, flat -- break; -- case 32: // minecraft:item -- readSkipSlot( packet, protocolVersion ); -- break; -- } -- } else -- { -- switch ( particleId ) -- { -- case 3: // minecraft:block -- case 20: // minecraft:falling_dust -- DefinedPacket.readVarInt( packet ); // block state -- break; -- case 11: // minecraft:dust -- packet.skipBytes( 16 ); // float, float, float, flat -- break; -- case 27: // minecraft:item -- readSkipSlot( packet, protocolVersion ); -- break; -- } -- } -- continue; -- default: -- if ( type >= 6 ) -- { -- type--; -- } -- break; -- } -- } -- -- switch ( type ) -- { -- case 0: -- packet.skipBytes( 1 ); // byte -- break; -- case 1: -- if ( index == metaIndex ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, position ); -- packet.readerIndex( position ); -- } -- DefinedPacket.readVarInt( packet ); -- break; -- case 2: -- packet.skipBytes( 4 ); // float -- break; -- case 3: -- case 4: -- DefinedPacket.readString( packet ); -- break; -- case 5: -- readSkipSlot( packet, protocolVersion ); -- break; -- case 6: -- packet.skipBytes( 1 ); // boolean -- break; -- case 7: -- packet.skipBytes( 12 ); // float, float, float -- break; -- case 8: -- packet.readLong(); -- break; -- case 9: -- if ( packet.readBoolean() ) -- { -- packet.skipBytes( 8 ); // long -- } -- break; -- case 10: -- DefinedPacket.readVarInt( packet ); -- break; -- case 11: -- if ( packet.readBoolean() ) -- { -- packet.skipBytes( 16 ); // long, long -- } -- break; -- case 12: -- DefinedPacket.readVarInt( packet ); -- break; -- case 13: -- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); -- if ( tag.isError() ) -- { -- throw new RuntimeException( tag.error() ); -- } -- break; -- case 15: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readVarInt( packet ); -- break; -- case 16: -- if ( index == metaIndex ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId + 1, newId + 1, position ); -- packet.readerIndex( position ); -- } -- DefinedPacket.readVarInt( packet ); -- break; -- case 17: -- DefinedPacket.readVarInt( packet ); -- break; -- default: -- // Waterfall start - Don't lie -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) -- { -- type++; -- } -- throw new IllegalArgumentException( "Unknown meta type " + type + ": Using mods? refer to disable_entity_metadata_rewrite in waterfall.yml" ); -- // Waterfall end -- } -- } -- -- packet.readerIndex( readerIndex ); -- } -- -- private static void readSkipSlot(ByteBuf packet, int protocolVersion) -- { -- if ( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) ? packet.readBoolean() : packet.readShort() != -1 ) -- { -- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) -- { -- DefinedPacket.readVarInt( packet ); -- } -- packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short -- -- int position = packet.readerIndex(); -- if ( packet.readByte() != 0 ) -- { -- packet.readerIndex( position ); -- -- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); -- if ( tag.isError() ) -- { -- throw new RuntimeException( tag.error() ); -- } -- } -- } -- } -- -- // Handles simple packets -- private static void rewrite(ByteBuf packet, int oldId, int newId, boolean[] ints, boolean[] varints) -- { -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if (packetId < 0 || packetId > ints.length || packetId > varints.length) { // Invalid packet id -- // Ignore these invalid packets for compatibility reasons -- packet.readerIndex( readerIndex ); -- return; -- } -- -- if ( ints[packetId] ) -- { -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength ); -- } else if ( varints[packetId] ) -- { -- rewriteVarInt( packet, oldId, newId, readerIndex + packetIdLength ); -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java -deleted file mode 100644 -index 6db530c3..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java -+++ /dev/null -@@ -1,182 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_10 extends EntityMap --{ -- -- static final EntityMap_1_10 INSTANCE = new EntityMap_1_10(); -- -- EntityMap_1_10() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount -- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x48 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x40 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java -deleted file mode 100644 -index 36822127..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java -+++ /dev/null -@@ -1,183 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_11 extends EntityMap --{ -- -- static final EntityMap_1_11 INSTANCE = new EntityMap_1_11(); -- -- EntityMap_1_11() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount -- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x48 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x40 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java -deleted file mode 100644 -index 38e12ce4..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java -+++ /dev/null -@@ -1,183 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_12 extends EntityMap --{ -- -- static final EntityMap_1_12 INSTANCE = new EntityMap_1_12(); -- -- EntityMap_1_12() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x32, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x35, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3C /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x4A /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x42 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x31 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x3B /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java -deleted file mode 100644 -index 5f296839..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java -+++ /dev/null -@@ -1,183 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_12_1 extends EntityMap --{ -- -- static final EntityMap_1_12_1 INSTANCE = new EntityMap_1_12_1(); -- -- EntityMap_1_12_1() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x30, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3D /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x4B /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x43 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x32 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2D /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x3C /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java -deleted file mode 100644 -index f3372f08..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java -+++ /dev/null -@@ -1,183 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_13 extends EntityMap --{ -- -- static final EntityMap_1_13 INSTANCE = new EntityMap_1_13(); -- -- EntityMap_1_13() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x41, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x50, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x52, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x53, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0D, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x19, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x40 /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x4F /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x46 /* Set Passengers : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x35 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2F /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x3F /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6, protocolVersion ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 7, protocolVersion ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 13, protocolVersion ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x28 /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java -deleted file mode 100644 -index 8210b0a7..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java -+++ /dev/null -@@ -1,187 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_14 extends EntityMap --{ -- -- static final EntityMap_1_14 INSTANCE = new EntityMap_1_14(); -- -- EntityMap_1_14() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x44 /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x55 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x4A /* Set Passengers : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = DefinedPacket.readVarInt( packet ); -- -- if ( type == 2 || type == 101 || type == 71 ) // arrow, fishing_bobber or spectral_arrow -- { -- if ( type == 2 || type == 71 ) // arrow or spectral_arrow -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x43 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 15, protocolVersion ); // guardian beam -- break; -- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java -deleted file mode 100644 -index c2cf810f..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java -+++ /dev/null -@@ -1,187 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_15 extends EntityMap --{ -- -- static final EntityMap_1_15 INSTANCE = new EntityMap_1_15(); -- -- EntityMap_1_15() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x09, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x57, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x5A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x56 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x4B /* Set Passengers : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x38 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = DefinedPacket.readVarInt( packet ); -- -- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow -- { -- if ( type == 2 || type == 72 ) // arrow or spectral_arrow -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x33 /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam -- break; -- case 0x51 /* Entity Sound Effect : PacketPlayOutEntitySound */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java -deleted file mode 100644 -index c8b06707..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java -+++ /dev/null -@@ -1,187 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_16 extends EntityMap --{ -- -- static final EntityMap_1_16 INSTANCE = new EntityMap_1_16(); -- -- EntityMap_1_16() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x02, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount -- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x1C, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x55 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x4B /* Set Passengers : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = DefinedPacket.readVarInt( packet ); -- -- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow -- { -- if ( type == 2 || type == 72 ) // arrow or spectral_arrow -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x04 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) -- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam -- break; -- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x2C /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java -deleted file mode 100644 -index 7241dc56..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java -+++ /dev/null -@@ -1,76 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import lombok.AccessLevel; --import lombok.RequiredArgsConstructor; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; -- --@RequiredArgsConstructor(access = AccessLevel.PRIVATE) --class EntityMap_1_16_2 extends EntityMap --{ -- -- static final EntityMap_1_16_2 INSTANCE_1_16_2 = new EntityMap_1_16_2( 0x04, 0x2D ); -- static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D ); -- static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); -- static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F ); -- static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 ); -- // -- private final int spawnPlayerId; -- private final int spectateId; -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) -- { -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == spawnPlayerId ) -- { -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == spectateId && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -deleted file mode 100644 -index cdc07dc4..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java -+++ /dev/null -@@ -1,102 +0,0 @@ --// FlameCord start - 1.7.x support --package net.md_5.bungee.entitymap; -- --import io.netty.buffer.ByteBuf; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_7_2 extends EntityMap --{ -- -- static final EntityMap INSTANCE = new EntityMap_1_7_2(); -- -- EntityMap_1_7_2() -- { -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed -- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation -- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player -- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item -- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object -- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob -- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting -- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb -- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity -- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move -- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look -- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move -- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport -- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look -- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity -- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata -- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect -- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect -- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation -- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity -- -- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation -- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action -- } -- -- @Override -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- //Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) -- { -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- } else if ( packetId == 0x13 /* Destroy Entities */ ) -- { -- int count = packet.getByte( packetIdLength ); -- for ( int i = 0; i < count; i++ ) -- { -- rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); -- } -- } else if ( packetId == 0x0E /* Spawn Object */ ) -- { -- DefinedPacket.readVarInt( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 ) -- { -- packet.skipBytes( 14 ); -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- int changedId = -1; -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- changedId = newId; -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- changedId = oldId; -- } -- if ( changedId != -1 ) -- { -- if ( changedId == 0 && readId != 0 ) -- { // Trim off the extra data -- packet.readerIndex( readerIndex ); -- packet.writerIndex( packet.readableBytes() - 6 ); -- } else if ( changedId != 0 && readId == 0 ) -- { // Add on the extra data -- packet.readerIndex( readerIndex ); -- packet.capacity( packet.readableBytes() + 6 ); -- packet.writerIndex( packet.readableBytes() + 6 ); -- } -- } -- } -- } -- packet.readerIndex( readerIndex ); -- } --} --// FlameCord end - 1.7.x support -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -deleted file mode 100644 -index cb9174b3..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java -+++ /dev/null -@@ -1,62 +0,0 @@ --// FlameCord start - 1.7.x support --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.connection.LoginResult; --import net.md_5.bungee.protocol.DefinedPacket; -- --class EntityMap_1_7_6 extends EntityMap_1_7_2 --{ -- -- static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- if ( packetId == 0x0C /* Spawn Player */ ) -- { -- DefinedPacket.readVarInt( packet ); -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- String uuid = DefinedPacket.readString( packet ); -- String username = DefinedPacket.readString( packet ); -- int props = DefinedPacket.readVarInt( packet ); -- if ( props == 0 ) -- { -- UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); -- if ( player != null ) -- { -- LoginResult profile = player.getPendingConnection().getLoginProfile(); -- if ( profile != null && profile.getProperties() != null -- && profile.getProperties().length >= 1 ) -- { -- ByteBuf rest = packet.copy(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeString( player.getUniqueId().toString(), packet ); -- DefinedPacket.writeString( username, packet ); -- DefinedPacket.writeVarInt( profile.getProperties().length, packet ); -- for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) -- { -- DefinedPacket.writeString( property.getName(), packet ); -- DefinedPacket.writeString( property.getValue(), packet ); -- DefinedPacket.writeString( property.getSignature(), packet ); -- } -- packet.writeBytes( rest ); -- rest.release(); -- } -- } -- } -- } -- packet.readerIndex( readerIndex ); -- } --} --// FlameCord end - 1.7.x support -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java -deleted file mode 100644 -index 8e2dbe69..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java -+++ /dev/null -@@ -1,176 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_8 extends EntityMap --{ -- -- static final EntityMap_1_8 INSTANCE = new EntityMap_1_8(); -- -- EntityMap_1_8() -- { -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed -- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation -- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player -- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item -- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object -- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob -- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting -- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb -- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity -- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move -- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look -- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move -- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport -- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look -- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity -- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata -- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect -- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect -- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation -- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity -- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera -- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Update Entity NBT -- -- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity -- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- //Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- if ( packetId == 0x0D /* Collect Item */ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( packetId == 0x1B /* Attach Entity */ ) -- { -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- } else if ( packetId == 0x13 /* Destroy Entities */ ) -- { -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( readerIndex + packetIdLength ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- } else if ( packetId == 0x0E /* Spawn Object */ ) -- { -- -- DefinedPacket.readVarInt( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 ) -- { -- packet.skipBytes( 14 ); -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- int changedId = readId; -- -- if ( readId == oldId ) -- { -- packet.setInt( position, changedId = newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, changedId = oldId ); -- } -- -- if ( readId > 0 && changedId <= 0 ) -- { -- packet.writerIndex( packet.writerIndex() - 6 ); -- } else if ( changedId > 0 && readId <= 0 ) -- { -- packet.ensureWritable( 6 ); -- packet.writerIndex( packet.writerIndex() + 6 ); -- } -- } -- } else if ( packetId == 0x0C /* Spawn Player */ ) -- { -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- } else if ( packetId == 0x42 /* Combat Event */ ) -- { -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- //Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x18 /* Spectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java -deleted file mode 100644 -index d61dc0cb..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java -+++ /dev/null -@@ -1,182 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_9 extends EntityMap --{ -- -- static final EntityMap_1_9 INSTANCE = new EntityMap_1_9(); -- -- EntityMap_1_9() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount -- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x49 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x40 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java -deleted file mode 100644 -index bfbc8432..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java -+++ /dev/null -@@ -1,182 +0,0 @@ --package net.md_5.bungee.entitymap; -- --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; --import io.netty.buffer.ByteBuf; --import java.util.UUID; --import net.md_5.bungee.BungeeCord; --import net.md_5.bungee.UserConnection; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.protocol.DefinedPacket; --import net.md_5.bungee.protocol.ProtocolConstants; -- --class EntityMap_1_9_4 extends EntityMap --{ -- -- static final EntityMap_1_9_4 INSTANCE = new EntityMap_1_9_4(); -- -- EntityMap_1_9_4() -- { -- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity -- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb -- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving -- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting -- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn -- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation -- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation -- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus -- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove -- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook -- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook -- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity -- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed -- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect -- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation -- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera -- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata -- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity -- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity -- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment -- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount -- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect -- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport -- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes -- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect -- -- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity -- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction -- } -- -- @Override -- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteClientbound( packet, oldId, newId ); -- -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- int jumpIndex = packet.readerIndex(); -- switch ( packetId ) -- { -- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: -- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); -- break; -- case 0x48 /* Collect Item : PacketPlayOutCollect */: -- DefinedPacket.readVarInt( packet ); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- break; -- case 0x40 /* Attach Entity : PacketPlayOutMount */: -- DefinedPacket.readVarInt( packet ); -- jumpIndex = packet.readerIndex(); -- // Fall through on purpose to int array of IDs -- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: -- int count = DefinedPacket.readVarInt( packet ); -- int[] ids = new int[ count ]; -- for ( int i = 0; i < count; i++ ) -- { -- ids[i] = DefinedPacket.readVarInt( packet ); -- } -- packet.readerIndex( jumpIndex ); -- packet.writerIndex( jumpIndex ); -- DefinedPacket.writeVarInt( count, packet ); -- for ( int id : ids ) -- { -- if ( id == oldId ) -- { -- id = newId; -- } else if ( id == newId ) -- { -- id = oldId; -- } -- DefinedPacket.writeVarInt( id, packet ); -- } -- break; -- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: -- DefinedPacket.readVarInt( packet ); -- DefinedPacket.readUUID( packet ); -- int type = packet.readUnsignedByte(); -- -- if ( type == 60 || type == 90 || type == 91 ) -- { -- if ( type == 60 || type == 91 ) -- { -- oldId = oldId + 1; -- newId = newId + 1; -- } -- -- packet.skipBytes( 26 ); // double, double, double, byte, byte -- int position = packet.readerIndex(); -- int readId = packet.readInt(); -- if ( readId == oldId ) -- { -- packet.setInt( position, newId ); -- } else if ( readId == newId ) -- { -- packet.setInt( position, oldId ); -- } -- } -- break; -- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- int idLength = packet.readerIndex() - readerIndex - packetIdLength; -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength + idLength ); -- DefinedPacket.writeUUID( player.getUniqueId(), packet ); -- packet.writerIndex( previous ); -- } -- break; -- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: -- int event = packet.readUnsignedByte(); -- if ( event == 1 /* End Combat*/ ) -- { -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } else if ( event == 2 /* Entity Dead */ ) -- { -- int position = packet.readerIndex(); -- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); -- packet.readerIndex( position ); -- DefinedPacket.readVarInt( packet ); -- rewriteInt( packet, oldId, newId, packet.readerIndex() ); -- } -- break; -- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: -- DefinedPacket.readVarInt( packet ); // Entity ID -- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook -- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam -- break; -- } -- packet.readerIndex( readerIndex ); -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) -- { -- super.rewriteServerbound( packet, oldId, newId ); -- // Special cases -- int readerIndex = packet.readerIndex(); -- int packetId = DefinedPacket.readVarInt( packet ); -- int packetIdLength = packet.readerIndex() - readerIndex; -- -- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) -- { -- UUID uuid = DefinedPacket.readUUID( packet ); -- ProxiedPlayer player; -- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) -- { -- int previous = packet.writerIndex(); -- packet.readerIndex( readerIndex ); -- packet.writerIndex( readerIndex + packetIdLength ); -- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); -- packet.writerIndex( previous ); -- } -- } -- packet.readerIndex( readerIndex ); -- } --} -diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java -deleted file mode 100644 -index cb81d1dd..00000000 ---- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java -+++ /dev/null -@@ -1,30 +0,0 @@ -- --package net.md_5.bungee.entitymap; -- --import io.netty.buffer.ByteBuf; --// Waterfall start -- --public class EntityMap_Dummy extends EntityMap { -- -- public static final EntityMap_Dummy INSTANCE = new EntityMap_Dummy(); -- -- EntityMap_Dummy() { -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) { -- } -- -- @Override -- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { -- } -- -- @Override -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) { -- } -- -- @Override -- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { -- } --} --// Waterfall end -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index caed4384..af428090 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -@@ -11,7 +11,6 @@ import lombok.Setter; - import net.md_5.bungee.BungeeCord; - import net.md_5.bungee.UserConnection; - import net.md_5.bungee.protocol.ProtocolConstants; --import net.md_5.bungee.protocol.packet.EntityRemoveEffect; - import net.md_5.bungee.protocol.packet.PluginMessage; - - /** -@@ -113,10 +112,6 @@ public class ForgeClientHandler - } - - private void resetAllThePotions(UserConnection con) { -- // Just to be sure -- for (Map.Entry entry: con.getPotions().entries()) { -- con.unsafe().sendPacket(new EntityRemoveEffect(entry.getKey(), entry.getValue())); -- } - con.getPotions().clear(); - } - --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch deleted file mode 100644 index cb483b30..00000000 --- a/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch +++ /dev/null @@ -1,22 +0,0 @@ -From c3a0de08b9d4d728fe488f5d3b83e19e2766f6ae Mon Sep 17 00:00:00 2001 -From: xIsm4 -Date: Thu, 4 Aug 2022 23:27:43 +0200 -Subject: [PATCH] Dont frame unreadable connections - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index aa538f74..99d203c7 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder - { - // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() - // will fire any cumulated data through the pipeline, so we want to try and stop it here. -- if ( !ctx.channel().isActive() ) -+ if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable - { - return; - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch deleted file mode 100644 index 68aa8311..00000000 --- a/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 8a2c6364c6c2e36eaa918195ca370382a37debee Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 13 Sep 2022 20:41:48 -0300 -Subject: [PATCH] Avoid throwing IOOB on login - - -diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 763d34c2..57e50a8b 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -@@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket - } - if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 ) - { -- if ( buf.readBoolean() ) -+ // FlameCord - Avoid throwing IOOB on login -+ if ( buf.isReadable() && buf.readBoolean() ) - { - uuid = readUUID( buf ); - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch deleted file mode 100644 index 6df0d6cf..00000000 --- a/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 981d25c1f3b03e1c2f10427811c7690c64c2e967 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 15 Nov 2022 18:07:27 +0100 -Subject: [PATCH] Only show connection fail reason when detailed logger is - enabled - - -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 f3d60253..021fe839 100644 ---- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java -+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer - // FlameCord - Allow for toggle the logging of connection failures - if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { - bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall -+ // FlameCord - Show connection fail reason -+ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); - } -- return ""; // Waterfall -+ return cause.getClass().getName(); // FlameCord - } - - @Override --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch b/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch deleted file mode 100644 index e4bd12bc..00000000 --- a/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 69f3e68d5a12bcaf0423d2c18da6b51a8d38d998 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 28 Dec 2022 14:23:54 -0300 -Subject: [PATCH] Optimize Decoder/Encoder Getter - - -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index 6f1d8336..b98ee6a7 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -31,26 +31,42 @@ public class ChannelWrapper - @Getter - private volatile boolean closing; - -+ // FlameCord start - Optimize Decoder/Encoder Getter -+ MinecraftDecoder decoder; -+ MinecraftEncoder encoder; -+ // FlameCord end - Optimize Decoder/Encoder Getter -+ - public ChannelWrapper(ChannelHandlerContext ctx) - { - this.ch = ctx.channel(); - this.remoteAddress = ( this.ch.remoteAddress() == null ) ? this.ch.parent().localAddress() : this.ch.remoteAddress(); -+ -+ // FlameCord start - Optimize Decoder/Encoder Getter -+ this.decoder = (MinecraftDecoder) ch.pipeline().get( PipelineUtils.PACKET_DECODER ); -+ this.encoder = (MinecraftEncoder) ch.pipeline().get( PipelineUtils.PACKET_ENCODER ); -+ // FlameCord end - Optimize Decoder/Encoder Getter - } - - public void setProtocol(Protocol protocol) - { - // FlameCord - Use pipeline to reduce redundancy - final ChannelPipeline pipeline = ch.pipeline(); -- pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); -- pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); -+ -+ // FlameCord start - Optimize Decoder/Encoder Getter -+ decoder.setProtocol( protocol ); -+ encoder.setProtocol( protocol ); -+ // FlameCord end - Optimize Decoder/Encoder Getter - } - - public void setVersion(int protocol) - { - // FlameCord - Use pipeline to reduce redundancy - final ChannelPipeline pipeline = ch.pipeline(); -- pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); -- pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); -+ -+ // FlameCord start - Optimize Decoder/Encoder Getter -+ decoder.setProtocolVersion( protocol ); -+ encoder.setProtocolVersion( protocol ); -+ // FlameCord end - Optimize Decoder/Encoder Getter - } - - public void write(Object packet) --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch deleted file mode 100644 index ef5d401a..00000000 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ /dev/null @@ -1,134 +0,0 @@ -From ab1e5d100f2d678f1471fa83226dc9a5af2d370b Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Tue, 10 Jan 2023 16:37:13 -0300 -Subject: [PATCH] Dont Process Links For Kick Messages - - -diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a..2bb27e67 100644 ---- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -+++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -@@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent - return components.toArray( new BaseComponent[ 0 ] ); - } - -+ // FlameCord start - Dont Process Links For Kick Messages -+ public static BaseComponent[] fromLegacyTextFast(String message) -+ { -+ return fromLegacyTextFast( message, ChatColor.WHITE ); -+ } -+ -+ public static BaseComponent[] fromLegacyTextFast(String message, ChatColor defaultColor) -+ { -+ ArrayList components = new ArrayList<>(); -+ StringBuilder builder = new StringBuilder(); -+ TextComponent component = new TextComponent(); -+ -+ for ( int i = 0; i < message.length(); i++ ) -+ { -+ char c = message.charAt( i ); -+ if ( c == ChatColor.COLOR_CHAR ) -+ { -+ if ( ++i >= message.length() ) -+ { -+ break; -+ } -+ c = message.charAt( i ); -+ if ( c >= 'A' && c <= 'Z' ) -+ { -+ c += 32; -+ } -+ ChatColor format; -+ if ( c == 'x' && i + 12 < message.length() ) -+ { -+ StringBuilder hex = new StringBuilder( "#" ); -+ for ( int j = 0; j < 6; j++ ) -+ { -+ hex.append( message.charAt( i + 2 + ( j * 2 ) ) ); -+ } -+ try -+ { -+ format = ChatColor.of( hex.toString() ); -+ } catch ( IllegalArgumentException ex ) -+ { -+ format = null; -+ } -+ -+ i += 12; -+ } else -+ { -+ format = ChatColor.getByChar( c ); -+ } -+ if ( format == null ) -+ { -+ continue; -+ } -+ if ( builder.length() > 0 ) -+ { -+ TextComponent old = component; -+ component = new TextComponent( old ); -+ old.setText( builder.toString() ); -+ builder = new StringBuilder(); -+ components.add( old ); -+ } -+ if ( format == ChatColor.BOLD ) -+ { -+ component.setBold( true ); -+ } else if ( format == ChatColor.ITALIC ) -+ { -+ component.setItalic( true ); -+ } else if ( format == ChatColor.UNDERLINE ) -+ { -+ component.setUnderlined( true ); -+ } else if ( format == ChatColor.STRIKETHROUGH ) -+ { -+ component.setStrikethrough( true ); -+ } else if ( format == ChatColor.MAGIC ) -+ { -+ component.setObfuscated( true ); -+ } else -+ { -+ if ( format == ChatColor.RESET ) -+ { -+ format = defaultColor; -+ } -+ component = new TextComponent(); -+ component.setColor( format ); -+ component.setReset( true ); -+ } -+ continue; -+ } -+ int pos = message.indexOf( ' ', i ); -+ if ( pos == -1 ) -+ { -+ pos = message.length(); -+ } -+ builder.append( c ); -+ } -+ -+ component.setText( builder.toString() ); -+ components.add( component ); -+ -+ return components.toArray( new BaseComponent[ 0 ] ); -+ } -+ // FlameCord end - Dont Process Links For Kick Messages -+ - /** - * The text of the component that will be displayed to the client - */ -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 e8c14c55..6d0719a0 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 -@@ -833,7 +833,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - if ( canSendKickMessage() ) - { -- disconnect( TextComponent.fromLegacyText( reason ) ); -+ disconnect( TextComponent.fromLegacyTextFast( reason ) ); // FlameCord - Dont Process Links For Kick Messages - } else - { - ch.close(); --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch deleted file mode 100644 index a40ebcc6..00000000 --- a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch +++ /dev/null @@ -1,97 +0,0 @@ -From f37bca815bffe22461c5b2760596ef18d56a1070 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Wed, 11 Jan 2023 10:14:12 -0300 -Subject: [PATCH] Bungee Plugins Command - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 6175d8e2d..2ea33a94b 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); - // FlameCord end - Antibot System - -+ // FlameCord - Bungee Plugins Command -+ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); -+ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); -+ - for (final String key : configuration.getKeys()) { - final Object value = configuration.get(key); - -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java -new file mode 100644 -index 000000000..2e20e9dca ---- /dev/null -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java -@@ -0,0 +1,45 @@ -+package dev._2lstudios.flamecord.commands; -+ -+import java.util.Collection; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import net.md_5.bungee.BungeeCord; -+import net.md_5.bungee.api.CommandSender; -+import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.plugin.Command; -+import net.md_5.bungee.api.plugin.Plugin; -+ -+public class BungeePluginsCommand extends Command { -+ public BungeePluginsCommand() { -+ super("bplugins"); -+ } -+ -+ @Override -+ public void execute(final CommandSender sender, final String[] args) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); -+ -+ if (sender.hasPermission("flamecord.usage")) { -+ Collection plugins = BungeeCord.getInstance().getPluginManager().getPlugins(); -+ int amount = plugins.size(); -+ String header = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_header", amount); -+ String separator = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_separator"); -+ StringBuilder stringBuilder = new StringBuilder(header); -+ boolean first = true; -+ -+ for (Plugin plugin : plugins) { -+ stringBuilder.append((first ? "" : separator) + plugin.getDescription().getName()); -+ -+ if (first) { -+ first = false; -+ } -+ } -+ -+ sender.sendMessage(TextComponent.fromLegacyText(stringBuilder.toString())); -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bplugins_nopermission"))); -+ } -+ } -+} -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 62712330e..ec5fd4af2 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -11,6 +11,7 @@ import com.google.gson.Gson; - import com.google.gson.GsonBuilder; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.commands.BungeePluginsCommand; - import dev._2lstudios.flamecord.commands.FlameCordCommand; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -@@ -912,5 +913,8 @@ public class BungeeCord extends ProxyServer - - // Flamecord Command - pluginManager.registerCommand(null, new FlameCordCommand(this)); -+ -+ // FlameCord - Bungee Plugins Command -+ pluginManager.registerCommand(null, new BungeePluginsCommand()); - } - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch deleted file mode 100644 index 0bc48e2d..00000000 --- a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 79f33268f3f154170f55362decf8fcc8b99a68f8 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sun, 15 Jan 2023 10:12:45 -0300 -Subject: [PATCH] Bungee IP Command - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 2ea33a94b..e42bb29d5 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); - setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); - -+ // FlameCord - Bungee IP Command -+ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); -+ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); -+ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); -+ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); -+ - for (final String key : configuration.getKeys()) { - final Object value = configuration.get(key); - -diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java -new file mode 100644 -index 000000000..85313491e ---- /dev/null -+++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java -@@ -0,0 +1,45 @@ -+package dev._2lstudios.flamecord.commands; -+ -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.MessagesConfiguration; -+import net.md_5.bungee.BungeeCord; -+import net.md_5.bungee.api.CommandSender; -+import net.md_5.bungee.api.chat.TextComponent; -+import net.md_5.bungee.api.connection.ProxiedPlayer; -+import net.md_5.bungee.api.plugin.Command; -+ -+public class BungeeIPCommand extends Command { -+ public BungeeIPCommand() { -+ super("bip"); -+ } -+ -+ @Override -+ public void execute(final CommandSender sender, final String[] args) { -+ final FlameCord flameCord = FlameCord.getInstance(); -+ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); -+ -+ if (sender.hasPermission("flamecord.bip")) { -+ if (args.length > 0) { -+ ProxiedPlayer player = BungeeCord.getInstance().getPlayer(args[0]); -+ -+ if (player != null) { -+ String message = messagesConfiguration.getTranslation("flamecord_bip", player.getDisplayName(), -+ player.getUniqueId(), player.getSocketAddress(), player.getPing(), player.getLocale(), -+ player.getViewDistance(), player.getServer().getInfo().getName()); -+ -+ sender.sendMessage(TextComponent.fromLegacyText(message)); -+ } else { -+ sender.sendMessage( -+ TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_offline"))); -+ } -+ } else { -+ sender.sendMessage( -+ TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_usage"))); -+ } -+ } else { -+ sender.sendMessage(TextComponent -+ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_nopermission"))); -+ } -+ } -+} -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ec5fd4af2..f5059666e 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -11,6 +11,7 @@ import com.google.gson.Gson; - import com.google.gson.GsonBuilder; - - import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.commands.BungeeIPCommand; - import dev._2lstudios.flamecord.commands.BungeePluginsCommand; - import dev._2lstudios.flamecord.commands.FlameCordCommand; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -916,5 +917,8 @@ public class BungeeCord extends ProxyServer - - // FlameCord - Bungee Plugins Command - pluginManager.registerCommand(null, new BungeePluginsCommand()); -+ -+ // FlameCord - Bungee IP Command -+ pluginManager.registerCommand(null, new BungeeIPCommand()); - } - } --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch deleted file mode 100644 index 5abacdb9..00000000 --- a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch +++ /dev/null @@ -1,37 +0,0 @@ -From daefdd3d718eecc9ac09fbece9e7baff22e1c195 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sun, 15 Jan 2023 19:03:34 -0300 -Subject: [PATCH] List Command Format - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index e42bb29d5..555319a7f 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -107,6 +107,9 @@ public class MessagesConfiguration extends FlameConfig { - setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); - setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); - -+ // FlameCord - List Command Format -+ setIfUnexistant("command_list_format", "&aServers:&r", configuration); -+ - for (final String key : configuration.getKeys()) { - final Object value = configuration.get(key); - -diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c22271105..0a5899319 100644 ---- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -+++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -@@ -25,6 +25,9 @@ public class CommandList extends Command - @Override - public void execute(CommandSender sender, String[] args) - { -+ // FlameCord - List Command Format -+ sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format") ); -+ - for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) - { - if ( !server.canAccess( sender ) ) --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch deleted file mode 100644 index 00c27323..00000000 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 477817bdc183b430c925b7b3841e5b51ac632852 Mon Sep 17 00:00:00 2001 -From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> -Date: Sun, 22 Jan 2023 09:41:36 -0300 -Subject: [PATCH] InitialHandler Processing State - - -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 6d0719a0..8beed72f 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 -@@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; - } - -+ // FlameCord start - InitialHandler Processing State -+ private boolean processing = false; -+ // FlameCord end - InitialHandler Processing State -+ - private boolean canSendKickMessage() - { - return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -@@ -275,6 +279,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(StatusRequest statusRequest) throws Exception - { - Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); -+ // FlameCord start - InitialHandler Processing State -+ Preconditions.checkState( !processing, "Cannot request STATUS while processing another packet"); -+ this.processing = true; -+ // FlameCord end - InitialHandler Processing State - - ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); - final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -392,6 +400,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - - thisState = State.PING; -+ // FlameCord start - InitialHandler Processing State -+ processing = false; -+ // FlameCord end - InitialHandler Processing State - } - - private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); -@@ -401,6 +412,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - { - // FlameCord - Never accept invalid packets - Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); -+ // FlameCord start - InitialHandler Processing State -+ Preconditions.checkState( !processing, "Cannot request PING while processing another packet"); -+ this.processing = true; -+ // FlameCord end - InitialHandler Processing State - - unsafe.sendPacket( ping ); - -@@ -412,7 +427,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(Handshake handshake) throws Exception - { - Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -- -+ // FlameCord start - InitialHandler Processing State -+ Preconditions.checkState( !processing, "Cannot request HANDSHAKE while processing another packet"); -+ this.processing = true; -+ // FlameCord end - InitialHandler Processing State -+ - // FlameCord start - Antibot System - // Close and firewall on invalid protocol - int protocol = handshake.getRequestedProtocol(); -@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - // FlameCord end - Antibot System - -+ // FlameCord start - InitialHandler Processing State -+ processing = false; -+ // FlameCord end - InitialHandler Processing State -+ - break; - case 2: - // Login -@@ -517,6 +540,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - return; - } -+ -+ // FlameCord start - InitialHandler Processing State -+ processing = false; -+ // FlameCord end - InitialHandler Processing State -+ - break; - default: - throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -527,6 +555,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - public void handle(LoginRequest loginRequest) throws Exception - { - Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); -+ // FlameCord start - InitialHandler Processing State -+ Preconditions.checkState( !processing, "Cannot request USERNAME while processing another packet"); -+ this.processing = true; -+ // FlameCord end - InitialHandler Processing State - - if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) - { -@@ -634,6 +666,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection - thisState = State.FINISHING; - finish(); - } -+ // FlameCord start - InitialHandler Processing State -+ processing = false; -+ // FlameCord end - InitialHandler Processing State - } - }; - -@@ -647,6 +682,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); - Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); - thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) -+ // FlameCord start - InitialHandler Processing State -+ Preconditions.checkState( !processing, "Cannot request ENCRYPT while processing another packet"); -+ this.processing = true; -+ // FlameCord end - InitialHandler Processing State - - SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); - // Waterfall start --- -2.37.3.windows.1 - diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch deleted file mode 100644 index 5619559b..00000000 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ /dev/null @@ -1,2623 +0,0 @@ -From c2ca35b27ef725cf2ce710726aee0ea1efb84723 Mon Sep 17 00:00:00 2001 -From: xIsm4 -Date: Fri, 27 Jan 2023 14:12:44 +0100 -Subject: [PATCH] Implement libdeflate - - -diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 6f463b9c6..6ec047ed7 100644 ---- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { - @Getter - private int antibotFirewallExpire = 60; - @Getter -+ private int compressionLevel = 6; -+ @Getter - private boolean antibotFirewallLog = true; - @Getter - private boolean antibotFirewallIpset = true; -@@ -324,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { - // FlameCord - Allow Invalid Names - this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); - -+ // FlameCord - Implement libdeflate -+ this.compressionLevel = setIfUnexistant("compression-level", this.compressionLevel, configuration); -+ - save(configuration, configurationFile); - } - } -diff --git a/native/compile-linux.sh b/native/compile-linux.sh -new file mode 100644 -index 000000000..5442dce9d ---- /dev/null -+++ b/native/compile-linux.sh -@@ -0,0 +1,25 @@ -+#!/bin/bash -+ -+if [ ! "$CC" ]; then -+ # The libdeflate authors recommend that we build using GCC as it produces "slightly faster binaries": -+ # https://github.com/ebiggers/libdeflate#for-unix -+ export CC=gcc -+fi -+ -+if [ ! -d libdeflate ]; then -+ echo "Cloning libdeflate..." -+ git clone https://github.com/ebiggers/libdeflate.git -+fi -+ -+echo "Compiling libdeflate..." -+cd libdeflate || exit -+CFLAGS="-fPIC -O2 -fomit-frame-pointer" make -+cd .. -+ -+CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer" -+ARCH=$(uname -m) -+mkdir -p src/main/resources/linux_$ARCH -+$CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ -+ libdeflate/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so -+$CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_openssl.c \ -+ -o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto -\ No newline at end of file -diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c -new file mode 100644 -index 000000000..aa7d1aba3 ---- /dev/null -+++ b/native/src/main/c/jni_cipher_macos.c -@@ -0,0 +1,66 @@ -+#include -+#include -+#include -+#include -+#include "jni_util.h" -+ -+typedef unsigned char byte; -+ -+JNIEXPORT jlong JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, -+ jclass clazz, -+ jbyteArray key, -+ jboolean encrypt) -+{ -+ jsize keyLen = (*env)->GetArrayLength(env, key); -+ if (keyLen != 16) { -+ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); -+ return 0; -+ } -+ -+ // Since we know the array size is always bounded, we can just use GetArrayRegion -+ // and save ourselves some error-checking headaches. -+ jbyte keyBytes[16]; -+ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); -+ if ((*env)->ExceptionCheck(env)) { -+ return 0; -+ } -+ -+ CCCryptorRef cryptor = NULL; -+ CCCryptorStatus result = CCCryptorCreateWithMode(encrypt ? kCCEncrypt : kCCDecrypt, -+ kCCModeCFB8, -+ kCCAlgorithmAES128, -+ ccNoPadding, -+ keyBytes, -+ keyBytes, -+ 16, -+ NULL, -+ 0, -+ 0, -+ 0, -+ &cryptor); -+ if (result != kCCSuccess) { -+ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); -+ return 0; -+ } -+ return (jlong) cryptor; -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, -+ jclass clazz, -+ jlong ptr) -+{ -+ CCCryptorRelease((CCCryptorRef) ptr); -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, -+ jclass clazz, -+ jlong ptr, -+ jlong source, -+ jint len, -+ jlong dest) -+{ -+ CCCryptorUpdate((CCCryptorRef) ptr, (byte*) source, len, (byte*) dest, len, NULL); -+} -\ No newline at end of file -diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c -new file mode 100644 -index 000000000..83515be52 ---- /dev/null -+++ b/native/src/main/c/jni_cipher_openssl.c -@@ -0,0 +1,62 @@ -+#include -+#include -+#include -+#include -+#include "jni_util.h" -+ -+typedef unsigned char byte; -+ -+JNIEXPORT jlong JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, -+ jclass clazz, -+ jbyteArray key, -+ jboolean encrypt) -+{ -+ jsize keyLen = (*env)->GetArrayLength(env, key); -+ if (keyLen != 16) { -+ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); -+ return 0; -+ } -+ -+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); -+ if (ctx == NULL) { -+ throwException(env, "java/lang/OutOfMemoryError", "allocate cipher"); -+ return 0; -+ } -+ -+ // Since we know the array size is always bounded, we can just use GetArrayRegion -+ // and save ourselves some error-checking headaches. -+ jbyte keyBytes[16]; -+ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); -+ if ((*env)->ExceptionCheck(env)) { -+ return 0; -+ } -+ -+ int result = EVP_CipherInit(ctx, EVP_aes_128_cfb8(), (byte*) keyBytes, (byte*) keyBytes, -+ encrypt); -+ if (result != 1) { -+ EVP_CIPHER_CTX_free(ctx); -+ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); -+ return 0; -+ } -+ return (jlong) ctx; -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, -+ jclass clazz, -+ jlong ptr) -+{ -+ EVP_CIPHER_CTX_free((EVP_CIPHER_CTX *) ptr); -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, -+ jclass clazz, -+ jlong ptr, -+ jlong source, -+ jint len, -+ jlong dest) -+{ -+ EVP_CipherUpdate((EVP_CIPHER_CTX*) ptr, (byte*) dest, &len, (byte*) source, len); -+} -\ No newline at end of file -diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c -new file mode 100644 -index 000000000..1e2b6bd8c ---- /dev/null -+++ b/native/src/main/c/jni_util.c -@@ -0,0 +1,12 @@ -+#include -+#include "jni_util.h" -+ -+void JNICALL -+throwException(JNIEnv *env, const char *type, const char *msg) -+{ -+ jclass klazz = (*env)->FindClass(env, type); -+ -+ if (klazz != 0) { -+ (*env)->ThrowNew(env, klazz, msg); -+ } -+} -\ No newline at end of file -diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h -new file mode 100644 -index 000000000..8938b26c8 ---- /dev/null -+++ b/native/src/main/c/jni_util.h -@@ -0,0 +1,4 @@ -+#include -+ -+JNIEXPORT void JNICALL -+throwException(JNIEnv *env, const char *type, const char *msg); -\ No newline at end of file -diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c -new file mode 100644 -index 000000000..809a7f857 ---- /dev/null -+++ b/native/src/main/c/jni_zlib_deflate.c -@@ -0,0 +1,43 @@ -+#include -+#include -+#include -+#include -+#include -+#include "jni_util.h" -+ -+JNIEXPORT jlong JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibDeflate_init(JNIEnv *env, -+ jclass clazz, -+ jint level) -+{ -+ struct libdeflate_compressor *compressor = libdeflate_alloc_compressor(level); -+ if (compressor == NULL) { -+ // Out of memory! -+ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate compressor"); -+ return 0; -+ } -+ return (jlong) compressor; -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibDeflate_free(JNIEnv *env, -+ jclass clazz, -+ jlong ctx) -+{ -+ libdeflate_free_compressor((struct libdeflate_compressor *) ctx); -+} -+ -+JNIEXPORT jlong JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibDeflate_process(JNIEnv *env, -+ jclass clazz, -+ jlong ctx, -+ jlong sourceAddress, -+ jint sourceLength, -+ jlong destinationAddress, -+ jint destinationLength) -+{ -+ struct libdeflate_compressor *compressor = (struct libdeflate_compressor *) ctx; -+ size_t produced = libdeflate_zlib_compress(compressor, (void *) sourceAddress, sourceLength, -+ (void *) destinationAddress, destinationLength); -+ return (jlong) produced; -+} -\ No newline at end of file -diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c -new file mode 100644 -index 000000000..d91319089 ---- /dev/null -+++ b/native/src/main/c/jni_zlib_inflate.c -@@ -0,0 +1,61 @@ -+#include -+#include -+#include -+#include -+#include -+#include "jni_util.h" -+ -+JNIEXPORT jlong JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibInflate_init(JNIEnv *env, -+ jclass clazz) -+{ -+ struct libdeflate_decompressor *decompress = libdeflate_alloc_decompressor(); -+ if (decompress == NULL) { -+ // Out of memory! -+ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate decompressor"); -+ return 0; -+ } -+ -+ return (jlong) decompress; -+} -+ -+JNIEXPORT void JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibInflate_free(JNIEnv *env, -+ jclass clazz, -+ jlong ctx) -+{ -+ libdeflate_free_decompressor((struct libdeflate_decompressor *) ctx); -+} -+ -+JNIEXPORT jboolean JNICALL -+Java_com_velocitypowered_natives_compression_NativeZlibInflate_process(JNIEnv *env, -+ jclass clazz, -+ jlong ctx, -+ jlong sourceAddress, -+ jint sourceLength, -+ jlong destinationAddress, -+ jint destinationLength, -+ jlong maximumSize) -+{ -+ struct libdeflate_decompressor *decompress = (struct libdeflate_decompressor *) ctx; -+ enum libdeflate_result result = libdeflate_zlib_decompress(decompress, (void *) sourceAddress, -+ sourceLength, (void *) destinationAddress, destinationLength, NULL); -+ -+ switch (result) { -+ case LIBDEFLATE_SUCCESS: -+ // We are happy -+ return JNI_TRUE; -+ case LIBDEFLATE_BAD_DATA: -+ throwException(env, "java/util/zip/DataFormatException", "inflate data is bad"); -+ return JNI_FALSE; -+ case LIBDEFLATE_SHORT_OUTPUT: -+ case LIBDEFLATE_INSUFFICIENT_SPACE: -+ // These cases are the same for us. We expect the full uncompressed size to be known. -+ throwException(env, "java/util/zip/DataFormatException", "uncompressed size is inaccurate"); -+ return JNI_FALSE; -+ default: -+ // Unhandled case -+ throwException(env, "java/util/zip/DataFormatException", "unknown libdeflate return code"); -+ return JNI_FALSE; -+ } -+} -\ No newline at end of file -diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java -new file mode 100644 -index 000000000..4ba41fc11 ---- /dev/null -+++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java -@@ -0,0 +1,15 @@ -+package com.velocitypowered.natives.compression; -+ -+/** -+ * Represents a native interface for zlib's deflate functions. -+ */ -+ -+//TODO Need refactor and recompile native! -+public class NativeZlibDeflate { -+ -+ public static native long init(int level); -+ -+ public static native long free(long ctx); -+ -+ public static native int process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength); -+} -diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java -new file mode 100644 -index 000000000..81d92e75b ---- /dev/null -+++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java -@@ -0,0 +1,17 @@ -+package com.velocitypowered.natives.compression; -+ -+import java.util.zip.DataFormatException; -+ -+/** -+ * Represents a native interface for zlib's inflate functions. -+ */ -+ -+//TODO Need refactor and recompile native! -+public class NativeZlibInflate { -+ -+ public static native long init(); -+ -+ public static native long free(long ctx); -+ -+ public static native boolean process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength) throws DataFormatException; -+} -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java -new file mode 100644 -index 000000000..a16a25844 ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java -@@ -0,0 +1,28 @@ -+package dev._2lstudios.flamecord.natives; -+ -+import dev._2lstudios.flamecord.natives.compress.Compressor; -+import io.netty.buffer.ByteBuf; -+import io.netty.buffer.ByteBufAllocator; -+ -+public class MoreByteBufUtils { -+ -+ public static ByteBuf ensureCompatible(ByteBufAllocator alloc, Compressor nativeStuff, ByteBuf buf) { -+ if (isCompatible(nativeStuff, buf)) { -+ return buf.retain(); -+ } -+ -+ // It's not, so we must make a direct copy. -+ ByteBuf newBuf = alloc.directBuffer(buf.readableBytes()); -+ newBuf.writeBytes(buf); -+ return newBuf; -+ } -+ -+ private static boolean isCompatible(Compressor nativeStuff, ByteBuf buf) { -+ if (nativeStuff.isNeedDirectBuffer()) { -+ return buf.hasMemoryAddress(); -+ } -+ -+ return true; -+ } -+ -+} -\ No newline at end of file -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java -new file mode 100644 -index 000000000..50f042bdf ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java -@@ -0,0 +1,36 @@ -+package dev._2lstudios.flamecord.natives; -+ -+import io.netty.buffer.ByteBuf; -+import io.netty.buffer.Unpooled; -+ -+public final class NativeEnvironmentDetector { -+ -+ private static final boolean IS_AMD64; -+ private static final boolean IS_AARCH64; -+ private static final boolean CAN_GET_MEMORYADDRESS; -+ -+ static { -+ ByteBuf test = Unpooled.directBuffer(); -+ try { -+ CAN_GET_MEMORYADDRESS = test.hasMemoryAddress(); -+ } -+ finally { -+ test.release(); -+ } -+ -+ String osArch = System.getProperty("os.arch", ""); -+ // HotSpot on Intel macOS prefers x86_64, but OpenJ9 on macOS and HotSpot/OpenJ9 elsewhere -+ // give amd64. -+ IS_AMD64 = osArch.equals("amd64") || osArch.equals("x86_64"); -+ IS_AARCH64 = osArch.equals("aarch64") || osArch.equals("arm64"); -+ } -+ -+ public static boolean isLinux_X86_64() { -+ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AMD64; -+ } -+ -+ public static boolean isLinux_AARCH64() { -+ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AARCH64; -+ } -+ -+} -\ No newline at end of file -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java -new file mode 100644 -index 000000000..a6709a869 ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java -@@ -0,0 +1,138 @@ -+package dev._2lstudios.flamecord.natives; -+ -+import dev._2lstudios.flamecord.natives.compress.Compressor; -+import dev._2lstudios.flamecord.natives.compress.CompressorFactory; -+import dev._2lstudios.flamecord.natives.compress.JavaCompressor; -+import dev._2lstudios.flamecord.natives.compress.LibdeflateCompressor; -+ -+import java.io.IOException; -+import java.io.InputStream; -+import java.nio.file.Files; -+import java.nio.file.Path; -+import java.nio.file.StandardCopyOption; -+import java.util.Arrays; -+import java.util.List; -+ -+public class Natives { -+ -+ private static final CompressorFactory COMPRESSOR_FACTORY = loadAvailableCompressFactory(); -+ -+ public static CompressorFactory getCompressorFactory() { -+ return COMPRESSOR_FACTORY; -+ } -+ -+ public static List getAvailableCompressorFactories() { -+ return Arrays.asList(new CompressorFactory() { -+ @Override -+ public String getName() { -+ return "Libdeflate (linux_x86_64)"; -+ } -+ -+ @Override -+ public boolean isCorrectEnvironment() { -+ return NativeEnvironmentDetector.isLinux_X86_64(); -+ } -+ -+ @Override -+ public String getNativePath() { -+ return "/libdeflate_x86_64.so"; -+ } -+ -+ @Override -+ public Compressor create(int level) { -+ return new LibdeflateCompressor(level); -+ } -+ }, new CompressorFactory() { -+ @Override -+ public String getName() { -+ return "Libdeflate (linux_aarch64)"; -+ } -+ -+ @Override -+ public boolean isCorrectEnvironment() { -+ return NativeEnvironmentDetector.isLinux_AARCH64(); -+ } -+ -+ @Override -+ public String getNativePath() { -+ return "/libdeflate_aarch64.so"; -+ } -+ -+ @Override -+ public Compressor create(int level) { -+ return new LibdeflateCompressor(level); -+ } -+ }, new CompressorFactory() { -+ @Override -+ public String getName() { -+ return "Java"; -+ } -+ -+ @Override -+ public boolean isCorrectEnvironment() { -+ return true; -+ } -+ -+ @Override -+ public String getNativePath() { -+ return null; -+ } -+ -+ @Override -+ public Compressor create(int level) { -+ return new JavaCompressor(level); -+ } -+ }); -+ } -+ -+ public static CompressorFactory loadAvailableCompressFactory() { -+ for (CompressorFactory factory : getAvailableCompressorFactories()) { -+ if (factory.isCorrectEnvironment()) { -+ String nativePath = factory.getNativePath(); -+ if (nativePath != null) { -+ try { -+ copyAndLoadNative(nativePath); -+ } -+ catch (Exception ignored) { -+ continue; -+ } -+ } -+ -+ return factory; -+ } -+ } -+ -+ throw new IllegalStateException("None of the compress factories recognized the environment!"); -+ } -+ -+ //Too good method to rewrite -+ private static void copyAndLoadNative(String path) { -+ try { -+ InputStream nativeLib = Natives.class.getResourceAsStream(path); -+ if (nativeLib == null) { -+ throw new IllegalStateException("Native library " + path + " not found."); -+ } -+ -+ Path tempFile = Files.createTempFile("native-", path.substring(path.lastIndexOf('.'))); -+ Files.copy(nativeLib, tempFile, StandardCopyOption.REPLACE_EXISTING); -+ Runtime.getRuntime().addShutdownHook(new Thread(() -> { -+ try { -+ Files.deleteIfExists(tempFile); -+ } -+ catch (IOException ignored) { -+ // Well, it doesn't matter... -+ } -+ })); -+ -+ try { -+ System.load(tempFile.toAbsolutePath().toString()); -+ } -+ catch (UnsatisfiedLinkError e) { -+ throw new RuntimeException("Unable to load native " + tempFile.toAbsolutePath(), e); -+ } -+ } -+ catch (IOException e) { -+ throw new RuntimeException("Unable to copy natives", e); -+ } -+ } -+} -\ No newline at end of file -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java -new file mode 100644 -index 000000000..f28ae3145 ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java -@@ -0,0 +1,16 @@ -+package dev._2lstudios.flamecord.natives.compress; -+ -+import io.netty.buffer.ByteBuf; -+ -+import java.io.Closeable; -+import java.util.zip.DataFormatException; -+ -+public interface Compressor extends Closeable { -+ -+ void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException; -+ -+ void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException; -+ -+ boolean isNeedDirectBuffer(); -+ -+} -\ No newline at end of file -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java -new file mode 100644 -index 000000000..3aed690ad ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java -@@ -0,0 +1,13 @@ -+package dev._2lstudios.flamecord.natives.compress; -+ -+public interface CompressorFactory { -+ -+ String getName(); -+ -+ boolean isCorrectEnvironment(); -+ -+ String getNativePath(); -+ -+ Compressor create(int level); -+ -+} -\ No newline at end of file -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java -new file mode 100644 -index 000000000..7d99eb02b ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java -@@ -0,0 +1,90 @@ -+package dev._2lstudios.flamecord.natives.compress; -+ -+import io.netty.buffer.ByteBuf; -+ -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import static com.google.common.base.Preconditions.checkArgument; -+import static com.google.common.base.Preconditions.checkState; -+ -+public class JavaCompressor implements Compressor { -+ -+ private final byte[] buffer = new byte[8192]; //NullCordX -+ -+ private final Deflater deflater; -+ private final Inflater inflater; -+ private boolean disposed = false; -+ -+ public JavaCompressor(int level) { -+ this.deflater = new Deflater(level); -+ this.inflater = new Inflater(); -+ } -+ -+ @Override -+ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException { -+ ensureNotDisposed(); -+ -+ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. -+ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); -+ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); -+ -+ try { -+ byte[] inData = new byte[source.readableBytes()]; -+ source.readBytes(inData); -+ -+ this.inflater.setInput(inData); -+ -+ while (!this.inflater.finished() && this.inflater.getTotalIn() < inData.length) { -+ int count = this.inflater.inflate(this.buffer); -+ destination.writeBytes(this.buffer, 0, count); -+ } -+ -+ } -+ finally { -+ this.inflater.reset(); -+ } -+ } -+ -+ @Override -+ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { -+ ensureNotDisposed(); -+ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. -+ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); -+ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); -+ -+ try { -+ byte[] inData = new byte[source.readableBytes()]; -+ source.readBytes(inData); -+ -+ this.deflater.setInput(inData); -+ this.deflater.finish(); -+ -+ while (!this.deflater.finished()) { -+ int count = this.deflater.deflate(this.buffer); -+ destination.writeBytes(this.buffer, 0, count); -+ } -+ } -+ finally { -+ this.deflater.reset(); -+ } -+ } -+ -+ @Override -+ public void close() { -+ this.disposed = true; -+ this.deflater.end(); -+ this.inflater.end(); -+ } -+ -+ private void ensureNotDisposed() { -+ checkState(!this.disposed, "Object already disposed"); -+ } -+ -+ @Override -+ public boolean isNeedDirectBuffer() { -+ return false; -+ } -+ -+} -diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java -new file mode 100644 -index 000000000..fd9f9007d ---- /dev/null -+++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java -@@ -0,0 +1,83 @@ -+package dev._2lstudios.flamecord.natives.compress; -+ -+import com.google.common.base.Preconditions; -+import com.velocitypowered.natives.compression.NativeZlibDeflate; -+import com.velocitypowered.natives.compression.NativeZlibInflate; -+import io.netty.buffer.ByteBuf; -+ -+import java.util.zip.DataFormatException; -+ -+public class LibdeflateCompressor implements Compressor { -+ -+ private final long inflateCtx; -+ private final long deflateCtx; -+ private boolean disposed = false; -+ -+ public LibdeflateCompressor(int level) { -+ int correctedLevel = level == -1 ? 6 : level; -+ if (correctedLevel > 12 || correctedLevel < 1) { -+ throw new IllegalArgumentException("Invalid compression level " + level); -+ } -+ -+ this.inflateCtx = NativeZlibInflate.init(); -+ this.deflateCtx = NativeZlibDeflate.init(correctedLevel); -+ } -+ -+ @Override -+ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) -+ throws DataFormatException { -+ ensureNotDisposed(); -+ -+ destination.ensureWritable(uncompressedSize); -+ -+ long sourceAddress = source.memoryAddress() + source.readerIndex(); -+ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); -+ -+ NativeZlibInflate.process(this.inflateCtx, sourceAddress, source.readableBytes(), destinationAddress, -+ uncompressedSize); -+ destination.writerIndex(destination.writerIndex() + uncompressedSize); -+ } -+ -+ @Override -+ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { -+ ensureNotDisposed(); -+ -+ while (true) { -+ long sourceAddress = source.memoryAddress() + source.readerIndex(); -+ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); -+ -+ int produced = NativeZlibDeflate.process(this.deflateCtx, sourceAddress, source.readableBytes(), -+ destinationAddress, destination.writableBytes()); -+ if (produced > 0) { -+ destination.writerIndex(destination.writerIndex() + produced); -+ break; -+ } -+ else if (produced == 0) { -+ // Insufficient room - enlarge the buffer. -+ destination.capacity(destination.capacity() * 2); -+ } -+ else { -+ throw new DataFormatException("libdeflate returned unknown code " + produced); -+ } -+ } -+ } -+ -+ private void ensureNotDisposed() { -+ Preconditions.checkState(!this.disposed, "Object already disposed"); -+ } -+ -+ @Override -+ public void close() { -+ if (!this.disposed) { -+ NativeZlibInflate.free(this.inflateCtx); -+ NativeZlibDeflate.free(this.deflateCtx); -+ } -+ this.disposed = true; -+ } -+ -+ @Override -+ public boolean isNeedDirectBuffer() { -+ return true; -+ } -+ -+} -diff --git a/native/src/main/resources/libdeflate_aarch64.so b/native/src/main/resources/libdeflate_aarch64.so -new file mode 100644 -index 0000000000000000000000000000000000000000..284450dd1c3632601b58628619dabee4ea57fa91 -GIT binary patch -literal 74880 -zcmb@v3w%`7x%a>J-jigK3FN|6Kr)j=l<}@ug4Jecf)El#Nz#8k+H-Of4Ge-2-_w9- -zCKoL@s7&P?d#G=dfG8PDYcHOYoWB2(fTcogtKsx^&Up_r3AZp<5e-W=$fVy{|xmn>eDNw%=iQI@=x!Ysz9ai(uf=XA&MIEJ)RxQ<`Z)GH^l_~I#QEEL?0!f5oOn+z<-L*kdn57p66fAH -znTfMKR*kZ8mgBAX^NY{<@p6f?l$C$?9DeKp`R(kqEUVeF;y+Q#GP5<)iXTSX|iyV0_ -zZOMCbqj^!1Q&V%Caxa@>636;=>zm7-UGw~Z)(k9CZ(jHG-Pd3HwDaTH;RAuI!#w`N -ze}+m`SEYXbv7sibYIR{CtpcfBN_!XooAL$sg+AxSg}Gk9k$Z{znO{&(&KKO*zu^9@ -zUvOXe=e$I_N4a;Ye&v5bJ=c6eJ+r@{{8z2|9m?s5HGWU*q<#uP*~+1ANRQokJ%0ZL -zXSv@SFFzxG|K@o4Q2c&D{QfuM_nq;268f_vUeD|C@`?Ko#P2^6zkgf29#vKK(8H@% -zR;_-l=F!Khs#MjY%Dbu_So-MFhnB5=Z0VzwcNMQ#wQ^}?P3?-Mv1gZlQdQSjQ}y7o -zl{G7ttzD`ftABLWH|}VxTl&aj%T}#ar8R$FQ&qR>;i|u1x?)w`vd7juvg#YO@Ickd -zn#Y#?{nFL)?2$*8u3k;ys>Rm5`&KNgoxk+K6*Z47ty;En*<*ig9S=Ubbm?DP$0Luf -zs)NY?ztt>S`PX+RQO94?okSgp?mWEo;nhnYQ=IA^S)(4VS-}{|)x)d)eyLjZ$kLVS -z(WNyHASX*7eRSojDxNYzjB4GARjZdO#;NYQ)vK=il3IA@B2RJEP1oHxHz8U&wnXDd -z{1^Kz|JOeApOlw7Cb}f{L;k%O_(#m1u1dKl{}TSjh#T(AxEvpg`<2A~-n3Zx_b$NJB=#@x3IcC5Ji{h0f460IkpG55#E -z%gQNXZ^gBzjJaPQr$_F`RXqMQMz0P%;v*9O?D6t)Kh7fSQRbNY3Es+ssblVsrQbQ` -z{#bgh8goBkQ>307#@rw4QVPc0j}M6ySLT@eWBF4u=Kk3J-ZSR@IID)(|Lz@gKV!`O -z!aUtjO&3YFUY@#B3vc5$!QsQT@gV(NX$ysy;zS)VK%%^WNYIQ5+0<~WVt -zB#ul?ZOYQkQT&tj%(_nII(N)<8rPmN*WZa -zI+tr*`?UR8T<4Ctc603+bA27xwXy3EeN!hEj+#pS_+s(yqVg`K`g6}W9Vkj~_Pfp(z0gPbLEiPezi_nH -zdRM>juCx~$m!DbVa>k)XCs1GYV9`8NQ@2>O9$Gl+<2~zl@7%!mqR|(B$Kh1I^6Eit -z-Wi8E`tjqtFN|eXzVVy?pkIkTovHX)*I7dko-tHVSLUc^syX@z?U<_Yx3uw-I>s{0 -zvrnjJ(3ltu854qMDt7OvD=m3z7R4}f=SSum!mf4*i-|? -zq!RwPh2P6GRq3*;CCG%ggx{a(uQN5^^4SAsjE3?{@}whHW^TNU@Z_^~*sVIQk3T=j -z^D`Acg5OE*v(WX?YFpPw@O`UIWqokJ*7ZTF7Vw;X^1z4IcuWeOtJAyAA)6yca!`Zb -zQLoYUC;B)_pFg=;jn1atBgS<1pfM#F)|36hpW=yTLC4yW92bp -zg1cjFeK-1Wib>UfcG&*NC?aX!^nD&#&$a$UFQ)o=^&U@j7Y5%0F -zo~UEu?6VJ6dxmN>-HF{(1KilUG4-2PH74LWMZXCcDJi35uXh?nPoP%;F>*|z4x^kdf6S1*L2tB?Vh&4 -zrj~41hU4e=&FS8&CZ@IP%3JhFv{LH#AV<=Fz3IsVVPkTzSJ(YQ$19&iU!3}QPKA__ -z{y1s-gZqoR&eeIkM!m&dAFZC>^~u$um%p-fZ%e%V*85g>5B@27i_|CeBJ@@3DWPP^+5(;m_dv(v^Slg4OQ_A7EUw -z{* -zoce-mmvX^ve=^OitE&25<#&OGII*|Kkn7>1i@%6;5Och^C0?|s*F{}TOLM1L!f -zN8bodxpTJ2Wz;}s(YJ?qHdt}zY?0v#ehcpvWxt63KiAb9XkU^`87b$X|5YlB7M;P6zv^GXW!vmWFW_sKg;h? -zbn-B=D|8leE#q;f;wN40-?N=MiJpu8e?!^)$G>lTS9E`#(*32)ty^Y4q~5K1K%JW1 -z+`MH3TVdG_?8G$mC}vaAg6DZ(ni`N&Pu9)Tu7Js@#dc -z@J%j05T=|HU)P#;`Au)2yE|R~w&h>63Bj{zT19)BYA~-=l|QkoTk6u)lIj`72XfT3 -zh;fCgG!50?N%>qu>#s^zrykB%mAN)^jSIcsw!FGAWaPT_+f;Uw)9G!_Ltk%3#$}w< -zjQ$*FZp6DtRXTZhcvo^)6Z~3{t11WaJGZC_{*W;v`1_BeFAnco(Djlr!7u%j{!IB( -z%9ngIiw}(O{2cXtWMl-x{)JuV7n-A0hKiIpRpnOvSP8Us=ypFbcRxOC^tQXzPtuL) -z{W6{#4K+H75Z{-g0#$kH)Q*{|a&xZA^37D)Isd5|u7a+RF)3JROp1iiGYz}?0laoP -z|80wuTdl))#!O_PZ-%PW9A@A#cys2H;sZ|KWAi$S)f{!@!#%t7)JQ%wx7>XHpW2+g -zTiR^uT|HG*cEI;$_#vHO|!?*ZA$Xl^p1F_HC)rUC*>ad+E0y=yB!0wZ&zcj{Wl*=QcH}hS^_M -zm7d#64(xF5-?Co2>KUJr(ZBJE{afr;?B3!iDs?nzD)K%2fKR1A(_HNGi%hf_j(%yk -z>2lTZ7SEcJkO6G|Vq%U~!{M)04uAb<(}CyU<8x(KkF4bWVtBl=-aE3m{^}8rvis{e -z3Y8wY3LSVxPb)i*j8>*zepAt;;sZg~{w>n)3N1Y-eHT6nkM@j2D-XkyWO$K~(_vjz -zc0!ZLX$LYY^67$4E;S+OR5puG2_EV2=;r+1Ez0)DTw`5kg)eF3OCobQYDPqTNn~wO -zf9n)gAo5@TakMfq-aF!UJ2B?In;6qejCrE`K4c<{oJ#u_w{4#P#+QsaB?ojFPiT;G -z9_OAdwR-L|rufA8cnYmT<7&n<^rz@t(SPUgs=2$JyXjl*GlS5r7+(*%;-pV?80aSW -z`S$gyQaNt+E5OXJ)W%Jd;yA_F2PQeO*W?8^Ve7AJC$!#m%@zP6wbqEpz}V5?#H -zugo_KQu0-S$7arJNm28p{apI2PgDii{fO9ou_NC_&YO`9>5I=$^AvtCA&)Oy(YwXz -z7@0e0qz7L@mrl@E^gHN`G=0guseZ2Tf!O6+I`2B+flqTjL%w@~2O`r_N5_>TbItH7 -ztDZz1*!(Fn24dqx??f-g>gW#SGGt5*?$W15`WTOdE{k70cD?zr*yKz5*taboTWra) -z8g1RC0-g>PC{cemvOYzPmiRamQs1cdoP9YX@@_qJeT6>J?!1;(6{uU6@}1TU)zzAzb%~w~ABk2Lr>m~w -zbgj$dle|uktY-{vwD>BQHDSF4_uOqF%!lgb046R8towyDPc#DHsJ -z@d3q{iGB+2>+F}`RHD?Tr_xnca#5NU^Zf#Ou1N#ZBUW3D?K_GrY5i9g_e^YD?gH#+BIC5)^#;L0@@!v_UfXplV3AO&G(5byk?KV`{C7Q -z&xe#hcD?%8Zc`aHr8z`qMzHN47?%-CtKhklsl?fa`y<2V9^RGKb*xH_X5kwOP2!t$ -zRarP6e?K0-gxwF%Qd!mXcWAuIx~gpMdFk`!@oLEw;=#hQ+=9X~S3#38#k+_+!?G1~ -zR6{+sr9+=;`P>c1i5rZV?eEjI{;9;XV)Mn;3y-U(J$b-sU?bix>albzZXXKa+4_&7 -zm9Db61?PyVqzyav>)gpjT_O50ysNZpls+A+GDkn4e_{GBdLw$EztA?I4BbBnFS6n7 -zhh^rdM!UtkHH()=h*J-1zH%GK=`X9%;a#a+zdax0Y3OjY^7NOny)QpCFi4##&?e<& -zEQF86yN!Un`vAwj_&dY97InGaBF05-6FRwLC|X(Pgm>t>_}91Ili2T4{&mk5DJQ%T -z|N6UdbWVskY>++=r@?>tek@yM)g`NJXIXW@<}|g$2~Spk;yK`i|AUiNma}Yj!Cc0} -z$yhkcuHwio_zrc|PUD^8xqiHuZR2x74v(*Q`1UC@;3G8ah88 -zv&QV1I;`$i#d^TSS>o2AL!8n3t(*_@uQ58s)b0`+)pw~hX2_=eS=z+Yrs_}LeaW1Qk6;jQ?$MU*>( -zZ}~3^TH>=X`oS$nylo;h~&!hQdxx@C!ae -zp7fKNnJRF`n9xs5>K~+iC*!Z<9}@TivNn+TEp7HfpR}RyBd#&+2tFgvrM+UG7BFv6 -zqct`)nz)~!_b|41KDJBcNA@Ep4LRax56VG -zTEd1cD7 -zce_gRwrzT9+7a-Pz3}`9_(-9$TmE&bLoEsCX@SrLEg-qRtE9lnKW)nFam-iUUd=}Q -zr$xlCifoBIhZ`Rhd?=7hU4xCYy4T<5>dsM<-^6I6->Z#?ov2zAW{wd!1HsoQc~(Bh6h0E>%jt&`H@thUR`slbkn} -zOB?hd3Hn<#)$=!$D+EIbGk#|(O#GO`oru>ynQo54%Yg7ya^f?L!&&$l%XN+5ht!K) -zTCr?`hqU*iZ<3lLyv6sq1@G%1Mogh?cs?NGWaGdVlwSrPjwAmfYMpS0`tSPV7Mb>+W0Hz1^;|YI#=2GY>}{vQoRY28<*#%agCNJ<4#`u62P0 -zs6doD_kpjx0)L|_*}EH@BT>K9y`H+r1G928&AUERRYuU6#Fp;`h}SJwn%|Xp;Eh2(o$3nC!-% -z20}&*R}{=~GV-S*OGl7D6aIu2sva$aTz_qCx1!zZwYl9n8LHvu@G1}9p`&hf?~@0x -zPyROgL%-kM(^%VG2d@p$dB$0Bzn8HN>mzf8CUad{g~(SMXCM97D<|J9JOd|*+m6ZZ -zL)aY;b@XCa_Fz|9!Hp7iN*iPAt@$|mr9S%<{}BDrp;`3QiQFT{bI36q4-sp`>&sfo -z_->~kua;g>P^G}@kWDa(cd5If2Knnl-zaOvw9#TU>Wbr-Kc{~!;*Y>Hwu55|)>Ma$ -zEC$OgBu5f`IEx?DkS}S!V|h)%VMCR*G*)*PtKR$QOIBU}&!@FCI=k!Q^3kqqmdz4B -zF7ht2ex@Sk!)46Zqc1XkhmlVi>ttj=#(NL865X0ot%JdW$1*ODcI)H=nctq)2wvA+ -z>MW2tBa}(l|1%YDbR9=eBqxj692M+FH1u_O;!(Wz(XzvLa=Js6C?!&&T% -zS%H1y9cXqJQJ%4XH=lQMe6|L$ea>R1KMY-CX})drvowWY`C89&l`R9I;MaN%>*M|O -z`|fdtEdwL^IO5`@po<(GEVld+jz4Dj%IA}(+{hvEmc(CbPwQW)L*60VI!EM>|P%<@6_yNcE^?eok=S2 -zpnaTQ7ugZrLS7!i{x^Z2*C3JMrgUE)oeSAtu*K@Ra^!s1y`Bk&TSH6KGwiL(S0+rRwJc3cbvOou8fsf21 -z8ID;~_37l6r(EzMi}4Dzqz2C3ZH`_!^M{LbQ~GXuI@{d2S=RzZFWawwO8>9hJTKc< -zIbY6PmG^Sy_04UsEWU@cdgkk)a&wPEcjK9m)cU$tE=FU9Y -zOv)_U36>qGefpKf)lx6**U_ejw$w{MUVJmZUEKH3p0r&|d)2h-q|KVPt&1~hv;67K -z#Z?lI(5^{4LxT^`%j7J43KQ?tsbt5mG%YY|ZVP^J*347i$_%Kde>ndABi9CUXQ-@` -z%pYNE9KuUY;v@JbbdH0U$?$Y&S#`lx*zUb*oTH9Ic-v>QPp`Gxr{_GTPDu>*JZ;JQ -zC!4i^y?#|eowvH+X~tpPBy6CvTkq7^lBaJ?O`e|9s7{IB-xF;wpQSdH_ks%~tJfbb -zRz7^3qpZ%ZvKJev{c7DS-}(FW$qsdX)dBp8qjx+sI%OV0_Zpj8tXOTI%mX1ubxGuh -zFPc58#u3*bOUIItGn;M60%+O`j)7h*aXI_93}wnZMS4&hUsqh|OQ8AksjsVZCeA2BlBxzHf|>|0g~-lhU!av~Rc;6e|CCNDHg`%(IJ48BC| -zs-Xy7JnC$oCVV~FtOC{GO-GUQ@zfOtYj&wj$JLKqp3S^kwribHQHQP(`$ismeajXj -zzkiFg*U`AL`z|A;|5w-tEz|r~W~Ry>rfsz@sbY4L8Hl85{_vtl3T79T&hy?;-ZNX% -z9WIsXsCDh$B6Tb0zAe&sR$&Bl^NSBusd15ErTatBBJE!J!&qDG+Ia5{Y|AR_8Ts{+ -zAy0Wv)p@PKv+22M*x9VR$+?F-**$hG!_hiX$6wpa_F$i?t^(Jfzm|QY&$Is!tvvaa -z@*WTUv%`};_}!C?>&dUkySgKHvhLnZe6fq%?zEBOmgjb!{~#57>G4OqE!+3_P2J#9 -zJ<|U{?BkJJp#|IN*|cez#Lwm6S4VD@`m!CK`so$mt2ZS>Pc8Huga*OsUZsAKv8$4h -zEik1IqwND{k*#lFzq0A03x3X~ZB+=Spwya>;dDD~YK_>;5IL1#zN_`A{vGF{FQzkI -zscNcU;`69JA<{7$939!No~^P*^a=er#^i`AmAV+isR#aX3$aF4%K$kn?|7X3(>yBO -zeGrU(8~8hMz`UkOsv#9#7bdBB2l4fXp{o{NRl^4tZ5iZad|IzwRmOCwJki+GsCe+5?-&VZ~>6{Ef=~-V;+Qb}gCtsFT?UnOgnn06>*l=G*(y*wP*t#qXR8LQ3dlG8KSx$Y -zUj~TB-c%WWJ2Y0Gt}58BD(BfX&C$mB-zc}6*mXNL>er2{y4#5HdMRI?+qb1zuf!g_ -zwdJtu=UY4~8=LVa`jCV^U=NfHduasoLKIk(VRM;U2TY*G$# -z+TozzspdRvM}VBcFErOtPFdv)$rCKvoQ(S*v=u{J4&&}-4*V$Pg)ZUaHOXqu9plV3 -zhxBwmbM=Au($f81K3l*{HP`&wd4+$qmhNAldGEYZmkQ{mOAD@EyR=()cewf9c`uJH -z>A`K3?Q2|S@y`SAnq%z;^IdOkDYk6L&*7O3o@qhhQPEY!2W0FIS@vptM0i#NE#E{Q -z$Bw@X95;d<35`ES&WGS-Dq|T$Hxqo7v6XpMiRpUPz4P8y^Pxv~XtYZpmMuE95nCqx -z-l!Qt_~1VQ4foO3#w+@^NW7ewd;gxUMqf))J^z}fh>44=dHFLH{nlK87k%GJJ6`nk -zHO?Vo-$aZXBCh=^*pkGe)trSEuUum{nvw5A$L|eXjf}Tt-okniEpU81G=K|~4&NIP -z+w3E+D9yShkl_@1Q!Aq6&b`RA*e`Mk_c1-ge^^iQ+p*W%Z>tTwpO)cI&ANBq_s#k9 -z?0;Hf+3a_lZGi!GonNP~kE~hQeMQO2f@0*Pq~+duZHNzX6Yq(hNE=&e<9f#N2z-@sl`$P0^LvEff5N8z1Lrdp -z|I%d}A%=O`c6SU5P{DtG+6+kUGDb5=v*ItoK$?jW|7EWk=wN)$QNH`!=JIpQnUgb<7hM)){<-|?)Y-jv -z+oQ)GB8LJm?`SatA@Um;uWDm*f8Qf511{BZT5y*Te&cOyRtOAzWAk^mXuPj?_y$hQ -zRikIAv*1H8$DER`81)eY={_l5KWZ-}>Z%*J$e*@vMqu62i$w@|Q -zny+7TP^Ef*3IBbJRbKyt-B<6K<=1SzYm)I_RbU<_vPT@@g(;QJ{u-XU{8gIrhL{`j -zO*RW;{=Oqk`8B77>ttz8)zd-VEjGFXzuT^-M|Oi(>{2O_7S7ei#Qq$c?bPfn-q$Z< -z-rsC+AuBQ_wsdo+ZY$c^mR`NMj>E&@;;^NIRf9z{Hi4+Dqrhj(%QGd-c+C|_*dGyt%JNjK#e+_Rh_sGZa<;uNaBq}+W+qt~101UNZ1H8eXEdfWYz$RxA -zXJ(Brttog0T%`~Ht@2r~W2CYEK>2@=cAdY=sR9o8g&oOqz^^jxvi?vfwhEqwI&D2W -z?P`ti@cZd%%`UJ7_4Q=8@Ul=%h^&B)YT_H>RIt2kZz`CS@J{6IFXf-tWiHvvnm4bO -zR>m1DT6aH9?7te>snyaP=H+I0r#`{|0+{s`zLRSda9`H?D&3ze{R>nIq9!=|1L)RpHB;)=x<8I}- -zjC&p9{xsumU6U8o6&3Nk$hs~8+0tdm>bOWBGz^28;#+Ae&1$RNNcC>uK5?WQENx=Dp}hN$0e5|M -z!7%)3B_Bg>0-~!<+A7qNz4hps&?S75^-b0EyOn;6KKRgQi^t^aCeNfV%hJJY>z8$J -zSiY>gN=xDVCfRPAjWX^a&75SYNU^OP^VeMbE!Ku(jhULO5MLf -zFpe?0HCscsple5(s(coj!p1na%wvnZ$#_1flK1bW{9bf%FSO{r##S{Wmu -zy*fcV>({b))*9zwHRJUh<0XDw18bGBsI$h)i1RSnJ3A~kCfO}~SxNp1wt0bf2jQJ7 -zB;%#5@shkCVGG_m7`12?J_+5%rRcpOM(=rI5v9iOKhC)oS^BR_mAxlc_7r8Bp??`= -z5;*r~*Z%FZVhxL*l)Dr^yFL)wwEiJvL*z^7`w!}^VGKmpT=3KdPbDARLp&+AOUeyU -z=5suMBt}<1Ok3-OAVAndaMIzUt&#mZq3wD2Nn(m*E4HN8oJ~pgfH>~*&Cw6oO -z^oqUGc;DHJd|2a`8u4K#t-2Y%w|VvqJetp$ykP%ZoM&SX@8K-6QZgE?{2%;2Q}NHN -zi?lHOpov`-KR>ym*7EUxLVgBMY%Xt69gj+WroaG913Rli%Xw -zZLG71&HdkUz4-gVl+4+z5%aDuW_^#ER_5FB4+9?<)7;hR9j9Gtl3$P98&G%N>i67m -zO8~siUzD!-b@h6=-ln?6pZB3}A;T8beS(wt%1h2hUzEA5`@o#J9;o)#Sa}X8gIpbGEK@wRNnN`kN`^1TWI3<4?h1a+GRFp4dJu -z=Qgcj$1SRIE^$JLI6;}&0afx~K^5x)Qmp9NePmykX&SL%ct+ur{#SqX+7Ujp@UHSzlM6R?MhS1zMJGZLZ|>fhzE# -zBHHYjSsc)Yz?(ZJ2PQFA(}rdTrq^8;Q13r+U`E?F2a+WxXWYWA_AWJaWni+A?AKbe -z1L4+W=9i`hFMHsd12WI{M)oZMS!exqTgU0Y;W)(l$P>izA=XA@&Hv`WA$*wR@=JI| -zK4xLhcOc(YYEndzKlwscjT@LhXzi_PJcR#S&{oy$%60nHy;CZbQaAO1t6V{x3{QKu -zqvi)0=yh-~KneLtL-S`NZlo{Jq3hj!e_ypR?HIpSA9Z -z16L|L>t2~p;n{+EnZGl8s|hpi=IiYu#ol&RhpN1^U6ASQK%V_POyRm?L`uI -zv93&FP~^4z+h?LLo?r}Q4s9d3ekT5=bZXYeQPg<7q+vmw+{LS!s(9DKyDoAl -z7w;w8hY&CxT9y|5?jELHz|-zdnp_( -z%O32m;n<73=ud3@j_Zle?-XN;XtUq7sTDj!^B?SpVZ6o@UEis-8UEUI-S2sS!GU7V -zP4<+?Zq^brUJkJvVl%{cXxI%|7bv#FRK2$|cfMHJzOu^1hE!ogYS8CoY)A)t0FK4& -zNGe#9*pdC4RtVk~=Wm)rFrZ#+ih^e~U?vKi;#^c+K>Q)NGI{`SDO24Tw-?wKiBrGG -zzBJ3cX57Y%eSfUI>Er!F_{OSC)v$rwr7B-F>>#GhnW!4J!Z&=+maX#Kp?jsB(3S05 -zSkvjRwdwvl+P*fgi)TmKvrx=+lvu_NkH*?n;S2LVkrrYo;gw}yFYu{wRl?RL_;fLk -zgg?9ClgQ0heo{zP^(m%2N3H$3o_N1;>aDG{r -zSBL$riN7~i?li`Yxu7W`o6_$=*4vn>>3~Nya(vo<)`(20ratjm_wrlt`!A9Y5B)YP -zU3V+yGh%Xb`vp01(OxQY@{0XaIZ2Dli8C-pPAoY{Mh?K`1HuR0UyZEH692<9bJ2q_ -zd4Z0YycnO67tzDRWB9TCfka*+P -z)3LbW3^);M7aIoSWycGj; -zvYDrBs%0R5Q`?qklj^Dld#T38Rx6#u;IMHdaU}1oE?_-cvib==jl7Y$3)-HAjonrs -zi?5R3$}4EcMy-br#H)9+PA4GkY1sK(=G0^k&BUIo%-WSIv*tREm8=(9j4h4`ebvNR -z)t23!HM5Y|>MeYilYMRqye<}7)mX8Wo%^Eysd5(m=Pdf)$-9cRLiEjAqax$oe9=9j -z`wzskGQQ#XGuihc>shW-*iWadPqx+xu@+Se3a-UMT7MrHR>%Nr2LF*bxR5yadg9!^ -zz04P>94ii%IM>3k?!Oqrip7w+YQ^8`e!htD?(dR|0>@>q1bEiJw@d^}niTwq`p+BV -zgCTIJUa+qCUXk*@fu@s!YY{8=>P3MNYhisxQh)fw=7IBIT|rQa$FwbSYwZXOliDlb(PrcK;MPiNDunUY~d5E~mWFCA3T)<>b+??RM{oudqqlYu> -zU5BQmc15mE>soy(`r^Pev*&O|N!Or}?GCY~RWL8v-xo5Hf~-A!kzB`pC}&ZZ`J`46 -zxw^C~#QgMO)(!lT*h=JJYm!3{wR3F?iPu))!ksUvGrUMcjJ$$ptBPh(j?~Q -zxy$yY>+#$8DT&KFS9*xcv2#{jZc@gI$t4#5Tks#`#f7}Mh{dlhVGjQ*s^M56a+0kY -z?3{OHf#cKXonRP3kB>bSVdmb2H^LV$cKTqF?NrzO#4BnNIWpJ>*ckIdl?rU{7;$eh -z_+H@z=EaEdLz!mxHt@)8V2>+qZ8~84y2{=+YmWbIaQoRsrpzBrzn=1KoWtN3&w>Bt -zRhxl{tgm$OI|Q!yJow*6aGdKoXCNECTr+D~O1l3A?o}^z`ft#Dqv17qjhSGDGG}H7 -zr#VP&wiA5egfgvpG&N6EcI;o-{r%n72`*fk^L6tyR;03)z7{IV{vEW^)(~SSZLsfp -zVt7rcQJ&q!8Vusd2F3a1{Waar0`pr68oPG8{Oy{}+lOxEg7e56S``@2qK8yvJ{Zp+ -zm_)l`tzQ+_U_66h5^`-;tI9T|?{6VyY9se;Blo5M6|&#(5ZEd4m3I)o>!KYO?G&vE -z$LQdmMF;0$a!P(L5#05VO7&k)`_F0GyBpuB>V6rzHgPX=psG7ZPxtnU{v%(B`ugJa -z{SrCbmZYq;N*BK)KH-P-^?mqPsAqazTt~rLHr%BuH_)#W9EDnXr06oP>DLJkxi+s; -zm9w?<{Tu1qY_0d-XJ>IR=e!Xdze=ThccXtH`k2G-W%uzL*(cs|UrgJ3l-r}!oJ2pR -zkJ7i_Vv9mbmF?1W?+(hyc=s`mId-#Q5%Lyht;|uw9?a#F9Zu$p`_f!~Wy@juQ+MYQ -z!z(-Mza*w7PR}Kl*PVCtXhtIEP3m!Szo;S>>lan19%W!xz`5YdD>A(voKJXWKSwTQ@n84un~%;S|6ye4Mr6L(u=lf0=~U`m -zY@{}+KZW@t?3a5na@K^7cW}QB9e*&c-y6`WA>`wG==b-~?`7!sBk1>===VN7)!$~C -zfz|8ME&a}XGTqYeYvTI-*przR&0w{n)2UBpRXh(?+h*x?s^7IXud!}nzJCJuMYm-R -z;NUpy6ms8=UXKGaegFNcZn;-&BE$PvbboL6HGV@kN}JH@BJ9}8xL%K2pehfEUbE)s -zyK%kld;CyLpKgom6Xzcw>-p$gTU@Vm^bAX{^UK2p{T{W&;z4*Pn=zPyoZ2E?`= -zVIDzzlGxX)eiK{AdpmU|#+yhIXQ(wf4loAI9!V$9zLRwtJCNCp$hV5m%MGbX;QcAV6Yygn_F)I| -zJP{wT5?L1=ka}4I@4kD6+1-nLi(OX8_jPM-Zank1D*NOU_UW0(^Xez<({EVgY8;O| -zpJo5WYGk-w(<2>>hv-l<*n*6`*yF!+{PP%F<{2e#ANb#lx%j~vbWVKWBi_yt@qc2g -zj+(RlBN9_!v)2DRYoD=8!`OwYS*%;h!^g80ql0=9K0bwKf28kXGfw;>TKNO6H-ML) -z;1HXxE|1%EWZBQNg}f_%Gi=!zY|4MJ2Mpe`&h2$s8_~?T69Z%?#(sm-%CncWG5(6V -zC+5|&+K_``!^Zj(Th^Ot`IamQk7W)jj4X(ab|DLQg0TxOH6B@DJy6zoWWk4>dJb8T -z>*tV#eB@v}HasRPNj)D*Cf5CI$cOE} -zqI1L!i479lBl6F9Ejb9C;ZRjUD`S5Q8T@Pfwv4;wuPy&J9{-o>-Y}8*GUR2Dw#B!V -z>;qrnIrHvr@o$!IQ<}GiyhwarSmpxJchS{O_JfIB$og8LH=lXm+)K>+<}>e`%e=2k -z$-HlDowV5Nv9|iHz2E_ipXip2ev2(^Ll@f6g%u?a6#SI?AvL~iKe@HVbINXG>^z(w -z=9npKGc3BtyO}>?4&k|JA!yCv{s!hQPH>2>hKT7bU&Gu*2hTR~ZW4BEL&=JfQyhg_ -zR-_0yJi+?DO!fvAA``jf5`{*(H}%I+#xUI-s9#oa0^YsPnYoUD761K6%A{KJ0ocu~ -zXQ_L(mbL$zoKNESR$wbcW_;LJi+*f{%$e=FT=q?VYHLoMk4_OgkkEfcnN%&kOmLS? -z;H3Y~H974jE2qVdh+Ppm7T$sVS$iQge9CFcTXFl_$TK=CHcYPhHce#<<*MTRTswvb -zD@s<4%v`hzI%h_jiO)`cjt3duMeLP5feb%czoOtIyvSU(qCotF=uQpujlw6H6Or|O -z^8JI8uhVyUFMY3uuU6mTz046?F+Q}UK*L6D=6=4ZGUXTKR3eLSK%c}4gTgm*0w;de -zDi7a2f=9xO-&0-%A4@nDo8bZZVf!L!y6 -zqm|vzun}5iA48kU*uR6b_$T?k&Y6lI^Zlb3R+7L@#I7XP`v`X8ar&%p<;XgqLa>vo -z`jdhnNQvJmoIx6-?zc>lQv@uhJ-UuOr~w -zQyAC%Eh->ugJd4m!c@Rcj+2{US4NeVZQ&=!{u}(Hh&k4a@slLp6P(}!u$nvZ;ew;c -z{1kS1r^Kz+o`M8^vMr_SH0zXxn8P~sLR!}ea2wZq%#S=oyv|(6Y35Y~KlwGdieM>% -zFAXx@Q(2D@0e3jOZDCjF39VxI1+bLwsGbvGE}`T7>0)b -z+jz>cCy1A^RS7)hYGRt`?c^zssmdrgik)*)98d9rrwBbtOXu4o*%$DXjo>M}z*AEJ8N?ic*-#NLkDZ7wi35&B{q5X%S{LN&$`+FOZIV;f~6SbUSOir -zZ?NJO&0WXuTy%H>SV|{(m&x%u`PReWCiie&$N4yVepkvk|6;I%<;0V(lW!F-bo+bP -z_IHGF0m$iD8iZ%qZ -z39SvqXyBej19tSdkz(!NdJlTH>1qBOX#4x{<6+{IR%mKaY5p6*QVR8P-VW?RqOM-> -zA?XkMSSnkNEBg?{3a-L+b_DWT`oVaTzeX7#NMT$IJ6L;;T -zPjc;iP*s*{%^yzolq)uHcYtm9I3`NGX^8v;f3}s)P_1%(rAD}~jNi62lK8vAf_-)C}G-5J* -zTO31~6d49HNMI<1#NxGFE6NInvJbl*L^lLOsS@0T>v6oNB92!cCXANs%GeCxOET1w#@1ZtJkW^(_qSb -z@vG9t2b^Ur!`!Rhvv94*ZOKW#j|Gp`gPDl!YBEy1smQqCgr~upPg5pBE|`1Gy%lU!auCTgM3__-4tKIgt-;da4DVf6;>*8d_6Qal -zT04ZS^Zx%6)0=9}e&pIfuj-&_lcl?k3%Vm&FWZbayHaX&|=NcI|EWJ&R_?C;_ -zChreiq_;P+uclC+?yaS~)Gz#&Hkkix&yJZw|!2ZG;MqrVB= -zt>>QoUGfcW+yxvop(in0K%Xws-?8tA{{92~+yT#a>2^zho5-C~;oXDuZ3o9e+1Fge -zHGSK`A=e80XRoqb`a5>b*iJ2(zJ02{i{Qcg=6i2`p})tF_t#k? -zU8tvc4Qx^#n2es?d!JKJDPygDnaNzAthc|D{TE6bZ^`EHV(fu7vHuO$P>O7dT=s&M -ziCiv-%Vih+_<{3NA0zT7vL|wR3Yw7Zx#OnW4)$q%!(6jfe3XWnAwt)?YiTUpW8|`%AB!iuZomv2PBG(JRPG-5- -zQ!oADIu{znj_dGGu65{jeLcm^KAWDrRJF!EPOT|SWgipvINgD*X8-Z4$N>B1tu^2h -z(_;I;P?CZ{e5PP1uf{QyyO1N$dB+oHosuFi{W!ZW~}jt-!lHW@H8O<(tq)H$~vna -zzD+u%8r$8BUYX!{_l&{u-Y{?R4;#tgc#|Ua;0NLxODsQ?;q~<0zt-c7+2{A+_bKH2 -zXFRiF2Kpd#^fDfQ?t1mH{E?V*EOt@_$d*K-GwaWIzEk`#+DcR8^Hd)hD|8c9hUu- -z{kvj=XJ4->z1ZKK_po-Fn90SwpBMYP^PSkWf4|d7&j;8Ck0dg -z|MHU?u)*RZgVGOVyoi2@j|@sbxbD44{AAkxXD;%SrJ6xMrh9X5{31UI{qzyK8?-Y~ -z>}F-& -z84T=ZjcpRLza5!QLgvl*9s!d*0w(e=vTkBqoEO;^g>8}8kbQ(}^5V8d}Q}=S(`y=BZI&tSFd>d^n2iw}ontRD-I?xl#Hi2)w%`@?32_JSh -zcI&IuA-SW(*!Jzw%Ga75=^x -z8z03OTH`~1{()zu;H4h={A|1*Ua;GD!ET$tuU+JYC!rU>9gJ~YydN3fW$((~%M5oz -zy%+4(;r`_^Z-MNAlz6-O9qEVT0(R@84f#%Ji24(H@lPL#j!xP?kv@9CwpUXo0H!D3 -zS6k2dhny33ll24vkVH#l?-iPv7@U6H?Qq20nHxc?v2`z-Gt;C(CK;oh6pb8I@l -zWlrrj9*2knwZW6z6$tOsR0#OI8U`y9rj4*H70R$t}0wChBUtaf?! -zGVNX(Z~mpVhFAJ0`jA)h(8$ixhj<@9jqFN1UTTeBZ2wRpdf)Y^>{&{2U&~s(qs+ks -zqX01RKe(6UQ&ShPqium_A@%1T?e!=tC+e~gZd{ihgz -zkwe+DdL!Q^lpNc5Dq6V`ny@=r*85=lA5u=f`F@Rxt@n%VQ&rYlzZib41zkC2Pa0VD -z*tLGHUy!3)F=v{ESzlQ12c9f`4&B*F4lhSQ){`}3+eDvc5{JCYcZ_aLVeQ`CkNwDr -zFTW2Q`?l7Jfnl(l&?+_RZ2fe--`AYJ@>7qebcMjeod)lCWA%qv@7JoO_8$V@_OZUN -ziI_q5JSNurZI?rQPw3r2@Jnkm;!o)D^R50so -zx0m%kCx5{Dz#o@%If%y&@$HQq)*>Hg&5x`Ll<)t^et=zINVD-Z+x5x)tQ&Oi66{E> -z$@T>MI~UpwUm1D5=~rX_|QodpZ- -z1v{#5xqi(<;JIimp$1MM9?!OOibPq=pd3Xu7pim`wuSNF04~{AK -zdf9Kd8~nEq{C9U8J92UFA^632RK0iddmDScUMR6J#ly@&_=uZX=P)Ys2t$-*Zp*?H -z4625g^&bP-;%0Vmv#7FL -zIa?07TMPNskfDQn+b`s73A&!eUe}PbjqR88NpNqW`@M*a`y}3#zGu57Z&QyCT79|} -zxh3{#2(fP9E$G+5A3b1Qd*H`G&2HhFVR%#szA1dHp)XtM3v+gnK4R?}`m&Y2$aM$T -z>_@TYCC2V?WN!+6A%_RIlerIBD{SE)7QQKSBuQ4@)(0IfvSb}w -zWIZE3xPxcbzOdg#Zwak}N0w|l+!9yHnjdtyT%B*4w~2CMR}=EEh&6z((T0q9BBzpZ -zep=ch2HHUkByDvh+9E!2^Xxh5lXz%BN&UzVOY12UTNiQ+8}}>XvV+f^mNd?Puk$MOS_mnqb}S7q&&eb3JkYslQar317l>m_RF -z|5o}h`Vm6@t!MPVfM=JEBY$PZk=t~=UvypiE#D)rp>JF1o796Jh}A>iX7Q{g-nSZJ -z&K<;@h4jA}-^JhDaf4T6RjF9tqMUa_e;EC#udgBI)ZAN_$M$OEu+}j=D1D3Vft8qZ -zg49i){>a&djdF07ah6yK89O!19DibdpFg2AAbTTD#IhlEm!+gi2n3(EHj#{6YmCyOrv=o0)Nz(y|p^ma=q-&31&Q_mF3Dzxv+TI(`rH^PzdNcdaN; -zgzdWnn4i3p%55d17VwZI6 -z0N-Wv=WDE!RSxfQ;>E6Hm1 -z&Btc*CHVt#&3CUWUC?2(>P+*>dW{`cozGmT(@&WYF$);rnnR4y5HXYDcSud?SM&9X -zsGbtp#u&Bh<0GxifrOExKK@2Y60|3C$lnT+Jm@5AbBg$z3wdDj*uJ0(T;9bz4&MWG -zyO@_LGBkf)d>$qb9CB<7*{qxM&asCy#P`rxpA-!9J(=xO)h%cF9U_hsImw;HI)B+? -zuO?aFb=i8wr}5>YZ03WJ#f`eMV$61#tA-aMdm?j9Tt9n4Y)rZpXRaKMeWSh)%va}I -z%@TWRe5YB(ztc=4^0Cf$n&mqiMcCh#l+xLu`|;;WceJOZ%@+C9(&w{R4qL)K_F(qp -z@C`WG-!A1vw$CE_Lbr>xY_V7pT#ontym&I(iYJ>~<|(G52C4(TEu-+6ares_A<>r| -z#2^R3;z#gNzx|efn&?gm_hg**Fy9tpoFsQWL~btfUp+rIW+HnsZr{Rg()TRG(92|= -zcoFuymGxuaEv+RNo*AhDE7bGByvE$?BaYYSfA*eB?mh6?dy><`zbx@>$R>4GTXlvR -zGnw;@+5f3A-=?N|Yth3&WYeI0j-h)ufTe$zeWX&hb$RT&hX={KW4XTa)=^$$UgTde -z);cwF|JXGr>AXj{=$-DJd%MS$;b)2H@o2W-(IS2Cc -z2YmSv_U9j@?BTiX(+)C+%X;W(+m*)O>>3}*BkmPFC{)Q_JL?e-g2{)mYsV<_T<$Et -zV0$I~SNTORiiqP{i1A$a)PnKb+=lCp9+7pC^Ew;+cO~_-61U0kR^qliv%&hEXWrN& -zdLcSt>BG_JoIYZ<6O834Eu{`@#|%xT!9 -z6l~oQ?4rnHFgeZtYI2HS)|ZOUJd2E<`f*B^*hCNImRR;H)q9L_3MT8=#0}GG$rYr& -zAhvKXHnE!XjeBza8E`eSTw92)7SKdS0C>3&G_YPCvt5$vMFVy#1 -z+#Z^=c@{pO`Z4R~TX0c|nFQ?HL&S`Ato2@Rst#XEO`6FX+uF4$k -z1P>Csb&7tRWA0b%KpuMl#6}%MC&R16Cug{ajd8(euvvn`9FjFMjGx#eDK9qZDEBUH -zms0;CyVOK|VwZ-Xk$p<;bI>8*TbFss%;veT@rH~0)NpMKSdlg+@I3rN;P+$WBrfV&StyX -znU}@it;l4ZA-Q}p-xFxP?MC(ysGSlMNi0+azM~I)Hir3RkZbrd+`kaoOlV`>JpJkX -z*J$N`7pp49IoztbeJ -z?_-+1U)`><#je&+PZ--0;#*fAf!U>_$G_Io%VeLP*wpJwSBz|C&39De+rHS;^n8^y -z_8ziQnLhus_cXcpz-RA~%T=bg#cZmx^s$lWOCB3xEl@-Qvp*YOL))%Rwrpy_Yna1eW#%DwBCR~KxokLd^BbgC44$lNM)av$B1HPa`xiTh77S9_AV+LO%H -zhO~6YhujyQ4#s)96`smIDv6i>Qokl~y7;vvo5Zi#f&rD~7n`)6ob8~ltVMJbA#xekos3Ky+8f?vUTF5gk@- -z>|;fb#|zCD=^=j$FethxdKe;J7G3NZivA?rx~NOWxR$@;lBTqN@|Us@e!+#kF-x5N -z@-0lkPs7v)W)8*}(ctL3PA4Y{o+ckSXXPc?);{c6=)>2HDgI&X%UGRrCYd{j(Pg1uzANeDJ0y|| -zTuSE(pHN+ePw=;+veanRHz}l5H!heY?m!l(N$5He!F_t$oh9XOH$lt5|Bm+$O2I3mlIGjcIa`IKf -z+u&W=olg%GY1a338pg@mDw}WM^&`<2t&)=%3fmOaLIITf*THQ(lJ -zzmD|^%&{oGD^WvkH5iS)kADd$C$V3A4}UG+@=W2In@K(`P(5CK+yZ?vREd25gjYkj?ZgNRt9wnYW1 -z`G&ZOeU!hYCjE5sT?Wao`Y7wc -z+_NUP`SzMw&9{#&_ZZ*x?L%JfH+}P#`S+Do@IXi**_+prCZN7sZEXx?>(P*X8-&% -zz9}KRc}Lkk{|q}Z_Srk?o~tj^xi;~P90WQ)^Gx>dSo}V}@N>^r@Ju_;zB%N-h8XW8 -z`M&5t@0sXNMEHaS<9=V!&<4P)hm3LpxRE;}sP>nwdMPIzanB=cA`2IBXn*2>C`MYQz@LmdhlD)S3_@1-B@d@qwdUzNGE5svOEZ_(Af4&H0dR^4Ok`YB~s97a~`tgGbj>d5#F -zF_)9848N4GqWx5Ivg+CXf!@qlPxt=o?@xC;d*rldUGI0y^QH3reZMPT1)TWH#QSF| -ze%kea+Pn7nsH!`E?!5Azgd{*9kqi*z=@1?YDwfGi0zn`|Km}iu$;>1fm`8SI0s#?Y -zq&})`gLwmuL8WW0-DS7<=&oI(;x65Gw^Tr}t88d#rE0sVZG~3Iet+klGnq^h=|{VN -z?frc|-}#;UJHPY0=lss^o^$TpnR_l3V*bfxAN>gJosM^!(f@Pse){aCxS#5SYys+Z -zsgRFFvp!k(y4oiNrN@>Q;D6T`7f&1dZhJbbdF^D(LFLK&!_*h&@%xnb7Op-vW5?5b -zlP^{so5qq?8jWRX2X+|NJ&kv^8x`Y9ywiLozW<*!u!My%X0N}H&n|SQ;=R3yCwm_I -z*{`rK(rG+bqJI7Z)+c||o1XdX48OK!_3PNxw_tCr6FOQOV=utzG*6Fz#)7(@R9M>- -z^zG!$4KGek?z@fVfYb2H2JGKu!#yAQlw#~cKL0Py1?r0<@GbGzd0dHooss`)!toDr -zEcYX$-#|Q`hkZ!lBL@GgdmX*RuLs)iNUb;R$1=Eg3+)w!@2xxaa}i@$zdVex`ky|s -zmflH&@7C6zM-2C)9iEBoXY|fhdN!kx# -zrKFPcGEQXv3|v!s^fT@GM&Bj(VJ$t&+_E<9`Q|s?$Nmp9FFn4Nbd6Y(yv))*IB@il -zJ=2--kprLEj~y_uL(^!lGUQLe?~k#6&+aRaIu{q=Kd<-=aT?w|i1)dh((J%g{Kgc& -zkHIm$2i=f{-osY -zXBU^I`M6MjyyH} -zy}}=wZ!b{Oj~2dUzRjYhHy8f1d1H~9zOnG1%o}E?>6wK;FyA^yO(z$=XuhSm?}mX% -zFPKkFdfxmL*2BL*8%$VxJdXZQz<0Ggv3thU53LrdaL;|C1iS0u&}$+1pYKNgRaW -zkZ)-+6*%b|@Yx4sTnm -z9&cQt@(s4W8z_$SB8Dh_D5fZe8Va7QzSfS6i25K -zM-2P+ytnIx3j40-@jkf&NI!@4A*7$G_~ouAk^X*#0sZbqycyB=CiHz1`reMb1G~O$ -zHc$*8-+{a*kS;|&-c4u5|AhINLNQXc>nZd7hzp7jiWQ1GO1oPSdkOKP;D1kljd+oL -z`eoyzS&UhqtotGM)?>41&Q|9e-80YQcSLW#zx+ZUo~2yMVHa#Vw(wP?U%|~j1MvNB -z3#+_(x0}u0?PNPX=JO}!L^o^Nb16ri=cg{F@1t^``DEQ|Pt$*Ln6B_mJTPga=Y3eC -z9eNEm+>2@7Of`?@9*WgZ);)_o(bRXM;amrq&A^}CeTw=id>z3q)Sja6md-DtdY{LB -zc4HyO`^(;-`G10?>5VCP-@KyFeFXO~v+AKszYPjt{(er!(q6_px}L=~duXSvmGY%- -zjnMlL^FuGLJ33}~E>MW~x;4>viO{_XGMe+{nu^vmpR7C1=ftP%*z*SKQhI0XF04`9 -zl|_#vVUbW+hkHiYJB>BB-G=wrGW`dAIJOyV-zl`Qj}(j(uORON{PJA3VdZ_e_k0ev -z=)ZZB>vtTZdMbG4LeFO=;QT*=-lfb*=TE!w-J}EmpT_;c_c7m|#=YJX=r@Z&!MwWT -zV?8UJUzOD~aVgt|^dylEA$^5N`#)B&?~MgIxc8lJ+rfTtDan4Gk3CcMCoW>2)Qfty -z`y%#2eHq6jM}IKCuiE3S@w=j4i_7m1xhdfe1?t1zNF)?yY?Et?Yp&lFtev~2A-bk! -zwKot7Zz~IjDQ~p$9&fw_RnHexPvUV!T^3)&Qtk5a3~s+6>hsUt?yH|$iri(PaKIHU -zYjk_-qrMO(1WpY>Y18YmM10%5WW*PAx!nz6)R{E|HwQyogO<4VguT&*a1gEWc!d$L -ztTEXvIVr`IYD_bv>oas_C37${mcm^HCIZYu0KTbXcw)lvOBnnRmtoP2cU%Ff0EP*c -z4rBnBUKrWR0>%K@0MSre3T!E`qk|0{%ITr2XA^K1jIL}Ra!UXg&UPR03N#gbm3W_$ -zj2EQ>`V^)Z0299VN(S&(BP9#SOJ|A&D9&Jt4XBbp1)5L?KnLgn17HM9KoXD)qyVWv -z8jucT0A?T)$O6Uyc=W(>fLvfKFb)_Goz#9dJFc1h@hC3a}Kg0VRMP -zZ~&!18L$jk4wM5cfE$68z$#!hPyws~DuJ7TwZJ-HJ#aH{3ves20oVxK2HXzZ0o)1P -z1vr5!zy(wTZomV0ff}F|r~`b!CSWt*2LeD42m$rL-vD7C0z`oZU<-2JlUw1=tNd2DAcgKs(R@ -zbOK#KH?RlT3+w~F1@r)q1HHh0;0fSK;3?n$@NM94fv17*0M7v51)c@I2mBrI_rO8m -zAAo-Zz7HG%o&%l-UI1PMegOOv@Xx?Yzz>0c0bU0BfLDN5f!Bb;!0W)j0{;da0e%Gh -zJMd%RC%}II{|WpQI12m>cmp^F90yJSZvt-tCxN$tp9B8|yaT)ooC5wE=m$;%zW{y- -zoB@6X{2F)s~eYway-%1f?WFlU*8z -zfE$Pa_XAG?uK~XVC^F)S4t0PYkP%8fPLWCHrE^XICIj<;62JxA2fP9(3etcABMOY* -zeiySNfbdq*fh-^oumHt?4X9#qMA5)Qg@T2`MWqx$sR@*pKU5X6Jzr-u{iPbV=+I!;7igKUy{^bPEJlrGI64DWK^Po<}ze5 -zjk8=iyLiDh*Is{vt;A8btbE0dD_5;vQ(1Y_+I8!1zWJ70H*DCr@wVGgs%;O`A4t-n`il3V?#aU&Dyf -zxC;$-duwXze4Eglfgt)2y@!6I4x^r;2Hkx(+H%i5XvV$wq6Mfv>P{6$tx;vFF4dH3 -zNj2oPqnhzb@e1*}@LIHR+Rf=PPOU1nacWnoLr|xnE -z1(?AmVrI$1Y&MRKWx1HyvN79aVWu-<=1IqzC>66%GS*5atZEFHp|F1lvn~C~4NI=S -z?%KtRuDN>Qg8B1`=UT6tGkey|8Pl(vRy1|WWJ}?sD+=-_PRJWSZftH&_L!_pb4Gev -zYD#jF$!O5)l)3fckb7>#>#v#XYG~ZTlzjd5`_R7mXkanEs?4B7>5`!&jemx5C0&f9d41V~%fq^dYqu>X@d(WaC;CV0z(6ke -zLj3UF173+QuNuJ*gFgk{5B?&!;T-%;!3(0eB~rHI=TnW7l>Bu3TLZ^fQm|+({6d)^ -zlFb2HAX`ELP!V7QUV^L=oRwTvVzzwC(4)7v>MBmXd&~?8#8kEpI0HRYmlN6A0rbbp -znk}t{Hho!-t~~Ylu~TN|NV9XU>eH(3SxVN4^Ou;jT6H~2S?Vb|O&Xo!Cx8X{@*E`V -z2MQpQt3u+x2WCLF7@P?^rEzw05tHR{b}Xb1St(=(sf>tTV4`d};T%J!2g`*}5&%%Kv)j?VrDO^2D3e0-ZBaLO$z- -z&3$;_UYW*i_9?A-ZQ~uCxm`Jq?(98dmbZ`V80*-ZwJ)>0$E=^N7|S!(n97$YTGH)6 -z#!gdt2<%Q%c_1-g?W1&DLrq%|8#oma`OgAbJ!I)z0$+kJgscuS>O<+j71Rx&T!6li -zZ;Z1;aGC; -z5y{R#_B3Q|T%yX(LpGxkI0qSC_(kpNOR=|iC>`xeX=|6#)~S?swkch$ -zilgT-MYrq}b=$Gyyv?Oh$Foe9j2~1i1gElUKT+>2>&bR><#guio;mrJ1AWeWTPRRI -z^<_`?O()-CHWZ~Vt3ShdbCeujVm_#}j%yq1=*;dKQ{JB2k<*>ECv(|e^S+Fpbp6Y^ -z;oZn>9EXjE9>&;!u>>|+l-BIFF^=}Ej!Z{)`ku7Xy{Y?B$~(q#}1r|6dsv17vDMoZEx -zC|U(O&+b8gkWcOACf(Ll$|~ib5G?_AL1*7yT-S6nG{kpn$T<|}6yXT)Q~Jc(+EC;$ -z%6C1Bv3DFVe^hCm*fzn@p4Tznu{V3)n9}atJvrr_wu3MY6|mG&r(cHOcQrSYs!rj8Kpg@byNfDoaG&9?dguLl+IMgo}}*Nsy9!RoP4X~=Wol? -z@dEAX9ci7ZT`Aqkdy;xgC8=+ouydu7v~sCW*B;G#OYi~|sy-3PqL9sjEPkAR2(lu` -zC?1IJ0QNyv3E4umo|UbsZ7KF1{f)Ao3Q$@F7Sw~WP@_JO@ZK^`2smn<9ZBOn< -zqI9=`Do2vHOVUb2ijPyD(K)dpy&T)$!OLDZEI*g7^Lzmv( -zqmI;a+*aqxa+EoQGJM>@oYJFnz?W)!J;-|zc_+yph{m->$aZ1=r?HMLGuw>i$;K5) -z4&#j`BYros%3xfrH&*C$52cz`n95BRrd6iZrW;Kwse5iRGl*8uAs1JWPmjRf5&W=_ -z)=xw;fOjCHwMCQ!CFbH*Q=8GzZs?#%wvwDkLyWyiGA&Z4fVj-JWOyQge?n<7p)!`#PpNQE@Ir}RvQ9a>A&!Pa@$szRC~ -zw#RS__YWOvq$YTG!JMV&^(}dK=Xj+0nG!N -z2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk4`?3HJfL|%^MK|7%>$YT -zG!JMV&^(}dK=Xj+0nG!N2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk -z4`?3HJfL|%^MK|7%>$YTG!JMV&^++}*8|vmic_C>U-r3+^fFAmFPnej-Lc|*oAMo^ -z{Qa@WqgTKZ?b@w!+T(+$UzDf)MTqcPOimL8KP&PJ#Iel(!=-@`iOz`=;}x!)=zZlx -zc$F!qVo@JaU3RlL7R})A;v_|SO)=5g0o9;TV-{gwzCRhS5amRBq7c!0LW!hYCS*O6 -zMR|ISE)l)^ljzcbTK|4g(E)KR)EQn$&fE8QA|Lz9@nhLe)yiM*^StnLqQxCddLl7r -zdn$90w&%PVf4X_+_QT5O$XnO{7Ae(}P23oJ9%Vhg!)S5#zN -zRXh_#sDJ1^u@tz=ONx{QF6<>Bf}~XNk#uA{FBa__Nk_(bi-`4+bSlL;@A%XG7%~tak)I>ao*= -zWq-V;n$}|vioPdCl4r%n$M{^@Lr{*3L*>~_j>kjgIc%isTaULszbMALq55NE+D$64 -ze^vSL{-PR=e%=%&uN`g{AJUGzUZkA%#v0vD8k5(%)Srz6)jv^A`$LetNlsXzfQ|Fv -z{p%3=ay}O7Y$Fm%T))W6)y5Tu$B&om50^g*In_tb`@A?lY&s#$;_bmsfZ)_${X)+7-heC%0YGvL9h~_78A#dqQ3h*y -zj3;6rv!PFW1WGyW14mRLe2nu~0=flUPZhqcDx#}UfqZh!`gII{6{20QfjHO7bnQC -z5b{bPm))~S$m@k%xSQQ1PiJB8e`N0m3KjCD$VA&0X#eOJo& -zsmGN<|9K%lC*&p^6WRD@ChJXz!yhC6^RA175AuSs4{2w^cVZ%*c=s}P&OJ0#U)njE -zVCT1&vD5$XP&=POpW;W#Pm1g$j0Ys|`X&*E -zS4)JQZwvXs0#(58p^$uD$oqs`&I?DmeE7QSO`%^T=Eo{w|5G7v5q5CMDHk`sRG)KS -zRgde%by^HLt#hQ`q(1FEqhN=(#P#q-VQ0OtFQ?C~Lf$9hHdmatL&z%=>hpq-7mEQ# -z>c1uANAFV&SVV2bZU@gQ7k- -zJ2-i0jJv^3VI`~$itjY -zPsmy84^_MTPERxxjySP1BXfrW^?q;E>#-J(tl_Nj1$|CeIPBWy^ai8hZLB8j3V5BK -zhCpB&io_i`p&1>bx(P)aqCUUX%_zCu@2hrtyfuDT)Eh7I1*J%2LWwFC_C_Mmt8Vc5 -zJzV7RI-{;?zZZ?#FzFY;#5$ -zs-w_j=pt{>@@<(Eg3%E9WoplX0H33)9NsWl*)c6}B -zb*h1wOrFqL<3e0S27MH&kNN_>?Ovge&~i6W=Qsntpfli#y6eb&!|nK8+qaD@oj+V$ -zi-vhdP!D=tVJEMF%O5KxyC$*MVhY~IXxQbHYSljUoAj%ig_5;Vcwl&r=-(kZLObFQ -z4SFR`=B#!_27N0Gkn*S*j9f>xN1Ta}bczsiha#x0xCmsQAcnXk?%3t=d&3LnBS)m1 -zwcemN>>E4|dPBijCLQ3~j$+GI5A*mU^}OFi(U_JG*Ew_7H#lp&u4n^-8|EW!L=WxH -zYITQ#5i(GZT4OLl4AM~IbS_(4vbxM!R#ED7#)rD}xU96ZI@A#K#A{I0#~-`=zS^MI -zgP@{|gz-@&K3@zS7_j217_Y!DqrqVz6pqhKtWSKNE1X~y17RfOtaAn7=6FSEWbh>M -zxkEZ>czcHzc6uA*%hSjb@CHKRZBFh27lz>Ye0A`U4o%2Y10r5MA&TO&q^o%sI7>HH -zl&oIih*wA`n@~};B7;sCT9sNfLsk-lDI$G~*N;HKBM4_%xrmqY(zOt+U+oZ)<6ORK -zjlE=*bIr14>&n(U*O%B=l?{ofAsMoLkyAE&MicgWKFK+q?nW0~Dd^GdLn@-WCBAB* -zdT%iP7_~>l#Y?`VTX-~mNgH&Lf6?xdPL$n)g-v9LPn^!$00J@+bz#1AVwK_@lKlm% -zE>FvwANIOD@h;_^H%ixe!{K1ai2&q_j`&i{irE~?81QIV<#jR@3}Izd8*H%hHP2N( -z593F5u1FoTdbR~oQsvRGnzO|lj!+zNHF4lXUfAn*Q2~*v$HK_U-EWOznq*d5)gdqB -zaYbFs>a7#&xH=EY$|JRex}Z}_$TXFrQ@{YPjw^u4$y$p!ls>HdY^vpITuGQ+0s*WY -z)k^Y~SzXa+*jL?v)kysE`U|J&IXZ4Ra4)5jd`>5Mk&sI!@2BLk6^TFMS+guJpXW(# -z6N>mchm&02i$mo7^l-xpvK~#S_x2!+Oh&%x0$?~!1lGG`n -zWKm&xepz0&KL{NvZzpAte10jpC9eEf%I8{xzbk0OF{$9TnUlPqmR#QVifn!^nI=wA -z7++pK50$*1l;TL5ZPnMV8Q=J#( -z`-K0b-(PtV!@*g2V=TB^>EHB3|sW03qtTXl}WQd`L -zt2BxFKP@yYvVbs=GSC^USvZ*&caa;%l2&+j&9pQI)Nh{|PC? -ZQ9^b2<4NheI5jq>K-J7jD3EZ-{uco)TXz5e - -literal 0 -HcmV?d00001 - -diff --git a/native/src/main/resources/libdeflate_x86_64.so b/native/src/main/resources/libdeflate_x86_64.so -new file mode 100644 -index 0000000000000000000000000000000000000000..cda376fa2c627f3457d3fb5ef79b2791f47118d7 -GIT binary patch -literal 61176 -zcmeFadwdnux$wUy*+8Pvi4rxnD8X(|iMJ9DShj%8;NCFX?f@z%tyr~c6zhdT0@zYb -zoSlT#aWwVXi>LLRdfxihp4XnEKSWW;=8^#30#rb)8mLN!2m)3JDCGS&|M^V -z)nlS;$_F(!$bCyoP~phyAHx1}*W7oP@}0o>pZ&|B{j#vXFT=~Ou)o|jeAMGBp|gDc -zpEzk+XJ>EW^-=$X98WyT8yQ#GQOXOMhojXO -zxQOte+e7_^^ClSUx3eCr7VOhV8V6?c~aD2+Qlj@?1NSYp%KJwmWXWW=_p@ -zvum!oCUQ+`YSlG2+&KHjn`X|bxpDT?s*7*EY2A+ -zck9d_-59C4dG;OilJl>>aaPUDJ8q9$a^2kPuDSk>+pd{=AJS-+1Hyw2fJ_ -z@3Kdp#@nu+b!UXjoEvK*w_SHDb0kl<-7)vZ2-9%= -zd2{YK?}Et0bZY#?*PMS|#mL^<^UoUvRlzX&|9t)p?hT|w-+#R3&*0rqUgzZ1LqB^2 -zF_IrC56fy#omnXDjFcw$%gOZ|{f-FfwltL6x$<3MgQGk2XOUca?z!@a@>%Bx^`;+D -zzU%)4j>_oTx4_ZZ+J&=C*@i%hc8C-E0=eF`}-RP{)U0SVc>5V_!|cP -zhJpY8W59MkDzM!F@4Oy~*bOZ;c|Gm6v$9}C@4$LSZRJ(ZneX$jIkb{HdA?cR`yD;} -zo%xnLi}~TV>*w|IEGCfOqMz5wvzQwGANBJ+JXbgKtp99p+?y2G-T?W|j(69b1UM7q -z9&ieKI?SPUQgKCirT+ic^+)}aT*?pG*+coZ+GS@uzhxV(_PRqgB{XnS*g!!~N3}UL -z(f57bxS70))P7@{?Tp(iPQ9%@s424Dac5E9c{Lz*-poI(11z46t8@M4uKtgCS$&>4 -zG$T+&ny1<7jmvHIS%AkuJyS*q++VTX!M1wOR;{*s$t=OBt+rovbSMir?01~tzJv3HU5QNPer;IL`|&~Vz2AE$eI@9B_doRO -z|I>rH{@cIUe*sP9zSr&d!cZK*kgQnK={ypNINe6gd20D$p`M2IHK#cT^5&ldR*}B4- -zW=)-zP^*$^wT7_%qn`sq+PfiEoOb^ZYnKQ2q1a}w-}cg(Xj+AI)J6%wIW18;o~_-j -z)(h=)iNjgmO85~5t|~t@M@~%>^IEJ_-G_zdDfwnmySiNyqZiw+M61iUeVH= -zaO1Xni*gSL2brzd_&r+-R`Di#dK-JUu?2(Ny$UYI(?y=AxpD+{C?85?-ZIZK(xGaMNZa -z6h(IYKy3#!Iwj>zO-2%9rp5})CWltcdoui+aBq#3ES5%-4Li(+m*vIKhy}}lzofe$ -z^LetNr{-hp#QG*+~AK1?F -zJoC9r4pBMj4!PGdK1-+}jurp3w#8B(3E9M3=fpIBCe&72y=ytGM$&lS&Th?v7zTIl -zJF75i2LS0u~ZOyQ*w!UXwv!ajxEN_C5Qmt+}Q*6asOy_edHms=u$W@C) -zTvn-WOTDiAD)pDNTE3xUUpxF?B-25~h;Cl_%cSOpjsR5wA0(LKqNLiDP#;?5w3bZ{ -z^EZ5G#rK;HcY@H|2$Q@}+pX-Df~2uJnICnPZ*36rC`cIVgx@T+#@IbUMcw%7d7mWI -zZra=Mq1p{4CE~uB8A8X23V*50g89-KXZO(Z*TPEPBvAUQRrsmpd~BEvKcJ?}uQ$m^ -zxC`zrPN~=Q{Q8&iq7NTxJLrUbVnxOdK_|pnpi%nU{XIPb*I_dbbrm(NF*A!0hiP@d -z?}69*$T^_oBT3jFtp$Q#%{NKm0bz2>OZ8}E3Nci)B;xDLh9ni71+fxsSg!f-q;@{)mCf6Rx5sB-uui-LcLz-3l3B^yQTP8xnb%PMtj|> -zEvje3Yd>^EJT!C15#VlZqDqg3kq*I^c>}S6<>pjkH&C -za!S2!U6E3UtZ7y14Qpyj{dL;q=%t%Q;S9IWJ)2>q>bvD)n-j9ObKonss)^Y)(2bBf -zr73UxHeR)+DVb97cEt`G)R##oT4$wIXS%$@cDe_djbA^O#@uL3y=iagunRk-Lb2NH -zygWMFnNQ)qcBf-d%2;W;Gh)T|x-RE0`Oar~X66y(V8h#H<~1#@ -zh8+oS>^Jl`wXk>HXQ!Kuf8d6;Q*GLqN~uq!iH_8U9kf!uBDJrbW^C1-9@d&JZ>MKt -zA6mz}f0`cDIeJh4wlO`d6I&@|Y_d0epx%Uz8)Za(e!6f+m3qh7GALF4YL)Sk(=*6y -zs^D9v2d%S9Blm)|7yXv4&bN&N@~>BPVb^he{A#=B+p5BLM_!mVmfLD%JZ)rC@z>{V -z(}vNdMo9Q)UdXJWgr8~_J$Ab@=bQ( -z&Xn=Ft@haJQ+wEQ%Po1tT(nkgD&GLM82aAUO0(ffa0DZ(`2@hyV;01Qo0&K0f*!1e -z-%6p5!j9%WYP&VDGWBNNXWyJV%r~HrX3Jbu5=%KNjbNsoY(d@rZ<?L<~g7xXXVZPq`9_BTnwk>!>K;pR+ntH-ANr>JGesJmvnO7#dR0gZm!*_ -z_@;TU_?tzn1bpcD`C`wNF(=NJq1YC)AGXU^!vei*lYf_Ena|xC%hN`{zBj6^G3Uer -zxhh`{H=o;)F7LMEtIYd12_h6TzFI%pP#*TDw!OGX$I3dV{Z;HY?o!6by=m@ZRnbn^*z`3hTYP8%Ke*$I&ZgKX!;*yBtt -z{8tYKZTB(#m{#3V12K`0^jS(9z4|!Y3Hd_Q(1ks07xN{w3Bl9yh8@C2Z^J#d+6QtC -z7|d1&g+DTX0J^;^%glz?m}r%?1NI6U%lZZOhHdt~P4=*Tw$XiLgLf0&)Ss^AQ)yYZ -z>VH?u#E8Aj2>;AQ$J^%9ujl*@bqpYs>A9474Ck=ZFVTXXp(3fQ)`zRMtfJ0)-UFwJVBkMd@UZ~^yI>#f$8}2+7G7+wd3*8*pGp}ysxlOtZq@m9Qj?)U3HJ8s^HwDQyCTWn`P2>%oPrrfbw -zLv2%U2GY_lJeXFmgG0OgbuE^BXUpA|d+&XE+#7b3znt}po&BcSG)jd1MnU|-q6_F@ -z-mj57qi>0%jlG~r1b#xj)r0!9o;SggwHR&@%y~b`3P04+R9*sydXe_(4jPJe+p3R1Qj3xh4K5iBR$L7Yn1cP9`H#;A@1e^VM -zXB&jMBhTr|yLe&I$qDZ=BfRQoY=`hM>MS21w~XUtujC^CH7&9#BhH6+t97(6$mtrC -zHgA`Cmh&>;uhMXR-an8!r%YJug*X?aZ7-gxJ -zYFily4}_)&6eYdtU)ynMc=g5erw@3%|$80_U55P?#{CoPBxyvOPhBfMbzL2;JCWE -z?z1z^Mn$K+LeO# -zhd++$h_~1NHRU}bYiC-{v_=ZW&$JPQlsA_4mgk|w!us~&g7A+oE2)uEx+3+P5I)RqFF@hII&I5kKE>+Tw;o#(>#Cn|BSzhZ9sbv4 -zz_4~`vYg?cL0f?x0ux6=y6w<(yGrQxt0CPo0OtU7JBbEzbZaXbvN3Us{eKqikMRxx -z1C0L|V9`G;m -z?mZ!(mj(9~2%SUikhze%KLj4q(D@^UX2ndzCJ>sO)k`dzKyuV^I7MB?=lUc0;vzwr -z9%KvBu%acf2On-RTKoyX*nEV)V=WaWW=%_}gGabLrC;juRB97S`!xMs9y{mq6w{)f -z@!@F<^PJ1G1W}Exr1q^Gzh&Q$m<**eKULVJ-bLNp0+2MsF+#*<$DlO&eKY{2RZChG#b8QNbtvpI%S|^#4h#2HMpkb9WZ$at -zmvMXW!xz2_hCMB_q_M$*&oPaeGdjmV -zeIzjV`e6D2xG0={yU_2Qd|Rzf4{Nd9L_ -zt`>Jli@6_&-FGzqrr(q|J3Fn1MTSq%I{Q`7to@Xb*7NUL@wOU*L-&*{ -zv+z}B<9E)&@0=}ur`ed)0<(w!W+kKjuYQl;8qr2ioya+JQH1`>?4>!k37@IeR^x$U -zJP?eh_whlmuLHdB*kJgSR-q+3!#^$ -z%MYN~&HHb{rNfkZ!*U;bSmcV@q&6aPFkJSwB8)x+l`FS)e)?+phLu}i-nVAu)~Fu*1~y)%p`IVqEKB}g=%fDtbzxjACU!n;cv*4c8M$oatd*v&D!$Tl<`;p -zF${*o&{YY`Y_5`T-*I+|yO^KKb{=Q7HUw^G$56}ZFwwpx+SRl?JF21xwVbPo!GpVo -zpCbh)(3iC^i8>pfnR=>a{lK_q5nBi37=tmX&3YsoX`Ou=A2NG8B;_~Pd76r_)Xwd -zSF9)Gn-6CE`v9*WMAglX_@g($)}cQts}YC$qls~mUWYWe$0L;+aY=&$eA3_sr!=_1 -zD-CXBfVzPK?U%|uB`48jKhN~sv|88enf?d}MC+lN3tyF>G3ry!ChtNv+w78)V0`b -zOik#crX87~ooV&)kv^(?SKPUP@4kzV+HV>fzJ<-^J2V5oi@!RbTkWr|%lWJ6<0AbX -zRvr`HC3vjC4K6D;mfD>w2%J_aTbMoxOkU*ws}|o0DCsc2)&H;ft+&xevqTV!yUyru -z9~WsmT=eT2lq-{hex3Jq(XE6xgXp2z^aS2jpnCBj``nXeF~f`f6iw44@M-_62|bTg -z5iNn^wG-c~*!l2VE4Qxxl(oitj}PqVv{&H2ib>nAHSi~tF%rtyrQXFN5-km7d^jjo -zz8l*|Tl&};f!V~g<9^x0e4O4~ZFEtuDEe^F!o2Xi!OTzq-_iXqEr0O88Up`od*1*L -z_rD&FK#~0bu5Lcu4{H!V?C|$r;*ULCNzIhfAJDHjS)pIo-yhQgL;GWRVk636ZY>tt -zqA~fvAArmU$-*!lptt+eRkkQ%ZGx4r5KXf~{FD07KhlQP*SnJa06fCJ((}Jc<{wY& -zPcr{GPwWZW$j!g_I>qYUlk6yZ9&EHdF=5iu8U -ztW=Lhc!|jz8|yro+10*K8mqHRY{ycKSm9pMUB+kNyZnHc1coJpZ| -zDR~MyAEvY~UxW7r%Z8sDiF8Uru#GJU^e4U`B^7(YV`tZ&Wei!&c>pe0;eS;$N^iPF -zGx;)q=wHxt=JLaybvA;x;G2VbPWo3~RP;#urtK{#9c1r&+aC6wttMj0b@%3n5Qjh3 -zcJJ=)IrC2HH?Qc2Yi-}DaWg5m)u``sSxRHt^S-R3{hwr#1b+O5rg^PjTY -zPqhdxZ#C2==k>h3**r6GpnePW3u@0Jb70`yYxUZV`A@35{&h_7y5pp+x^0G;=vL!O -z=phFets5-j4P?DN}`iY$m&PQz!K{<*Y8)yP}Npt|y!8B|E3?DmAX{ -zDZs^lkzTilRl6286T~#uUp~o;K5Dt8@r`p%?@DXFSM5?3e|gS0uLM<45Z^OzELjRr -zwO7=HpX3(CH_rWY!W(a3u~D@t>6TjYm*=(-wWw0r;N#gVEL9rhnN+b(CHL0UgnP}D -zv^RNp!o6wgw97B{&KZ(yc;C!40;l*9ys3D*Z-NtU<#4wkX+FKeGM|1Wp_b#(mak2g -zFSp{WEpz;O4E3n7Ast^``$lr++pB2=PqmQxf381demxSIcUt|y9#+%mowPVorlZ8= -zotV_iQ3l6Z#)|CDB0W_J^XU&0#$OWgx96M-6n*`>#ci}n=F$}L38K=`N9vBL6)kNO -zr%1UhTlJ?AyZ$4Q*%d7*wg34t?$TZ&w$QFWBpLT<)keT}ncT9ld&q9sYi7{zI!}Wj -zGC`&mqcu^qP%>TS;peAg3sdBQ*xrk=h0^HWu0dfwjPV+FbL}1-xpNLpo_8kvZPkhU -z5FOzhFz21*9Ei>>bq*BHJIm=F@B$`Z#GJUC#0ddzh0`5eWn4Nrk{ -z$ecIKITW3HnscadUQs`I0Hn9a{y_E5=eUB%R!Xg|XpwdFbz~V`;+;c2RwQz{@-fuF -zcb$gsFDws%+{(SHqBR5CWEhd8_Z>tBDt^HzP@IvXNFrVeg_;wHVzxxp8YgfDRHCsHMG>OZ;c)UarV{SB4zM{$-S!by~S9!O8Zms*M -z#_okrZB_4L?R8#{J7hT@8MQkCe%x%i$2(nc+s7$S6zaQfu_EwyvQC}o97Sz{TD6;* -zV!?;%%&n*PCr<1c?S?g#K@hfgzs)6_=YYxuDQ%T8L6i-pZ@0Y{>>sKK;Z^V7rq(LR -zS}#60A9mYq_skNilA3MzR8mR)%JOYKtwM6{&no@OuMfnFU7lf|0 -z>bFXHGQMZ_47JB;&6E1MLSxSaH|D0iOAV`jg)oLy|9%fKuVmrY397_R$BC+#nN5J1 -zQtJ}l?PT@b8Y`Nkj?w{Zi;~$z9?-Yt?Z^j{?%&ax^c}B>70oVId+0a-CK2B{_q_To -zx+i0+YD*LnnJci|lk2xiS)%YQD8auDU&JkWCio<%Z5itmYG+X0x8!~PneqksVIWKk -z0WJU9C=*Xh5gw_JEs^dW)>^OczVr01StyEnrv-n#*x8Q!`xrJVcB1up -z4L$Rxx+P0gdoaRm=P~38@vr2?kz_@N)iH^}wW?%EBED+g3#zlLFyLGA&%7x;!1FUE -zfL6%_{HW`RK6%cYii(!L=b*|^)^iO~@G2v!4H@i?T~fbIBYR=dw;02A;=WO5hfxb3 -zSW!X2wX(>6Edzp$rp9izjn}#gHGN?~M)L#7u|u6@$2ZpQkkqkKj2Um-P;wTn#Ylfy -zbO_{;*rVTcr)I9j#*tOSgyP;@w48Mfao5SFI3?RrP}q* -zzpB^IQ7xoSH3&fdh@dcNf12&x7ZGlk1%O>xLnNJiw)A-FEfbSn%&*RckenD-w&#@* -z+OfR{MTDfi2Dx0dR2Ed1mGRHj{`aVPm_bCoQ^={>&~iSS?luWK>ntYkr;^(R^V#+L -zZ~9#{vRM8xC$3H`Ovfg(WY=^&Vw&8Ob$ap7Hue)G{tWECT+lZ^ZFPx%xt_iwb;zay -z$r0Uwm@c!u9}l2Za;3sf(vPE>E} -z{61B85~|K@%A*Qub}1Kh{lwOa(BE^Pbwmmp`^=|zF(RXU&p1g8ox81J{bGUHwA%?O -zHvJ4H$!^Pw6EhpPhQ=$+2guA>ghfndHo+rfm$`^#eVIXWd9qt6*#iMw3B4SX%pe#a -zqXFA>pc3Lw;9(E_Q1nNZ#0^@1=oW!E{m`K&n(JeRC>GS9@A -zcqTTJFEBe9=W%%^qFD2H?)WH)k)4Go4<=bso7;3MaKIjXEpf-U97mYL5a(~WmhPR8 -z5cqR$joC)+v2_b#lTj~OV60gGd^;B{7wK;Bd=}PJE7Vb$*=r`U5QrvEA&~k55uvI# -z1Db59Sie*}p{~KiKNG+Wjz|$iRua6dUoK>CE_z6}msxKnHX7|TsxpTWXsZzD^Yj=I -z#S{@aTVgJHcJR+xH`M*_Hg@T+4yV#hkPI%O+3*w=210RqKjpW0Dy_jTqib1|7H#I= -zjXYdj$X$S?Lu9H9rbr|};~~Mxp+d7swz6aNE@gJKDDZdbFzK&qC~%(|i|K^PVtY%( -z8cTb>6|<_3pWNqO`GJbKX3Bi}6a1D}Q)*ADd@TlXs(cq*OdvC5PQVOpi>8b(Lvz_C>!U!%*4TEu^RTg|;_xjUC@-Hp#qH8T2|bl_I&J@l{ajjeX#7 -zi6QjsYI)(6TxJ{~l~7&!xrmPKeWD}1Ku|KO;YZ-v1ke5DM#2rIM9UAaGHUXVX(iC3OxMZoy?Sn#B`;IgC=eE#J?{v(*M~yzQ5k(N+#>(H -zOyzb^oFB-*Y-iq)AaC+_5Gca`(F^9HA^bN9)7sv|GTXa*xK?JcdbiA?-PW{A{f{UH#V-@seTALUa#HRhmJai -z0Xm*X-*gQQ{eu4Uspm07#=7lC;9_Gqhpr&=xL*6_h93dgj-13-L%`Qd6VW5!EyCF{CLMMD -z&IM-TDOVEMAkBND-T{*{g3|6?rJ|W+K5W|^D3P=g@=)MTD3B;ysfvK=1Cd&M^c4>y|u<)QYq@Pn;5oh}mW~v{Mi~59Jwxe}sa?av#Y1 -zx(g$o-BUYQtyZplWn*5C6Tw;gLEVz)q&3@nN(Ax?WxC}jrDg8ShHp^V=EyT)6KXxP -zh}zG~z3@{VDT0^wm<>azr5==8wzJbv>zo5d?O(zs#|0pMh+yRNZW1W*-d_?5ww9pn -zDO@7QXxKzoy$7GrccMwO8Anb{!gY1K<@*!)0qkv#G$MakcVqcL{+w(&p#5}U2((x9 -zq|`ojKpi4*a#BRpeu5rV`}hmf10uD@sEytgh816jBToFPygP#-_e~hca=P=)rdzo~ -z1D-){ShoDoWCB{YSM$ecGnPiwav~T5P~NWEU1}41K5Bm<>9@o|r;3Th?V*kEkr@R -zQ4h?HL@xHyspAPMiQFDL5S^MY9T*49rwIlDl31w5I%1B4Yu^<%scv=`JXj`bR7gim -zJM-y%UbNfTjRtR)0bv(vyt~gncrAL*T=e4L0{RcC9`Z)+HFja=I|pXfzGE(0GM`r! -zd!3d+73&FCN9NM^>y@PUbsd-EfAn_IiPGVnR7IgYsEwD`2nO!LhNk>^4JJ0hZpv00 -zsKNuM)vh51AT1uMfu{pI3_*4b^^X;7h+-0>N9+oNtkMC}9RIf)`&bEg_Mcwco^Xf6 -zUcdzC!N{p((~t!7ixcHY)j3eiw`Ro!x5c%l2=e>%5Y6@piQi -z-5h`2bZ*tCNW>;ePM5aLyk~^N6Yf(&9AqI|-nR|AaJk;U6+GtKh3)Qx!n^g`wV}^0 -z7Vp~_swDBZxtc*CfuQbjb|E@pIT5DMgMt(I*j)7BE0aQGW)ou*33ey(GFBS{40i5R>YO(`<1 -zY@cwlYvc7tpgAnmb3Q6gqrd>m5-UXhJW+S#uZo}G?4FT;Ur<) -zX!v2i{>oW^7pc9ff?s-}!L9%q%ID{N3AXP*!wx*3w=;+qi#I8x;Tee(HFbX$S -zF1*OuKVWV_>jVRtF(HqAc-0A2W|Q(jVg)Ic>h&t)!)i4pFRiwAR+E!k(NnSJ5^rQ# -zI{t~7sep=7>d%XNU1{I98cjA6*joZR7AOxmP3uv#SpfsS_`* -zKo!OOCiH_lHin6hLiCJ;96O|Of_m&hk&ojS-aDAA_XyiXja2;s?HT`z%_g@}P#=w% -znI2fdCZ(c45-Lm8y5^*NBQ5_0^k%zGA-2_XcSH?|S^HLg&YhW&^kipy6jL+h-TFwh -ztCWP0Dz%?oZmIJ95N;~Ilg%282M#!y|G#IXFppr$?;QgEhfWq?+0(=Qy{GH@A-@)8 -z)%TXM7Fm!q*1&403`ea=8mm*XDeEozNEfcBsVjOWxJ8e^R5EBCtnUB*@7V+$bG% -zAT$Iz-3J|DLztQKK)sBINLW^&1UP|1k04#xuB)+gtvIN51%#Rf1^MF{bs*`e9pJ$- -z1YUpzNId9Zk!ZxfqJ$LoMg!_=5Xb_swGtElto3}IJ -z8@48ltVXSb%m8eH`_QlJ&?&*2R3YB#bIIuVv!gg*r_JRPDo4KxH3x&xXryD2hCqNg -zL`-3{%W#B_nQCKW%2`$5uaz}n!Rg!n)wm3y{0Ok@e+%?7e8WF6xXJSixgomXHbwvj -zp|_#KTy$SV!`K1=s6jaytj$rp212n$8|zwWGcD|+$QyK7+}AS0R-@s`w3=V6<`*2{ -z4MUb-&p(rBBm63Am4%i8k%>jczZQWsb?sY_nkF8?lYl29$~IgNm$1qk~pjJ0X< -zLWp&Kg9cM-XV>qw>=T<6@wbpqLc@Hqn9qR)UM7SZ*y&_Vk=x)u#XtQbu=pPYP1$R@ -z&-NZ|IVC^RKN=gXm(<@qL?VpU<{bmR1@2|qOBYLtIbq@uiPO%fq{Q}`TEr6JUdQpx -zaxwlY&GO22{_o&_!VT@UokZkXPKgpEljxH-%DY8G?fdc>rmRz@)xf**c&!f8axZ#NUG;~w<^F&VqaC*eu5{fh-qdHr*qHJ!kk -zQ2vtc6{VsXDidnGEcz|o!t9!N9QVi%AZ9lf1HO?0pDh?2F5}mUAyx5rX8*k~==6lz -z*!dl_2zxW_v&kdNeNdWa6|sCXQ>F*aK^}OZdZ;9McG}t#WZN(X1*jZ}rXdEz3FTh-b}AhT&GncbWJ7j{2ax>uc4`XQFlm-pm96NxxOBj##+MX6A10(&n<3l(E?w -zQ(U_NTopTh6rPDX`-hs1`|;sY?)+%VokmD~liBbKdZ3_)f+8u%oJtL-8B9g&iUUOO -zUR;mfG)iJjUP&Bt$0=kGM*(7w3`qmg$z5MO5d25WkjV*kLu|xX)<||wnX{!M>88gW -zwAANLHU@OFEYkhD{!ZxSC`~IGlvRv+uADnyo6Fj5>wM`Gjzn-}h__1-4e7eJO5^NH}$7$&tKpG4wHR9m3SWc!< -zgbu-I7{qckn;Q7*Y1Un*n2qlh(6QH8c|Pm#abY3nRZ6V-rNYjlMCOiy@@11(B{>>R -z%+_66{RLd2pE>?!LF`)fX{Ys0PY+8g4WrOB!npn{Sq&3Gy5epVXz{8AgNX)++)OCKoI0445n)47mS=u5lr6Q=lLrjgI@W6 -z6#A4!1o*_v{E-{P0lUcGw8q41{{&qWJ0C{@dY01zuRK;P+<#}(?iB}gLjk8Dh2r3B -z)>4rJ){-2rh%~T_4T&)`gnEjAym227vQ<;B#vj%vn^2j -z!LcTlXg`Lg{6zVh#F!zm*=Lw9O^rp(moVqwJ$qz~qh_2vLy5yg|0oXl{TrEoP2I9% -zKU8j)0*_EPn>f?nZF!Kk1dw~_`m2Kur|UU9{}1Ro@BbxT@5|BkMsO=U1GU$b1vGth -zf*!2bM$=ee?ZSCK&>G?576pu6Cx<2=i{_``w`s=JulA9 -zeL&Cc3D#Pn=O{w<3lnbMw}atndVZgq{`4#dhJ2Bp+mi0oZ~Z&;{0mwUdj46^?2+_* -zHOs4kJ`;Lg&`ZxZ4oJthnGF~7RY1=-9w!BvUqayNifu=s=k{KDew^`YdTu|;@FY7x -z;4!!+Q~-UiKGT!546z-e=vi(>j--^2vz9j0o{T+-eKM7!mvcIGBitd8SbUtVTtP?Du}O1t+DU407bfK&`J8 -zfwVwbXFEFyE2M~s#cTecTz#y1jw2Bi7z+rm!2$dS`Yic=*$)scgM9% -zm6tflz|vLQyRIglCE2%!RwU`l%Eo+zXTH -z^JGpbv7bWB(D${9BDLGfesluIJJj4hE>cH)`!@nEYGQdUz6|2Enp^0@PW?mvaVXeDbWlLK&Za5cg2Vrym$!;49|FSFv6@ -z4ND_+vatovp{bRv#5i|RrZ(cAD0?A#?IX<}+nDN*KmIKA1%D6#$T7z{0-U}2T5BF@ -z$gkJyaYuoFGw_xM^D|xGm*?rs&vb!bKLG!9fnPrW|8(u^_QEfxRuxAz{AN=GaG^7p -zwPKBbt@Nq!q$P%iV~v2KbhD#{onV}_|4K3j;ixTZx{03ZUgIRtV!G9d8X=b^_8+FQbK@Bo! -zk08aLr$NpLHAO_kA=vyK#7V?|K(v=&s+4F`WhfJ*2}ZX!g_&$lO0LJFv>e#)zorIe -zHEh`9KSvXs2Z%ex92R$-rso;!^b&XMsgvCqr*Yubdn||Dc#>9C8I2!QRWKfiu{nr#`$Gx5X?T@izRrK1Xk4ggu??{i -zkqpIMLj*rb^#I^%(SHU{eon?V-Ch7b(1V8G@eZ>*x*2Xs|@HI -z22@Is#il1|E5JW*V|qM^3vZC|>;(`kaf@A^@B6-ns!ryqPY;E(AE=^ndS(Mv6e^;o -zM}SC{ibs`QA=6%Te4unjqIBSlfE|e1_ft8CMCBm-zo>O~SplVs(iucjyZIa*Rob%) -zs+B#kTFocwqcx7+4&xlkHyfW}-B$RZR2D_ND-Nd1x9dH!pI~x&S9~rW8zFGfNGWfD -zXd*%}h>`&tzQg*$wav0@pjuE!Des&~qL2viqLUueI*I(Te-3rh6O(lOA))?33UFG~ -zD?up4BEh&%Be8Q$6cTAzX68yD2$a$;Fgkh(v16c%X0HE(0uq42wA`U_vW5 -zCH{&XLXU(3hQO~wG{5RC$r1{XAC2*MeJuQ=4wY~8jX-24WZpIX2}6A~puayse`ic~ -zV_(W&mGOq=4gXgR2y8?-mJ-%%xJ;s(gUCTdUki`=S7O5UF}Z)5 -zJoZ{D?9{sg=}V{#VLz=z`x5s8SOB7yX6+xz`#Xuggzt}|Weu}_y$pnfuTRpS|0;aF -zSihbnv+{-Pb@1Ik)>0HJm(xF^{{4&vUlU1pGcGEKUI<124$7W3M7O>UvlUt2VxemKMMVTEs;mu76`0kIZP}`35f+pR|&9=B~x&@QF-BllMwr7%Nw=9im!+5PUj&6 -z_B6p}!|&?;*vW9qu*3D51F}$)_MX<^a`wTo -zxn(o2B@wnxTipX5AkeMXRTfJL8G`M4)y7uO#uiIWb#H97T#Y^93Qw?}GnEw)Sqd5$ -zfwX7nWt{>lXJU_2nIrJNY+;AAXBKjj6+NAAzRYNlGV%dd`gB=>sq+3UE&Fdop;J<$Ts&{?#V0Ks3TGUoI)*Q_ReD67s4)AP%V6_?kTMo_sYb -z>0A%ogX!#oVJ(UCMTx0c?!|^!?PU7FJ{PmXgU6UbFz2OF)fRuk9@EVc0RM7>GMyDTb1@*)En$TgG9<65x;0u)S^N$v(vng -z63MCr7dI1!H)trItCdH_e8VtsufG$hXSok*P9+=6Ig@T#psoC8He&?qC4(ucKOjpb -zPj4yZ6RKVgz>P;rnf6!_P;q9#7hRLUU}JexiQFa3qCZz$J%1XV>MvZ!VHCvW}aI -zudMY2KoW2RnV_YFf1sYwd4eS{RwNGj{NW=e#@egf!62}mW77%Oqx{JNr-wZ{#$&1*mU_fh&doE*8lSWf}cy}aH8yr -z<^KN)t5)(G5kX2C0ml{^oH^EJq2y;v&kmCK<77{g)4W~KmXmRpFqoqMe!&BpJ+ -zUoJU)N}pd`kZ`|Un(&%MT;}osvaonCR(VXMQRSAh=@ttbHJ9P)+t+Wj -z^Vxkx%281sIbUN3B}VVBnNBK2p#RvAJ9_`@Cuuj(ENJRlWX=lm{SIq)xwO0B$rl7U -z&&xmbf3k>!%4$_5s$jS;IdCl25>nWbD9`GQgauGgQng*;7F{?A6FM!wPY~DD<`-6} -z?!(H51?49kSzZ{Ff91$>y*}?%4(mD{}ZB2SL_%0xQ5gnj@x1>sl#;S_iUKyz8UsU2jaF2IWK|a -z(SYeGx=lQUUe4ZL-3(t#eC9-CbfsB-nW#f~zKnSEW!wZ0@bzUKxd-_AGWdEee66EB -zPz1b%S|=rTLOZ*=PLYvK3AwH50pySsU&#QbC(MZ*{yjX~6o -z5Idnh)TDy?#th?$2=A|47{>gerU1do5hI`N5FiDpP@l-xdm-JiPeH(9qhLK$TA)g -z1uyvdRwLx9|aSI^XfU9-{~-9;X`ce&Pn7gi*}n& -zP(@Zop4BdtPJi0hS@DXz%xJ&^AA*T%(cM+jpMa&BSF;;WjFOKnw^4x0HEpRz*~!=W -z*wUbp$N4U3L`W&X40rQ`a}(pZDV!=D1S!Pt>$l4g;fEQDiWQJK*(d7Ch&bvoAb&RS -z@>mwK05tCZRzghT)5ww!W3OP#e>ib1dZK0K{NF*$s@vbg+%aLy7Bk4S$&vEfnFFNx -zGB>$dl~Wvl4rC;MeGggyX{3Y(_LJR~g{Z*Q46!d);U}GaYixdKe>`_FKQHh)o0M5` -zZ?lchSU2Px33x3xC#+1#oUk$#;*OM*&BAcSolj?br-xccOwR*r4h0p3469XHcf;>C%eRbc#ypli^!0D3C%6u*i=CieTKErvGp|;RR -zb6Xz&Vn;3~!K=M?H;0YOIT)O5&X%S&O##9CZQZH1q}=k;6pgvVEo|9Z$;IHF>wC{@Y*lCQ|zfQUO68h$fcF4OT%@&hf94 -z@q0}{ekYzq%9{vaeFLG -zVT>N9rH4z5%t`XmxSJt8R?4UgPTYs|2J`T~8VnX(uIoL;-13*ONv?+R5KjLzWG` -zm`1slv=clkhBXts=`_lBk^xwszUEW79E&zKF3EIA4CcG;UzMT5=~{u=r5*QY8jx@EekA1bD5-D+5|C3uKYWw2ma5cTNap3 -z2_;tjGT}y@Zh3)7?Xx8pIZU@avyVx1x+OnXhzDV*zjm&BCdjvZQ=QM2)A^X7A3=G3G}2v(X2vrwIu_3K9KF -z2;_&N@zSCz%d={=WYgJZ({yH$%?~V2Uc?=9%>qnx3=_Dhr$+;g=5WaUVaYm!bX1A0P`SBg;j~&^0%u~9 -z6y{mpcx>z018r}1LEHEOz^1#)Nh4h+PQm?$cqSG3kP^#wKz1w??xl~-BLkJsE4#iY -z`i%&_ULR#Y#T^p3U~%-Jc_Q9O*!iuNb`#YT0n;UeEb@eV)_)}6(wxC{Td+3zYd!N! -zdPbm&gjRKbzgq0?UcXvDV1IuhUq}1Zdfvl)o%M&UkIINx*V% -zufm$s?F9J%*OT9X4B5s2H38{0u;*BGZHDY;NQy&@o-6iZdcA-|=vgNJh&duU*j&W1 -zIsR72kNJ>}_k#2#xGC!*G9q|Vn`AxE -zcE^s9vr{I^0b|}Jq>8MW`@X0>Ee$5{DLX(2(H0etE*eaVxwPe7W^@hKWx^L1rU!!# -zIog3E8(9bZ&@bkm?)`(%g7reIx8vXRvmnF$LE#V4@pEU^)U@}z7LFv*2Zzq@XFQ$} -z7ve%n9%ejh3$LH?SPDE4DI-cj3`@+Oq&-+hyV^zIn&Dw0Q0f5m -zVZDnr!jF&YJvhi<{=}6o^MAvg=!t~)Qwg@r{I($mlQ1Gts;{yUMX!V}RXfRZUxa81 -z)?F<1fVRYv@zr;Yt}>TBv`Au3q{O!q?91qfG$z5AQ_ai@I;c*@*WOjk>-D+P0jNiF -z(O~szsB|AG%W2b6(~;PeEJ2l-&KS8xG!zH82$rHAmqPUx87V=)&uq9zvo%8fNO|{P -zjW?t@ZFyy?KG1Xgu9V=!--fmUA?G+dqsX)o&LIpNNf%0M!-h?In1l_VA)_e3u(`NM -z3Nmj2WmQG@(jpM>NtO8`KSI%&pD``4S%OD-1 -z>eL?Z_MS;zba2`mH)LcaG7&|03PYwRv*`!YpLbgHd{m7r=vaY@yVyy9OIYP%C-aC_ -zZ#2VZ>{Akj#ia3|zzDCgEW;U3Y6|*mNDtTdT@_&SNs~j|0?rFMV7O -z8HRY~bFUCtpW_4QSfa12eP=7p@=GP2BhQx-&$(2zo_;`|Tq^M#{XjhD(p~BJmR|f? -z^?sy|AbwSkRi5QwvSV>wM=m8d=#hZ7)I&>!s`xQWeL!fnf`}uLnWKe3vmcWSw7T{+ -z0;>2n1$g5qAjg*9fmjhJjeF!216hsK){p2L5%G-Pu2LQ1fyX}+O@oN*9I-@uHUmmW -zfztSA0KD4F6fwbp&bbcx*Ni*QEIcv-pEj2bENDN)&oEQy51DC^f&K}>Gck;FIFcc1 -z-uE>c0*q_bMp6JK?1O@?^)CXpK<f%J6die`d*YzOvnh`R1T}6JxE*O`3)xRA~^wt-sHGYz!v$PVs -zc!=f`QQp#kRwf(3wXP>AH0KcCyFsF^2|UhE({A)E+db#(RJ_w{_+NaaUL#Z5ioZVR -zFS;_sc>_O*YBv6gHb4Vm%5(C@k3NUBB1MUa&zlqM`6sKG{qI#Qeo-Smrf2-rRB3VMO93eHzYTGO7yw2;#prb_A|SgKdzTUFNe||5!aAPuPgWS_qRX-OMV^VL -z6@R&QyJ${%>witA!o5YKPLryv#_HBI8QnzNxvU@PsH>EGymzYl6VQFsC#N;Z$s$Qe -z2)t1*Nn&f`H~BWHHiMv|{E5(p*&vAkNyMX&(1@8atE>OvjVFzLyW~mJKH?yqHn%$S~ -zZ?^6KH~X6pibeJtwhbqbopNO -zs_d96>)Y0R5n&`9brY?Reqgr?6^5IQ5Ap&xZn9T&6C0Z+{%1Be7fTH8O0h59%P~Cu -zl-t*QSo*H)YkosAc>6XrZ#~QZ0ZQQe}}uAKQ1AZGWD@6!QFgh`0ZA`jroXuj6o=X -zVAg#xG5_MVw}2D&}kHfD19 -zW!sm;-x`0-aEZThHqlYWC)_OH8~`N@NQd8UM4kooEpav2VfcS0uvVH2wrFwBnwi;n -zP$GYQfi;|iE=u|b)<%VawZr!@2V8OZKIS_g58`T1(}J+6UxyOO&4(tYZ$SM)#PLk- -z;G`IFs*pgwbU*WIk=ewnm`Jrbp?5Ktu?c$wTV}w5a}dQVKNZXt=CVkcSnl!@U`wF( -zh&~#Qs$lpQYG^!(d|>|*n`baX2Q;2VaUXxLWi~B$aw$Vjup=z(T}7(O-gSQ8?oRo= -z?_4;Ytu~Fa>s!ni!s$1`%q*oL$i1S8gw#nF&?glv*4DPA*tskx6%fu5hQ3=E+H%LR -zxBh55#AJh*>Xsa~G~8e?@bHocuvHoNz-^=Q36ITnP~hwHHV+pv9= -zYqOXC^86Irpd0=VT~NSY{>zV*g3J{n7%J9&Sy+8Dqc{rXXDQYIEaoPZKk)VNGN$j= -zuMpX|feq4!?@PVFp{KQeu1wo_Xj=kvvgd2IDGx-AOOagPq{y4 -zNErGhd_)05`Y}T~XlBlk8f;HKdR#r=>wf_cUm90`3z8IY)^j~9t{%qU!npF3fX|`U -z|8`tCB?oNCa(k~fS}J~bppu$yBitj)XE02}|E*?O?4uz5cNKmLGR&00%l->(b$=6k -zv)OXBW|v6T&645Zo%U7?`LtbJW#my={bzw2E&BrS3%yZG&R`Bn;1Aqr;YGxe1d9n= -zIhjX;Nb!2-Ac5lLWYIh<@bKak9ViY0%1U>sI%ShhK4y&h939C98{3;zkS>3#T1}67 -zS04%;ZZDayH`GW>!<)t~*UjQzgU&k!-2ZpNrHR2tqI_2x4w%7tn|=E`bK&B9ZxYUh -zlYbv_@*gzQ_U-Q^T>Me*dRTvTY-MFV?2G$5i~IJI0EUEw|6B3ma6Z3ef2WQY%l^*( -z@#3_>?`_r)-(oqQNPi*raX?q7dSV_H~Kws8*Aqx5+5LU2PK)j37gH5r4*w+T~pi -zTJIR}4OoHw!zT-U$w7`_a!S`Vnyd8mLJ*qsy6E#O=Z5JS15EW{8ljvV!8cZdjI4kcgR<@9rk1T -z3%5_ob`$(hs&aG;XU4FXDOf8gxsdIXW6XvhQli%i4&Uz;?4L|rI91jQs-%vr7ktio -zK_w5NKGG@x8OORBMB2yS$VCm_EcGTibXI)3dCwZgYrX_+n=cWD+!zw7oHwx(I&}68 -zEkEFu{F`%tb0^-XK`mPS-^xe**BSft!GBMFwD-<$g+#7mxpl@1m^R{UY(AdMWXt}3 -zSpbdY_T`P_H{tt_5B)%J;40Qh&<}UOj9NeF;J_)8H^kO7Q?BkU?8N%7}UUz^UG3ch(gQL)KW>$J&psUJdrKo^!U| -z##%>z{HO=9971Cs^{1ifjMxlaqu%;3Uc`D(X?uf{z$L5Pas4gd~ta -z5y}sYP_ga4RN1R$>dCBa4pHY|H6%#w@kpf -zLs36%^R_SM*L+hJqqEeacL#47;s&gn`9&KVHpJTbIu;I1FTq^LD>RmD@@cZCp -zNhD$CSjSRT9OsQQy0292GOfzw?X*k%Mq0`kAQ`3EI@yGHLmMxXH`= -z#?4+PIh^9jX3UTyto`GWo4EPbs*j_2+kF`~=T~K&`&1pS3YGtDm*W^4mAm -zrYygaZsE@MPvuN6yh*0Nprr2a_nTdrK2&&#Ol -zkGK-n(z0m&F8BtpZ~FmH|f@IU>#ulHFMVUHp9kO>=(7Fm-uEixb1J5 -zXRSE{&65D{`Rzlkl0i~VW4|{};ul}_^8FV2oxLA~9cm3n-)d`E=i=?W>GZ}{sf|0H -zR^N``W!hg#XUVD$pAtILw|u~J;uqsS-$Kp>PfC&8S!-sZ%YM?8mc)MQ#v8bP)aN7Q -zTQo)Nuam6o{dF(b@GEciZHdnDd6OjV5?+VA#iCxsI -zdLt)+BTb;xz0U;hVJstXpb2C*j>WarPWgr%c=%ndwoBlj?7+X9KzS77F)4py2d*`N -z+!$Eg+u3Ss?ZE4KCAhrAH_|tlC|EK|;2U3@U?;&hp5oB<4ScY3{o~*E58j7Eww*q* -zacvuS*0%d!b(a)S+&^K-#f*QO(&ALBZ%RuXB}O;KjOOito6?4O<*dQo{tS`qc}{4J -zS`D-HBslcQN5UKC$FbWlQM!?E8Y!H$NzAv}Luf#6*~XshK*}$zOC5Zc)KLdda%k59 -z-t*t=AC#Xg9p$&}mzDX~eKXX`yc#RKS>vusOsHQ%2HEw8;}(?5?(W2ijq)LFj(Fzr -zVHQ6uC0Kr(sV27J!D=!oOT|gmmob5kTl&|UK{?E6>o<7KT7`UaGhOO3kLUNYki2}r -z&^!3gEcElYJNuI)8PVL4i2i!+pvjFxNwYZ%t+}7`JjT{DDQ2xS60d`nUrLVKQnjJs -zz0^C{KA#oCEA9lwH6|Y1W|+v-p%DhW$9JF+HWXa^r3Y)Ck(W{DSs}F*H7{%V -zupGDiaDdJG4WGUw&A0n^3=O{JgA=x}z4^A>rF%p5d@wyad-y+c8*bu70aUf4b{W6x -z{~5EOPx~kIW#tFz=GIYVD*QzG>Z|(P>+Tn1tf4d%ppNY9mmN9c)5@_6`;2Hd;qv{z -zu>PQi>J(D(ROvMJr84=Q#dEdT%{TuR^m(rKS~-eYSjCgN0YkGJXAkA=vKuq_ -z&KVob!@Fe_RIaOI>=0GxEZ6$oPvKDso4G*A=+1{9bB4D$s+-1;9!P&7xU)Z~hNu&{ -ze7UmrJ-+@^`v5gDp|yRHa!TUwiQ9d<3@)O#zB$%WR=Gd$&A?4I$z#Lm4d3EXjY9@y -zu|~E;-gA_CaAQKk(tR9p{my3PWB9)Mwo|i*znnAf9lqj?yeK`P;=G1|wAc%>Z&Oas -zypz+SgfE-rxs+(RglezSbf36H)d$c;VUmiV}|gi-Y$>&Hkc*e1TLifvuXntLkP<1G#C?nxO3mOjW -zVNbuDyh@~_n~D-DxAKDmrMq2%zv6|_lF@E5`jGXgHaMlY`NOQn&}CRxd0+%D=tg*; -zVKZl6MEMS34^eyxH@9cF+Sh%Sz^4M!OJ3g3a6=e3e~8%TT(U(;c<*2X-&5lEpIgL( -z$9)jG)E@WhH?kf(A?$NCqd#lh*L>fvp?R&;@S#u9pcV4?d$Z$QHg8@tXI)#OZ?jcjxy*)U -zWHo#uAE=o|cBitb4p+))*q$qU{cy3%vxl$adx8l|Zbsg6Q^k1;871Lo-VOJ?P=^n- -zeEVfHl9L~_Lk9jCp0#OxGk)fK&UP=mJUI<-w7mJ{-j;RZUo9kgt>s9?0XRPd68BQd -zj#TW@-t{Hk<>MQx;#{g<5nJu0foHe1v>g3c%ie?ATWSvO+psQp^n;f7kM3;Qo4>tf -zZ*gnOYe&9nIgsDla-eu~%cV!ww~RirrDfZZcJZZWTUx3P#cuFjdZ1;)y4(Zb(4RK= -zMjv=}!@7*4hg-g_*h;wxIJ$qs&YQ-4?Aowy#(~dpsFv4`9%|WtbSwVU+_LTH7cJjb -ze#lSTLzktJW}C#_>uUMi(GOeNk8W%E_U2uLe}hYHvw-prD|p3fruj^7-Wz3(LKZe5-Fz<&IadzbHRBa8JrJNzz8rBi~<*c -z(O?X?5R3)mz(wF*ommBftg?yxEfpoW`jB4THpuyAOPlq0#FEopa{$Z#h?US2j+uPPzK6D1*inq -zgDOxBLZAjL01H7aSOgY>8^Dd=CU7&j1=N9C!EK-(ECEZwGH^S%12lj;!E&$yG=jUp -z-Jl8F1AYwd1^0oUfS-cOeRz&qewupRsjya)acc7XT62jCx|4SWbb -z0z1LS;1lpE*adcjcJLYa9P9ym!5835un+79UxBZ|H{bv`2o8b6;9Kxd@Sosc;0QPh -z!gbav3vz>K5CdXCFAxWM14a>x5rnbGWhH>)7?=8k!QdotDyh!^=YUb*Vl<_JX`ld9 -zqqQD94Az64=#)nZ2ArbRIR+lf4#pqi^#%Qa2PA+*a2z-ubf+ZVwe|KF;cz_og15ZA -z37!V`gT-JDSjOAS`hsD^iPX?rQCwWFUa^W|zKf#2pCa|g#t!nHbxz8tG2<@2G}V`u -zF(E5^;-sA1DS3HUOr17;#*8bknmKdUtgElNX7=nkbFTIK^Yilqfw^-F3JMAfgTY`? -zQPI44#l^)X&~?{cH-G;8Qm70nFE6ivDuu3xs)VYALP9k{3luFBs#Uberp1bGu<1sd -zZqjtKO}A*OGjyw=+YHrr(2@>X+Cj@Sl_e&6ho_7lcS-8_jLhswIg_Q}QfvxMnXje9 -zs=SoeE~^w&6;qedE}t%(T{0<_DU_6`qd2N4svxQqstk4kZ0l{)wcWPS+F)bu?V9e; -z)S&53L(2`VFx1#VcXiU;9n>_(>rEM#nvtE8H+9BUv#yzaEd?$J7R@UzxsKK>E2j-< -zJ=#qgOj=3`bi)ml<))h`#x1u{0?fyDF&wKgS_O8lrOKi$( -zO<7&JFYb=4&BGom-kr2^=Jv5`Y7a**N#8K^k;0D$+&BI03!V;r(|1MA)^ndI-81BY -z**h+I;l_VO-8TN^(|rb&f7Kk -z{;S@-@GlDwCEPvbjq{(Z`0~_;{QtQ8rCYj*>>m|sS@qoZSDWc2C<#c8q! -zw%)z_L{NML_5B{|_dVqKft2tA$)bji@85p_G!Po3X|SfG2s$BxPW&D^>3e9%52TZS -zAc?2A@PL?DT3%W^K3*DB8ciBTDmPKnahi_T)L)ZSos*;*on)%ia8tF0N7Qh)(})`H -zcKSUnaN_s1Kxb#sM=n=Xlv{TS=@6z``pL8+f_j>nNDq{mkwll7#|hvxFar2M0Ne`J -z0hfzo;EDoFv*aTPE~Z%AuyJ<=n7+7@fET2IRFH3VBNr3}xgnWl$TUPEefP}Go-v7? -zGE)*;`-8#YBycJ?1Dpd!fr~*Jm<9?!HK+#t98RQW -zlE`h4HP9MB&c|axB9?flxxUQh`cR8;%r)hUaM6?`O3eeiXtz?W%dN|Jt@9;Vcab&D -zO0mwjlCATsbFuntYq&Mmy3iV9jkYeJ1S4sIVb+hVv#c|%p_J@&S|!q+$owPii?qje -zlKbK(DDwrFmCp{7%^a_W%TwvPyl^;l>Qcs`r!cEFohqdFIVZfyyNZ-h6!9u9AX=dnmRgpN}A3HHEO -z^X`q+@Mic1cq@E6Jdqb@?1OuE^RTNA_Q7YvE8+58$d<-7zq7M_a -zzHF^e7L4C^=u_oK){5*-QKsyOn%Kt^mk~dU|C#Z##N-@;(up?~AMcHiSmQm3cSmJ- -zlJ0Vk_jntl$9smYi1B$+mc?dz#@6?m=xKGiuZ`;C8H>#48AhD(o+Q$Y_ry(-CRqvY -zL*Lt_hyiu1xrNi5uhM -z=n5pW;65aC;CY-+)aUMx#JUOHtn#_?zuyS-QOs6Zbyi(oGd{ -zNwMUos!hmbyti;mye?bXSbS?3VG^H9j)W!7CqVpA#-k^YOVbO9Y&x>X9J)nTjO-DI -zO!B)C*(zjbb8P!pvFZg9e~;^mby#))8piZ@63bEYRw>QCM@wTkd<5>DH$h@x$mxqTjQeRR}1RfD*x -z-ABg~cX~xQ{EEcQ^sID6J%}n_{8aVdu7}ygu`0vi1ri5J1(nE3k&Va4C6BwJCVG+@ -z#kW^P(;t?_WP4KTV{<&Kd%F`|o|H7tFtYFHBDUVA(NW9T{}3vKqz`UJ7R|VxNf~Xw -z%<7>JX4`$R&E>8VPwL(W$4hMu1xYk$G~@nMj%{C>EWR{dTq5a8PvRshLh?-|-X+94 -zO1;?mVr;j*ulj1Hr^)4RjqWjDdY4^}CiLyOiR(#6-^USk-|rktI`#dn&v)xE#?IW{->t6|eK{|(%HPo*T(+EJXO?5^TGj?Eyj-te;5z-1 -zJT6n^RpXr++at!}OsT)9HTont?jxyDxwcKuUC0dCDag-h^t>V6M>miJo#67 -zX8JsNY8-t4y{+gq*K-*&S0mej>?|>Wp@W9VkufQsQ<+2UBkVN^o7!<5j<{|rUrP6+ -zM$NR_lP#64MI(-UJmyqrbwp_?>yR55Zo|M)vHlxwKBAO)MxcV?9 -z%Z-mpgRS4VmBM+6wuUqt_%3Au$M&^@DlNC?NIB@0Hrzp+#GRe>CsF^8{&&?tik<-M -zlLm#PiwT`7z5>Z*LXi%aX_-*%lQx%OUnubdo6CKy5M4#liJB+raG56vnQ%T}Q6cB~ -zIzKZ;$n{@{;a1Tq9WKMTP^vzc>za`C9U-|qD{8Zuj;8vrNMxK5VyIK3=3*Re*8(G# -zabC#SsWyCaj>{`D`LQiR*}qE1XTym)H}$wrpV#Vee%ztLO*yr?|7Xmr+aWT;F}i&x -zXnv*UMVgOovr|-#j7({t@B4$zGt<&8@(xQ6&MgU)d&ee^N=`X%%y9dl=Y$Ta8}A!y -z8mx;vs>44VV%pkm8NcW%kG72ebd|?grX9MkaUK5BRW1XfQ(_;x -zd9vc|Q66tq_9*Xb)%7Uv*U|5sxwvKRZM9Qk@=dUsn|qQcT9q&NBZhBeUKb$e`V>i#8thS!ygDm4;&QK(AtuN*@z%_`;HrzRGRV|oDEujOU{RnG*F$)}!O;#Ys<1nO@yYowNY#Q;d|QG~LM -zT*t3dQg&2m`6?sV<9ZEpWzSGMqPpMbuu;d4%=c*>-;6&ETK@(We~^{hW(&-C{WkKR -z>QnZyx_APb7ZG1xCoA%-2)R5@>`4!AsOwRFHge@xGGT)%ZDw7h<=)Y@K-~j#I7iEQ -zXsSrsPe^t}O8qzMdd{=O)-^hQtB$`w%WJeePaG9e_rLJlw0zZACAJ>2ne{6zPaS6q -z)O{_7FCdqEQ=iijsTU!6W37~{=@R>Vs?DrVwS1qJtNT>Kj%YpJzt|CD^@aI(xYGZU -zEk9Z7IakZ;UbF>juFqkrmN%`n<)`TQS0h*clVJ>o;iX#Mw9J;P`%Dh6H1Y4YrYL#$>+B5VGX58~*@j@AqU*Jue65F5 -zMR#d=%5Us*bx+OV<4RBW>)l^;eD#AO;tjTwS=+SS()F*0Z|fT)k0{qb3Mlo^rsWA* -z&uA@A{FN_z{6a0aerpTP((+rhyjkl%PRs8{?&@JaAoD6^&trB( -zqkpZIr)WJXTF(wGuhZ>l>iLM4@6+*hcePIGB?-IFb4DN+f6H&viZ#1b$-B=(rXd$Q -zQ*?RNJw9nlwY*a2iy4Xz;lQ#dG;+Rovx)zx9gk*G^fTngOS|X_GxgA>BkI{!n0UX^=uj#uL4Pn$l255SzYb6ScoISYGX~ -z3|5uZgaWcPJ9*^DaVe~F+M$vWk=P(k+G?w!sHi#^GI<$kX-Nnzk~?t_p43rb4xH}L9nV?wQYx@ZV@|mDD`Znx2={G((r!WN(B|wj{JhPp{jtG -zJ1OiaZ))61Avrhe_>*T0MDYNkD| -zm<%Gq?1plxi)dwMkf}*k!~XPHlYP0_Y0d}{X(J4^4e2aLS5xLu3}YlCIo*0eu+*ts -zU4XhZmfxQ_d4@kDOZ!U}U!(Q=r{|_=&+%vGOd0RX@lTmBVOqv?|8(E@oQy91)TQ>F -z+1cZ(pQ_2We?FwfVJ_RjU}|b+PWJdT|H$N#$)l}MaaF~_&Yvv#v!~~BF*36UDoExI -z)7AAB=fQ`%CjWtDQy%gIbx3>v(8@7&?Dx+r!>71haar?Ql(?XBQD=!qTwvMF-6@hf -z{2vy;w2Z0*vMQ@s5YafQHF|6dzrUb1AVU;=ZE-{@E13&2QzUq(%I3x9sJtQ+OrBR> -zldR@b=am#%>Z~|WU2G*6E-ELb%|lgoh+LHAw`?k!KJgP)6)X)%0)14;q$^pqL^6lT -z^SGWShq&}v$ue~$Qic3{%}Ndy>&aqqAxg}doz$K++9}L2IRwf|3dp`9B$_c!>6uH1 -zNTyGfF&#DY-yg_jU58s0?s;r7&*=>xs^x~6`!;i)%mHr%sxayE^?~83IwFrz6q)(I -zK4o8_y?4^2U!@NWUnvg~Ajww_P5LAeLa9J>oAhRV!0=QPKpY{h&OYIP7Lc_a6V0q6 -z7=F5rY3w)g44*-`tQDDav)*91x&Mu{U#qnWIgl`u-mFU)Zq}zv{*mP`*XhS=g=W3W -z@O&+o^xPeHt3P@EC3Rx%e>?7b6A?n@d4+vu+iH%5R|98yuTE!po-;DXI=F-19Fg9v -zn;34&Yt)!?!*7pBU#BxL{NOK5N}HSfjkGZ$y;=V>oZHSWByHuSdpVKvoA&EiuUT!! -zYL3XzYl}Pn|AHfD`sQXk$Z**c>!is1e@mbqLpK -z+c6^Jn{&hEd5t`aGU?5FQqsSf{#DY7@0s*w-N~!dH|z47a+`cjwcbWriDJ^5^{KWu -z5JFz{zw@6-Z}{5;In!HhI&Q1YWqfjyNoV-`1Ul1?ZL?#K)#-;h6LW0R8SzdnGxq1V -z*&+ElePn!74<`L?4kZ5+BhcKWH|z2ySmFvfd57=XLF#{<&cC*=EtK{C8er@(NzDWkm|OHp0wH4w7_34-tboV_ -zfhGflCajj0e$|dGpVvP02FJEk5yGQ9u6h~4qM*R|Xqf=k^ebM`(w@8a*=vWx$o{@L -z|FeH<@3r6O?6YUzPffkAn|iH@IZO`@Axz!XS2)c%UlmcQjN%Gn3pd&L1%pk$4r_h6 -zh}ZW$pI+}FTZCRu5L~L!_Xsqp8-!imAr(x@q(q`NqP87St(>wwEYkQRbPBI1hAB{B -za?7j+hg(f^rmYL*#;Z4H#_s)B)b@>?pS}Crx~V65o<#id=0@Q!8h;kWHrw|M>$Evs -zozJ)--aIWc3vn*~CgP8WeEb#QuMmGz;34zO=v|wFdme*FUWPs9lIZc#zm78xu519O -zDIJE)CCV1aiYitfhyTFqe!Ndp{-j@f^y?aag-}!p^skMAWJ{x$`^G?>%YI{KEQ!Ul -zl6iv12w|Nj!QB-CJk6Vc!Ae{$5%GmW*edKL?uU^d-Ygz|N4&pL#J#mb8SfvSp)*ea -z+5T#(kj)|Z86nI~oH+&fRh-aQP`IBU?=TE=F&z(nD!7+;slZjHc;=ukl?Bh1HN9J;JWCly -zQHwij1Q>_uc-ThiZPc=Mf!P;SA@_6vCSaV0sl+?@ka_VZ$80Vcf;5)Pqj+-0PRR;U -ziytFLVOemINOz4Y#E9#27EM-RX2;1tn_ -z;|=_VfhQPvG!@KyO;!r}yP~}5y&}~}lr%#In}JhT>(+b&r?J<0iGfq+=)BUvX;SLk -zA-I?Ef-O1{7ndQ!WCM2_c)o$pH*ns2GI$I;OG4Ck16TDqPsR>|fmcd~H3lx%CAW1N -zc(zQ8+HK%+*txmaz++{4J_mkcFpQH1RKJ1CY0b?q8n|3foc9|zJpnmp`wTo&C*m@I -zT%UuywK)dE2}6cS1|BqUTo%LOeFGmqOc@Iq_!t8Z-{NH~*+%*Z7=6!Es|HF(m`UZXLbK_ixE?ba4w}9u#{PAKgtE);d|F(c>;tG>8Hn1u` -zOEJYcR!egRrac3DZZHVf19L;(?yY&nOo_onlu~z%^y3k^~=2X-dz(rfGw}{I{k# -zeaEgIa2~j*Y1-A_hqIvJu0ACJF5cx)UWS=P0n^u?!1bazN+HZDeny!D$BGXq?Xacf -z)2zpFJbdR5@)hjr8NCc+uAYjeToP(eln#W?z}C{dQ7?sf5d*Fs%O-fObixQ5CI~Nr -zOQnmmpTik5?7*@eW9VQn7vbRR5VVz*#yp80&=AUj=gKli+>Q3|dN@?pnlXSg8cY5i -zmxOPfz%*C!7E8{7>hcQZCFm&6Oq+X2(|qR}e1B{3X|Ch7xs|-@!pmS!d1-VVE?!qp -zCW8y*4=UYIG1Xo9F!sZifz_X2mABRA#^G(MtEcANSjK977!UvWf~M7S%K;lU9DNEL -zgg2(nu#LgYqOD({=X&Mn;NF{>)*HSLGhyxafVJY$Ag?aW0)6`5@S)M+&Ay*Ag!`!~}u82-?!yER}=>NsG -zVyAS$|JlE-L_vM!x)FEd(>uHxPF7YGoKNM}l=o1?$S2eWv1z540t=dPUeg*Ee}*6l -zCRgPsMKHH2XVOp4@fIg+Nx;dA^I(Bq&5C5K_?*SLFW%Qv`xveYOB?L2%2UR}!K(bR -zmiMtEo1D!&*RHQMt-<%PK7wC{e*>oKdrUXphkL8Dt5)Me#>%WjF;*soajeW)bkex^ -zQ`ffDxwhB%X2IqAywP_VYw#gFU!9>Gg8kLDJR7F+9p(k~;5!G6r!aSeaszw45`S(L -z(Kt}1=P571r0MmsefUuE-JhEuJ_75eS2SLDkGE-mF5kH7QzHB(5`BgYUb-O%xb7^D -zYSfo9TFIkdePfVU!p-U96r3e9HZHvflQiHwQyYDM8ch3_riFt@L`C1wSDd94Ya%L| -zjurLrieAG^tO?|DtrI#4@MySckJG|i8yqP~h6LcPi32Q)1mN5+9#f*Lxc -zX?&z?hc)eos2_!+BMFPVL4`elXaZH1i1GIqFzTWIjLz=qVPTX -zwx+E|?MLlJEjg`eAyfzIb<_b=w*~EIuprbR_VW$YAsozF+)@N_vh<>M;w-$5>cOSr -zz;~wlS550j^`O2r5?_=-ya^%bz&FHA)FD(AcUzvTnwF2+i#h}TIDe8-0w2wvWDR3a -zsn{_x@K@nN{DmN^DJ^CG>zXF_8?{Kg@pnHoHq}*ph?a>MW8aEbzi(O?kFNFC=rzOdg$C3p?B!@U*)+Fc{y|NnZxVga+m4pa$jT`-ug!X7{orgKld>Nz?PS5{0o#L? -zbXe9rR+#}?nl~xY5VPPu<+sqYpg3kK+E3tUyo)ir>E=;5w%}e+o1?7!<7^y`glr10 -zP#dyzNLg5?r+5`(E*u+~Vm^0;tQM9me9)4MBh(Iu7S6NqF=SwExzF+z-UVSU_ -zj?o`$bJ_L-#!JroM_Sj7` -zn|N39iKb;C<$>o=aWXUnUTU2jKU;nw$S(ryQa$jm5FUm%ZZqMtlsl|))7SW&F_p=reglOqn+ -zt>{9hPE)G4#3m9rNZq6!(hky2(q2+OX+P-zX^=ETIz-B{m>yJ8n@}$+A>bf&lX^%y -zNIOY;N&Te#qywZu(h%tosr&{L)nKe{)~sq$m3Zk=T7Mpn4Bc~u3jcF -z^C{?&v0G}!BPe;Gb&K-$C9$Af_6CEQjT!#lHDFAi%;fhjaZ$b*_we!@?e+|*On&d) -z&T)g%Yb4^{%vWUJow$|R?#SWykC%HR`iOreoAB&K&Ar_dp9GxC1u3m|yixGHLYAPA -z;a;78qsiliQzNkDyaf(&MD=IMI#-$JVUfOs+~pDXFTI^l -z)45k=4l;Ns13zR_aFIBc2rxjrg*c=14&r=M!_(U$3f@RO6jAU_$=lEYUm6~A^h;@2 -zEWiNq0C7LhfWe_(89PGUL+NFUFUs^0{Bz>$JHi2fw}_=_5-k`YgIshfaa#np5%)hN -z9C?JWQppL(3b}}fh|BcNCN@%Z^+Ry@$zp3j_>m*JLC=PBH2|?|ij_X7UQ=WmS^DEcq+7W!3;+xe* -zDW#aj*{;n2_pB{4F(<5AyU4`m!0ENc^|>OE+~K@NX**^L-cLS)(npa1@)Y$lad!pG -zURRXSd$%yl(_lMxAU{?fD1e>o7G*>p3jdtU?&%Qw)VF@nw+sbXxWtvPS+#(@vZf24+9)GsW1a -zvBgDY<#v1EL+=Y_=!?yO?oD;DI#vz5x#?|_G6cK7Uz`}idB%g(b~uMr?k=U?0Bct< -zba$!BB53L=j`7o;)en7L_LvaGLhug8pAGsBZuAmR)X=g2w!IUy_<5GRVzR6EyjXW94&X#yr^Rv&VSIsRvH` -z>?%Fby|{wK!&n$f<6Com=fPmc9W_--_8bK+-mQ939Dr_@fs- -ziW&p$+p=PMso+k?>Pm$dk;n(oMmW9AE@SFONZLL#dZS2P2=8F_N4Mum;DX)T?J?aw -V!n_vFZMVlN^j;mUKt|X2{|D$~Sdst$ - -delta 7376 -zcmZvh3v^V~xySdJ$%G`tWWp;CLNmbx0w_tukOaZZkVpmyG87O*9@86C9wCHY^;&8( -z69~#cvsU1vf(RN5_ex#1H=0$86mdW*c)eU>X?@^>v2bO=qlDYl3W}cl-)Db29R~MW -zXa0NtzWsikefG5f-nM_Itvx$qps<`@Qk4!*{c$^ukYSV`|Kt5yrh@tO3Og<*%Ilhy~J2V -zFC=7=J0Z)MZuy$v+a`U+ZtM3!>(@u`C)65uTQN!;m4R$z49C4I*4u>`Aku`hTJdBh -zqQR!Pn=AG+*#@|5=1!Lt6bqGzAETROK9R`^(B)=FI6}o=E5TrbPQ5Nw>ZQt3(KyDdqRmY -zIiubx1s-GmJKaO06}ZH_9xC(i;Z{E{&W$MQWcpvesgw~8~0>Vkiu_(g;*$6RoQ -zcq)nKxqt|d@luX{ow=`Afli3k#s(fs-`&cvgA2&u0y=q46n1%%erluclze(FIgwu8 -zn%_!lZj7dpX83LHvfk6uX;Gp=RS(zyxuKaB!=^g-Qv-pm|%HijRsjh_0tgly1K(UP@*e -zy=}LI5c0N_Jt-x<=6Gp1`Zs#XQ`rARL>3YDwmJ6DDNkOa8xf+-WP0j{AHrPd%fRt6 -zLdf8KDJp}UFQ|2LY4UdD0D~x?Lz9OkE`~k2i@un=BqxHoijw~_TM)LuO-bMKXL|D-dt0V3hxka+oWqlg{TQ39R1yArdcB`hg@hl@>IB&KC7AN8i&NHt=X8( -zQ;nlNuUt3H_UK9^LhX)H*zl?Q1|MWxYs~yi#`jlLwlx~~y`k;kaa?!1yV7O9IwJ9>xO4p|NbB<+M{c%u= -z>W>r{(I2DfUu(;3bB58D>a3x4191%jI^{(g;{BmfK+C;r -z6BlD&j&7qKZ{?`3he+$-uOMpV(`&lXv{{IOf)<`K%^CHV0PdjaQ*SlyrPWh!9eLnm -z*{A6n(lL244}NM@v+PdP?cVx=ebd`&R$&!5TIuzvg*fA#o?0}t@FR5O{hkFf)ze>_ -zW?kqn)(CzTeV2w$n{3Pam>!xoymA|sC@QlB5?dL8%Aqp@-89Hs -zD7P-xz$~e2dFWpdr4IAVIV1Fkp3HAeGujKHD*A@C;v50gL{&5k74^%CrUFehj(O5Y -zEfV;7(AhHvlMJ(@0=r+d@y{rB1o8sNlVB0KX53M6c>uhH($@NSUBiF;3Bmuori15X -z@IzGCny+fgpQKGQhI;!UU3y*+H4=YI|H0Rr9Vrh9u_65E=-K<_#*qHY(s1aO|9cQ@ -z(nb6pb9{+k%kqox18=40)ySdRFsZxi(u_=-v9HVFOR?Jq-%S~_3yc@L#?St*RPsAr -zulo1)3&GR-6mj~nWOMh=^1 -z6V!FYG+Uv5=niNQ`ZBZ^8itmpD@h^ -zsOyiWc~FL-SvXO&pF}~>PV`Y2+KmxR#R;JkGh{y0kEwSM>c;v=!W*aef6)-A`%BZ@ -z2JM9IgZl6mINA>@tQ($>WP}T**$ZugCeS;}MjCFqvTS7bRrE~kfdaF^IzabQ>GI6M -z%YJW~`uKou7aQ>`rA5nY%Pzt)0wHlvn)6B9!Zdk4lW8wXcF;5nrLwDoCZJcd=;P%x -zM=g8PG}W6_9c7lmvJGq;$CkBu0xV3kRty~c->~4#XgO>GLXJ`q{ba>ZqmF*DV!e?? -z*(;|T2Wj`p;^aGFKaSo%i%_{E^$(`mNRt{yZf(d-mR0bf|8JwphT7!$2z4N|kajoB -zb6kfnNY@%>JLX^{vS`+->5jedMd^iAwT@o+4$`GnwaF7P9=`WYvy-l@Dxe=VmODB? -zcG2#}TE|8BN~ouCWndvjr|EO7XOtmkra9N!>eG^@yk(u*9*1o&Y)hpLPB!T0U;-~3 -z>s!E^=Cf}yQqqz<{be`ogRK>>vd7?;PIj;y{a!Hr(IUBw`zLVk8FPr4FA1E4QNX2V -zFos>ToJ-QC>65-b*`qHlw--GiU8)k57JhwR%B@xgY`>OsHq(OUJfoS`HjmAB%Atot -zQI`9NGn20=>ALBiW*5#B=bOi7xH(5mM9T$fRG=6$@%})bEz+OX2A)Eu9@~&WiL5=G -zo7KnaXKi8)vbM8!uy(SBS-V*yti7z(RRzj%W?01um(qYJVc=%7=Bj)&65_MC67lDyv<7 -zS_WfdYK~>w@_js8xW1RuYwO1a;`&H_|Jra{;*@JT#>v$yxn82$R1S|J{#k-vx>GEE -zQs&U-&+v_~6eD-dSh#k@l%fOA{F -zLcGP?&+&D^pX>N>{4#U#LzRJi+o*MiceZSCm<{b*fRni^j=Pw5%u*5k9KTd^p8~o< -zUgikHjcIJUqUN3jt%IojY}54 -zwc_5qF&we@%^T0V;PRe4e#iTq^KrK5oRyxpc;ALJrqB8yUb{AdcdfGzDGwI3yp6@F -zWO8V%EmA^14lTAtCea^5#Z!6D(I-23Q7Gfa-dD;@x|zH1{Vkoo4?V}+T}ab5jm?R_ -z*DXf}%Iw0~v~|(v>O^yP5ah(=z{ndHjv_1?Ej|6;Yqr -z5-?~3I4y*h{5&Jz=6l0S%|Tzm|Fo!4MTivgv}Fz-fm53tf%v~n+{{Hz*V?v_EqQ!}s2_XBxbc-;sqOz^#|?Hr -zIzdxtRZ4o-_-zN|CDWCsi!=1;Mr#F?ZZFQzhe@s7v<6h4b+j&^SGE@?yZN~4rk?HP -z$w3a`NV%gtSsygrw0uWJvR)fbdI>fTxtw$!Aw3QQX!J9EA?E;E@l3gMplZK9-&E2o -z&lIQVrJq|(=aGW<6yc-MJIkHC`Riq!OKWx(575UKt=ALj)t$x3%_?_iBc0z_u0vUk -zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh -dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh - -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 -index f33ce913a..01b208ed2 100644 ---- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -+++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java -@@ -30,6 +30,22 @@ public abstract class DefinedPacket - writeString( s, buf, Short.MAX_VALUE ); - } - -+ //Velocity start -+ private static final int[] VARINT_EXACT_BYTE_LENGTHS = new int[33]; -+ -+ static { -+ for (int i = 0; i <= 32; ++i) { -+ VARINT_EXACT_BYTE_LENGTHS[i] = (int) Math.ceil((31d - (i - 1)) / 7d); -+ } -+ VARINT_EXACT_BYTE_LENGTHS[32] = 1; // Special case for the number 0. -+ } -+ -+ public static int varIntBytes(int value) { -+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)]; -+ } -+ //Velocity end -+ -+ - public static void writeString(String s, ByteBuf buf, int maxLength) - { - if ( s.length() > maxLength ) -@@ -198,6 +214,12 @@ public abstract class DefinedPacket - } - } - -+ public static void write21BitVarInt(ByteBuf buf, int value) { -+ // See https://steinborn.me/posts/performance/how-fast-can-you-write-a-varint/ -+ int w = (value & 0x7F | 0x80) << 16 | ((value >>> 7) & 0x7F | 0x80) << 8 | (value >>> 14); -+ buf.writeMedium(w); -+ } -+ - public static int readVarShort(ByteBuf buf) - { - int low = buf.readUnsignedShort(); -diff --git a/proxy/pom.xml b/proxy/pom.xml -index 10fe411d8..f6daaea4d 100644 ---- a/proxy/pom.xml -+++ b/proxy/pom.xml -@@ -165,6 +165,12 @@ - ${project.version} - compile - -+ -+ io.github.waterfallmc -+ waterfall-native -+ ${project.version} -+ compile -+ - - io.github.waterfallmc - waterfall-module-cmd-alert -diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index f5059666e..dba21bcc7 100644 ---- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -@@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; - import dev._2lstudios.flamecord.configuration.ModulesConfiguration; - import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; -+import dev._2lstudios.flamecord.natives.Natives; - import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; - import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException; - import io.netty.bootstrap.ServerBootstrap; -@@ -256,23 +257,7 @@ public class BungeeCord extends ProxyServer - - pluginManager = new PluginManager( this ); - -- if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) -- { -- if ( EncryptionUtil.nativeFactory.load() ) -- { -- logger.info( "Using mbed TLS based native cipher." ); -- } else -- { -- logger.info( "Using standard Java JCE cipher." ); -- } -- if ( CompressFactory.zlib.load() ) -- { -- logger.info( "Using zlib based native compressor." ); -- } else -- { -- logger.info( "Using standard Java compressor." ); -- } -- } -+ logger.log(Level.INFO, "FlameCord is using " + Natives.getCompressorFactory().getName() + " compression"); - } - - /** -diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf4627..10cb0430c 100644 ---- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -+++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -@@ -1,45 +1,74 @@ - package net.md_5.bungee.compress; - -+import java.util.zip.DataFormatException; -+ -+import dev._2lstudios.flamecord.natives.MoreByteBufUtils; -+import dev._2lstudios.flamecord.natives.compress.Compressor; - import io.netty.buffer.ByteBuf; -+import io.netty.buffer.ByteBufAllocator; - import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.MessageToByteEncoder; --import java.util.zip.Deflater; - import lombok.Setter; --import net.md_5.bungee.jni.zlib.BungeeZlib; - import net.md_5.bungee.protocol.DefinedPacket; - --public class PacketCompressor extends MessageToByteEncoder --{ -+public class PacketCompressor extends MessageToByteEncoder { -+ -+ private final Compressor compressor; - -- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); - @Setter - private int threshold = 256; - -- @Override -- public void handlerAdded(ChannelHandlerContext ctx) throws Exception -- { -- zlib.init( true, Deflater.DEFAULT_COMPRESSION ); -+ public PacketCompressor(Compressor compressor) { -+ this.compressor = compressor; - } - - @Override -- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception -- { -- zlib.free(); -+ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { -+ compressor.close(); - } - - @Override -- protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception -- { -+ protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { - int origSize = msg.readableBytes(); -- if ( origSize < threshold ) -- { -- DefinedPacket.writeVarInt( 0, out ); -- out.writeBytes( msg ); -- } else -- { -- DefinedPacket.writeVarInt( origSize, out ); -- -- zlib.process( msg, out ); -+ if (origSize < threshold) { -+ // Under the threshold, there is nothing to do. -+ DefinedPacket.writeVarInt(0, out); -+ out.writeBytes(msg); -+ return; -+ } -+ -+ int uncompressed = msg.readableBytes(); -+ -+ DefinedPacket.writeVarInt(uncompressed, out); -+ ByteBuf compatibleIn = MoreByteBufUtils.ensureCompatible(ctx.alloc(), compressor, msg); -+ -+ int startCompressed = out.writerIndex(); -+ try { -+ compressor.deflate(compatibleIn, out); -+ } finally { -+ compatibleIn.release(); -+ } -+ int compressedLength = out.writerIndex() - startCompressed; -+ if (compressedLength >= 1 << 21) { -+ throw new DataFormatException("The server sent a very large (over 2MiB compressed) packet."); - } - } -+ -+ @Override -+ protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception { -+ return allocateByteBufForCompression(ctx.alloc(), msg, threshold); -+ } -+ -+ public static ByteBuf allocateByteBufForCompression(ByteBufAllocator allocator, ByteBuf msg, int threshold) { -+ int uncompressed = msg.readableBytes(); -+ if (uncompressed < threshold) { -+ int finalBufferSize = uncompressed + 1; -+ finalBufferSize += DefinedPacket.varIntBytes(finalBufferSize); -+ return allocator.directBuffer(finalBufferSize); -+ } -+ -+ // (maximum data length after compression) + packet length varint + uncompressed data varint -+ int initialBufferSize = (uncompressed - 1) + 3 + DefinedPacket.varIntBytes(uncompressed); -+ return allocator.directBuffer(initialBufferSize); -+ } - } -diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -index eaedf4bc4..066bdafc8 100644 ---- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -+++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -@@ -1,5 +1,6 @@ - package net.md_5.bungee.compress; - -+import dev._2lstudios.flamecord.natives.compress.Compressor; - import lombok.*; - - import com.google.common.base.Preconditions; -@@ -8,53 +9,75 @@ import io.netty.channel.ChannelHandlerContext; - import io.netty.handler.codec.MessageToMessageDecoder; - import java.util.List; - import net.md_5.bungee.jni.zlib.BungeeZlib; -+import net.md_5.bungee.protocol.BadPacketException; - import net.md_5.bungee.protocol.DefinedPacket; - -+import static dev._2lstudios.flamecord.natives.MoreByteBufUtils.ensureCompatible; -+ -+ - @RequiredArgsConstructor --public class PacketDecompressor extends MessageToMessageDecoder --{ -+public class PacketDecompressor extends MessageToMessageDecoder { -+ private static final int VANILLA_MAXIMUM_UNCOMPRESSED_SIZE = 8 * 1024 * 1024; // 8MiB -+ private static final int MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING = ((100 * 4) + Short.MAX_VALUE) + 5 + 5; //((100 chars channel tag) + max data size) + string varint + packet id varint - -- private final int compressionThreshold; -- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); -+ @Setter -+ private boolean checking = false; - -- @Override -- public void handlerAdded(ChannelHandlerContext ctx) throws Exception -- { -- zlib.init( false, 0 ); -- } -+ private final Compressor compressor; -+ private final int threshold; - - @Override -- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception -- { -- zlib.free(); -+ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { -+ compressor.close(); - } - - @Override -- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception -- { -- int size = DefinedPacket.readVarInt( in ); -- if ( size == 0 ) -- { -- out.add( in.retain() ); -- } else -- { -- Preconditions.checkArgument( size >= compressionThreshold, "Decompressed size %s less than compression threshold %s", size, compressionThreshold); -- ByteBuf decompressed = ctx.alloc().directBuffer(); -- -- try -- { -- zlib.process( in, decompressed ); -- Preconditions.checkArgument( decompressed.readableBytes() == size, "Decompressed size %s is not equal to actual decompressed bytes", size, decompressed.readableBytes()); -- -- out.add( decompressed ); -- decompressed = null; -- } finally -- { -- if ( decompressed != null ) -- { -- decompressed.release(); -- } -- } -+ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { -+ int size = DefinedPacket.readVarInt(in); -+ if (size == 0) { -+ out.add(in.retain()); -+ return; -+ } -+ -+ //Velocity start -+ if (threshold != -1 && size < threshold) { -+ throw new BadPacketException( -+ "Uncompressed size " + size + " is less than threshold " + threshold -+ ); -+ } -+ -+ if (size > VANILLA_MAXIMUM_UNCOMPRESSED_SIZE) { -+ throw new BadPacketException("" + -+ "Uncompressed size " + size + " exceeds threshold of " + VANILLA_MAXIMUM_UNCOMPRESSED_SIZE -+ ); -+ } -+ -+ if (checking && size > MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING) { -+ throw new BadPacketException( -+ "Uncompressed size " + size + " exceeds threshold of " + MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING + " (While checking)" -+ ); -+ } -+ //Velocity end -+ -+ ByteBuf compatibleIn = ensureCompatible(ctx.alloc(), compressor, in); -+ ByteBuf uncompressed; -+ if (checking) { -+ uncompressed = ctx.alloc().directBuffer(size, size); -+ } -+ else { -+ uncompressed = ctx.alloc().directBuffer(size); -+ } -+ -+ try { -+ compressor.inflate(compatibleIn, uncompressed, size); -+ out.add(uncompressed); -+ } -+ catch (Exception e) { -+ uncompressed.release(); -+ throw e; -+ } -+ finally { -+ compatibleIn.release(); - } - } --} -+} -\ No newline at end of file -diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab8..95ed34416 100644 ---- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -+++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -@@ -44,8 +44,8 @@ public class ForgeUtils - if ( discriminator == 2 ) // ModList - { - ByteBuf buffer = payload.slice(); -- int modCount = DefinedPacket.readVarInt( buffer, 2 ); -- for ( int i = 0; i < modCount; i++ ) -+ int modCount = DefinedPacket.readVarInt( buffer ); // FlameCord - Remove length check for compression -+ for ( int i = 0; i < modCount; i++ ) - { - modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); - } -diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a75..ffe038168 100644 ---- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -+++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -@@ -1,6 +1,10 @@ - package net.md_5.bungee.netty; - - import com.google.common.base.Preconditions; -+import dev._2lstudios.flamecord.FlameCord; -+import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; -+import dev._2lstudios.flamecord.natives.Natives; -+import dev._2lstudios.flamecord.natives.compress.Compressor; - import io.netty.channel.Channel; - import io.netty.channel.ChannelFutureListener; - import io.netty.channel.ChannelHandler; -@@ -145,15 +149,16 @@ public class ChannelWrapper - return ch; - } - -- public void setCompressionThreshold(int compressionThreshold) -- { -+ public void setCompressionThreshold(int compressionThreshold) { -+ Compressor compressor = Natives.getCompressorFactory().create( FlameCord.getInstance().getFlameCordConfiguration().getCompressionLevel() ); -+ - // FlameCord - Use pipeline to reduce redundancy - final ChannelPipeline pipeline = ch.pipeline(); - if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) - { -- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); -+ addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor( compressor ) ); - } -- if ( compressionThreshold != -1 ) -+ if ( compressionThreshold != -1 ) - { - pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); - } else -@@ -163,7 +168,7 @@ public class ChannelWrapper - - if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) - { -- addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); -+ addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor( compressor, compressionThreshold ) ); // FlameCord - Implement Libdeflate - } - if ( compressionThreshold == -1 ) - { -@@ -171,6 +176,7 @@ public class ChannelWrapper - } - } - -+ - // FlameCord start - Antibot System - // Make the channel accessible - public Channel getChannel() { -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 f04fdd9ce..9aebc9e1a 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 -@@ -126,7 +126,8 @@ public class PipelineUtils - }; - public static final Base BASE = new Base(); - private static final KickStringWriter legacyKicker = new KickStringWriter(); -- private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); -+ // FlameCord - Implement Libdeflate -+ public static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); - public static final String TIMEOUT_HANDLER = "timeout"; - public static final String PACKET_DECODER = "packet-decoder"; - public static final String PACKET_ENCODER = "packet-encoder"; --- -2.37.3.windows.1 - From d387b6fb3f60f955336d36eabe718eaebd631681 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Feb 2023 17:24:27 -0300 Subject: [PATCH 416/499] Ignore new patches --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a9f790e6..ae230226 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ out/ .project .settings -pom.xml \ No newline at end of file +pom.xml + +Waterfall-Proxy-Patches \ No newline at end of file From 4bb4066ad486431e694ce184c3a5383301ec9925 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Feb 2023 17:51:32 -0300 Subject: [PATCH 417/499] Make compilable again --- .gitignore | 6 +- .../0001-FlameCord-POM-Changes.patch | 146 + ...ferences-from-Waterfall-to-FlameCord.patch | 122 + .../0003-FlameCord-rebrand.patch | 63 + .../0004-1.7.x-support.patch | 1620 +++++++++ ...ake-PlayerHandshakeEvent-cancellable.patch | 56 + .../0006-Make-a-getter-for-the-callback.patch | 23 + ...sable-update-checker-Use-bungee-name.patch | 73 + .../0008-Change-replaceAll-to-replace.patch | 23 + ...9-Use-duplicate-for-MinecraftDecoder.patch | 32 + ...ections-Don-t-flush-if-not-necessary.patch | 131 + .../0011-Packet-Checks.patch | 53 + .../0012-Change-default-timeout.patch | 23 + ...0013-Don-t-allow-name-containing-dot.patch | 23 + ...14-Use-pipeline-to-reduce-redundancy.patch | 78 + ...tom-uuids-even-if-onlineMode-is-true.patch | 22 + ...ateException-to-QuietException-and-e.patch | 24 + ...-Don-t-declare-uuid-unless-it-s-null.patch | 25 + .../0018-FlameCord-General-Patch.patch | 377 ++ .../0019-FlameCord-module-system.patch | 194 + ...0020-FlameCord-message-configuration.patch | 224 ++ .../0021-Fix-ByteBuf-memory-leaks.patch | 68 + .../0022-Check-if-packetID-is-invalid.patch | 27 + .../0023-FlameCord-logger-options.patch | 140 + ...dded-an-api-method-to-unload-Plugins.patch | 86 + .../0025-Apply-packet-limits.patch | 69 + .../0026-Custom-motd-system.patch | 676 ++++ .../0027-TCP-Fast-Open.patch | 46 + .../0028-Antibot-System.patch | 1989 ++++++++++ .../0029-Allow-Invalid-Names.patch | 47 + ...0030-Disable-entity-Metadata-Rewrite.patch | 3240 +++++++++++++++++ ...31-Dont-frame-unreadable-connections.patch | 22 + .../0032-Avoid-throwing-IOOB-on-login.patch | 23 + ...tion-fail-reason-when-detailed-logge.patch | 26 + ...0034-Optimize-Decoder-Encoder-Getter.patch | 60 + ...Dont-Process-Links-For-Kick-Messages.patch | 134 + .../0036-Bungee-Plugins-Command.patch | 97 + .../0037-Bungee-IP-Command.patch | 98 + .../0038-List-Command-Format.patch | 37 + ...0039-InitialHandler-Processing-State.patch | 124 + .../0040-Implement-libdeflate.patch | 2623 +++++++++++++ pom.xml | 25 + 42 files changed, 12990 insertions(+), 5 deletions(-) create mode 100644 Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch create mode 100644 Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch create mode 100644 Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch create mode 100644 Waterfall-Proxy-Patches/0004-1.7.x-support.patch create mode 100644 Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch create mode 100644 Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch create mode 100644 Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch create mode 100644 Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch create mode 100644 Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch create mode 100644 Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch create mode 100644 Waterfall-Proxy-Patches/0011-Packet-Checks.patch create mode 100644 Waterfall-Proxy-Patches/0012-Change-default-timeout.patch create mode 100644 Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch create mode 100644 Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch create mode 100644 Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch create mode 100644 Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch create mode 100644 Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch create mode 100644 Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch create mode 100644 Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch create mode 100644 Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch create mode 100644 Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch create mode 100644 Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch create mode 100644 Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch create mode 100644 Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch create mode 100644 Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch create mode 100644 Waterfall-Proxy-Patches/0026-Custom-motd-system.patch create mode 100644 Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch create mode 100644 Waterfall-Proxy-Patches/0028-Antibot-System.patch create mode 100644 Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch create mode 100644 Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch create mode 100644 Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch create mode 100644 Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch create mode 100644 Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch create mode 100644 Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch create mode 100644 Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch create mode 100644 Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch create mode 100644 Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch create mode 100644 Waterfall-Proxy-Patches/0038-List-Command-Format.patch create mode 100644 Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch create mode 100644 Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index ae230226..e9b9b106 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,4 @@ FlameCord-Proxy out/ .project -.settings - -pom.xml - -Waterfall-Proxy-Patches \ No newline at end of file +.settings \ No newline at end of file diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch new file mode 100644 index 00000000..2da0b2fa --- /dev/null +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -0,0 +1,146 @@ +From 01758bf18170f703930757151d86c9440e8793da Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:59:15 +0800 +Subject: [PATCH] FlameCord POM Changes + + +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +new file mode 100644 +index 00000000..20edd900 +--- /dev/null ++++ b/flamecord/pom.xml +@@ -0,0 +1,44 @@ ++ ++ 4.0.0 ++ ++ ++ io.github.waterfallmc ++ waterfall-parent ++ 1.19-R0.1-SNAPSHOT ++ ../pom.xml ++ ++ ++ dev._2lstudios ++ waterfall-flamecord ++ 1.19-R0.1-SNAPSHOT ++ jar ++ ++ Waterfall-FlameCord ++ FlameCord adds security essentials and new configuration options ++ ++ ++ ++ io.github.waterfallmc ++ waterfall-config ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-chat ++ ${project.version} ++ compile ++ ++ ++ ++ ++ ${project.name} ++ ++ ++ true ++ ${basedir}/src/main/resources ++ ++ ++ ++ +diff --git a/pom.xml b/pom.xml +index 2b544c23..d940b21c 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -63,6 +63,7 @@ + query + + native ++ flamecord + + + +diff --git a/protocol/pom.xml b/protocol/pom.xml +index 93ae5952..d6222d16 100644 +--- a/protocol/pom.xml ++++ b/protocol/pom.xml +@@ -64,5 +64,14 @@ + 1.3.0 + compile + ++ ++ ++ ++ dev._2lstudios ++ waterfall-flamecord ++ ${project.version} ++ compile ++ ++ + + +diff --git a/proxy/pom.xml b/proxy/pom.xml +index 1036a2e7..10fe411d 100644 +--- a/proxy/pom.xml ++++ b/proxy/pom.xml +@@ -157,6 +157,51 @@ + runtime + + ++ ++ ++ ++ dev._2lstudios ++ waterfall-flamecord ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-module-cmd-alert ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-module-cmd-find ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-module-cmd-list ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-module-cmd-send ++ ${project.version} ++ compile ++ ++ ++ io.github.waterfallmc ++ waterfall-module-cmd-server ++ ${project.version} ++ compile ++ ++ ++ net.md-5 ++ bungeecord-module-reconnect-yaml ++ ${project.version} ++ compile ++ ++ + + + +-- +2.37.0.windows.1 + diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch new file mode 100644 index 00000000..a5690f86 --- /dev/null +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -0,0 +1,122 @@ +From 5b40e2e22fb37fb5aa2b34d3a6b14bd91e7e72fa Mon Sep 17 00:00:00 2001 +From: Techcable +Date: Mon, 6 Jun 2016 13:47:46 -0600 +Subject: [PATCH] Rename references from Waterfall to FlameCord + + +diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml +index 688f1b995..b0b0d33eb 100644 +--- a/bootstrap/pom.xml ++++ b/bootstrap/pom.xml +@@ -37,7 +37,7 @@ + + + +- Waterfall ++ FlameCord + + + org.apache.maven.plugins +diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +index a4516ed96..9838f5c55 100644 +--- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java ++++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +@@ -7,7 +7,7 @@ public class Bootstrap + { + if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 ) + { +- System.err.println( "*** ERROR *** Waterfall requires Java 8 or above to function! Please download and install it!" ); ++ System.err.println( "*** ERROR *** FlameCord requires Java 8 or above to function! Please download and install it!" ); + System.out.println( "You can check your Java version with the command: java -version" ); + return; + } +diff --git a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java +index d703d6d24..49dce84ba 100644 +--- a/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java ++++ b/log/src/main/java/net/md_5/bungee/log/LogDispatcher.java +@@ -12,7 +12,7 @@ public class LogDispatcher extends Thread + + public LogDispatcher(BungeeLogger logger) + { +- super( "Waterfall Logger Thread" ); ++ super( "FlameCord Logger Thread" ); + this.logger = logger; + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index e0fcd8fbe..8617cdc7a 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -189,7 +189,7 @@ public class BungeeCord extends ProxyServer + public BungeeCord() throws IOException + { + // Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up. +- Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use Waterfall in directory with ! in path." ); ++ Preconditions.checkState( new File( "." ).getAbsolutePath().indexOf( '!' ) == -1, "Cannot use FlameCord in directory with ! in path." ); + + reloadMessages(); + +@@ -545,7 +545,7 @@ public class BungeeCord extends ProxyServer + @Override + public String getName() + { +- return "Waterfall"; ++ return "FlameCord"; + } + + @Override +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +index 96a9998d1..463bc3d53 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +@@ -63,7 +63,7 @@ public class BungeeCordLauncher + + BungeeCord bungee = new BungeeCord(); + ProxyServer.setInstance( bungee ); +- bungee.getLogger().info( "Enabled Waterfall version " + bungee.getVersion() ); ++ bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); + bungee.start(); + + if ( !options.has( "noconsole" ) ) +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +index b26035cf9..820f7b03c 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +@@ -16,6 +16,6 @@ public class CommandBungee extends Command + @Override + public void execute(CommandSender sender, String[] args) + { +- sender.sendMessage( ChatColor.BLUE + "This server is running Waterfall version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +index 720d0c3b5..5ab4db189 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +@@ -23,7 +23,7 @@ public class CommandReload extends Command + BungeeCord.getInstance().startListeners(); + BungeeCord.getInstance().getPluginManager().callEvent( new ProxyReloadEvent( sender ) ); + +- sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "Waterfall has been reloaded." +- + " This is NOT advisable and you will not be supported with any issues that arise! Please restart Waterfall ASAP." ); ++ sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "FlameCord has been reloaded." ++ + " This is NOT advisable and you will not be supported with any issues that arise! Please restart FlameCord ASAP." ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +index 0dd69778b..9abae0b61 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +@@ -227,7 +227,7 @@ public class YamlConfig implements ConfigurationAdapter + Map val = entry.getValue(); + String name = entry.getKey(); + String addr = get( "address", "localhost:25565", val ); +- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Waterfall - Forced Host", val ) ); ++ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); + boolean restricted = get( "restricted", false, val ); + SocketAddress address = Util.getAddr( addr ); + ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch new file mode 100644 index 00000000..29c2ad9e --- /dev/null +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -0,0 +1,63 @@ +From 84cae2e73501b000c7f15d260d4ec736d7025ea3 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 8 Jun 2021 22:24:27 -0300 +Subject: [PATCH] FlameCord rebrand + + +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index da0efa36f..966d2442b 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { + YamlConfig config = new YamlConfig(new File("waterfall.yml")); + config.load(false); // Load, but no permissions + logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); +- gameVersion = config.getString("game_version", "").isEmpty() ? Joiner.on(", ").join(ProtocolConstants.SUPPORTED_VERSIONS) : config.getString("game_version", ""); ++ // FlameCord - Make the version look better ++ gameVersion = config.getString("game_version", "").isEmpty() ? ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1) : config.getString("game_version", ""); + useNettyDnsResolver = config.getBoolean("use_netty_dns_resolver", useNettyDnsResolver); + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 8617cdc7a..0ed479c8d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer + @Override + public String getVersion() + { +- return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); ++ return "1.3.6"; + } + + public final void reloadMessages() +diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +index 820f7b03c..aeda79639 100644 +--- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java ++++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +@@ -16,6 +16,7 @@ public class CommandBungee extends Command + @Override + public void execute(CommandSender sender, String[] args) + { +- sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); ++ // FlameCord - Use custom version message ++ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); + } + } +diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +index 0c1ecfb8e..b2b199969 100644 +--- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java ++++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +@@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler + // Waterfall start + List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); + +- ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", ++ // FlameCord - Rebrand ++ ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "FlameCord_Proxy", + bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), + listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); + QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch new file mode 100644 index 00000000..ceb18cfc --- /dev/null +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -0,0 +1,1620 @@ +From c6b956bee70e03b5983a6c83a083ba9426258667 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 30 Sep 2021 19:54:33 -0300 +Subject: [PATCH] 1.7.x support + + +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 +index 59f2cb73d..f33ce913a 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +@@ -415,4 +415,36 @@ public abstract class DefinedPacket + return 0; + } + // Waterfall end ++ ++ // FlameCord start - 1.7.x support ++ public static byte[] v17readArray(ByteBuf buf) ++ { ++ // Read in a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) ++ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. ++ int len = readVarShort( buf ); ++ ++ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit ++ Preconditions.checkArgument( len <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot receive array longer than 2097050 (got %s bytes)", len ); ++ ++ byte[] ret = new byte[ len ]; ++ buf.readBytes( ret ); ++ return ret; ++ } ++ ++ public static void v17writeArray(byte[] b, ByteBuf buf, boolean allowExtended) ++ { ++ // (Integer.MAX_VALUE & 0x1FFF9A ) = 2097050 - Forge's current upper limit ++ if ( allowExtended ) ++ { ++ Preconditions.checkArgument( b.length <= ( Integer.MAX_VALUE & 0x1FFF9A ), "Cannot send array longer than 2097050 (got %s bytes)", b.length ); ++ } else ++ { ++ Preconditions.checkArgument( b.length <= Short.MAX_VALUE, "Cannot send array longer than Short.MAX_VALUE (got %s bytes)", b.length ); ++ } ++ // Write a 2 or 3 byte number that represents the length of the packet. (3 byte "shorts" for Forge only) ++ // No vanilla packet should give a 3 byte packet, this method will still retain vanilla behaviour. ++ writeVarShort( buf, b.length ); ++ buf.writeBytes( b ); ++ } ++ // FlameCord end - 1.7.x support + } +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 +index 2357f3801..c9e45b915 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -66,7 +66,7 @@ public enum Protocol + TO_SERVER.registerPacket( + Handshake.class, + Handshake::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + } + }, +@@ -78,7 +78,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + KeepAlive.class, + KeepAlive::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), + map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), + map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), +@@ -93,7 +93,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Login.class, + Login::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), + map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), +@@ -106,7 +106,7 @@ public enum Protocol + ); + TO_CLIENT.registerPacket( Chat.class, + Chat::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), + map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), + map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), +@@ -117,7 +117,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Respawn.class, + Respawn::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x07 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x07 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), +@@ -144,20 +144,20 @@ public enum Protocol + TO_CLIENT.registerPacket( + EntityEffect.class, + EntityEffect::new, +- map(ProtocolConstants.MINECRAFT_1_8, 0x1D), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support + map(ProtocolConstants.MINECRAFT_1_9, -1) + ); + TO_CLIENT.registerPacket( + EntityRemoveEffect.class, + EntityRemoveEffect::new, +- map(ProtocolConstants.MINECRAFT_1_8, 0x1E), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support + map(ProtocolConstants.MINECRAFT_1_9, -1) + ); + // Waterfall end + TO_CLIENT.registerPacket( + PlayerListItem.class, // PlayerInfo + PlayerListItem::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x38 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x38 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), + map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), +@@ -173,7 +173,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + TabCompleteResponse.class, + TabCompleteResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3A ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3A ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), + map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), + map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), +@@ -186,7 +186,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardObjective.class, + ScoreboardObjective::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3B ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3B ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), + map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), +@@ -200,7 +200,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardScore.class, + ScoreboardScore::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3C ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3C ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), +@@ -214,7 +214,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + ScoreboardDisplay.class, + ScoreboardDisplay::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3D ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3D ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), +@@ -228,7 +228,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Team.class, + Team::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3E ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3E ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), +@@ -242,7 +242,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + PluginMessage.class, + PluginMessage::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x3F ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x3F ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), + map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), +@@ -257,7 +257,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Kick.class, + Kick::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x40 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x40 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), + map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), + map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), +@@ -272,7 +272,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + Title.class, + Title::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x45 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x45 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), + map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), +@@ -317,7 +317,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + PlayerListHeaderFooter.class, + PlayerListHeaderFooter::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x47 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x47 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), + map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), +@@ -335,7 +335,7 @@ public enum Protocol + TO_CLIENT.registerPacket( + EntityStatus.class, + EntityStatus::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x1A ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x1A ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), + map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), + map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), +@@ -401,7 +401,7 @@ public enum Protocol + TO_SERVER.registerPacket( + KeepAlive.class, + KeepAlive::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), + map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), +@@ -415,7 +415,7 @@ public enum Protocol + ); + TO_SERVER.registerPacket( Chat.class, + Chat::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), +@@ -437,7 +437,7 @@ public enum Protocol + TO_SERVER.registerPacket( + TabCompleteRequest.class, + TabCompleteRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x14 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x14 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), +@@ -450,7 +450,7 @@ public enum Protocol + TO_SERVER.registerPacket( + ClientSettings.class, + ClientSettings::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x15 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x15 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), +@@ -462,7 +462,7 @@ public enum Protocol + TO_SERVER.registerPacket( + PluginMessage.class, + PluginMessage::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x17 ), ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x17 ), // FlameCord - 1.7.x support + map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), + map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), + map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), +@@ -483,23 +483,23 @@ public enum Protocol + TO_CLIENT.registerPacket( + StatusResponse.class, + StatusResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + PingPacket.class, + PingPacket::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + + TO_SERVER.registerPacket( + StatusRequest.class, + StatusRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + PingPacket.class, + PingPacket::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + } + }, +@@ -511,22 +511,22 @@ public enum Protocol + TO_CLIENT.registerPacket( + Kick.class, + Kick::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + EncryptionRequest.class, + EncryptionRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + LoginSuccess.class, + LoginSuccess::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x02 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x02 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + SetCompression.class, + SetCompression::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x03 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x03 ) // FlameCord - 1.7.x support + ); + TO_CLIENT.registerPacket( + LoginPayloadRequest.class, +@@ -537,12 +537,12 @@ public enum Protocol + TO_SERVER.registerPacket( + LoginRequest.class, + LoginRequest::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x00 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x00 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + EncryptionResponse.class, + EncryptionResponse::new, +- map( ProtocolConstants.MINECRAFT_1_8, 0x01 ) ++ map( ProtocolConstants.MINECRAFT_1_7_2, 0x01 ) // FlameCord - 1.7.x support + ); + TO_SERVER.registerPacket( + LoginPayloadResponse.class, +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 +index 85f1b0b46..b5b3b2890 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +@@ -7,6 +7,10 @@ public class ProtocolConstants + { + + private static final boolean SNAPSHOT_SUPPORT = Boolean.getBoolean( "net.md_5.bungee.protocol.snapshot" ); ++ // FlameCord start - 1.7.x support ++ public static final int MINECRAFT_1_7_2 = 4; ++ public static final int MINECRAFT_1_7_6 = 5; ++ // FlameCord end - 1.7.x support + public static final int MINECRAFT_1_8 = 47; + public static final int MINECRAFT_1_9 = 107; + public static final int MINECRAFT_1_9_1 = 108; +@@ -47,6 +51,7 @@ public class ProtocolConstants + static + { + ImmutableList.Builder supportedVersions = ImmutableList.builder().add( ++ "1.7.x", // FlameCord - 1.7.x support + "1.8.x", + "1.9.x", + "1.10.x", +@@ -61,6 +66,10 @@ public class ProtocolConstants + "1.19.x" + ); + ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( ++ // FlameCord start - 1.7.x support ++ ProtocolConstants.MINECRAFT_1_7_2, ++ ProtocolConstants.MINECRAFT_1_7_6, ++ // FlameCord end - 1.7.x support + ProtocolConstants.MINECRAFT_1_8, + ProtocolConstants.MINECRAFT_1_9, + ProtocolConstants.MINECRAFT_1_9_1, +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +index dc9866097..230018aea 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +@@ -41,6 +41,7 @@ public class Chat extends DefinedPacket + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { + message = readString( buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); ++ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support + if ( direction == ProtocolConstants.Direction.TO_CLIENT ) + { + position = buf.readByte(); +@@ -55,6 +56,7 @@ public class Chat extends DefinedPacket + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { + writeString( message, buf, ( direction == ProtocolConstants.Direction.TO_CLIENT ) ? 262144 : ( protocolVersion >= ProtocolConstants.MINECRAFT_1_11 ? 256 : 100 ) ); ++ if ( ProtocolConstants.isAfterOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_8 ) ) // FlameCord - 1.7.x support + if ( direction == ProtocolConstants.Direction.TO_CLIENT ) + { + buf.writeByte( position ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +index d7d4e6ab4..570a89f0a 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +@@ -34,6 +34,12 @@ public class ClientSettings extends DefinedPacket + chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte(); + chatColours = buf.readBoolean(); + skinParts = buf.readByte(); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ difficulty = buf.readByte(); ++ } ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) + { + mainHand = DefinedPacket.readVarInt( buf ); +@@ -51,6 +57,19 @@ public class ClientSettings extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( locale, buf ); ++ buf.writeByte( viewDistance ); ++ buf.writeByte( chatFlags ); ++ buf.writeBoolean( chatColours ); ++ buf.writeByte( skinParts ); ++ buf.writeByte( difficulty ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( locale, buf ); + buf.writeByte( viewDistance ); + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +index a29524ca8..e78519964 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +@@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ serverId = readString( buf ); ++ publicKey = v17readArray( buf ); ++ verifyToken = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + serverId = readString( buf ); + publicKey = readArray( buf ); + verifyToken = readArray( buf ); +@@ -31,6 +41,16 @@ public class EncryptionRequest extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( serverId, buf ); ++ v17writeArray( publicKey, buf, false ); ++ v17writeArray( verifyToken, buf, false ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( serverId, buf ); + writeArray( publicKey, buf ); + writeArray( verifyToken, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +index 545eec72f..eacdbe78a 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +@@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket + + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ sharedSecret = v17readArray( buf ); ++ verifyToken = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + sharedSecret = readArray( buf, 128 ); + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19 || protocolVersion >= ProtocolConstants.MINECRAFT_1_19_3 || buf.readBoolean() ) + { +@@ -35,6 +44,15 @@ public class EncryptionResponse extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ v17writeArray( sharedSecret, buf, false ); ++ v17writeArray( verifyToken, buf, false ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeArray( sharedSecret, buf ); + if ( verifyToken != null ) + { +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +index d11a9ea9d..0ed78a8c4 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -21,20 +22,41 @@ public class EntityEffect extends DefinedPacket { + private boolean hideParticles; + + @Override +- public void read(ByteBuf buf) { +- this.entityId = readVarInt(buf); ++ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support + this.effectId = buf.readUnsignedByte(); + this.amplifier = buf.readUnsignedByte(); +- this.duration = readVarInt(buf); +- this.hideParticles = buf.readBoolean(); ++ this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ++ { ++ this.hideParticles = buf.readBoolean(); ++ } ++ // FlameCord end - 1.7.x support + } + + @Override +- public void write(ByteBuf buf) { +- writeVarInt(this.entityId, buf); ++ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.entityId, buf); ++ } else ++ { ++ buf.writeInt(effectId); ++ } ++ // FlameCord end - 1.7.x support + buf.writeByte(this.effectId); + buf.writeByte(this.amplifier); +- writeVarInt(this.duration, buf); ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.duration, buf); ++ } else ++ { ++ buf.writeShort(duration); ++ } ++ // FlameCord end - 1.7.x support + buf.writeBoolean(this.hideParticles); + } + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +index 7ed2dc3ab..435b85789 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -18,14 +19,22 @@ public class EntityRemoveEffect extends DefinedPacket { + private int effectId; + + @Override +- public void read(ByteBuf buf) { +- this.entityId = readVarInt(buf); ++ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support + this.effectId = buf.readUnsignedByte(); + } + + @Override +- public void write(ByteBuf buf) { +- writeVarInt(this.entityId, buf); ++ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ // FlameCord start - 1.7.x support ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) ++ { ++ writeVarInt(this.entityId, buf); ++ } else ++ { ++ buf.writeInt(entityId); ++ } ++ // FlameCord end - 1.7.x support + buf.writeByte(effectId); + } + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +index b004bc416..a8c3e7736 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +@@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ randomId = buf.readInt(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + randomId = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) ? buf.readLong() : readVarInt( buf ); + } + + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ buf.writeInt((int) randomId); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_12_2 ) + { + buf.writeLong( randomId ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +index 07fb3d79a..7d03cd10a 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +@@ -25,6 +25,11 @@ public class LoginSuccess extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { ++ uuid = readUndashedUUID( buf ); ++ } else ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) + { + uuid = readUUID( buf ); +@@ -42,6 +47,11 @@ public class LoginSuccess extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_7_2 ) { ++ writeUndashedUUID( uuid.toString(), buf ); ++ } else ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_16 ) + { + writeUUID( uuid, buf ); +@@ -61,4 +71,14 @@ public class LoginSuccess extends DefinedPacket + { + handler.handle( this ); + } ++ ++ // FlameCord start - 1.7.x support ++ private static UUID readUndashedUUID(ByteBuf buf) { ++ return UUID.fromString( new StringBuilder( readString( buf ) ).insert( 20, '-' ).insert( 16, '-' ).insert( 12, '-' ).insert( 8, '-' ).toString() ); ++ } ++ ++ private static void writeUndashedUUID(String uuid, ByteBuf buf) { ++ writeString( new StringBuilder( 32 ).append( uuid, 0, 8 ).append( uuid, 9, 13 ).append( uuid, 14, 18 ).append( uuid, 19, 23 ).append( uuid, 24, 36 ).toString(), buf ); ++ } ++ // FlameCord end - 1.7.x support + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +index 9b9c412da..4c50d2378 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +@@ -23,6 +23,18 @@ public class PlayerListItem extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ items = new Item[ 1 ]; ++ Item item = items[ 0 ] = new Item(); ++ item.displayName = item.username = readString( buf ); ++ action = !buf.readBoolean() ? Action.REMOVE_PLAYER : Action.ADD_PLAYER; ++ item.ping = (int) buf.readShort(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + action = Action.values()[DefinedPacket.readVarInt( buf )]; + items = new Item[ DefinedPacket.readVarInt( buf ) ]; + for ( int i = 0; i < items.length; i++ ) +@@ -63,6 +75,17 @@ public class PlayerListItem extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ Item item = items[0]; // Only one at a time ++ writeString( item.displayName, buf ); // TODO: Server unique only! ++ buf.writeBoolean( action != Action.REMOVE_PLAYER ); ++ buf.writeShort( item.ping ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + DefinedPacket.writeVarInt( action.ordinal(), buf ); + DefinedPacket.writeVarInt( items.length, buf ); + for ( Item item : items ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +index 91f71c095..57a82d29e 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +@@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ tag = readString( buf ); ++ data = v17readArray( buf ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); + int maxSize = ( direction == ProtocolConstants.Direction.TO_SERVER ) ? Short.MAX_VALUE : 0x100000; + Preconditions.checkArgument( buf.readableBytes() <= maxSize, "Payload too large" ); +@@ -83,6 +92,15 @@ public class PluginMessage extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( tag, buf ); ++ v17writeArray( data, buf, allowExtendedPacket ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( tag ) : tag, buf ); + buf.writeBytes( data ); + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +index 3c7905d54..75b371e9c 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +@@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ name = readString( buf ); ++ value = readString( buf ); ++ action = buf.readByte(); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + name = readString( buf ); + action = buf.readByte(); + if ( action == 0 || action == 2 ) +@@ -46,6 +56,16 @@ public class ScoreboardObjective extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( name, buf ); ++ writeString( value, buf ); ++ buf.writeByte( action ); ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( name, buf ); + buf.writeByte( action ); + if ( action == 0 || action == 2 ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +index 0b27fc86b..a812441d9 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +@@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket + @Override + public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ itemName = readString( buf ); ++ action = buf.readByte(); ++ if ( action != 1 ) ++ { ++ scoreName = readString( buf ); ++ value = buf.readInt(); ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + itemName = readString( buf ); + action = buf.readByte(); + scoreName = readString( buf ); +@@ -39,6 +53,20 @@ public class ScoreboardScore extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( itemName, buf ); ++ buf.writeByte( action ); ++ if ( action != 1 ) ++ { ++ writeString( scoreName, buf ); ++ buf.writeInt( value ); ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( itemName, buf ); + buf.writeByte( action ); + writeString( scoreName, buf ); +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +index 80e4f85af..cab28b999 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +@@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket + } + cursor = readString( buf, ( protocolVersion > ProtocolConstants.MINECRAFT_1_13 ? 32500 : ( protocolVersion == ProtocolConstants.MINECRAFT_1_13 ? 256 : 32767 ) ) ); + ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) + { + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) +@@ -66,6 +67,7 @@ public class TabCompleteRequest extends DefinedPacket + } + writeString( cursor, buf ); + ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support + if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 ) + { + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +index a5555f6af..1eb458b61 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +@@ -55,12 +55,22 @@ public class Team extends DefinedPacket + suffix = readString( buf ); + } + friendlyFire = buf.readByte(); +- nameTagVisibility = readString( buf ); ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ++ { ++ nameTagVisibility = readString( buf ); ++ } ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) + { + collisionRule = readString( buf ); + } +- color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); ++ // FlameCord start - 1.7.x support ++ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ++ { ++ color = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? readVarInt( buf ) : buf.readByte(); ++ } ++ // FlameCord end - 1.7.x support + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) + { + prefix = readString( buf ); +@@ -69,7 +79,7 @@ public class Team extends DefinedPacket + } + if ( mode == 0 || mode == 3 || mode == 4 ) + { +- int len = readVarInt( buf ); ++ int len = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt( buf ) : buf.readShort(); // FlameCord - 1.7.x support + players = new String[ len ]; + for ( int i = 0; i < len; i++ ) + { +@@ -81,6 +91,30 @@ public class Team extends DefinedPacket + @Override + public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) + { ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isBeforeOrEq( protocolVersion, ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ writeString( name, buf ); ++ buf.writeByte( mode ); ++ if ( mode == 0 || mode == 2 ) ++ { ++ writeString( displayName, buf ); ++ writeString( prefix, buf ); ++ writeString( suffix, buf ); ++ buf.writeByte( friendlyFire ); ++ } ++ if ( mode == 0 || mode == 3 || mode == 4 ) ++ { ++ buf.writeShort( players.length ); ++ for ( String player : players ) ++ { ++ writeString( player, buf ); ++ } ++ } ++ return; ++ } ++ // FlameCord end - 1.7.x support ++ + writeString( name, buf ); + buf.writeByte( mode ); + if ( mode == 0 || mode == 2 ) +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index ca1dad0e5..e11e30402 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer + .registerTypeAdapter( SelectorComponent.class, new SelectorComponentSerializer() ) + .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer() ) + .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); ++ // FlameCord start - 1.7.x support ++ public final Gson gsonLegacy = new GsonBuilder() ++ .registerTypeAdapter( BaseComponent.class, new ComponentSerializer() ) ++ .registerTypeAdapter( TextComponent.class, new TextComponentSerializer() ) ++ .registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ) ++ .registerTypeAdapter( ServerPing.PlayerInfo.class, new PlayerInfoSerializer( ProtocolConstants.MINECRAFT_1_7_2 ) ) ++ .registerTypeAdapter( Favicon.class, Favicon.getFaviconTypeAdapter() ).create(); ++ // FlameCord end - 1.7.x support + @Getter + private ConnectionThrottle connectionThrottle; + private final ModuleManager moduleManager = new ModuleManager(); +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +index 1d377a655..0ea5f90b4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +@@ -183,6 +183,7 @@ public class BungeeTitle implements Title + @Override + public Title send(ProxiedPlayer player) + { ++ if ( ProtocolConstants.isBeforeOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return this; // FlameCord - 1.7.x support + sendPacket( player, clear ); + sendPacket( player, reset ); + sendPacket( player, times ); +diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +index 491cf1a16..6cd8ec3b4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java ++++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +@@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; + import java.lang.reflect.Type; + import java.util.UUID; + import net.md_5.bungee.api.ServerPing; ++import net.md_5.bungee.protocol.ProtocolConstants; + + public class PlayerInfoSerializer implements JsonSerializer, JsonDeserializer + { ++ // FlameCord start - 1.7.x support ++ private final int protocol; ++ ++ public PlayerInfoSerializer() ++ { ++ this.protocol = ProtocolConstants.MINECRAFT_1_7_6; ++ } ++ ++ public PlayerInfoSerializer(int protocol) ++ { ++ this.protocol = protocol; ++ } ++ // FlameCord end - 1.7.x support + + @Override + public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException +@@ -20,7 +34,7 @@ public class PlayerInfoSerializer implements JsonSerializer= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); +- brand.release(); ++ // FlameCord start - 1.7.x support ++ String brandString = bungee.getName() + " (" + bungee.getVersion() + ")"; ++ ++ if ( ProtocolConstants.isBeforeOrEq( user.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ user.unsafe().sendPacket( new PluginMessage( "MC|Brand", brandString.getBytes( StandardCharsets.UTF_8 ), handshakeHandler.isServerForge() ) ); ++ } else ++ { ++ ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); ++ user.unsafe().sendPacket( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand", brand, handshakeHandler.isServerForge() ) ); ++ brand.release(); ++ } ++ // FlameCord end - 1.7.x support + } + + user.setDimension( login.getDimension() ); +@@ -296,7 +306,7 @@ public class ServerConnector extends PacketHandler + if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall + for ( Objective objective : serverScoreboard.getObjectives() ) + { +- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); ++ user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support + } + for ( Score score : serverScoreboard.getScores() ) + { +@@ -466,7 +476,13 @@ public class ServerConnector extends PacketHandler + if ( pluginMessage.getTag().equals( ForgeConstants.FML_HANDSHAKE_TAG ) || pluginMessage.getTag().equals( ForgeConstants.FORGE_REGISTER ) ) + { + this.handshakeHandler.handle( pluginMessage ); +- ++ // FlameCord start - 1.7.x support ++ if ( user.getForgeClientHandler().checkUserOutdated() ) ++ { ++ ch.close(); ++ user.getPendingConnects().remove(target); ++ } ++ // FlameCord end - 1.7.x support + // We send the message as part of the handler, so don't send it here. + throw CancelSendSignal.INSTANCE; + } +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 b44d13e59..2d72e26ea 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer + public void setDisplayName(String name) + { + Preconditions.checkNotNull( name, "displayName" ); ++ // Its "spigot" responsability to choose wether to support 1.7 or not. ++ //Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); // FlameCord - 1.7.x support + displayName = name; + } + +@@ -524,7 +526,7 @@ public final class UserConnection implements ProxiedPlayer + // transform score components + message = ChatComponentTransformer.getInstance().transform( this, true, message ); + +- if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 ) ++ if ( position == ChatMessageType.ACTION_BAR && getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_17 && getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_8 ) // FlameCord - 1.7.x support + { + // Versions older than 1.11 cannot send the Action bar with the new JSON formattings + // Fix by converting to a legacy message, see https://bugs.mojang.com/browse/MC-119145 +@@ -720,6 +722,7 @@ public final class UserConnection implements ProxiedPlayer + @Override + public void setTabHeader(BaseComponent header, BaseComponent footer) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + header = ChatComponentTransformer.getInstance().transform( this, true, header )[0]; + footer = ChatComponentTransformer.getInstance().transform( this, true, footer )[0]; + +@@ -732,6 +735,7 @@ public final class UserConnection implements ProxiedPlayer + @Override + public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + header = ChatComponentTransformer.getInstance().transform( this, true, header ); + footer = ChatComponentTransformer.getInstance().transform( this, true, footer ); + +@@ -761,6 +765,7 @@ public final class UserConnection implements ProxiedPlayer + + public void setCompressionThreshold(int compressionThreshold) + { ++ if ( ProtocolConstants.isBeforeOrEq( pendingConnection.getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) return; // FlameCord + if ( !ch.isClosing() && this.compressionThreshold == -1 && compressionThreshold >= 0 ) + { + this.compressionThreshold = compressionThreshold; +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 +index 89b98b360..0ac22ad38 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; + import io.netty.channel.unix.DomainSocketAddress; + import java.io.DataInput; + import java.net.InetSocketAddress; ++import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.HashMap; // Waterfall + import java.util.List; +@@ -201,7 +202,7 @@ public class DownstreamBridge extends PacketHandler + switch ( objective.getAction() ) + { + case 0: +- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType().toString() ) ); ++ serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // FlameCord - 1.7.x support + break; + case 1: + serverScoreboard.removeObjective( objective.getName() ); +@@ -211,7 +212,7 @@ public class DownstreamBridge extends PacketHandler + if ( oldObjective != null ) + { + oldObjective.setValue( objective.getValue() ); +- oldObjective.setType( objective.getType().toString() ); ++ oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // FlameCord - 1.7.x support + } + break; + default: +@@ -309,16 +310,28 @@ public class DownstreamBridge extends PacketHandler + + if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) ) + { +- ByteBuf brand = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- String serverBrand = DefinedPacket.readString( brand ); +- brand.release(); +- +- Preconditions.checkState( !serverBrand.contains( bungee.getName() ), "Cannot connect proxy to itself!" ); +- +- brand = ByteBufAllocator.DEFAULT.heapBuffer(); +- DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // Waterfall +- pluginMessage.setData( brand ); +- brand.release(); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ try ++ { ++ ByteBuf brand = Unpooled.wrappedBuffer(pluginMessage.getData()); ++ String serverBrand = DefinedPacket.readString(brand); ++ brand.release(); ++ brand = ByteBufAllocator.DEFAULT.heapBuffer(); ++ DefinedPacket.writeString(bungee.getName() + " <- " + serverBrand, brand ); // Waterfall ++ pluginMessage.setData(brand); ++ brand.release(); ++ } catch (Exception ProtocolHacksSuck) ++ { ++ return; ++ } ++ } else ++ { ++ String serverBrand = new String( pluginMessage.getData(), StandardCharsets.UTF_8); ++ pluginMessage.setData( ( bungee.getName() + " <- " + serverBrand ).getBytes(StandardCharsets.UTF_8) ); // FlameCord - 1.7.x support ++ } ++ // FlameCord end - 1.7.x support + // changes in the packet are ignored so we need to send it manually + con.unsafe().sendPacket( pluginMessage ); + throw CancelSendSignal.INSTANCE; +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 a19bbdd0f..de417ecae 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 +@@ -3,6 +3,9 @@ package net.md_5.bungee.connection; + import com.google.common.base.Charsets; + import com.google.common.base.Preconditions; + import com.google.gson.Gson; ++import com.google.gson.JsonElement; ++import com.google.gson.JsonObject; ++ + import java.math.BigInteger; + import java.net.InetSocketAddress; + import java.net.SocketAddress; +@@ -280,8 +283,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void done(ProxyPingEvent pingResult, Throwable error) + { +- Gson gson = BungeeCord.getInstance().gson; +- unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); ++ // FlameCord start - 1.7.x support ++ Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; ++ if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ // Minecraft < 1.9 doesn't send string server descriptions as chat components. Older 1.7+ // clients even crash when encountering a chat component instead of a string. To be on the ++ // safe side, always send legacy descriptions for < 1.9 clients. ++ JsonElement element = gson.toJsonTree(pingResult.getResponse()); ++ Preconditions.checkArgument(element.isJsonObject(), "Response is not a JSON object"); ++ JsonObject object = element.getAsJsonObject(); ++ object.addProperty("description", pingResult.getResponse().getDescription()); ++ ++ unsafe.sendPacket(new StatusResponse(gson.toJson(element))); ++ } else ++ { ++ unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); ++ } ++ // FlameCord end - 1.7.x support + if ( bungee.getConnectionThrottle() != null ) + { + bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +index 6df3f3dd9..a409d440b 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +@@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; + import net.md_5.bungee.protocol.MinecraftEncoder; + import net.md_5.bungee.protocol.PacketWrapper; + import net.md_5.bungee.protocol.Protocol; ++import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.Handshake; + import net.md_5.bungee.protocol.packet.StatusRequest; + import net.md_5.bungee.protocol.packet.StatusResponse; +@@ -65,7 +66,7 @@ public class PingHandler extends PacketHandler + @SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") + public void handle(StatusResponse statusResponse) throws Exception + { +- Gson gson = BungeeCord.getInstance().gson; ++ Gson gson = protocol == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; // FlameCord - 1.7.x support + ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class ); + ( (BungeeServerInfo) target ).cachePing( serverPing ); + callback.done( serverPing, null ); +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 d72208e75..66332af4e 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 +@@ -101,7 +101,12 @@ public class UpstreamBridge extends PacketHandler + player.unsafe().sendPacket( newPacket ); + } else + { +- player.unsafe().sendPacket( oldPacket ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( oldPacket ); ++ } ++ // FlameCord end - 1.7.x support + } + } + con.getServer().disconnect( "Quitting" ); +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index ad951df05..68916db79 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -34,6 +34,12 @@ public abstract class EntityMap + // Waterfall end + switch ( version ) + { ++ // FlameCord start - 1.7.x support ++ case ProtocolConstants.MINECRAFT_1_7_2: ++ return EntityMap_1_7_2.INSTANCE; ++ case ProtocolConstants.MINECRAFT_1_7_6: ++ return EntityMap_1_7_6.INSTANCE; ++ // FlameCord end - 1.7.x support + case ProtocolConstants.MINECRAFT_1_8: + return EntityMap_1_8.INSTANCE; + case ProtocolConstants.MINECRAFT_1_9: +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +new file mode 100644 +index 000000000..cdc07dc45 +--- /dev/null ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +@@ -0,0 +1,102 @@ ++// FlameCord start - 1.7.x support ++package net.md_5.bungee.entitymap; ++ ++import io.netty.buffer.ByteBuf; ++import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; ++ ++class EntityMap_1_7_2 extends EntityMap ++{ ++ ++ static final EntityMap INSTANCE = new EntityMap_1_7_2(); ++ ++ EntityMap_1_7_2() ++ { ++ addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment ++ addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed ++ addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation ++ addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player ++ addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item ++ addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object ++ addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob ++ addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting ++ addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb ++ addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity ++ addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity ++ addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move ++ addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look ++ addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move ++ addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport ++ addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look ++ addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status ++ addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity ++ addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata ++ addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect ++ addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect ++ addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties ++ addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation ++ addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity ++ ++ addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity ++ addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation ++ addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action ++ } ++ ++ @Override ++ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) ++ { ++ super.rewriteClientbound( packet, oldId, newId ); ++ ++ //Special cases ++ int readerIndex = packet.readerIndex(); ++ int packetId = DefinedPacket.readVarInt( packet ); ++ int packetIdLength = packet.readerIndex() - readerIndex; ++ if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) ++ { ++ rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); ++ } else if ( packetId == 0x13 /* Destroy Entities */ ) ++ { ++ int count = packet.getByte( packetIdLength ); ++ for ( int i = 0; i < count; i++ ) ++ { ++ rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); ++ } ++ } else if ( packetId == 0x0E /* Spawn Object */ ) ++ { ++ DefinedPacket.readVarInt( packet ); ++ int type = packet.readUnsignedByte(); ++ ++ if ( type == 60 || type == 90 ) ++ { ++ packet.skipBytes( 14 ); ++ int position = packet.readerIndex(); ++ int readId = packet.readInt(); ++ int changedId = -1; ++ if ( readId == oldId ) ++ { ++ packet.setInt( position, newId ); ++ changedId = newId; ++ } else if ( readId == newId ) ++ { ++ packet.setInt( position, oldId ); ++ changedId = oldId; ++ } ++ if ( changedId != -1 ) ++ { ++ if ( changedId == 0 && readId != 0 ) ++ { // Trim off the extra data ++ packet.readerIndex( readerIndex ); ++ packet.writerIndex( packet.readableBytes() - 6 ); ++ } else if ( changedId != 0 && readId == 0 ) ++ { // Add on the extra data ++ packet.readerIndex( readerIndex ); ++ packet.capacity( packet.readableBytes() + 6 ); ++ packet.writerIndex( packet.readableBytes() + 6 ); ++ } ++ } ++ } ++ } ++ packet.readerIndex( readerIndex ); ++ } ++} ++// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +new file mode 100644 +index 000000000..cb9174b35 +--- /dev/null ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +@@ -0,0 +1,62 @@ ++// FlameCord start - 1.7.x support ++package net.md_5.bungee.entitymap; ++ ++import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; ++import io.netty.buffer.ByteBuf; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.UserConnection; ++import net.md_5.bungee.connection.LoginResult; ++import net.md_5.bungee.protocol.DefinedPacket; ++ ++class EntityMap_1_7_6 extends EntityMap_1_7_2 ++{ ++ ++ static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); ++ ++ @Override ++ @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") ++ public void rewriteClientbound(ByteBuf packet, int oldId, int newId) ++ { ++ super.rewriteClientbound( packet, oldId, newId ); ++ ++ int readerIndex = packet.readerIndex(); ++ int packetId = DefinedPacket.readVarInt( packet ); ++ int packetIdLength = packet.readerIndex() - readerIndex; ++ if ( packetId == 0x0C /* Spawn Player */ ) ++ { ++ DefinedPacket.readVarInt( packet ); ++ int idLength = packet.readerIndex() - readerIndex - packetIdLength; ++ String uuid = DefinedPacket.readString( packet ); ++ String username = DefinedPacket.readString( packet ); ++ int props = DefinedPacket.readVarInt( packet ); ++ if ( props == 0 ) ++ { ++ UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); ++ if ( player != null ) ++ { ++ LoginResult profile = player.getPendingConnection().getLoginProfile(); ++ if ( profile != null && profile.getProperties() != null ++ && profile.getProperties().length >= 1 ) ++ { ++ ByteBuf rest = packet.copy(); ++ packet.readerIndex( readerIndex ); ++ packet.writerIndex( readerIndex + packetIdLength + idLength ); ++ DefinedPacket.writeString( player.getUniqueId().toString(), packet ); ++ DefinedPacket.writeString( username, packet ); ++ DefinedPacket.writeVarInt( profile.getProperties().length, packet ); ++ for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) ++ { ++ DefinedPacket.writeString( property.getName(), packet ); ++ DefinedPacket.writeString( property.getValue(), packet ); ++ DefinedPacket.writeString( property.getSignature(), packet ); ++ } ++ packet.writeBytes( rest ); ++ rest.release(); ++ } ++ } ++ } ++ } ++ packet.readerIndex( readerIndex ); ++ } ++} ++// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +index bea2bbff9..caed43849 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +@@ -8,6 +8,7 @@ import lombok.Getter; + import lombok.NonNull; + import lombok.RequiredArgsConstructor; + import lombok.Setter; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.UserConnection; + import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.EntityRemoveEffect; +@@ -23,6 +24,12 @@ public class ForgeClientHandler + @NonNull + private final UserConnection con; + ++ // FlameCord start - 1.7.x support ++ @Getter ++ @Setter(AccessLevel.PACKAGE) ++ private boolean forgeOutdated = false; ++ // FlameCord end - 1.7.x support ++ + /** + * The users' mod list. + */ +@@ -175,4 +182,21 @@ public class ForgeClientHandler + { + return fmlTokenInHandshake || clientModList != null; + } ++ ++ // FlameCord start - 1.7.x support ++ /** ++ * Checks to see if a user is using an outdated FML build, and takes ++ * appropriate action on the User side. This should only be called during a ++ * server connection, by the ServerConnector ++ * ++ * @return true if the user's FML build is outdated, otherwise ++ * false ++ */ ++ public boolean checkUserOutdated() { ++ if (forgeOutdated) { ++ con.disconnect( BungeeCord.getInstance().getTranslation("connect_kick_outdated_forge") ); ++ } ++ return forgeOutdated; ++ } ++ // FlameCord end - 1.7.x support + } +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +index 5e02f8c8a..85bc21b9f 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +@@ -3,6 +3,7 @@ package net.md_5.bungee.forge; + import java.util.Map; + import net.md_5.bungee.ServerConnector; + import net.md_5.bungee.UserConnection; ++import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.PluginMessage; + + /** +@@ -84,6 +85,22 @@ enum ForgeClientHandshakeState implements IForgeClientPacketHandler clientModList = ForgeUtils.readModList( message ); + con.getForgeClientHandler().setClientModList( clientModList ); ++ // FlameCord start - 1.7.x support ++ // If the user is below 1.8, we need to check the version of FML - it's not always an OK version. ++ if ( ProtocolConstants.isBeforeOrEq( con.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_7_6 ) ) ++ { ++ // Get the version from the mod list. ++ int buildNumber = ForgeUtils.getFmlBuildNumber( clientModList ); ++ ++ // If we get 0, we're probably using a testing build, so let it though. Otherwise, check the build number. ++ if ( buildNumber < ForgeConstants.FML_MIN_BUILD_VERSION && buildNumber != 0 ) ++ { ++ // Mark the user as an old Forge user. This will then cause any Forge ServerConnectors to cancel any ++ // connections to it. ++ con.getForgeClientHandler().setForgeOutdated( true ); ++ } ++ } ++ // FlameCord end - 1.7.x support + } + + return WAITINGSERVERDATA; +diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +index f70d357a3..df6a4b12c 100644 +--- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java ++++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +@@ -13,6 +13,7 @@ public class ServerUnique extends TabList + { + + private final Collection uuids = new HashSet<>(); ++ private final Collection usernames = new HashSet<>(); // FlameCord - 1.7.x support + + public ServerUnique(ProxiedPlayer player) + { +@@ -26,10 +27,26 @@ public class ServerUnique extends TabList + { + if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) + { +- uuids.add( item.getUuid() ); ++ // FlameCord start - 1.7.x support ++ if ( item.getUuid() != null ) ++ { ++ uuids.add( item.getUuid() ); ++ } else ++ { ++ usernames.add( item.getUsername() ); ++ } ++ // FlameCord end - 1.7.x support + } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) + { +- uuids.remove( item.getUuid() ); ++ // FlameCord start - 1.7.x support ++ if ( item.getUuid() != null ) ++ { ++ uuids.remove( item.getUuid() ); ++ } else ++ { ++ usernames.remove( item.getUsername() ); ++ } ++ // FlameCord end - 1.7.x support + } + } + player.unsafe().sendPacket( playerListItem ); +@@ -79,17 +96,48 @@ public class ServerUnique extends TabList + { + PlayerListItem packet = new PlayerListItem(); + packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); +- PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() ]; ++ PlayerListItem.Item[] items = new PlayerListItem.Item[ uuids.size() + usernames.size() ]; // FlameCord - 1.7.x support + int i = 0; ++ ++ // FlameCord start - 1.7.x support ++ for ( String username : usernames ) ++ { ++ PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); ++ item.setUsername( username ); ++ item.setDisplayName( username ); ++ item.setPing( 0 ); ++ } ++ // FlameCord end - 1.7.x support ++ + for ( UUID uuid : uuids ) + { + PlayerListItem.Item item = items[i++] = new PlayerListItem.Item(); + item.setUuid( uuid ); + } + packet.setItems( items ); +- player.unsafe().sendPacket( packet ); ++ // FlameCord start - 1.7.x support ++ if ( ProtocolConstants.isAfterOrEq( player.getPendingConnection().getVersion(), ProtocolConstants.MINECRAFT_1_8 ) ) ++ { ++ player.unsafe().sendPacket( packet ); ++ } else ++ { ++ // Split up the packet ++ for ( PlayerListItem.Item item : packet.getItems() ) ++ { ++ PlayerListItem p2 = new PlayerListItem(); ++ p2.setAction( packet.getAction() ); ++ ++ p2.setItems( new PlayerListItem.Item[] ++ { ++ item ++ } ); ++ player.unsafe().sendPacket( p2 ); ++ } ++ } ++ // FlameCord end - 1.7.x support + } + uuids.clear(); ++ usernames.clear(); // FlameCord - 1.7.x support + } + + @Override +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch new file mode 100644 index 00000000..8e8d9017 --- /dev/null +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -0,0 +1,56 @@ +From 2a6878cb7a8c16bb76b79012db51d81f112636c9 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:57:23 +0800 +Subject: [PATCH] Make PlayerHandshakeEvent cancellable + + +diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +index 2f7b38d9e..e29b0ed35 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +@@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; + + import lombok.Data; + import lombok.EqualsAndHashCode; ++import lombok.Getter; ++import lombok.Setter; + import lombok.ToString; + import net.md_5.bungee.api.connection.PendingConnection; ++import net.md_5.bungee.api.plugin.Cancellable; + import net.md_5.bungee.api.plugin.Event; + import net.md_5.bungee.protocol.packet.Handshake; + +@@ -14,8 +17,11 @@ import net.md_5.bungee.protocol.packet.Handshake; + @Data + @ToString(callSuper = false) + @EqualsAndHashCode(callSuper = false) +-public class PlayerHandshakeEvent extends Event +-{ ++// FlameCord - Implement cancellable ++public class PlayerHandshakeEvent extends Event implements Cancellable { ++ @Getter ++ @Setter ++ private boolean cancelled = false; + + /** + * Connection attempting to login. +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 de417ecae..c3543a18d 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 +@@ -362,7 +362,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); + +- bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) ); ++ // FlameCord - Make PlayerHandshakeEvent cancellable ++ if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ++ ch.close(); ++ return; ++ } + + switch ( handshake.getRequestedProtocol() ) + { +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch new file mode 100644 index 00000000..f3bb0749 --- /dev/null +++ b/Waterfall-Proxy-Patches/0006-Make-a-getter-for-the-callback.patch @@ -0,0 +1,23 @@ +From c44b23dcab5a544424e6835060638e1bbf053ae2 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 17:58:18 +0800 +Subject: [PATCH] Make a getter for the callback + + +diff --git a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +index cf85ca06..8a945a99 100644 +--- a/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java ++++ b/api/src/main/java/net/md_5/bungee/api/event/AsyncEvent.java +@@ -25,7 +25,8 @@ import net.md_5.bungee.api.plugin.Plugin; + @EqualsAndHashCode(callSuper = true) + public class AsyncEvent extends Event + { +- ++ // FlameCord - Make a getter for the callback ++ @Getter + private final Callback done; + private final Map intents = new ConcurrentHashMap<>(); + private final AtomicBoolean fired = new AtomicBoolean(); +-- +2.32.0 + diff --git a/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch new file mode 100644 index 00000000..79c93927 --- /dev/null +++ b/Waterfall-Proxy-Patches/0007-Disable-update-checker-Use-bungee-name.patch @@ -0,0 +1,73 @@ +From 2edaf016d49ec4c769eebaf7383f3a7e6dccc19c Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:00:49 +0800 +Subject: [PATCH] Disable update checker & Use bungee name + + +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +index 463bc3d53..00243fdb9 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +@@ -45,25 +45,10 @@ public class BungeeCordLauncher + return; + } + +- if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) +- { +- Date buildDate = new SimpleDateFormat( "yyyyMMdd" ).parse( BungeeCord.class.getPackage().getSpecificationVersion() ); +- +- Calendar deadline = Calendar.getInstance(); +- deadline.add( Calendar.WEEK_OF_YEAR, -8 ); +- if ( buildDate.before( deadline.getTime() ) ) +- { +- System.err.println( "*** Hey! This build is potentially outdated :( ***" ); +- System.err.println( "*** Please check for a new build from https://papermc.io/downloads ***" ); +- System.err.println( "*** Should this build be outdated, you will get NO support for it. ***" ); +- //System.err.println( "*** Server will start in 10 seconds ***" ); +- //Thread.sleep( TimeUnit.SECONDS.toMillis( 10 ) ); +- } +- } +- + BungeeCord bungee = new BungeeCord(); + ProxyServer.setInstance( bungee ); +- bungee.getLogger().info( "Enabled FlameCord version " + bungee.getVersion() ); ++ // FlameCord - Use BungeeCord name ++ bungee.getLogger().info( "Enabled " + bungee.getName() + " version " + bungee.getVersion() ); + bungee.start(); + + if ( !options.has( "noconsole" ) ) +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +index 9abae0b61..e8232c0bd 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +@@ -22,6 +22,7 @@ import java.util.Locale; + import java.util.Map; + import java.util.logging.Level; + import lombok.RequiredArgsConstructor; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.Util; + import net.md_5.bungee.api.ChatColor; + import net.md_5.bungee.api.ProxyServer; +@@ -227,7 +228,8 @@ public class YamlConfig implements ConfigurationAdapter + Map val = entry.getValue(); + String name = entry.getKey(); + String addr = get( "address", "localhost:25565", val ); +- String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another FlameCord - Forced Host", val ) ); ++ // FlameCord - Use Bungee name instead ++ String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another " + BungeeCord.getInstance().getName() + " - Forced Host", val ) ); + boolean restricted = get( "restricted", false, val ); + SocketAddress address = Util.getAddr( addr ); + ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted ); +@@ -253,7 +255,8 @@ public class YamlConfig implements ConfigurationAdapter + + for ( Map val : base ) + { +- String motd = get( "motd", "&1Another Bungee server", val ); ++ // FlameCord - Use Bungee name instead ++ String motd = get( "motd", "&1Another " + BungeeCord.getInstance().getName() + " server", val ); + motd = ChatColor.translateAlternateColorCodes( '&', motd ); + + int maxPlayers = get( "max_players", 1, val ); +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch new file mode 100644 index 00000000..bc20733d --- /dev/null +++ b/Waterfall-Proxy-Patches/0008-Change-replaceAll-to-replace.patch @@ -0,0 +1,23 @@ +From dca52858df4acbd78c9128f6e40e447b86824150 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:01:37 +0800 +Subject: [PATCH] Change replaceAll() to replace() + + +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index d672c8ef..9067b806 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -129,7 +129,8 @@ public class ServerConnector extends PacketHandler + newp[newp.length - 2] = new net.md_5.bungee.protocol.Property( ForgeConstants.FML_LOGIN_PROFILE, "true", null ); + + // If we do not perform the replacement, then the IP Forwarding code in Spigot et. al. will try to split on this prematurely. +- newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replaceAll( "\0", "\1"), "" ); ++ // FlameCord - Change replaceAll() to replace() ++ newp[newp.length - 1] = new net.md_5.bungee.protocol.Property( ForgeConstants.EXTRA_DATA, user.getExtraDataInHandshake().replace( "\0", "\1"), "" ); + + // All done. + properties = newp; +-- +2.36.1.windows.1 + diff --git a/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch b/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch new file mode 100644 index 00000000..251aaab9 --- /dev/null +++ b/Waterfall-Proxy-Patches/0009-Use-duplicate-for-MinecraftDecoder.patch @@ -0,0 +1,32 @@ +From 510085f25ef21678828f5b3026662f51a94c1137 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 21 Dec 2022 21:43:05 -0300 +Subject: [PATCH] Use duplicate() for MinecraftDecoder + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index ac83e3253..c31ec1ce7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -38,7 +38,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; +- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :( ++ ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy + + Object packetTypeInfo = null; + try +@@ -73,7 +73,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder + in.skipBytes( in.readableBytes() ); + } + +- out.add( new PacketWrapper( packet, slice ) ); ++ // FlameCord - Duplicate buf instead of Copy ++ out.add( new PacketWrapper( packet, slice.retain() ) ); + slice = null; + } catch (BadPacketException | IndexOutOfBoundsException e) { + // Waterfall start: Additional DoS mitigations +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch new file mode 100644 index 00000000..1922c3a8 --- /dev/null +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -0,0 +1,131 @@ +From 9c6dd2dc6ee18d5429d098b5a5d1963cfd404856 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:06:17 +0800 +Subject: [PATCH] Close connections & Don't flush if not necessary + + +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 c3543a18..8ed26e5c 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 +@@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + ServerPing legacy = result.getResponse(); ++ ++ // FlameCord - Close and return if legacy == null ++ if (legacy == null) { ++ ch.close(); ++ return; ++ } ++ + String kickMessage; + + if ( v1_5 ) +@@ -283,6 +290,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void done(ProxyPingEvent pingResult, Throwable error) + { ++ // FlameCord - Close if response is null ++ if (pingResult.getResponse() == null) { ++ ch.close(); ++ return; ++ } ++ ++ // FlameCord - Return if connection is closed ++ if (ch.isClosed()) { ++ return; ++ } ++ + // FlameCord start - 1.7.x support + Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; + if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) +@@ -327,11 +345,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection + @Override + public void handle(PingPacket ping) throws Exception + { +- if (!ACCEPT_INVALID_PACKETS) { +- Preconditions.checkState(thisState == State.PING, "Not expecting PING"); +- } ++ // FlameCord - Never accept invalid packets ++ Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); ++ + unsafe.sendPacket( ping ); +- disconnect( "" ); ++ ++ // FlameCord - Close instead of disconnect ++ ch.close(); + } + + @Override +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 6dc5633f..8b0fac0a 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -80,10 +80,11 @@ public class ChannelWrapper + + if ( packet != null && ch.isActive() ) + { +- ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE, ChannelFutureListener.CLOSE ); ++ // FlameCord - Remove the firing of exceptions on failure ++ ch.writeAndFlush( packet ).addListeners( ChannelFutureListener.CLOSE ); + } else + { +- ch.flush(); ++ // FlameCord - Don't flush just close + ch.close(); + } + } +@@ -113,7 +114,7 @@ public class ChannelWrapper + public void addBefore(String baseName, String name, ChannelHandler handler) + { + Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" ); +- ch.pipeline().flush(); ++ // FlameCord - Don't flush if not necessary + ch.pipeline().addBefore( baseName, name, handler ); + } + +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 2a21243b..a95193ba 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 +@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; + import io.netty.channel.ChannelException; ++import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInitializer; + import io.netty.channel.ChannelOption; + import io.netty.channel.EventLoopGroup; +@@ -98,6 +99,14 @@ public class PipelineUtils + + BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); + } ++ ++ // FlameCord - Close on exception caught ++ @Override ++ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ++ cause.printStackTrace(); ++ ++ ctx.close(); ++ } + }; + public static final Base BASE = new Base(); + private static final KickStringWriter legacyKicker = new KickStringWriter(); +@@ -192,5 +201,13 @@ public class PipelineUtils + + ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); + } ++ ++ // FlameCord - Close on exception caught ++ @Override ++ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { ++ cause.printStackTrace(); ++ ++ ctx.close(); ++ } + } + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0011-Packet-Checks.patch b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch new file mode 100644 index 00000000..af75e874 --- /dev/null +++ b/Waterfall-Proxy-Patches/0011-Packet-Checks.patch @@ -0,0 +1,53 @@ +From cf87130274644325adbf7fabb7b95d95e976ee57 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:10:30 +0800 +Subject: [PATCH] Packet Checks + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index c31ec1ce7..640f0ea26 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -38,6 +38,19 @@ public class MinecraftDecoder extends MessageToMessageDecoder + } + + Protocol.DirectionData prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; ++ ++ // FlameCord - Check size before decoding ++ if (prot == protocol.TO_SERVER) { ++ final int readableBytes = in.readableBytes(); ++ final int capacity = in.capacity(); ++ ++ if (readableBytes > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too many readableBytes: " + readableBytes); ++ } else if (capacity > 2097152) { ++ throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); ++ } ++ } ++ + ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy + + Object packetTypeInfo = null; +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 29cf4b4fc..4820267b3 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -78,6 +78,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception + { ++ // FlameCord - Return if channel isn't active ++ if (!ctx.channel().isActive()) { ++ if (msg instanceof PacketWrapper) { ++ ((PacketWrapper) msg).trySingleRelease(); ++ } ++ ++ return; ++ } ++ + if ( msg instanceof HAProxyMessage ) + { + HAProxyMessage proxy = (HAProxyMessage) msg; +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch new file mode 100644 index 00000000..9be72fe2 --- /dev/null +++ b/Waterfall-Proxy-Patches/0012-Change-default-timeout.patch @@ -0,0 +1,23 @@ +From f790d57423c57a21d642db20b6de9d3515fd3e93 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:14:02 +0800 +Subject: [PATCH] Change default timeout + + +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +index 8911bee85..b67195ec8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +@@ -35,7 +35,8 @@ public abstract class Configuration implements ProxyConfig + /** + * Time before users are disconnected due to no network activity. + */ +- private int timeout = 30000; ++ // FlameCord - Modify default timeout ++ private int timeout = 17000; + /** + * UUID used for metrics. + */ +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch new file mode 100644 index 00000000..e6063a4c --- /dev/null +++ b/Waterfall-Proxy-Patches/0013-Don-t-allow-name-containing-dot.patch @@ -0,0 +1,23 @@ +From cbec17576f5c5472cf0037f9962ca5c806133200 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:25:51 +0800 +Subject: [PATCH] Don't allow name containing dot + + +diff --git a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +index 1a4242a2e..d947fad7d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java ++++ b/proxy/src/main/java/net/md_5/bungee/util/AllowedCharacters.java +@@ -21,7 +21,8 @@ public final class AllowedCharacters + } else + { + // Don't allow spaces, Yaml config doesn't support them +- return isChatAllowedCharacter( c ) && c != ' '; ++ // FlameCord - Don't allow dots ++ return isChatAllowedCharacter( c ) && c != ' ' && c != '.'; + } + } + +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch new file mode 100644 index 00000000..d056e727 --- /dev/null +++ b/Waterfall-Proxy-Patches/0014-Use-pipeline-to-reduce-redundancy.patch @@ -0,0 +1,78 @@ +From 33c937b0b20e6ad8994c21258841d5330443c2fe Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:30:07 +0800 +Subject: [PATCH] Use pipeline to reduce redundancy + + +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 8b0fac0a..b3fa4835 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -5,6 +5,8 @@ import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandler; + import io.netty.channel.ChannelHandlerContext; ++import io.netty.channel.ChannelPipeline; ++ + import java.net.SocketAddress; + import java.util.concurrent.TimeUnit; + import lombok.Getter; +@@ -37,14 +39,18 @@ public class ChannelWrapper + + public void setProtocol(Protocol protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocol( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocol( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); + } + + public void setVersion(int protocol) + { +- ch.pipeline().get( MinecraftDecoder.class ).setProtocolVersion( protocol ); +- ch.pipeline().get( MinecraftEncoder.class ).setProtocolVersion( protocol ); ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); ++ pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); + } + + public void write(Object packet) +@@ -125,25 +131,27 @@ public class ChannelWrapper + + public void setCompressionThreshold(int compressionThreshold) + { +- if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) ++ // FlameCord - Use pipeline to reduce redundancy ++ final ChannelPipeline pipeline = ch.pipeline(); ++ if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); + } + if ( compressionThreshold != -1 ) + { +- ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); ++ pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); + } else + { +- ch.pipeline().remove( "compress" ); ++ pipeline.remove( "compress" ); + } + +- if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) ++ if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + { + addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); + } + if ( compressionThreshold == -1 ) + { +- ch.pipeline().remove( "decompress" ); ++ pipeline.remove( "decompress" ); + } + } + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch new file mode 100644 index 00000000..7bc2ea29 --- /dev/null +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -0,0 +1,22 @@ +From 047ea04ae1cf8277e6c2eed87dc0d5fd901efe91 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:35:33 +0800 +Subject: [PATCH] Allow custom uuids even if onlineMode is true + + +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 8ed26e5c..4242b9c8 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 +@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void setUniqueId(UUID uuid) + { + Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); +- Preconditions.checkState( !onlineMode, "Can only set uuid when online mode is false" ); ++ // FlameCord - Allow custom uuids even if onlineMode is true + this.uniqueId = uuid; + } + +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch new file mode 100644 index 00000000..6d5cf4c5 --- /dev/null +++ b/Waterfall-Proxy-Patches/0016-Change-IllegalStateException-to-QuietException-and-e.patch @@ -0,0 +1,24 @@ +From 0f07c38f3d16849626c28ae710616788f30b00fc Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:40:55 +0800 +Subject: [PATCH] Change IllegalStateException to QuietException and explain + that is a plugin + + +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 2d72e26ea..94702434d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -313,7 +313,8 @@ public final class UserConnection implements ProxiedPlayer + + if ( getServer() == null && !ch.isClosing() ) + { +- throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); ++ // FlameCord - Change IllegalStateException to QuietException and explain that is a plugin ++ throw new QuietException("A plugin cancelled ServerConnectEvent with no server or disconnect."); + } + return; + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch new file mode 100644 index 00000000..9bc71fef --- /dev/null +++ b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch @@ -0,0 +1,25 @@ +From ac09d06618510ed85aadc83a5a6bb812bf109218 Mon Sep 17 00:00:00 2001 +From: foss-mc <69294560+foss-mc@users.noreply.github.com> +Date: Wed, 16 Dec 2020 18:43:17 +0800 +Subject: [PATCH] Don't declare uuid unless it's null + + +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 8715821fe..1c10b5a93 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 +@@ -559,7 +559,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + loginProfile = obj; + name = obj.getName(); +- uniqueId = Util.getUUID( obj.getId() ); ++ // FlameCord - Don't declare uuid unless it's null ++ if (uniqueId == null) { ++ uniqueId = Util.getUUID(obj.getId()); ++ } + finish(); + return; + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch new file mode 100644 index 00000000..396cf54d --- /dev/null +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -0,0 +1,377 @@ +From f4ab4a93d462da9ff8375c432ea7824a189ca59a Mon Sep 17 00:00:00 2001 +From: Juan Cruz Linsalata +Date: Mon, 12 Oct 2020 15:40:53 -0300 +Subject: [PATCH] FlameCord General Patch + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +new file mode 100644 +index 000000000..f3d5c0290 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -0,0 +1,31 @@ ++package dev._2lstudios.flamecord; ++ ++import java.util.Collection; ++import java.util.logging.Logger; ++ ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import lombok.Getter; ++import net.md_5.bungee.config.ConfigurationProvider; ++import net.md_5.bungee.config.YamlConfiguration; ++ ++public class FlameCord { ++ @Getter ++ private static FlameCord instance; ++ ++ public static void initialize(final Logger logger, final Collection whitelistedAddresses) { ++ if (FlameCord.instance == null) { ++ FlameCord.instance = new FlameCord(); ++ } ++ ++ instance.reload(logger, whitelistedAddresses); ++ } ++ ++ @Getter ++ private FlameCordConfiguration flameCordConfiguration; ++ ++ public void reload(final Logger logger, final Collection whitelistedAddresses) { ++ final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); ++ } ++} +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +new file mode 100644 +index 000000000..e6c660d15 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java +@@ -0,0 +1,74 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.HashSet; ++ ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++import net.md_5.bungee.config.YamlConfiguration; ++ ++public class FlameConfig { ++ Configuration load(File file) { ++ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ if (file.exists() && file.isFile()) { ++ try { ++ return configurationProvider.load(file); ++ } catch (IOException ex) { ++ // Failed to load, do nothing ++ } ++ } ++ ++ return new Configuration(); ++ } ++ ++ void save(Configuration config, File file) { ++ ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); ++ ++ try { ++ configurationProvider.save(config, file); ++ } catch (IOException ex) { ++ // Failed to save, do nothing ++ } ++ } ++ ++ double setIfUnexistant(final String arg1, final double arg2, final Configuration configuration) { ++ return (double) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ int setIfUnexistant(final String arg1, final int arg2, final Configuration configuration) { ++ return (int) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ String setIfUnexistant(final String arg1, final String arg2, final Configuration configuration) { ++ return (String) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ boolean setIfUnexistant(final String arg1, final boolean arg2, final Configuration configuration) { ++ return (boolean) setIfUnexistant(arg1, (Object) arg2, configuration); ++ } ++ ++ Object setIfUnexistant(final String arg1, final Object arg2, final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, arg2); ++ ++ return arg2; ++ } else { ++ return configuration.get(arg1); ++ } ++ } ++ ++ Collection setIfUnexistant(final String arg1, final Collection arg2, ++ final Configuration configuration) { ++ if (!configuration.contains(arg1)) { ++ configuration.set(arg1, new ArrayList<>(arg2)); ++ ++ return arg2; ++ } else { ++ return new HashSet<>(configuration.getStringList(arg1)); ++ } ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +new file mode 100644 +index 000000000..241e8ed9c +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -0,0 +1,20 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.HashSet; ++ ++import lombok.Getter; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class FlameCordConfiguration extends FlameConfig { ++ public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { ++ final File configurationFile = new File("./flamecord.yml"); ++ final Configuration configuration = load(configurationFile); ++ ++ save(configuration, configurationFile); ++ } ++} +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 640f0ea26..70a1192e7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -1,5 +1,6 @@ + package net.md_5.bungee.protocol; + ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufUtil; + import io.netty.channel.ChannelHandlerContext; +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +new file mode 100644 +index 000000000..021b38d43 +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -0,0 +1,58 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import java.util.Collection; ++import java.util.HashSet; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.config.ServerInfo; ++import net.md_5.bungee.api.plugin.Command; ++ ++public class FlameCordCommand extends Command { ++private final BungeeCord bungeeCord; ++ ++ public FlameCordCommand(final BungeeCord bungeeCord) { ++ super("flamecord"); ++ ++ this.bungeeCord = bungeeCord; ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ ++ if (sender.hasPermission("flamecord.usage")) { ++ if (args.length > 0) { ++ final String arg0 = args[0]; ++ ++ switch (arg0) { ++ case "reload": { ++ // FlameCord - Collect ips from servers ++ final Collection whitelistedAddresses = new HashSet<>(); ++ ++ for (final ServerInfo serverInfo : bungeeCord.getServers().values()) { ++ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); ++ } ++ ++ FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); ++ sender.sendMessage(TextComponent ++ .fromLegacyText("flamecord_reload")); ++ break; ++ } ++ default: { ++ sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); ++ break; ++ } ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText("flamecord_help")); ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText("flamecord_nopermission")); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 27d41dd00..0d8f02d25 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -9,6 +9,8 @@ import com.google.common.collect.Sets; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + import com.google.gson.Gson; + import com.google.gson.GsonBuilder; ++ ++import dev._2lstudios.flamecord.FlameCord; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; +@@ -295,6 +297,15 @@ public class BungeeCord extends ProxyServer + pluginManager.loadPlugins(); + config.load(); + ++ // FlameCord - Renew and register modules ++ final Collection whitelistedAddresses = new HashSet<>(); ++ ++ for (final ServerInfo serverInfo : getServers().values()) { ++ whitelistedAddresses.add(serverInfo.getSocketAddress().toString()); ++ } ++ ++ FlameCord.initialize(logger, whitelistedAddresses); ++ + if ( config.isForgeSupport() ) + { + registerChannel( ForgeConstants.FML_TAG ); +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index da688839c..3a07c7c8a 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -2,6 +2,8 @@ package net.md_5.bungee; + + import com.google.common.base.Joiner; + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufAllocator; + import java.net.InetSocketAddress; +@@ -165,7 +167,9 @@ public class ServerConnector extends PacketHandler + { + if ( packet.packet == null ) + { +- throw new QuietException( "Unexpected packet received during server login process!\n" + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - FlameCord General Patch ++ // More specific invalid packet exceptions ++ throw new QuietException( "Unexpected packet received during server connector process!\n" + BufUtil.dump(packet.buf, 16) ); + } + } + +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 94702434d..e48f77131 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; + import net.md_5.bungee.api.Title; + import net.md_5.bungee.api.chat.BaseComponent; + import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.config.ListenerInfo; + import net.md_5.bungee.api.config.ServerInfo; + import net.md_5.bungee.api.connection.ProxiedPlayer; + import net.md_5.bungee.api.event.PermissionCheckEvent; +@@ -66,6 +67,7 @@ import net.md_5.bungee.tab.ServerUnique; + import net.md_5.bungee.tab.TabList; + import net.md_5.bungee.util.CaseInsensitiveSet; + import net.md_5.bungee.util.ChatComponentTransformer; ++import net.md_5.bungee.util.QuietException; + + @RequiredArgsConstructor + public final class UserConnection implements ProxiedPlayer +@@ -393,9 +395,11 @@ public final class UserConnection implements ProxiedPlayer + .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, request.getConnectTimeout() ) + .remoteAddress( target.getAddress() ); + // Windows is bugged, multi homed users will just have to live with random connecting IPs +- if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() && getPendingConnection().getListener().getSocketAddress() instanceof InetSocketAddress ) ++ // FlameCord - Use listenerInfo ++ final ListenerInfo listenerInfo = getPendingConnection().getListener(); ++ if ( listenerInfo.isSetLocalAddress() && !PlatformDependent.isWindows() && listenerInfo.getSocketAddress() instanceof InetSocketAddress ) + { +- b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 ); ++ b.localAddress( listenerInfo.getHost().getHostString(), 0 ); + } + b.connect().addListener( listener ); + } +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 3b1bffe6c..22688a045 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 +@@ -21,6 +21,8 @@ import java.util.logging.Level; + import javax.crypto.SecretKey; + import javax.crypto.spec.SecretKeySpec; + ++import dev._2lstudios.flamecord.FlameCord; ++ + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -159,7 +161,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( packet.packet == null ) + { +- throw new QuietException( "Unexpected packet received during login process! " + BufUtil.dump( packet.buf, 16 ) ); ++ // FlameCord - FlameCord General Patch ++ // More specific invalid packet exceptions ++ throw new QuietException( "Unexpected packet received during initial handler process!\n" + BufUtil.dump(packet.buf, 16) ); + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +index a409d440b..3503c089d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +@@ -1,6 +1,7 @@ + package net.md_5.bungee.connection; + + import com.google.gson.Gson; ++ + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 4820267b3..694ecdb01 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -1,6 +1,8 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInboundHandlerAdapter; + import io.netty.handler.codec.CorruptedFrameException; +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 a95193ba7..a4c3bd710 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,8 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++ ++import dev._2lstudios.flamecord.FlameCord; + import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch new file mode 100644 index 00000000..57217719 --- /dev/null +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -0,0 +1,194 @@ +From 681805834a7f83cccb8de7878b8ffacbdb4b6d0d Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 1 May 2021 14:17:48 -0300 +Subject: [PATCH] FlameCord module system + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index f3d5c0290..fb3d8ca2e 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.logging.Logger; + + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import lombok.Getter; + import net.md_5.bungee.config.ConfigurationProvider; + import net.md_5.bungee.config.YamlConfiguration; +@@ -23,9 +24,16 @@ public class FlameCord { + @Getter + private FlameCordConfiguration flameCordConfiguration; + ++ // FlameCord - Module System ++ @Getter ++ private ModulesConfiguration modulesConfiguration; ++ + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + + this.flameCordConfiguration = new FlameCordConfiguration(configurationProvider, whitelistedAddresses); ++ ++ // FlameCord - Module System ++ this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +new file mode 100644 +index 000000000..a6cb2638f +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java +@@ -0,0 +1,35 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++ ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class ModulesConfiguration extends FlameConfig { ++ public boolean reconnectEnabled = false; ++ public boolean alertEnabled = true; ++ public boolean findEnabled = true; ++ public boolean ipEnabled = true; ++ public boolean listEnabled = true; ++ public boolean permsEnabled = true; ++ public boolean reloadEnabled = true; ++ public boolean sendEnabled = true; ++ public boolean serverEnabled = true; ++ ++ public ModulesConfiguration(final ConfigurationProvider configurationProvider) { ++ final File configurationFile = new File("./modules.yml"); ++ final Configuration configuration = load(configurationFile); ++ ++ this.alertEnabled = setIfUnexistant("alert.enabled", this.alertEnabled, configuration); ++ this.findEnabled = setIfUnexistant("find.enabled", this.findEnabled, configuration); ++ this.ipEnabled = setIfUnexistant("ip.enabled", this.ipEnabled, configuration); ++ this.listEnabled = setIfUnexistant("list.enabled", this.listEnabled, configuration); ++ this.permsEnabled = setIfUnexistant("perms.enabled", this.permsEnabled, configuration); ++ this.reloadEnabled = setIfUnexistant("reload.enabled", this.reloadEnabled, configuration); ++ this.sendEnabled = setIfUnexistant("send.enabled", this.sendEnabled, configuration); ++ this.serverEnabled = setIfUnexistant("server.enabled", this.serverEnabled, configuration); ++ this.reconnectEnabled = setIfUnexistant("reconnect.enabled", this.reconnectEnabled, configuration); ++ ++ save(configuration, configurationFile); ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 0d8f02d25..d58227fd9 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -11,6 +11,8 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.FlameCordCommand; ++import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; +@@ -90,6 +92,13 @@ import net.md_5.bungee.conf.Configuration; + import net.md_5.bungee.conf.YamlConfig; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.module.ModuleManager; ++import net.md_5.bungee.module.cmd.alert.CommandAlert; ++import net.md_5.bungee.module.cmd.alert.CommandAlertRaw; ++import net.md_5.bungee.module.cmd.find.CommandFind; ++import net.md_5.bungee.module.cmd.list.CommandList; ++import net.md_5.bungee.module.cmd.send.CommandSend; ++import net.md_5.bungee.module.cmd.server.CommandServer; ++import net.md_5.bungee.module.reconnect.yaml.YamlReconnectHandler; + import net.md_5.bungee.netty.PipelineUtils; + import net.md_5.bungee.protocol.DefinedPacket; + import net.md_5.bungee.protocol.ProtocolConstants; +@@ -244,11 +253,6 @@ public class BungeeCord extends ProxyServer + // Waterfall end + + pluginManager = new PluginManager( this ); +- getPluginManager().registerCommand( null, new CommandReload() ); +- getPluginManager().registerCommand( null, new CommandEnd() ); +- getPluginManager().registerCommand( null, new CommandIP() ); +- getPluginManager().registerCommand( null, new CommandBungee() ); +- getPluginManager().registerCommand( null, new CommandPerms() ); + + if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) + { +@@ -287,9 +291,10 @@ public class BungeeCord extends ProxyServer + bossEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); + workerEventLoopGroup = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); + +- File moduleDirectory = new File( "modules" ); ++ // FlameCord - Use own module system ++ /* File moduleDirectory = new File( "modules" ); + moduleManager.load( this, moduleDirectory ); +- pluginManager.detectPlugins( moduleDirectory ); ++ pluginManager.detectPlugins( moduleDirectory ); */ + + pluginsFolder.mkdir(); + pluginManager.detectPlugins( pluginsFolder ); +@@ -315,6 +320,7 @@ public class BungeeCord extends ProxyServer + + isRunning = true; + ++ loadModules(); + pluginManager.enablePlugins(); + + if ( config.getThrottle() > 0 ) +@@ -853,4 +859,53 @@ public class BungeeCord extends ProxyServer + { + return new BungeeTitle(); + } ++ ++ // FlameCord - FlameCord Module System ++ public void loadModules() { ++ final ModulesConfiguration modulesConfiguration = FlameCord.getInstance().getModulesConfiguration(); ++ ++ // Bungeecord Commands ++ pluginManager.registerCommand(null, new CommandEnd()); ++ pluginManager.registerCommand(null, new CommandBungee()); ++ ++ if (modulesConfiguration.reloadEnabled) { ++ pluginManager.registerCommand(null, new CommandReload()); ++ } ++ if (modulesConfiguration.ipEnabled) { ++ pluginManager.registerCommand(null, new CommandIP()); ++ } ++ if (modulesConfiguration.permsEnabled) { ++ pluginManager.registerCommand(null, new CommandPerms()); ++ } ++ ++ // Modules Commands ++ if (modulesConfiguration.alertEnabled) { ++ pluginManager.registerCommand(null, new CommandAlert()); ++ pluginManager.registerCommand(null, new CommandAlertRaw()); ++ } ++ if (modulesConfiguration.findEnabled) { ++ pluginManager.registerCommand(null, new CommandFind()); ++ } ++ if (modulesConfiguration.listEnabled) { ++ pluginManager.registerCommand(null, new CommandList()); ++ } ++ if (modulesConfiguration.sendEnabled) { ++ pluginManager.registerCommand(null, new CommandSend()); ++ } ++ if (modulesConfiguration.serverEnabled) { ++ pluginManager.registerCommand(null, new CommandServer()); ++ } ++ ++ if (modulesConfiguration.reconnectEnabled) { ++ for (ListenerInfo info : getConfig().getListeners()) { ++ if (!info.isForceDefault() && getReconnectHandler() == null) { ++ setReconnectHandler(new YamlReconnectHandler()); ++ break; ++ } ++ } ++ } ++ ++ // Flamecord Command ++ pluginManager.registerCommand(null, new FlameCordCommand(this)); ++ } + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch new file mode 100644 index 00000000..9d030c6c --- /dev/null +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -0,0 +1,224 @@ +From 168e63822c7f19251ff48a96fb341b230d662143 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Sat, 1 May 2021 13:40:39 -0300 +Subject: [PATCH] FlameCord message configuration + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index fb3d8ca2e..676ba95b9 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.logging.Logger; + + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import lombok.Getter; + import net.md_5.bungee.config.ConfigurationProvider; +@@ -27,6 +28,8 @@ public class FlameCord { + // FlameCord - Module System + @Getter + private ModulesConfiguration modulesConfiguration; ++ @Getter ++ private MessagesConfiguration messagesConfiguration; + + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); +@@ -35,5 +38,6 @@ public class FlameCord { + + // FlameCord - Module System + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); ++ this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +new file mode 100644 +index 000000000..ae1794385 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -0,0 +1,102 @@ ++package dev._2lstudios.flamecord.configuration; ++ ++import java.io.File; ++import java.text.MessageFormat; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Logger; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.config.Configuration; ++import net.md_5.bungee.config.ConfigurationProvider; ++ ++public class MessagesConfiguration extends FlameConfig { ++ private final Logger logger; ++ private final Map messages = new HashMap<>(); ++ ++ public MessagesConfiguration(final Logger logger, final ConfigurationProvider configurationProvider) { ++ this.logger = logger; ++ ++ final File configurationFile = new File("./messages.yml"); ++ final Configuration configuration = load(configurationFile); ++ ++ // FlameCord ++ setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); ++ setIfUnexistant("flamecord_help", ++ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", ++ configuration); ++ setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); ++ ++ // BungeeCord ++ setIfUnexistant("alert", "&8[&4Alert&8]&r ", configuration); ++ setIfUnexistant("already_connected", "&cYou are already connected to this server!", configuration); ++ setIfUnexistant("already_connected_proxy", "&cYou are already connected to this proxy!", configuration); ++ setIfUnexistant("already_connecting", "&cAlready connecting to this server!", configuration); ++ setIfUnexistant("command_list", "&a[{0}] &e({1}): &r{2}", configuration); ++ setIfUnexistant("connect_kick", "&cKicked whilst connecting to {0}: {1}", configuration); ++ setIfUnexistant("current_server", "&6You are currently connected to {0}.", configuration); ++ setIfUnexistant("fallback_kick", ++ "&cCould not connect to a default or fallback server, please try again later: {0}", configuration); ++ setIfUnexistant("fallback_lobby", ++ "&cCould not connect to target server, you have been moved to a fallback server.", configuration); ++ setIfUnexistant("lost_connection", "[Proxy] Lost connection to server.", configuration); ++ setIfUnexistant("mojang_fail", "Error occurred while contacting login servers, are they down?", ++ configuration); ++ setIfUnexistant("no_permission", "&cYou do not have permission to execute this command!", configuration); ++ setIfUnexistant("no_server", "&cThe specified server does not exist.", configuration); ++ setIfUnexistant("no_server_permission", "&cYou don't have permission to access this server.", ++ configuration); ++ setIfUnexistant("outdated_client", "Outdated client! Please use {0}", configuration); ++ setIfUnexistant("outdated_server", "Outdated server! I'm still on {0}", configuration); ++ setIfUnexistant("proxy_full", "Server is full!", configuration); ++ setIfUnexistant("restart", "[Proxy] Proxy restarting.", configuration); ++ setIfUnexistant("server_list", "&6You may connect to the following servers at this time: ", configuration); ++ setIfUnexistant("server_went_down", ++ "&cThe server you were previously on went down, you have been connected to a fallback server", ++ configuration); ++ setIfUnexistant("total_players", "Total players online: {0}", configuration); ++ setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); ++ setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); ++ setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); ++ setIfUnexistant("message_needed", "&cYou must supply a message.", configuration); ++ setIfUnexistant("error_occurred_player", ++ "&cAn error occurred while parsing your message. (Hover for details)", configuration); ++ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", ++ configuration); ++ setIfUnexistant("server_command_hover_players", "{0} players", configuration); ++ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); ++ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); ++ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); ++ setIfUnexistant("user_online_at", "&a{0} &ris online at {1}", configuration); ++ setIfUnexistant("send_cmd_usage", ++ "&cNot enough arguments, usage: /send ", configuration); ++ setIfUnexistant("player_only", "&cOnly in game players can use this command", configuration); ++ setIfUnexistant("you_got_summoned", "&6Summoned to {0} by {1}", configuration); ++ setIfUnexistant("command_perms_groups", "&6You have the following groups: {0}", configuration); ++ setIfUnexistant("command_perms_permission", "&9- {0}", configuration); ++ setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); ++ setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); ++ ++ for (final String key : configuration.getKeys()) { ++ final Object value = configuration.get(key); ++ ++ if (value instanceof String) { ++ this.messages.put(key, ChatColor.translateAlternateColorCodes('&', (String) value)); ++ } ++ } ++ ++ save(configuration, configurationFile); ++ } ++ ++ public String getTranslation(final String name, final Object... args) { ++ if (!messages.containsKey(name)) { ++ logger.warning("[FlameCord] Tried to get translation '" + name ++ + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); ++ } ++ ++ return MessageFormat.format(messages.getOrDefault(name, ""), args); ++ } ++} +\ No newline at end of file +diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +index 698b420f4..e4ad7e389 100644 +--- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java ++++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +@@ -50,7 +50,9 @@ public class CommandServer extends Command implements TabExecutor + int count = server.getPlayers().size(); + serverTextComponent.setHoverEvent( new HoverEvent( + HoverEvent.Action.SHOW_TEXT, +- new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) ++ // FlameCord - FlameCord messages configuration ++ // Make player count customizable ++ new ComponentBuilder( ProxyServer.getInstance().getTranslation( "server_command_hover_players", count ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) + ); + serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); + serverList.append( serverTextComponent ); +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +index 021b38d43..fb81adee0 100644 +--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.HashSet; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; +@@ -22,6 +23,7 @@ private final BungeeCord bungeeCord; + @Override + public void execute(final CommandSender sender, final String[] args) { + final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); + + if (sender.hasPermission("flamecord.usage")) { + if (args.length > 0) { +@@ -38,21 +40,22 @@ private final BungeeCord bungeeCord; + + FlameCord.initialize(bungeeCord.getLogger(), whitelistedAddresses); + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_reload")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); + break; + } + default: { +- sender.sendMessage(TextComponent.fromLegacyText("flamecord_help")); ++ sender.sendMessage(TextComponent.fromLegacyText( ++ messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + break; + } + } + } else { + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_help")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + } + } else { + sender.sendMessage(TextComponent +- .fromLegacyText("flamecord_nopermission")); ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_nopermission"))); + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index d58227fd9..8994454c7 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -620,8 +620,8 @@ public class BungeeCord extends ProxyServer + @Override + public String getTranslation(String name, Object... args) + { +- Format format = messageFormats.get( name ); +- return ( format != null ) ? format.format( args ) : ""; ++ // FlameCord - Use own translation system ++ return FlameCord.getInstance().getMessagesConfiguration().getTranslation(name, args); + } + + @Override +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch new file mode 100644 index 00000000..b77c30d6 --- /dev/null +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -0,0 +1,68 @@ +From 4121bc5ef2215f0621d449c5cf2073c47ed93947 Mon Sep 17 00:00:00 2001 +From: linsaftw +Date: Sat, 20 Mar 2021 12:36:25 -0300 +Subject: [PATCH] Fix ByteBuf memory leaks + + +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +index 68916db79..688ff72d2 100644 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +@@ -155,11 +155,15 @@ public abstract class EntityMap + if ( readId == oldId || readId == newId ) + { + ByteBuf data = packet.copy(); +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- data.release(); ++ ++ try { ++ packet.readerIndex( offset ); ++ packet.writerIndex( offset ); ++ DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); ++ packet.writeBytes( data ); ++ } finally { ++ data.release(); ++ } + } + } + +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index cefa0206e..8d4439ab8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -38,16 +38,22 @@ public class ForgeUtils + { + Map modTags = new HashMap<>(); + ByteBuf payload = Unpooled.wrappedBuffer( pluginMessage.getData() ); +- byte discriminator = payload.readByte(); +- if ( discriminator == 2 ) // ModList +- { +- ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ ++ try { ++ byte discriminator = payload.readByte(); ++ if ( discriminator == 2 ) // ModList + { +- modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ ByteBuf buffer = payload.slice(); ++ int modCount = DefinedPacket.readVarInt( buffer, 2 ); ++ for ( int i = 0; i < modCount; i++ ) ++ { ++ modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); ++ } + } ++ } finally { ++ payload.release(); + } ++ + return modTags; + } + +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch new file mode 100644 index 00000000..07bc7ec1 --- /dev/null +++ b/Waterfall-Proxy-Patches/0022-Check-if-packetID-is-invalid.patch @@ -0,0 +1,27 @@ +From 7e20c899237e194fbda629aa6be4444fbe293b7d Mon Sep 17 00:00:00 2001 +From: PermisosDev <55111245+PermisosDev@users.noreply.github.com> +Date: Thu, 15 Apr 2021 08:34:57 -0300 +Subject: [PATCH] Check if packetID is invalid. + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 70a1192e7..6316143f7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder + + int packetId = DefinedPacket.readVarInt( in ); + packetTypeInfo = packetId; +- ++ // FlameCord Start - Check if packetId is invalid. ++ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID) ++ { ++ throw new FastDecoderException( "[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId ); ++ } ++ // Flamecord End + DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge ); + if ( packet != null ) + { +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch new file mode 100644 index 00000000..6f49bf56 --- /dev/null +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -0,0 +1,140 @@ +From 1d9ee842e043c343a64b8fe7ef6962ee0fb53041 Mon Sep 17 00:00:00 2001 +From: linsaftw <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 30 Apr 2021 23:51:51 -0300 +Subject: [PATCH] FlameCord logger options + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 241e8ed9c..b563cbced 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -11,10 +11,27 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration extends FlameConfig { ++ @Getter ++ private boolean loggerInitialhandler = false; ++ @Getter ++ private boolean loggerExceptions = false; ++ @Getter ++ private boolean loggerDump = false; ++ @Getter ++ private boolean loggerHaProxy = false; ++ @Getter ++ private boolean loggerDetailedConnection = true; ++ + public FlameCordConfiguration(final ConfigurationProvider configurationProvider, final Collection whitelistedAddresses) { + final File configurationFile = new File("./flamecord.yml"); + final Configuration configuration = load(configurationFile); + ++ this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); ++ this.loggerExceptions = setIfUnexistant("logger.exceptions", this.loggerExceptions, configuration); ++ this.loggerDump = setIfUnexistant("logger.dump", this.loggerDump, configuration); ++ this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); ++ this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); ++ + save(configuration, configurationFile); + } + } +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 e48f77131..909227970 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; + import com.google.common.collect.HashMultimap; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multimap; ++import dev._2lstudios.flamecord.FlameCord; + import io.netty.bootstrap.Bootstrap; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFuture; +@@ -406,7 +407,10 @@ public final class UserConnection implements ProxiedPlayer + + private String connectionFailMessage(Throwable cause) + { +- bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception( cause, false )); // Waterfall ++ // FlameCord - Allow for toggle the logging of connection failures ++ if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { ++ bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ } + return ""; // Waterfall + } + +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 22688a045..66a347542 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 +@@ -396,7 +396,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + case 1: + // Ping +- if ( bungee.getConfig().isLogPings() ) ++ // FlameCord - Option to log initialhandler ++ if ( bungee.getConfig().isLogPings() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); + } +@@ -405,7 +406,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection + break; + case 2: + // Login +- if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() ) // Waterfall ++ // FlameCord - Option to log initialhandler ++ if (BungeeCord.getInstance().getConfig().isLogInitialHandlerConnections() && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) // Waterfall + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 694ecdb01..14e3004fc 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel = new ChannelWrapper( ctx ); + handler.connected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has connected", handler ); + } +@@ -61,7 +62,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + channel.markClosed(); + handler.disconnected( channel ); + +- if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) ) ++ // FlameCord - Option to log initialhandler ++ if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) && FlameCord.getInstance().getFlameCordConfiguration().isLoggerInitialhandler() ) + { + ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); + } +@@ -98,10 +100,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() ); + +- ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] +- { +- channel.getRemoteAddress(), newAddress +- } ); ++ // FlameCord - Option to log haproxy ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isLoggerHaProxy() ) ++ ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[] ++ { ++ channel.getRemoteAddress(), newAddress ++ } ); + + channel.setRemoteAddress( newAddress ); + } +@@ -146,6 +150,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + { + boolean logExceptions = !( handler instanceof PingHandler ); + ++ // FlameCord - Option to log exceptions ++ logExceptions = FlameCord.getInstance().getFlameCordConfiguration().isLoggerExceptions() ? logExceptions : false; ++ + if ( logExceptions ) + { + if ( cause instanceof ReadTimeoutException ) +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch new file mode 100644 index 00000000..94640188 --- /dev/null +++ b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch @@ -0,0 +1,86 @@ +From 664f35c5a6155c5e41aa10d1cd15cf590cc011a0 Mon Sep 17 00:00:00 2001 +From: abhiram +Date: Thu, 13 May 2021 01:05:03 +0530 +Subject: [PATCH] Added an api method to unload Plugins + +Format Code to Bungee's code style + +diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +index 90031156f..a190dfae8 100644 +--- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java ++++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +@@ -25,6 +25,7 @@ import java.util.Set; + import java.util.Stack; + import java.util.jar.JarEntry; + import java.util.jar.JarFile; ++import java.util.logging.Handler; + import java.util.logging.Level; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; // Waterfall + import io.github.waterfallmc.waterfall.exception.ProxyCommandException; // Waterfall +@@ -63,6 +64,7 @@ public final class PluginManager + private Map toLoad = new HashMap<>(); + private final Multimap commandsByPlugin = ArrayListMultimap.create(); + private final Multimap listenersByPlugin = ArrayListMultimap.create(); ++ private final HashMap pluginloaders = new HashMap<>(); + + @SuppressWarnings("unchecked") + public PluginManager(ProxyServer proxy) +@@ -291,6 +293,45 @@ public final class PluginManager + return plugins.get( name ); + } + ++ ++ /** ++ * This will Unload the given plugin ++ * ++ * @param plugin to unload ++ */ ++ // FlameCord start - Adds a method to unload plugin from proxy ++ public void unloadPlugin(Plugin plugin) ++ { ++ plugin.onDisable(); ++ this.unregisterListeners( plugin ); ++ this.unregisterCommands( plugin ); ++ this.proxy.getScheduler().cancel( plugin ); ++ ++ for ( Handler handler : plugin.getLogger().getHandlers() ) ++ { ++ handler.close(); ++ } ++ ++ try ++ { ++ pluginloaders.get( plugin.getDescription().getName() ).close(); ++ }catch (Exception exception) ++ { ++ exception.printStackTrace(); ++ } ++ ++ if( this.plugins.containsKey( plugin.getDescription().getName() ) ) ++ { ++ this.plugins.remove( plugin.getDescription().getName() ); ++ } ++ ++ if( this.pluginloaders.containsKey( plugin.getDescription().getName() ) ) ++ { ++ this.pluginloaders.remove( plugin.getDescription().getName() ); ++ } ++ } ++ // FlameCord end ++ + public void loadPlugins() + { + Map pluginStatuses = new HashMap<>(); +@@ -395,6 +436,9 @@ public final class PluginManager + Plugin clazz = (Plugin) main.getDeclaredConstructor().newInstance(); + + plugins.put( plugin.getName(), clazz ); ++ // FlameCord start - cache url classloaders to unload plugins ++ pluginloaders.put( plugin.getName(),loader ); ++ // FlameCord end + clazz.onLoad(); + ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] + { +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch new file mode 100644 index 00000000..17fe687b --- /dev/null +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -0,0 +1,69 @@ +From 2caae71d8c0bdc5a325610ef1c77775f9ba4ee69 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Jun 2021 11:30:19 -0300 +Subject: [PATCH] Apply packet limits + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +index e78519964..222285cc1 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +@@ -61,4 +61,14 @@ public class EncryptionRequest extends DefinedPacket + { + handler.handle( this ); + } ++ ++ @Override ++ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 20 + 256 + 256; // FlameCord - Apply packet limits ++ } ++ ++ @Override ++ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 20 + 1 + 1; // FlameCord - Apply packet limits ++ } + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +index 7dbbfd3cd..b78420556 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java +@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; + import lombok.NoArgsConstructor; + import net.md_5.bungee.protocol.AbstractPacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; ++import net.md_5.bungee.protocol.ProtocolConstants; + + @Data + @NoArgsConstructor +@@ -43,4 +44,14 @@ public class Handshake extends DefinedPacket + { + handler.handle( this ); + } ++ ++ @Override ++ public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 1036 + 256; // FlameCord - Apply packet limits ++ } ++ ++ @Override ++ public int expectedMinLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { ++ return 5; // FlameCord - Apply packet limits ++ } + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +index 3224b0d2b..763d34c2f 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +@@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket + public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { + // Accommodate the rare (but likely malicious) use of UTF-8 usernames, since it is technically + // legal on the protocol level. +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return -1; ++ // FlameCord - Apply packet limits ++ if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 1024; + return 1 + (16 * 4); + } + // Waterfall end +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch new file mode 100644 index 00000000..2ecfe04a --- /dev/null +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -0,0 +1,676 @@ +From 2072d8d33f059abfdb95c16158792887f3f701d3 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 7 Oct 2021 21:37:24 -0300 +Subject: [PATCH] Custom motd system + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index b563cbced..b41ee92cc 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -2,15 +2,94 @@ package dev._2lstudios.flamecord.configuration; + + import java.io.File; + import java.util.ArrayList; ++import java.util.Collections; + import java.util.Arrays; + import java.util.Collection; + import java.util.HashSet; ++import java.util.List; ++import java.util.Random; + ++import dev._2lstudios.flamecord.utils.ColorUtil; + import lombok.Getter; + import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration extends FlameConfig { ++ public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { ++ String motd; ++ ++ if (protocol >= 735) { ++ motd = hexMotds.get(new Random().nextInt(hexMotds.size())); ++ } else { ++ motd = motds.get(new Random().nextInt(motds.size())); ++ } ++ ++ motd = motd.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ ++ return motd; ++ } ++ ++ public String[] getSample(int maxPlayers, int onlinePlayers, int protocol) { ++ String sample; ++ ++ if (protocol >= 735) { ++ sample = hexSamples.get(new Random().nextInt(hexSamples.size())); ++ } else { ++ sample = samples.get(new Random().nextInt(samples.size())); ++ } ++ ++ sample = sample.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ ++ return sample.split("\n"); ++ } ++ ++ public String getProtocolName(int maxPlayers, int onlinePlayers) { ++ return protocolName.replace("%maxplayers%", String.valueOf(maxPlayers)).replace("%onlineplayers%", String.valueOf(onlinePlayers)); ++ } ++ ++ public int getFakePlayersAmount(final int players) { ++ switch (fakePlayersMode) { ++ case "STATIC": ++ return fakePlayersAmount; ++ case "RANDOM": ++ return (int) (Math.floor(Math.random() * fakePlayersAmount) + 1); ++ case "DIVISION": ++ return players / fakePlayersAmount; ++ default: ++ return 0; ++ } ++ } ++ ++ @Getter ++ private boolean motdEnabled = false; ++ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List hexMotds; ++ ++ @Getter ++ private boolean sampleEnabled = false; ++ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List hexSamples; ++ ++ @Getter ++ private boolean protocolEnabled = false; ++ @Getter ++ private String protocolName = "&c&lMaintenance"; ++ @Getter ++ private boolean protocolAlwaysShow = false; ++ ++ @Getter ++ private boolean maxPlayersEnabled = false; ++ @Getter ++ private int maxPlayersAmount = 1000; ++ @Getter ++ private boolean maxPlayersOneMore = false; ++ ++ @Getter ++ private boolean fakePlayersEnabled = false; ++ @Getter ++ private int fakePlayersAmount = 3; ++ private String fakePlayersMode = "DIVISION"; ++ + @Getter + private boolean loggerInitialhandler = false; + @Getter +@@ -32,6 +111,22 @@ public class FlameCordConfiguration extends FlameConfig { + this.loggerHaProxy = setIfUnexistant("logger.haproxy", this.loggerHaProxy, configuration); + this.loggerDetailedConnection = setIfUnexistant("logger.detailed-connect-errors", this.loggerDetailedConnection, configuration); + ++ this.motdEnabled = setIfUnexistant("custom-motd.motd.enabled", this.motdEnabled, configuration); ++ this.hexMotds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 735); ++ this.motds = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.motd.motds", this.motds, configuration)), 734); ++ this.sampleEnabled = setIfUnexistant("custom-motd.sample.enabled", this.sampleEnabled, configuration); ++ this.hexSamples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 735); ++ this.samples = ColorUtil.hexColor(new ArrayList<>(setIfUnexistant("custom-motd.sample.samples", this.samples, configuration)), 734); ++ this.protocolEnabled = setIfUnexistant("custom-motd.protocol.enabled", this.protocolEnabled, configuration); ++ this.protocolName = ColorUtil.hexColor(setIfUnexistant("custom-motd.protocol.name", this.protocolName, configuration), 735); ++ this.protocolAlwaysShow = setIfUnexistant("custom-motd.protocol.always-show", this.protocolAlwaysShow, configuration); ++ this.maxPlayersEnabled = setIfUnexistant("custom-motd.maxplayers.enabled", this.maxPlayersEnabled, configuration); ++ this.maxPlayersAmount = setIfUnexistant("custom-motd.maxplayers.amount", this.maxPlayersAmount, configuration); ++ this.maxPlayersOneMore = setIfUnexistant("custom-motd.maxplayers.justonemore", this.maxPlayersOneMore, configuration); ++ this.fakePlayersEnabled = setIfUnexistant("custom-motd.fakeplayers.enabled", this.fakePlayersEnabled, configuration); ++ this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); ++ this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); ++ + save(configuration, configurationFile); + } + } +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java +new file mode 100644 +index 000000000..9587bccda +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java +@@ -0,0 +1,48 @@ ++package dev._2lstudios.flamecord.utils; ++ ++import java.util.List; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++import net.md_5.bungee.api.ChatColor; ++ ++public class ColorUtil { ++ public static String color(String text) { ++ return ChatColor.translateAlternateColorCodes('&', text); ++ } ++ ++ public static List color(final List texts) { ++ for (int i = 0; i < texts.size(); i++) { ++ texts.set(i, color(texts.get(i))); ++ } ++ ++ return texts; ++ } ++ ++ public static String hex(String text, int protocol) { ++ if (text == null) { ++ return text; ++ } ++ ++ return IridiumColorAPI.process(text, protocol); ++ } ++ ++ public static String hexColor(String text, int protocol) { ++ if (text != null) { ++ text = color(text); ++ ++ if (text != null) { ++ text = hex(text, protocol); ++ } ++ } ++ ++ return text; ++ } ++ ++ public static List hexColor(final List texts, int protocol) { ++ for (int i = 0; i < texts.size(); i++) { ++ texts.set(i, hexColor(texts.get(i), protocol)); ++ } ++ ++ return texts; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java +new file mode 100644 +index 000000000..6c386e16f +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java +@@ -0,0 +1,275 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi; ++ ++import java.awt.Color; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.List; ++import java.util.Map; ++import java.util.stream.Collectors; ++ ++import javax.annotation.Nonnull; ++ ++import com.google.common.collect.ImmutableMap; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.GradientPattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.Pattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.RainbowPattern; ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns.SolidPattern; ++import net.md_5.bungee.api.ChatColor; ++ ++public class IridiumColorAPI { ++ ++ /** ++ * Cached result if the server version is after the v1.16 RGB update. ++ * ++ * @since 1.0.0 ++ */ ++ private static final boolean SUPPORTS_RGB(int protocol) { ++ return protocol >= 735; ++ } ++ ++ private static final List SPECIAL_COLORS = Arrays.asList("&l", "&n", "&o", "&k", "&m", "§l", "§n", "§o", "§k", "§m"); ++ ++ /** ++ * Cached result of all legacy colors. ++ * ++ * @since 1.0.0 ++ */ ++ private static final Map COLORS = ImmutableMap.builder() ++ .put(new Color(0), ChatColor.getByChar('0')) ++ .put(new Color(170), ChatColor.getByChar('1')) ++ .put(new Color(43520), ChatColor.getByChar('2')) ++ .put(new Color(43690), ChatColor.getByChar('3')) ++ .put(new Color(11141120), ChatColor.getByChar('4')) ++ .put(new Color(11141290), ChatColor.getByChar('5')) ++ .put(new Color(16755200), ChatColor.getByChar('6')) ++ .put(new Color(11184810), ChatColor.getByChar('7')) ++ .put(new Color(5592405), ChatColor.getByChar('8')) ++ .put(new Color(5592575), ChatColor.getByChar('9')) ++ .put(new Color(5635925), ChatColor.getByChar('a')) ++ .put(new Color(5636095), ChatColor.getByChar('b')) ++ .put(new Color(16733525), ChatColor.getByChar('c')) ++ .put(new Color(16733695), ChatColor.getByChar('d')) ++ .put(new Color(16777045), ChatColor.getByChar('e')) ++ .put(new Color(16777215), ChatColor.getByChar('f')).build(); ++ ++ /** ++ * Cached result of patterns. ++ * ++ * @since 1.0.2 ++ */ ++ private static final List PATTERNS = Arrays.asList(new GradientPattern(), new SolidPattern(), new RainbowPattern()); ++ ++ /** ++ * Processes a string to add color to it. ++ * Thanks to Distressing for helping with the regex <3 ++ * ++ * @param string The string we want to process ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String process(@Nonnull String string, int protocol) { ++ for (Pattern pattern : PATTERNS) { ++ string = pattern.process(string, protocol); ++ } ++ ++ string = ChatColor.translateAlternateColorCodes('&', string); ++ return string; ++ } ++ ++ /** ++ * Processes multiple strings in a collection. ++ * ++ * @param strings The collection of the strings we are processing ++ * @return The list of processed strings ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ public static List process(@Nonnull Collection strings, int protocol) { ++ return strings.stream() ++ .map(s -> IridiumColorAPI.process(s, protocol)) ++ .collect(Collectors.toList()); ++ } ++ ++ /** ++ * Colors a String. ++ * ++ * @param string The string we want to color ++ * @param color The color we want to set it to ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String color(@Nonnull String string, @Nonnull Color color, int protocol) { ++ return (SUPPORTS_RGB(protocol) ? ChatColor.of(color) : getClosestColor(color)) + string; ++ } ++ ++ /** ++ * Colors a String with a gradiant. ++ * ++ * @param string The string we want to color ++ * @param start The starting gradiant ++ * @param end The ending gradiant ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static String color(@Nonnull String string, @Nonnull Color start, @Nonnull Color end, int protocol) { ++ String originalString = string; ++ ++ ChatColor[] colors = createGradient(start, end, withoutSpecialChar(string).length(), protocol); ++ return apply(originalString, colors); ++ } ++ ++ /** ++ * Colors a String with rainbow colors. ++ * ++ * @param string The string which should have rainbow colors ++ * @param saturation The saturation of the rainbow colors ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ public static String rainbow(@Nonnull String string, float saturation, int protocol) { ++ String originalString = string; ++ ++ ChatColor[] colors = createRainbow(withoutSpecialChar(string).length(), saturation, protocol); ++ return apply(originalString, colors); ++ } ++ ++ /** ++ * Gets a color from hex code. ++ * ++ * @param string The hex code of the color ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ public static ChatColor getColor(@Nonnull String string, int protocol) { ++ return SUPPORTS_RGB(protocol) ? ChatColor.of(new Color(Integer.parseInt(string, 16))) ++ : getClosestColor(new Color(Integer.parseInt(string, 16))); ++ } ++ ++ /** ++ * Removes all color codes from the provided String, including IridiumColorAPI ++ * patterns. ++ * ++ * @param string The String which should be stripped ++ * @return The stripped string without color codes ++ * @since 1.0.5 ++ */ ++ @Nonnull ++ public static String stripColorFormatting(@Nonnull String string) { ++ return string.replaceAll("<#[0-9A-F]{6}>|[&§][a-f0-9lnokm]|<[/]?[A-Z]{5,8}(:[0-9A-F]{6})?[0-9]*>", ""); ++ } ++ ++ @Nonnull ++ private static String apply(@Nonnull String source, ChatColor[] colors) { ++ StringBuilder specialColors = new StringBuilder(); ++ StringBuilder stringBuilder = new StringBuilder(); ++ String[] characters = source.split(""); ++ int outIndex = 0; ++ for (int i = 0; i < characters.length; i++) { ++ if (characters[i].equals("&") || characters[i].equals("§")) { ++ if (i + 1 < characters.length) { ++ if (characters[i + 1].equals("r")) { ++ specialColors.setLength(0); ++ } else { ++ specialColors.append(characters[i]); ++ specialColors.append(characters[i + 1]); ++ } ++ i++; ++ } else ++ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); ++ } else ++ stringBuilder.append(colors[outIndex++]).append(specialColors).append(characters[i]); ++ } ++ return stringBuilder.toString(); ++ } ++ ++ @Nonnull ++ private static String withoutSpecialChar(@Nonnull String source) { ++ String workingString = source; ++ for (String color : SPECIAL_COLORS) { ++ if (workingString.contains(color)) { ++ workingString = workingString.replace(color, ""); ++ } ++ } ++ return workingString; ++ } ++ ++ /** ++ * Returns a rainbow array of chat colors. ++ * ++ * @param step How many colors we return ++ * @param saturation The saturation of the rainbow ++ * @return The array of colors ++ * @since 1.0.3 ++ */ ++ @Nonnull ++ private static ChatColor[] createRainbow(int step, float saturation, int protocol) { ++ ChatColor[] colors = new ChatColor[step]; ++ double colorStep = (1.00 / step); ++ ++ for (int i = 0; i < step; i++) { ++ Color color = Color.getHSBColor((float) (colorStep * i), saturation, saturation); ++ if (SUPPORTS_RGB(protocol)) { ++ colors[i] = ChatColor.of(color); ++ } else { ++ colors[i] = getClosestColor(color); ++ } ++ } ++ ++ return colors; ++ } ++ ++ /** ++ * Returns a gradient array of chat colors. ++ * ++ * @param start The starting color. ++ * @param end The ending color. ++ * @param step How many colors we return. ++ * @author TheViperShow ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color end, int step, int protocol) { ++ ChatColor[] colors = new ChatColor[step]; ++ int stepR = Math.abs(start.getRed() - end.getRed()) / (step - 1); ++ int stepG = Math.abs(start.getGreen() - end.getGreen()) / (step - 1); ++ int stepB = Math.abs(start.getBlue() - end.getBlue()) / (step - 1); ++ int[] direction = new int[] { ++ start.getRed() < end.getRed() ? +1 : -1, ++ start.getGreen() < end.getGreen() ? +1 : -1, ++ start.getBlue() < end.getBlue() ? +1 : -1 ++ }; ++ ++ for (int i = 0; i < step; i++) { ++ Color color = new Color(start.getRed() + ((stepR * i) * direction[0]), start.getGreen() + ((stepG * i) * direction[1]), start.getBlue() + ((stepB * i) * direction[2])); ++ if (SUPPORTS_RGB(protocol)) { ++ colors[i] = ChatColor.of(color); ++ } else { ++ colors[i] = getClosestColor(color); ++ } ++ } ++ ++ return colors; ++ } ++ ++ /** ++ * Returns the closest legacy color from an rgb color ++ * ++ * @param color The color we want to transform ++ * @since 1.0.0 ++ */ ++ @Nonnull ++ private static ChatColor getClosestColor(Color color) { ++ Color nearestColor = null; ++ double nearestDistance = Integer.MAX_VALUE; ++ ++ for (Color constantColor : COLORS.keySet()) { ++ double distance = Math.pow(color.getRed() - constantColor.getRed(), 2) + Math.pow(color.getGreen() - constantColor.getGreen(), 2) + Math.pow(color.getBlue() - constantColor.getBlue(), 2); ++ if (nearestDistance > distance) { ++ nearestColor = constantColor; ++ nearestDistance = distance; ++ } ++ } ++ return COLORS.get(nearestColor); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java +new file mode 100644 +index 000000000..c1f05cd0a +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java +@@ -0,0 +1,33 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.awt.*; ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++/** ++ * Represents a gradient color pattern which can be applied to a String. ++ */ ++public class GradientPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); ++ ++ /** ++ * Applies a gradient pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String start = matcher.group(1); ++ String end = matcher.group(3); ++ String content = matcher.group(2); ++ string = string.replace(matcher.group(), IridiumColorAPI.color(content, new Color(Integer.parseInt(start, 16)), new Color(Integer.parseInt(end, 16)), protocol)); ++ } ++ return string; ++ } ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java +new file mode 100644 +index 000000000..5457ead64 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java +@@ -0,0 +1,17 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++/** ++ * Represents a color pattern which can be applied to a String. ++ */ ++public interface Pattern { ++ ++ /** ++ * Applies this pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ String process(String string, int protocol); ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java +new file mode 100644 +index 000000000..792e9f987 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++public class RainbowPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(.*?)"); ++ ++ /** ++ * Applies a rainbow pattern to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String saturation = matcher.group(1); ++ String content = matcher.group(2); ++ string = string.replace(matcher.group(), IridiumColorAPI.rainbow(content, Float.parseFloat(saturation), protocol)); ++ } ++ return string; ++ } ++ ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java +new file mode 100644 +index 000000000..0b039c797 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java +@@ -0,0 +1,29 @@ ++package dev._2lstudios.flamecord.utils.iridiumcolorapi.patterns; ++ ++import java.util.regex.Matcher; ++ ++import dev._2lstudios.flamecord.utils.iridiumcolorapi.IridiumColorAPI; ++ ++public class SolidPattern implements Pattern { ++ ++ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("|#\\{([0-9A-Fa-f]{6})}"); ++ ++ /** ++ * Applies a solid RGB color to the provided String. ++ * Output might me the same as the input if this pattern is not present. ++ * ++ * @param string The String to which this pattern should be applied to ++ * @return The new String with applied pattern ++ */ ++ public String process(String string, int protocol) { ++ Matcher matcher = pattern.matcher(string); ++ while (matcher.find()) { ++ String color = matcher.group(1); ++ if (color == null) color = matcher.group(2); ++ ++ string = string.replace(matcher.group(), IridiumColorAPI.getColor(color, protocol) + ""); ++ } ++ return string; ++ } ++ ++} +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 66a347542..58be68b02 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 +@@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; + + import dev._2lstudios.flamecord.FlameCord; + ++import dev._2lstudios.flamecord.configuration.FlameConfig; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); +- final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); + + Callback pingBack = new Callback() +@@ -338,7 +339,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection + ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); + } else + { +- pingBack.done( getPingInfo( motd, protocol ), null ); ++ // FlameCord - Custom motd system ++ // Get the configuration ++ final FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ String motd; ++ String protocolName; ++ ++ ServerPing.PlayerInfo[] sample = null; ++ ++ int maxPlayers = listener.getMaxPlayers(); ++ int onlinePlayers = bungee.getOnlineCount(); ++ ++ if (config.isFakePlayersEnabled()) { ++ onlinePlayers += config.getFakePlayersAmount(onlinePlayers); ++ } ++ ++ if (config.isMaxPlayersEnabled()) { ++ maxPlayers = config.isMaxPlayersOneMore() ? onlinePlayers + 1 : config.getMaxPlayersAmount(); ++ } ++ ++ if (config.isMotdEnabled()) { ++ motd = config.getMOTD(maxPlayers, onlinePlayers, protocol); ++ } else { ++ motd = ( forced != null ) ? forced.getMotd() : listener.getMotd(); ++ } ++ ++ if (config.isProtocolEnabled()) { ++ protocolName = config.getProtocolName(maxPlayers, onlinePlayers); ++ } else { ++ protocolName = bungee.getName() + " " + bungee.getGameVersion(); ++ } ++ ++ int customProtocol = config.isProtocolEnabled() && config.isProtocolAlwaysShow() ? -1 : protocol; ++ ++ if (config.isSampleEnabled()) { ++ final UUID fakeUuid = new UUID(0, 0); ++ final String[] sampleString = config.getSample(maxPlayers, onlinePlayers, protocol); ++ ++ sample = new ServerPing.PlayerInfo[sampleString.length]; ++ ++ for (int i = 0; i < sampleString.length; i++) { ++ sample[i] = new ServerPing.PlayerInfo(sampleString[i], fakeUuid); ++ } ++ } ++ ++ pingBack.done( new ServerPing( ++ new ServerPing.Protocol( protocolName, customProtocol ), ++ new ServerPing.Players( maxPlayers, onlinePlayers, sample ), ++ motd, BungeeCord.getInstance().config.getFaviconObject() ), null ); ++ // FlameCord end - Custom motd system + } + + thisState = State.PING; +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch new file mode 100644 index 00000000..5e56fbf5 --- /dev/null +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -0,0 +1,46 @@ +From 62bf8051431b5035171c900d729a1c175fcda639 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 24 Feb 2022 23:41:57 -0300 +Subject: [PATCH] TCP Fast Open + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index b41ee92cc..14665b1f6 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration extends FlameConfig { ++ // FlameCord - TCP Fast Open ++ @Getter ++ private int tcpFastOpen = 3; ++ + public String getMOTD(int maxPlayers, int onlinePlayers, int protocol) { + String motd; + +@@ -127,6 +131,8 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersAmount = setIfUnexistant("custom-motd.fakeplayers.amount", this.fakePlayersAmount, configuration); + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + ++ this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ + save(configuration, configurationFile); + } + } +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 a4c3bd710..ffea15992 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 +@@ -194,6 +194,8 @@ public class PipelineUtils + // IP_TOS is not supported (Windows XP / Windows Server 2003) + } + ch.config().setOption( ChannelOption.TCP_NODELAY, true ); ++ // FlameCord - TCP Fast Open ++ ch.config().setOption( ChannelOption.TCP_FASTOPEN, FlameCord.getInstance().getFlameCordConfiguration().getTcpFastOpen() ); + ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); + ch.config().setWriteBufferWaterMark( MARK ); + +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch new file mode 100644 index 00000000..ca0779d9 --- /dev/null +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -0,0 +1,1989 @@ +From 405f365b733a8d8a322b0426ef103cdc7774cffe Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 4 Mar 2022 13:35:53 -0300 +Subject: [PATCH] Antibot System + + +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +index 20edd9001..f48f1e60b 100644 +--- a/flamecord/pom.xml ++++ b/flamecord/pom.xml +@@ -30,6 +30,17 @@ + ${project.version} + compile + ++ ++ com.maxmind.db ++ maxmind-db ++ 2.0.0 ++ ++ ++ io.netty ++ netty-handler ++ ${netty.version} ++ compile ++ + + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +index 676ba95b9..3824cc533 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +@@ -1,8 +1,16 @@ + package dev._2lstudios.flamecord; + ++import java.io.IOException; + import java.util.Collection; ++import java.util.Iterator; ++import java.util.concurrent.ConcurrentHashMap; ++import java.util.logging.Level; + import java.util.logging.Logger; + ++import dev._2lstudios.flamecord.antibot.AddressDataManager; ++import dev._2lstudios.flamecord.antibot.CheckManager; ++import dev._2lstudios.flamecord.antibot.LoggerWrapper; ++import dev._2lstudios.flamecord.antibot.StatsData; + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +@@ -13,8 +21,13 @@ import net.md_5.bungee.config.YamlConfiguration; + public class FlameCord { + @Getter + private static FlameCord instance; ++ private static Runtime runtime; + + public static void initialize(final Logger logger, final Collection whitelistedAddresses) { ++ if (FlameCord.runtime == null) { ++ FlameCord.runtime = Runtime.getRuntime(); ++ } ++ + if (FlameCord.instance == null) { + FlameCord.instance = new FlameCord(); + } +@@ -31,6 +44,16 @@ public class FlameCord { + @Getter + private MessagesConfiguration messagesConfiguration; + ++ // FlameCord - Antibot System ++ @Getter ++ private AddressDataManager addressDataManager; ++ @Getter ++ private CheckManager checkManager; ++ @Getter ++ private StatsData statsData; ++ @Getter ++ private LoggerWrapper loggerWrapper; ++ + public void reload(final Logger logger, final Collection whitelistedAddresses) { + final ConfigurationProvider configurationProvider = ConfigurationProvider.getProvider(YamlConfiguration.class); + +@@ -39,5 +62,106 @@ public class FlameCord { + // FlameCord - Module System + this.modulesConfiguration = new ModulesConfiguration(configurationProvider); + this.messagesConfiguration = new MessagesConfiguration(logger, configurationProvider); ++ ++ // FlameCord - Antibot System ++ if (checkManager != null) checkManager.unload(); ++ this.loggerWrapper = new LoggerWrapper(Logger.getLogger("BungeeCord")); ++ this.addressDataManager = new AddressDataManager(); ++ this.checkManager = new CheckManager(addressDataManager, flameCordConfiguration); ++ this.statsData = new StatsData(); ++ ++ // Initialize antibot firewall ipset ++ if (flameCordConfiguration.isAntibotFirewallIpset()) { ++ runLinuxCommand("apt install iptables -y"); // Install iptables ++ runLinuxCommand("apt install ipset -y"); // Install ipset ++ runLinuxCommand("ipset destroy flamecord-firewall"); // Delete old FlameCord set ++ runLinuxCommand("ipset create flamecord-firewall hash:ip timeout 60"); // Create new FlameCord set ++ runLinuxCommand("iptables -I INPUT -m set --match-set flamecord-firewall src -j DROP"); // Create iptables rule to DROP ++ ++ // Thread to run queued firewall linux commands ++ new Thread(() -> { ++ FlameCord flameCord = FlameCord.getInstance(); ++ ++ while (!flameCord.isShuttingDown()) { ++ flameCord.runQueuedLinuxCommands(); ++ ++ try { ++ Thread.sleep(1000); ++ } catch (InterruptedException e) { ++ // Ignore ++ } ++ } ++ }).start(); ++ } ++ } ++ ++ private boolean shutdown = false; ++ ++ public boolean isShuttingDown() { ++ return shutdown; ++ } ++ ++ public void shutdown() { ++ this.shutdown = true; ++ } ++ ++ /** ++ * Utility to run a Linux commands for iptables. ++ * @param command ++ */ ++ public void runLinuxCommand(String command) { ++ try { ++ runtime.exec("/bin/sh -c " + command); ++ } catch (IOException e) { ++ /* ++ * Windows throws exception. ++ */ ++ } ++ } ++ ++ // Commands to execute in the queue ++ private Collection commandQueue = ConcurrentHashMap.newKeySet(); ++ ++ // Boolean for when the commands are processing ++ private boolean processing = false; ++ ++ /** ++ * Add command to the linux command queue ++ * @param command ++ */ ++ public void queueLinuxCommand(String command) { ++ commandQueue.add(command); ++ } ++ ++ /** ++ * Run the queued linux commands ++ */ ++ public void runQueuedLinuxCommands() { ++ if (!commandQueue.isEmpty() && !processing) { ++ processing = true; ++ ++ try { ++ Iterator iterator = commandQueue.iterator(); ++ StringBuilder commands = new StringBuilder(); ++ int ranCommands = 0; ++ ++ while (iterator.hasNext()) { ++ String command = iterator.next(); ++ ++ if (ranCommands++ > 0) { ++ commands.append(" && "); ++ } ++ ++ commands.append(command); ++ iterator.remove(); ++ } ++ ++ runLinuxCommand(commands.toString()); ++ ++ getLoggerWrapper().log(Level.INFO, "Blacklisted " + ranCommands + " ips from the kernel with IPSet"); ++ } finally { ++ processing = false; ++ } ++ } + } + } +\ No newline at end of file +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java +new file mode 100644 +index 000000000..0295ea89d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java +@@ -0,0 +1,48 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.Collection; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class AccountsCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; ++ ++ public AccountsCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress, final String nickname) { ++ if (config.getAntibotAccountsWhitelist().contains(nickname)) { ++ return false; ++ } ++ ++ if (config.isAntibotAccountsEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ final Collection nicknames = addressData.getNicknames(); ++ ++ if (nicknames.size() > config.getAntibotAccountsLimit()) { ++ nicknames.remove(nickname); ++ ++ if ( config.isAntibotAccountsLog() ) ++ { ++ logger.log( Level.INFO, "[FlameCord] [{0}] has too many accounts", remoteAddress ); ++ } ++ ++ if (config.isAntibotAccountsFirewall()) { ++ addressData.firewall("Too many accounts"); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java +new file mode 100644 +index 000000000..7c7899830 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java +@@ -0,0 +1,165 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.util.Collection; ++import java.util.HashSet; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class AddressData { ++ private FlameCordConfiguration config; ++ private StatsData statsData; ++ private Collection nicknames = null; ++ private final String hostString; ++ private String lastNickname = ""; ++ private String country = null; ++ private String firewallReason = null; ++ private long lastPing = 0; ++ private long penultimateConnection = 0; ++ private long lastConnection = 0; ++ private long lastFirewall = 0; ++ private int pingsSecond = 0; ++ private int totalPings = 0; ++ private int connectionsSecond = 0; ++ private int totalConnections = 0; ++ ++ public AddressData(final String hostString) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.statsData = FlameCord.getInstance().getStatsData(); ++ this.hostString = hostString; ++ } ++ ++ public Collection getNicknames() { ++ if (nicknames == null) nicknames = new HashSet<>(); ++ ++ return nicknames; ++ } ++ ++ public String getLastNickname() { ++ return lastNickname; ++ } ++ ++ public void addNickname(final String nickname) { ++ if (nicknames == null) nicknames = new HashSet<>(); ++ ++ if (!lastNickname.equals(nickname)) { ++ this.lastNickname = nickname; ++ this.totalConnections = 1; ++ } ++ ++ this.nicknames.add(nickname); ++ } ++ ++ public long getPenultimateConnection() { ++ return penultimateConnection; ++ } ++ ++ public long getTimeSincePenultimateConnection() { ++ return System.currentTimeMillis() - penultimateConnection; ++ } ++ ++ public long getLastConnection() { ++ return lastConnection; ++ } ++ ++ public long getTimeSinceLastConnection() { ++ return System.currentTimeMillis() - lastConnection; ++ } ++ ++ private void updatePingsSecond() { ++ if (System.currentTimeMillis() - lastPing >= 1000) { ++ pingsSecond = 0; ++ } ++ } ++ ++ public int getPingsSecond() { ++ updatePingsSecond(); ++ return pingsSecond; ++ } ++ ++ public void addPing() { ++ statsData.addPing(); ++ updatePingsSecond(); ++ lastPing = System.currentTimeMillis(); ++ pingsSecond++; ++ totalPings++; ++ } ++ ++ public int getTotalPings() { ++ return totalPings; ++ } ++ ++ private void updateConnectionsSecond() { ++ if (System.currentTimeMillis() - lastConnection >= 1000) { ++ connectionsSecond = 0; ++ } ++ } ++ ++ public int getConnectionsSecond() { ++ updateConnectionsSecond(); ++ return connectionsSecond; ++ } ++ ++ public void addConnection() { ++ final long currentTime = System.currentTimeMillis(); ++ ++ statsData.addConnection(); ++ updateConnectionsSecond(); ++ penultimateConnection = lastConnection == 0 ? currentTime : lastConnection; ++ lastConnection = currentTime; ++ connectionsSecond++; ++ totalConnections++; ++ } ++ ++ public int getTotalConnections() { ++ return totalConnections; ++ } ++ ++ public String getHostString() { ++ return hostString; ++ } ++ ++ public boolean isFirewalled() { ++ return System.currentTimeMillis() - lastFirewall < config ++ .getAntibotFirewallExpire() * 1000; ++ } ++ ++ public void firewall(String reason) { ++ if (!FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewallWhitelist().contains(hostString)) { ++ this.lastFirewall = System.currentTimeMillis(); ++ this.firewallReason = reason; ++ ++ // Queue the firewall as a ipset linux command ++ FlameCord.getInstance().queueLinuxCommand("ipset add flamecord-firewall " + hostString); ++ } ++ } ++ ++ public void unfirewall() { ++ this.lastFirewall = 0; ++ this.firewallReason = null; ++ } ++ ++ public String getFirewallReason() { ++ if (isFirewalled()) { ++ return firewallReason; ++ } ++ ++ return null; ++ } ++ ++ public void setTotalConnections(final int totalConnections) { ++ this.totalConnections = totalConnections; ++ } ++ ++ public String setCountry(final String country) { ++ return this.country = country; ++ } ++ ++ public String getCountry() { ++ return country; ++ } ++ ++ public boolean hasNickname(final String nickname) { ++ return nicknames.contains(nickname); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java +new file mode 100644 +index 000000000..bd14f56a1 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java +@@ -0,0 +1,48 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++ ++public class AddressDataManager { ++ private Map addressData = new HashMap<>(); ++ ++ public String sanitizeAddress(String text) { ++ // Remove the port ++ text = text.split(":")[0]; ++ ++ // Check if first character is a slash ++ if (text.startsWith("/")) { ++ // Remove the first character ++ text = text.substring(1); ++ } ++ ++ return text; ++ } ++ ++ public AddressData getAddressData(String addressString) { ++ addressString = sanitizeAddress(addressString); ++ ++ if (addressData.containsKey(addressString)) { ++ return addressData.get(addressString); ++ } else { ++ AddressData data = new AddressData(addressString); ++ ++ addressData.put(addressString, data); ++ ++ return data; ++ } ++ } ++ ++ public AddressData getAddressData(final SocketAddress address) { ++ final InetSocketAddress iNetSocketAddress = (InetSocketAddress) address; ++ final String addressString = iNetSocketAddress.getHostString(); ++ ++ return getAddressData(addressString); ++ } ++ ++ public int getAddresCount() { ++ return addressData.size(); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java +new file mode 100644 +index 000000000..1503ac954 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java +@@ -0,0 +1,40 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import lombok.Getter; ++ ++public class CheckManager { ++ @Getter ++ private final AccountsCheck accountsCheck; ++ @Getter ++ private final CountryCheck countryCheck; ++ @Getter ++ private final FastChatCheck fastChatCheck; ++ @Getter ++ private final NicknameCheck nicknameCheck; ++ @Getter ++ private final PasswordCheck passwordCheck; ++ @Getter ++ private final RatelimitCheck ratelimitCheck; ++ @Getter ++ private final ReconnectCheck reconnectCheck; ++ @Getter ++ private final PacketsCheck packetsCheck; ++ ++ public CheckManager(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { ++ this.accountsCheck = new AccountsCheck(addressDataManager); ++ this.countryCheck = new CountryCheck(addressDataManager); ++ this.fastChatCheck = new FastChatCheck(addressDataManager); ++ this.nicknameCheck = new NicknameCheck(addressDataManager); ++ this.passwordCheck = new PasswordCheck(addressDataManager); ++ this.ratelimitCheck = new RatelimitCheck(addressDataManager); ++ this.reconnectCheck = new ReconnectCheck(addressDataManager); ++ this.packetsCheck = new PacketsCheck(); ++ ++ this.countryCheck.load(); ++ } ++ ++ public void unload() { ++ this.countryCheck.unload(); ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java +new file mode 100644 +index 000000000..fdfd9c8d7 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java +@@ -0,0 +1,148 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.io.File; ++import java.io.IOException; ++import java.io.InputStream; ++import java.net.InetAddress; ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.net.URL; ++import java.nio.file.Files; ++import java.util.logging.Level; ++ ++import com.maxmind.db.CHMCache; ++import com.maxmind.db.MaxMindDbConstructor; ++import com.maxmind.db.MaxMindDbParameter; ++import com.maxmind.db.Reader; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class CountryCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; ++ private Reader maxMindReader; ++ ++ public CountryCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public void download(final URL url, final File file) throws Exception { ++ try (InputStream in = url.openStream()) { ++ Files.copy(in, file.toPath()); ++ } ++ } ++ ++ public void load() { ++ final File file = new File("GeoLite2-Country.mmdb"); ++ ++ try { ++ if (!file.exists()) { ++ System.out.println("Starting download of MaxMindDB (This will take some seconds...)"); ++ download(new URL("https://git.io/GeoLite2-Country.mmdb"), file); ++ } ++ ++ this.maxMindReader = new Reader(file, new CHMCache()); ++ } catch (final Exception exception) { ++ System.out.println("MaxMindDB was not able to download!"); ++ } ++ } ++ ++ public void unload() { ++ try { ++ if (this.maxMindReader != null) { ++ this.maxMindReader.close(); ++ } ++ } catch (final IOException ex) { ++ // Ignored ++ } ++ } ++ ++ private boolean isBlacklisted(final FlameCordConfiguration config, final String isoCode) { ++ for (final String blacklisted : config.getAntibotCountryBlacklist()) { ++ if (isoCode.contains(blacklisted)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public static class LookupResult { ++ private final Country country; ++ ++ @MaxMindDbConstructor ++ public LookupResult(@MaxMindDbParameter(name = "country") final Country country) { ++ this.country = country; ++ } ++ ++ public Country getCountry() { ++ return this.country; ++ } ++ } ++ ++ public static class Country { ++ private final String isoCode; ++ ++ @MaxMindDbConstructor ++ public Country(@MaxMindDbParameter(name = "iso_code") final String isoCode) { ++ this.isoCode = isoCode; ++ } ++ ++ public String getIsoCode() { ++ return this.isoCode; ++ } ++ } ++ ++ public String getIsoCode(final InetAddress address) { ++ try { ++ final LookupResult lookupResult = maxMindReader.get(address, LookupResult.class); ++ ++ if (lookupResult == null) { ++ return "LOCAL"; ++ } else { ++ final Country country = lookupResult.getCountry(); ++ final String isoCode = country.getIsoCode(); ++ ++ return isoCode; ++ } ++ } catch (final Exception exception) { ++ // Ignored ++ } ++ ++ return null; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress) { ++ if (config.isAntibotCountryEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ final String addressCountry = addressData.getCountry(); ++ final String country; ++ ++ if (addressCountry != null) { ++ country = addressCountry; ++ } else { ++ country = getIsoCode(((InetSocketAddress) remoteAddress).getAddress()); ++ addressData.setCountry(country); ++ } ++ ++ if (country != null && isBlacklisted(config, country)) { ++ if (config.isAntibotCountryLog()) { ++ logger.log(Level.INFO, ++ "[FlameCord] [{0}] has his country blocked from the server", remoteAddress); ++ } ++ ++ if (config.isAntibotCountryFirewall()) { ++ addressData.firewall("Blacklisted country"); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java +new file mode 100644 +index 000000000..e21408873 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java +@@ -0,0 +1,39 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class FastChatCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private final AddressDataManager addressDataManager; ++ ++ public FastChatCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress) { ++ if (config.isAntibotFastChatEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ ++ if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { ++ if (config.isAntibotFastChatLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is chatting too fast", remoteAddress); ++ } ++ ++ if (config.isAntibotFastChatFirewall()) { ++ addressData.firewall("Too fast chatting"); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java +new file mode 100644 +index 000000000..df26a3634 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ ++public class LoggerWrapper { ++ private Logger logger; ++ ++ // Last time a log was done ++ private long lastLog = System.currentTimeMillis(); ++ ++ public LoggerWrapper(Logger logger) { ++ this.logger = logger; ++ } ++ ++ public void log(Level level, String msg, Object ...params) { ++ long currentTime = System.currentTimeMillis(); ++ ++ // Throttle logs by 100ms ++ if (currentTime - lastLog > 100) { ++ // Set the last log ++ lastLog = currentTime; ++ ++ // Log the text ++ logger.log(level, msg, params); ++ } ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java +new file mode 100644 +index 000000000..1b35fba5d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java +@@ -0,0 +1,52 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class NicknameCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; ++ ++ public NicknameCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ private boolean isBlacklisted(final FlameCordConfiguration config, final String nickname) { ++ String lowerNickname = nickname.toLowerCase(); ++ ++ for (final String blacklisted : config.getAntibotNicknameBlacklist()) { ++ if (lowerNickname.contains(blacklisted)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress) { ++ if (config.isAntibotNicknameEnabled()) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ final String nickname = addressData.getLastNickname(); ++ ++ if (isBlacklisted(config, nickname)) { ++ if (config.isAntibotNicknameLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", remoteAddress); ++ } ++ ++ if (config.isAntibotNicknameFirewall()) { ++ addressData.firewall("Blacklisted nickname [" + nickname + "]"); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java +new file mode 100644 +index 000000000..a7bd9f153 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java +@@ -0,0 +1,69 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.enums.PacketsCheckResult; ++import dev._2lstudios.flamecord.enums.PacketsViolationReason; ++import dev._2lstudios.flamecord.utils.ProtocolUtil; ++import io.netty.buffer.ByteBuf; ++ ++public class PacketsCheck { ++ private Map packetsData = new HashMap<>(); ++ ++ // Time since the last clear passed ++ private long lastClear = System.currentTimeMillis(); ++ ++ public PacketsData getData(SocketAddress address) { ++ String ip = address.toString(); ++ ++ if (System.currentTimeMillis() - lastClear >= 60000) { ++ packetsData.clear(); ++ this.lastClear = System.currentTimeMillis(); ++ } ++ ++ PacketsData data; ++ ++ if (packetsData.containsKey(ip)) { ++ data = packetsData.get(ip); ++ } else { ++ data = new PacketsData(address); ++ packetsData.put(ip, data); ++ } ++ ++ return data; ++ } ++ ++ public PacketsCheckResult check(SocketAddress socketAddress, ByteBuf byteBuf) { ++ FlameCordConfiguration config = FlameCord.getInstance().getFlameCordConfiguration(); ++ ++ if (!config.isAntibotPacketsEnabled()) { ++ return PacketsCheckResult.NONE; ++ } ++ ++ PacketsData packetsData = getData(socketAddress); ++ int length = byteBuf.readableBytes(); ++ int index = byteBuf.readerIndex(); ++ int packetId = ProtocolUtil.readVarInt(byteBuf); ++ byteBuf.readerIndex(index); ++ ++ packetsData.addVls(length * config.getAntibotPacketsVlsPerByte(), PacketsViolationReason.SIZE, packetId); ++ packetsData.addVls(config.getAntibotPacketsVlsPerPacket(), PacketsViolationReason.RATE, packetId); ++ ++ double vls = packetsData.getPacketsVls(); ++ ++ if (vls >= config.getAntibotPacketsVlsToKick()) { ++ return PacketsCheckResult.KICK; ++ } else if (vls >= config.getAntibotPacketsVlsToCancel()) { ++ return PacketsCheckResult.CANCEL; ++ } else { ++ return PacketsCheckResult.NONE; ++ } ++ } ++ ++ public void printPackets(SocketAddress remoteAddress) { ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java +new file mode 100644 +index 000000000..7189a7f37 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java +@@ -0,0 +1,115 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Map.Entry; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.enums.PacketsViolationReason; ++ ++public class PacketsData { ++ // The address related to this data ++ private SocketAddress address; ++ ++ // The vls of the current address ++ private double packetsVls = 0; ++ ++ // The vls of the current address because of size ++ private double packetsVlsSize = 0; ++ ++ // The vls of the current address because of rate ++ private double packetsVlsRate = 0; ++ ++ // The last time vls was calculated ++ private long lastVlsCalculated = System.currentTimeMillis(); ++ ++ // The vls by packet ids ++ private Map vlsByPacketId = new HashMap<>(); ++ ++ // If cancellation was printed ++ private boolean cancelPrinted = false; ++ ++ public PacketsData(SocketAddress address) { ++ this.address = address; ++ } ++ ++ public double simplify(double number) { ++ return (double) (int) (number * 1000) / 1000; ++ } ++ ++ public void printKick() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] was kicked because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); ++ } ++ } ++ ++ public void printCancel() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog() && !cancelPrinted) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] was cancelled because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); ++ this.cancelPrinted = true; ++ } ++ } ++ ++ public void printPackets() { ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() ++ && simplify(this.packetsVls) > 0) { ++ System.out ++ .println("[FlameCord] [" + address ++ + "] debug is enabled, showing stats (Total: " + simplify(packetsVls) + "vls Size: " ++ + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); ++ for (Entry entry : this.vlsByPacketId.entrySet()) { ++ System.out.print(entry.getKey() + "-" + simplify(entry.getValue()) + "vls, "); ++ } ++ System.out.println(""); ++ } ++ } ++ ++ public double getPacketsVls() { ++ if (System.currentTimeMillis() - lastVlsCalculated >= 1000) { ++ printPackets(); ++ ++ this.cancelPrinted = false; ++ this.packetsVls = 0; ++ this.packetsVlsSize = 0; ++ this.packetsVlsRate = 0; ++ this.vlsByPacketId.clear(); ++ this.lastVlsCalculated = System.currentTimeMillis(); ++ } ++ ++ return packetsVls; ++ } ++ ++ public void addVls(double packetsVls, PacketsViolationReason reason, int packetId) { ++ this.packetsVls += packetsVls; ++ this.vlsByPacketId.put(packetId, this.vlsByPacketId.getOrDefault(packetId, 0.0) + packetsVls); ++ ++ switch (reason) { ++ case SIZE: { ++ this.packetsVlsSize += packetsVls; ++ break; ++ } ++ case RATE: { ++ this.packetsVlsRate += packetsVls; ++ break; ++ } ++ default: { ++ break; ++ } ++ } ++ } ++ ++ public double getPacketsVlsSize() { ++ return packetsVlsSize; ++ } ++ ++ public double getPacketsVlsRate() { ++ return packetsVlsRate; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java +new file mode 100644 +index 000000000..68555de34 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java +@@ -0,0 +1,69 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class PasswordCheck { ++ private FlameCordConfiguration config; ++ private AddressDataManager addressDataManager; ++ private LoggerWrapper logger; ++ private String lastNickname = ""; ++ private String lastPassword = ""; ++ private int repeatCount = 0; ++ ++ public PasswordCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ private void updatePassword(final FlameCordConfiguration config, final String nickname, final String password) { ++ if (!nickname.equals(lastNickname)) { ++ if (password.equals(lastPassword)) { ++ if (repeatCount < config.getAntibotPasswordLimit()) { ++ repeatCount++; ++ } ++ } else if (repeatCount > 0) { ++ repeatCount--; ++ } ++ } ++ ++ lastNickname = nickname; ++ lastPassword = password; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress, final String passwordMessage) { ++ if (config.isAntibotPasswordEnabled()) { ++ if (passwordMessage.contains("/login ") || passwordMessage.contains("/l ") ++ || passwordMessage.contains("/register ") ++ || passwordMessage.contains("/reg ")) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ final String nickname = addressData.getLastNickname(); ++ final String password = passwordMessage.split(" ")[1]; ++ ++ updatePassword(config, nickname, password); ++ ++ if (repeatCount >= config.getAntibotPasswordLimit()) { ++ if (config.isAntibotPasswordLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has entered a repeated password", remoteAddress); ++ } ++ ++ if (config.isAntibotPasswordFirewall()) { ++ addressData.firewall("Repeated password"); ++ } ++ ++ return true; ++ } ++ } ++ } ++ ++ return false; ++ } ++ ++ public int getRepeatCount() { ++ return repeatCount; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java +new file mode 100644 +index 000000000..51c1866ec +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java +@@ -0,0 +1,52 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class RatelimitCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; ++ ++ public RatelimitCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress, int protocol) { ++ if (config.isAntibotRatelimitEnabled()) { ++ AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ ++ if (config.getAntibotRatelimitWhitelist().contains(addressData.getHostString())) { ++ return false; ++ } ++ ++ if (addressData.getConnectionsSecond() >= config.getAntibotRatelimitConnectionsPerSecond() ++ || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { ++ if (config.isAntibotRatelimitLog()) { ++ if (protocol == 1) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is pinging too fast", remoteAddress); ++ } else { ++ logger.log(Level.INFO, "[FlameCord] [{0}] is connecting too fast", remoteAddress); ++ } ++ } ++ ++ if (config.isAntibotRatelimitFirewall()) { ++ if (protocol == 1) { ++ addressData.firewall("Too many pings"); ++ } else { ++ addressData.firewall("Too many connections"); ++ } ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java +new file mode 100644 +index 000000000..d38ffc9e3 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java +@@ -0,0 +1,53 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.net.SocketAddress; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++ ++public class ReconnectCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; ++ private AddressDataManager addressDataManager; ++ private int connections = 0; ++ private long lastConnection = 0; ++ ++ public ReconnectCheck(final AddressDataManager addressDataManager) { ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public boolean check(final SocketAddress remoteAddress) { ++ if (config.isAntibotReconnectEnabled()) { ++ final long currentTime = System.currentTimeMillis(); ++ ++ if (currentTime - lastConnection > config.getAntibotReconnectConnectionThresholdLimit()) { ++ lastConnection = currentTime; ++ connections = 0; ++ } ++ ++ if (++connections > config.getAntibotReconnectConnectionThreshold()) { ++ final AddressData addressData = addressDataManager.getAddressData(remoteAddress); ++ final boolean needsAttempts = addressData.getTotalConnections() < config.getAntibotReconnectAttempts() ++ || addressData.getTotalPings() < config.getAntibotReconnectPings(); ++ final boolean tooSlow = addressData.getTimeSincePenultimateConnection() > config ++ .getAntibotReconnectMaxTime(); ++ ++ if (tooSlow) { ++ if (config.isAntibotReconnectLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] has to reconnect to join", remoteAddress); ++ } ++ ++ addressData.setTotalConnections(0); ++ return true; ++ } else { ++ return needsAttempts; ++ } ++ } ++ } ++ ++ return false; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java +new file mode 100644 +index 000000000..44d773abe +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java +@@ -0,0 +1,75 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++public class StatsData { ++ // Time of the last second ++ private long lastSecond = System.currentTimeMillis(); ++ ++ // Total pings and connections ++ private int totalPings = 0; ++ private int totalConnections = 0; ++ ++ // Current second connections and pings ++ private int currentPings = 0; ++ private int currentConnections = 0; ++ ++ // Last second connections and pings ++ private int lastPings = 0; ++ private int lastConnections = 0; ++ ++ public void resetData() { ++ // Get current time ++ long currentTime = System.currentTimeMillis(); ++ ++ // Check if one second passed ++ if (currentTime - lastSecond > 1000) { ++ // Set the last second to this one ++ lastSecond = currentTime; ++ ++ // Reset the data ++ lastPings = currentPings; ++ lastConnections = currentConnections; ++ currentPings = 0; ++ currentConnections = 0; ++ } ++ } ++ ++ public void addPing() { ++ resetData(); ++ currentPings++; ++ totalPings++; ++ } ++ ++ public void addConnection() { ++ resetData(); ++ currentConnections++; ++ totalConnections++; ++ } ++ ++ public int getCurrentPings() { ++ resetData(); ++ return currentPings; ++ } ++ ++ public int getCurrentConnections() { ++ resetData(); ++ return currentConnections; ++ } ++ ++ public int getLastPings() { ++ resetData(); ++ return lastPings; ++ } ++ ++ public int getLastConnections() { ++ resetData(); ++ return lastConnections; ++ } ++ ++ public int getTotalPings() { ++ return totalPings; ++ } ++ ++ public int getTotalConnections() { ++ return totalConnections; ++ } ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 14665b1f6..0f12f4ae6 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,187 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration extends FlameConfig { ++ // Antibot accounts ++ @Getter ++ private boolean antibotAccountsEnabled = true; ++ @Getter ++ private boolean antibotAccountsFirewall = true; ++ @Getter ++ private int antibotAccountsLimit = 3; ++ @Getter ++ private boolean antibotAccountsLog = true; ++ @Getter ++ private Collection antibotAccountsWhitelist = Arrays.asList("Nickname"); ++ ++ // Antibot country ++ @Getter ++ private boolean antibotCountryEnabled = true; ++ @Getter ++ private boolean antibotCountryFirewall = true; ++ @Getter ++ private Collection antibotCountryBlacklist = Arrays.asList("CN", "HK", "RU", "IN", "TH", "ID", "DZ", "VN", "IR", "PK"); ++ @Getter ++ private Collection antibotFirewalledExceptions = Arrays.asList("BadPacketException", "QuietException", "IllegalStateConfig", "FastException"); ++ @Getter ++ private boolean antibotCountryLog = true; ++ ++ // Antibot fastchat ++ @Getter ++ private boolean antibotFastChatEnabled = true; ++ @Getter ++ private boolean antibotFastChatFirewall = true; ++ @Getter ++ private int antibotFastChatTime = 1000; ++ @Getter ++ private boolean antibotFastChatLog = true; ++ ++ // Antibot firewall ++ @Getter ++ private boolean antibotFirewallEnabled = true; ++ @Getter ++ private int antibotFirewallExpire = 60; ++ @Getter ++ private boolean antibotFirewallLog = true; ++ @Getter ++ private boolean antibotFirewallIpset = true; ++ @Getter ++ private Collection antibotFirewallWhitelist = Arrays.asList("127.0.0.1"); ++ ++ // Antibot nickname ++ @Getter ++ private boolean antibotNicknameEnabled = true; ++ @Getter ++ private boolean antibotNicknameFirewall = true; ++ @Getter ++ private Collection antibotNicknameBlacklist = Arrays.asList("mcstorm", "mcdown", "mcbot", "theresa_bot", "dropbot", "kingbot"); ++ @Getter ++ private boolean antibotNicknameLog = true; ++ ++ // Antibot password ++ @Getter ++ private boolean antibotPasswordEnabled = true; ++ @Getter ++ private boolean antibotPasswordFirewall = true; ++ @Getter ++ private int antibotPasswordLimit = 3; ++ @Getter ++ private boolean antibotPasswordLog = true; ++ ++ // Antibot ratelimit ++ @Getter ++ private boolean antibotRatelimitEnabled = true; ++ @Getter ++ private boolean antibotRatelimitFirewall = true; ++ @Getter ++ private int antibotRatelimitConnectionsPerSecond = 3; ++ @Getter ++ private int antibotRatelimitPingsPerSecond = 8; ++ @Getter ++ private boolean antibotRatelimitLog = true; ++ @Getter ++ private Collection antibotRatelimitWhitelist = Arrays.asList("127.0.0.1"); ++ ++ // Antibot reconnect ++ @Getter ++ private boolean antibotReconnectEnabled = true; ++ @Getter ++ private int antibotReconnectAttempts = 2; ++ @Getter ++ private int antibotReconnectPings = 0; ++ @Getter ++ private int antibotReconnectMaxTime = 10000; ++ @Getter ++ private int antibotReconnectConnectionThreshold = 1; ++ @Getter ++ private int antibotReconnectConnectionThresholdLimit = 8000; ++ @Getter ++ private boolean antibotReconnectLog = true; ++ ++ // Antibot packets ++ @Getter ++ private boolean antibotPacketsEnabled = true; ++ @Getter ++ private boolean antibotPacketsLog = true; ++ @Getter ++ private boolean antibotPacketsDebug = false; ++ @Getter ++ private double antibotPacketsVlsPerByte = 0.0017; ++ @Getter ++ private double antibotPacketsVlsPerPacket = 0.1; ++ @Getter ++ private double antibotPacketsVlsToKick = 100; ++ @Getter ++ private double antibotPacketsVlsToCancel = 25; ++ ++ public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { ++ // Antibot accounts ++ this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); ++ this.antibotAccountsFirewall = setIfUnexistant("antibot.accounts.firewall", this.antibotAccountsFirewall, config); ++ this.antibotAccountsLimit = setIfUnexistant("antibot.accounts.limit", this.antibotAccountsLimit, config); ++ this.antibotAccountsLog = setIfUnexistant("antibot.accounts.log", this.antibotAccountsLog, config); ++ this.antibotAccountsWhitelist = setIfUnexistant("antibot.accounts.whitelist", this.antibotAccountsWhitelist, config); ++ ++ // Antibot country ++ this.antibotCountryEnabled = setIfUnexistant("antibot.country.enabled", this.antibotCountryEnabled, config); ++ this.antibotCountryFirewall = setIfUnexistant("antibot.country.firewall", this.antibotCountryFirewall, config); ++ this.antibotCountryBlacklist = setIfUnexistant("antibot.country.blacklist", this.antibotCountryBlacklist, config); ++ this.antibotCountryLog = setIfUnexistant("antibot.country.log", this.antibotCountryLog, config); ++ ++ // Antibot fastchat ++ this.antibotFastChatEnabled = setIfUnexistant("antibot.fastchat.enabled", this.antibotFastChatEnabled, config); ++ this.antibotFastChatFirewall = setIfUnexistant("antibot.fastchat.firewall", this.antibotFastChatFirewall, config); ++ this.antibotFastChatTime = setIfUnexistant("antibot.fastchat.time", this.antibotFastChatTime, config); ++ this.antibotFastChatLog = setIfUnexistant("antibot.fastchat.log", this.antibotFastChatLog, config); ++ ++ // Antibot firewall ++ this.antibotFirewallEnabled = setIfUnexistant("antibot.firewall.enabled", this.antibotFirewallEnabled, config); ++ this.antibotFirewalledExceptions = setIfUnexistant("antibot.firewall.exceptions", this.antibotFirewalledExceptions, config); ++ this.antibotFirewallExpire = setIfUnexistant("antibot.firewall.time", this.antibotFirewallExpire, config); ++ this.antibotFirewallLog = setIfUnexistant("antibot.firewall.log", this.antibotFirewallLog, config); ++ this.antibotFirewallWhitelist = new HashSet<>( setIfUnexistant("antibot.firewall.whitelist", this.antibotFirewallWhitelist, config )); ++ this.antibotFirewallIpset = setIfUnexistant("antibot.firewall.ipset", this.antibotFirewallIpset, config); ++ ++ // Add local server ips to whitelist ++ this.antibotFirewallWhitelist.addAll(whitelistedAddresses); ++ ++ // Antibot nickname ++ this.antibotNicknameEnabled = setIfUnexistant("antibot.nickname.enabled", this.antibotNicknameEnabled, config); ++ this.antibotNicknameFirewall = setIfUnexistant("antibot.nickname.firewall", this.antibotNicknameFirewall, config); ++ this.antibotNicknameBlacklist = setIfUnexistant("antibot.nickname.blacklist", this.antibotNicknameBlacklist, config); ++ this.antibotNicknameLog = setIfUnexistant("antibot.nickname.log", this.antibotNicknameLog, config); ++ ++ // Antibot password ++ this.antibotPasswordEnabled = setIfUnexistant("antibot.password.enabled", this.antibotPasswordEnabled, config); ++ this.antibotPasswordFirewall = setIfUnexistant("antibot.password.firewall", this.antibotPasswordFirewall, config); ++ this.antibotPasswordLimit = setIfUnexistant("antibot.password.limit", this.antibotPasswordLimit, config); ++ this.antibotPasswordLog = setIfUnexistant("antibot.password.log", this.antibotPasswordLog, config); ++ ++ // Antibot ratelimit ++ this.antibotRatelimitEnabled = setIfUnexistant("antibot.ratelimit.enabled", this.antibotRatelimitEnabled, config); ++ this.antibotRatelimitFirewall = setIfUnexistant("antibot.ratelimit.firewall", this.antibotRatelimitFirewall, config); ++ this.antibotRatelimitConnectionsPerSecond = setIfUnexistant("antibot.ratelimit.connections-per-second", this.antibotRatelimitConnectionsPerSecond, config); ++ this.antibotRatelimitPingsPerSecond = setIfUnexistant("antibot.ratelimit.pings-per-second", this.antibotRatelimitPingsPerSecond, config); ++ this.antibotRatelimitLog = setIfUnexistant("antibot.ratelimit.log", this.antibotRatelimitLog, config); ++ this.antibotRatelimitWhitelist = new HashSet<>( setIfUnexistant("antibot.ratelimit.whitelist", this.antibotRatelimitWhitelist, config )); ++ ++ // Antibot reconnect ++ this.antibotReconnectEnabled = setIfUnexistant("antibot.reconnect.enabled", this.antibotReconnectEnabled, config); ++ this.antibotReconnectAttempts = setIfUnexistant("antibot.reconnect.attempts", this.antibotReconnectAttempts, config); ++ this.antibotReconnectPings = setIfUnexistant("antibot.reconnect.pings", this.antibotReconnectPings, config); ++ this.antibotReconnectMaxTime = setIfUnexistant("antibot.reconnect.max-time", this.antibotReconnectMaxTime, config); ++ this.antibotReconnectConnectionThreshold = setIfUnexistant("antibot.reconnect.connection-threshold", this.antibotReconnectConnectionThreshold, config); ++ this.antibotReconnectConnectionThresholdLimit = setIfUnexistant("antibot.reconnect.connection-threshold-limit", this.antibotReconnectConnectionThresholdLimit, config); ++ this.antibotReconnectLog = setIfUnexistant("antibot.reconnect.log", this.antibotReconnectLog, config); ++ ++ // Antibot packets ++ this.antibotPacketsEnabled = setIfUnexistant("antibot.packets.enabled", this.antibotPacketsEnabled, config); ++ this.antibotPacketsLog = setIfUnexistant("antibot.packets.log", this.antibotPacketsLog, config); ++ this.antibotPacketsDebug = setIfUnexistant("antibot.packets.debug", this.antibotPacketsDebug, config); ++ this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); ++ this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); ++ this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); ++ } ++ + // FlameCord - TCP Fast Open + @Getter + private int tcpFastOpen = 3; +@@ -132,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { + this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); + + this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); ++ ++ // FlameCord - Antibot System ++ loadAntibot(configuration, whitelistedAddresses); + + save(configuration, configurationFile); + } +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index ae1794385..6175d8e2d 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -80,6 +80,22 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); + setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + ++ // FlameCord start - Antibot System ++ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); ++ ++ setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); ++ setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); ++ setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); ++ // FlameCord end - Antibot System ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java +new file mode 100644 +index 000000000..285810ea1 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java +@@ -0,0 +1,5 @@ ++package dev._2lstudios.flamecord.enums; ++ ++public enum PacketsCheckResult { ++ KICK, CANCEL, NONE ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java +new file mode 100644 +index 000000000..c19c4965d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java +@@ -0,0 +1,5 @@ ++package dev._2lstudios.flamecord.enums; ++ ++public enum PacketsViolationReason { ++ SIZE, RATE ++} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java +new file mode 100644 +index 000000000..7f26e7a0d +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java +@@ -0,0 +1,27 @@ ++package dev._2lstudios.flamecord.utils; ++ ++import io.netty.buffer.ByteBuf; ++ ++public class ProtocolUtil { ++ private static int SEGMENT_BITS = 0x7F; ++ private static int CONTINUE_BIT = 0x80; ++ ++ public static int readVarInt(ByteBuf byteBuf) { ++ int value = 0; ++ int position = 0; ++ byte currentByte; ++ ++ while (byteBuf.isReadable()) { ++ currentByte = byteBuf.readByte(); ++ value |= (currentByte & SEGMENT_BITS) << position; ++ ++ if ((currentByte & CONTINUE_BIT) == 0) break; ++ ++ position += 7; ++ ++ if (position >= 32) throw new RuntimeException("VarInt is too big"); ++ } ++ ++ return value; ++ } ++} +\ No newline at end of file +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index 6316143f7..aa538f748 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder + throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); + } + } ++ ++ // FlameCord start - Antibot Packet Check ++ if (prot == protocol.TO_SERVER) { ++ dev._2lstudios.flamecord.antibot.PacketsCheck packetsCheck = FlameCord.getInstance().getCheckManager().getPacketsCheck(); ++ dev._2lstudios.flamecord.enums.PacketsCheckResult result = packetsCheck.check(ctx.channel().remoteAddress(), in); ++ ++ switch (result) { ++ case KICK: ++ packetsCheck.getData(ctx.channel().remoteAddress()).printKick(); ++ ++ in.skipBytes(in.readableBytes()); ++ ctx.close(); ++ return; ++ case CANCEL: ++ packetsCheck.getData(ctx.channel().remoteAddress()).printCancel(); ++ ++ in.skipBytes(in.readableBytes()); ++ return; ++ default: ++ break; ++ } ++ } ++ // FlameCord end - Antibot Packet Check + + ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy + + Object packetTypeInfo = null; + try + { ++ // FlameCord - Duplicate buf instead of Copy ++ slice = in.duplicate(); // Can't slice this one due to EntityMap :( ++ + // Waterfall start + if (in.readableBytes() == 0 && !server) { + return; +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 +index c9e45b915..022f94b2d 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +@@ -723,4 +723,8 @@ public enum Protocol + // Waterfall end + } + } ++ ++ public DirectionData getToServer() { ++ return TO_SERVER; ++ } + } +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +index c0d371426..403ccba98 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +@@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.ByteToMessageDecoder; + import io.netty.handler.codec.CorruptedFrameException; ++ + import java.util.List; + + public class Varint21FrameDecoder extends ByteToMessageDecoder + { +- + private static boolean DIRECT_WARNING; + + @Override +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +index fb81adee0..173b47f33 100644 +--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +@@ -4,6 +4,7 @@ import java.util.Collection; + import java.util.HashSet; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.antibot.StatsData; + import dev._2lstudios.flamecord.configuration.MessagesConfiguration; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.CommandSender; +@@ -27,9 +28,7 @@ private final BungeeCord bungeeCord; + + if (sender.hasPermission("flamecord.usage")) { + if (args.length > 0) { +- final String arg0 = args[0]; +- +- switch (arg0) { ++ switch (args[0]) { + case "reload": { + // FlameCord - Collect ips from servers + final Collection whitelistedAddresses = new HashSet<>(); +@@ -43,9 +42,44 @@ private final BungeeCord bungeeCord; + .fromLegacyText(messagesConfiguration.getTranslation("flamecord_reload"))); + break; + } ++ case "stats": { ++ StatsData statsData = FlameCord.getInstance().getStatsData(); ++ int totalPings = statsData.getTotalPings(); ++ int totalConnections = statsData.getTotalConnections(); ++ int lastPings = statsData.getLastPings(); ++ int lastConnections = statsData.getLastConnections(); ++ ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, lastPings, lastConnections))); ++ break; ++ } ++ case "firewall": { ++ if (args.length > 2) { ++ String ip = args[2]; ++ ++ switch (args[1]) { ++ case "add": { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).firewall("Blacklisted by command"); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_add", ip))); ++ break; ++ } ++ case "remove": { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ip).unfirewall(); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_remove", ip))); ++ break; ++ } ++ default: { ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); ++ break; ++ } ++ } ++ } else { ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_firewall_help"))); ++ } ++ ++ break; ++ } + default: { +- sender.sendMessage(TextComponent.fromLegacyText( +- messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); ++ sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_help", bungeeCord.getVersion()))); + break; + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 8994454c7..62712330e 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer + } catch (InterruptedException ignored) {} + } + ++ // FlameCord start - Antibot System ++ FlameCord.getInstance().shutdown(); ++ getLogger().info( "Shutting down FlameCord linux command thread" ); ++ // FlameCord end - Antibot System ++ + getLogger().info( "Thank you and goodbye" ); + // Need to close loggers after last message! + org.apache.logging.log4j.LogManager.shutdown(); // Waterfall +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 58be68b02..b88e64526 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 +@@ -22,8 +22,8 @@ import javax.crypto.SecretKey; + import javax.crypto.spec.SecretKeySpec; + + import dev._2lstudios.flamecord.FlameCord; +- +-import dev._2lstudios.flamecord.configuration.FlameConfig; ++import dev._2lstudios.flamecord.antibot.AddressData; ++import dev._2lstudios.flamecord.antibot.CheckManager; + import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + import lombok.Getter; + import lombok.RequiredArgsConstructor; +@@ -412,6 +412,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(Handshake handshake) throws Exception + { + Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); ++ ++ // FlameCord start - Antibot System ++ // Close and firewall on invalid protocol ++ int protocol = handshake.getRequestedProtocol(); ++ ++ if (protocol != 1 && protocol != 2) { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotRatelimitFirewall() ) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ch.getChannel().remoteAddress()).firewall("Invalid handshake protocol"); ++ } ++ ++ ch.close(); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + this.handshake = handshake; + ch.setVersion( handshake.getProtocolVersion() ); + ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); +@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + return; + } + ++ // FlameCord start - Antibot System ++ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ // FlameCord end - Antibot System ++ + switch ( handshake.getRequestedProtocol() ) + { + case 1: +@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + thisState = State.STATUS; + ch.setProtocol( Protocol.STATUS ); ++ ++ // FlameCord start - Antibot System ++ addressData.addPing(); ++ ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + break; + case 2: + // Login +@@ -464,6 +496,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.USERNAME; + ch.setProtocol( Protocol.LOGIN ); + ++ // FlameCord start - Antibot System ++ addressData.addConnection(); ++ ++ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) + { + if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) +@@ -527,6 +569,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection + return; + } + ++ // FlameCord start - Antibot System ++ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ String nickname = loginRequest.getData(); ++ ++ addressData.addNickname( nickname ); ++ ++ if ( checkManager.getAccountsCheck().check( ch.getRemoteAddress(), nickname ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_accounts", addressData.getNicknames().size() ) ); ++ return; ++ } ++ ++ if ( checkManager.getNicknameCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); ++ return; ++ } ++ ++ if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); ++ return; ++ } ++ ++ if ( checkManager.getCountryCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + // If offline mode and they are already on, don't allow connect + // We can just check by UUID here as names are based on UUID + if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) +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 66332af4e..c16e28c80 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,11 +4,15 @@ 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 dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.antibot.CheckManager; + import io.netty.channel.Channel; + import java.util.ArrayList; + import java.util.LinkedList; + import java.util.List; + import java.util.UUID; ++ + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.ServerConnection.KeepAliveData; + import net.md_5.bungee.UserConnection; +@@ -207,6 +211,22 @@ public class UpstreamBridge extends PacketHandler + } + Preconditions.checkArgument(!empty, "Chat message is empty"); + ++ // FlameCord start - Antibot System ++ final CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ ++ if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) ++ { ++ con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); ++ throw CancelSendSignal.INSTANCE; ++ } ++ ++ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), message ) ) ++ { ++ con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); ++ throw CancelSendSignal.INSTANCE; ++ } ++ // FlameCord end - Antibot System ++ + ChatEvent chatEvent = new ChatEvent( con, con.getServer(), message ); + if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) + { +diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +index e2911d5e4..1e3608fa4 100644 +--- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +@@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; + import io.netty.handler.codec.http.HttpResponseStatus; + import io.netty.handler.codec.http.LastHttpContent; + import java.nio.charset.Charset; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; + import lombok.RequiredArgsConstructor; ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.Callback; + + @RequiredArgsConstructor +@@ -21,6 +25,15 @@ public class HttpHandler extends SimpleChannelInboundHandler + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { ++ // Flamecord start - Antibot System ++ String reason = cause.getClass().getSimpleName(); ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); ++ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); ++ } ++ // Flamecord end - Antibot System ++ + try + { + callback.done( null, cause ); +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index b3fa48355..6f1d8336d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -154,4 +154,11 @@ public class ChannelWrapper + pipeline.remove( "decompress" ); + } + } ++ ++ // FlameCord start - Antibot System ++ // Make the channel accessible ++ public Channel getChannel() { ++ return ch; ++ } ++ // FlameCord end - Antibot System + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +index 14e3004fc..3fce5ff11 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +@@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; + import java.io.IOException; + import java.net.InetSocketAddress; + import java.util.logging.Level; ++ ++import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.api.ProxyServer; + import net.md_5.bungee.connection.CancelSendSignal; + import net.md_5.bungee.connection.InitialHandler; +@@ -146,6 +148,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { ++ // Flamecord start - Antibot System ++ String reason = cause.getClass().getSimpleName(); ++ if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) ++ { ++ FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); ++ } ++ // Flamecord end - Antibot System ++ + if ( ctx.channel().isActive() ) + { + boolean logExceptions = !( handler instanceof PingHandler ); +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 ffea15992..f04fdd9ce 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 +@@ -59,6 +59,20 @@ public class PipelineUtils + { + SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + ++ // FlameCord start - Antibot System ++ String firewallReason = FlameCord.getInstance().getAddressDataManager().getAddressData(ch.remoteAddress()).getFirewallReason(); ++ if ( firewallReason != null ) ++ { ++ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) ++ { ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); ++ } ++ ++ ch.close(); ++ return; ++ } ++ // FlameCord end - Antibot System ++ + if ( BungeeCord.getInstance().getConnectionThrottle() != null && BungeeCord.getInstance().getConnectionThrottle().throttle( remoteAddress ) ) + { + ch.close(); +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch new file mode 100644 index 00000000..2f46e925 --- /dev/null +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -0,0 +1,47 @@ +From 1e3a2975964623026cc90326efc27ccafb47ae51 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 4 Mar 2022 14:09:35 -0300 +Subject: [PATCH] Allow Invalid Names + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 0f12f4ae6..6f463b9c6 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; + import net.md_5.bungee.config.ConfigurationProvider; + + public class FlameCordConfiguration extends FlameConfig { ++ // FlameCord - Allow Invalid Names ++ @Getter ++ private boolean allowInvalidNames = false; ++ + // Antibot accounts + @Getter + private boolean antibotAccountsEnabled = true; +@@ -317,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { + // FlameCord - Antibot System + loadAntibot(configuration, whitelistedAddresses); + ++ // FlameCord - Allow Invalid Names ++ this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); ++ + save(configuration, configurationFile); + } + } +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 b88e64526..e8c14c552 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 +@@ -528,7 +528,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); + +- if ( !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) ++ if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + { + disconnect( bungee.getTranslation( "name_invalid" ) ); + return; +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch new file mode 100644 index 00000000..d80f3dbc --- /dev/null +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -0,0 +1,3240 @@ +From 1a4b10d4833f4c2c0f827ed75897f5187e6ec8ed Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 10 Mar 2022 20:23:55 -0300 +Subject: [PATCH] Disable entity Metadata Rewrite + + +diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +index 469fe0e1..97bd384b 100644 +--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java ++++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +@@ -251,11 +251,6 @@ public interface ProxyConfig + */ + boolean isDisableModernTabLimiter(); + +- /** +- * @return Should we disable entity metadata rewriting? +- */ +- boolean isDisableEntityMetadataRewrite(); +- + /** + * Whether tablist rewriting should be disabled or not + * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise +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 +index 0c334afc..88865b85 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +@@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; + import net.md_5.bungee.protocol.packet.Commands; + import net.md_5.bungee.protocol.packet.EncryptionRequest; + import net.md_5.bungee.protocol.packet.EncryptionResponse; +-import net.md_5.bungee.protocol.packet.EntityEffect; // Waterfall +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; // Waterfall + import net.md_5.bungee.protocol.packet.EntityStatus; + import net.md_5.bungee.protocol.packet.GameState; + import net.md_5.bungee.protocol.packet.Handshake; +@@ -225,14 +223,4 @@ public abstract class AbstractPacketHandler + public void handle(ServerData serverData) throws Exception + { + } +- +- // Waterfall start +- public void handle(EntityEffect entityEffect) throws Exception +- { +- } +- +- public void handle(EntityRemoveEffect removeEffect) throws Exception +- { +- } +- // Waterfall end + } +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 +index 022f94b2..970011e8 100644 +--- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; + import net.md_5.bungee.protocol.packet.EncryptionResponse; + import net.md_5.bungee.protocol.packet.EntityStatus; + import net.md_5.bungee.protocol.packet.GameState; +-import net.md_5.bungee.protocol.packet.EntityEffect; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.Handshake; + import net.md_5.bungee.protocol.packet.KeepAlive; + import net.md_5.bungee.protocol.packet.Kick; +@@ -140,20 +138,6 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), + map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) + ); +- // Waterfall start +- TO_CLIENT.registerPacket( +- EntityEffect.class, +- EntityEffect::new, +- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1D ), // FlameCord - 1.7.x support +- map(ProtocolConstants.MINECRAFT_1_9, -1) +- ); +- TO_CLIENT.registerPacket( +- EntityRemoveEffect.class, +- EntityRemoveEffect::new, +- map( ProtocolConstants.MINECRAFT_1_7_2, 0x1E ), // FlameCord - 1.7.x support +- map(ProtocolConstants.MINECRAFT_1_9, -1) +- ); +- // Waterfall end + TO_CLIENT.registerPacket( + PlayerListItem.class, // PlayerInfo + PlayerListItem::new, +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +deleted file mode 100644 +index 0ed78a8c..00000000 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java ++++ /dev/null +@@ -1,67 +0,0 @@ +-package net.md_5.bungee.protocol.packet; +- +-import io.netty.buffer.ByteBuf; +-import lombok.AllArgsConstructor; +-import lombok.Data; +-import lombok.EqualsAndHashCode; +-import lombok.NoArgsConstructor; +-import net.md_5.bungee.protocol.AbstractPacketHandler; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-@Data +-@NoArgsConstructor +-@AllArgsConstructor +-@EqualsAndHashCode(callSuper = false) +-public class EntityEffect extends DefinedPacket { +- +- private int entityId; +- private int effectId; +- private int amplifier; +- private int duration; +- private boolean hideParticles; +- +- @Override +- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support +- this.effectId = buf.readUnsignedByte(); +- this.amplifier = buf.readUnsignedByte(); +- this.duration = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readShort(); // FlameCord - 1.7.x support +- // FlameCord start - 1.7.x support +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) +- { +- this.hideParticles = buf.readBoolean(); +- } +- // FlameCord end - 1.7.x support +- } +- +- @Override +- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.entityId, buf); +- } else +- { +- buf.writeInt(effectId); +- } +- // FlameCord end - 1.7.x support +- buf.writeByte(this.effectId); +- buf.writeByte(this.amplifier); +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.duration, buf); +- } else +- { +- buf.writeShort(duration); +- } +- // FlameCord end - 1.7.x support +- buf.writeBoolean(this.hideParticles); +- } +- +- @Override +- public void handle(AbstractPacketHandler handler) throws Exception { +- handler.handle(this); +- } +-} +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +deleted file mode 100644 +index 435b8578..00000000 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java ++++ /dev/null +@@ -1,45 +0,0 @@ +-package net.md_5.bungee.protocol.packet; +- +-import io.netty.buffer.ByteBuf; +-import lombok.AllArgsConstructor; +-import lombok.Data; +-import lombok.EqualsAndHashCode; +-import lombok.NoArgsConstructor; +-import net.md_5.bungee.protocol.AbstractPacketHandler; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-@Data +-@NoArgsConstructor +-@AllArgsConstructor +-@EqualsAndHashCode(callSuper = false) +-public class EntityRemoveEffect extends DefinedPacket { +- +- private int entityId; +- private int effectId; +- +- @Override +- public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- this.entityId = protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ? readVarInt(buf) : buf.readInt(); // FlameCord - 1.7.x support +- this.effectId = buf.readUnsignedByte(); +- } +- +- @Override +- public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { +- // FlameCord start - 1.7.x support +- if (protocolVersion >= ProtocolConstants.MINECRAFT_1_8) +- { +- writeVarInt(this.entityId, buf); +- } else +- { +- buf.writeInt(entityId); +- } +- // FlameCord end - 1.7.x support +- buf.writeByte(effectId); +- } +- +- @Override +- public void handle(AbstractPacketHandler handler) throws Exception { +- handler.handle(this); +- } +-} +diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +index 966d2442..be337a68 100644 +--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java ++++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +@@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { + private int tabThrottle = 1000; + private boolean disableModernTabLimiter = true; + +- private boolean disableEntityMetadataRewrite = false; + private boolean disableTabListRewrite = true; + + /* +@@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { + // Throttling options + tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); + disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter); +- disableEntityMetadataRewrite = config.getBoolean("disable_entity_metadata_rewrite", disableEntityMetadataRewrite); + disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite); + pluginChannelLimit = config.getInt("registered_plugin_channels_limit", pluginChannelLimit); + pluginChannelNameLimit = config.getInt("plugin_channel_name_limit", pluginChannelNameLimit); +@@ -105,11 +103,6 @@ public class WaterfallConfiguration extends Configuration { + return disableModernTabLimiter; + } + +- @Override +- public boolean isDisableEntityMetadataRewrite() { +- return disableEntityMetadataRewrite; +- } +- + @Override + public boolean isDisableTabListRewrite() { + return disableTabListRewrite; +diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +index 3a07c7c8..f51c668d 100644 +--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java ++++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +@@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler + ch.write( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:register" : "REGISTER", Joiner.on( "\0" ).join( registeredChannels ).getBytes( StandardCharsets.UTF_8 ), false ) ); + } + +- if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null ) +- { +- ch.write( user.getSettings() ); +- } +- + if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla + { + user.getForgeClientHandler().setHandshakeComplete(); +@@ -308,20 +303,6 @@ public class ServerConnector extends PacketHandler + user.getTabListHandler().onServerChange(); + + Scoreboard serverScoreboard = user.getServerSentScoreboard(); +- if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall +- for ( Objective objective : serverScoreboard.getObjectives() ) +- { +- user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), objective.getType() == null ? null : ScoreboardObjective.HealthDisplay.fromString(objective.getType()), (byte) 1 ) ); // FlameCord - 1.7 support +- } +- for ( Score score : serverScoreboard.getScores() ) +- { +- user.unsafe().sendPacket( new ScoreboardScore( score.getItemName(), (byte) 1, score.getScoreName(), score.getValue() ) ); +- } +- for ( Team team : serverScoreboard.getTeams() ) +- { +- user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.Team( team.getName() ) ); +- } +- } // Waterfall + serverScoreboard.clear(); + + for ( UUID bossbar : user.getSentBossBars() ) +@@ -340,33 +321,27 @@ public class ServerConnector extends PacketHandler + } + + user.setDimensionChange( true ); +- if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- } + + user.setServerEntityId( login.getEntityId() ); + + // Waterfall start +- if ( user.isDisableEntityMetadataRewrite() ) { +- // Ensure that we maintain consistency +- user.setClientEntityId( login.getEntityId() ); ++ // Ensure that we maintain consistency ++ user.setClientEntityId( login.getEntityId() ); + +- // Only send if we are not in the same dimension +- if ( login.getDimension() != user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- } ++ // Only send if we are not in the same dimension ++ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer ++ { ++ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); ++ } + +- Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), +- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); +- user.unsafe().sendPacket(modLogin); ++ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), ++ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); ++ user.unsafe().sendPacket(modLogin); + +- // Only send if we're in the same dimension +- if ( login.getDimension() == user.getDimension() ) // Waterfall - defer +- { +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- } ++ // Only send if we're in the same dimension ++ if ( login.getDimension() == user.getDimension() ) // Waterfall - defer ++ { ++ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); + } + // Waterfall end + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +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 90922797..f3d60253 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; + import net.md_5.bungee.api.score.Scoreboard; + import net.md_5.bungee.chat.ComponentSerializer; + import net.md_5.bungee.connection.InitialHandler; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.forge.ForgeClientHandler; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.forge.ForgeServerHandler; +@@ -137,8 +136,6 @@ public final class UserConnection implements ProxiedPlayer + /*========================================================================*/ + @Getter + private String displayName; +- @Getter +- private EntityMap entityRewrite; + private Locale locale; + /*========================================================================*/ + @Getter +@@ -159,8 +156,6 @@ public final class UserConnection implements ProxiedPlayer + + public void init() + { +- this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); +- + this.displayName = name; + + tabListHandler = new ServerUnique( this ); +@@ -794,10 +789,4 @@ public final class UserConnection implements ProxiedPlayer + { + return serverSentScoreboard; + } +- +- // Waterfall start +- public boolean isDisableEntityMetadataRewrite() { +- return entityRewrite == net.md_5.bungee.entitymap.EntityMap_Dummy.INSTANCE; +- } +- // Waterfall end + } +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 +index 0ac22ad3..6e425764 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +@@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; + import net.md_5.bungee.api.score.Scoreboard; + import net.md_5.bungee.api.score.Team; + import net.md_5.bungee.chat.ComponentSerializer; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.PacketHandler; + import net.md_5.bungee.protocol.DefinedPacket; +@@ -54,8 +53,6 @@ import net.md_5.bungee.protocol.PacketWrapper; + import net.md_5.bungee.protocol.ProtocolConstants; + import net.md_5.bungee.protocol.packet.BossBar; + import net.md_5.bungee.protocol.packet.Commands; +-import net.md_5.bungee.protocol.packet.EntityEffect; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.KeepAlive; + import net.md_5.bungee.protocol.packet.Kick; + import net.md_5.bungee.protocol.packet.PlayerListItem; +@@ -150,11 +147,6 @@ public class DownstreamBridge extends PacketHandler + @Override + public void handle(PacketWrapper packet) throws Exception + { +- EntityMap rewrite = con.getEntityRewrite(); +- if ( rewrite != null ) +- { +- rewrite.rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId(), con.getPendingConnection().getVersion() ); +- } + con.sendPacket( packet ); + } + +@@ -705,34 +697,6 @@ public class DownstreamBridge extends PacketHandler + } + } + +- // Waterfall start +- @Override +- public void handle(EntityEffect entityEffect) throws Exception +- { +- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall +- // Don't send any potions when switching between servers (which involves a handshake), which can trigger a race +- // condition on the client. +- if (this.con.getForgeClientHandler().isForgeUser() && !this.con.getForgeClientHandler().isHandshakeComplete()) { +- throw CancelSendSignal.INSTANCE; +- } +- con.getPotions().put(rewriteEntityId(entityEffect.getEntityId()), entityEffect.getEffectId()); +- } +- +- @Override +- public void handle(EntityRemoveEffect removeEffect) throws Exception +- { +- if (con.isDisableEntityMetadataRewrite()) return; // Waterfall +- con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId()); +- } +- +- private int rewriteEntityId(int entityId) { +- if (entityId == con.getServerEntityId()) { +- return con.getClientEntityId(); +- } +- return entityId; +- } +- // Waterfall end +- + @Override + public void handle(Respawn respawn) + { +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 c16e28c8..5a7f3880 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 +@@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; + import net.md_5.bungee.api.event.PluginMessageEvent; + import net.md_5.bungee.api.event.SettingsChangedEvent; + import net.md_5.bungee.api.event.TabCompleteEvent; +-import net.md_5.bungee.entitymap.EntityMap; + import net.md_5.bungee.forge.ForgeConstants; + import net.md_5.bungee.netty.ChannelWrapper; + import net.md_5.bungee.netty.PacketHandler; +@@ -144,11 +143,6 @@ public class UpstreamBridge extends PacketHandler + { + if ( con.getServer() != null ) + { +- EntityMap rewrite = con.getEntityRewrite(); +- if ( rewrite != null ) +- { +- rewrite.rewriteServerbound( packet.buf, con.getClientEntityId(), con.getServerEntityId(), con.getPendingConnection().getVersion() ); +- } + con.getServer().getCh().write( packet ); + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +deleted file mode 100644 +index 688ff72d..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java ++++ /dev/null +@@ -1,372 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import io.netty.buffer.ByteBufInputStream; +-import java.io.DataInputStream; +-import lombok.AccessLevel; +-import lombok.NoArgsConstructor; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +-import se.llbit.nbt.NamedTag; +-import se.llbit.nbt.Tag; +- +-/** +- * Class to rewrite integers within packets. +- */ +-@NoArgsConstructor(access = AccessLevel.PACKAGE) +-public abstract class EntityMap +-{ +- +- private final boolean[] clientboundInts = new boolean[ 256 ]; +- private final boolean[] clientboundVarInts = new boolean[ 256 ]; +- +- private final boolean[] serverboundInts = new boolean[ 256 ]; +- private final boolean[] serverboundVarInts = new boolean[ 256 ]; +- +- // Returns the correct entity map for the protocol version +- public static EntityMap getEntityMap(int version) +- { +- // Waterfall start +- if (net.md_5.bungee.api.ProxyServer.getInstance().getConfig().isDisableEntityMetadataRewrite()) { +- return EntityMap_Dummy.INSTANCE; +- } +- // Waterfall end +- switch ( version ) +- { +- // FlameCord start - 1.7.x support +- case ProtocolConstants.MINECRAFT_1_7_2: +- return EntityMap_1_7_2.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_7_6: +- return EntityMap_1_7_6.INSTANCE; +- // FlameCord end - 1.7.x support +- case ProtocolConstants.MINECRAFT_1_8: +- return EntityMap_1_8.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_9: +- case ProtocolConstants.MINECRAFT_1_9_1: +- case ProtocolConstants.MINECRAFT_1_9_2: +- return EntityMap_1_9.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_9_4: +- return EntityMap_1_9_4.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_10: +- return EntityMap_1_10.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_11: +- case ProtocolConstants.MINECRAFT_1_11_1: +- return EntityMap_1_11.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_12: +- return EntityMap_1_12.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_12_1: +- case ProtocolConstants.MINECRAFT_1_12_2: +- return EntityMap_1_12_1.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_13: +- case ProtocolConstants.MINECRAFT_1_13_1: +- case ProtocolConstants.MINECRAFT_1_13_2: +- return EntityMap_1_13.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_14: +- case ProtocolConstants.MINECRAFT_1_14_1: +- case ProtocolConstants.MINECRAFT_1_14_2: +- case ProtocolConstants.MINECRAFT_1_14_3: +- case ProtocolConstants.MINECRAFT_1_14_4: +- return EntityMap_1_14.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_15: +- case ProtocolConstants.MINECRAFT_1_15_1: +- case ProtocolConstants.MINECRAFT_1_15_2: +- return EntityMap_1_15.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_16: +- case ProtocolConstants.MINECRAFT_1_16_1: +- return EntityMap_1_16.INSTANCE; +- case ProtocolConstants.MINECRAFT_1_16_2: +- case ProtocolConstants.MINECRAFT_1_16_3: +- case ProtocolConstants.MINECRAFT_1_16_4: +- return EntityMap_1_16_2.INSTANCE_1_16_2; +- case ProtocolConstants.MINECRAFT_1_17: +- case ProtocolConstants.MINECRAFT_1_17_1: +- return EntityMap_1_16_2.INSTANCE_1_17; +- case ProtocolConstants.MINECRAFT_1_18: +- case ProtocolConstants.MINECRAFT_1_18_2: +- return EntityMap_1_16_2.INSTANCE_1_18; +- case ProtocolConstants.MINECRAFT_1_19: +- return EntityMap_1_16_2.INSTANCE_1_19; +- case ProtocolConstants.MINECRAFT_1_19_1: +- case ProtocolConstants.MINECRAFT_1_19_3: +- return EntityMap_1_16_2.INSTANCE_1_19_1; +- } +- throw new RuntimeException( "Version " + version + " has no entity map" ); +- } +- +- protected void addRewrite(int id, ProtocolConstants.Direction direction, boolean varint) +- { +- if ( direction == ProtocolConstants.Direction.TO_CLIENT ) +- { +- if ( varint ) +- { +- clientboundVarInts[id] = true; +- } else +- { +- clientboundInts[id] = true; +- } +- } else if ( varint ) +- { +- serverboundVarInts[id] = true; +- } else +- { +- serverboundInts[id] = true; +- } +- } +- +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- rewrite( packet, oldId, newId, serverboundInts, serverboundVarInts ); +- } +- +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- rewriteServerbound( packet, oldId, newId ); +- } +- +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- rewrite( packet, oldId, newId, clientboundInts, clientboundVarInts ); +- } +- +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- rewriteClientbound( packet, oldId, newId ); +- } +- +- protected static void rewriteInt(ByteBuf packet, int oldId, int newId, int offset) +- { +- int readId = packet.getInt( offset ); +- if ( readId == oldId ) +- { +- packet.setInt( offset, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( offset, oldId ); +- } +- } +- +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- protected static void rewriteVarInt(ByteBuf packet, int oldId, int newId, int offset) +- { +- // Need to rewrite the packet because VarInts are variable length +- int readId = DefinedPacket.readVarInt( packet ); +- int readIdLength = packet.readerIndex() - offset; +- if ( readId == oldId || readId == newId ) +- { +- ByteBuf data = packet.copy(); +- +- try { +- packet.readerIndex( offset ); +- packet.writerIndex( offset ); +- DefinedPacket.writeVarInt( readId == oldId ? newId : oldId, packet ); +- packet.writeBytes( data ); +- } finally { +- data.release(); +- } +- } +- } +- +- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex) +- { +- rewriteMetaVarInt( packet, oldId, newId, metaIndex, -1 ); +- } +- +- protected static void rewriteMetaVarInt(ByteBuf packet, int oldId, int newId, int metaIndex, int protocolVersion) +- { +- int readerIndex = packet.readerIndex(); +- +- short index; +- while ( ( index = packet.readUnsignedByte() ) != 0xFF ) +- { +- int type = DefinedPacket.readVarInt( packet ); +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) +- { +- switch ( type ) +- { +- case 5: // optional chat +- if ( packet.readBoolean() ) +- { +- DefinedPacket.readString( packet ); +- } +- continue; +- case 15: // particle +- int particleId = DefinedPacket.readVarInt( packet ); +- +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 ) +- { +- switch ( particleId ) +- { +- case 3: // minecraft:block +- case 23: // minecraft:falling_dust +- DefinedPacket.readVarInt( packet ); // block state +- break; +- case 14: // minecraft:dust +- packet.skipBytes( 16 ); // float, float, float, flat +- break; +- case 32: // minecraft:item +- readSkipSlot( packet, protocolVersion ); +- break; +- } +- } else +- { +- switch ( particleId ) +- { +- case 3: // minecraft:block +- case 20: // minecraft:falling_dust +- DefinedPacket.readVarInt( packet ); // block state +- break; +- case 11: // minecraft:dust +- packet.skipBytes( 16 ); // float, float, float, flat +- break; +- case 27: // minecraft:item +- readSkipSlot( packet, protocolVersion ); +- break; +- } +- } +- continue; +- default: +- if ( type >= 6 ) +- { +- type--; +- } +- break; +- } +- } +- +- switch ( type ) +- { +- case 0: +- packet.skipBytes( 1 ); // byte +- break; +- case 1: +- if ( index == metaIndex ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, position ); +- packet.readerIndex( position ); +- } +- DefinedPacket.readVarInt( packet ); +- break; +- case 2: +- packet.skipBytes( 4 ); // float +- break; +- case 3: +- case 4: +- DefinedPacket.readString( packet ); +- break; +- case 5: +- readSkipSlot( packet, protocolVersion ); +- break; +- case 6: +- packet.skipBytes( 1 ); // boolean +- break; +- case 7: +- packet.skipBytes( 12 ); // float, float, float +- break; +- case 8: +- packet.readLong(); +- break; +- case 9: +- if ( packet.readBoolean() ) +- { +- packet.skipBytes( 8 ); // long +- } +- break; +- case 10: +- DefinedPacket.readVarInt( packet ); +- break; +- case 11: +- if ( packet.readBoolean() ) +- { +- packet.skipBytes( 16 ); // long, long +- } +- break; +- case 12: +- DefinedPacket.readVarInt( packet ); +- break; +- case 13: +- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); +- if ( tag.isError() ) +- { +- throw new RuntimeException( tag.error() ); +- } +- break; +- case 15: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- break; +- case 16: +- if ( index == metaIndex ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId + 1, newId + 1, position ); +- packet.readerIndex( position ); +- } +- DefinedPacket.readVarInt( packet ); +- break; +- case 17: +- DefinedPacket.readVarInt( packet ); +- break; +- default: +- // Waterfall start - Don't lie +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) +- { +- type++; +- } +- throw new IllegalArgumentException( "Unknown meta type " + type + ": Using mods? refer to disable_entity_metadata_rewrite in waterfall.yml" ); +- // Waterfall end +- } +- } +- +- packet.readerIndex( readerIndex ); +- } +- +- private static void readSkipSlot(ByteBuf packet, int protocolVersion) +- { +- if ( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) ? packet.readBoolean() : packet.readShort() != -1 ) +- { +- if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 ) +- { +- DefinedPacket.readVarInt( packet ); +- } +- packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short +- +- int position = packet.readerIndex(); +- if ( packet.readByte() != 0 ) +- { +- packet.readerIndex( position ); +- +- Tag tag = NamedTag.read( new DataInputStream( new ByteBufInputStream( packet ) ) ); +- if ( tag.isError() ) +- { +- throw new RuntimeException( tag.error() ); +- } +- } +- } +- } +- +- // Handles simple packets +- private static void rewrite(ByteBuf packet, int oldId, int newId, boolean[] ints, boolean[] varints) +- { +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if (packetId < 0 || packetId > ints.length || packetId > varints.length) { // Invalid packet id +- // Ignore these invalid packets for compatibility reasons +- packet.readerIndex( readerIndex ); +- return; +- } +- +- if ( ints[packetId] ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength ); +- } else if ( varints[packetId] ) +- { +- rewriteVarInt( packet, oldId, newId, readerIndex + packetIdLength ); +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +deleted file mode 100644 +index 6db530c3..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_10 extends EntityMap +-{ +- +- static final EntityMap_1_10 INSTANCE = new EntityMap_1_10(); +- +- EntityMap_1_10() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +deleted file mode 100644 +index 36822127..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_11 extends EntityMap +-{ +- +- static final EntityMap_1_11 INSTANCE = new EntityMap_1_11(); +- +- EntityMap_1_11() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +deleted file mode 100644 +index 38e12ce4..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_12 extends EntityMap +-{ +- +- static final EntityMap_1_12 INSTANCE = new EntityMap_1_12(); +- +- EntityMap_1_12() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x32, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x35, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3C /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4A /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x42 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x31 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3B /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +deleted file mode 100644 +index 5f296839..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_12_1 extends EntityMap +-{ +- +- static final EntityMap_1_12_1 INSTANCE = new EntityMap_1_12_1(); +- +- EntityMap_1_12_1() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x30, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3D, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4E, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3D /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4B /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x43 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x32 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2D /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3C /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7 ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1E /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +deleted file mode 100644 +index f3372f08..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java ++++ /dev/null +@@ -1,183 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_13 extends EntityMap +-{ +- +- static final EntityMap_1_13 INSTANCE = new EntityMap_1_13(); +- +- EntityMap_1_13() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x33, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x41, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x42, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x4F, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x50, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x52, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x53, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x19, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x40 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x4F /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x46 /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x35 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2F /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x3F /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 6, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 7, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 13, protocolVersion ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x28 /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +deleted file mode 100644 +index 8210b0a7..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_14 extends EntityMap +-{ +- +- static final EntityMap_1_14 INSTANCE = new EntityMap_1_14(); +- +- EntityMap_1_14() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x44 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x55 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4A /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 101 || type == 71 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 71 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x43 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 15, protocolVersion ); // guardian beam +- break; +- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +deleted file mode 100644 +index c2cf810f..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_15 extends EntityMap +-{ +- +- static final EntityMap_1_15 INSTANCE = new EntityMap_1_15(); +- +- EntityMap_1_15() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x09, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3F, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x57, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x5A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x56 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4B /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x38 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 72 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x33 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam +- break; +- case 0x51 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +deleted file mode 100644 +index c8b06707..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java ++++ /dev/null +@@ -1,187 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_16 extends EntityMap +-{ +- +- static final EntityMap_1_16 INSTANCE = new EntityMap_1_16(); +- +- EntityMap_1_16() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x02, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x47, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount +- addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x45 /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x55 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x4B /* Set Passengers : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = DefinedPacket.readVarInt( packet ); +- +- if ( type == 2 || type == 102 || type == 72 ) // arrow, fishing_bobber or spectral_arrow +- { +- if ( type == 2 || type == 72 ) // arrow or spectral_arrow +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x04 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x32 /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x44 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al) +- rewriteMetaVarInt( packet, oldId, newId, 16, protocolVersion ); // guardian beam +- break; +- case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x2C /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +deleted file mode 100644 +index 7241dc56..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java ++++ /dev/null +@@ -1,76 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import lombok.AccessLevel; +-import lombok.RequiredArgsConstructor; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +- +-@RequiredArgsConstructor(access = AccessLevel.PRIVATE) +-class EntityMap_1_16_2 extends EntityMap +-{ +- +- static final EntityMap_1_16_2 INSTANCE_1_16_2 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); +- static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F ); +- static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 ); +- // +- private final int spawnPlayerId; +- private final int spectateId; +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) +- { +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == spawnPlayerId ) +- { +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == spectateId && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +deleted file mode 100644 +index cdc07dc4..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java ++++ /dev/null +@@ -1,102 +0,0 @@ +-// FlameCord start - 1.7.x support +-package net.md_5.bungee.entitymap; +- +-import io.netty.buffer.ByteBuf; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_7_2 extends EntityMap +-{ +- +- static final EntityMap INSTANCE = new EntityMap_1_7_2(); +- +- EntityMap_1_7_2() +- { +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Equipment +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, false ); // Use bed +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation +- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, false ); // Collect Item +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object +- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob +- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting +- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb +- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Velocity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Relative Move +- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look +- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Look and Relative Move +- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Teleport +- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Head Look +- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Metadata +- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Effect +- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, false ); // Remove Entity Effect +- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Properties +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity +- +- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, false ); // Use Entity +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, false ); // Animation +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, false ); // Entity Action +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0D /* Collect Item */ || packetId == 0x1B /* Attach Entity */ ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- } else if ( packetId == 0x13 /* Destroy Entities */ ) +- { +- int count = packet.getByte( packetIdLength ); +- for ( int i = 0; i < count; i++ ) +- { +- rewriteInt( packet, oldId, newId, packetIdLength + 1 + i * 4 ); +- } +- } else if ( packetId == 0x0E /* Spawn Object */ ) +- { +- DefinedPacket.readVarInt( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 ) +- { +- packet.skipBytes( 14 ); +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- int changedId = -1; +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- changedId = newId; +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- changedId = oldId; +- } +- if ( changedId != -1 ) +- { +- if ( changedId == 0 && readId != 0 ) +- { // Trim off the extra data +- packet.readerIndex( readerIndex ); +- packet.writerIndex( packet.readableBytes() - 6 ); +- } else if ( changedId != 0 && readId == 0 ) +- { // Add on the extra data +- packet.readerIndex( readerIndex ); +- packet.capacity( packet.readableBytes() + 6 ); +- packet.writerIndex( packet.readableBytes() + 6 ); +- } +- } +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +-// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +deleted file mode 100644 +index cb9174b3..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java ++++ /dev/null +@@ -1,62 +0,0 @@ +-// FlameCord start - 1.7.x support +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.connection.LoginResult; +-import net.md_5.bungee.protocol.DefinedPacket; +- +-class EntityMap_1_7_6 extends EntityMap_1_7_2 +-{ +- +- static final EntityMap_1_7_6 INSTANCE = new EntityMap_1_7_6(); +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0C /* Spawn Player */ ) +- { +- DefinedPacket.readVarInt( packet ); +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- String uuid = DefinedPacket.readString( packet ); +- String username = DefinedPacket.readString( packet ); +- int props = DefinedPacket.readVarInt( packet ); +- if ( props == 0 ) +- { +- UserConnection player = (UserConnection) BungeeCord.getInstance().getPlayer( username ); +- if ( player != null ) +- { +- LoginResult profile = player.getPendingConnection().getLoginProfile(); +- if ( profile != null && profile.getProperties() != null +- && profile.getProperties().length >= 1 ) +- { +- ByteBuf rest = packet.copy(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeString( player.getUniqueId().toString(), packet ); +- DefinedPacket.writeString( username, packet ); +- DefinedPacket.writeVarInt( profile.getProperties().length, packet ); +- for ( net.md_5.bungee.protocol.Property property : profile.getProperties() ) +- { +- DefinedPacket.writeString( property.getName(), packet ); +- DefinedPacket.writeString( property.getValue(), packet ); +- DefinedPacket.writeString( property.getSignature(), packet ); +- } +- packet.writeBytes( rest ); +- rest.release(); +- } +- } +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +-// FlameCord end - 1.7.x support +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +deleted file mode 100644 +index 8e2dbe69..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java ++++ /dev/null +@@ -1,176 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_8 extends EntityMap +-{ +- +- static final EntityMap_1_8 INSTANCE = new EntityMap_1_8(); +- +- EntityMap_1_8() +- { +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation +- addRewrite( 0x0C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player +- addRewrite( 0x0D, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item +- addRewrite( 0x0E, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object +- addRewrite( 0x0F, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob +- addRewrite( 0x10, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting +- addRewrite( 0x11, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb +- addRewrite( 0x12, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity +- addRewrite( 0x15, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move +- addRewrite( 0x16, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look +- addRewrite( 0x17, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move +- addRewrite( 0x18, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport +- addRewrite( 0x19, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look +- addRewrite( 0x1A, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity +- addRewrite( 0x1C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata +- addRewrite( 0x1D, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect +- addRewrite( 0x1E, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect +- addRewrite( 0x20, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation +- addRewrite( 0x2C, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Global Entity +- addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Update Entity NBT +- +- addRewrite( 0x02, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity +- addRewrite( 0x0B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- if ( packetId == 0x0D /* Collect Item */ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( packetId == 0x1B /* Attach Entity */ ) +- { +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- } else if ( packetId == 0x13 /* Destroy Entities */ ) +- { +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( readerIndex + packetIdLength ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- } else if ( packetId == 0x0E /* Spawn Object */ ) +- { +- +- DefinedPacket.readVarInt( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 ) +- { +- packet.skipBytes( 14 ); +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- int changedId = readId; +- +- if ( readId == oldId ) +- { +- packet.setInt( position, changedId = newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, changedId = oldId ); +- } +- +- if ( readId > 0 && changedId <= 0 ) +- { +- packet.writerIndex( packet.writerIndex() - 6 ); +- } else if ( changedId > 0 && readId <= 0 ) +- { +- packet.ensureWritable( 6 ); +- packet.writerIndex( packet.writerIndex() + 6 ); +- } +- } +- } else if ( packetId == 0x0C /* Spawn Player */ ) +- { +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- } else if ( packetId == 0x42 /* Combat Event */ ) +- { +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- //Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x18 /* Spectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +deleted file mode 100644 +index d61dc0cb..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_9 extends EntityMap +-{ +- +- static final EntityMap_1_9 INSTANCE = new EntityMap_1_9(); +- +- EntityMap_1_9() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x49 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +deleted file mode 100644 +index bfbc8432..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java ++++ /dev/null +@@ -1,182 +0,0 @@ +-package net.md_5.bungee.entitymap; +- +-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +-import io.netty.buffer.ByteBuf; +-import java.util.UUID; +-import net.md_5.bungee.BungeeCord; +-import net.md_5.bungee.UserConnection; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.protocol.DefinedPacket; +-import net.md_5.bungee.protocol.ProtocolConstants; +- +-class EntityMap_1_9_4 extends EntityMap +-{ +- +- static final EntityMap_1_9_4 INSTANCE = new EntityMap_1_9_4(); +- +- EntityMap_1_9_4() +- { +- addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity +- addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb +- addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving +- addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting +- addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn +- addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation +- addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation +- addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus +- addRewrite( 0x25, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove +- addRewrite( 0x26, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook +- addRewrite( 0x27, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook +- addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity +- addRewrite( 0x2F, ProtocolConstants.Direction.TO_CLIENT, true ); // Use bed : PacketPlayOutBed +- addRewrite( 0x31, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect +- addRewrite( 0x34, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation +- addRewrite( 0x36, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera +- addRewrite( 0x39, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata +- addRewrite( 0x3A, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity +- addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity +- addRewrite( 0x3C, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment +- addRewrite( 0x40, ProtocolConstants.Direction.TO_CLIENT, true ); // Attach Entity : PacketPlayOutMount +- addRewrite( 0x48, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect +- addRewrite( 0x49, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport +- addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes +- addRewrite( 0x4B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect +- +- addRewrite( 0x0A, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity +- addRewrite( 0x14, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction +- } +- +- @Override +- @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteClientbound( packet, oldId, newId ); +- +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- int jumpIndex = packet.readerIndex(); +- switch ( packetId ) +- { +- case 0x3A /* Attach Entity : PacketPlayOutAttachEntity */: +- rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 ); +- break; +- case 0x48 /* Collect Item : PacketPlayOutCollect */: +- DefinedPacket.readVarInt( packet ); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- break; +- case 0x40 /* Attach Entity : PacketPlayOutMount */: +- DefinedPacket.readVarInt( packet ); +- jumpIndex = packet.readerIndex(); +- // Fall through on purpose to int array of IDs +- case 0x30 /* Destroy Entities : PacketPlayOutEntityDestroy */: +- int count = DefinedPacket.readVarInt( packet ); +- int[] ids = new int[ count ]; +- for ( int i = 0; i < count; i++ ) +- { +- ids[i] = DefinedPacket.readVarInt( packet ); +- } +- packet.readerIndex( jumpIndex ); +- packet.writerIndex( jumpIndex ); +- DefinedPacket.writeVarInt( count, packet ); +- for ( int id : ids ) +- { +- if ( id == oldId ) +- { +- id = newId; +- } else if ( id == newId ) +- { +- id = oldId; +- } +- DefinedPacket.writeVarInt( id, packet ); +- } +- break; +- case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */: +- DefinedPacket.readVarInt( packet ); +- DefinedPacket.readUUID( packet ); +- int type = packet.readUnsignedByte(); +- +- if ( type == 60 || type == 90 || type == 91 ) +- { +- if ( type == 60 || type == 91 ) +- { +- oldId = oldId + 1; +- newId = newId + 1; +- } +- +- packet.skipBytes( 26 ); // double, double, double, byte, byte +- int position = packet.readerIndex(); +- int readId = packet.readInt(); +- if ( readId == oldId ) +- { +- packet.setInt( position, newId ); +- } else if ( readId == newId ) +- { +- packet.setInt( position, oldId ); +- } +- } +- break; +- case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- int idLength = packet.readerIndex() - readerIndex - packetIdLength; +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength + idLength ); +- DefinedPacket.writeUUID( player.getUniqueId(), packet ); +- packet.writerIndex( previous ); +- } +- break; +- case 0x2C /* Combat Event : PacketPlayOutCombatEvent */: +- int event = packet.readUnsignedByte(); +- if ( event == 1 /* End Combat*/ ) +- { +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } else if ( event == 2 /* Entity Dead */ ) +- { +- int position = packet.readerIndex(); +- rewriteVarInt( packet, oldId, newId, packet.readerIndex() ); +- packet.readerIndex( position ); +- DefinedPacket.readVarInt( packet ); +- rewriteInt( packet, oldId, newId, packet.readerIndex() ); +- } +- break; +- case 0x39 /* EntityMetadata : PacketPlayOutEntityMetadata */: +- DefinedPacket.readVarInt( packet ); // Entity ID +- rewriteMetaVarInt( packet, oldId + 1, newId + 1, 5 ); // fishing hook +- rewriteMetaVarInt( packet, oldId, newId, 12 ); // guardian beam +- break; +- } +- packet.readerIndex( readerIndex ); +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) +- { +- super.rewriteServerbound( packet, oldId, newId ); +- // Special cases +- int readerIndex = packet.readerIndex(); +- int packetId = DefinedPacket.readVarInt( packet ); +- int packetIdLength = packet.readerIndex() - readerIndex; +- +- if ( packetId == 0x1B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() ) +- { +- UUID uuid = DefinedPacket.readUUID( packet ); +- ProxiedPlayer player; +- if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null ) +- { +- int previous = packet.writerIndex(); +- packet.readerIndex( readerIndex ); +- packet.writerIndex( readerIndex + packetIdLength ); +- DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet ); +- packet.writerIndex( previous ); +- } +- } +- packet.readerIndex( readerIndex ); +- } +-} +diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +deleted file mode 100644 +index cb81d1dd..00000000 +--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java ++++ /dev/null +@@ -1,30 +0,0 @@ +- +-package net.md_5.bungee.entitymap; +- +-import io.netty.buffer.ByteBuf; +-// Waterfall start +- +-public class EntityMap_Dummy extends EntityMap { +- +- public static final EntityMap_Dummy INSTANCE = new EntityMap_Dummy(); +- +- EntityMap_Dummy() { +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId) { +- } +- +- @Override +- public void rewriteServerbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId) { +- } +- +- @Override +- public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion) { +- } +-} +-// Waterfall end +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +index caed4384..af428090 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +@@ -11,7 +11,6 @@ import lombok.Setter; + import net.md_5.bungee.BungeeCord; + import net.md_5.bungee.UserConnection; + import net.md_5.bungee.protocol.ProtocolConstants; +-import net.md_5.bungee.protocol.packet.EntityRemoveEffect; + import net.md_5.bungee.protocol.packet.PluginMessage; + + /** +@@ -113,10 +112,6 @@ public class ForgeClientHandler + } + + private void resetAllThePotions(UserConnection con) { +- // Just to be sure +- for (Map.Entry entry: con.getPotions().entries()) { +- con.unsafe().sendPacket(new EntityRemoveEffect(entry.getKey(), entry.getValue())); +- } + con.getPotions().clear(); + } + +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch b/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch new file mode 100644 index 00000000..cb483b30 --- /dev/null +++ b/Waterfall-Proxy-Patches/0031-Dont-frame-unreadable-connections.patch @@ -0,0 +1,22 @@ +From c3a0de08b9d4d728fe488f5d3b83e19e2766f6ae Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Thu, 4 Aug 2022 23:27:43 +0200 +Subject: [PATCH] Dont frame unreadable connections + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +index aa538f74..99d203c7 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +@@ -33,7 +33,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder + { + // See Varint21FrameDecoder for the general reasoning. We add this here as ByteToMessageDecoder#handlerRemoved() + // will fire any cumulated data through the pipeline, so we want to try and stop it here. +- if ( !ctx.channel().isActive() ) ++ if ( !ctx.channel().isActive() || !in.isReadable() ) // FlameCord - Check if connection is readable + { + return; + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch b/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch new file mode 100644 index 00000000..68aa8311 --- /dev/null +++ b/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch @@ -0,0 +1,23 @@ +From 8a2c6364c6c2e36eaa918195ca370382a37debee Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 13 Sep 2022 20:41:48 -0300 +Subject: [PATCH] Avoid throwing IOOB on login + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +index 763d34c2..57e50a8b 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +@@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket + } + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 ) + { +- if ( buf.readBoolean() ) ++ // FlameCord - Avoid throwing IOOB on login ++ if ( buf.isReadable() && buf.readBoolean() ) + { + uuid = readUUID( buf ); + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch b/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch new file mode 100644 index 00000000..6df0d6cf --- /dev/null +++ b/Waterfall-Proxy-Patches/0033-Only-show-connection-fail-reason-when-detailed-logge.patch @@ -0,0 +1,26 @@ +From 981d25c1f3b03e1c2f10427811c7690c64c2e967 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 15 Nov 2022 18:07:27 +0100 +Subject: [PATCH] Only show connection fail reason when detailed logger is + enabled + + +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 f3d60253..021fe839 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -405,8 +405,10 @@ public final class UserConnection implements ProxiedPlayer + // FlameCord - Allow for toggle the logging of connection failures + if(FlameCord.getInstance().getFlameCordConfiguration().isLoggerDetailedConnection()) { + bungee.getLogger().log(Level.WARNING, "Error occurred processing connection for " + this.name + " " + Util.exception(cause, false)); // Waterfall ++ // FlameCord - Show connection fail reason ++ return groups.contains( "admin" ) ? cause.getMessage() : cause.getClass().getName(); + } +- return ""; // Waterfall ++ return cause.getClass().getName(); // FlameCord + } + + @Override +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch b/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch new file mode 100644 index 00000000..e4bd12bc --- /dev/null +++ b/Waterfall-Proxy-Patches/0034-Optimize-Decoder-Encoder-Getter.patch @@ -0,0 +1,60 @@ +From 69f3e68d5a12bcaf0423d2c18da6b51a8d38d998 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 28 Dec 2022 14:23:54 -0300 +Subject: [PATCH] Optimize Decoder/Encoder Getter + + +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index 6f1d8336..b98ee6a7 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -31,26 +31,42 @@ public class ChannelWrapper + @Getter + private volatile boolean closing; + ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ MinecraftDecoder decoder; ++ MinecraftEncoder encoder; ++ // FlameCord end - Optimize Decoder/Encoder Getter ++ + public ChannelWrapper(ChannelHandlerContext ctx) + { + this.ch = ctx.channel(); + this.remoteAddress = ( this.ch.remoteAddress() == null ) ? this.ch.parent().localAddress() : this.ch.remoteAddress(); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ this.decoder = (MinecraftDecoder) ch.pipeline().get( PipelineUtils.PACKET_DECODER ); ++ this.encoder = (MinecraftEncoder) ch.pipeline().get( PipelineUtils.PACKET_ENCODER ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void setProtocol(Protocol protocol) + { + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); +- pipeline.get( MinecraftDecoder.class ).setProtocol( protocol ); +- pipeline.get( MinecraftEncoder.class ).setProtocol( protocol ); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ decoder.setProtocol( protocol ); ++ encoder.setProtocol( protocol ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void setVersion(int protocol) + { + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); +- pipeline.get( MinecraftDecoder.class ).setProtocolVersion( protocol ); +- pipeline.get( MinecraftEncoder.class ).setProtocolVersion( protocol ); ++ ++ // FlameCord start - Optimize Decoder/Encoder Getter ++ decoder.setProtocolVersion( protocol ); ++ encoder.setProtocolVersion( protocol ); ++ // FlameCord end - Optimize Decoder/Encoder Getter + } + + public void write(Object packet) +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch new file mode 100644 index 00000000..ef5d401a --- /dev/null +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -0,0 +1,134 @@ +From ab1e5d100f2d678f1471fa83226dc9a5af2d370b Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 10 Jan 2023 16:37:13 -0300 +Subject: [PATCH] Dont Process Links For Kick Messages + + +diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +index 4371374a..2bb27e67 100644 +--- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java ++++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +@@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent + return components.toArray( new BaseComponent[ 0 ] ); + } + ++ // FlameCord start - Dont Process Links For Kick Messages ++ public static BaseComponent[] fromLegacyTextFast(String message) ++ { ++ return fromLegacyTextFast( message, ChatColor.WHITE ); ++ } ++ ++ public static BaseComponent[] fromLegacyTextFast(String message, ChatColor defaultColor) ++ { ++ ArrayList components = new ArrayList<>(); ++ StringBuilder builder = new StringBuilder(); ++ TextComponent component = new TextComponent(); ++ ++ for ( int i = 0; i < message.length(); i++ ) ++ { ++ char c = message.charAt( i ); ++ if ( c == ChatColor.COLOR_CHAR ) ++ { ++ if ( ++i >= message.length() ) ++ { ++ break; ++ } ++ c = message.charAt( i ); ++ if ( c >= 'A' && c <= 'Z' ) ++ { ++ c += 32; ++ } ++ ChatColor format; ++ if ( c == 'x' && i + 12 < message.length() ) ++ { ++ StringBuilder hex = new StringBuilder( "#" ); ++ for ( int j = 0; j < 6; j++ ) ++ { ++ hex.append( message.charAt( i + 2 + ( j * 2 ) ) ); ++ } ++ try ++ { ++ format = ChatColor.of( hex.toString() ); ++ } catch ( IllegalArgumentException ex ) ++ { ++ format = null; ++ } ++ ++ i += 12; ++ } else ++ { ++ format = ChatColor.getByChar( c ); ++ } ++ if ( format == null ) ++ { ++ continue; ++ } ++ if ( builder.length() > 0 ) ++ { ++ TextComponent old = component; ++ component = new TextComponent( old ); ++ old.setText( builder.toString() ); ++ builder = new StringBuilder(); ++ components.add( old ); ++ } ++ if ( format == ChatColor.BOLD ) ++ { ++ component.setBold( true ); ++ } else if ( format == ChatColor.ITALIC ) ++ { ++ component.setItalic( true ); ++ } else if ( format == ChatColor.UNDERLINE ) ++ { ++ component.setUnderlined( true ); ++ } else if ( format == ChatColor.STRIKETHROUGH ) ++ { ++ component.setStrikethrough( true ); ++ } else if ( format == ChatColor.MAGIC ) ++ { ++ component.setObfuscated( true ); ++ } else ++ { ++ if ( format == ChatColor.RESET ) ++ { ++ format = defaultColor; ++ } ++ component = new TextComponent(); ++ component.setColor( format ); ++ component.setReset( true ); ++ } ++ continue; ++ } ++ int pos = message.indexOf( ' ', i ); ++ if ( pos == -1 ) ++ { ++ pos = message.length(); ++ } ++ builder.append( c ); ++ } ++ ++ component.setText( builder.toString() ); ++ components.add( component ); ++ ++ return components.toArray( new BaseComponent[ 0 ] ); ++ } ++ // FlameCord end - Dont Process Links For Kick Messages ++ + /** + * The text of the component that will be displayed to the client + */ +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 e8c14c55..6d0719a0 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 +@@ -833,7 +833,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + if ( canSendKickMessage() ) + { +- disconnect( TextComponent.fromLegacyText( reason ) ); ++ disconnect( TextComponent.fromLegacyTextFast( reason ) ); // FlameCord - Dont Process Links For Kick Messages + } else + { + ch.close(); +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch new file mode 100644 index 00000000..a40ebcc6 --- /dev/null +++ b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch @@ -0,0 +1,97 @@ +From f37bca815bffe22461c5b2760596ef18d56a1070 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Wed, 11 Jan 2023 10:14:12 -0300 +Subject: [PATCH] Bungee Plugins Command + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index 6175d8e2d..2ea33a94b 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); + // FlameCord end - Antibot System + ++ // FlameCord - Bungee Plugins Command ++ setIfUnexistant("flamecord_bplugins_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); ++ setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); + +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java +new file mode 100644 +index 000000000..2e20e9dca +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java +@@ -0,0 +1,45 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import java.util.Collection; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.plugin.Command; ++import net.md_5.bungee.api.plugin.Plugin; ++ ++public class BungeePluginsCommand extends Command { ++ public BungeePluginsCommand() { ++ super("bplugins"); ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); ++ ++ if (sender.hasPermission("flamecord.usage")) { ++ Collection plugins = BungeeCord.getInstance().getPluginManager().getPlugins(); ++ int amount = plugins.size(); ++ String header = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_header", amount); ++ String separator = FlameCord.getInstance().getMessagesConfiguration().getTranslation("flamecord_bplugins_separator"); ++ StringBuilder stringBuilder = new StringBuilder(header); ++ boolean first = true; ++ ++ for (Plugin plugin : plugins) { ++ stringBuilder.append((first ? "" : separator) + plugin.getDescription().getName()); ++ ++ if (first) { ++ first = false; ++ } ++ } ++ ++ sender.sendMessage(TextComponent.fromLegacyText(stringBuilder.toString())); ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bplugins_nopermission"))); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index 62712330e..ec5fd4af2 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -11,6 +11,7 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.BungeePluginsCommand; + import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +@@ -912,5 +913,8 @@ public class BungeeCord extends ProxyServer + + // Flamecord Command + pluginManager.registerCommand(null, new FlameCordCommand(this)); ++ ++ // FlameCord - Bungee Plugins Command ++ pluginManager.registerCommand(null, new BungeePluginsCommand()); + } + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch new file mode 100644 index 00000000..0bc48e2d --- /dev/null +++ b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch @@ -0,0 +1,98 @@ +From 79f33268f3f154170f55362decf8fcc8b99a68f8 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 15 Jan 2023 10:12:45 -0300 +Subject: [PATCH] Bungee IP Command + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index 2ea33a94b..e42bb29d5 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); + setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); + ++ // FlameCord - Bungee IP Command ++ setIfUnexistant("flamecord_bip_nopermission", "&cYou don't have permission to do this!", configuration); ++ setIfUnexistant("flamecord_bip_offline", "&cThe player is not online!", configuration); ++ setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); ++ setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); + +diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java +new file mode 100644 +index 000000000..85313491e +--- /dev/null ++++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java +@@ -0,0 +1,45 @@ ++package dev._2lstudios.flamecord.commands; ++ ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.MessagesConfiguration; ++import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.api.CommandSender; ++import net.md_5.bungee.api.chat.TextComponent; ++import net.md_5.bungee.api.connection.ProxiedPlayer; ++import net.md_5.bungee.api.plugin.Command; ++ ++public class BungeeIPCommand extends Command { ++ public BungeeIPCommand() { ++ super("bip"); ++ } ++ ++ @Override ++ public void execute(final CommandSender sender, final String[] args) { ++ final FlameCord flameCord = FlameCord.getInstance(); ++ final MessagesConfiguration messagesConfiguration = flameCord.getMessagesConfiguration(); ++ ++ if (sender.hasPermission("flamecord.bip")) { ++ if (args.length > 0) { ++ ProxiedPlayer player = BungeeCord.getInstance().getPlayer(args[0]); ++ ++ if (player != null) { ++ String message = messagesConfiguration.getTranslation("flamecord_bip", player.getDisplayName(), ++ player.getUniqueId(), player.getSocketAddress(), player.getPing(), player.getLocale(), ++ player.getViewDistance(), player.getServer().getInfo().getName()); ++ ++ sender.sendMessage(TextComponent.fromLegacyText(message)); ++ } else { ++ sender.sendMessage( ++ TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_offline"))); ++ } ++ } else { ++ sender.sendMessage( ++ TextComponent.fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_usage"))); ++ } ++ } else { ++ sender.sendMessage(TextComponent ++ .fromLegacyText(messagesConfiguration.getTranslation("flamecord_bip_nopermission"))); ++ } ++ } ++} +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index ec5fd4af2..f5059666e 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -11,6 +11,7 @@ import com.google.gson.Gson; + import com.google.gson.GsonBuilder; + + import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.commands.BungeeIPCommand; + import dev._2lstudios.flamecord.commands.BungeePluginsCommand; + import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; +@@ -916,5 +917,8 @@ public class BungeeCord extends ProxyServer + + // FlameCord - Bungee Plugins Command + pluginManager.registerCommand(null, new BungeePluginsCommand()); ++ ++ // FlameCord - Bungee IP Command ++ pluginManager.registerCommand(null, new BungeeIPCommand()); + } + } +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch new file mode 100644 index 00000000..5abacdb9 --- /dev/null +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -0,0 +1,37 @@ +From daefdd3d718eecc9ac09fbece9e7baff22e1c195 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 15 Jan 2023 19:03:34 -0300 +Subject: [PATCH] List Command Format + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +index e42bb29d5..555319a7f 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +@@ -107,6 +107,9 @@ public class MessagesConfiguration extends FlameConfig { + setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); + setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); + ++ // FlameCord - List Command Format ++ setIfUnexistant("command_list_format", "&aServers:&r", configuration); ++ + for (final String key : configuration.getKeys()) { + final Object value = configuration.get(key); + +diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +index c22271105..0a5899319 100644 +--- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java ++++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +@@ -25,6 +25,9 @@ public class CommandList extends Command + @Override + public void execute(CommandSender sender, String[] args) + { ++ // FlameCord - List Command Format ++ sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format") ); ++ + for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) + { + if ( !server.canAccess( sender ) ) +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch new file mode 100644 index 00000000..00c27323 --- /dev/null +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -0,0 +1,124 @@ +From 477817bdc183b430c925b7b3841e5b51ac632852 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Sun, 22 Jan 2023 09:41:36 -0300 +Subject: [PATCH] InitialHandler Processing State + + +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 6d0719a0..8beed72f 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 +@@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING; + } + ++ // FlameCord start - InitialHandler Processing State ++ private boolean processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + private boolean canSendKickMessage() + { + return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; +@@ -275,6 +279,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(StatusRequest statusRequest) throws Exception + { + Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request STATUS while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); + final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); +@@ -392,6 +400,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + + thisState = State.PING; ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State + } + + private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); +@@ -401,6 +412,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + // FlameCord - Never accept invalid packets + Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request PING while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + unsafe.sendPacket( ping ); + +@@ -412,7 +427,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(Handshake handshake) throws Exception + { + Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); +- ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request HANDSHAKE while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State ++ + // FlameCord start - Antibot System + // Close and firewall on invalid protocol + int protocol = handshake.getRequestedProtocol(); +@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + // FlameCord end - Antibot System + ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + break; + case 2: + // Login +@@ -517,6 +540,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + return; + } ++ ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State ++ + break; + default: + throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); +@@ -527,6 +555,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + public void handle(LoginRequest loginRequest) throws Exception + { + Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request USERNAME while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) + { +@@ -634,6 +666,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.FINISHING; + finish(); + } ++ // FlameCord start - InitialHandler Processing State ++ processing = false; ++ // FlameCord end - InitialHandler Processing State + } + }; + +@@ -647,6 +682,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); + Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); + thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) ++ // FlameCord start - InitialHandler Processing State ++ Preconditions.checkState( !processing, "Cannot request ENCRYPT while processing another packet"); ++ this.processing = true; ++ // FlameCord end - InitialHandler Processing State + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); + // Waterfall start +-- +2.37.3.windows.1 + diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch new file mode 100644 index 00000000..5619559b --- /dev/null +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -0,0 +1,2623 @@ +From c2ca35b27ef725cf2ce710726aee0ea1efb84723 Mon Sep 17 00:00:00 2001 +From: xIsm4 +Date: Fri, 27 Jan 2023 14:12:44 +0100 +Subject: [PATCH] Implement libdeflate + + +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +index 6f463b9c6..6ec047ed7 100644 +--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +@@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { + @Getter + private int antibotFirewallExpire = 60; + @Getter ++ private int compressionLevel = 6; ++ @Getter + private boolean antibotFirewallLog = true; + @Getter + private boolean antibotFirewallIpset = true; +@@ -324,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { + // FlameCord - Allow Invalid Names + this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); + ++ // FlameCord - Implement libdeflate ++ this.compressionLevel = setIfUnexistant("compression-level", this.compressionLevel, configuration); ++ + save(configuration, configurationFile); + } + } +diff --git a/native/compile-linux.sh b/native/compile-linux.sh +new file mode 100644 +index 000000000..5442dce9d +--- /dev/null ++++ b/native/compile-linux.sh +@@ -0,0 +1,25 @@ ++#!/bin/bash ++ ++if [ ! "$CC" ]; then ++ # The libdeflate authors recommend that we build using GCC as it produces "slightly faster binaries": ++ # https://github.com/ebiggers/libdeflate#for-unix ++ export CC=gcc ++fi ++ ++if [ ! -d libdeflate ]; then ++ echo "Cloning libdeflate..." ++ git clone https://github.com/ebiggers/libdeflate.git ++fi ++ ++echo "Compiling libdeflate..." ++cd libdeflate || exit ++CFLAGS="-fPIC -O2 -fomit-frame-pointer" make ++cd .. ++ ++CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer" ++ARCH=$(uname -m) ++mkdir -p src/main/resources/linux_$ARCH ++$CC $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ ++ libdeflate/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so ++$CC $CFLAGS -shared src/main/c/jni_util.c src/main/c/jni_cipher_openssl.c \ ++ -o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto +\ No newline at end of file +diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c +new file mode 100644 +index 000000000..aa7d1aba3 +--- /dev/null ++++ b/native/src/main/c/jni_cipher_macos.c +@@ -0,0 +1,66 @@ ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++typedef unsigned char byte; ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, ++ jclass clazz, ++ jbyteArray key, ++ jboolean encrypt) ++{ ++ jsize keyLen = (*env)->GetArrayLength(env, key); ++ if (keyLen != 16) { ++ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); ++ return 0; ++ } ++ ++ // Since we know the array size is always bounded, we can just use GetArrayRegion ++ // and save ourselves some error-checking headaches. ++ jbyte keyBytes[16]; ++ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); ++ if ((*env)->ExceptionCheck(env)) { ++ return 0; ++ } ++ ++ CCCryptorRef cryptor = NULL; ++ CCCryptorStatus result = CCCryptorCreateWithMode(encrypt ? kCCEncrypt : kCCDecrypt, ++ kCCModeCFB8, ++ kCCAlgorithmAES128, ++ ccNoPadding, ++ keyBytes, ++ keyBytes, ++ 16, ++ NULL, ++ 0, ++ 0, ++ 0, ++ &cryptor); ++ if (result != kCCSuccess) { ++ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); ++ return 0; ++ } ++ return (jlong) cryptor; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, ++ jclass clazz, ++ jlong ptr) ++{ ++ CCCryptorRelease((CCCryptorRef) ptr); ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, ++ jclass clazz, ++ jlong ptr, ++ jlong source, ++ jint len, ++ jlong dest) ++{ ++ CCCryptorUpdate((CCCryptorRef) ptr, (byte*) source, len, (byte*) dest, len, NULL); ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c +new file mode 100644 +index 000000000..83515be52 +--- /dev/null ++++ b/native/src/main/c/jni_cipher_openssl.c +@@ -0,0 +1,62 @@ ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++typedef unsigned char byte; ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_init(JNIEnv *env, ++ jclass clazz, ++ jbyteArray key, ++ jboolean encrypt) ++{ ++ jsize keyLen = (*env)->GetArrayLength(env, key); ++ if (keyLen != 16) { ++ throwException(env, "java/lang/IllegalArgumentException", "cipher not 16 bytes"); ++ return 0; ++ } ++ ++ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); ++ if (ctx == NULL) { ++ throwException(env, "java/lang/OutOfMemoryError", "allocate cipher"); ++ return 0; ++ } ++ ++ // Since we know the array size is always bounded, we can just use GetArrayRegion ++ // and save ourselves some error-checking headaches. ++ jbyte keyBytes[16]; ++ (*env)->GetByteArrayRegion(env, key, 0, keyLen, (jbyte*) keyBytes); ++ if ((*env)->ExceptionCheck(env)) { ++ return 0; ++ } ++ ++ int result = EVP_CipherInit(ctx, EVP_aes_128_cfb8(), (byte*) keyBytes, (byte*) keyBytes, ++ encrypt); ++ if (result != 1) { ++ EVP_CIPHER_CTX_free(ctx); ++ throwException(env, "java/security/GeneralSecurityException", "openssl initialize cipher"); ++ return 0; ++ } ++ return (jlong) ctx; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_free(JNIEnv *env, ++ jclass clazz, ++ jlong ptr) ++{ ++ EVP_CIPHER_CTX_free((EVP_CIPHER_CTX *) ptr); ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_encryption_OpenSslCipherImpl_process(JNIEnv *env, ++ jclass clazz, ++ jlong ptr, ++ jlong source, ++ jint len, ++ jlong dest) ++{ ++ EVP_CipherUpdate((EVP_CIPHER_CTX*) ptr, (byte*) dest, &len, (byte*) source, len); ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c +new file mode 100644 +index 000000000..1e2b6bd8c +--- /dev/null ++++ b/native/src/main/c/jni_util.c +@@ -0,0 +1,12 @@ ++#include ++#include "jni_util.h" ++ ++void JNICALL ++throwException(JNIEnv *env, const char *type, const char *msg) ++{ ++ jclass klazz = (*env)->FindClass(env, type); ++ ++ if (klazz != 0) { ++ (*env)->ThrowNew(env, klazz, msg); ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h +new file mode 100644 +index 000000000..8938b26c8 +--- /dev/null ++++ b/native/src/main/c/jni_util.h +@@ -0,0 +1,4 @@ ++#include ++ ++JNIEXPORT void JNICALL ++throwException(JNIEnv *env, const char *type, const char *msg); +\ No newline at end of file +diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c +new file mode 100644 +index 000000000..809a7f857 +--- /dev/null ++++ b/native/src/main/c/jni_zlib_deflate.c +@@ -0,0 +1,43 @@ ++#include ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_init(JNIEnv *env, ++ jclass clazz, ++ jint level) ++{ ++ struct libdeflate_compressor *compressor = libdeflate_alloc_compressor(level); ++ if (compressor == NULL) { ++ // Out of memory! ++ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate compressor"); ++ return 0; ++ } ++ return (jlong) compressor; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_free(JNIEnv *env, ++ jclass clazz, ++ jlong ctx) ++{ ++ libdeflate_free_compressor((struct libdeflate_compressor *) ctx); ++} ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibDeflate_process(JNIEnv *env, ++ jclass clazz, ++ jlong ctx, ++ jlong sourceAddress, ++ jint sourceLength, ++ jlong destinationAddress, ++ jint destinationLength) ++{ ++ struct libdeflate_compressor *compressor = (struct libdeflate_compressor *) ctx; ++ size_t produced = libdeflate_zlib_compress(compressor, (void *) sourceAddress, sourceLength, ++ (void *) destinationAddress, destinationLength); ++ return (jlong) produced; ++} +\ No newline at end of file +diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c +new file mode 100644 +index 000000000..d91319089 +--- /dev/null ++++ b/native/src/main/c/jni_zlib_inflate.c +@@ -0,0 +1,61 @@ ++#include ++#include ++#include ++#include ++#include ++#include "jni_util.h" ++ ++JNIEXPORT jlong JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_init(JNIEnv *env, ++ jclass clazz) ++{ ++ struct libdeflate_decompressor *decompress = libdeflate_alloc_decompressor(); ++ if (decompress == NULL) { ++ // Out of memory! ++ throwException(env, "java/lang/OutOfMemoryError", "libdeflate allocate decompressor"); ++ return 0; ++ } ++ ++ return (jlong) decompress; ++} ++ ++JNIEXPORT void JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_free(JNIEnv *env, ++ jclass clazz, ++ jlong ctx) ++{ ++ libdeflate_free_decompressor((struct libdeflate_decompressor *) ctx); ++} ++ ++JNIEXPORT jboolean JNICALL ++Java_com_velocitypowered_natives_compression_NativeZlibInflate_process(JNIEnv *env, ++ jclass clazz, ++ jlong ctx, ++ jlong sourceAddress, ++ jint sourceLength, ++ jlong destinationAddress, ++ jint destinationLength, ++ jlong maximumSize) ++{ ++ struct libdeflate_decompressor *decompress = (struct libdeflate_decompressor *) ctx; ++ enum libdeflate_result result = libdeflate_zlib_decompress(decompress, (void *) sourceAddress, ++ sourceLength, (void *) destinationAddress, destinationLength, NULL); ++ ++ switch (result) { ++ case LIBDEFLATE_SUCCESS: ++ // We are happy ++ return JNI_TRUE; ++ case LIBDEFLATE_BAD_DATA: ++ throwException(env, "java/util/zip/DataFormatException", "inflate data is bad"); ++ return JNI_FALSE; ++ case LIBDEFLATE_SHORT_OUTPUT: ++ case LIBDEFLATE_INSUFFICIENT_SPACE: ++ // These cases are the same for us. We expect the full uncompressed size to be known. ++ throwException(env, "java/util/zip/DataFormatException", "uncompressed size is inaccurate"); ++ return JNI_FALSE; ++ default: ++ // Unhandled case ++ throwException(env, "java/util/zip/DataFormatException", "unknown libdeflate return code"); ++ return JNI_FALSE; ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java +new file mode 100644 +index 000000000..4ba41fc11 +--- /dev/null ++++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java +@@ -0,0 +1,15 @@ ++package com.velocitypowered.natives.compression; ++ ++/** ++ * Represents a native interface for zlib's deflate functions. ++ */ ++ ++//TODO Need refactor and recompile native! ++public class NativeZlibDeflate { ++ ++ public static native long init(int level); ++ ++ public static native long free(long ctx); ++ ++ public static native int process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength); ++} +diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java +new file mode 100644 +index 000000000..81d92e75b +--- /dev/null ++++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java +@@ -0,0 +1,17 @@ ++package com.velocitypowered.natives.compression; ++ ++import java.util.zip.DataFormatException; ++ ++/** ++ * Represents a native interface for zlib's inflate functions. ++ */ ++ ++//TODO Need refactor and recompile native! ++public class NativeZlibInflate { ++ ++ public static native long init(); ++ ++ public static native long free(long ctx); ++ ++ public static native boolean process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, int destinationLength) throws DataFormatException; ++} +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java +new file mode 100644 +index 000000000..a16a25844 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java +@@ -0,0 +1,28 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import dev._2lstudios.flamecord.natives.compress.Compressor; ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.ByteBufAllocator; ++ ++public class MoreByteBufUtils { ++ ++ public static ByteBuf ensureCompatible(ByteBufAllocator alloc, Compressor nativeStuff, ByteBuf buf) { ++ if (isCompatible(nativeStuff, buf)) { ++ return buf.retain(); ++ } ++ ++ // It's not, so we must make a direct copy. ++ ByteBuf newBuf = alloc.directBuffer(buf.readableBytes()); ++ newBuf.writeBytes(buf); ++ return newBuf; ++ } ++ ++ private static boolean isCompatible(Compressor nativeStuff, ByteBuf buf) { ++ if (nativeStuff.isNeedDirectBuffer()) { ++ return buf.hasMemoryAddress(); ++ } ++ ++ return true; ++ } ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java +new file mode 100644 +index 000000000..50f042bdf +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java +@@ -0,0 +1,36 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.Unpooled; ++ ++public final class NativeEnvironmentDetector { ++ ++ private static final boolean IS_AMD64; ++ private static final boolean IS_AARCH64; ++ private static final boolean CAN_GET_MEMORYADDRESS; ++ ++ static { ++ ByteBuf test = Unpooled.directBuffer(); ++ try { ++ CAN_GET_MEMORYADDRESS = test.hasMemoryAddress(); ++ } ++ finally { ++ test.release(); ++ } ++ ++ String osArch = System.getProperty("os.arch", ""); ++ // HotSpot on Intel macOS prefers x86_64, but OpenJ9 on macOS and HotSpot/OpenJ9 elsewhere ++ // give amd64. ++ IS_AMD64 = osArch.equals("amd64") || osArch.equals("x86_64"); ++ IS_AARCH64 = osArch.equals("aarch64") || osArch.equals("arm64"); ++ } ++ ++ public static boolean isLinux_X86_64() { ++ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AMD64; ++ } ++ ++ public static boolean isLinux_AARCH64() { ++ return CAN_GET_MEMORYADDRESS && System.getProperty("os.name", "").equalsIgnoreCase("Linux") && IS_AARCH64; ++ } ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java +new file mode 100644 +index 000000000..a6709a869 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java +@@ -0,0 +1,138 @@ ++package dev._2lstudios.flamecord.natives; ++ ++import dev._2lstudios.flamecord.natives.compress.Compressor; ++import dev._2lstudios.flamecord.natives.compress.CompressorFactory; ++import dev._2lstudios.flamecord.natives.compress.JavaCompressor; ++import dev._2lstudios.flamecord.natives.compress.LibdeflateCompressor; ++ ++import java.io.IOException; ++import java.io.InputStream; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.nio.file.StandardCopyOption; ++import java.util.Arrays; ++import java.util.List; ++ ++public class Natives { ++ ++ private static final CompressorFactory COMPRESSOR_FACTORY = loadAvailableCompressFactory(); ++ ++ public static CompressorFactory getCompressorFactory() { ++ return COMPRESSOR_FACTORY; ++ } ++ ++ public static List getAvailableCompressorFactories() { ++ return Arrays.asList(new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Libdeflate (linux_x86_64)"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return NativeEnvironmentDetector.isLinux_X86_64(); ++ } ++ ++ @Override ++ public String getNativePath() { ++ return "/libdeflate_x86_64.so"; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new LibdeflateCompressor(level); ++ } ++ }, new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Libdeflate (linux_aarch64)"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return NativeEnvironmentDetector.isLinux_AARCH64(); ++ } ++ ++ @Override ++ public String getNativePath() { ++ return "/libdeflate_aarch64.so"; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new LibdeflateCompressor(level); ++ } ++ }, new CompressorFactory() { ++ @Override ++ public String getName() { ++ return "Java"; ++ } ++ ++ @Override ++ public boolean isCorrectEnvironment() { ++ return true; ++ } ++ ++ @Override ++ public String getNativePath() { ++ return null; ++ } ++ ++ @Override ++ public Compressor create(int level) { ++ return new JavaCompressor(level); ++ } ++ }); ++ } ++ ++ public static CompressorFactory loadAvailableCompressFactory() { ++ for (CompressorFactory factory : getAvailableCompressorFactories()) { ++ if (factory.isCorrectEnvironment()) { ++ String nativePath = factory.getNativePath(); ++ if (nativePath != null) { ++ try { ++ copyAndLoadNative(nativePath); ++ } ++ catch (Exception ignored) { ++ continue; ++ } ++ } ++ ++ return factory; ++ } ++ } ++ ++ throw new IllegalStateException("None of the compress factories recognized the environment!"); ++ } ++ ++ //Too good method to rewrite ++ private static void copyAndLoadNative(String path) { ++ try { ++ InputStream nativeLib = Natives.class.getResourceAsStream(path); ++ if (nativeLib == null) { ++ throw new IllegalStateException("Native library " + path + " not found."); ++ } ++ ++ Path tempFile = Files.createTempFile("native-", path.substring(path.lastIndexOf('.'))); ++ Files.copy(nativeLib, tempFile, StandardCopyOption.REPLACE_EXISTING); ++ Runtime.getRuntime().addShutdownHook(new Thread(() -> { ++ try { ++ Files.deleteIfExists(tempFile); ++ } ++ catch (IOException ignored) { ++ // Well, it doesn't matter... ++ } ++ })); ++ ++ try { ++ System.load(tempFile.toAbsolutePath().toString()); ++ } ++ catch (UnsatisfiedLinkError e) { ++ throw new RuntimeException("Unable to load native " + tempFile.toAbsolutePath(), e); ++ } ++ } ++ catch (IOException e) { ++ throw new RuntimeException("Unable to copy natives", e); ++ } ++ } ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java +new file mode 100644 +index 000000000..f28ae3145 +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java +@@ -0,0 +1,16 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import io.netty.buffer.ByteBuf; ++ ++import java.io.Closeable; ++import java.util.zip.DataFormatException; ++ ++public interface Compressor extends Closeable { ++ ++ void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException; ++ ++ void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException; ++ ++ boolean isNeedDirectBuffer(); ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java +new file mode 100644 +index 000000000..3aed690ad +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java +@@ -0,0 +1,13 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++public interface CompressorFactory { ++ ++ String getName(); ++ ++ boolean isCorrectEnvironment(); ++ ++ String getNativePath(); ++ ++ Compressor create(int level); ++ ++} +\ No newline at end of file +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java +new file mode 100644 +index 000000000..7d99eb02b +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java +@@ -0,0 +1,90 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import io.netty.buffer.ByteBuf; ++ ++import java.util.zip.DataFormatException; ++import java.util.zip.Deflater; ++import java.util.zip.Inflater; ++ ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkState; ++ ++public class JavaCompressor implements Compressor { ++ ++ private final byte[] buffer = new byte[8192]; //NullCordX ++ ++ private final Deflater deflater; ++ private final Inflater inflater; ++ private boolean disposed = false; ++ ++ public JavaCompressor(int level) { ++ this.deflater = new Deflater(level); ++ this.inflater = new Inflater(); ++ } ++ ++ @Override ++ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) throws DataFormatException { ++ ensureNotDisposed(); ++ ++ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. ++ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); ++ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); ++ ++ try { ++ byte[] inData = new byte[source.readableBytes()]; ++ source.readBytes(inData); ++ ++ this.inflater.setInput(inData); ++ ++ while (!this.inflater.finished() && this.inflater.getTotalIn() < inData.length) { ++ int count = this.inflater.inflate(this.buffer); ++ destination.writeBytes(this.buffer, 0, count); ++ } ++ ++ } ++ finally { ++ this.inflater.reset(); ++ } ++ } ++ ++ @Override ++ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { ++ ensureNotDisposed(); ++ // We (probably) can't nicely deal with >=1 buffer nicely, so let's scream loudly. ++ checkArgument(source.nioBufferCount() == 1, "source has multiple backing buffers"); ++ checkArgument(destination.nioBufferCount() == 1, "destination has multiple backing buffers"); ++ ++ try { ++ byte[] inData = new byte[source.readableBytes()]; ++ source.readBytes(inData); ++ ++ this.deflater.setInput(inData); ++ this.deflater.finish(); ++ ++ while (!this.deflater.finished()) { ++ int count = this.deflater.deflate(this.buffer); ++ destination.writeBytes(this.buffer, 0, count); ++ } ++ } ++ finally { ++ this.deflater.reset(); ++ } ++ } ++ ++ @Override ++ public void close() { ++ this.disposed = true; ++ this.deflater.end(); ++ this.inflater.end(); ++ } ++ ++ private void ensureNotDisposed() { ++ checkState(!this.disposed, "Object already disposed"); ++ } ++ ++ @Override ++ public boolean isNeedDirectBuffer() { ++ return false; ++ } ++ ++} +diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java +new file mode 100644 +index 000000000..fd9f9007d +--- /dev/null ++++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java +@@ -0,0 +1,83 @@ ++package dev._2lstudios.flamecord.natives.compress; ++ ++import com.google.common.base.Preconditions; ++import com.velocitypowered.natives.compression.NativeZlibDeflate; ++import com.velocitypowered.natives.compression.NativeZlibInflate; ++import io.netty.buffer.ByteBuf; ++ ++import java.util.zip.DataFormatException; ++ ++public class LibdeflateCompressor implements Compressor { ++ ++ private final long inflateCtx; ++ private final long deflateCtx; ++ private boolean disposed = false; ++ ++ public LibdeflateCompressor(int level) { ++ int correctedLevel = level == -1 ? 6 : level; ++ if (correctedLevel > 12 || correctedLevel < 1) { ++ throw new IllegalArgumentException("Invalid compression level " + level); ++ } ++ ++ this.inflateCtx = NativeZlibInflate.init(); ++ this.deflateCtx = NativeZlibDeflate.init(correctedLevel); ++ } ++ ++ @Override ++ public void inflate(ByteBuf source, ByteBuf destination, int uncompressedSize) ++ throws DataFormatException { ++ ensureNotDisposed(); ++ ++ destination.ensureWritable(uncompressedSize); ++ ++ long sourceAddress = source.memoryAddress() + source.readerIndex(); ++ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); ++ ++ NativeZlibInflate.process(this.inflateCtx, sourceAddress, source.readableBytes(), destinationAddress, ++ uncompressedSize); ++ destination.writerIndex(destination.writerIndex() + uncompressedSize); ++ } ++ ++ @Override ++ public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException { ++ ensureNotDisposed(); ++ ++ while (true) { ++ long sourceAddress = source.memoryAddress() + source.readerIndex(); ++ long destinationAddress = destination.memoryAddress() + destination.writerIndex(); ++ ++ int produced = NativeZlibDeflate.process(this.deflateCtx, sourceAddress, source.readableBytes(), ++ destinationAddress, destination.writableBytes()); ++ if (produced > 0) { ++ destination.writerIndex(destination.writerIndex() + produced); ++ break; ++ } ++ else if (produced == 0) { ++ // Insufficient room - enlarge the buffer. ++ destination.capacity(destination.capacity() * 2); ++ } ++ else { ++ throw new DataFormatException("libdeflate returned unknown code " + produced); ++ } ++ } ++ } ++ ++ private void ensureNotDisposed() { ++ Preconditions.checkState(!this.disposed, "Object already disposed"); ++ } ++ ++ @Override ++ public void close() { ++ if (!this.disposed) { ++ NativeZlibInflate.free(this.inflateCtx); ++ NativeZlibDeflate.free(this.deflateCtx); ++ } ++ this.disposed = true; ++ } ++ ++ @Override ++ public boolean isNeedDirectBuffer() { ++ return true; ++ } ++ ++} +diff --git a/native/src/main/resources/libdeflate_aarch64.so b/native/src/main/resources/libdeflate_aarch64.so +new file mode 100644 +index 0000000000000000000000000000000000000000..284450dd1c3632601b58628619dabee4ea57fa91 +GIT binary patch +literal 74880 +zcmb@v3w%`7x%a>J-jigK3FN|6Kr)j=l<}@ug4Jecf)El#Nz#8k+H-Of4Ge-2-_w9- +zCKoL@s7&P?d#G=dfG8PDYcHOYoWB2(fTcogtKsx^&Up_r3AZp<5e-W=$fVy{|xmn>eDNw%=iQI@=x!Ysz9ai(uf=XA&MIEJ)RxQ<`Z)GH^l_~I#QEEL?0!f5oOn+z<-L*kdn57p66fAH +znTfMKR*kZ8mgBAX^NY{<@p6f?l$C$?9DeKp`R(kqEUVeF;y+Q#GP5<)iXTSX|iyV0_ +zZOMCbqj^!1Q&V%Caxa@>636;=>zm7-UGw~Z)(k9CZ(jHG-Pd3HwDaTH;RAuI!#w`N +ze}+m`SEYXbv7sibYIR{CtpcfBN_!XooAL$sg+AxSg}Gk9k$Z{znO{&(&KKO*zu^9@ +zUvOXe=e$I_N4a;Ye&v5bJ=c6eJ+r@{{8z2|9m?s5HGWU*q<#uP*~+1ANRQokJ%0ZL +zXSv@SFFzxG|K@o4Q2c&D{QfuM_nq;268f_vUeD|C@`?Ko#P2^6zkgf29#vKK(8H@% +zR;_-l=F!Khs#MjY%Dbu_So-MFhnB5=Z0VzwcNMQ#wQ^}?P3?-Mv1gZlQdQSjQ}y7o +zl{G7ttzD`ftABLWH|}VxTl&aj%T}#ar8R$FQ&qR>;i|u1x?)w`vd7juvg#YO@Ickd +zn#Y#?{nFL)?2$*8u3k;ys>Rm5`&KNgoxk+K6*Z47ty;En*<*ig9S=Ubbm?DP$0Luf +zs)NY?ztt>S`PX+RQO94?okSgp?mWEo;nhnYQ=IA^S)(4VS-}{|)x)d)eyLjZ$kLVS +z(WNyHASX*7eRSojDxNYzjB4GARjZdO#;NYQ)vK=il3IA@B2RJEP1oHxHz8U&wnXDd +z{1^Kz|JOeApOlw7Cb}f{L;k%O_(#m1u1dKl{}TSjh#T(AxEvpg`<2A~-n3Zx_b$NJB=#@x3IcC5Ji{h0f460IkpG55#E +z%gQNXZ^gBzjJaPQr$_F`RXqMQMz0P%;v*9O?D6t)Kh7fSQRbNY3Es+ssblVsrQbQ` +z{#bgh8goBkQ>307#@rw4QVPc0j}M6ySLT@eWBF4u=Kk3J-ZSR@IID)(|Lz@gKV!`O +z!aUtjO&3YFUY@#B3vc5$!QsQT@gV(NX$ysy;zS)VK%%^WNYIQ5+0<~WVt +zB#ul?ZOYQkQT&tj%(_nII(N)<8rPmN*WZa +zI+tr*`?UR8T<4Ctc603+bA27xwXy3EeN!hEj+#pS_+s(yqVg`K`g6}W9Vkj~_Pfp(z0gPbLEiPezi_nH +zdRM>juCx~$m!DbVa>k)XCs1GYV9`8NQ@2>O9$Gl+<2~zl@7%!mqR|(B$Kh1I^6Eit +z-Wi8E`tjqtFN|eXzVVy?pkIkTovHX)*I7dko-tHVSLUc^syX@z?U<_Yx3uw-I>s{0 +zvrnjJ(3ltu854qMDt7OvD=m3z7R4}f=SSum!mf4*i-|? +zq!RwPh2P6GRq3*;CCG%ggx{a(uQN5^^4SAsjE3?{@}whHW^TNU@Z_^~*sVIQk3T=j +z^D`Acg5OE*v(WX?YFpPw@O`UIWqokJ*7ZTF7Vw;X^1z4IcuWeOtJAyAA)6yca!`Zb +zQLoYUC;B)_pFg=;jn1atBgS<1pfM#F)|36hpW=yTLC4yW92bp +zg1cjFeK-1Wib>UfcG&*NC?aX!^nD&#&$a$UFQ)o=^&U@j7Y5%0F +zo~UEu?6VJ6dxmN>-HF{(1KilUG4-2PH74LWMZXCcDJi35uXh?nPoP%;F>*|z4x^kdf6S1*L2tB?Vh&4 +zrj~41hU4e=&FS8&CZ@IP%3JhFv{LH#AV<=Fz3IsVVPkTzSJ(YQ$19&iU!3}QPKA__ +z{y1s-gZqoR&eeIkM!m&dAFZC>^~u$um%p-fZ%e%V*85g>5B@27i_|CeBJ@@3DWPP^+5(;m_dv(v^Slg4OQ_A7EUw +z{* +zoce-mmvX^ve=^OitE&25<#&OGII*|Kkn7>1i@%6;5Och^C0?|s*F{}TOLM1L!f +zN8bodxpTJ2Wz;}s(YJ?qHdt}zY?0v#ehcpvWxt63KiAb9XkU^`87b$X|5YlB7M;P6zv^GXW!vmWFW_sKg;h? +zbn-B=D|8leE#q;f;wN40-?N=MiJpu8e?!^)$G>lTS9E`#(*32)ty^Y4q~5K1K%JW1 +z+`MH3TVdG_?8G$mC}vaAg6DZ(ni`N&Pu9)Tu7Js@#dc +z@J%j05T=|HU)P#;`Au)2yE|R~w&h>63Bj{zT19)BYA~-=l|QkoTk6u)lIj`72XfT3 +zh;fCgG!50?N%>qu>#s^zrykB%mAN)^jSIcsw!FGAWaPT_+f;Uw)9G!_Ltk%3#$}w< +zjQ$*FZp6DtRXTZhcvo^)6Z~3{t11WaJGZC_{*W;v`1_BeFAnco(Djlr!7u%j{!IB( +z%9ngIiw}(O{2cXtWMl-x{)JuV7n-A0hKiIpRpnOvSP8Us=ypFbcRxOC^tQXzPtuL) +z{W6{#4K+H75Z{-g0#$kH)Q*{|a&xZA^37D)Isd5|u7a+RF)3JROp1iiGYz}?0laoP +z|80wuTdl))#!O_PZ-%PW9A@A#cys2H;sZ|KWAi$S)f{!@!#%t7)JQ%wx7>XHpW2+g +zTiR^uT|HG*cEI;$_#vHO|!?*ZA$Xl^p1F_HC)rUC*>ad+E0y=yB!0wZ&zcj{Wl*=QcH}hS^_M +zm7d#64(xF5-?Co2>KUJr(ZBJE{afr;?B3!iDs?nzD)K%2fKR1A(_HNGi%hf_j(%yk +z>2lTZ7SEcJkO6G|Vq%U~!{M)04uAb<(}CyU<8x(KkF4bWVtBl=-aE3m{^}8rvis{e +z3Y8wY3LSVxPb)i*j8>*zepAt;;sZg~{w>n)3N1Y-eHT6nkM@j2D-XkyWO$K~(_vjz +zc0!ZLX$LYY^67$4E;S+OR5puG2_EV2=;r+1Ez0)DTw`5kg)eF3OCobQYDPqTNn~wO +zf9n)gAo5@TakMfq-aF!UJ2B?In;6qejCrE`K4c<{oJ#u_w{4#P#+QsaB?ojFPiT;G +z9_OAdwR-L|rufA8cnYmT<7&n<^rz@t(SPUgs=2$JyXjl*GlS5r7+(*%;-pV?80aSW +z`S$gyQaNt+E5OXJ)W%Jd;yA_F2PQeO*W?8^Ve7AJC$!#m%@zP6wbqEpz}V5?#H +zugo_KQu0-S$7arJNm28p{apI2PgDii{fO9ou_NC_&YO`9>5I=$^AvtCA&)Oy(YwXz +z7@0e0qz7L@mrl@E^gHN`G=0guseZ2Tf!O6+I`2B+flqTjL%w@~2O`r_N5_>TbItH7 +ztDZz1*!(Fn24dqx??f-g>gW#SGGt5*?$W15`WTOdE{k70cD?zr*yKz5*taboTWra) +z8g1RC0-g>PC{cemvOYzPmiRamQs1cdoP9YX@@_qJeT6>J?!1;(6{uU6@}1TU)zzAzb%~w~ABk2Lr>m~w +zbgj$dle|uktY-{vwD>BQHDSF4_uOqF%!lgb046R8towyDPc#DHsJ +z@d3q{iGB+2>+F}`RHD?Tr_xnca#5NU^Zf#Ou1N#ZBUW3D?K_GrY5i9g_e^YD?gH#+BIC5)^#;L0@@!v_UfXplV3AO&G(5byk?KV`{C7Q +z&xe#hcD?%8Zc`aHr8z`qMzHN47?%-CtKhklsl?fa`y<2V9^RGKb*xH_X5kwOP2!t$ +zRarP6e?K0-gxwF%Qd!mXcWAuIx~gpMdFk`!@oLEw;=#hQ+=9X~S3#38#k+_+!?G1~ +zR6{+sr9+=;`P>c1i5rZV?eEjI{;9;XV)Mn;3y-U(J$b-sU?bix>albzZXXKa+4_&7 +zm9Db61?PyVqzyav>)gpjT_O50ysNZpls+A+GDkn4e_{GBdLw$EztA?I4BbBnFS6n7 +zhh^rdM!UtkHH()=h*J-1zH%GK=`X9%;a#a+zdax0Y3OjY^7NOny)QpCFi4##&?e<& +zEQF86yN!Un`vAwj_&dY97InGaBF05-6FRwLC|X(Pgm>t>_}91Ili2T4{&mk5DJQ%T +z|N6UdbWVskY>++=r@?>tek@yM)g`NJXIXW@<}|g$2~Spk;yK`i|AUiNma}Yj!Cc0} +z$yhkcuHwio_zrc|PUD^8xqiHuZR2x74v(*Q`1UC@;3G8ah88 +zv&QV1I;`$i#d^TSS>o2AL!8n3t(*_@uQ58s)b0`+)pw~hX2_=eS=z+Yrs_}LeaW1Qk6;jQ?$MU*>( +zZ}~3^TH>=X`oS$nylo;h~&!hQdxx@C!ae +zp7fKNnJRF`n9xs5>K~+iC*!Z<9}@TivNn+TEp7HfpR}RyBd#&+2tFgvrM+UG7BFv6 +zqct`)nz)~!_b|41KDJBcNA@Ep4LRax56VG +zTEd1cD7 +zce_gRwrzT9+7a-Pz3}`9_(-9$TmE&bLoEsCX@SrLEg-qRtE9lnKW)nFam-iUUd=}Q +zr$xlCifoBIhZ`Rhd?=7hU4xCYy4T<5>dsM<-^6I6->Z#?ov2zAW{wd!1HsoQc~(Bh6h0E>%jt&`H@thUR`slbkn} +zOB?hd3Hn<#)$=!$D+EIbGk#|(O#GO`oru>ynQo54%Yg7ya^f?L!&&$l%XN+5ht!K) +zTCr?`hqU*iZ<3lLyv6sq1@G%1Mogh?cs?NGWaGdVlwSrPjwAmfYMpS0`tSPV7Mb>+W0Hz1^;|YI#=2GY>}{vQoRY28<*#%agCNJ<4#`u62P0 +zs6doD_kpjx0)L|_*}EH@BT>K9y`H+r1G928&AUERRYuU6#Fp;`h}SJwn%|Xp;Eh2(o$3nC!-% +z20}&*R}{=~GV-S*OGl7D6aIu2sva$aTz_qCx1!zZwYl9n8LHvu@G1}9p`&hf?~@0x +zPyROgL%-kM(^%VG2d@p$dB$0Bzn8HN>mzf8CUad{g~(SMXCM97D<|J9JOd|*+m6ZZ +zL)aY;b@XCa_Fz|9!Hp7iN*iPAt@$|mr9S%<{}BDrp;`3QiQFT{bI36q4-sp`>&sfo +z_->~kua;g>P^G}@kWDa(cd5If2Knnl-zaOvw9#TU>Wbr-Kc{~!;*Y>Hwu55|)>Ma$ +zEC$OgBu5f`IEx?DkS}S!V|h)%VMCR*G*)*PtKR$QOIBU}&!@FCI=k!Q^3kqqmdz4B +zF7ht2ex@Sk!)46Zqc1XkhmlVi>ttj=#(NL865X0ot%JdW$1*ODcI)H=nctq)2wvA+ +z>MW2tBa}(l|1%YDbR9=eBqxj692M+FH1u_O;!(Wz(XzvLa=Js6C?!&&T% +zS%H1y9cXqJQJ%4XH=lQMe6|L$ea>R1KMY-CX})drvowWY`C89&l`R9I;MaN%>*M|O +z`|fdtEdwL^IO5`@po<(GEVld+jz4Dj%IA}(+{hvEmc(CbPwQW)L*60VI!EM>|P%<@6_yNcE^?eok=S2 +zpnaTQ7ugZrLS7!i{x^Z2*C3JMrgUE)oeSAtu*K@Ra^!s1y`Bk&TSH6KGwiL(S0+rRwJc3cbvOou8fsf21 +z8ID;~_37l6r(EzMi}4Dzqz2C3ZH`_!^M{LbQ~GXuI@{d2S=RzZFWawwO8>9hJTKc< +zIbY6PmG^Sy_04UsEWU@cdgkk)a&wPEcjK9m)cU$tE=FU9Y +zOv)_U36>qGefpKf)lx6**U_ejw$w{MUVJmZUEKH3p0r&|d)2h-q|KVPt&1~hv;67K +z#Z?lI(5^{4LxT^`%j7J43KQ?tsbt5mG%YY|ZVP^J*347i$_%Kde>ndABi9CUXQ-@` +z%pYNE9KuUY;v@JbbdH0U$?$Y&S#`lx*zUb*oTH9Ic-v>QPp`Gxr{_GTPDu>*JZ;JQ +zC!4i^y?#|eowvH+X~tpPBy6CvTkq7^lBaJ?O`e|9s7{IB-xF;wpQSdH_ks%~tJfbb +zRz7^3qpZ%ZvKJev{c7DS-}(FW$qsdX)dBp8qjx+sI%OV0_Zpj8tXOTI%mX1ubxGuh +zFPc58#u3*bOUIItGn;M60%+O`j)7h*aXI_93}wnZMS4&hUsqh|OQ8AksjsVZCeA2BlBxzHf|>|0g~-lhU!av~Rc;6e|CCNDHg`%(IJ48BC| +zs-Xy7JnC$oCVV~FtOC{GO-GUQ@zfOtYj&wj$JLKqp3S^kwribHQHQP(`$ismeajXj +zzkiFg*U`AL`z|A;|5w-tEz|r~W~Ry>rfsz@sbY4L8Hl85{_vtl3T79T&hy?;-ZNX% +z9WIsXsCDh$B6Tb0zAe&sR$&Bl^NSBusd15ErTatBBJE!J!&qDG+Ia5{Y|AR_8Ts{+ +zAy0Wv)p@PKv+22M*x9VR$+?F-**$hG!_hiX$6wpa_F$i?t^(Jfzm|QY&$Is!tvvaa +z@*WTUv%`};_}!C?>&dUkySgKHvhLnZe6fq%?zEBOmgjb!{~#57>G4OqE!+3_P2J#9 +zJ<|U{?BkJJp#|IN*|cez#Lwm6S4VD@`m!CK`so$mt2ZS>Pc8Huga*OsUZsAKv8$4h +zEik1IqwND{k*#lFzq0A03x3X~ZB+=Spwya>;dDD~YK_>;5IL1#zN_`A{vGF{FQzkI +zscNcU;`69JA<{7$939!No~^P*^a=er#^i`AmAV+isR#aX3$aF4%K$kn?|7X3(>yBO +zeGrU(8~8hMz`UkOsv#9#7bdBB2l4fXp{o{NRl^4tZ5iZad|IzwRmOCwJki+GsCe+5?-&VZ~>6{Ef=~-V;+Qb}gCtsFT?UnOgnn06>*l=G*(y*wP*t#qXR8LQ3dlG8KSx$Y +zUj~TB-c%WWJ2Y0Gt}58BD(BfX&C$mB-zc}6*mXNL>er2{y4#5HdMRI?+qb1zuf!g_ +zwdJtu=UY4~8=LVa`jCV^U=NfHduasoLKIk(VRM;U2TY*G$# +z+TozzspdRvM}VBcFErOtPFdv)$rCKvoQ(S*v=u{J4&&}-4*V$Pg)ZUaHOXqu9plV3 +zhxBwmbM=Au($f81K3l*{HP`&wd4+$qmhNAldGEYZmkQ{mOAD@EyR=()cewf9c`uJH +z>A`K3?Q2|S@y`SAnq%z;^IdOkDYk6L&*7O3o@qhhQPEY!2W0FIS@vptM0i#NE#E{Q +z$Bw@X95;d<35`ES&WGS-Dq|T$Hxqo7v6XpMiRpUPz4P8y^Pxv~XtYZpmMuE95nCqx +z-l!Qt_~1VQ4foO3#w+@^NW7ewd;gxUMqf))J^z}fh>44=dHFLH{nlK87k%GJJ6`nk +zHO?Vo-$aZXBCh=^*pkGe)trSEuUum{nvw5A$L|eXjf}Tt-okniEpU81G=K|~4&NIP +z+w3E+D9yShkl_@1Q!Aq6&b`RA*e`Mk_c1-ge^^iQ+p*W%Z>tTwpO)cI&ANBq_s#k9 +z?0;Hf+3a_lZGi!GonNP~kE~hQeMQO2f@0*Pq~+duZHNzX6Yq(hNE=&e<9f#N2z-@sl`$P0^LvEff5N8z1Lrdp +z|I%d}A%=O`c6SU5P{DtG+6+kUGDb5=v*ItoK$?jW|7EWk=wN)$QNH`!=JIpQnUgb<7hM)){<-|?)Y-jv +z+oQ)GB8LJm?`SatA@Um;uWDm*f8Qf511{BZT5y*Te&cOyRtOAzWAk^mXuPj?_y$hQ +zRikIAv*1H8$DER`81)eY={_l5KWZ-}>Z%*J$e*@vMqu62i$w@|Q +zny+7TP^Ef*3IBbJRbKyt-B<6K<=1SzYm)I_RbU<_vPT@@g(;QJ{u-XU{8gIrhL{`j +zO*RW;{=Oqk`8B77>ttz8)zd-VEjGFXzuT^-M|Oi(>{2O_7S7ei#Qq$c?bPfn-q$Z< +z-rsC+AuBQ_wsdo+ZY$c^mR`NMj>E&@;;^NIRf9z{Hi4+Dqrhj(%QGd-c+C|_*dGyt%JNjK#e+_Rh_sGZa<;uNaBq}+W+qt~101UNZ1H8eXEdfWYz$RxA +zXJ(Brttog0T%`~Ht@2r~W2CYEK>2@=cAdY=sR9o8g&oOqz^^jxvi?vfwhEqwI&D2W +z?P`ti@cZd%%`UJ7_4Q=8@Ul=%h^&B)YT_H>RIt2kZz`CS@J{6IFXf-tWiHvvnm4bO +zR>m1DT6aH9?7te>snyaP=H+I0r#`{|0+{s`zLRSda9`H?D&3ze{R>nIq9!=|1L)RpHB;)=x<8I}- +zjC&p9{xsumU6U8o6&3Nk$hs~8+0tdm>bOWBGz^28;#+Ae&1$RNNcC>uK5?WQENx=Dp}hN$0e5|M +z!7%)3B_Bg>0-~!<+A7qNz4hps&?S75^-b0EyOn;6KKRgQi^t^aCeNfV%hJJY>z8$J +zSiY>gN=xDVCfRPAjWX^a&75SYNU^OP^VeMbE!Ku(jhULO5MLf +zFpe?0HCscsple5(s(coj!p1na%wvnZ$#_1flK1bW{9bf%FSO{r##S{Wmu +zy*fcV>({b))*9zwHRJUh<0XDw18bGBsI$h)i1RSnJ3A~kCfO}~SxNp1wt0bf2jQJ7 +zB;%#5@shkCVGG_m7`12?J_+5%rRcpOM(=rI5v9iOKhC)oS^BR_mAxlc_7r8Bp??`= +z5;*r~*Z%FZVhxL*l)Dr^yFL)wwEiJvL*z^7`w!}^VGKmpT=3KdPbDARLp&+AOUeyU +z=5suMBt}<1Ok3-OAVAndaMIzUt&#mZq3wD2Nn(m*E4HN8oJ~pgfH>~*&Cw6oO +z^oqUGc;DHJd|2a`8u4K#t-2Y%w|VvqJetp$ykP%ZoM&SX@8K-6QZgE?{2%;2Q}NHN +zi?lHOpov`-KR>ym*7EUxLVgBMY%Xt69gj+WroaG913Rli%Xw +zZLG71&HdkUz4-gVl+4+z5%aDuW_^#ER_5FB4+9?<)7;hR9j9Gtl3$P98&G%N>i67m +zO8~siUzD!-b@h6=-ln?6pZB3}A;T8beS(wt%1h2hUzEA5`@o#J9;o)#Sa}X8gIpbGEK@wRNnN`kN`^1TWI3<4?h1a+GRFp4dJu +z=Qgcj$1SRIE^$JLI6;}&0afx~K^5x)Qmp9NePmykX&SL%ct+ur{#SqX+7Ujp@UHSzlM6R?MhS1zMJGZLZ|>fhzE# +zBHHYjSsc)Yz?(ZJ2PQFA(}rdTrq^8;Q13r+U`E?F2a+WxXWYWA_AWJaWni+A?AKbe +z1L4+W=9i`hFMHsd12WI{M)oZMS!exqTgU0Y;W)(l$P>izA=XA@&Hv`WA$*wR@=JI| +zK4xLhcOc(YYEndzKlwscjT@LhXzi_PJcR#S&{oy$%60nHy;CZbQaAO1t6V{x3{QKu +zqvi)0=yh-~KneLtL-S`NZlo{Jq3hj!e_ypR?HIpSA9Z +z16L|L>t2~p;n{+EnZGl8s|hpi=IiYu#ol&RhpN1^U6ASQK%V_POyRm?L`uI +zv93&FP~^4z+h?LLo?r}Q4s9d3ekT5=bZXYeQPg<7q+vmw+{LS!s(9DKyDoAl +z7w;w8hY&CxT9y|5?jELHz|-zdnp_( +z%O32m;n<73=ud3@j_Zle?-XN;XtUq7sTDj!^B?SpVZ6o@UEis-8UEUI-S2sS!GU7V +zP4<+?Zq^brUJkJvVl%{cXxI%|7bv#FRK2$|cfMHJzOu^1hE!ogYS8CoY)A)t0FK4& +zNGe#9*pdC4RtVk~=Wm)rFrZ#+ih^e~U?vKi;#^c+K>Q)NGI{`SDO24Tw-?wKiBrGG +zzBJ3cX57Y%eSfUI>Er!F_{OSC)v$rwr7B-F>>#GhnW!4J!Z&=+maX#Kp?jsB(3S05 +zSkvjRwdwvl+P*fgi)TmKvrx=+lvu_NkH*?n;S2LVkrrYo;gw}yFYu{wRl?RL_;fLk +zgg?9ClgQ0heo{zP^(m%2N3H$3o_N1;>aDG{r +zSBL$riN7~i?li`Yxu7W`o6_$=*4vn>>3~Nya(vo<)`(20ratjm_wrlt`!A9Y5B)YP +zU3V+yGh%Xb`vp01(OxQY@{0XaIZ2Dli8C-pPAoY{Mh?K`1HuR0UyZEH692<9bJ2q_ +zd4Z0YycnO67tzDRWB9TCfka*+P +z)3LbW3^);M7aIoSWycGj; +zvYDrBs%0R5Q`?qklj^Dld#T38Rx6#u;IMHdaU}1oE?_-cvib==jl7Y$3)-HAjonrs +zi?5R3$}4EcMy-br#H)9+PA4GkY1sK(=G0^k&BUIo%-WSIv*tREm8=(9j4h4`ebvNR +z)t23!HM5Y|>MeYilYMRqye<}7)mX8Wo%^Eysd5(m=Pdf)$-9cRLiEjAqax$oe9=9j +z`wzskGQQ#XGuihc>shW-*iWadPqx+xu@+Se3a-UMT7MrHR>%Nr2LF*bxR5yadg9!^ +zz04P>94ii%IM>3k?!Oqrip7w+YQ^8`e!htD?(dR|0>@>q1bEiJw@d^}niTwq`p+BV +zgCTIJUa+qCUXk*@fu@s!YY{8=>P3MNYhisxQh)fw=7IBIT|rQa$FwbSYwZXOliDlb(PrcK;MPiNDunUY~d5E~mWFCA3T)<>b+??RM{oudqqlYu> +zU5BQmc15mE>soy(`r^Pev*&O|N!Or}?GCY~RWL8v-xo5Hf~-A!kzB`pC}&ZZ`J`46 +zxw^C~#QgMO)(!lT*h=JJYm!3{wR3F?iPu))!ksUvGrUMcjJ$$ptBPh(j?~Q +zxy$yY>+#$8DT&KFS9*xcv2#{jZc@gI$t4#5Tks#`#f7}Mh{dlhVGjQ*s^M56a+0kY +z?3{OHf#cKXonRP3kB>bSVdmb2H^LV$cKTqF?NrzO#4BnNIWpJ>*ckIdl?rU{7;$eh +z_+H@z=EaEdLz!mxHt@)8V2>+qZ8~84y2{=+YmWbIaQoRsrpzBrzn=1KoWtN3&w>Bt +zRhxl{tgm$OI|Q!yJow*6aGdKoXCNECTr+D~O1l3A?o}^z`ft#Dqv17qjhSGDGG}H7 +zr#VP&wiA5egfgvpG&N6EcI;o-{r%n72`*fk^L6tyR;03)z7{IV{vEW^)(~SSZLsfp +zVt7rcQJ&q!8Vusd2F3a1{Waar0`pr68oPG8{Oy{}+lOxEg7e56S``@2qK8yvJ{Zp+ +zm_)l`tzQ+_U_66h5^`-;tI9T|?{6VyY9se;Blo5M6|&#(5ZEd4m3I)o>!KYO?G&vE +z$LQdmMF;0$a!P(L5#05VO7&k)`_F0GyBpuB>V6rzHgPX=psG7ZPxtnU{v%(B`ugJa +z{SrCbmZYq;N*BK)KH-P-^?mqPsAqazTt~rLHr%BuH_)#W9EDnXr06oP>DLJkxi+s; +zm9w?<{Tu1qY_0d-XJ>IR=e!Xdze=ThccXtH`k2G-W%uzL*(cs|UrgJ3l-r}!oJ2pR +zkJ7i_Vv9mbmF?1W?+(hyc=s`mId-#Q5%Lyht;|uw9?a#F9Zu$p`_f!~Wy@juQ+MYQ +z!z(-Mza*w7PR}Kl*PVCtXhtIEP3m!Szo;S>>lan19%W!xz`5YdD>A(voKJXWKSwTQ@n84un~%;S|6ye4Mr6L(u=lf0=~U`m +zY@{}+KZW@t?3a5na@K^7cW}QB9e*&c-y6`WA>`wG==b-~?`7!sBk1>===VN7)!$~C +zfz|8ME&a}XGTqYeYvTI-*przR&0w{n)2UBpRXh(?+h*x?s^7IXud!}nzJCJuMYm-R +z;NUpy6ms8=UXKGaegFNcZn;-&BE$PvbboL6HGV@kN}JH@BJ9}8xL%K2pehfEUbE)s +zyK%kld;CyLpKgom6Xzcw>-p$gTU@Vm^bAX{^UK2p{T{W&;z4*Pn=zPyoZ2E?`= +zVIDzzlGxX)eiK{AdpmU|#+yhIXQ(wf4loAI9!V$9zLRwtJCNCp$hV5m%MGbX;QcAV6Yygn_F)I| +zJP{wT5?L1=ka}4I@4kD6+1-nLi(OX8_jPM-Zank1D*NOU_UW0(^Xez<({EVgY8;O| +zpJo5WYGk-w(<2>>hv-l<*n*6`*yF!+{PP%F<{2e#ANb#lx%j~vbWVKWBi_yt@qc2g +zj+(RlBN9_!v)2DRYoD=8!`OwYS*%;h!^g80ql0=9K0bwKf28kXGfw;>TKNO6H-ML) +z;1HXxE|1%EWZBQNg}f_%Gi=!zY|4MJ2Mpe`&h2$s8_~?T69Z%?#(sm-%CncWG5(6V +zC+5|&+K_``!^Zj(Th^Ot`IamQk7W)jj4X(ab|DLQg0TxOH6B@DJy6zoWWk4>dJb8T +z>*tV#eB@v}HasRPNj)D*Cf5CI$cOE} +zqI1L!i479lBl6F9Ejb9C;ZRjUD`S5Q8T@Pfwv4;wuPy&J9{-o>-Y}8*GUR2Dw#B!V +z>;qrnIrHvr@o$!IQ<}GiyhwarSmpxJchS{O_JfIB$og8LH=lXm+)K>+<}>e`%e=2k +z$-HlDowV5Nv9|iHz2E_ipXip2ev2(^Ll@f6g%u?a6#SI?AvL~iKe@HVbINXG>^z(w +z=9npKGc3BtyO}>?4&k|JA!yCv{s!hQPH>2>hKT7bU&Gu*2hTR~ZW4BEL&=JfQyhg_ +zR-_0yJi+?DO!fvAA``jf5`{*(H}%I+#xUI-s9#oa0^YsPnYoUD761K6%A{KJ0ocu~ +zXQ_L(mbL$zoKNESR$wbcW_;LJi+*f{%$e=FT=q?VYHLoMk4_OgkkEfcnN%&kOmLS? +z;H3Y~H974jE2qVdh+Ppm7T$sVS$iQge9CFcTXFl_$TK=CHcYPhHce#<<*MTRTswvb +zD@s<4%v`hzI%h_jiO)`cjt3duMeLP5feb%czoOtIyvSU(qCotF=uQpujlw6H6Or|O +z^8JI8uhVyUFMY3uuU6mTz046?F+Q}UK*L6D=6=4ZGUXTKR3eLSK%c}4gTgm*0w;de +zDi7a2f=9xO-&0-%A4@nDo8bZZVf!L!y6 +zqm|vzun}5iA48kU*uR6b_$T?k&Y6lI^Zlb3R+7L@#I7XP`v`X8ar&%p<;XgqLa>vo +z`jdhnNQvJmoIx6-?zc>lQv@uhJ-UuOr~w +zQyAC%Eh->ugJd4m!c@Rcj+2{US4NeVZQ&=!{u}(Hh&k4a@slLp6P(}!u$nvZ;ew;c +z{1kS1r^Kz+o`M8^vMr_SH0zXxn8P~sLR!}ea2wZq%#S=oyv|(6Y35Y~KlwGdieM>% +zFAXx@Q(2D@0e3jOZDCjF39VxI1+bLwsGbvGE}`T7>0)b +z+jz>cCy1A^RS7)hYGRt`?c^zssmdrgik)*)98d9rrwBbtOXu4o*%$DXjo>M}z*AEJ8N?ic*-#NLkDZ7wi35&B{q5X%S{LN&$`+FOZIV;f~6SbUSOir +zZ?NJO&0WXuTy%H>SV|{(m&x%u`PReWCiie&$N4yVepkvk|6;I%<;0V(lW!F-bo+bP +z_IHGF0m$iD8iZ%qZ +z39SvqXyBej19tSdkz(!NdJlTH>1qBOX#4x{<6+{IR%mKaY5p6*QVR8P-VW?RqOM-> +zA?XkMSSnkNEBg?{3a-L+b_DWT`oVaTzeX7#NMT$IJ6L;;T +zPjc;iP*s*{%^yzolq)uHcYtm9I3`NGX^8v;f3}s)P_1%(rAD}~jNi62lK8vAf_-)C}G-5J* +zTO31~6d49HNMI<1#NxGFE6NInvJbl*L^lLOsS@0T>v6oNB92!cCXANs%GeCxOET1w#@1ZtJkW^(_qSb +z@vG9t2b^Ur!`!Rhvv94*ZOKW#j|Gp`gPDl!YBEy1smQqCgr~upPg5pBE|`1Gy%lU!auCTgM3__-4tKIgt-;da4DVf6;>*8d_6Qal +zT04ZS^Zx%6)0=9}e&pIfuj-&_lcl?k3%Vm&FWZbayHaX&|=NcI|EWJ&R_?C;_ +zChreiq_;P+uclC+?yaS~)Gz#&Hkkix&yJZw|!2ZG;MqrVB= +zt>>QoUGfcW+yxvop(in0K%Xws-?8tA{{92~+yT#a>2^zho5-C~;oXDuZ3o9e+1Fge +zHGSK`A=e80XRoqb`a5>b*iJ2(zJ02{i{Qcg=6i2`p})tF_t#k? +zU8tvc4Qx^#n2es?d!JKJDPygDnaNzAthc|D{TE6bZ^`EHV(fu7vHuO$P>O7dT=s&M +ziCiv-%Vih+_<{3NA0zT7vL|wR3Yw7Zx#OnW4)$q%!(6jfe3XWnAwt)?YiTUpW8|`%AB!iuZomv2PBG(JRPG-5- +zQ!oADIu{znj_dGGu65{jeLcm^KAWDrRJF!EPOT|SWgipvINgD*X8-Z4$N>B1tu^2h +z(_;I;P?CZ{e5PP1uf{QyyO1N$dB+oHosuFi{W!ZW~}jt-!lHW@H8O<(tq)H$~vna +zzD+u%8r$8BUYX!{_l&{u-Y{?R4;#tgc#|Ua;0NLxODsQ?;q~<0zt-c7+2{A+_bKH2 +zXFRiF2Kpd#^fDfQ?t1mH{E?V*EOt@_$d*K-GwaWIzEk`#+DcR8^Hd)hD|8c9hUu- +z{kvj=XJ4->z1ZKK_po-Fn90SwpBMYP^PSkWf4|d7&j;8Ck0dg +z|MHU?u)*RZgVGOVyoi2@j|@sbxbD44{AAkxXD;%SrJ6xMrh9X5{31UI{qzyK8?-Y~ +z>}F-& +z84T=ZjcpRLza5!QLgvl*9s!d*0w(e=vTkBqoEO;^g>8}8kbQ(}^5V8d}Q}=S(`y=BZI&tSFd>d^n2iw}ontRD-I?xl#Hi2)w%`@?32_JSh +zcI&IuA-SW(*!Jzw%Ga75=^x +z8z03OTH`~1{()zu;H4h={A|1*Ua;GD!ET$tuU+JYC!rU>9gJ~YydN3fW$((~%M5oz +zy%+4(;r`_^Z-MNAlz6-O9qEVT0(R@84f#%Ji24(H@lPL#j!xP?kv@9CwpUXo0H!D3 +zS6k2dhny33ll24vkVH#l?-iPv7@U6H?Qq20nHxc?v2`z-Gt;C(CK;oh6pb8I@l +zWlrrj9*2knwZW6z6$tOsR0#OI8U`y9rj4*H70R$t}0wChBUtaf?! +zGVNX(Z~mpVhFAJ0`jA)h(8$ixhj<@9jqFN1UTTeBZ2wRpdf)Y^>{&{2U&~s(qs+ks +zqX01RKe(6UQ&ShPqium_A@%1T?e!=tC+e~gZd{ihgz +zkwe+DdL!Q^lpNc5Dq6V`ny@=r*85=lA5u=f`F@Rxt@n%VQ&rYlzZib41zkC2Pa0VD +z*tLGHUy!3)F=v{ESzlQ12c9f`4&B*F4lhSQ){`}3+eDvc5{JCYcZ_aLVeQ`CkNwDr +zFTW2Q`?l7Jfnl(l&?+_RZ2fe--`AYJ@>7qebcMjeod)lCWA%qv@7JoO_8$V@_OZUN +ziI_q5JSNurZI?rQPw3r2@Jnkm;!o)D^R50so +zx0m%kCx5{Dz#o@%If%y&@$HQq)*>Hg&5x`Ll<)t^et=zINVD-Z+x5x)tQ&Oi66{E> +z$@T>MI~UpwUm1D5=~rX_|QodpZ- +z1v{#5xqi(<;JIimp$1MM9?!OOibPq=pd3Xu7pim`wuSNF04~{AK +zdf9Kd8~nEq{C9U8J92UFA^632RK0iddmDScUMR6J#ly@&_=uZX=P)Ys2t$-*Zp*?H +z4625g^&bP-;%0Vmv#7FL +zIa?07TMPNskfDQn+b`s73A&!eUe}PbjqR88NpNqW`@M*a`y}3#zGu57Z&QyCT79|} +zxh3{#2(fP9E$G+5A3b1Qd*H`G&2HhFVR%#szA1dHp)XtM3v+gnK4R?}`m&Y2$aM$T +z>_@TYCC2V?WN!+6A%_RIlerIBD{SE)7QQKSBuQ4@)(0IfvSb}w +zWIZE3xPxcbzOdg#Zwak}N0w|l+!9yHnjdtyT%B*4w~2CMR}=EEh&6z((T0q9BBzpZ +zep=ch2HHUkByDvh+9E!2^Xxh5lXz%BN&UzVOY12UTNiQ+8}}>XvV+f^mNd?Puk$MOS_mnqb}S7q&&eb3JkYslQar317l>m_RF +z|5o}h`Vm6@t!MPVfM=JEBY$PZk=t~=UvypiE#D)rp>JF1o796Jh}A>iX7Q{g-nSZJ +z&K<;@h4jA}-^JhDaf4T6RjF9tqMUa_e;EC#udgBI)ZAN_$M$OEu+}j=D1D3Vft8qZ +zg49i){>a&djdF07ah6yK89O!19DibdpFg2AAbTTD#IhlEm!+gi2n3(EHj#{6YmCyOrv=o0)Nz(y|p^ma=q-&31&Q_mF3Dzxv+TI(`rH^PzdNcdaN; +zgzdWnn4i3p%55d17VwZI6 +z0N-Wv=WDE!RSxfQ;>E6Hm1 +z&Btc*CHVt#&3CUWUC?2(>P+*>dW{`cozGmT(@&WYF$);rnnR4y5HXYDcSud?SM&9X +zsGbtp#u&Bh<0GxifrOExKK@2Y60|3C$lnT+Jm@5AbBg$z3wdDj*uJ0(T;9bz4&MWG +zyO@_LGBkf)d>$qb9CB<7*{qxM&asCy#P`rxpA-!9J(=xO)h%cF9U_hsImw;HI)B+? +zuO?aFb=i8wr}5>YZ03WJ#f`eMV$61#tA-aMdm?j9Tt9n4Y)rZpXRaKMeWSh)%va}I +z%@TWRe5YB(ztc=4^0Cf$n&mqiMcCh#l+xLu`|;;WceJOZ%@+C9(&w{R4qL)K_F(qp +z@C`WG-!A1vw$CE_Lbr>xY_V7pT#ontym&I(iYJ>~<|(G52C4(TEu-+6ares_A<>r| +z#2^R3;z#gNzx|efn&?gm_hg**Fy9tpoFsQWL~btfUp+rIW+HnsZr{Rg()TRG(92|= +zcoFuymGxuaEv+RNo*AhDE7bGByvE$?BaYYSfA*eB?mh6?dy><`zbx@>$R>4GTXlvR +zGnw;@+5f3A-=?N|Yth3&WYeI0j-h)ufTe$zeWX&hb$RT&hX={KW4XTa)=^$$UgTde +z);cwF|JXGr>AXj{=$-DJd%MS$;b)2H@o2W-(IS2Cc +z2YmSv_U9j@?BTiX(+)C+%X;W(+m*)O>>3}*BkmPFC{)Q_JL?e-g2{)mYsV<_T<$Et +zV0$I~SNTORiiqP{i1A$a)PnKb+=lCp9+7pC^Ew;+cO~_-61U0kR^qliv%&hEXWrN& +zdLcSt>BG_JoIYZ<6O834Eu{`@#|%xT!9 +z6l~oQ?4rnHFgeZtYI2HS)|ZOUJd2E<`f*B^*hCNImRR;H)q9L_3MT8=#0}GG$rYr& +zAhvKXHnE!XjeBza8E`eSTw92)7SKdS0C>3&G_YPCvt5$vMFVy#1 +z+#Z^=c@{pO`Z4R~TX0c|nFQ?HL&S`Ato2@Rst#XEO`6FX+uF4$k +z1P>Csb&7tRWA0b%KpuMl#6}%MC&R16Cug{ajd8(euvvn`9FjFMjGx#eDK9qZDEBUH +zms0;CyVOK|VwZ-Xk$p<;bI>8*TbFss%;veT@rH~0)NpMKSdlg+@I3rN;P+$WBrfV&StyX +znU}@it;l4ZA-Q}p-xFxP?MC(ysGSlMNi0+azM~I)Hir3RkZbrd+`kaoOlV`>JpJkX +z*J$N`7pp49IoztbeJ +z?_-+1U)`><#je&+PZ--0;#*fAf!U>_$G_Io%VeLP*wpJwSBz|C&39De+rHS;^n8^y +z_8ziQnLhus_cXcpz-RA~%T=bg#cZmx^s$lWOCB3xEl@-Qvp*YOL))%Rwrpy_Yna1eW#%DwBCR~KxokLd^BbgC44$lNM)av$B1HPa`xiTh77S9_AV+LO%H +zhO~6YhujyQ4#s)96`smIDv6i>Qokl~y7;vvo5Zi#f&rD~7n`)6ob8~ltVMJbA#xekos3Ky+8f?vUTF5gk@- +z>|;fb#|zCD=^=j$FethxdKe;J7G3NZivA?rx~NOWxR$@;lBTqN@|Us@e!+#kF-x5N +z@-0lkPs7v)W)8*}(ctL3PA4Y{o+ckSXXPc?);{c6=)>2HDgI&X%UGRrCYd{j(Pg1uzANeDJ0y|| +zTuSE(pHN+ePw=;+veanRHz}l5H!heY?m!l(N$5He!F_t$oh9XOH$lt5|Bm+$O2I3mlIGjcIa`IKf +z+u&W=olg%GY1a338pg@mDw}WM^&`<2t&)=%3fmOaLIITf*THQ(lJ +zzmD|^%&{oGD^WvkH5iS)kADd$C$V3A4}UG+@=W2In@K(`P(5CK+yZ?vREd25gjYkj?ZgNRt9wnYW1 +z`G&ZOeU!hYCjE5sT?Wao`Y7wc +z+_NUP`SzMw&9{#&_ZZ*x?L%JfH+}P#`S+Do@IXi**_+prCZN7sZEXx?>(P*X8-&% +zz9}KRc}Lkk{|q}Z_Srk?o~tj^xi;~P90WQ)^Gx>dSo}V}@N>^r@Ju_;zB%N-h8XW8 +z`M&5t@0sXNMEHaS<9=V!&<4P)hm3LpxRE;}sP>nwdMPIzanB=cA`2IBXn*2>C`MYQz@LmdhlD)S3_@1-B@d@qwdUzNGE5svOEZ_(Af4&H0dR^4Ok`YB~s97a~`tgGbj>d5#F +zF_)9848N4GqWx5Ivg+CXf!@qlPxt=o?@xC;d*rldUGI0y^QH3reZMPT1)TWH#QSF| +ze%kea+Pn7nsH!`E?!5Azgd{*9kqi*z=@1?YDwfGi0zn`|Km}iu$;>1fm`8SI0s#?Y +zq&})`gLwmuL8WW0-DS7<=&oI(;x65Gw^Tr}t88d#rE0sVZG~3Iet+klGnq^h=|{VN +z?frc|-}#;UJHPY0=lss^o^$TpnR_l3V*bfxAN>gJosM^!(f@Pse){aCxS#5SYys+Z +zsgRFFvp!k(y4oiNrN@>Q;D6T`7f&1dZhJbbdF^D(LFLK&!_*h&@%xnb7Op-vW5?5b +zlP^{so5qq?8jWRX2X+|NJ&kv^8x`Y9ywiLozW<*!u!My%X0N}H&n|SQ;=R3yCwm_I +z*{`rK(rG+bqJI7Z)+c||o1XdX48OK!_3PNxw_tCr6FOQOV=utzG*6Fz#)7(@R9M>- +z^zG!$4KGek?z@fVfYb2H2JGKu!#yAQlw#~cKL0Py1?r0<@GbGzd0dHooss`)!toDr +zEcYX$-#|Q`hkZ!lBL@GgdmX*RuLs)iNUb;R$1=Eg3+)w!@2xxaa}i@$zdVex`ky|s +zmflH&@7C6zM-2C)9iEBoXY|fhdN!kx# +zrKFPcGEQXv3|v!s^fT@GM&Bj(VJ$t&+_E<9`Q|s?$Nmp9FFn4Nbd6Y(yv))*IB@il +zJ=2--kprLEj~y_uL(^!lGUQLe?~k#6&+aRaIu{q=Kd<-=aT?w|i1)dh((J%g{Kgc& +zkHIm$2i=f{-osY +zXBU^I`M6MjyyH} +zy}}=wZ!b{Oj~2dUzRjYhHy8f1d1H~9zOnG1%o}E?>6wK;FyA^yO(z$=XuhSm?}mX% +zFPKkFdfxmL*2BL*8%$VxJdXZQz<0Ggv3thU53LrdaL;|C1iS0u&}$+1pYKNgRaW +zkZ)-+6*%b|@Yx4sTnm +z9&cQt@(s4W8z_$SB8Dh_D5fZe8Va7QzSfS6i25K +zM-2P+ytnIx3j40-@jkf&NI!@4A*7$G_~ouAk^X*#0sZbqycyB=CiHz1`reMb1G~O$ +zHc$*8-+{a*kS;|&-c4u5|AhINLNQXc>nZd7hzp7jiWQ1GO1oPSdkOKP;D1kljd+oL +z`eoyzS&UhqtotGM)?>41&Q|9e-80YQcSLW#zx+ZUo~2yMVHa#Vw(wP?U%|~j1MvNB +z3#+_(x0}u0?PNPX=JO}!L^o^Nb16ri=cg{F@1t^``DEQ|Pt$*Ln6B_mJTPga=Y3eC +z9eNEm+>2@7Of`?@9*WgZ);)_o(bRXM;amrq&A^}CeTw=id>z3q)Sja6md-DtdY{LB +zc4HyO`^(;-`G10?>5VCP-@KyFeFXO~v+AKszYPjt{(er!(q6_px}L=~duXSvmGY%- +zjnMlL^FuGLJ33}~E>MW~x;4>viO{_XGMe+{nu^vmpR7C1=ftP%*z*SKQhI0XF04`9 +zl|_#vVUbW+hkHiYJB>BB-G=wrGW`dAIJOyV-zl`Qj}(j(uORON{PJA3VdZ_e_k0ev +z=)ZZB>vtTZdMbG4LeFO=;QT*=-lfb*=TE!w-J}EmpT_;c_c7m|#=YJX=r@Z&!MwWT +zV?8UJUzOD~aVgt|^dylEA$^5N`#)B&?~MgIxc8lJ+rfTtDan4Gk3CcMCoW>2)Qfty +z`y%#2eHq6jM}IKCuiE3S@w=j4i_7m1xhdfe1?t1zNF)?yY?Et?Yp&lFtev~2A-bk! +zwKot7Zz~IjDQ~p$9&fw_RnHexPvUV!T^3)&Qtk5a3~s+6>hsUt?yH|$iri(PaKIHU +zYjk_-qrMO(1WpY>Y18YmM10%5WW*PAx!nz6)R{E|HwQyogO<4VguT&*a1gEWc!d$L +ztTEXvIVr`IYD_bv>oas_C37${mcm^HCIZYu0KTbXcw)lvOBnnRmtoP2cU%Ff0EP*c +z4rBnBUKrWR0>%K@0MSre3T!E`qk|0{%ITr2XA^K1jIL}Ra!UXg&UPR03N#gbm3W_$ +zj2EQ>`V^)Z0299VN(S&(BP9#SOJ|A&D9&Jt4XBbp1)5L?KnLgn17HM9KoXD)qyVWv +z8jucT0A?T)$O6Uyc=W(>fLvfKFb)_Goz#9dJFc1h@hC3a}Kg0VRMP +zZ~&!18L$jk4wM5cfE$68z$#!hPyws~DuJ7TwZJ-HJ#aH{3ves20oVxK2HXzZ0o)1P +z1vr5!zy(wTZomV0ff}F|r~`b!CSWt*2LeD42m$rL-vD7C0z`oZU<-2JlUw1=tNd2DAcgKs(R@ +zbOK#KH?RlT3+w~F1@r)q1HHh0;0fSK;3?n$@NM94fv17*0M7v51)c@I2mBrI_rO8m +zAAo-Zz7HG%o&%l-UI1PMegOOv@Xx?Yzz>0c0bU0BfLDN5f!Bb;!0W)j0{;da0e%Gh +zJMd%RC%}II{|WpQI12m>cmp^F90yJSZvt-tCxN$tp9B8|yaT)ooC5wE=m$;%zW{y- +zoB@6X{2F)s~eYway-%1f?WFlU*8z +zfE$Pa_XAG?uK~XVC^F)S4t0PYkP%8fPLWCHrE^XICIj<;62JxA2fP9(3etcABMOY* +zeiySNfbdq*fh-^oumHt?4X9#qMA5)Qg@T2`MWqx$sR@*pKU5X6Jzr-u{iPbV=+I!;7igKUy{^bPEJlrGI64DWK^Po<}ze5 +zjk8=iyLiDh*Is{vt;A8btbE0dD_5;vQ(1Y_+I8!1zWJ70H*DCr@wVGgs%;O`A4t-n`il3V?#aU&Dyf +zxC;$-duwXze4Eglfgt)2y@!6I4x^r;2Hkx(+H%i5XvV$wq6Mfv>P{6$tx;vFF4dH3 +zNj2oPqnhzb@e1*}@LIHR+Rf=PPOU1nacWnoLr|xnE +z1(?AmVrI$1Y&MRKWx1HyvN79aVWu-<=1IqzC>66%GS*5atZEFHp|F1lvn~C~4NI=S +z?%KtRuDN>Qg8B1`=UT6tGkey|8Pl(vRy1|WWJ}?sD+=-_PRJWSZftH&_L!_pb4Gev +zYD#jF$!O5)l)3fckb7>#>#v#XYG~ZTlzjd5`_R7mXkanEs?4B7>5`!&jemx5C0&f9d41V~%fq^dYqu>X@d(WaC;CV0z(6ke +zLj3UF173+QuNuJ*gFgk{5B?&!;T-%;!3(0eB~rHI=TnW7l>Bu3TLZ^fQm|+({6d)^ +zlFb2HAX`ELP!V7QUV^L=oRwTvVzzwC(4)7v>MBmXd&~?8#8kEpI0HRYmlN6A0rbbp +znk}t{Hho!-t~~Ylu~TN|NV9XU>eH(3SxVN4^Ou;jT6H~2S?Vb|O&Xo!Cx8X{@*E`V +z2MQpQt3u+x2WCLF7@P?^rEzw05tHR{b}Xb1St(=(sf>tTV4`d};T%J!2g`*}5&%%Kv)j?VrDO^2D3e0-ZBaLO$z- +z&3$;_UYW*i_9?A-ZQ~uCxm`Jq?(98dmbZ`V80*-ZwJ)>0$E=^N7|S!(n97$YTGH)6 +z#!gdt2<%Q%c_1-g?W1&DLrq%|8#oma`OgAbJ!I)z0$+kJgscuS>O<+j71Rx&T!6li +zZ;Z1;aGC; +z5y{R#_B3Q|T%yX(LpGxkI0qSC_(kpNOR=|iC>`xeX=|6#)~S?swkch$ +zilgT-MYrq}b=$Gyyv?Oh$Foe9j2~1i1gElUKT+>2>&bR><#guio;mrJ1AWeWTPRRI +z^<_`?O()-CHWZ~Vt3ShdbCeujVm_#}j%yq1=*;dKQ{JB2k<*>ECv(|e^S+Fpbp6Y^ +z;oZn>9EXjE9>&;!u>>|+l-BIFF^=}Ej!Z{)`ku7Xy{Y?B$~(q#}1r|6dsv17vDMoZEx +zC|U(O&+b8gkWcOACf(Ll$|~ib5G?_AL1*7yT-S6nG{kpn$T<|}6yXT)Q~Jc(+EC;$ +z%6C1Bv3DFVe^hCm*fzn@p4Tznu{V3)n9}atJvrr_wu3MY6|mG&r(cHOcQrSYs!rj8Kpg@byNfDoaG&9?dguLl+IMgo}}*Nsy9!RoP4X~=Wol? +z@dEAX9ci7ZT`Aqkdy;xgC8=+ouydu7v~sCW*B;G#OYi~|sy-3PqL9sjEPkAR2(lu` +zC?1IJ0QNyv3E4umo|UbsZ7KF1{f)Ao3Q$@F7Sw~WP@_JO@ZK^`2smn<9ZBOn< +zqI9=`Do2vHOVUb2ijPyD(K)dpy&T)$!OLDZEI*g7^Lzmv( +zqmI;a+*aqxa+EoQGJM>@oYJFnz?W)!J;-|zc_+yph{m->$aZ1=r?HMLGuw>i$;K5) +z4&#j`BYros%3xfrH&*C$52cz`n95BRrd6iZrW;Kwse5iRGl*8uAs1JWPmjRf5&W=_ +z)=xw;fOjCHwMCQ!CFbH*Q=8GzZs?#%wvwDkLyWyiGA&Z4fVj-JWOyQge?n<7p)!`#PpNQE@Ir}RvQ9a>A&!Pa@$szRC~ +zw#RS__YWOvq$YTG!JMV&^(}dK=Xj+0nG!N +z2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk4`?3HJfL|%^MK|7%>$YT +zG!JMV&^(}dK=Xj+0nG!N2Q&|89?(3Xc|h}k<^jzEng=uwXdci!pm{*^faU?s1DXdk +z4`?3HJfL|%^MK|7%>$YTG!JMV&^++}*8|vmic_C>U-r3+^fFAmFPnej-Lc|*oAMo^ +z{Qa@WqgTKZ?b@w!+T(+$UzDf)MTqcPOimL8KP&PJ#Iel(!=-@`iOz`=;}x!)=zZlx +zc$F!qVo@JaU3RlL7R})A;v_|SO)=5g0o9;TV-{gwzCRhS5amRBq7c!0LW!hYCS*O6 +zMR|ISE)l)^ljzcbTK|4g(E)KR)EQn$&fE8QA|Lz9@nhLe)yiM*^StnLqQxCddLl7r +zdn$90w&%PVf4X_+_QT5O$XnO{7Ae(}P23oJ9%Vhg!)S5#zN +zRXh_#sDJ1^u@tz=ONx{QF6<>Bf}~XNk#uA{FBa__Nk_(bi-`4+bSlL;@A%XG7%~tak)I>ao*= +zWq-V;n$}|vioPdCl4r%n$M{^@Lr{*3L*>~_j>kjgIc%isTaULszbMALq55NE+D$64 +ze^vSL{-PR=e%=%&uN`g{AJUGzUZkA%#v0vD8k5(%)Srz6)jv^A`$LetNlsXzfQ|Fv +z{p%3=ay}O7Y$Fm%T))W6)y5Tu$B&om50^g*In_tb`@A?lY&s#$;_bmsfZ)_${X)+7-heC%0YGvL9h~_78A#dqQ3h*y +zj3;6rv!PFW1WGyW14mRLe2nu~0=flUPZhqcDx#}UfqZh!`gII{6{20QfjHO7bnQC +z5b{bPm))~S$m@k%xSQQ1PiJB8e`N0m3KjCD$VA&0X#eOJo& +zsmGN<|9K%lC*&p^6WRD@ChJXz!yhC6^RA175AuSs4{2w^cVZ%*c=s}P&OJ0#U)njE +zVCT1&vD5$XP&=POpW;W#Pm1g$j0Ys|`X&*E +zS4)JQZwvXs0#(58p^$uD$oqs`&I?DmeE7QSO`%^T=Eo{w|5G7v5q5CMDHk`sRG)KS +zRgde%by^HLt#hQ`q(1FEqhN=(#P#q-VQ0OtFQ?C~Lf$9hHdmatL&z%=>hpq-7mEQ# +z>c1uANAFV&SVV2bZU@gQ7k- +zJ2-i0jJv^3VI`~$itjY +zPsmy84^_MTPERxxjySP1BXfrW^?q;E>#-J(tl_Nj1$|CeIPBWy^ai8hZLB8j3V5BK +zhCpB&io_i`p&1>bx(P)aqCUUX%_zCu@2hrtyfuDT)Eh7I1*J%2LWwFC_C_Mmt8Vc5 +zJzV7RI-{;?zZZ?#FzFY;#5$ +zs-w_j=pt{>@@<(Eg3%E9WoplX0H33)9NsWl*)c6}B +zb*h1wOrFqL<3e0S27MH&kNN_>?Ovge&~i6W=Qsntpfli#y6eb&!|nK8+qaD@oj+V$ +zi-vhdP!D=tVJEMF%O5KxyC$*MVhY~IXxQbHYSljUoAj%ig_5;Vcwl&r=-(kZLObFQ +z4SFR`=B#!_27N0Gkn*S*j9f>xN1Ta}bczsiha#x0xCmsQAcnXk?%3t=d&3LnBS)m1 +zwcemN>>E4|dPBijCLQ3~j$+GI5A*mU^}OFi(U_JG*Ew_7H#lp&u4n^-8|EW!L=WxH +zYITQ#5i(GZT4OLl4AM~IbS_(4vbxM!R#ED7#)rD}xU96ZI@A#K#A{I0#~-`=zS^MI +zgP@{|gz-@&K3@zS7_j217_Y!DqrqVz6pqhKtWSKNE1X~y17RfOtaAn7=6FSEWbh>M +zxkEZ>czcHzc6uA*%hSjb@CHKRZBFh27lz>Ye0A`U4o%2Y10r5MA&TO&q^o%sI7>HH +zl&oIih*wA`n@~};B7;sCT9sNfLsk-lDI$G~*N;HKBM4_%xrmqY(zOt+U+oZ)<6ORK +zjlE=*bIr14>&n(U*O%B=l?{ofAsMoLkyAE&MicgWKFK+q?nW0~Dd^GdLn@-WCBAB* +zdT%iP7_~>l#Y?`VTX-~mNgH&Lf6?xdPL$n)g-v9LPn^!$00J@+bz#1AVwK_@lKlm% +zE>FvwANIOD@h;_^H%ixe!{K1ai2&q_j`&i{irE~?81QIV<#jR@3}Izd8*H%hHP2N( +z593F5u1FoTdbR~oQsvRGnzO|lj!+zNHF4lXUfAn*Q2~*v$HK_U-EWOznq*d5)gdqB +zaYbFs>a7#&xH=EY$|JRex}Z}_$TXFrQ@{YPjw^u4$y$p!ls>HdY^vpITuGQ+0s*WY +z)k^Y~SzXa+*jL?v)kysE`U|J&IXZ4Ra4)5jd`>5Mk&sI!@2BLk6^TFMS+guJpXW(# +z6N>mchm&02i$mo7^l-xpvK~#S_x2!+Oh&%x0$?~!1lGG`n +zWKm&xepz0&KL{NvZzpAte10jpC9eEf%I8{xzbk0OF{$9TnUlPqmR#QVifn!^nI=wA +z7++pK50$*1l;TL5ZPnMV8Q=J#( +z`-K0b-(PtV!@*g2V=TB^>EHB3|sW03qtTXl}WQd`L +zt2BxFKP@yYvVbs=GSC^USvZ*&caa;%l2&+j&9pQI)Nh{|PC? +ZQ9^b2<4NheI5jq>K-J7jD3EZ-{uco)TXz5e + +literal 0 +HcmV?d00001 + +diff --git a/native/src/main/resources/libdeflate_x86_64.so b/native/src/main/resources/libdeflate_x86_64.so +new file mode 100644 +index 0000000000000000000000000000000000000000..cda376fa2c627f3457d3fb5ef79b2791f47118d7 +GIT binary patch +literal 61176 +zcmeFadwdnux$wUy*+8Pvi4rxnD8X(|iMJ9DShj%8;NCFX?f@z%tyr~c6zhdT0@zYb +zoSlT#aWwVXi>LLRdfxihp4XnEKSWW;=8^#30#rb)8mLN!2m)3JDCGS&|M^V +z)nlS;$_F(!$bCyoP~phyAHx1}*W7oP@}0o>pZ&|B{j#vXFT=~Ou)o|jeAMGBp|gDc +zpEzk+XJ>EW^-=$X98WyT8yQ#GQOXOMhojXO +zxQOte+e7_^^ClSUx3eCr7VOhV8V6?c~aD2+Qlj@?1NSYp%KJwmWXWW=_p@ +zvum!oCUQ+`YSlG2+&KHjn`X|bxpDT?s*7*EY2A+ +zck9d_-59C4dG;OilJl>>aaPUDJ8q9$a^2kPuDSk>+pd{=AJS-+1Hyw2fJ_ +z@3Kdp#@nu+b!UXjoEvK*w_SHDb0kl<-7)vZ2-9%= +zd2{YK?}Et0bZY#?*PMS|#mL^<^UoUvRlzX&|9t)p?hT|w-+#R3&*0rqUgzZ1LqB^2 +zF_IrC56fy#omnXDjFcw$%gOZ|{f-FfwltL6x$<3MgQGk2XOUca?z!@a@>%Bx^`;+D +zzU%)4j>_oTx4_ZZ+J&=C*@i%hc8C-E0=eF`}-RP{)U0SVc>5V_!|cP +zhJpY8W59MkDzM!F@4Oy~*bOZ;c|Gm6v$9}C@4$LSZRJ(ZneX$jIkb{HdA?cR`yD;} +zo%xnLi}~TV>*w|IEGCfOqMz5wvzQwGANBJ+JXbgKtp99p+?y2G-T?W|j(69b1UM7q +z9&ieKI?SPUQgKCirT+ic^+)}aT*?pG*+coZ+GS@uzhxV(_PRqgB{XnS*g!!~N3}UL +z(f57bxS70))P7@{?Tp(iPQ9%@s424Dac5E9c{Lz*-poI(11z46t8@M4uKtgCS$&>4 +zG$T+&ny1<7jmvHIS%AkuJyS*q++VTX!M1wOR;{*s$t=OBt+rovbSMir?01~tzJv3HU5QNPer;IL`|&~Vz2AE$eI@9B_doRO +z|I>rH{@cIUe*sP9zSr&d!cZK*kgQnK={ypNINe6gd20D$p`M2IHK#cT^5&ldR*}B4- +zW=)-zP^*$^wT7_%qn`sq+PfiEoOb^ZYnKQ2q1a}w-}cg(Xj+AI)J6%wIW18;o~_-j +z)(h=)iNjgmO85~5t|~t@M@~%>^IEJ_-G_zdDfwnmySiNyqZiw+M61iUeVH= +zaO1Xni*gSL2brzd_&r+-R`Di#dK-JUu?2(Ny$UYI(?y=AxpD+{C?85?-ZIZK(xGaMNZa +z6h(IYKy3#!Iwj>zO-2%9rp5})CWltcdoui+aBq#3ES5%-4Li(+m*vIKhy}}lzofe$ +z^LetNr{-hp#QG*+~AK1?F +zJoC9r4pBMj4!PGdK1-+}jurp3w#8B(3E9M3=fpIBCe&72y=ytGM$&lS&Th?v7zTIl +zJF75i2LS0u~ZOyQ*w!UXwv!ajxEN_C5Qmt+}Q*6asOy_edHms=u$W@C) +zTvn-WOTDiAD)pDNTE3xUUpxF?B-25~h;Cl_%cSOpjsR5wA0(LKqNLiDP#;?5w3bZ{ +z^EZ5G#rK;HcY@H|2$Q@}+pX-Df~2uJnICnPZ*36rC`cIVgx@T+#@IbUMcw%7d7mWI +zZra=Mq1p{4CE~uB8A8X23V*50g89-KXZO(Z*TPEPBvAUQRrsmpd~BEvKcJ?}uQ$m^ +zxC`zrPN~=Q{Q8&iq7NTxJLrUbVnxOdK_|pnpi%nU{XIPb*I_dbbrm(NF*A!0hiP@d +z?}69*$T^_oBT3jFtp$Q#%{NKm0bz2>OZ8}E3Nci)B;xDLh9ni71+fxsSg!f-q;@{)mCf6Rx5sB-uui-LcLz-3l3B^yQTP8xnb%PMtj|> +zEvje3Yd>^EJT!C15#VlZqDqg3kq*I^c>}S6<>pjkH&C +za!S2!U6E3UtZ7y14Qpyj{dL;q=%t%Q;S9IWJ)2>q>bvD)n-j9ObKonss)^Y)(2bBf +zr73UxHeR)+DVb97cEt`G)R##oT4$wIXS%$@cDe_djbA^O#@uL3y=iagunRk-Lb2NH +zygWMFnNQ)qcBf-d%2;W;Gh)T|x-RE0`Oar~X66y(V8h#H<~1#@ +zh8+oS>^Jl`wXk>HXQ!Kuf8d6;Q*GLqN~uq!iH_8U9kf!uBDJrbW^C1-9@d&JZ>MKt +zA6mz}f0`cDIeJh4wlO`d6I&@|Y_d0epx%Uz8)Za(e!6f+m3qh7GALF4YL)Sk(=*6y +zs^D9v2d%S9Blm)|7yXv4&bN&N@~>BPVb^he{A#=B+p5BLM_!mVmfLD%JZ)rC@z>{V +z(}vNdMo9Q)UdXJWgr8~_J$Ab@=bQ( +z&Xn=Ft@haJQ+wEQ%Po1tT(nkgD&GLM82aAUO0(ffa0DZ(`2@hyV;01Qo0&K0f*!1e +z-%6p5!j9%WYP&VDGWBNNXWyJV%r~HrX3Jbu5=%KNjbNsoY(d@rZ<?L<~g7xXXVZPq`9_BTnwk>!>K;pR+ntH-ANr>JGesJmvnO7#dR0gZm!*_ +z_@;TU_?tzn1bpcD`C`wNF(=NJq1YC)AGXU^!vei*lYf_Ena|xC%hN`{zBj6^G3Uer +zxhh`{H=o;)F7LMEtIYd12_h6TzFI%pP#*TDw!OGX$I3dV{Z;HY?o!6by=m@ZRnbn^*z`3hTYP8%Ke*$I&ZgKX!;*yBtt +z{8tYKZTB(#m{#3V12K`0^jS(9z4|!Y3Hd_Q(1ks07xN{w3Bl9yh8@C2Z^J#d+6QtC +z7|d1&g+DTX0J^;^%glz?m}r%?1NI6U%lZZOhHdt~P4=*Tw$XiLgLf0&)Ss^AQ)yYZ +z>VH?u#E8Aj2>;AQ$J^%9ujl*@bqpYs>A9474Ck=ZFVTXXp(3fQ)`zRMtfJ0)-UFwJVBkMd@UZ~^yI>#f$8}2+7G7+wd3*8*pGp}ysxlOtZq@m9Qj?)U3HJ8s^HwDQyCTWn`P2>%oPrrfbw +zLv2%U2GY_lJeXFmgG0OgbuE^BXUpA|d+&XE+#7b3znt}po&BcSG)jd1MnU|-q6_F@ +z-mj57qi>0%jlG~r1b#xj)r0!9o;SggwHR&@%y~b`3P04+R9*sydXe_(4jPJe+p3R1Qj3xh4K5iBR$L7Yn1cP9`H#;A@1e^VM +zXB&jMBhTr|yLe&I$qDZ=BfRQoY=`hM>MS21w~XUtujC^CH7&9#BhH6+t97(6$mtrC +zHgA`Cmh&>;uhMXR-an8!r%YJug*X?aZ7-gxJ +zYFily4}_)&6eYdtU)ynMc=g5erw@3%|$80_U55P?#{CoPBxyvOPhBfMbzL2;JCWE +z?z1z^Mn$K+LeO# +zhd++$h_~1NHRU}bYiC-{v_=ZW&$JPQlsA_4mgk|w!us~&g7A+oE2)uEx+3+P5I)RqFF@hII&I5kKE>+Tw;o#(>#Cn|BSzhZ9sbv4 +zz_4~`vYg?cL0f?x0ux6=y6w<(yGrQxt0CPo0OtU7JBbEzbZaXbvN3Us{eKqikMRxx +z1C0L|V9`G;m +z?mZ!(mj(9~2%SUikhze%KLj4q(D@^UX2ndzCJ>sO)k`dzKyuV^I7MB?=lUc0;vzwr +z9%KvBu%acf2On-RTKoyX*nEV)V=WaWW=%_}gGabLrC;juRB97S`!xMs9y{mq6w{)f +z@!@F<^PJ1G1W}Exr1q^Gzh&Q$m<**eKULVJ-bLNp0+2MsF+#*<$DlO&eKY{2RZChG#b8QNbtvpI%S|^#4h#2HMpkb9WZ$at +zmvMXW!xz2_hCMB_q_M$*&oPaeGdjmV +zeIzjV`e6D2xG0={yU_2Qd|Rzf4{Nd9L_ +zt`>Jli@6_&-FGzqrr(q|J3Fn1MTSq%I{Q`7to@Xb*7NUL@wOU*L-&*{ +zv+z}B<9E)&@0=}ur`ed)0<(w!W+kKjuYQl;8qr2ioya+JQH1`>?4>!k37@IeR^x$U +zJP?eh_whlmuLHdB*kJgSR-q+3!#^$ +z%MYN~&HHb{rNfkZ!*U;bSmcV@q&6aPFkJSwB8)x+l`FS)e)?+phLu}i-nVAu)~Fu*1~y)%p`IVqEKB}g=%fDtbzxjACU!n;cv*4c8M$oatd*v&D!$Tl<`;p +zF${*o&{YY`Y_5`T-*I+|yO^KKb{=Q7HUw^G$56}ZFwwpx+SRl?JF21xwVbPo!GpVo +zpCbh)(3iC^i8>pfnR=>a{lK_q5nBi37=tmX&3YsoX`Ou=A2NG8B;_~Pd76r_)Xwd +zSF9)Gn-6CE`v9*WMAglX_@g($)}cQts}YC$qls~mUWYWe$0L;+aY=&$eA3_sr!=_1 +zD-CXBfVzPK?U%|uB`48jKhN~sv|88enf?d}MC+lN3tyF>G3ry!ChtNv+w78)V0`b +zOik#crX87~ooV&)kv^(?SKPUP@4kzV+HV>fzJ<-^J2V5oi@!RbTkWr|%lWJ6<0AbX +zRvr`HC3vjC4K6D;mfD>w2%J_aTbMoxOkU*ws}|o0DCsc2)&H;ft+&xevqTV!yUyru +z9~WsmT=eT2lq-{hex3Jq(XE6xgXp2z^aS2jpnCBj``nXeF~f`f6iw44@M-_62|bTg +z5iNn^wG-c~*!l2VE4Qxxl(oitj}PqVv{&H2ib>nAHSi~tF%rtyrQXFN5-km7d^jjo +zz8l*|Tl&};f!V~g<9^x0e4O4~ZFEtuDEe^F!o2Xi!OTzq-_iXqEr0O88Up`od*1*L +z_rD&FK#~0bu5Lcu4{H!V?C|$r;*ULCNzIhfAJDHjS)pIo-yhQgL;GWRVk636ZY>tt +zqA~fvAArmU$-*!lptt+eRkkQ%ZGx4r5KXf~{FD07KhlQP*SnJa06fCJ((}Jc<{wY& +zPcr{GPwWZW$j!g_I>qYUlk6yZ9&EHdF=5iu8U +ztW=Lhc!|jz8|yro+10*K8mqHRY{ycKSm9pMUB+kNyZnHc1coJpZ| +zDR~MyAEvY~UxW7r%Z8sDiF8Uru#GJU^e4U`B^7(YV`tZ&Wei!&c>pe0;eS;$N^iPF +zGx;)q=wHxt=JLaybvA;x;G2VbPWo3~RP;#urtK{#9c1r&+aC6wttMj0b@%3n5Qjh3 +zcJJ=)IrC2HH?Qc2Yi-}DaWg5m)u``sSxRHt^S-R3{hwr#1b+O5rg^PjTY +zPqhdxZ#C2==k>h3**r6GpnePW3u@0Jb70`yYxUZV`A@35{&h_7y5pp+x^0G;=vL!O +z=phFets5-j4P?DN}`iY$m&PQz!K{<*Y8)yP}Npt|y!8B|E3?DmAX{ +zDZs^lkzTilRl6286T~#uUp~o;K5Dt8@r`p%?@DXFSM5?3e|gS0uLM<45Z^OzELjRr +zwO7=HpX3(CH_rWY!W(a3u~D@t>6TjYm*=(-wWw0r;N#gVEL9rhnN+b(CHL0UgnP}D +zv^RNp!o6wgw97B{&KZ(yc;C!40;l*9ys3D*Z-NtU<#4wkX+FKeGM|1Wp_b#(mak2g +zFSp{WEpz;O4E3n7Ast^``$lr++pB2=PqmQxf381demxSIcUt|y9#+%mowPVorlZ8= +zotV_iQ3l6Z#)|CDB0W_J^XU&0#$OWgx96M-6n*`>#ci}n=F$}L38K=`N9vBL6)kNO +zr%1UhTlJ?AyZ$4Q*%d7*wg34t?$TZ&w$QFWBpLT<)keT}ncT9ld&q9sYi7{zI!}Wj +zGC`&mqcu^qP%>TS;peAg3sdBQ*xrk=h0^HWu0dfwjPV+FbL}1-xpNLpo_8kvZPkhU +z5FOzhFz21*9Ei>>bq*BHJIm=F@B$`Z#GJUC#0ddzh0`5eWn4Nrk{ +z$ecIKITW3HnscadUQs`I0Hn9a{y_E5=eUB%R!Xg|XpwdFbz~V`;+;c2RwQz{@-fuF +zcb$gsFDws%+{(SHqBR5CWEhd8_Z>tBDt^HzP@IvXNFrVeg_;wHVzxxp8YgfDRHCsHMG>OZ;c)UarV{SB4zM{$-S!by~S9!O8Zms*M +z#_okrZB_4L?R8#{J7hT@8MQkCe%x%i$2(nc+s7$S6zaQfu_EwyvQC}o97Sz{TD6;* +zV!?;%%&n*PCr<1c?S?g#K@hfgzs)6_=YYxuDQ%T8L6i-pZ@0Y{>>sKK;Z^V7rq(LR +zS}#60A9mYq_skNilA3MzR8mR)%JOYKtwM6{&no@OuMfnFU7lf|0 +z>bFXHGQMZ_47JB;&6E1MLSxSaH|D0iOAV`jg)oLy|9%fKuVmrY397_R$BC+#nN5J1 +zQtJ}l?PT@b8Y`Nkj?w{Zi;~$z9?-Yt?Z^j{?%&ax^c}B>70oVId+0a-CK2B{_q_To +zx+i0+YD*LnnJci|lk2xiS)%YQD8auDU&JkWCio<%Z5itmYG+X0x8!~PneqksVIWKk +z0WJU9C=*Xh5gw_JEs^dW)>^OczVr01StyEnrv-n#*x8Q!`xrJVcB1up +z4L$Rxx+P0gdoaRm=P~38@vr2?kz_@N)iH^}wW?%EBED+g3#zlLFyLGA&%7x;!1FUE +zfL6%_{HW`RK6%cYii(!L=b*|^)^iO~@G2v!4H@i?T~fbIBYR=dw;02A;=WO5hfxb3 +zSW!X2wX(>6Edzp$rp9izjn}#gHGN?~M)L#7u|u6@$2ZpQkkqkKj2Um-P;wTn#Ylfy +zbO_{;*rVTcr)I9j#*tOSgyP;@w48Mfao5SFI3?RrP}q* +zzpB^IQ7xoSH3&fdh@dcNf12&x7ZGlk1%O>xLnNJiw)A-FEfbSn%&*RckenD-w&#@* +z+OfR{MTDfi2Dx0dR2Ed1mGRHj{`aVPm_bCoQ^={>&~iSS?luWK>ntYkr;^(R^V#+L +zZ~9#{vRM8xC$3H`Ovfg(WY=^&Vw&8Ob$ap7Hue)G{tWECT+lZ^ZFPx%xt_iwb;zay +z$r0Uwm@c!u9}l2Za;3sf(vPE>E} +z{61B85~|K@%A*Qub}1Kh{lwOa(BE^Pbwmmp`^=|zF(RXU&p1g8ox81J{bGUHwA%?O +zHvJ4H$!^Pw6EhpPhQ=$+2guA>ghfndHo+rfm$`^#eVIXWd9qt6*#iMw3B4SX%pe#a +zqXFA>pc3Lw;9(E_Q1nNZ#0^@1=oW!E{m`K&n(JeRC>GS9@A +zcqTTJFEBe9=W%%^qFD2H?)WH)k)4Go4<=bso7;3MaKIjXEpf-U97mYL5a(~WmhPR8 +z5cqR$joC)+v2_b#lTj~OV60gGd^;B{7wK;Bd=}PJE7Vb$*=r`U5QrvEA&~k55uvI# +z1Db59Sie*}p{~KiKNG+Wjz|$iRua6dUoK>CE_z6}msxKnHX7|TsxpTWXsZzD^Yj=I +z#S{@aTVgJHcJR+xH`M*_Hg@T+4yV#hkPI%O+3*w=210RqKjpW0Dy_jTqib1|7H#I= +zjXYdj$X$S?Lu9H9rbr|};~~Mxp+d7swz6aNE@gJKDDZdbFzK&qC~%(|i|K^PVtY%( +z8cTb>6|<_3pWNqO`GJbKX3Bi}6a1D}Q)*ADd@TlXs(cq*OdvC5PQVOpi>8b(Lvz_C>!U!%*4TEu^RTg|;_xjUC@-Hp#qH8T2|bl_I&J@l{ajjeX#7 +zi6QjsYI)(6TxJ{~l~7&!xrmPKeWD}1Ku|KO;YZ-v1ke5DM#2rIM9UAaGHUXVX(iC3OxMZoy?Sn#B`;IgC=eE#J?{v(*M~yzQ5k(N+#>(H +zOyzb^oFB-*Y-iq)AaC+_5Gca`(F^9HA^bN9)7sv|GTXa*xK?JcdbiA?-PW{A{f{UH#V-@seTALUa#HRhmJai +z0Xm*X-*gQQ{eu4Uspm07#=7lC;9_Gqhpr&=xL*6_h93dgj-13-L%`Qd6VW5!EyCF{CLMMD +z&IM-TDOVEMAkBND-T{*{g3|6?rJ|W+K5W|^D3P=g@=)MTD3B;ysfvK=1Cd&M^c4>y|u<)QYq@Pn;5oh}mW~v{Mi~59Jwxe}sa?av#Y1 +zx(g$o-BUYQtyZplWn*5C6Tw;gLEVz)q&3@nN(Ax?WxC}jrDg8ShHp^V=EyT)6KXxP +zh}zG~z3@{VDT0^wm<>azr5==8wzJbv>zo5d?O(zs#|0pMh+yRNZW1W*-d_?5ww9pn +zDO@7QXxKzoy$7GrccMwO8Anb{!gY1K<@*!)0qkv#G$MakcVqcL{+w(&p#5}U2((x9 +zq|`ojKpi4*a#BRpeu5rV`}hmf10uD@sEytgh816jBToFPygP#-_e~hca=P=)rdzo~ +z1D-){ShoDoWCB{YSM$ecGnPiwav~T5P~NWEU1}41K5Bm<>9@o|r;3Th?V*kEkr@R +zQ4h?HL@xHyspAPMiQFDL5S^MY9T*49rwIlDl31w5I%1B4Yu^<%scv=`JXj`bR7gim +zJM-y%UbNfTjRtR)0bv(vyt~gncrAL*T=e4L0{RcC9`Z)+HFja=I|pXfzGE(0GM`r! +zd!3d+73&FCN9NM^>y@PUbsd-EfAn_IiPGVnR7IgYsEwD`2nO!LhNk>^4JJ0hZpv00 +zsKNuM)vh51AT1uMfu{pI3_*4b^^X;7h+-0>N9+oNtkMC}9RIf)`&bEg_Mcwco^Xf6 +zUcdzC!N{p((~t!7ixcHY)j3eiw`Ro!x5c%l2=e>%5Y6@piQi +z-5h`2bZ*tCNW>;ePM5aLyk~^N6Yf(&9AqI|-nR|AaJk;U6+GtKh3)Qx!n^g`wV}^0 +z7Vp~_swDBZxtc*CfuQbjb|E@pIT5DMgMt(I*j)7BE0aQGW)ou*33ey(GFBS{40i5R>YO(`<1 +zY@cwlYvc7tpgAnmb3Q6gqrd>m5-UXhJW+S#uZo}G?4FT;Ur<) +zX!v2i{>oW^7pc9ff?s-}!L9%q%ID{N3AXP*!wx*3w=;+qi#I8x;Tee(HFbX$S +zF1*OuKVWV_>jVRtF(HqAc-0A2W|Q(jVg)Ic>h&t)!)i4pFRiwAR+E!k(NnSJ5^rQ# +zI{t~7sep=7>d%XNU1{I98cjA6*joZR7AOxmP3uv#SpfsS_`* +zKo!OOCiH_lHin6hLiCJ;96O|Of_m&hk&ojS-aDAA_XyiXja2;s?HT`z%_g@}P#=w% +znI2fdCZ(c45-Lm8y5^*NBQ5_0^k%zGA-2_XcSH?|S^HLg&YhW&^kipy6jL+h-TFwh +ztCWP0Dz%?oZmIJ95N;~Ilg%282M#!y|G#IXFppr$?;QgEhfWq?+0(=Qy{GH@A-@)8 +z)%TXM7Fm!q*1&403`ea=8mm*XDeEozNEfcBsVjOWxJ8e^R5EBCtnUB*@7V+$bG% +zAT$Iz-3J|DLztQKK)sBINLW^&1UP|1k04#xuB)+gtvIN51%#Rf1^MF{bs*`e9pJ$- +z1YUpzNId9Zk!ZxfqJ$LoMg!_=5Xb_swGtElto3}IJ +z8@48ltVXSb%m8eH`_QlJ&?&*2R3YB#bIIuVv!gg*r_JRPDo4KxH3x&xXryD2hCqNg +zL`-3{%W#B_nQCKW%2`$5uaz}n!Rg!n)wm3y{0Ok@e+%?7e8WF6xXJSixgomXHbwvj +zp|_#KTy$SV!`K1=s6jaytj$rp212n$8|zwWGcD|+$QyK7+}AS0R-@s`w3=V6<`*2{ +z4MUb-&p(rBBm63Am4%i8k%>jczZQWsb?sY_nkF8?lYl29$~IgNm$1qk~pjJ0X< +zLWp&Kg9cM-XV>qw>=T<6@wbpqLc@Hqn9qR)UM7SZ*y&_Vk=x)u#XtQbu=pPYP1$R@ +z&-NZ|IVC^RKN=gXm(<@qL?VpU<{bmR1@2|qOBYLtIbq@uiPO%fq{Q}`TEr6JUdQpx +zaxwlY&GO22{_o&_!VT@UokZkXPKgpEljxH-%DY8G?fdc>rmRz@)xf**c&!f8axZ#NUG;~w<^F&VqaC*eu5{fh-qdHr*qHJ!kk +zQ2vtc6{VsXDidnGEcz|o!t9!N9QVi%AZ9lf1HO?0pDh?2F5}mUAyx5rX8*k~==6lz +z*!dl_2zxW_v&kdNeNdWa6|sCXQ>F*aK^}OZdZ;9McG}t#WZN(X1*jZ}rXdEz3FTh-b}AhT&GncbWJ7j{2ax>uc4`XQFlm-pm96NxxOBj##+MX6A10(&n<3l(E?w +zQ(U_NTopTh6rPDX`-hs1`|;sY?)+%VokmD~liBbKdZ3_)f+8u%oJtL-8B9g&iUUOO +zUR;mfG)iJjUP&Bt$0=kGM*(7w3`qmg$z5MO5d25WkjV*kLu|xX)<||wnX{!M>88gW +zwAANLHU@OFEYkhD{!ZxSC`~IGlvRv+uADnyo6Fj5>wM`Gjzn-}h__1-4e7eJO5^NH}$7$&tKpG4wHR9m3SWc!< +zgbu-I7{qckn;Q7*Y1Un*n2qlh(6QH8c|Pm#abY3nRZ6V-rNYjlMCOiy@@11(B{>>R +z%+_66{RLd2pE>?!LF`)fX{Ys0PY+8g4WrOB!npn{Sq&3Gy5epVXz{8AgNX)++)OCKoI0445n)47mS=u5lr6Q=lLrjgI@W6 +z6#A4!1o*_v{E-{P0lUcGw8q41{{&qWJ0C{@dY01zuRK;P+<#}(?iB}gLjk8Dh2r3B +z)>4rJ){-2rh%~T_4T&)`gnEjAym227vQ<;B#vj%vn^2j +z!LcTlXg`Lg{6zVh#F!zm*=Lw9O^rp(moVqwJ$qz~qh_2vLy5yg|0oXl{TrEoP2I9% +zKU8j)0*_EPn>f?nZF!Kk1dw~_`m2Kur|UU9{}1Ro@BbxT@5|BkMsO=U1GU$b1vGth +zf*!2bM$=ee?ZSCK&>G?576pu6Cx<2=i{_``w`s=JulA9 +zeL&Cc3D#Pn=O{w<3lnbMw}atndVZgq{`4#dhJ2Bp+mi0oZ~Z&;{0mwUdj46^?2+_* +zHOs4kJ`;Lg&`ZxZ4oJthnGF~7RY1=-9w!BvUqayNifu=s=k{KDew^`YdTu|;@FY7x +z;4!!+Q~-UiKGT!546z-e=vi(>j--^2vz9j0o{T+-eKM7!mvcIGBitd8SbUtVTtP?Du}O1t+DU407bfK&`J8 +zfwVwbXFEFyE2M~s#cTecTz#y1jw2Bi7z+rm!2$dS`Yic=*$)scgM9% +zm6tflz|vLQyRIglCE2%!RwU`l%Eo+zXTH +z^JGpbv7bWB(D${9BDLGfesluIJJj4hE>cH)`!@nEYGQdUz6|2Enp^0@PW?mvaVXeDbWlLK&Za5cg2Vrym$!;49|FSFv6@ +z4ND_+vatovp{bRv#5i|RrZ(cAD0?A#?IX<}+nDN*KmIKA1%D6#$T7z{0-U}2T5BF@ +z$gkJyaYuoFGw_xM^D|xGm*?rs&vb!bKLG!9fnPrW|8(u^_QEfxRuxAz{AN=GaG^7p +zwPKBbt@Nq!q$P%iV~v2KbhD#{onV}_|4K3j;ixTZx{03ZUgIRtV!G9d8X=b^_8+FQbK@Bo! +zk08aLr$NpLHAO_kA=vyK#7V?|K(v=&s+4F`WhfJ*2}ZX!g_&$lO0LJFv>e#)zorIe +zHEh`9KSvXs2Z%ex92R$-rso;!^b&XMsgvCqr*Yubdn||Dc#>9C8I2!QRWKfiu{nr#`$Gx5X?T@izRrK1Xk4ggu??{i +zkqpIMLj*rb^#I^%(SHU{eon?V-Ch7b(1V8G@eZ>*x*2Xs|@HI +z22@Is#il1|E5JW*V|qM^3vZC|>;(`kaf@A^@B6-ns!ryqPY;E(AE=^ndS(Mv6e^;o +zM}SC{ibs`QA=6%Te4unjqIBSlfE|e1_ft8CMCBm-zo>O~SplVs(iucjyZIa*Rob%) +zs+B#kTFocwqcx7+4&xlkHyfW}-B$RZR2D_ND-Nd1x9dH!pI~x&S9~rW8zFGfNGWfD +zXd*%}h>`&tzQg*$wav0@pjuE!Des&~qL2viqLUueI*I(Te-3rh6O(lOA))?33UFG~ +zD?up4BEh&%Be8Q$6cTAzX68yD2$a$;Fgkh(v16c%X0HE(0uq42wA`U_vW5 +zCH{&XLXU(3hQO~wG{5RC$r1{XAC2*MeJuQ=4wY~8jX-24WZpIX2}6A~puayse`ic~ +zV_(W&mGOq=4gXgR2y8?-mJ-%%xJ;s(gUCTdUki`=S7O5UF}Z)5 +zJoZ{D?9{sg=}V{#VLz=z`x5s8SOB7yX6+xz`#Xuggzt}|Weu}_y$pnfuTRpS|0;aF +zSihbnv+{-Pb@1Ik)>0HJm(xF^{{4&vUlU1pGcGEKUI<124$7W3M7O>UvlUt2VxemKMMVTEs;mu76`0kIZP}`35f+pR|&9=B~x&@QF-BllMwr7%Nw=9im!+5PUj&6 +z_B6p}!|&?;*vW9qu*3D51F}$)_MX<^a`wTo +zxn(o2B@wnxTipX5AkeMXRTfJL8G`M4)y7uO#uiIWb#H97T#Y^93Qw?}GnEw)Sqd5$ +zfwX7nWt{>lXJU_2nIrJNY+;AAXBKjj6+NAAzRYNlGV%dd`gB=>sq+3UE&Fdop;J<$Ts&{?#V0Ks3TGUoI)*Q_ReD67s4)AP%V6_?kTMo_sYb +z>0A%ogX!#oVJ(UCMTx0c?!|^!?PU7FJ{PmXgU6UbFz2OF)fRuk9@EVc0RM7>GMyDTb1@*)En$TgG9<65x;0u)S^N$v(vng +z63MCr7dI1!H)trItCdH_e8VtsufG$hXSok*P9+=6Ig@T#psoC8He&?qC4(ucKOjpb +zPj4yZ6RKVgz>P;rnf6!_P;q9#7hRLUU}JexiQFa3qCZz$J%1XV>MvZ!VHCvW}aI +zudMY2KoW2RnV_YFf1sYwd4eS{RwNGj{NW=e#@egf!62}mW77%Oqx{JNr-wZ{#$&1*mU_fh&doE*8lSWf}cy}aH8yr +z<^KN)t5)(G5kX2C0ml{^oH^EJq2y;v&kmCK<77{g)4W~KmXmRpFqoqMe!&BpJ+ +zUoJU)N}pd`kZ`|Un(&%MT;}osvaonCR(VXMQRSAh=@ttbHJ9P)+t+Wj +z^Vxkx%281sIbUN3B}VVBnNBK2p#RvAJ9_`@Cuuj(ENJRlWX=lm{SIq)xwO0B$rl7U +z&&xmbf3k>!%4$_5s$jS;IdCl25>nWbD9`GQgauGgQng*;7F{?A6FM!wPY~DD<`-6} +z?!(H51?49kSzZ{Ff91$>y*}?%4(mD{}ZB2SL_%0xQ5gnj@x1>sl#;S_iUKyz8UsU2jaF2IWK|a +z(SYeGx=lQUUe4ZL-3(t#eC9-CbfsB-nW#f~zKnSEW!wZ0@bzUKxd-_AGWdEee66EB +zPz1b%S|=rTLOZ*=PLYvK3AwH50pySsU&#QbC(MZ*{yjX~6o +z5Idnh)TDy?#th?$2=A|47{>gerU1do5hI`N5FiDpP@l-xdm-JiPeH(9qhLK$TA)g +z1uyvdRwLx9|aSI^XfU9-{~-9;X`ce&Pn7gi*}n& +zP(@Zop4BdtPJi0hS@DXz%xJ&^AA*T%(cM+jpMa&BSF;;WjFOKnw^4x0HEpRz*~!=W +z*wUbp$N4U3L`W&X40rQ`a}(pZDV!=D1S!Pt>$l4g;fEQDiWQJK*(d7Ch&bvoAb&RS +z@>mwK05tCZRzghT)5ww!W3OP#e>ib1dZK0K{NF*$s@vbg+%aLy7Bk4S$&vEfnFFNx +zGB>$dl~Wvl4rC;MeGggyX{3Y(_LJR~g{Z*Q46!d);U}GaYixdKe>`_FKQHh)o0M5` +zZ?lchSU2Px33x3xC#+1#oUk$#;*OM*&BAcSolj?br-xccOwR*r4h0p3469XHcf;>C%eRbc#ypli^!0D3C%6u*i=CieTKErvGp|;RR +zb6Xz&Vn;3~!K=M?H;0YOIT)O5&X%S&O##9CZQZH1q}=k;6pgvVEo|9Z$;IHF>wC{@Y*lCQ|zfQUO68h$fcF4OT%@&hf94 +z@q0}{ekYzq%9{vaeFLG +zVT>N9rH4z5%t`XmxSJt8R?4UgPTYs|2J`T~8VnX(uIoL;-13*ONv?+R5KjLzWG` +zm`1slv=clkhBXts=`_lBk^xwszUEW79E&zKF3EIA4CcG;UzMT5=~{u=r5*QY8jx@EekA1bD5-D+5|C3uKYWw2ma5cTNap3 +z2_;tjGT}y@Zh3)7?Xx8pIZU@avyVx1x+OnXhzDV*zjm&BCdjvZQ=QM2)A^X7A3=G3G}2v(X2vrwIu_3K9KF +z2;_&N@zSCz%d={=WYgJZ({yH$%?~V2Uc?=9%>qnx3=_Dhr$+;g=5WaUVaYm!bX1A0P`SBg;j~&^0%u~9 +z6y{mpcx>z018r}1LEHEOz^1#)Nh4h+PQm?$cqSG3kP^#wKz1w??xl~-BLkJsE4#iY +z`i%&_ULR#Y#T^p3U~%-Jc_Q9O*!iuNb`#YT0n;UeEb@eV)_)}6(wxC{Td+3zYd!N! +zdPbm&gjRKbzgq0?UcXvDV1IuhUq}1Zdfvl)o%M&UkIINx*V% +zufm$s?F9J%*OT9X4B5s2H38{0u;*BGZHDY;NQy&@o-6iZdcA-|=vgNJh&duU*j&W1 +zIsR72kNJ>}_k#2#xGC!*G9q|Vn`AxE +zcE^s9vr{I^0b|}Jq>8MW`@X0>Ee$5{DLX(2(H0etE*eaVxwPe7W^@hKWx^L1rU!!# +zIog3E8(9bZ&@bkm?)`(%g7reIx8vXRvmnF$LE#V4@pEU^)U@}z7LFv*2Zzq@XFQ$} +z7ve%n9%ejh3$LH?SPDE4DI-cj3`@+Oq&-+hyV^zIn&Dw0Q0f5m +zVZDnr!jF&YJvhi<{=}6o^MAvg=!t~)Qwg@r{I($mlQ1Gts;{yUMX!V}RXfRZUxa81 +z)?F<1fVRYv@zr;Yt}>TBv`Au3q{O!q?91qfG$z5AQ_ai@I;c*@*WOjk>-D+P0jNiF +z(O~szsB|AG%W2b6(~;PeEJ2l-&KS8xG!zH82$rHAmqPUx87V=)&uq9zvo%8fNO|{P +zjW?t@ZFyy?KG1Xgu9V=!--fmUA?G+dqsX)o&LIpNNf%0M!-h?In1l_VA)_e3u(`NM +z3Nmj2WmQG@(jpM>NtO8`KSI%&pD``4S%OD-1 +z>eL?Z_MS;zba2`mH)LcaG7&|03PYwRv*`!YpLbgHd{m7r=vaY@yVyy9OIYP%C-aC_ +zZ#2VZ>{Akj#ia3|zzDCgEW;U3Y6|*mNDtTdT@_&SNs~j|0?rFMV7O +z8HRY~bFUCtpW_4QSfa12eP=7p@=GP2BhQx-&$(2zo_;`|Tq^M#{XjhD(p~BJmR|f? +z^?sy|AbwSkRi5QwvSV>wM=m8d=#hZ7)I&>!s`xQWeL!fnf`}uLnWKe3vmcWSw7T{+ +z0;>2n1$g5qAjg*9fmjhJjeF!216hsK){p2L5%G-Pu2LQ1fyX}+O@oN*9I-@uHUmmW +zfztSA0KD4F6fwbp&bbcx*Ni*QEIcv-pEj2bENDN)&oEQy51DC^f&K}>Gck;FIFcc1 +z-uE>c0*q_bMp6JK?1O@?^)CXpK<f%J6die`d*YzOvnh`R1T}6JxE*O`3)xRA~^wt-sHGYz!v$PVs +zc!=f`QQp#kRwf(3wXP>AH0KcCyFsF^2|UhE({A)E+db#(RJ_w{_+NaaUL#Z5ioZVR +zFS;_sc>_O*YBv6gHb4Vm%5(C@k3NUBB1MUa&zlqM`6sKG{qI#Qeo-Smrf2-rRB3VMO93eHzYTGO7yw2;#prb_A|SgKdzTUFNe||5!aAPuPgWS_qRX-OMV^VL +z6@R&QyJ${%>witA!o5YKPLryv#_HBI8QnzNxvU@PsH>EGymzYl6VQFsC#N;Z$s$Qe +z2)t1*Nn&f`H~BWHHiMv|{E5(p*&vAkNyMX&(1@8atE>OvjVFzLyW~mJKH?yqHn%$S~ +zZ?^6KH~X6pibeJtwhbqbopNO +zs_d96>)Y0R5n&`9brY?Reqgr?6^5IQ5Ap&xZn9T&6C0Z+{%1Be7fTH8O0h59%P~Cu +zl-t*QSo*H)YkosAc>6XrZ#~QZ0ZQQe}}uAKQ1AZGWD@6!QFgh`0ZA`jroXuj6o=X +zVAg#xG5_MVw}2D&}kHfD19 +zW!sm;-x`0-aEZThHqlYWC)_OH8~`N@NQd8UM4kooEpav2VfcS0uvVH2wrFwBnwi;n +zP$GYQfi;|iE=u|b)<%VawZr!@2V8OZKIS_g58`T1(}J+6UxyOO&4(tYZ$SM)#PLk- +z;G`IFs*pgwbU*WIk=ewnm`Jrbp?5Ktu?c$wTV}w5a}dQVKNZXt=CVkcSnl!@U`wF( +zh&~#Qs$lpQYG^!(d|>|*n`baX2Q;2VaUXxLWi~B$aw$Vjup=z(T}7(O-gSQ8?oRo= +z?_4;Ytu~Fa>s!ni!s$1`%q*oL$i1S8gw#nF&?glv*4DPA*tskx6%fu5hQ3=E+H%LR +zxBh55#AJh*>Xsa~G~8e?@bHocuvHoNz-^=Q36ITnP~hwHHV+pv9= +zYqOXC^86Irpd0=VT~NSY{>zV*g3J{n7%J9&Sy+8Dqc{rXXDQYIEaoPZKk)VNGN$j= +zuMpX|feq4!?@PVFp{KQeu1wo_Xj=kvvgd2IDGx-AOOagPq{y4 +zNErGhd_)05`Y}T~XlBlk8f;HKdR#r=>wf_cUm90`3z8IY)^j~9t{%qU!npF3fX|`U +z|8`tCB?oNCa(k~fS}J~bppu$yBitj)XE02}|E*?O?4uz5cNKmLGR&00%l->(b$=6k +zv)OXBW|v6T&645Zo%U7?`LtbJW#my={bzw2E&BrS3%yZG&R`Bn;1Aqr;YGxe1d9n= +zIhjX;Nb!2-Ac5lLWYIh<@bKak9ViY0%1U>sI%ShhK4y&h939C98{3;zkS>3#T1}67 +zS04%;ZZDayH`GW>!<)t~*UjQzgU&k!-2ZpNrHR2tqI_2x4w%7tn|=E`bK&B9ZxYUh +zlYbv_@*gzQ_U-Q^T>Me*dRTvTY-MFV?2G$5i~IJI0EUEw|6B3ma6Z3ef2WQY%l^*( +z@#3_>?`_r)-(oqQNPi*raX?q7dSV_H~Kws8*Aqx5+5LU2PK)j37gH5r4*w+T~pi +zTJIR}4OoHw!zT-U$w7`_a!S`Vnyd8mLJ*qsy6E#O=Z5JS15EW{8ljvV!8cZdjI4kcgR<@9rk1T +z3%5_ob`$(hs&aG;XU4FXDOf8gxsdIXW6XvhQli%i4&Uz;?4L|rI91jQs-%vr7ktio +zK_w5NKGG@x8OORBMB2yS$VCm_EcGTibXI)3dCwZgYrX_+n=cWD+!zw7oHwx(I&}68 +zEkEFu{F`%tb0^-XK`mPS-^xe**BSft!GBMFwD-<$g+#7mxpl@1m^R{UY(AdMWXt}3 +zSpbdY_T`P_H{tt_5B)%J;40Qh&<}UOj9NeF;J_)8H^kO7Q?BkU?8N%7}UUz^UG3ch(gQL)KW>$J&psUJdrKo^!U| +z##%>z{HO=9971Cs^{1ifjMxlaqu%;3Uc`D(X?uf{z$L5Pas4gd~ta +z5y}sYP_ga4RN1R$>dCBa4pHY|H6%#w@kpf +zLs36%^R_SM*L+hJqqEeacL#47;s&gn`9&KVHpJTbIu;I1FTq^LD>RmD@@cZCp +zNhD$CSjSRT9OsQQy0292GOfzw?X*k%Mq0`kAQ`3EI@yGHLmMxXH`= +z#?4+PIh^9jX3UTyto`GWo4EPbs*j_2+kF`~=T~K&`&1pS3YGtDm*W^4mAm +zrYygaZsE@MPvuN6yh*0Nprr2a_nTdrK2&&#Ol +zkGK-n(z0m&F8BtpZ~FmH|f@IU>#ulHFMVUHp9kO>=(7Fm-uEixb1J5 +zXRSE{&65D{`Rzlkl0i~VW4|{};ul}_^8FV2oxLA~9cm3n-)d`E=i=?W>GZ}{sf|0H +zR^N``W!hg#XUVD$pAtILw|u~J;uqsS-$Kp>PfC&8S!-sZ%YM?8mc)MQ#v8bP)aN7Q +zTQo)Nuam6o{dF(b@GEciZHdnDd6OjV5?+VA#iCxsI +zdLt)+BTb;xz0U;hVJstXpb2C*j>WarPWgr%c=%ndwoBlj?7+X9KzS77F)4py2d*`N +z+!$Eg+u3Ss?ZE4KCAhrAH_|tlC|EK|;2U3@U?;&hp5oB<4ScY3{o~*E58j7Eww*q* +zacvuS*0%d!b(a)S+&^K-#f*QO(&ALBZ%RuXB}O;KjOOito6?4O<*dQo{tS`qc}{4J +zS`D-HBslcQN5UKC$FbWlQM!?E8Y!H$NzAv}Luf#6*~XshK*}$zOC5Zc)KLdda%k59 +z-t*t=AC#Xg9p$&}mzDX~eKXX`yc#RKS>vusOsHQ%2HEw8;}(?5?(W2ijq)LFj(Fzr +zVHQ6uC0Kr(sV27J!D=!oOT|gmmob5kTl&|UK{?E6>o<7KT7`UaGhOO3kLUNYki2}r +z&^!3gEcElYJNuI)8PVL4i2i!+pvjFxNwYZ%t+}7`JjT{DDQ2xS60d`nUrLVKQnjJs +zz0^C{KA#oCEA9lwH6|Y1W|+v-p%DhW$9JF+HWXa^r3Y)Ck(W{DSs}F*H7{%V +zupGDiaDdJG4WGUw&A0n^3=O{JgA=x}z4^A>rF%p5d@wyad-y+c8*bu70aUf4b{W6x +z{~5EOPx~kIW#tFz=GIYVD*QzG>Z|(P>+Tn1tf4d%ppNY9mmN9c)5@_6`;2Hd;qv{z +zu>PQi>J(D(ROvMJr84=Q#dEdT%{TuR^m(rKS~-eYSjCgN0YkGJXAkA=vKuq_ +z&KVob!@Fe_RIaOI>=0GxEZ6$oPvKDso4G*A=+1{9bB4D$s+-1;9!P&7xU)Z~hNu&{ +ze7UmrJ-+@^`v5gDp|yRHa!TUwiQ9d<3@)O#zB$%WR=Gd$&A?4I$z#Lm4d3EXjY9@y +zu|~E;-gA_CaAQKk(tR9p{my3PWB9)Mwo|i*znnAf9lqj?yeK`P;=G1|wAc%>Z&Oas +zypz+SgfE-rxs+(RglezSbf36H)d$c;VUmiV}|gi-Y$>&Hkc*e1TLifvuXntLkP<1G#C?nxO3mOjW +zVNbuDyh@~_n~D-DxAKDmrMq2%zv6|_lF@E5`jGXgHaMlY`NOQn&}CRxd0+%D=tg*; +zVKZl6MEMS34^eyxH@9cF+Sh%Sz^4M!OJ3g3a6=e3e~8%TT(U(;c<*2X-&5lEpIgL( +z$9)jG)E@WhH?kf(A?$NCqd#lh*L>fvp?R&;@S#u9pcV4?d$Z$QHg8@tXI)#OZ?jcjxy*)U +zWHo#uAE=o|cBitb4p+))*q$qU{cy3%vxl$adx8l|Zbsg6Q^k1;871Lo-VOJ?P=^n- +zeEVfHl9L~_Lk9jCp0#OxGk)fK&UP=mJUI<-w7mJ{-j;RZUo9kgt>s9?0XRPd68BQd +zj#TW@-t{Hk<>MQx;#{g<5nJu0foHe1v>g3c%ie?ATWSvO+psQp^n;f7kM3;Qo4>tf +zZ*gnOYe&9nIgsDla-eu~%cV!ww~RirrDfZZcJZZWTUx3P#cuFjdZ1;)y4(Zb(4RK= +zMjv=}!@7*4hg-g_*h;wxIJ$qs&YQ-4?Aowy#(~dpsFv4`9%|WtbSwVU+_LTH7cJjb +ze#lSTLzktJW}C#_>uUMi(GOeNk8W%E_U2uLe}hYHvw-prD|p3fruj^7-Wz3(LKZe5-Fz<&IadzbHRBa8JrJNzz8rBi~<*c +z(O?X?5R3)mz(wF*ommBftg?yxEfpoW`jB4THpuyAOPlq0#FEopa{$Z#h?US2j+uPPzK6D1*inq +zgDOxBLZAjL01H7aSOgY>8^Dd=CU7&j1=N9C!EK-(ECEZwGH^S%12lj;!E&$yG=jUp +z-Jl8F1AYwd1^0oUfS-cOeRz&qewupRsjya)acc7XT62jCx|4SWbb +z0z1LS;1lpE*adcjcJLYa9P9ym!5835un+79UxBZ|H{bv`2o8b6;9Kxd@Sosc;0QPh +z!gbav3vz>K5CdXCFAxWM14a>x5rnbGWhH>)7?=8k!QdotDyh!^=YUb*Vl<_JX`ld9 +zqqQD94Az64=#)nZ2ArbRIR+lf4#pqi^#%Qa2PA+*a2z-ubf+ZVwe|KF;cz_og15ZA +z37!V`gT-JDSjOAS`hsD^iPX?rQCwWFUa^W|zKf#2pCa|g#t!nHbxz8tG2<@2G}V`u +zF(E5^;-sA1DS3HUOr17;#*8bknmKdUtgElNX7=nkbFTIK^Yilqfw^-F3JMAfgTY`? +zQPI44#l^)X&~?{cH-G;8Qm70nFE6ivDuu3xs)VYALP9k{3luFBs#Uberp1bGu<1sd +zZqjtKO}A*OGjyw=+YHrr(2@>X+Cj@Sl_e&6ho_7lcS-8_jLhswIg_Q}QfvxMnXje9 +zs=SoeE~^w&6;qedE}t%(T{0<_DU_6`qd2N4svxQqstk4kZ0l{)wcWPS+F)bu?V9e; +z)S&53L(2`VFx1#VcXiU;9n>_(>rEM#nvtE8H+9BUv#yzaEd?$J7R@UzxsKK>E2j-< +zJ=#qgOj=3`bi)ml<))h`#x1u{0?fyDF&wKgS_O8lrOKi$( +zO<7&JFYb=4&BGom-kr2^=Jv5`Y7a**N#8K^k;0D$+&BI03!V;r(|1MA)^ndI-81BY +z**h+I;l_VO-8TN^(|rb&f7Kk +z{;S@-@GlDwCEPvbjq{(Z`0~_;{QtQ8rCYj*>>m|sS@qoZSDWc2C<#c8q! +zw%)z_L{NML_5B{|_dVqKft2tA$)bji@85p_G!Po3X|SfG2s$BxPW&D^>3e9%52TZS +zAc?2A@PL?DT3%W^K3*DB8ciBTDmPKnahi_T)L)ZSos*;*on)%ia8tF0N7Qh)(})`H +zcKSUnaN_s1Kxb#sM=n=Xlv{TS=@6z``pL8+f_j>nNDq{mkwll7#|hvxFar2M0Ne`J +z0hfzo;EDoFv*aTPE~Z%AuyJ<=n7+7@fET2IRFH3VBNr3}xgnWl$TUPEefP}Go-v7? +zGE)*;`-8#YBycJ?1Dpd!fr~*Jm<9?!HK+#t98RQW +zlE`h4HP9MB&c|axB9?flxxUQh`cR8;%r)hUaM6?`O3eeiXtz?W%dN|Jt@9;Vcab&D +zO0mwjlCATsbFuntYq&Mmy3iV9jkYeJ1S4sIVb+hVv#c|%p_J@&S|!q+$owPii?qje +zlKbK(DDwrFmCp{7%^a_W%TwvPyl^;l>Qcs`r!cEFohqdFIVZfyyNZ-h6!9u9AX=dnmRgpN}A3HHEO +z^X`q+@Mic1cq@E6Jdqb@?1OuE^RTNA_Q7YvE8+58$d<-7zq7M_a +zzHF^e7L4C^=u_oK){5*-QKsyOn%Kt^mk~dU|C#Z##N-@;(up?~AMcHiSmQm3cSmJ- +zlJ0Vk_jntl$9smYi1B$+mc?dz#@6?m=xKGiuZ`;C8H>#48AhD(o+Q$Y_ry(-CRqvY +zL*Lt_hyiu1xrNi5uhM +z=n5pW;65aC;CY-+)aUMx#JUOHtn#_?zuyS-QOs6Zbyi(oGd{ +zNwMUos!hmbyti;mye?bXSbS?3VG^H9j)W!7CqVpA#-k^YOVbO9Y&x>X9J)nTjO-DI +zO!B)C*(zjbb8P!pvFZg9e~;^mby#))8piZ@63bEYRw>QCM@wTkd<5>DH$h@x$mxqTjQeRR}1RfD*x +z-ABg~cX~xQ{EEcQ^sID6J%}n_{8aVdu7}ygu`0vi1ri5J1(nE3k&Va4C6BwJCVG+@ +z#kW^P(;t?_WP4KTV{<&Kd%F`|o|H7tFtYFHBDUVA(NW9T{}3vKqz`UJ7R|VxNf~Xw +z%<7>JX4`$R&E>8VPwL(W$4hMu1xYk$G~@nMj%{C>EWR{dTq5a8PvRshLh?-|-X+94 +zO1;?mVr;j*ulj1Hr^)4RjqWjDdY4^}CiLyOiR(#6-^USk-|rktI`#dn&v)xE#?IW{->t6|eK{|(%HPo*T(+EJXO?5^TGj?Eyj-te;5z-1 +zJT6n^RpXr++at!}OsT)9HTont?jxyDxwcKuUC0dCDag-h^t>V6M>miJo#67 +zX8JsNY8-t4y{+gq*K-*&S0mej>?|>Wp@W9VkufQsQ<+2UBkVN^o7!<5j<{|rUrP6+ +zM$NR_lP#64MI(-UJmyqrbwp_?>yR55Zo|M)vHlxwKBAO)MxcV?9 +z%Z-mpgRS4VmBM+6wuUqt_%3Au$M&^@DlNC?NIB@0Hrzp+#GRe>CsF^8{&&?tik<-M +zlLm#PiwT`7z5>Z*LXi%aX_-*%lQx%OUnubdo6CKy5M4#liJB+raG56vnQ%T}Q6cB~ +zIzKZ;$n{@{;a1Tq9WKMTP^vzc>za`C9U-|qD{8Zuj;8vrNMxK5VyIK3=3*Re*8(G# +zabC#SsWyCaj>{`D`LQiR*}qE1XTym)H}$wrpV#Vee%ztLO*yr?|7Xmr+aWT;F}i&x +zXnv*UMVgOovr|-#j7({t@B4$zGt<&8@(xQ6&MgU)d&ee^N=`X%%y9dl=Y$Ta8}A!y +z8mx;vs>44VV%pkm8NcW%kG72ebd|?grX9MkaUK5BRW1XfQ(_;x +zd9vc|Q66tq_9*Xb)%7Uv*U|5sxwvKRZM9Qk@=dUsn|qQcT9q&NBZhBeUKb$e`V>i#8thS!ygDm4;&QK(AtuN*@z%_`;HrzRGRV|oDEujOU{RnG*F$)}!O;#Ys<1nO@yYowNY#Q;d|QG~LM +zT*t3dQg&2m`6?sV<9ZEpWzSGMqPpMbuu;d4%=c*>-;6&ETK@(We~^{hW(&-C{WkKR +z>QnZyx_APb7ZG1xCoA%-2)R5@>`4!AsOwRFHge@xGGT)%ZDw7h<=)Y@K-~j#I7iEQ +zXsSrsPe^t}O8qzMdd{=O)-^hQtB$`w%WJeePaG9e_rLJlw0zZACAJ>2ne{6zPaS6q +z)O{_7FCdqEQ=iijsTU!6W37~{=@R>Vs?DrVwS1qJtNT>Kj%YpJzt|CD^@aI(xYGZU +zEk9Z7IakZ;UbF>juFqkrmN%`n<)`TQS0h*clVJ>o;iX#Mw9J;P`%Dh6H1Y4YrYL#$>+B5VGX58~*@j@AqU*Jue65F5 +zMR#d=%5Us*bx+OV<4RBW>)l^;eD#AO;tjTwS=+SS()F*0Z|fT)k0{qb3Mlo^rsWA* +z&uA@A{FN_z{6a0aerpTP((+rhyjkl%PRs8{?&@JaAoD6^&trB( +zqkpZIr)WJXTF(wGuhZ>l>iLM4@6+*hcePIGB?-IFb4DN+f6H&viZ#1b$-B=(rXd$Q +zQ*?RNJw9nlwY*a2iy4Xz;lQ#dG;+Rovx)zx9gk*G^fTngOS|X_GxgA>BkI{!n0UX^=uj#uL4Pn$l255SzYb6ScoISYGX~ +z3|5uZgaWcPJ9*^DaVe~F+M$vWk=P(k+G?w!sHi#^GI<$kX-Nnzk~?t_p43rb4xH}L9nV?wQYx@ZV@|mDD`Znx2={G((r!WN(B|wj{JhPp{jtG +zJ1OiaZ))61Avrhe_>*T0MDYNkD| +zm<%Gq?1plxi)dwMkf}*k!~XPHlYP0_Y0d}{X(J4^4e2aLS5xLu3}YlCIo*0eu+*ts +zU4XhZmfxQ_d4@kDOZ!U}U!(Q=r{|_=&+%vGOd0RX@lTmBVOqv?|8(E@oQy91)TQ>F +z+1cZ(pQ_2We?FwfVJ_RjU}|b+PWJdT|H$N#$)l}MaaF~_&Yvv#v!~~BF*36UDoExI +z)7AAB=fQ`%CjWtDQy%gIbx3>v(8@7&?Dx+r!>71haar?Ql(?XBQD=!qTwvMF-6@hf +z{2vy;w2Z0*vMQ@s5YafQHF|6dzrUb1AVU;=ZE-{@E13&2QzUq(%I3x9sJtQ+OrBR> +zldR@b=am#%>Z~|WU2G*6E-ELb%|lgoh+LHAw`?k!KJgP)6)X)%0)14;q$^pqL^6lT +z^SGWShq&}v$ue~$Qic3{%}Ndy>&aqqAxg}doz$K++9}L2IRwf|3dp`9B$_c!>6uH1 +zNTyGfF&#DY-yg_jU58s0?s;r7&*=>xs^x~6`!;i)%mHr%sxayE^?~83IwFrz6q)(I +zK4o8_y?4^2U!@NWUnvg~Ajww_P5LAeLa9J>oAhRV!0=QPKpY{h&OYIP7Lc_a6V0q6 +z7=F5rY3w)g44*-`tQDDav)*91x&Mu{U#qnWIgl`u-mFU)Zq}zv{*mP`*XhS=g=W3W +z@O&+o^xPeHt3P@EC3Rx%e>?7b6A?n@d4+vu+iH%5R|98yuTE!po-;DXI=F-19Fg9v +zn;34&Yt)!?!*7pBU#BxL{NOK5N}HSfjkGZ$y;=V>oZHSWByHuSdpVKvoA&EiuUT!! +zYL3XzYl}Pn|AHfD`sQXk$Z**c>!is1e@mbqLpK +z+c6^Jn{&hEd5t`aGU?5FQqsSf{#DY7@0s*w-N~!dH|z47a+`cjwcbWriDJ^5^{KWu +z5JFz{zw@6-Z}{5;In!HhI&Q1YWqfjyNoV-`1Ul1?ZL?#K)#-;h6LW0R8SzdnGxq1V +z*&+ElePn!74<`L?4kZ5+BhcKWH|z2ySmFvfd57=XLF#{<&cC*=EtK{C8er@(NzDWkm|OHp0wH4w7_34-tboV_ +zfhGflCajj0e$|dGpVvP02FJEk5yGQ9u6h~4qM*R|Xqf=k^ebM`(w@8a*=vWx$o{@L +z|FeH<@3r6O?6YUzPffkAn|iH@IZO`@Axz!XS2)c%UlmcQjN%Gn3pd&L1%pk$4r_h6 +zh}ZW$pI+}FTZCRu5L~L!_Xsqp8-!imAr(x@q(q`NqP87St(>wwEYkQRbPBI1hAB{B +za?7j+hg(f^rmYL*#;Z4H#_s)B)b@>?pS}Crx~V65o<#id=0@Q!8h;kWHrw|M>$Evs +zozJ)--aIWc3vn*~CgP8WeEb#QuMmGz;34zO=v|wFdme*FUWPs9lIZc#zm78xu519O +zDIJE)CCV1aiYitfhyTFqe!Ndp{-j@f^y?aag-}!p^skMAWJ{x$`^G?>%YI{KEQ!Ul +zl6iv12w|Nj!QB-CJk6Vc!Ae{$5%GmW*edKL?uU^d-Ygz|N4&pL#J#mb8SfvSp)*ea +z+5T#(kj)|Z86nI~oH+&fRh-aQP`IBU?=TE=F&z(nD!7+;slZjHc;=ukl?Bh1HN9J;JWCly +zQHwij1Q>_uc-ThiZPc=Mf!P;SA@_6vCSaV0sl+?@ka_VZ$80Vcf;5)Pqj+-0PRR;U +ziytFLVOemINOz4Y#E9#27EM-RX2;1tn_ +z;|=_VfhQPvG!@KyO;!r}yP~}5y&}~}lr%#In}JhT>(+b&r?J<0iGfq+=)BUvX;SLk +zA-I?Ef-O1{7ndQ!WCM2_c)o$pH*ns2GI$I;OG4Ck16TDqPsR>|fmcd~H3lx%CAW1N +zc(zQ8+HK%+*txmaz++{4J_mkcFpQH1RKJ1CY0b?q8n|3foc9|zJpnmp`wTo&C*m@I +zT%UuywK)dE2}6cS1|BqUTo%LOeFGmqOc@Iq_!t8Z-{NH~*+%*Z7=6!Es|HF(m`UZXLbK_ixE?ba4w}9u#{PAKgtE);d|F(c>;tG>8Hn1u` +zOEJYcR!egRrac3DZZHVf19L;(?yY&nOo_onlu~z%^y3k^~=2X-dz(rfGw}{I{k# +zeaEgIa2~j*Y1-A_hqIvJu0ACJF5cx)UWS=P0n^u?!1bazN+HZDeny!D$BGXq?Xacf +z)2zpFJbdR5@)hjr8NCc+uAYjeToP(eln#W?z}C{dQ7?sf5d*Fs%O-fObixQ5CI~Nr +zOQnmmpTik5?7*@eW9VQn7vbRR5VVz*#yp80&=AUj=gKli+>Q3|dN@?pnlXSg8cY5i +zmxOPfz%*C!7E8{7>hcQZCFm&6Oq+X2(|qR}e1B{3X|Ch7xs|-@!pmS!d1-VVE?!qp +zCW8y*4=UYIG1Xo9F!sZifz_X2mABRA#^G(MtEcANSjK977!UvWf~M7S%K;lU9DNEL +zgg2(nu#LgYqOD({=X&Mn;NF{>)*HSLGhyxafVJY$Ag?aW0)6`5@S)M+&Ay*Ag!`!~}u82-?!yER}=>NsG +zVyAS$|JlE-L_vM!x)FEd(>uHxPF7YGoKNM}l=o1?$S2eWv1z540t=dPUeg*Ee}*6l +zCRgPsMKHH2XVOp4@fIg+Nx;dA^I(Bq&5C5K_?*SLFW%Qv`xveYOB?L2%2UR}!K(bR +zmiMtEo1D!&*RHQMt-<%PK7wC{e*>oKdrUXphkL8Dt5)Me#>%WjF;*soajeW)bkex^ +zQ`ffDxwhB%X2IqAywP_VYw#gFU!9>Gg8kLDJR7F+9p(k~;5!G6r!aSeaszw45`S(L +z(Kt}1=P571r0MmsefUuE-JhEuJ_75eS2SLDkGE-mF5kH7QzHB(5`BgYUb-O%xb7^D +zYSfo9TFIkdePfVU!p-U96r3e9HZHvflQiHwQyYDM8ch3_riFt@L`C1wSDd94Ya%L| +zjurLrieAG^tO?|DtrI#4@MySckJG|i8yqP~h6LcPi32Q)1mN5+9#f*Lxc +zX?&z?hc)eos2_!+BMFPVL4`elXaZH1i1GIqFzTWIjLz=qVPTX +zwx+E|?MLlJEjg`eAyfzIb<_b=w*~EIuprbR_VW$YAsozF+)@N_vh<>M;w-$5>cOSr +zz;~wlS550j^`O2r5?_=-ya^%bz&FHA)FD(AcUzvTnwF2+i#h}TIDe8-0w2wvWDR3a +zsn{_x@K@nN{DmN^DJ^CG>zXF_8?{Kg@pnHoHq}*ph?a>MW8aEbzi(O?kFNFC=rzOdg$C3p?B!@U*)+Fc{y|NnZxVga+m4pa$jT`-ug!X7{orgKld>Nz?PS5{0o#L? +zbXe9rR+#}?nl~xY5VPPu<+sqYpg3kK+E3tUyo)ir>E=;5w%}e+o1?7!<7^y`glr10 +zP#dyzNLg5?r+5`(E*u+~Vm^0;tQM9me9)4MBh(Iu7S6NqF=SwExzF+z-UVSU_ +zj?o`$bJ_L-#!JroM_Sj7` +zn|N39iKb;C<$>o=aWXUnUTU2jKU;nw$S(ryQa$jm5FUm%ZZqMtlsl|))7SW&F_p=reglOqn+ +zt>{9hPE)G4#3m9rNZq6!(hky2(q2+OX+P-zX^=ETIz-B{m>yJ8n@}$+A>bf&lX^%y +zNIOY;N&Te#qywZu(h%tosr&{L)nKe{)~sq$m3Zk=T7Mpn4Bc~u3jcF +z^C{?&v0G}!BPe;Gb&K-$C9$Af_6CEQjT!#lHDFAi%;fhjaZ$b*_we!@?e+|*On&d) +z&T)g%Yb4^{%vWUJow$|R?#SWykC%HR`iOreoAB&K&Ar_dp9GxC1u3m|yixGHLYAPA +z;a;78qsiliQzNkDyaf(&MD=IMI#-$JVUfOs+~pDXFTI^l +z)45k=4l;Ns13zR_aFIBc2rxjrg*c=14&r=M!_(U$3f@RO6jAU_$=lEYUm6~A^h;@2 +zEWiNq0C7LhfWe_(89PGUL+NFUFUs^0{Bz>$JHi2fw}_=_5-k`YgIshfaa#np5%)hN +z9C?JWQppL(3b}}fh|BcNCN@%Z^+Ry@$zp3j_>m*JLC=PBH2|?|ij_X7UQ=WmS^DEcq+7W!3;+xe* +zDW#aj*{;n2_pB{4F(<5AyU4`m!0ENc^|>OE+~K@NX**^L-cLS)(npa1@)Y$lad!pG +zURRXSd$%yl(_lMxAU{?fD1e>o7G*>p3jdtU?&%Qw)VF@nw+sbXxWtvPS+#(@vZf24+9)GsW1a +zvBgDY<#v1EL+=Y_=!?yO?oD;DI#vz5x#?|_G6cK7Uz`}idB%g(b~uMr?k=U?0Bct< +zba$!BB53L=j`7o;)en7L_LvaGLhug8pAGsBZuAmR)X=g2w!IUy_<5GRVzR6EyjXW94&X#yr^Rv&VSIsRvH` +z>?%Fby|{wK!&n$f<6Com=fPmc9W_--_8bK+-mQ939Dr_@fs- +ziW&p$+p=PMso+k?>Pm$dk;n(oMmW9AE@SFONZLL#dZS2P2=8F_N4Mum;DX)T?J?aw +V!n_vFZMVlN^j;mUKt|X2{|D$~Sdst$ + +delta 7376 +zcmZvh3v^V~xySdJ$%G`tWWp;CLNmbx0w_tukOaZZkVpmyG87O*9@86C9wCHY^;&8( +z69~#cvsU1vf(RN5_ex#1H=0$86mdW*c)eU>X?@^>v2bO=qlDYl3W}cl-)Db29R~MW +zXa0NtzWsikefG5f-nM_Itvx$qps<`@Qk4!*{c$^ukYSV`|Kt5yrh@tO3Og<*%Ilhy~J2V +zFC=7=J0Z)MZuy$v+a`U+ZtM3!>(@u`C)65uTQN!;m4R$z49C4I*4u>`Aku`hTJdBh +zqQR!Pn=AG+*#@|5=1!Lt6bqGzAETROK9R`^(B)=FI6}o=E5TrbPQ5Nw>ZQt3(KyDdqRmY +zIiubx1s-GmJKaO06}ZH_9xC(i;Z{E{&W$MQWcpvesgw~8~0>Vkiu_(g;*$6RoQ +zcq)nKxqt|d@luX{ow=`Afli3k#s(fs-`&cvgA2&u0y=q46n1%%erluclze(FIgwu8 +zn%_!lZj7dpX83LHvfk6uX;Gp=RS(zyxuKaB!=^g-Qv-pm|%HijRsjh_0tgly1K(UP@*e +zy=}LI5c0N_Jt-x<=6Gp1`Zs#XQ`rARL>3YDwmJ6DDNkOa8xf+-WP0j{AHrPd%fRt6 +zLdf8KDJp}UFQ|2LY4UdD0D~x?Lz9OkE`~k2i@un=BqxHoijw~_TM)LuO-bMKXL|D-dt0V3hxka+oWqlg{TQ39R1yArdcB`hg@hl@>IB&KC7AN8i&NHt=X8( +zQ;nlNuUt3H_UK9^LhX)H*zl?Q1|MWxYs~yi#`jlLwlx~~y`k;kaa?!1yV7O9IwJ9>xO4p|NbB<+M{c%u= +z>W>r{(I2DfUu(;3bB58D>a3x4191%jI^{(g;{BmfK+C;r +z6BlD&j&7qKZ{?`3he+$-uOMpV(`&lXv{{IOf)<`K%^CHV0PdjaQ*SlyrPWh!9eLnm +z*{A6n(lL244}NM@v+PdP?cVx=ebd`&R$&!5TIuzvg*fA#o?0}t@FR5O{hkFf)ze>_ +zW?kqn)(CzTeV2w$n{3Pam>!xoymA|sC@QlB5?dL8%Aqp@-89Hs +zD7P-xz$~e2dFWpdr4IAVIV1Fkp3HAeGujKHD*A@C;v50gL{&5k74^%CrUFehj(O5Y +zEfV;7(AhHvlMJ(@0=r+d@y{rB1o8sNlVB0KX53M6c>uhH($@NSUBiF;3Bmuori15X +z@IzGCny+fgpQKGQhI;!UU3y*+H4=YI|H0Rr9Vrh9u_65E=-K<_#*qHY(s1aO|9cQ@ +z(nb6pb9{+k%kqox18=40)ySdRFsZxi(u_=-v9HVFOR?Jq-%S~_3yc@L#?St*RPsAr +zulo1)3&GR-6mj~nWOMh=^1 +z6V!FYG+Uv5=niNQ`ZBZ^8itmpD@h^ +zsOyiWc~FL-SvXO&pF}~>PV`Y2+KmxR#R;JkGh{y0kEwSM>c;v=!W*aef6)-A`%BZ@ +z2JM9IgZl6mINA>@tQ($>WP}T**$ZugCeS;}MjCFqvTS7bRrE~kfdaF^IzabQ>GI6M +z%YJW~`uKou7aQ>`rA5nY%Pzt)0wHlvn)6B9!Zdk4lW8wXcF;5nrLwDoCZJcd=;P%x +zM=g8PG}W6_9c7lmvJGq;$CkBu0xV3kRty~c->~4#XgO>GLXJ`q{ba>ZqmF*DV!e?? +z*(;|T2Wj`p;^aGFKaSo%i%_{E^$(`mNRt{yZf(d-mR0bf|8JwphT7!$2z4N|kajoB +zb6kfnNY@%>JLX^{vS`+->5jedMd^iAwT@o+4$`GnwaF7P9=`WYvy-l@Dxe=VmODB? +zcG2#}TE|8BN~ouCWndvjr|EO7XOtmkra9N!>eG^@yk(u*9*1o&Y)hpLPB!T0U;-~3 +z>s!E^=Cf}yQqqz<{be`ogRK>>vd7?;PIj;y{a!Hr(IUBw`zLVk8FPr4FA1E4QNX2V +zFos>ToJ-QC>65-b*`qHlw--GiU8)k57JhwR%B@xgY`>OsHq(OUJfoS`HjmAB%Atot +zQI`9NGn20=>ALBiW*5#B=bOi7xH(5mM9T$fRG=6$@%})bEz+OX2A)Eu9@~&WiL5=G +zo7KnaXKi8)vbM8!uy(SBS-V*yti7z(RRzj%W?01um(qYJVc=%7=Bj)&65_MC67lDyv<7 +zS_WfdYK~>w@_js8xW1RuYwO1a;`&H_|Jra{;*@JT#>v$yxn82$R1S|J{#k-vx>GEE +zQs&U-&+v_~6eD-dSh#k@l%fOA{F +zLcGP?&+&D^pX>N>{4#U#LzRJi+o*MiceZSCm<{b*fRni^j=Pw5%u*5k9KTd^p8~o< +zUgikHjcIJUqUN3jt%IojY}54 +zwc_5qF&we@%^T0V;PRe4e#iTq^KrK5oRyxpc;ALJrqB8yUb{AdcdfGzDGwI3yp6@F +zWO8V%EmA^14lTAtCea^5#Z!6D(I-23Q7Gfa-dD;@x|zH1{Vkoo4?V}+T}ab5jm?R_ +z*DXf}%Iw0~v~|(v>O^yP5ah(=z{ndHjv_1?Ej|6;Yqr +z5-?~3I4y*h{5&Jz=6l0S%|Tzm|Fo!4MTivgv}Fz-fm53tf%v~n+{{Hz*V?v_EqQ!}s2_XBxbc-;sqOz^#|?Hr +zIzdxtRZ4o-_-zN|CDWCsi!=1;Mr#F?ZZFQzhe@s7v<6h4b+j&^SGE@?yZN~4rk?HP +z$w3a`NV%gtSsygrw0uWJvR)fbdI>fTxtw$!Aw3QQX!J9EA?E;E@l3gMplZK9-&E2o +z&lIQVrJq|(=aGW<6yc-MJIkHC`Riq!OKWx(575UKt=ALj)t$x3%_?_iBc0z_u0vUk +zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh +dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh + +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 +index f33ce913a..01b208ed2 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +@@ -30,6 +30,22 @@ public abstract class DefinedPacket + writeString( s, buf, Short.MAX_VALUE ); + } + ++ //Velocity start ++ private static final int[] VARINT_EXACT_BYTE_LENGTHS = new int[33]; ++ ++ static { ++ for (int i = 0; i <= 32; ++i) { ++ VARINT_EXACT_BYTE_LENGTHS[i] = (int) Math.ceil((31d - (i - 1)) / 7d); ++ } ++ VARINT_EXACT_BYTE_LENGTHS[32] = 1; // Special case for the number 0. ++ } ++ ++ public static int varIntBytes(int value) { ++ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)]; ++ } ++ //Velocity end ++ ++ + public static void writeString(String s, ByteBuf buf, int maxLength) + { + if ( s.length() > maxLength ) +@@ -198,6 +214,12 @@ public abstract class DefinedPacket + } + } + ++ public static void write21BitVarInt(ByteBuf buf, int value) { ++ // See https://steinborn.me/posts/performance/how-fast-can-you-write-a-varint/ ++ int w = (value & 0x7F | 0x80) << 16 | ((value >>> 7) & 0x7F | 0x80) << 8 | (value >>> 14); ++ buf.writeMedium(w); ++ } ++ + public static int readVarShort(ByteBuf buf) + { + int low = buf.readUnsignedShort(); +diff --git a/proxy/pom.xml b/proxy/pom.xml +index 10fe411d8..f6daaea4d 100644 +--- a/proxy/pom.xml ++++ b/proxy/pom.xml +@@ -165,6 +165,12 @@ + ${project.version} + compile + ++ ++ io.github.waterfallmc ++ waterfall-native ++ ${project.version} ++ compile ++ + + io.github.waterfallmc + waterfall-module-cmd-alert +diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +index f5059666e..dba21bcc7 100644 +--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java ++++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +@@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; + import dev._2lstudios.flamecord.configuration.ModulesConfiguration; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import io.github.waterfallmc.waterfall.conf.WaterfallConfiguration; ++import dev._2lstudios.flamecord.natives.Natives; + import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; + import io.github.waterfallmc.waterfall.exception.ProxyPluginEnableDisableException; + import io.netty.bootstrap.ServerBootstrap; +@@ -256,23 +257,7 @@ public class BungeeCord extends ProxyServer + + pluginManager = new PluginManager( this ); + +- if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) ) +- { +- if ( EncryptionUtil.nativeFactory.load() ) +- { +- logger.info( "Using mbed TLS based native cipher." ); +- } else +- { +- logger.info( "Using standard Java JCE cipher." ); +- } +- if ( CompressFactory.zlib.load() ) +- { +- logger.info( "Using zlib based native compressor." ); +- } else +- { +- logger.info( "Using standard Java compressor." ); +- } +- } ++ logger.log(Level.INFO, "FlameCord is using " + Natives.getCompressorFactory().getName() + " compression"); + } + + /** +diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +index d07cf4627..10cb0430c 100644 +--- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java ++++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +@@ -1,45 +1,74 @@ + package net.md_5.bungee.compress; + ++import java.util.zip.DataFormatException; ++ ++import dev._2lstudios.flamecord.natives.MoreByteBufUtils; ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import io.netty.buffer.ByteBuf; ++import io.netty.buffer.ByteBufAllocator; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.MessageToByteEncoder; +-import java.util.zip.Deflater; + import lombok.Setter; +-import net.md_5.bungee.jni.zlib.BungeeZlib; + import net.md_5.bungee.protocol.DefinedPacket; + +-public class PacketCompressor extends MessageToByteEncoder +-{ ++public class PacketCompressor extends MessageToByteEncoder { ++ ++ private final Compressor compressor; + +- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); + @Setter + private int threshold = 256; + +- @Override +- public void handlerAdded(ChannelHandlerContext ctx) throws Exception +- { +- zlib.init( true, Deflater.DEFAULT_COMPRESSION ); ++ public PacketCompressor(Compressor compressor) { ++ this.compressor = compressor; + } + + @Override +- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception +- { +- zlib.free(); ++ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { ++ compressor.close(); + } + + @Override +- protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception +- { ++ protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception { + int origSize = msg.readableBytes(); +- if ( origSize < threshold ) +- { +- DefinedPacket.writeVarInt( 0, out ); +- out.writeBytes( msg ); +- } else +- { +- DefinedPacket.writeVarInt( origSize, out ); +- +- zlib.process( msg, out ); ++ if (origSize < threshold) { ++ // Under the threshold, there is nothing to do. ++ DefinedPacket.writeVarInt(0, out); ++ out.writeBytes(msg); ++ return; ++ } ++ ++ int uncompressed = msg.readableBytes(); ++ ++ DefinedPacket.writeVarInt(uncompressed, out); ++ ByteBuf compatibleIn = MoreByteBufUtils.ensureCompatible(ctx.alloc(), compressor, msg); ++ ++ int startCompressed = out.writerIndex(); ++ try { ++ compressor.deflate(compatibleIn, out); ++ } finally { ++ compatibleIn.release(); ++ } ++ int compressedLength = out.writerIndex() - startCompressed; ++ if (compressedLength >= 1 << 21) { ++ throw new DataFormatException("The server sent a very large (over 2MiB compressed) packet."); + } + } ++ ++ @Override ++ protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) throws Exception { ++ return allocateByteBufForCompression(ctx.alloc(), msg, threshold); ++ } ++ ++ public static ByteBuf allocateByteBufForCompression(ByteBufAllocator allocator, ByteBuf msg, int threshold) { ++ int uncompressed = msg.readableBytes(); ++ if (uncompressed < threshold) { ++ int finalBufferSize = uncompressed + 1; ++ finalBufferSize += DefinedPacket.varIntBytes(finalBufferSize); ++ return allocator.directBuffer(finalBufferSize); ++ } ++ ++ // (maximum data length after compression) + packet length varint + uncompressed data varint ++ int initialBufferSize = (uncompressed - 1) + 3 + DefinedPacket.varIntBytes(uncompressed); ++ return allocator.directBuffer(initialBufferSize); ++ } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +index eaedf4bc4..066bdafc8 100644 +--- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java ++++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +@@ -1,5 +1,6 @@ + package net.md_5.bungee.compress; + ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import lombok.*; + + import com.google.common.base.Preconditions; +@@ -8,53 +9,75 @@ import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.MessageToMessageDecoder; + import java.util.List; + import net.md_5.bungee.jni.zlib.BungeeZlib; ++import net.md_5.bungee.protocol.BadPacketException; + import net.md_5.bungee.protocol.DefinedPacket; + ++import static dev._2lstudios.flamecord.natives.MoreByteBufUtils.ensureCompatible; ++ ++ + @RequiredArgsConstructor +-public class PacketDecompressor extends MessageToMessageDecoder +-{ ++public class PacketDecompressor extends MessageToMessageDecoder { ++ private static final int VANILLA_MAXIMUM_UNCOMPRESSED_SIZE = 8 * 1024 * 1024; // 8MiB ++ private static final int MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING = ((100 * 4) + Short.MAX_VALUE) + 5 + 5; //((100 chars channel tag) + max data size) + string varint + packet id varint + +- private final int compressionThreshold; +- private final BungeeZlib zlib = CompressFactory.zlib.newInstance(); ++ @Setter ++ private boolean checking = false; + +- @Override +- public void handlerAdded(ChannelHandlerContext ctx) throws Exception +- { +- zlib.init( false, 0 ); +- } ++ private final Compressor compressor; ++ private final int threshold; + + @Override +- public void handlerRemoved(ChannelHandlerContext ctx) throws Exception +- { +- zlib.free(); ++ public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { ++ compressor.close(); + } + + @Override +- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception +- { +- int size = DefinedPacket.readVarInt( in ); +- if ( size == 0 ) +- { +- out.add( in.retain() ); +- } else +- { +- Preconditions.checkArgument( size >= compressionThreshold, "Decompressed size %s less than compression threshold %s", size, compressionThreshold); +- ByteBuf decompressed = ctx.alloc().directBuffer(); +- +- try +- { +- zlib.process( in, decompressed ); +- Preconditions.checkArgument( decompressed.readableBytes() == size, "Decompressed size %s is not equal to actual decompressed bytes", size, decompressed.readableBytes()); +- +- out.add( decompressed ); +- decompressed = null; +- } finally +- { +- if ( decompressed != null ) +- { +- decompressed.release(); +- } +- } ++ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { ++ int size = DefinedPacket.readVarInt(in); ++ if (size == 0) { ++ out.add(in.retain()); ++ return; ++ } ++ ++ //Velocity start ++ if (threshold != -1 && size < threshold) { ++ throw new BadPacketException( ++ "Uncompressed size " + size + " is less than threshold " + threshold ++ ); ++ } ++ ++ if (size > VANILLA_MAXIMUM_UNCOMPRESSED_SIZE) { ++ throw new BadPacketException("" + ++ "Uncompressed size " + size + " exceeds threshold of " + VANILLA_MAXIMUM_UNCOMPRESSED_SIZE ++ ); ++ } ++ ++ if (checking && size > MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING) { ++ throw new BadPacketException( ++ "Uncompressed size " + size + " exceeds threshold of " + MAXIMUM_UNCOMPRESSED_SIZE_WHILE_CHECKING + " (While checking)" ++ ); ++ } ++ //Velocity end ++ ++ ByteBuf compatibleIn = ensureCompatible(ctx.alloc(), compressor, in); ++ ByteBuf uncompressed; ++ if (checking) { ++ uncompressed = ctx.alloc().directBuffer(size, size); ++ } ++ else { ++ uncompressed = ctx.alloc().directBuffer(size); ++ } ++ ++ try { ++ compressor.inflate(compatibleIn, uncompressed, size); ++ out.add(uncompressed); ++ } ++ catch (Exception e) { ++ uncompressed.release(); ++ throw e; ++ } ++ finally { ++ compatibleIn.release(); + } + } +-} ++} +\ No newline at end of file +diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +index 8d4439ab8..95ed34416 100644 +--- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java ++++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +@@ -44,8 +44,8 @@ public class ForgeUtils + if ( discriminator == 2 ) // ModList + { + ByteBuf buffer = payload.slice(); +- int modCount = DefinedPacket.readVarInt( buffer, 2 ); +- for ( int i = 0; i < modCount; i++ ) ++ int modCount = DefinedPacket.readVarInt( buffer ); // FlameCord - Remove length check for compression ++ for ( int i = 0; i < modCount; i++ ) + { + modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); + } +diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +index b98ee6a75..ffe038168 100644 +--- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java ++++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +@@ -1,6 +1,10 @@ + package net.md_5.bungee.netty; + + import com.google.common.base.Preconditions; ++import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; ++import dev._2lstudios.flamecord.natives.Natives; ++import dev._2lstudios.flamecord.natives.compress.Compressor; + import io.netty.channel.Channel; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandler; +@@ -145,15 +149,16 @@ public class ChannelWrapper + return ch; + } + +- public void setCompressionThreshold(int compressionThreshold) +- { ++ public void setCompressionThreshold(int compressionThreshold) { ++ Compressor compressor = Natives.getCompressorFactory().create( FlameCord.getInstance().getFlameCordConfiguration().getCompressionLevel() ); ++ + // FlameCord - Use pipeline to reduce redundancy + final ChannelPipeline pipeline = ch.pipeline(); + if ( pipeline.get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + { +- addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); ++ addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor( compressor ) ); + } +- if ( compressionThreshold != -1 ) ++ if ( compressionThreshold != -1 ) + { + pipeline.get( PacketCompressor.class ).setThreshold( compressionThreshold ); + } else +@@ -163,7 +168,7 @@ public class ChannelWrapper + + if ( pipeline.get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + { +- addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor(compressionThreshold) ); ++ addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor( compressor, compressionThreshold ) ); // FlameCord - Implement Libdeflate + } + if ( compressionThreshold == -1 ) + { +@@ -171,6 +176,7 @@ public class ChannelWrapper + } + } + ++ + // FlameCord start - Antibot System + // Make the channel accessible + public Channel getChannel() { +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 f04fdd9ce..9aebc9e1a 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 +@@ -126,7 +126,8 @@ public class PipelineUtils + }; + public static final Base BASE = new Base(); + private static final KickStringWriter legacyKicker = new KickStringWriter(); +- private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); ++ // FlameCord - Implement Libdeflate ++ public static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); + public static final String TIMEOUT_HANDLER = "timeout"; + public static final String PACKET_DECODER = "packet-decoder"; + public static final String PACKET_ENCODER = "packet-encoder"; +-- +2.37.3.windows.1 + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..a1167dd0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + io.github.waterfallmc + waterfall-super + dev-SNAPSHOT + pom + + Waterfall-Super + Super project for FlameCord. + https://github.com/2lstudios-mc/FlameCord + + + FlameCord-Proxy + + + + clean install + + + + UTF-8 + + From 0c6fc5fafd9b1fbed3e716794231518b7440eee0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:35:58 -0300 Subject: [PATCH 418/499] Show better information when someone gets blacklisted --- .../0028-Antibot-System.patch | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index ca0779d9..4cf2a22f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 405f365b733a8d8a322b0426ef103cdc7774cffe Mon Sep 17 00:00:00 2001 +From f18ce5e7dc170f19e8bb57e74cafbd9bb90658ae Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -242,14 +242,15 @@ index 000000000..0295ea89d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..7c7899830 +index 000000000..7aa157966 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java -@@ -0,0 +1,165 @@ +@@ -0,0 +1,170 @@ +package dev._2lstudios.flamecord.antibot; + +import java.util.Collection; +import java.util.HashSet; ++import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -377,6 +378,10 @@ index 000000000..7c7899830 + this.lastFirewall = System.currentTimeMillis(); + this.firewallReason = reason; + ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog()) { ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, hostString ); ++ } ++ + // Queue the firewall as a ipset linux command + FlameCord.getInstance().queueLinuxCommand("ipset add flamecord-firewall " + hostString); + } @@ -1700,7 +1705,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8994454c7..62712330e 100644 +index 9ecdbd174..b55855196 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1883,22 +1888,19 @@ index 66332af4e..c16e28c80 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e4..1e3608fa4 100644 +index e2911d5e4..d853b4044 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -@@ -8,7 +8,11 @@ import io.netty.handler.codec.http.HttpResponse; +@@ -8,6 +8,8 @@ import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.LastHttpContent; import java.nio.charset.Charset; -+import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; import lombok.RequiredArgsConstructor; -+import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.Callback; - @RequiredArgsConstructor -@@ -21,6 +25,15 @@ public class HttpHandler extends SimpleChannelInboundHandler +@@ -21,6 +23,14 @@ public class HttpHandler extends SimpleChannelInboundHandler @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { @@ -1907,7 +1909,6 @@ index e2911d5e4..1e3608fa4 100644 + if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); -+ BungeeCord.getInstance().getLogger().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + @@ -1931,19 +1932,18 @@ index b3fa48355..6f1d8336d 100644 + // FlameCord end - Antibot System } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..3fce5ff11 100644 +index 14e3004fc..b61ed5218 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -@@ -12,6 +12,8 @@ import io.netty.handler.timeout.ReadTimeoutException; +@@ -12,6 +12,7 @@ import io.netty.handler.timeout.ReadTimeoutException; import java.io.IOException; import java.net.InetSocketAddress; import java.util.logging.Level; + -+import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.connection.CancelSendSignal; import net.md_5.bungee.connection.InitialHandler; -@@ -146,6 +148,15 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter +@@ -146,6 +147,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { @@ -1952,7 +1952,6 @@ index 14e3004fc..3fce5ff11 100644 + if (FlameCord.getInstance().getFlameCordConfiguration().getAntibotFirewalledExceptions().contains(reason)) + { + FlameCord.getInstance().getAddressDataManager().getAddressData(ctx.channel().remoteAddress()).firewall(reason); -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, ctx.channel().remoteAddress() ); + } + // Flamecord end - Antibot System + From dafe1e3bb1dee70e77552b114c345706a59fe389 Mon Sep 17 00:00:00 2001 From: Sammwy Date: Sat, 25 Feb 2023 11:16:08 -0300 Subject: [PATCH 419/499] doc: enhance readme, code_of_conduct.md and security.md file --- .gitattributes | 2 + CODE_OF_CONDUCT.md | 133 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 44 +++++++++++---- SECURITY.md | 16 ++++++ 4 files changed, 183 insertions(+), 12 deletions(-) create mode 100644 .gitattributes create mode 100644 CODE_OF_CONDUCT.md create mode 100644 SECURITY.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..aceca530 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Ensuring github workflows eol for all platform is lf +* eol=lf \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..45d257b2 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/README.md b/README.md index f22f7172..19605bb5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ # FlameCord -FlameCord is a Waterfall fork or modification that adds antibot features, exploit prevention systems, performance improvements, removal of unused features, library updates and application layer ddos mitigation. - -## Links +![Download](https://img.shields.io/badge/Download-%244.99-blue?style=flat-square) ![Discord](https://img.shields.io/discord/442079515498381312?style=flat-square&color=%237289da&label=Discord&logo=discord&logoColor=%237289da) ![GitHub](https://img.shields.io/github/license/2lstudios-mc/flamecord?style=flat-square) - +FlameCord is a Waterfall fork or modification that adds antibot features, exploit prevention systems, performance improvements, removal of unused features, library updates and application layer ddos mitigation. -## Features +## ⭐ Features FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: @@ -16,26 +14,48 @@ FlameCord being a fork of Waterfall, has all its features, and some of its own, * **Performance Improvements**: FlameCord tries to improve performance by removing unused features and disabling exception logs. -## Why fork Waterfall? +## 💻 Why fork Waterfall? FlameCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. FlameCord will track upstream Waterfall and merge changes as needed. -## How to (Server Admins) +## 🌱 Get Started + +### How to (Server Admins) Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. -## How To (Compiling from source) +### How To (Compiling from source) + +To compile FlameCord, you need JDK 8 or above, git, bash, maven, and an internet connection. + +```bash +# Clone this repo. +git clone https://github.com/2lstudios-mc/FlameCord + +# Navigate to the cloned repository. +cd FlameCord + +# Build project. +./flamecord b +``` + +> **Note:** +> To compile on Windows you must do it from a [git-bash](https://git-scm.com/downloads) terminal or [WSL](https://learn.microsoft.com/windows/wsl/install). + +The jar will be generated in the directory `FlameCord-Proxy/bootstrap/target` -To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet connection. +## 🤝 Contributing -Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` +Contributions, issues and feature requests are welcome! +Feel free to check [issues page](https://github.com/2lstudios-mc/flamecord). FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. -## Contribute +## 📝 License -* Feel free to open a PR! We accept contributions. +Copyright © 2018-2023 [2LStudios](https://github.com/2lstudios-mc). +This project is [MIT License](LICENSE.txt) licensed. \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..366bf225 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +> **Warning** +> To avoid major problems please report all vulnerabilities privately. + +## Report a Vulnerability + +If you suspect or confirm a possible vulnerability, let us know privately by DM. You can find us on our [Discord server](https://discord.gg/gF36AT3). Due to the limited time, it is possible that the issue will not be answered or fixed, if so, it is because the team considers that it is not of vital importance. It will still be taken into consideration. + +In your report, please include as much detail as possible: + +- The version or git sha of FlameCord you are running. +- Your operating system distribution & version. +- Steps to reproduce. +- Expected behavior. +- Obtained behavior. From 5197465560dad83a0b03b0a37b53931e706460b6 Mon Sep 17 00:00:00 2001 From: Sammwy Date: Sat, 25 Feb 2023 19:34:09 -0300 Subject: [PATCH 420/499] fix: fixed shields (badges) redirect link on click --- CODE_OF_CONDUCT.md | 3 +-- README.md | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 45d257b2..df486cd4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,8 +60,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[INSERT CONTACT METHOD]. +reported to the community leaders responsible for enforcement at our [Discord server](https://discord.gg/gF36AT3). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/README.md b/README.md index 19605bb5..3effdbe8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ # FlameCord -![Download](https://img.shields.io/badge/Download-%244.99-blue?style=flat-square) ![Discord](https://img.shields.io/discord/442079515498381312?style=flat-square&color=%237289da&label=Discord&logo=discord&logoColor=%237289da) ![GitHub](https://img.shields.io/github/license/2lstudios-mc/flamecord?style=flat-square) + + + + + + + + + FlameCord is a Waterfall fork or modification that adds antibot features, exploit prevention systems, performance improvements, removal of unused features, library updates and application layer ddos mitigation. @@ -58,4 +66,4 @@ FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](h ## 📝 License Copyright © 2018-2023 [2LStudios](https://github.com/2lstudios-mc). -This project is [MIT License](LICENSE.txt) licensed. \ No newline at end of file +This project is [MIT License](LICENSE.txt) licensed. From f8c6350028e951dbfbb845f9ec3e4f90a83a6aef Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:20:34 -0300 Subject: [PATCH 421/499] Update README.md --- README.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/README.md b/README.md index 3effdbe8..91429601 100644 --- a/README.md +++ b/README.md @@ -36,26 +36,6 @@ Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. -### How To (Compiling from source) - -To compile FlameCord, you need JDK 8 or above, git, bash, maven, and an internet connection. - -```bash -# Clone this repo. -git clone https://github.com/2lstudios-mc/FlameCord - -# Navigate to the cloned repository. -cd FlameCord - -# Build project. -./flamecord b -``` - -> **Note:** -> To compile on Windows you must do it from a [git-bash](https://git-scm.com/downloads) terminal or [WSL](https://learn.microsoft.com/windows/wsl/install). - -The jar will be generated in the directory `FlameCord-Proxy/bootstrap/target` - ## 🤝 Contributing Contributions, issues and feature requests are welcome! From f647bc152555df96f7fddbb0d42b860491ba11ce Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:23:15 -0300 Subject: [PATCH 422/499] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 91429601..f2b9f696 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. + + ## 🤝 Contributing Contributions, issues and feature requests are welcome! From edb0df7eeb55f144c575eb8c857193f051cb058b Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:23:47 -0300 Subject: [PATCH 423/499] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f2b9f696..390ffc44 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,11 @@ FlameCord will track upstream Waterfall and merge changes as needed. ## 🌱 Get Started -### How to (Server Admins) - Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. - + ## 🤝 Contributing From cdaf836ca80db8d1fdada513c4b827fb338d4f0f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 10 Mar 2023 23:34:29 -0300 Subject: [PATCH 424/499] DynDNS Support --- .../0041-DynDNS-Support.patch | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0041-DynDNS-Support.patch diff --git a/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch b/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch new file mode 100644 index 00000000..bc4c8086 --- /dev/null +++ b/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch @@ -0,0 +1,108 @@ +From 58df06f4485af12677ab0033e7cb7c382354b782 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Fri, 10 Mar 2023 23:33:01 -0300 +Subject: [PATCH] DynDNS Support + + +diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +index 97bd384b2..1e76d1a13 100644 +--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java ++++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +@@ -13,6 +13,8 @@ import net.md_5.bungee.api.config.ServerInfo; + @Deprecated + public interface ProxyConfig + { ++ // FlameCord - DynDNS Support ++ void updateServerIPs(); + + /** + * Time before users are disconnected due to no network activity. +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 021fe8398..d7824dddd 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -369,17 +369,31 @@ public final class UserConnection implements ProxiedPlayer + future.channel().close(); + pendingConnects.remove( target ); + +- ServerInfo def = updateAndGetNextServer( target ); +- if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) ) ++ // FlameCord start - DynDNS Support ++ InetSocketAddress updated = (InetSocketAddress) Util.getAddr( target.getAddress().getHostName() + ":" + target.getAddress().getPort() ); ++ if ( !updated.getAddress().getHostAddress().equals( target.getAddress().getAddress().getHostAddress() ) ) + { +- if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_lobby" ) ); // Waterfall +- connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK, request.getConnectTimeout(), request.isSendFeedback() ); // Waterfall +- } else if ( dimensionChange ) +- { +- disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); ++ ProxyServer.getInstance().getConfig().updateServerIPs(); ++ System.out.println( "Updated server IPs" ); ++ ++ connect( ProxyServer.getInstance().getServerInfo( target.getName() ), null, false, ServerConnectEvent.Reason.UNKNOWN ); + } else + { +- if (request.isSendFeedback()) sendMessage( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); ++ // FlameCord end - DynDNS Support ++ ServerInfo def = updateAndGetNextServer( target ); ++ if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) ) ++ { ++ sendMessage( bungee.getTranslation( "fallback_lobby" ) ); ++ connect( def, null, true, ServerConnectEvent.Reason.LOBBY_FALLBACK ); ++ } else if ( dimensionChange ) ++ { ++ disconnect( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) ); ++ } else ++ { ++ sendMessage( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) ); ++ ++ sendMessage( "§cCause: " + future.cause().getMessage() + " | " + future.cause().toString() ); ++ } + } + } + } +diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +index b67195ec8..e9fccb2d0 100644 +--- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java ++++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap; // Waterfall + import gnu.trove.map.TMap; + import java.io.File; + import java.io.IOException; ++import java.net.InetSocketAddress; + import java.util.Arrays; + import java.util.Collection; + import java.util.Map; +@@ -15,6 +16,7 @@ import lombok.Getter; + import lombok.Synchronized; // Waterfall + + import net.md_5.bungee.BungeeCord; ++import net.md_5.bungee.Util; + import net.md_5.bungee.api.Favicon; + import net.md_5.bungee.api.ProxyConfig; + import net.md_5.bungee.api.ProxyServer; +@@ -31,6 +33,21 @@ import net.md_5.bungee.util.CaseInsensitiveSet; + @Getter + public abstract class Configuration implements ProxyConfig + { ++ // FlameCord start - DynDNS Support ++ public void updateServerIPs() ++ { ++ TMap newServers = new CaseInsensitiveMap<>(); ++ ++ for ( ServerInfo info : servers.values() ) ++ { ++ InetSocketAddress updated = (InetSocketAddress) Util.getAddr( info.getAddress().getHostName() + ":" + info.getAddress().getPort() ); ++ ServerInfo updatedInfo = ProxyServer.getInstance().constructServerInfo( info.getName(), updated, info.getMotd(), info.isRestricted() ); ++ newServers.put( info.getName(), updatedInfo ); ++ } ++ ++ servers = newServers; ++ } ++ // FlameCord end - DynDNS Support + + /** + * Time before users are disconnected due to no network activity. +-- +2.37.3.windows.1 + From 3f8db08ea0f19f4268a29450af5a37f364d46917 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 10 Mar 2023 23:37:47 -0300 Subject: [PATCH 425/499] Remove unused log --- Waterfall-Proxy-Patches/0041-DynDNS-Support.patch | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch b/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch index bc4c8086..d98331cb 100644 --- a/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch +++ b/Waterfall-Proxy-Patches/0041-DynDNS-Support.patch @@ -1,4 +1,4 @@ -From 58df06f4485af12677ab0033e7cb7c382354b782 Mon Sep 17 00:00:00 2001 +From 0c34bb827c1070b27a6e6ffcc548d6875c23efc6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 10 Mar 2023 23:33:01 -0300 Subject: [PATCH] DynDNS Support @@ -18,10 +18,10 @@ index 97bd384b2..1e76d1a13 100644 /** * Time before users are disconnected due to no network activity. 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 021fe8398..d7824dddd 100644 +index 021fe8398..4e3982d24 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java -@@ -369,17 +369,31 @@ public final class UserConnection implements ProxiedPlayer +@@ -369,17 +369,29 @@ public final class UserConnection implements ProxiedPlayer future.channel().close(); pendingConnects.remove( target ); @@ -37,8 +37,6 @@ index 021fe8398..d7824dddd 100644 - { - disconnect( bungee.getTranslation( "fallback_kick", connectionFailMessage( future.cause() ) ) ); + ProxyServer.getInstance().getConfig().updateServerIPs(); -+ System.out.println( "Updated server IPs" ); -+ + connect( ProxyServer.getInstance().getServerInfo( target.getName() ), null, false, ServerConnectEvent.Reason.UNKNOWN ); } else { From a42a9dccecedf0cd4fa9b6cd1a7a7b54ab92c02a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 10 Mar 2023 23:49:17 -0300 Subject: [PATCH 426/499] 1.3.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 29c2ad9e..c68e6809 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 84cae2e73501b000c7f15d260d4ec736d7025ea3 Mon Sep 17 00:00:00 2001 +From 2bb5da307d6b60ff46fd9135808c4f46df035484 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..0ed479c8d 100644 +index 8617cdc7a..4568e9b0b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..0ed479c8d 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.6"; ++ return "1.3.7"; } public final void reloadMessages() From b260781a6f346842b4ea6931090d870aaedd8022 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Sat, 11 Mar 2023 10:57:46 -0300 Subject: [PATCH 427/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 390ffc44..37d53656 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ -FlameCord is a Waterfall fork or modification that adds antibot features, exploit prevention systems, performance improvements, removal of unused features, library updates and application layer ddos mitigation. +FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 ## ⭐ Features From 8b9401f3d6909b76a5b9a0e8dddc02282fe1b170 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:54:30 -0300 Subject: [PATCH 428/499] Change gitmodule url to LinsaFTW Waterfall --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f5069af2..88ee6b9c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Waterfall"] path = Waterfall - url = https://github.com/WaterfallMC/Waterfall.git + url = https://github.com/LinsaFTW/Waterfall.git From d094fc161646da38444914f5ca284d1dc394055a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Mar 2023 15:00:06 -0300 Subject: [PATCH 429/499] 1.19.4 Support --- Waterfall | 2 +- .../0004-1.7.x-support.patch | 60 ++++++++-------- .../0021-Fix-ByteBuf-memory-leaks.patch | 6 +- ...dded-an-api-method-to-unload-Plugins.patch | 10 +-- .../0025-Apply-packet-limits.patch | 10 +-- .../0028-Antibot-System.patch | 8 +-- ...0030-Disable-entity-Metadata-Rewrite.patch | 69 ++++++++++--------- .../0038-List-Command-Format.patch | 11 ++- 8 files changed, 90 insertions(+), 86 deletions(-) diff --git a/Waterfall b/Waterfall index 756aa03a..fe174361 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 756aa03a7de78edb76c6dcf2e1953eebe0cb04bd +Subproject commit fe17436165e6027194c23d96f2c11665d46b259b diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index ceb18cfc..2bb78957 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From c6b956bee70e03b5983a6c83a083ba9426258667 Mon Sep 17 00:00:00 2001 +From f6c2732d23405260984a660dda715f6f03fab6b6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -46,7 +46,7 @@ index 59f2cb73d..f33ce913a 100644 + // FlameCord end - 1.7.x support } 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 -index 2357f3801..c9e45b915 100644 +index 8bf14d561..c433ac4ab 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -66,7 +66,7 @@ public enum Protocol @@ -67,7 +67,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1F ), map( ProtocolConstants.MINECRAFT_1_13, 0x21 ), map( ProtocolConstants.MINECRAFT_1_14, 0x20 ), -@@ -93,7 +93,7 @@ public enum Protocol +@@ -94,7 +94,7 @@ public enum Protocol TO_CLIENT.registerPacket( Login.class, Login::new, @@ -76,7 +76,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x23 ), map( ProtocolConstants.MINECRAFT_1_13, 0x25 ), map( ProtocolConstants.MINECRAFT_1_15, 0x26 ), -@@ -106,7 +106,7 @@ public enum Protocol +@@ -108,7 +108,7 @@ public enum Protocol ); TO_CLIENT.registerPacket( Chat.class, Chat::new, @@ -85,7 +85,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0F ), map( ProtocolConstants.MINECRAFT_1_13, 0x0E ), map( ProtocolConstants.MINECRAFT_1_15, 0x0F ), -@@ -117,7 +117,7 @@ public enum Protocol +@@ -119,7 +119,7 @@ public enum Protocol TO_CLIENT.registerPacket( Respawn.class, Respawn::new, @@ -94,7 +94,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x33 ), map( ProtocolConstants.MINECRAFT_1_12, 0x34 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ), -@@ -144,20 +144,20 @@ public enum Protocol +@@ -148,20 +148,20 @@ public enum Protocol TO_CLIENT.registerPacket( EntityEffect.class, EntityEffect::new, @@ -118,7 +118,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x2D ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ), map( ProtocolConstants.MINECRAFT_1_13, 0x30 ), -@@ -173,7 +173,7 @@ public enum Protocol +@@ -177,7 +177,7 @@ public enum Protocol TO_CLIENT.registerPacket( TabCompleteResponse.class, TabCompleteResponse::new, @@ -127,7 +127,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0E ), map( ProtocolConstants.MINECRAFT_1_13, 0x10 ), map( ProtocolConstants.MINECRAFT_1_15, 0x11 ), -@@ -186,7 +186,7 @@ public enum Protocol +@@ -191,7 +191,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardObjective.class, ScoreboardObjective::new, @@ -136,7 +136,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x3F ), map( ProtocolConstants.MINECRAFT_1_12, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ), -@@ -200,7 +200,7 @@ public enum Protocol +@@ -206,7 +206,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardScore.class, ScoreboardScore::new, @@ -145,7 +145,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x42 ), map( ProtocolConstants.MINECRAFT_1_12, 0x44 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ), -@@ -214,7 +214,7 @@ public enum Protocol +@@ -221,7 +221,7 @@ public enum Protocol TO_CLIENT.registerPacket( ScoreboardDisplay.class, ScoreboardDisplay::new, @@ -154,7 +154,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x38 ), map( ProtocolConstants.MINECRAFT_1_12, 0x3A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ), -@@ -228,7 +228,7 @@ public enum Protocol +@@ -236,7 +236,7 @@ public enum Protocol TO_CLIENT.registerPacket( Team.class, Team::new, @@ -163,7 +163,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x41 ), map( ProtocolConstants.MINECRAFT_1_12, 0x43 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ), -@@ -242,7 +242,7 @@ public enum Protocol +@@ -251,7 +251,7 @@ public enum Protocol TO_CLIENT.registerPacket( PluginMessage.class, PluginMessage::new, @@ -172,7 +172,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x18 ), map( ProtocolConstants.MINECRAFT_1_13, 0x19 ), map( ProtocolConstants.MINECRAFT_1_14, 0x18 ), -@@ -257,7 +257,7 @@ public enum Protocol +@@ -267,7 +267,7 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -181,7 +181,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1A ), map( ProtocolConstants.MINECRAFT_1_13, 0x1B ), map( ProtocolConstants.MINECRAFT_1_14, 0x1A ), -@@ -272,7 +272,7 @@ public enum Protocol +@@ -283,7 +283,7 @@ public enum Protocol TO_CLIENT.registerPacket( Title.class, Title::new, @@ -190,7 +190,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_12, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ), map( ProtocolConstants.MINECRAFT_1_13, 0x4B ), -@@ -317,7 +317,7 @@ public enum Protocol +@@ -333,7 +333,7 @@ public enum Protocol TO_CLIENT.registerPacket( PlayerListHeaderFooter.class, PlayerListHeaderFooter::new, @@ -199,7 +199,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x48 ), map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ), map( ProtocolConstants.MINECRAFT_1_12, 0x49 ), -@@ -335,7 +335,7 @@ public enum Protocol +@@ -352,7 +352,7 @@ public enum Protocol TO_CLIENT.registerPacket( EntityStatus.class, EntityStatus::new, @@ -208,7 +208,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x1B ), map( ProtocolConstants.MINECRAFT_1_13, 0x1C ), map( ProtocolConstants.MINECRAFT_1_14, 0x1B ), -@@ -401,7 +401,7 @@ public enum Protocol +@@ -425,7 +425,7 @@ public enum Protocol TO_SERVER.registerPacket( KeepAlive.class, KeepAlive::new, @@ -217,7 +217,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x0B ), map( ProtocolConstants.MINECRAFT_1_12, 0x0C ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ), -@@ -415,7 +415,7 @@ public enum Protocol +@@ -440,7 +440,7 @@ public enum Protocol ); TO_SERVER.registerPacket( Chat.class, Chat::new, @@ -226,7 +226,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12, 0x03 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ), -@@ -437,7 +437,7 @@ public enum Protocol +@@ -462,7 +462,7 @@ public enum Protocol TO_SERVER.registerPacket( TabCompleteRequest.class, TabCompleteRequest::new, @@ -235,7 +235,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x01 ), map( ProtocolConstants.MINECRAFT_1_12, 0x02 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ), -@@ -450,7 +450,7 @@ public enum Protocol +@@ -476,7 +476,7 @@ public enum Protocol TO_SERVER.registerPacket( ClientSettings.class, ClientSettings::new, @@ -244,7 +244,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x04 ), map( ProtocolConstants.MINECRAFT_1_12, 0x05 ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ), -@@ -462,7 +462,7 @@ public enum Protocol +@@ -489,7 +489,7 @@ public enum Protocol TO_SERVER.registerPacket( PluginMessage.class, PluginMessage::new, @@ -253,7 +253,7 @@ index 2357f3801..c9e45b915 100644 map( ProtocolConstants.MINECRAFT_1_9, 0x09 ), map( ProtocolConstants.MINECRAFT_1_12, 0x0A ), map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ), -@@ -483,23 +483,23 @@ public enum Protocol +@@ -511,23 +511,23 @@ public enum Protocol TO_CLIENT.registerPacket( StatusResponse.class, StatusResponse::new, @@ -281,7 +281,7 @@ index 2357f3801..c9e45b915 100644 ); } }, -@@ -511,22 +511,22 @@ public enum Protocol +@@ -539,22 +539,22 @@ public enum Protocol TO_CLIENT.registerPacket( Kick.class, Kick::new, @@ -308,7 +308,7 @@ index 2357f3801..c9e45b915 100644 ); TO_CLIENT.registerPacket( LoginPayloadRequest.class, -@@ -537,12 +537,12 @@ public enum Protocol +@@ -565,12 +565,12 @@ public enum Protocol TO_SERVER.registerPacket( LoginRequest.class, LoginRequest::new, @@ -324,7 +324,7 @@ index 2357f3801..c9e45b915 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index 85f1b0b46..b5b3b2890 100644 +index fa625d964..34a90b85e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index 85f1b0b46..b5b3b2890 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -47,6 +51,7 @@ public class ProtocolConstants +@@ -48,6 +52,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,7 +346,7 @@ index 85f1b0b46..b5b3b2890 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -61,6 +66,10 @@ public class ProtocolConstants +@@ -62,6 +67,10 @@ public class ProtocolConstants "1.19.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( @@ -915,7 +915,7 @@ index a5555f6af..1eb458b61 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ca1dad0e5..e11e30402 100644 +index 4568e9b0b..d2b28ebb6 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer @@ -1099,7 +1099,7 @@ index b44d13e59..2d72e26ea 100644 { this.compressionThreshold = compressionThreshold; 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 -index 89b98b360..0ac22ad38 100644 +index e01f65ace..c532d7f4c 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; @@ -1247,7 +1247,7 @@ index d72208e75..66332af4e 100644 } con.getServer().disconnect( "Quitting" ); diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index ad951df05..68916db79 100644 +index 28d2127f9..8fb6bf514 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -34,6 +34,12 @@ public abstract class EntityMap diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch index b77c30d6..64b404e4 100644 --- a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From 4121bc5ef2215f0621d449c5cf2073c47ed93947 Mon Sep 17 00:00:00 2001 +From bdf1f938031bb0a6cb5a991cc9e353a82246a246 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 68916db79..688ff72d2 100644 +index 8fb6bf514..2ea419186 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -155,11 +155,15 @@ public abstract class EntityMap +@@ -157,11 +157,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); diff --git a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch index 94640188..8cfe0767 100644 --- a/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch +++ b/Waterfall-Proxy-Patches/0024-Added-an-api-method-to-unload-Plugins.patch @@ -1,4 +1,4 @@ -From 664f35c5a6155c5e41aa10d1cd15cf590cc011a0 Mon Sep 17 00:00:00 2001 +From 82189db9bdfb79a0317466418be558ee8a8bdf83 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 13 May 2021 01:05:03 +0530 Subject: [PATCH] Added an api method to unload Plugins @@ -6,7 +6,7 @@ Subject: [PATCH] Added an api method to unload Plugins Format Code to Bungee's code style diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java -index 90031156f..a190dfae8 100644 +index 1ba5b2496..5db665c7c 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -25,6 +25,7 @@ import java.util.Set; @@ -17,7 +17,7 @@ index 90031156f..a190dfae8 100644 import java.util.logging.Level; import io.github.waterfallmc.waterfall.event.ProxyExceptionEvent; // Waterfall import io.github.waterfallmc.waterfall.exception.ProxyCommandException; // Waterfall -@@ -63,6 +64,7 @@ public final class PluginManager +@@ -64,6 +65,7 @@ public final class PluginManager private Map toLoad = new HashMap<>(); private final Multimap commandsByPlugin = ArrayListMultimap.create(); private final Multimap listenersByPlugin = ArrayListMultimap.create(); @@ -25,7 +25,7 @@ index 90031156f..a190dfae8 100644 @SuppressWarnings("unchecked") public PluginManager(ProxyServer proxy) -@@ -291,6 +293,45 @@ public final class PluginManager +@@ -292,6 +294,45 @@ public final class PluginManager return plugins.get( name ); } @@ -71,7 +71,7 @@ index 90031156f..a190dfae8 100644 public void loadPlugins() { Map pluginStatuses = new HashMap<>(); -@@ -395,6 +436,9 @@ public final class PluginManager +@@ -396,6 +437,9 @@ public final class PluginManager Plugin clazz = (Plugin) main.getDeclaredConstructor().newInstance(); plugins.put( plugin.getName(), clazz ); diff --git a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch index 17fe687b..e714bd4e 100644 --- a/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch +++ b/Waterfall-Proxy-Patches/0025-Apply-packet-limits.patch @@ -1,4 +1,4 @@ -From 2caae71d8c0bdc5a325610ef1c77775f9ba4ee69 Mon Sep 17 00:00:00 2001 +From 1bc16d636d3833dc1f8b8f2d1a88c9e87f40106b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:30:19 -0300 Subject: [PATCH] Apply packet limits @@ -51,19 +51,21 @@ index 7dbbfd3cd..b78420556 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -index 3224b0d2b..763d34c2f 100644 +index d0e37793d..763d34c2f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java -@@ -70,7 +70,8 @@ public class LoginRequest extends DefinedPacket +@@ -70,8 +70,9 @@ public class LoginRequest extends DefinedPacket public int expectedMaxLength(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { // Accommodate the rare (but likely malicious) use of UTF-8 usernames, since it is technically // legal on the protocol level. - if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return -1; +- return 1 + (16 * 3); + // FlameCord - Apply packet limits + if (protocolVersion >= ProtocolConstants.MINECRAFT_1_19) return 1 + (16 * 4) + 1024; - return 1 + (16 * 4); ++ return 1 + (16 * 4); } // Waterfall end + } -- 2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 4cf2a22f..37667709 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From f18ce5e7dc170f19e8bb57e74cafbd9bb90658ae Mon Sep 17 00:00:00 2001 +From 052471b9b8ba531f70ceef841127d88fe31d0abf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1605,10 +1605,10 @@ index 6316143f7..aa538f748 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c9e45b915..022f94b2d 100644 +index c433ac4ab..4ee05067a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java -@@ -723,4 +723,8 @@ public enum Protocol +@@ -751,4 +751,8 @@ public enum Protocol // Waterfall end } } @@ -1705,7 +1705,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 9ecdbd174..b55855196 100644 +index c5638b9df..e4fcdd9b4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index d80f3dbc..c511a28a 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,11 +1,11 @@ -From 1a4b10d4833f4c2c0f827ed75897f5187e6ec8ed Mon Sep 17 00:00:00 2001 +From f69fd8b81cc200a058053b02d59413975389b34a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index 469fe0e1..97bd384b 100644 +index 469fe0e12..97bd384b2 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java @@ -251,11 +251,6 @@ public interface ProxyConfig @@ -21,7 +21,7 @@ index 469fe0e1..97bd384b 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index 0c334afc..88865b85 100644 +index 0c334afcf..88865b851 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -49,7 +49,7 @@ index 0c334afc..88865b85 100644 - // Waterfall end } 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 -index 022f94b2..970011e8 100644 +index 4ee05067a..6063be023 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -61,9 +61,9 @@ index 022f94b2..970011e8 100644 import net.md_5.bungee.protocol.packet.Handshake; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.Kick; -@@ -140,20 +138,6 @@ public enum Protocol - map( ProtocolConstants.MINECRAFT_1_17, 0x0D ), - map( ProtocolConstants.MINECRAFT_1_19, 0x0A ) +@@ -144,20 +142,6 @@ public enum Protocol + map( ProtocolConstants.MINECRAFT_1_19, 0x0A ), + map( ProtocolConstants.MINECRAFT_1_19_4, 0xB ) ); - // Waterfall start - TO_CLIENT.registerPacket( @@ -84,7 +84,7 @@ index 022f94b2..970011e8 100644 PlayerListItem::new, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java deleted file mode 100644 -index 0ed78a8c..00000000 +index 0ed78a8c4..000000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ /dev/null @@ -1,67 +0,0 @@ @@ -157,7 +157,7 @@ index 0ed78a8c..00000000 -} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java deleted file mode 100644 -index 435b8578..00000000 +index 435b85789..000000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ /dev/null @@ -1,45 +0,0 @@ @@ -207,7 +207,7 @@ index 435b8578..00000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 966d2442..be337a68 100644 +index 966d2442b..be337a680 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { @@ -239,7 +239,7 @@ index 966d2442..be337a68 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a07c7c8..f51c668d 100644 +index 3a07c7c8a..f51c668d7 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler @@ -324,7 +324,7 @@ index 3a07c7c8..f51c668d 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 90922797..f3d60253 100644 +index 909227970..f3d60253f 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -365,7 +365,7 @@ index 90922797..f3d60253 100644 - // Waterfall end } 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 -index 0ac22ad3..6e425764 100644 +index c532d7f4c..5d7f92f81 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -433,7 +433,7 @@ index 0ac22ad3..6e425764 100644 public void handle(Respawn respawn) { 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 c16e28c8..5a7f3880 100644 +index c16e28c80..5a7f38800 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 @@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -458,10 +458,10 @@ index c16e28c8..5a7f3880 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index 688ff72d..00000000 +index 2ea419186..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null -@@ -1,372 +0,0 @@ +@@ -1,374 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -554,6 +554,8 @@ index 688ff72d..00000000 - case ProtocolConstants.MINECRAFT_1_19_1: - case ProtocolConstants.MINECRAFT_1_19_3: - return EntityMap_1_16_2.INSTANCE_1_19_1; +- case ProtocolConstants.MINECRAFT_1_19_4: +- return EntityMap_1_16_2.INSTANCE_1_19_4; - } - throw new RuntimeException( "Version " + version + " has no entity map" ); - } @@ -836,7 +838,7 @@ index 688ff72d..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java deleted file mode 100644 -index 6db530c3..00000000 +index 6db530c3a..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -1024,7 +1026,7 @@ index 6db530c3..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java deleted file mode 100644 -index 36822127..00000000 +index 368221275..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1213,7 +1215,7 @@ index 36822127..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java deleted file mode 100644 -index 38e12ce4..00000000 +index 38e12ce40..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1402,7 +1404,7 @@ index 38e12ce4..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java deleted file mode 100644 -index 5f296839..00000000 +index 5f2968394..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1591,7 +1593,7 @@ index 5f296839..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java deleted file mode 100644 -index f3372f08..00000000 +index f3372f088..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1780,7 +1782,7 @@ index f3372f08..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java deleted file mode 100644 -index 8210b0a7..00000000 +index 8210b0a7e..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -1973,7 +1975,7 @@ index 8210b0a7..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java deleted file mode 100644 -index c2cf810f..00000000 +index c2cf810f3..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2166,7 +2168,7 @@ index c2cf810f..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java deleted file mode 100644 -index c8b06707..00000000 +index c8b067071..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2359,10 +2361,10 @@ index c8b06707..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index 7241dc56..00000000 +index e5e784a01..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null -@@ -1,76 +0,0 @@ +@@ -1,77 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -2384,6 +2386,7 @@ index 7241dc56..00000000 - static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D ); - static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F ); - static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 ); +- static final EntityMap_1_16_2 INSTANCE_1_19_4 = new EntityMap_1_16_2( 0x03, 0x30 ); - // - private final int spawnPlayerId; - private final int spectateId; @@ -2441,7 +2444,7 @@ index 7241dc56..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java deleted file mode 100644 -index cdc07dc4..00000000 +index cdc07dc45..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +++ /dev/null @@ -1,102 +0,0 @@ @@ -2550,7 +2553,7 @@ index cdc07dc4..00000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java deleted file mode 100644 -index cb9174b3..00000000 +index cb9174b35..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ /dev/null @@ -1,62 +0,0 @@ @@ -2619,7 +2622,7 @@ index cb9174b3..00000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java deleted file mode 100644 -index 8e2dbe69..00000000 +index 8e2dbe699..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +++ /dev/null @@ -1,176 +0,0 @@ @@ -2801,7 +2804,7 @@ index 8e2dbe69..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java deleted file mode 100644 -index d61dc0cb..00000000 +index d61dc0cba..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -2989,7 +2992,7 @@ index d61dc0cb..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java deleted file mode 100644 -index bfbc8432..00000000 +index bfbc84327..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -3177,7 +3180,7 @@ index bfbc8432..00000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java deleted file mode 100644 -index cb81d1dd..00000000 +index cb81d1dd8..000000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +++ /dev/null @@ -1,30 +0,0 @@ @@ -3213,7 +3216,7 @@ index cb81d1dd..00000000 -// Waterfall end \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index caed4384..af428090 100644 +index caed43849..af4280904 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -11,7 +11,6 @@ import lombok.Setter; diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch index 5abacdb9..22c9edc2 100644 --- a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -1,4 +1,4 @@ -From daefdd3d718eecc9ac09fbece9e7baff22e1c195 Mon Sep 17 00:00:00 2001 +From 10b29c21ab86559a31b3229ddd2f9bf156c01c97 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:34 -0300 Subject: [PATCH] List Command Format @@ -19,19 +19,18 @@ index e42bb29d5..555319a7f 100644 final Object value = configuration.get(key); diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c22271105..0a5899319 100644 +index c4ac9173f..10a0cf4a8 100644 --- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -@@ -25,6 +25,9 @@ public class CommandList extends Command - @Override +@@ -28,6 +28,8 @@ public class CommandList extends Command implements TabExecutor public void execute(CommandSender sender, String[] args) { + boolean hideEmptyServers = ( args.length == 0 ) || !args[0].equalsIgnoreCase( "all" ); + // FlameCord - List Command Format + sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_list_format") ); -+ + for ( ServerInfo server : ProxyServer.getInstance().getServers().values() ) { - if ( !server.canAccess( sender ) ) -- 2.37.3.windows.1 From 0116328cc517666b85e171911a45fb7f73cbd4ce Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 14 Mar 2023 15:05:42 -0300 Subject: [PATCH 430/499] 1.3.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index c68e6809..2a79da42 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 2bb5da307d6b60ff46fd9135808c4f46df035484 Mon Sep 17 00:00:00 2001 +From 271df1e27f1ae8acb0c42335882134ca4096191b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..4568e9b0b 100644 +index 8617cdc7a..cb5928de2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7a..4568e9b0b 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.7"; ++ return "1.3.8"; } public final void reloadMessages() From ffaadc8e942f5ee35a1b9ef017d6e064a0887519 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:50:16 -0300 Subject: [PATCH 431/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0001-FlameCord-POM-Changes.patch | 31 +++++-- .../0003-FlameCord-rebrand.patch | 12 +-- .../0028-Antibot-System.patch | 89 +++++++++---------- ...0030-Disable-entity-Metadata-Rewrite.patch | 62 ++++++------- .../0040-Implement-libdeflate.patch | 54 +++++------ 6 files changed, 131 insertions(+), 119 deletions(-) diff --git a/Waterfall b/Waterfall index fe174361..cf69c8c9 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit fe17436165e6027194c23d96f2c11665d46b259b +Subproject commit cf69c8c94d4a0c6ffaea4aa6d7ad877f7ab7d1a9 diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index 2da0b2fa..5b6f4c3f 100644 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From 01758bf18170f703930757151d86c9440e8793da Mon Sep 17 00:00:00 2001 +From dd46a5fceccb1bc93c8456538a6e3cee9ec8ab28 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,10 +6,10 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..20edd900 +index 00000000..6cb405a8 --- /dev/null +++ b/flamecord/pom.xml -@@ -0,0 +1,44 @@ +@@ -0,0 +1,57 @@ + + 4.0.0 @@ -42,6 +42,19 @@ index 00000000..20edd900 + ${project.version} + compile + ++<<<<<<< Updated upstream ++======= ++ ++ com.maxmind.db ++ maxmind-db ++ 2.0.0 ++ ++ ++ io.netty ++ netty-handler ++ compile ++ ++>>>>>>> Stashed changes + + + @@ -55,7 +68,7 @@ index 00000000..20edd900 + + diff --git a/pom.xml b/pom.xml -index 2b544c23..d940b21c 100644 +index 7ff4a013..378c5f7d 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ @@ -67,10 +80,10 @@ index 2b544c23..d940b21c 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 93ae5952..d6222d16 100644 +index 221469b9..5bc0cefd 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml -@@ -64,5 +64,14 @@ +@@ -63,5 +63,14 @@ 1.3.0 compile @@ -86,10 +99,10 @@ index 93ae5952..d6222d16 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index 1036a2e7..10fe411d 100644 +index d3801c9b..02625018 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -157,6 +157,51 @@ +@@ -150,6 +150,51 @@ runtime @@ -142,5 +155,5 @@ index 1036a2e7..10fe411d 100644 -- -2.37.0.windows.1 +2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 2a79da42..148ea31f 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,14 +1,14 @@ -From 271df1e27f1ae8acb0c42335882134ca4096191b Mon Sep 17 00:00:00 2001 +From 2a17717d24e127c74fa1287494182a3c957b93ee Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36f..966d2442b 100644 +index 1b3287e6..e5662111 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { +@@ -69,7 +69,8 @@ public class WaterfallConfiguration extends Configuration { YamlConfig config = new YamlConfig(new File("waterfall.yml")); config.load(false); // Load, but no permissions logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7a..cb5928de2 100644 +index 8617cdc7..cb5928de 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -32,7 +32,7 @@ index 8617cdc7a..cb5928de2 100644 public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03c..aeda79639 100644 +index 820f7b03..aeda7963 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03c..aeda79639 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b2b199969 100644 +index 0c1ecfb8..b2b19996 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 37667709..e8f62393 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,33 +1,32 @@ -From 052471b9b8ba531f70ceef841127d88fe31d0abf Mon Sep 17 00:00:00 2001 +From b94c0c4c774f0bf58f026ebf32bb36d1579ba240 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..f48f1e60b 100644 +index 6cb405a8..95bdf348 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml -@@ -30,6 +30,17 @@ +@@ -30,8 +30,6 @@ ${project.version} compile -+ -+ com.maxmind.db -+ maxmind-db -+ 2.0.0 -+ -+ -+ io.netty -+ netty-handler -+ ${netty.version} -+ compile -+ +-<<<<<<< Updated upstream +-======= + + com.maxmind.db + maxmind-db +@@ -42,7 +40,6 @@ + netty-handler + compile + +->>>>>>> Stashed changes diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b9..3824cc533 100644 +index 676ba95b..3824cc53 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -188,7 +187,7 @@ index 676ba95b9..3824cc533 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 000000000..0295ea89d +index 00000000..0295ea89 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,48 @@ @@ -242,7 +241,7 @@ index 000000000..0295ea89d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..7aa157966 +index 00000000..7aa15796 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,170 @@ @@ -418,7 +417,7 @@ index 000000000..7aa157966 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..bd14f56a1 +index 00000000..bd14f56a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,48 @@ @@ -472,7 +471,7 @@ index 000000000..bd14f56a1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 000000000..1503ac954 +index 00000000..1503ac95 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java @@ -0,0 +1,40 @@ @@ -518,7 +517,7 @@ index 000000000..1503ac954 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 000000000..fdfd9c8d7 +index 00000000..fdfd9c8d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,148 @@ @@ -672,7 +671,7 @@ index 000000000..fdfd9c8d7 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 000000000..e21408873 +index 00000000..e2140887 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,39 @@ @@ -717,7 +716,7 @@ index 000000000..e21408873 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 000000000..df26a3634 +index 00000000..df26a363 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,28 @@ @@ -751,7 +750,7 @@ index 000000000..df26a3634 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 000000000..1b35fba5d +index 00000000..1b35fba5 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,52 @@ @@ -809,7 +808,7 @@ index 000000000..1b35fba5d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 000000000..a7bd9f153 +index 00000000..a7bd9f15 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java @@ -0,0 +1,69 @@ @@ -884,7 +883,7 @@ index 000000000..a7bd9f153 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 000000000..7189a7f37 +index 00000000..7189a7f3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java @@ -0,0 +1,115 @@ @@ -1005,7 +1004,7 @@ index 000000000..7189a7f37 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 000000000..68555de34 +index 00000000..68555de3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,69 @@ @@ -1080,7 +1079,7 @@ index 000000000..68555de34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..51c1866ec +index 00000000..51c1866e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,52 @@ @@ -1138,7 +1137,7 @@ index 000000000..51c1866ec +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 000000000..d38ffc9e3 +index 00000000..d38ffc9e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,53 @@ @@ -1197,7 +1196,7 @@ index 000000000..d38ffc9e3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 000000000..44d773abe +index 00000000..44d773ab --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java @@ -0,0 +1,75 @@ @@ -1277,7 +1276,7 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f6..0f12f4ae6 100644 +index 14665b1f..0f12f4ae 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,187 @@ import net.md_5.bungee.config.Configuration; @@ -1479,7 +1478,7 @@ index 14665b1f6..0f12f4ae6 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae1794385..6175d8e2d 100644 +index ae179438..6175d8e2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -80,6 +80,22 @@ public class MessagesConfiguration extends FlameConfig { @@ -1507,7 +1506,7 @@ index ae1794385..6175d8e2d 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 000000000..285810ea1 +index 00000000..285810ea --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ @@ -1518,7 +1517,7 @@ index 000000000..285810ea1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 -index 000000000..c19c4965d +index 00000000..c19c4965 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java @@ -0,0 +1,5 @@ @@ -1529,7 +1528,7 @@ index 000000000..c19c4965d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 000000000..7f26e7a0d +index 00000000..7f26e7a0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1562,7 +1561,7 @@ index 000000000..7f26e7a0d +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f7..aa538f748 100644 +index 6316143f..aa538f74 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1605,7 +1604,7 @@ index 6316143f7..aa538f748 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c433ac4ab..4ee05067a 100644 +index c433ac4a..4ee05067 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -751,4 +751,8 @@ public enum Protocol @@ -1618,7 +1617,7 @@ index c433ac4ab..4ee05067a 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d371426..403ccba98 100644 +index c0d37142..403ccba9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1635,7 +1634,7 @@ index c0d371426..403ccba98 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee0..173b47f33 100644 +index fb81adee..173b47f3 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1705,7 +1704,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c5638b9df..e4fcdd9b4 100644 +index e2e715db..7ff5540b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1721,7 +1720,7 @@ index c5638b9df..e4fcdd9b4 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 58be68b02..b88e64526 100644 +index d65884ae..29afa82c 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1845,7 +1844,7 @@ index 58be68b02..b88e64526 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4e..c16e28c80 100644 +index 66332af4..c16e28c8 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,11 +4,15 @@ import com.google.common.base.Preconditions; @@ -1888,7 +1887,7 @@ index 66332af4e..c16e28c80 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e4..d853b4044 100644 +index e2911d5e..d853b404 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,6 +8,8 @@ import io.netty.handler.codec.http.HttpResponse; @@ -1916,7 +1915,7 @@ index e2911d5e4..d853b4044 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b3fa48355..6f1d8336d 100644 +index b3fa4835..6f1d8336 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -154,4 +154,11 @@ public class ChannelWrapper @@ -1932,7 +1931,7 @@ index b3fa48355..6f1d8336d 100644 + // FlameCord end - Antibot System } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..b61ed5218 100644 +index 14e3004f..b61ed521 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,7 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -1959,7 +1958,7 @@ index 14e3004fc..b61ed5218 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea15992..f04fdd9ce 100644 +index ffea1599..f04fdd9c 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 @@ -59,6 +59,20 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index c511a28a..24ec4d61 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,11 +1,11 @@ -From f69fd8b81cc200a058053b02d59413975389b34a Mon Sep 17 00:00:00 2001 +From 828bb1d13c25fc9e7184bed56790e58a021f2222 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index 469fe0e12..97bd384b2 100644 +index e855cfb6..97176901 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java @@ -251,11 +251,6 @@ public interface ProxyConfig @@ -21,7 +21,7 @@ index 469fe0e12..97bd384b2 100644 * Whether tablist rewriting should be disabled or not * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise 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 -index 0c334afcf..88865b851 100644 +index 0c334afc..88865b85 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/AbstractPacketHandler.java @@ -10,8 +10,6 @@ import net.md_5.bungee.protocol.packet.ClientStatus; @@ -49,7 +49,7 @@ index 0c334afcf..88865b851 100644 - // Waterfall end } 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 -index 4ee05067a..6063be023 100644 +index 4ee05067..6063be02 100644 --- 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,8 +22,6 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest; @@ -84,7 +84,7 @@ index 4ee05067a..6063be023 100644 PlayerListItem::new, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java deleted file mode 100644 -index 0ed78a8c4..000000000 +index 0ed78a8c..00000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ /dev/null @@ -1,67 +0,0 @@ @@ -157,7 +157,7 @@ index 0ed78a8c4..000000000 -} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java deleted file mode 100644 -index 435b85789..000000000 +index 435b8578..00000000 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ /dev/null @@ -1,45 +0,0 @@ @@ -207,10 +207,10 @@ index 435b85789..000000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 966d2442b..be337a680 100644 +index e5662111..47d7d9d7 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -43,7 +43,6 @@ public class WaterfallConfiguration extends Configuration { private int tabThrottle = 1000; private boolean disableModernTabLimiter = true; @@ -218,7 +218,7 @@ index 966d2442b..be337a680 100644 private boolean disableTabListRewrite = true; /* -@@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -75,7 +74,6 @@ public class WaterfallConfiguration extends Configuration { // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter); @@ -226,7 +226,7 @@ index 966d2442b..be337a680 100644 disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite); pluginChannelLimit = config.getInt("registered_plugin_channels_limit", pluginChannelLimit); pluginChannelNameLimit = config.getInt("plugin_channel_name_limit", pluginChannelNameLimit); -@@ -105,11 +103,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -106,11 +104,6 @@ public class WaterfallConfiguration extends Configuration { return disableModernTabLimiter; } @@ -239,7 +239,7 @@ index 966d2442b..be337a680 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a07c7c8a..f51c668d7 100644 +index 3a07c7c8..f51c668d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler @@ -324,7 +324,7 @@ index 3a07c7c8a..f51c668d7 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 909227970..f3d60253f 100644 +index 90922797..f3d60253 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -365,7 +365,7 @@ index 909227970..f3d60253f 100644 - // Waterfall end } 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 -index c532d7f4c..5d7f92f81 100644 +index c532d7f4..5d7f92f8 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -46,7 +46,6 @@ import net.md_5.bungee.api.score.Score; @@ -433,7 +433,7 @@ index c532d7f4c..5d7f92f81 100644 public void handle(Respawn respawn) { 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 c16e28c80..5a7f38800 100644 +index c16e28c8..5a7f3880 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 @@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -458,7 +458,7 @@ index c16e28c80..5a7f38800 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index 2ea419186..000000000 +index 2ea41918..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null @@ -1,374 +0,0 @@ @@ -838,7 +838,7 @@ index 2ea419186..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java deleted file mode 100644 -index 6db530c3a..000000000 +index 6db530c3..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_10.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -1026,7 +1026,7 @@ index 6db530c3a..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java deleted file mode 100644 -index 368221275..000000000 +index 36822127..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_11.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1215,7 +1215,7 @@ index 368221275..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java deleted file mode 100644 -index 38e12ce40..000000000 +index 38e12ce4..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1404,7 +1404,7 @@ index 38e12ce40..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java deleted file mode 100644 -index 5f2968394..000000000 +index 5f296839..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_12_1.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1593,7 +1593,7 @@ index 5f2968394..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java deleted file mode 100644 -index f3372f088..000000000 +index f3372f08..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_13.java +++ /dev/null @@ -1,183 +0,0 @@ @@ -1782,7 +1782,7 @@ index f3372f088..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java deleted file mode 100644 -index 8210b0a7e..000000000 +index 8210b0a7..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -1975,7 +1975,7 @@ index 8210b0a7e..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java deleted file mode 100644 -index c2cf810f3..000000000 +index c2cf810f..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_15.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2168,7 +2168,7 @@ index c2cf810f3..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java deleted file mode 100644 -index c8b067071..000000000 +index c8b06707..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java +++ /dev/null @@ -1,187 +0,0 @@ @@ -2361,7 +2361,7 @@ index c8b067071..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java deleted file mode 100644 -index e5e784a01..000000000 +index e5e784a0..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16_2.java +++ /dev/null @@ -1,77 +0,0 @@ @@ -2444,7 +2444,7 @@ index e5e784a01..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java deleted file mode 100644 -index cdc07dc45..000000000 +index cdc07dc4..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +++ /dev/null @@ -1,102 +0,0 @@ @@ -2553,7 +2553,7 @@ index cdc07dc45..000000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java deleted file mode 100644 -index cb9174b35..000000000 +index cb9174b3..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java +++ /dev/null @@ -1,62 +0,0 @@ @@ -2622,7 +2622,7 @@ index cb9174b35..000000000 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java deleted file mode 100644 -index 8e2dbe699..000000000 +index 8e2dbe69..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_8.java +++ /dev/null @@ -1,176 +0,0 @@ @@ -2804,7 +2804,7 @@ index 8e2dbe699..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java deleted file mode 100644 -index d61dc0cba..000000000 +index d61dc0cb..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -2992,7 +2992,7 @@ index d61dc0cba..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java deleted file mode 100644 -index bfbc84327..000000000 +index bfbc8432..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_9_4.java +++ /dev/null @@ -1,182 +0,0 @@ @@ -3180,7 +3180,7 @@ index bfbc84327..000000000 -} diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java deleted file mode 100644 -index cb81d1dd8..000000000 +index cb81d1dd..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_Dummy.java +++ /dev/null @@ -1,30 +0,0 @@ @@ -3216,7 +3216,7 @@ index cb81d1dd8..000000000 -// Waterfall end \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index caed43849..af4280904 100644 +index caed4384..af428090 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -11,7 +11,6 @@ import lombok.Setter; diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 5619559b..356dfc73 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From c2ca35b27ef725cf2ce710726aee0ea1efb84723 Mon Sep 17 00:00:00 2001 +From 0f15af459b68ab1cb21f126380e32cf17d6939ef Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 6f463b9c6..6ec047ed7 100644 +index 6f463b9c..6ec047ed 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -29,7 +29,7 @@ index 6f463b9c6..6ec047ed7 100644 } diff --git a/native/compile-linux.sh b/native/compile-linux.sh new file mode 100644 -index 000000000..5442dce9d +index 00000000..5442dce9 --- /dev/null +++ b/native/compile-linux.sh @@ -0,0 +1,25 @@ @@ -61,7 +61,7 @@ index 000000000..5442dce9d \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c new file mode 100644 -index 000000000..aa7d1aba3 +index 00000000..aa7d1aba --- /dev/null +++ b/native/src/main/c/jni_cipher_macos.c @@ -0,0 +1,66 @@ @@ -134,7 +134,7 @@ index 000000000..aa7d1aba3 \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c new file mode 100644 -index 000000000..83515be52 +index 00000000..83515be5 --- /dev/null +++ b/native/src/main/c/jni_cipher_openssl.c @@ -0,0 +1,62 @@ @@ -203,7 +203,7 @@ index 000000000..83515be52 \ No newline at end of file diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c new file mode 100644 -index 000000000..1e2b6bd8c +index 00000000..1e2b6bd8 --- /dev/null +++ b/native/src/main/c/jni_util.c @@ -0,0 +1,12 @@ @@ -222,7 +222,7 @@ index 000000000..1e2b6bd8c \ No newline at end of file diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h new file mode 100644 -index 000000000..8938b26c8 +index 00000000..8938b26c --- /dev/null +++ b/native/src/main/c/jni_util.h @@ -0,0 +1,4 @@ @@ -233,7 +233,7 @@ index 000000000..8938b26c8 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c new file mode 100644 -index 000000000..809a7f857 +index 00000000..809a7f85 --- /dev/null +++ b/native/src/main/c/jni_zlib_deflate.c @@ -0,0 +1,43 @@ @@ -283,7 +283,7 @@ index 000000000..809a7f857 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c new file mode 100644 -index 000000000..d91319089 +index 00000000..d9131908 --- /dev/null +++ b/native/src/main/c/jni_zlib_inflate.c @@ -0,0 +1,61 @@ @@ -351,7 +351,7 @@ index 000000000..d91319089 \ No newline at end of file diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java new file mode 100644 -index 000000000..4ba41fc11 +index 00000000..4ba41fc1 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java @@ -0,0 +1,15 @@ @@ -372,7 +372,7 @@ index 000000000..4ba41fc11 +} diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java new file mode 100644 -index 000000000..81d92e75b +index 00000000..81d92e75 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java @@ -0,0 +1,17 @@ @@ -395,7 +395,7 @@ index 000000000..81d92e75b +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java new file mode 100644 -index 000000000..a16a25844 +index 00000000..a16a2584 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java @@ -0,0 +1,28 @@ @@ -430,7 +430,7 @@ index 000000000..a16a25844 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java new file mode 100644 -index 000000000..50f042bdf +index 00000000..50f042bd --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java @@ -0,0 +1,36 @@ @@ -473,7 +473,7 @@ index 000000000..50f042bdf \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java new file mode 100644 -index 000000000..a6709a869 +index 00000000..a6709a86 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java @@ -0,0 +1,138 @@ @@ -618,7 +618,7 @@ index 000000000..a6709a869 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java new file mode 100644 -index 000000000..f28ae3145 +index 00000000..f28ae314 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java @@ -0,0 +1,16 @@ @@ -641,7 +641,7 @@ index 000000000..f28ae3145 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java new file mode 100644 -index 000000000..3aed690ad +index 00000000..3aed690a --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java @@ -0,0 +1,13 @@ @@ -661,7 +661,7 @@ index 000000000..3aed690ad \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java new file mode 100644 -index 000000000..7d99eb02b +index 00000000..7d99eb02 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java @@ -0,0 +1,90 @@ @@ -757,7 +757,7 @@ index 000000000..7d99eb02b +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java new file mode 100644 -index 000000000..fd9f9007d +index 00000000..fd9f9007 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java @@ -0,0 +1,83 @@ @@ -2215,7 +2215,7 @@ zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh 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 -index f33ce913a..01b208ed2 100644 +index f33ce913..01b208ed 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -30,6 +30,22 @@ public abstract class DefinedPacket @@ -2255,10 +2255,10 @@ index f33ce913a..01b208ed2 100644 { int low = buf.readUnsignedShort(); diff --git a/proxy/pom.xml b/proxy/pom.xml -index 10fe411d8..f6daaea4d 100644 +index 02625018..37abc9f7 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -165,6 +165,12 @@ +@@ -158,6 +158,12 @@ ${project.version} compile @@ -2272,7 +2272,7 @@ index 10fe411d8..f6daaea4d 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index f5059666e..dba21bcc7 100644 +index 77149dfb..252ae3b0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2309,7 +2309,7 @@ index f5059666e..dba21bcc7 100644 /** diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf4627..10cb0430c 100644 +index d07cf462..10cb0430 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java @@ -1,45 +1,74 @@ @@ -2411,7 +2411,7 @@ index d07cf4627..10cb0430c 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -index eaedf4bc4..066bdafc8 100644 +index eaedf4bc..066bdafc 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java @@ -1,5 +1,6 @@ @@ -2537,7 +2537,7 @@ index eaedf4bc4..066bdafc8 100644 +} \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab8..95ed34416 100644 +index 8d4439ab..95ed3441 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -44,8 +44,8 @@ public class ForgeUtils @@ -2552,7 +2552,7 @@ index 8d4439ab8..95ed34416 100644 modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a75..ffe038168 100644 +index b98ee6a7..ffe03816 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2605,7 +2605,7 @@ index b98ee6a75..ffe038168 100644 // Make the channel accessible public Channel getChannel() { 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 f04fdd9ce..9aebc9e1a 100644 +index f04fdd9c..9aebc9e1 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 @@ -126,7 +126,8 @@ public class PipelineUtils From 6c8e00ab52a10c40e915c4074f03ebb9357b95c4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:58:34 -0300 Subject: [PATCH 432/499] Fix patches --- .../0001-FlameCord-POM-Changes.patch | 19 +++----------- .../0028-Antibot-System.patch | 26 +++++++++---------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index 5b6f4c3f..60a676c0 100644 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From dd46a5fceccb1bc93c8456538a6e3cee9ec8ab28 Mon Sep 17 00:00:00 2001 +From f549424aed518d36fb5d4b9ba3a6f42ca6559ba6 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -6,10 +6,10 @@ Subject: [PATCH] FlameCord POM Changes diff --git a/flamecord/pom.xml b/flamecord/pom.xml new file mode 100644 -index 00000000..6cb405a8 +index 00000000..20edd900 --- /dev/null +++ b/flamecord/pom.xml -@@ -0,0 +1,57 @@ +@@ -0,0 +1,44 @@ + + 4.0.0 @@ -42,19 +42,6 @@ index 00000000..6cb405a8 + ${project.version} + compile + -+<<<<<<< Updated upstream -+======= -+ -+ com.maxmind.db -+ maxmind-db -+ 2.0.0 -+ -+ -+ io.netty -+ netty-handler -+ compile -+ -+>>>>>>> Stashed changes + + + diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index e8f62393..b9ae0a1f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,27 +1,27 @@ -From b94c0c4c774f0bf58f026ebf32bb36d1579ba240 Mon Sep 17 00:00:00 2001 +From e5469d2ebf0b560f5faa4f8c94a743bd3e12264e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 6cb405a8..95bdf348 100644 +index 20edd900..95bdf348 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml -@@ -30,8 +30,6 @@ +@@ -30,6 +30,16 @@ ${project.version} compile --<<<<<<< Updated upstream --======= - - com.maxmind.db - maxmind-db -@@ -42,7 +40,6 @@ - netty-handler - compile - -->>>>>>> Stashed changes ++ ++ com.maxmind.db ++ maxmind-db ++ 2.0.0 ++ ++ ++ io.netty ++ netty-handler ++ compile ++ From ced5bb2926efffa5b5ce838e5c46e73443c00be1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:07:27 -0300 Subject: [PATCH 433/499] Don't load country db if countries is disabled --- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index b9ae0a1f..184c2e4f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From e5469d2ebf0b560f5faa4f8c94a743bd3e12264e Mon Sep 17 00:00:00 2001 +From 90fb897bb17b0b3b1baa1809759a7f9a0e2976ef Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -517,10 +517,10 @@ index 00000000..1503ac95 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 00000000..fdfd9c8d +index 00000000..9f65a2b3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java -@@ -0,0 +1,148 @@ +@@ -0,0 +1,150 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.File; @@ -560,6 +560,8 @@ index 00000000..fdfd9c8d + } + + public void load() { ++ if (!config.isAntibotCountryEnabled()) return; ++ + final File file = new File("GeoLite2-Country.mmdb"); + + try { From d581f6a1d111c175b1bfc2fdaa42774d40066740 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:08:19 -0300 Subject: [PATCH 434/499] 1.3.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 148ea31f..69f308c5 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 8617cdc7..cb5928de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.8"; ++ return "1.3.9"; } public final void reloadMessages() From 5eb039fd361d8b6de6a95a4136a1cdfd7c86fe96 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:37:51 -0300 Subject: [PATCH 435/499] Update and Upgrade backlinks --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 37d53656..d8a9cb6e 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,17 @@ - + -FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 +FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 ## ⭐ Features FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: -* **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. +* **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in Waterfall. * **Antibot Features**: FlameCord brings swift bot protection for your Minecraft server to avoid extra CPU usage and crashes in your machines. @@ -34,7 +34,7 @@ Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. - + ## 🤝 Contributing From 479e62133c1cb46c71a418537adc3e4383204ca0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:38:39 -0300 Subject: [PATCH 436/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8a9cb6e..80bdf311 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ -FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 +FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft or Spigot server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 ## ⭐ Features From 24f414cd8935255c4031dc92d50aaeb34a65dcaa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:54:42 -0300 Subject: [PATCH 437/499] Remove cause from fallback kick --- ...042-Remove-cause-from-fallback-kicks.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0042-Remove-cause-from-fallback-kicks.patch diff --git a/Waterfall-Proxy-Patches/0042-Remove-cause-from-fallback-kicks.patch b/Waterfall-Proxy-Patches/0042-Remove-cause-from-fallback-kicks.patch new file mode 100644 index 00000000..77001967 --- /dev/null +++ b/Waterfall-Proxy-Patches/0042-Remove-cause-from-fallback-kicks.patch @@ -0,0 +1,22 @@ +From 42615e592b18cd0212c9d99d2856dea252fe3f1a Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Tue, 21 Mar 2023 20:53:32 -0300 +Subject: [PATCH] Remove cause from fallback kicks + + +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 4e3982d2..e941ce8b 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -389,8 +389,6 @@ public final class UserConnection implements ProxiedPlayer + } else + { + sendMessage( bungee.getTranslation( "fallback_kick", future.cause().getClass().getName() ) ); +- +- sendMessage( "§cCause: " + future.cause().getMessage() + " | " + future.cause().toString() ); + } + } + } +-- +2.37.3.windows.1 + From 9bb5e1af174058fe6cfaf407abb2e33e9625826e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 22 Mar 2023 09:12:16 -0300 Subject: [PATCH 438/499] 1.4.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 69f308c5..c88dc48c 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 2a17717d24e127c74fa1287494182a3c957b93ee Mon Sep 17 00:00:00 2001 +From b5b0a8e7f63aee72560a251063726e1c8a235e43 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index 1b3287e6..e5662111 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..cb5928de 100644 +index 8617cdc7..cd02ab6a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..cb5928de 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.3.9"; ++ return "1.4.0"; } public final void reloadMessages() From 3a53e525cddf59d6c79043ff7b3d9ed4016ba5fe Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:37:04 -0300 Subject: [PATCH 439/499] Optimize AntiBot GetAddress --- .../0028-Antibot-System.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 184c2e4f..633d86ed 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 90fb897bb17b0b3b1baa1809759a7f9a0e2976ef Mon Sep 17 00:00:00 2001 +From f3f2e3d8f146ae949b0e803c996520825fe8a8e1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -417,10 +417,10 @@ index 00000000..7aa15796 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 00000000..bd14f56a +index 00000000..007be392 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java -@@ -0,0 +1,48 @@ +@@ -0,0 +1,50 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.InetSocketAddress; @@ -433,11 +433,13 @@ index 00000000..bd14f56a + + public String sanitizeAddress(String text) { + // Remove the port -+ text = text.split(":")[0]; ++ int indexOfPort = text.indexOf(":"); ++ if (indexOfPort != -1) { ++ text = text.substring(0, indexOfPort); ++ } + -+ // Check if first character is a slash ++ // Remove the slash at the start + if (text.startsWith("/")) { -+ // Remove the first character + text = text.substring(1); + } + @@ -1706,7 +1708,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e2e715db..7ff5540b 100644 +index fa520992..2fc20af6 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer From 5f48c85d6f782ca11a3e0f8de4601cc2e0979a1e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:37:13 -0300 Subject: [PATCH 440/499] Optimize Channel Initialization --- .../0043-Optimize-PipelineUtils.patch | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch diff --git a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch new file mode 100644 index 00000000..28e94b1d --- /dev/null +++ b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch @@ -0,0 +1,83 @@ +From 18f49182ce45a066df5a3cf10fb9cfc7d1c23eb3 Mon Sep 17 00:00:00 2001 +From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> +Date: Thu, 23 Mar 2023 22:35:42 -0300 +Subject: [PATCH] Optimize PipelineUtils + + +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 9aebc9e1..3bd25647 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 +@@ -6,10 +6,12 @@ import dev._2lstudios.flamecord.FlameCord; + import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; + import io.netty.buffer.PooledByteBufAllocator; + import io.netty.channel.Channel; ++import io.netty.channel.ChannelConfig; + import io.netty.channel.ChannelException; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInitializer; + import io.netty.channel.ChannelOption; ++import io.netty.channel.ChannelPipeline; + import io.netty.channel.EventLoopGroup; + import io.netty.channel.ServerChannel; + import io.netty.channel.WriteBufferWaterMark; +@@ -50,7 +52,6 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; + + public class PipelineUtils + { +- + public static final AttributeKey LISTENER = AttributeKey.newInstance( "ListerInfo" ); + public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() + { +@@ -195,31 +196,39 @@ public class PipelineUtils + private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb + private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK ); + ++ // FlameCord start - Optimize PipelineUtils ++ private static ReadTimeoutHandler READ_TIMEOUT_HANDLER = null; ++ private static final Varint21FrameDecoder VARINT21_FRAME_DECODER = new Varint21FrameDecoder(); ++ + public static final class Base extends ChannelInitializer + { + + @Override + public void initChannel(Channel ch) throws Exception + { ++ ChannelPipeline pipeline = ch.pipeline(); ++ ChannelConfig channelConfig = ch.config(); + try + { +- ch.config().setOption( ChannelOption.IP_TOS, 0x18 ); ++ channelConfig.setOption( ChannelOption.IP_TOS, 0x18 ); + } catch ( ChannelException ex ) + { + // IP_TOS is not supported (Windows XP / Windows Server 2003) + } +- ch.config().setOption( ChannelOption.TCP_NODELAY, true ); ++ channelConfig.setOption( ChannelOption.TCP_NODELAY, true ); + // FlameCord - TCP Fast Open +- ch.config().setOption( ChannelOption.TCP_FASTOPEN, FlameCord.getInstance().getFlameCordConfiguration().getTcpFastOpen() ); +- ch.config().setAllocator( PooledByteBufAllocator.DEFAULT ); +- ch.config().setWriteBufferWaterMark( MARK ); ++ channelConfig.setOption( ChannelOption.TCP_FASTOPEN, FlameCord.getInstance().getFlameCordConfiguration().getTcpFastOpen() ); ++ channelConfig.setAllocator( PooledByteBufAllocator.DEFAULT ); ++ channelConfig.setWriteBufferWaterMark( MARK ); + +- ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); +- ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); +- ch.pipeline().addLast( FRAME_PREPENDER, framePrepender ); ++ pipeline.addLast( FRAME_DECODER, VARINT21_FRAME_DECODER ); ++ if (READ_TIMEOUT_HANDLER == null) READ_TIMEOUT_HANDLER = new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ); ++ pipeline.addLast( TIMEOUT_HANDLER, READ_TIMEOUT_HANDLER ); ++ pipeline.addLast( FRAME_PREPENDER, framePrepender ); + +- ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); ++ pipeline.addLast( BOSS_HANDLER, new HandlerBoss() ); + } ++ // FlameCord end - Optimize PipelineUtils + + // FlameCord - Close on exception caught + @Override +-- +2.37.3.windows.1 + From e8bd6009f1b62f8ace4333f94673d3fce29b3aaf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:51:01 -0300 Subject: [PATCH 441/499] Fix sharing handlers --- .../0043-Optimize-PipelineUtils.patch | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch index 28e94b1d..f6a8af44 100644 --- a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch +++ b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch @@ -1,11 +1,11 @@ -From 18f49182ce45a066df5a3cf10fb9cfc7d1c23eb3 Mon Sep 17 00:00:00 2001 +From f33e0d4b04817d111c1cd4b76b95c86193146299 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:35:42 -0300 Subject: [PATCH] Optimize PipelineUtils 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 9aebc9e1..3bd25647 100644 +index 9aebc9e1..8580344d 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 @@ -6,10 +6,12 @@ import dev._2lstudios.flamecord.FlameCord; @@ -29,14 +29,11 @@ index 9aebc9e1..3bd25647 100644 public static final AttributeKey LISTENER = AttributeKey.newInstance( "ListerInfo" ); public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() { -@@ -195,31 +196,39 @@ public class PipelineUtils +@@ -195,31 +196,35 @@ public class PipelineUtils private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK ); + // FlameCord start - Optimize PipelineUtils -+ private static ReadTimeoutHandler READ_TIMEOUT_HANDLER = null; -+ private static final Varint21FrameDecoder VARINT21_FRAME_DECODER = new Varint21FrameDecoder(); -+ public static final class Base extends ChannelInitializer { @@ -66,9 +63,8 @@ index 9aebc9e1..3bd25647 100644 - ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); - ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); - ch.pipeline().addLast( FRAME_PREPENDER, framePrepender ); -+ pipeline.addLast( FRAME_DECODER, VARINT21_FRAME_DECODER ); -+ if (READ_TIMEOUT_HANDLER == null) READ_TIMEOUT_HANDLER = new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ); -+ pipeline.addLast( TIMEOUT_HANDLER, READ_TIMEOUT_HANDLER ); ++ pipeline.addLast( FRAME_DECODER, new Varint21FrameDecoder() ); ++ pipeline.addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); + pipeline.addLast( FRAME_PREPENDER, framePrepender ); - ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); From 07763973590328653695c06518b133dbfbdba4c9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 24 Mar 2023 10:10:45 -0300 Subject: [PATCH 442/499] 1.4.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index c88dc48c..b1a04007 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From b5b0a8e7f63aee72560a251063726e1c8a235e43 Mon Sep 17 00:00:00 2001 +From 014be7c18f3e1b2488497be0fcdf541c1edd3fed Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index 1b3287e6..e5662111 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..cd02ab6a 100644 +index 8617cdc7..1b60f615 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 8617cdc7..cd02ab6a 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.0"; ++ return "1.4.1"; } public final void reloadMessages() From 8d413a58d645cf41a2e885755714731f140ce3a5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:33:18 -0300 Subject: [PATCH 443/499] Dont send empty messages --- ...0020-FlameCord-message-configuration.patch | 24 ++++++++++++++----- ...0030-Disable-entity-Metadata-Rewrite.patch | 6 ++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 9d030c6c..e2b30aa7 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -1,11 +1,11 @@ -From 168e63822c7f19251ff48a96fb341b230d662143 Mon Sep 17 00:00:00 2001 +From 1bcd1ea1d1480107e8e63b28761d3be67ab4467b Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 13:40:39 -0300 Subject: [PATCH] FlameCord message configuration diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index fb3d8ca2e..676ba95b9 100644 +index fb3d8ca2..676ba95b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -35,7 +35,7 @@ index fb3d8ca2e..676ba95b9 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java new file mode 100644 -index 000000000..ae1794385 +index 00000000..ae179438 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -0,0 +1,102 @@ @@ -143,7 +143,7 @@ index 000000000..ae1794385 +} \ No newline at end of file diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java -index 698b420f4..e4ad7e389 100644 +index 698b420f..e4ad7e38 100644 --- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java @@ -50,7 +50,9 @@ public class CommandServer extends Command implements TabExecutor @@ -158,7 +158,7 @@ index 698b420f4..e4ad7e389 100644 serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); serverList.append( serverTextComponent ); diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index 021b38d43..fb81adee0 100644 +index 021b38d4..fb81adee 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -205,7 +205,7 @@ index 021b38d43..fb81adee0 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d58227fd9..8994454c7 100644 +index 7c4da8c4..0c53eba3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -620,8 +620,8 @@ public class BungeeCord extends ProxyServer @@ -219,6 +219,18 @@ index d58227fd9..8994454c7 100644 } @Override +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 e48f7713..0c4a0def 100644 +--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java ++++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java +@@ -461,6 +461,7 @@ public final class UserConnection implements ProxiedPlayer + @Override + public void sendMessage(String message) + { ++ if (!message.equals("")) // FlameCord - FlameCord message configuration + sendMessage( TextComponent.fromLegacyText( message ) ); + } + -- 2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index 24ec4d61..0532b6dc 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From 828bb1d13c25fc9e7184bed56790e58a021f2222 Mon Sep 17 00:00:00 2001 +From 54416b5037fd35a10bf3763fa55a9cfd4f8da531 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -324,7 +324,7 @@ index 3a07c7c8..f51c668d 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 90922797..f3d60253 100644 +index b5e20ea1..18a29ae3 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -353,7 +353,7 @@ index 90922797..f3d60253 100644 this.displayName = name; tabListHandler = new ServerUnique( this ); -@@ -794,10 +789,4 @@ public final class UserConnection implements ProxiedPlayer +@@ -795,10 +790,4 @@ public final class UserConnection implements ProxiedPlayer { return serverSentScoreboard; } From 7f60e3748ea8fd512270c620a9a92f16924d2dc3 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 27 Mar 2023 20:33:42 -0300 Subject: [PATCH 444/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0003-FlameCord-rebrand.patch | 8 +- ...ections-Don-t-flush-if-not-necessary.patch | 14 +- .../0027-TCP-Fast-Open.patch | 8 +- .../0028-Antibot-System.patch | 10 +- ...0030-Disable-entity-Metadata-Rewrite.patch | 14 +- .../0038-List-Command-Format.patch | 8 +- .../0040-Implement-libdeflate.patch | 171 +----------------- .../0043-Optimize-PipelineUtils.patch | 25 +-- 9 files changed, 50 insertions(+), 210 deletions(-) diff --git a/Waterfall b/Waterfall index cf69c8c9..0dc74bb2 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit cf69c8c94d4a0c6ffaea4aa6d7ad877f7ab7d1a9 +Subproject commit 0dc74bb24213c9e08dc78d9f3c53089b3b52118b diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index b1a04007..fe24161f 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,14 +1,14 @@ -From 014be7c18f3e1b2488497be0fcdf541c1edd3fed Mon Sep 17 00:00:00 2001 +From a2b921fb0525f5af3562057eeec84c4b0c46ae37 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index 1b3287e6..e5662111 100644 +index da0efa36..966d2442 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -69,7 +69,8 @@ public class WaterfallConfiguration extends Configuration { +@@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { YamlConfig config = new YamlConfig(new File("waterfall.yml")); config.load(false); // Load, but no permissions logInitialHandlerConnections = config.getBoolean( "log_initial_handler_connections", logInitialHandlerConnections ); @@ -19,7 +19,7 @@ index 1b3287e6..e5662111 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8617cdc7..1b60f615 100644 +index 821904f3..49adbde0 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 1922c3a8..7209e8a1 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,11 +1,11 @@ -From 9c6dd2dc6ee18d5429d098b5a5d1963cfd404856 Mon Sep 17 00:00:00 2001 +From 3fcd08a5340657c1144a5d9a2c919c2297937589 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 c3543a18..8ed26e5c 100644 +index 965a419f..99e2dafa 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 @@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -86,7 +86,7 @@ index 6dc5633f..8b0fac0a 100644 } 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 2a21243b..a95193ba 100644 +index af65e192..993b55b0 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 @@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; @@ -97,7 +97,7 @@ index 2a21243b..a95193ba 100644 import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; -@@ -98,6 +99,14 @@ public class PipelineUtils +@@ -101,6 +102,14 @@ public class PipelineUtils BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); } @@ -110,9 +110,9 @@ index 2a21243b..a95193ba 100644 + ctx.close(); + } }; - public static final Base BASE = new Base(); - private static final KickStringWriter legacyKicker = new KickStringWriter(); -@@ -192,5 +201,13 @@ public class PipelineUtils + public static final Base BASE = new Base( false ); + public static final Base BASE_SERVERSIDE = new Base( true ); +@@ -203,5 +212,13 @@ public class PipelineUtils ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 5e56fbf5..64f1136e 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,11 +1,11 @@ -From 62bf8051431b5035171c900d729a1c175fcda639 Mon Sep 17 00:00:00 2001 +From 7967c49c7a8e56c79de7d520f9ae03f2ed53af1e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b41ee92cc..14665b1f6 100644 +index b41ee92c..14665b1f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -29,10 +29,10 @@ index b41ee92cc..14665b1f6 100644 } } 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 a4c3bd710..ffea15992 100644 +index d9e360a1..156ea2aa 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 -@@ -194,6 +194,8 @@ public class PipelineUtils +@@ -203,6 +203,8 @@ public class PipelineUtils // IP_TOS is not supported (Windows XP / Windows Server 2003) } ch.config().setOption( ChannelOption.TCP_NODELAY, true ); diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 633d86ed..080fc1a0 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From f3f2e3d8f146ae949b0e803c996520825fe8a8e1 Mon Sep 17 00:00:00 2001 +From 87645acfa86b4bd64b98b3a6aef7e9727fb1f24c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1621,7 +1621,7 @@ index c433ac4a..4ee05067 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index c0d37142..403ccba9 100644 +index 3a802ca4..c23e6856 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1708,7 +1708,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index fa520992..2fc20af6 100644 +index c0a50444..08aa4318 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1962,10 +1962,10 @@ index 14e3004f..b61ed521 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 ffea1599..f04fdd9c 100644 +index 156ea2aa..3a025312 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 -@@ -59,6 +59,20 @@ public class PipelineUtils +@@ -62,6 +62,20 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index 0532b6dc..c294fd87 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,11 +1,11 @@ -From 54416b5037fd35a10bf3763fa55a9cfd4f8da531 Mon Sep 17 00:00:00 2001 +From bc07ea7e84cdbce71415ceef9fa817a6211adb3d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java -index e855cfb6..97176901 100644 +index 469fe0e1..97bd384b 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java @@ -251,11 +251,6 @@ public interface ProxyConfig @@ -207,10 +207,10 @@ index 435b8578..00000000 - } -} diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index e5662111..47d7d9d7 100644 +index 966d2442..be337a68 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -@@ -43,7 +43,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -42,7 +42,6 @@ public class WaterfallConfiguration extends Configuration { private int tabThrottle = 1000; private boolean disableModernTabLimiter = true; @@ -218,7 +218,7 @@ index e5662111..47d7d9d7 100644 private boolean disableTabListRewrite = true; /* -@@ -75,7 +74,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -74,7 +73,6 @@ public class WaterfallConfiguration extends Configuration { // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter); @@ -226,7 +226,7 @@ index e5662111..47d7d9d7 100644 disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite); pluginChannelLimit = config.getInt("registered_plugin_channels_limit", pluginChannelLimit); pluginChannelNameLimit = config.getInt("plugin_channel_name_limit", pluginChannelNameLimit); -@@ -106,11 +104,6 @@ public class WaterfallConfiguration extends Configuration { +@@ -105,11 +103,6 @@ public class WaterfallConfiguration extends Configuration { return disableModernTabLimiter; } @@ -324,7 +324,7 @@ index 3a07c7c8..f51c668d 100644 // Waterfall end user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); 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 b5e20ea1..18a29ae3 100644 +index c006277f..8114095e 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch index 22c9edc2..b4d4ca0b 100644 --- a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -1,11 +1,11 @@ -From 10b29c21ab86559a31b3229ddd2f9bf156c01c97 Mon Sep 17 00:00:00 2001 +From 4bdecd3bce63e87e3c1388cf7bf9c67a9fa2c6d0 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:34 -0300 Subject: [PATCH] List Command Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index e42bb29d5..555319a7f 100644 +index e42bb29d..555319a7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -107,6 +107,9 @@ public class MessagesConfiguration extends FlameConfig { @@ -19,10 +19,10 @@ index e42bb29d5..555319a7f 100644 final Object value = configuration.get(key); diff --git a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -index c4ac9173f..10a0cf4a8 100644 +index 79d0bb21..97b775ee 100644 --- a/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java +++ b/module/cmd-list/src/main/java/net/md_5/bungee/module/cmd/list/CommandList.java -@@ -28,6 +28,8 @@ public class CommandList extends Command implements TabExecutor +@@ -27,6 +27,8 @@ public class CommandList extends Command implements TabExecutor public void execute(CommandSender sender, String[] args) { boolean hideEmptyServers = ( args.length == 0 ) || !args[0].equalsIgnoreCase( "all" ); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 356dfc73..69bbcad9 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,4 +1,4 @@ -From 0f15af459b68ab1cb21f126380e32cf17d6939ef Mon Sep 17 00:00:00 2001 +From 482102b6fca099a58b23ed16997e4d8f0b063da3 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate @@ -2060,160 +2060,6 @@ mvE7bo|3AFL=DqtkrJea2sXUJADZOi#9b>NzDWkm|OHp0wH4w7_34-tboV_ -zfhGflCajj0e$|dGpVvP02FJEk5yGQ9u6h~4qM*R|Xqf=k^ebM`(w@8a*=vWx$o{@L -z|FeH<@3r6O?6YUzPffkAn|iH@IZO`@Axz!XS2)c%UlmcQjN%Gn3pd&L1%pk$4r_h6 -zh}ZW$pI+}FTZCRu5L~L!_Xsqp8-!imAr(x@q(q`NqP87St(>wwEYkQRbPBI1hAB{B -za?7j+hg(f^rmYL*#;Z4H#_s)B)b@>?pS}Crx~V65o<#id=0@Q!8h;kWHrw|M>$Evs -zozJ)--aIWc3vn*~CgP8WeEb#QuMmGz;34zO=v|wFdme*FUWPs9lIZc#zm78xu519O -zDIJE)CCV1aiYitfhyTFqe!Ndp{-j@f^y?aag-}!p^skMAWJ{x$`^G?>%YI{KEQ!Ul -zl6iv12w|Nj!QB-CJk6Vc!Ae{$5%GmW*edKL?uU^d-Ygz|N4&pL#J#mb8SfvSp)*ea -z+5T#(kj)|Z86nI~oH+&fRh-aQP`IBU?=TE=F&z(nD!7+;slZjHc;=ukl?Bh1HN9J;JWCly -zQHwij1Q>_uc-ThiZPc=Mf!P;SA@_6vCSaV0sl+?@ka_VZ$80Vcf;5)Pqj+-0PRR;U -ziytFLVOemINOz4Y#E9#27EM-RX2;1tn_ -z;|=_VfhQPvG!@KyO;!r}yP~}5y&}~}lr%#In}JhT>(+b&r?J<0iGfq+=)BUvX;SLk -zA-I?Ef-O1{7ndQ!WCM2_c)o$pH*ns2GI$I;OG4Ck16TDqPsR>|fmcd~H3lx%CAW1N -zc(zQ8+HK%+*txmaz++{4J_mkcFpQH1RKJ1CY0b?q8n|3foc9|zJpnmp`wTo&C*m@I -zT%UuywK)dE2}6cS1|BqUTo%LOeFGmqOc@Iq_!t8Z-{NH~*+%*Z7=6!Es|HF(m`UZXLbK_ixE?ba4w}9u#{PAKgtE);d|F(c>;tG>8Hn1u` -zOEJYcR!egRrac3DZZHVf19L;(?yY&nOo_onlu~z%^y3k^~=2X-dz(rfGw}{I{k# -zeaEgIa2~j*Y1-A_hqIvJu0ACJF5cx)UWS=P0n^u?!1bazN+HZDeny!D$BGXq?Xacf -z)2zpFJbdR5@)hjr8NCc+uAYjeToP(eln#W?z}C{dQ7?sf5d*Fs%O-fObixQ5CI~Nr -zOQnmmpTik5?7*@eW9VQn7vbRR5VVz*#yp80&=AUj=gKli+>Q3|dN@?pnlXSg8cY5i -zmxOPfz%*C!7E8{7>hcQZCFm&6Oq+X2(|qR}e1B{3X|Ch7xs|-@!pmS!d1-VVE?!qp -zCW8y*4=UYIG1Xo9F!sZifz_X2mABRA#^G(MtEcANSjK977!UvWf~M7S%K;lU9DNEL -zgg2(nu#LgYqOD({=X&Mn;NF{>)*HSLGhyxafVJY$Ag?aW0)6`5@S)M+&Ay*Ag!`!~}u82-?!yER}=>NsG -zVyAS$|JlE-L_vM!x)FEd(>uHxPF7YGoKNM}l=o1?$S2eWv1z540t=dPUeg*Ee}*6l -zCRgPsMKHH2XVOp4@fIg+Nx;dA^I(Bq&5C5K_?*SLFW%Qv`xveYOB?L2%2UR}!K(bR -zmiMtEo1D!&*RHQMt-<%PK7wC{e*>oKdrUXphkL8Dt5)Me#>%WjF;*soajeW)bkex^ -zQ`ffDxwhB%X2IqAywP_VYw#gFU!9>Gg8kLDJR7F+9p(k~;5!G6r!aSeaszw45`S(L -z(Kt}1=P571r0MmsefUuE-JhEuJ_75eS2SLDkGE-mF5kH7QzHB(5`BgYUb-O%xb7^D -zYSfo9TFIkdePfVU!p-U96r3e9HZHvflQiHwQyYDM8ch3_riFt@L`C1wSDd94Ya%L| -zjurLrieAG^tO?|DtrI#4@MySckJG|i8yqP~h6LcPi32Q)1mN5+9#f*Lxc -zX?&z?hc)eos2_!+BMFPVL4`elXaZH1i1GIqFzTWIjLz=qVPTX -zwx+E|?MLlJEjg`eAyfzIb<_b=w*~EIuprbR_VW$YAsozF+)@N_vh<>M;w-$5>cOSr -zz;~wlS550j^`O2r5?_=-ya^%bz&FHA)FD(AcUzvTnwF2+i#h}TIDe8-0w2wvWDR3a -zsn{_x@K@nN{DmN^DJ^CG>zXF_8?{Kg@pnHoHq}*ph?a>MW8aEbzi(O?kFNFC=rzOdg$C3p?B!@U*)+Fc{y|NnZxVga+m4pa$jT`-ug!X7{orgKld>Nz?PS5{0o#L? -zbXe9rR+#}?nl~xY5VPPu<+sqYpg3kK+E3tUyo)ir>E=;5w%}e+o1?7!<7^y`glr10 -zP#dyzNLg5?r+5`(E*u+~Vm^0;tQM9me9)4MBh(Iu7S6NqF=SwExzF+z-UVSU_ -zj?o`$bJ_L-#!JroM_Sj7` -zn|N39iKb;C<$>o=aWXUnUTU2jKU;nw$S(ryQa$jm5FUm%ZZqMtlsl|))7SW&F_p=reglOqn+ -zt>{9hPE)G4#3m9rNZq6!(hky2(q2+OX+P-zX^=ETIz-B{m>yJ8n@}$+A>bf&lX^%y -zNIOY;N&Te#qywZu(h%tosr&{L)nKe{)~sq$m3Zk=T7Mpn4Bc~u3jcF -z^C{?&v0G}!BPe;Gb&K-$C9$Af_6CEQjT!#lHDFAi%;fhjaZ$b*_we!@?e+|*On&d) -z&T)g%Yb4^{%vWUJow$|R?#SWykC%HR`iOreoAB&K&Ar_dp9GxC1u3m|yixGHLYAPA -z;a;78qsiliQzNkDyaf(&MD=IMI#-$JVUfOs+~pDXFTI^l -z)45k=4l;Ns13zR_aFIBc2rxjrg*c=14&r=M!_(U$3f@RO6jAU_$=lEYUm6~A^h;@2 -zEWiNq0C7LhfWe_(89PGUL+NFUFUs^0{Bz>$JHi2fw}_=_5-k`YgIshfaa#np5%)hN -z9C?JWQppL(3b}}fh|BcNCN@%Z^+Ry@$zp3j_>m*JLC=PBH2|?|ij_X7UQ=WmS^DEcq+7W!3;+xe* -zDW#aj*{;n2_pB{4F(<5AyU4`m!0ENc^|>OE+~K@NX**^L-cLS)(npa1@)Y$lad!pG -zURRXSd$%yl(_lMxAU{?fD1e>o7G*>p3jdtU?&%Qw)VF@nw+sbXxWtvPS+#(@vZf24+9)GsW1a -zvBgDY<#v1EL+=Y_=!?yO?oD;DI#vz5x#?|_G6cK7Uz`}idB%g(b~uMr?k=U?0Bct< -zba$!BB53L=j`7o;)en7L_LvaGLhug8pAGsBZuAmR)X=g2w!IUy_<5GRVzR6EyjXW94&X#yr^Rv&VSIsRvH` -z>?%Fby|{wK!&n$f<6Com=fPmc9W_--_8bK+-mQ939Dr_@fs- -ziW&p$+p=PMso+k?>Pm$dk;n(oMmW9AE@SFONZLL#dZS2P2=8F_N4Mum;DX)T?J?aw -V!n_vFZMVlN^j;mUKt|X2{|D$~Sdst$ - -delta 7376 -zcmZvh3v^V~xySdJ$%G`tWWp;CLNmbx0w_tukOaZZkVpmyG87O*9@86C9wCHY^;&8( -z69~#cvsU1vf(RN5_ex#1H=0$86mdW*c)eU>X?@^>v2bO=qlDYl3W}cl-)Db29R~MW -zXa0NtzWsikefG5f-nM_Itvx$qps<`@Qk4!*{c$^ukYSV`|Kt5yrh@tO3Og<*%Ilhy~J2V -zFC=7=J0Z)MZuy$v+a`U+ZtM3!>(@u`C)65uTQN!;m4R$z49C4I*4u>`Aku`hTJdBh -zqQR!Pn=AG+*#@|5=1!Lt6bqGzAETROK9R`^(B)=FI6}o=E5TrbPQ5Nw>ZQt3(KyDdqRmY -zIiubx1s-GmJKaO06}ZH_9xC(i;Z{E{&W$MQWcpvesgw~8~0>Vkiu_(g;*$6RoQ -zcq)nKxqt|d@luX{ow=`Afli3k#s(fs-`&cvgA2&u0y=q46n1%%erluclze(FIgwu8 -zn%_!lZj7dpX83LHvfk6uX;Gp=RS(zyxuKaB!=^g-Qv-pm|%HijRsjh_0tgly1K(UP@*e -zy=}LI5c0N_Jt-x<=6Gp1`Zs#XQ`rARL>3YDwmJ6DDNkOa8xf+-WP0j{AHrPd%fRt6 -zLdf8KDJp}UFQ|2LY4UdD0D~x?Lz9OkE`~k2i@un=BqxHoijw~_TM)LuO-bMKXL|D-dt0V3hxka+oWqlg{TQ39R1yArdcB`hg@hl@>IB&KC7AN8i&NHt=X8( -zQ;nlNuUt3H_UK9^LhX)H*zl?Q1|MWxYs~yi#`jlLwlx~~y`k;kaa?!1yV7O9IwJ9>xO4p|NbB<+M{c%u= -z>W>r{(I2DfUu(;3bB58D>a3x4191%jI^{(g;{BmfK+C;r -z6BlD&j&7qKZ{?`3he+$-uOMpV(`&lXv{{IOf)<`K%^CHV0PdjaQ*SlyrPWh!9eLnm -z*{A6n(lL244}NM@v+PdP?cVx=ebd`&R$&!5TIuzvg*fA#o?0}t@FR5O{hkFf)ze>_ -zW?kqn)(CzTeV2w$n{3Pam>!xoymA|sC@QlB5?dL8%Aqp@-89Hs -zD7P-xz$~e2dFWpdr4IAVIV1Fkp3HAeGujKHD*A@C;v50gL{&5k74^%CrUFehj(O5Y -zEfV;7(AhHvlMJ(@0=r+d@y{rB1o8sNlVB0KX53M6c>uhH($@NSUBiF;3Bmuori15X -z@IzGCny+fgpQKGQhI;!UU3y*+H4=YI|H0Rr9Vrh9u_65E=-K<_#*qHY(s1aO|9cQ@ -z(nb6pb9{+k%kqox18=40)ySdRFsZxi(u_=-v9HVFOR?Jq-%S~_3yc@L#?St*RPsAr -zulo1)3&GR-6mj~nWOMh=^1 -z6V!FYG+Uv5=niNQ`ZBZ^8itmpD@h^ -zsOyiWc~FL-SvXO&pF}~>PV`Y2+KmxR#R;JkGh{y0kEwSM>c;v=!W*aef6)-A`%BZ@ -z2JM9IgZl6mINA>@tQ($>WP}T**$ZugCeS;}MjCFqvTS7bRrE~kfdaF^IzabQ>GI6M -z%YJW~`uKou7aQ>`rA5nY%Pzt)0wHlvn)6B9!Zdk4lW8wXcF;5nrLwDoCZJcd=;P%x -zM=g8PG}W6_9c7lmvJGq;$CkBu0xV3kRty~c->~4#XgO>GLXJ`q{ba>ZqmF*DV!e?? -z*(;|T2Wj`p;^aGFKaSo%i%_{E^$(`mNRt{yZf(d-mR0bf|8JwphT7!$2z4N|kajoB -zb6kfnNY@%>JLX^{vS`+->5jedMd^iAwT@o+4$`GnwaF7P9=`WYvy-l@Dxe=VmODB? -zcG2#}TE|8BN~ouCWndvjr|EO7XOtmkra9N!>eG^@yk(u*9*1o&Y)hpLPB!T0U;-~3 -z>s!E^=Cf}yQqqz<{be`ogRK>>vd7?;PIj;y{a!Hr(IUBw`zLVk8FPr4FA1E4QNX2V -zFos>ToJ-QC>65-b*`qHlw--GiU8)k57JhwR%B@xgY`>OsHq(OUJfoS`HjmAB%Atot -zQI`9NGn20=>ALBiW*5#B=bOi7xH(5mM9T$fRG=6$@%})bEz+OX2A)Eu9@~&WiL5=G -zo7KnaXKi8)vbM8!uy(SBS-V*yti7z(RRzj%W?01um(qYJVc=%7=Bj)&65_MC67lDyv<7 -zS_WfdYK~>w@_js8xW1RuYwO1a;`&H_|Jra{;*@JT#>v$yxn82$R1S|J{#k-vx>GEE -zQs&U-&+v_~6eD-dSh#k@l%fOA{F -zLcGP?&+&D^pX>N>{4#U#LzRJi+o*MiceZSCm<{b*fRni^j=Pw5%u*5k9KTd^p8~o< -zUgikHjcIJUqUN3jt%IojY}54 -zwc_5qF&we@%^T0V;PRe4e#iTq^KrK5oRyxpc;ALJrqB8yUb{AdcdfGzDGwI3yp6@F -zWO8V%EmA^14lTAtCea^5#Z!6D(I-23Q7Gfa-dD;@x|zH1{Vkoo4?V}+T}ab5jm?R_ -z*DXf}%Iw0~v~|(v>O^yP5ah(=z{ndHjv_1?Ej|6;Yqr -z5-?~3I4y*h{5&Jz=6l0S%|Tzm|Fo!4MTivgv}Fz-fm53tf%v~n+{{Hz*V?v_EqQ!}s2_XBxbc-;sqOz^#|?Hr -zIzdxtRZ4o-_-zN|CDWCsi!=1;Mr#F?ZZFQzhe@s7v<6h4b+j&^SGE@?yZN~4rk?HP -z$w3a`NV%gtSsygrw0uWJvR)fbdI>fTxtw$!Aw3QQX!J9EA?E;E@l3gMplZK9-&E2o -z&lIQVrJq|(=aGW<6yc-MJIkHC`Riq!OKWx(575UKt=ALj)t$x3%_?_iBc0z_u0vUk -zH2T@TkgJhaJX@a1r<2HPIZ&R2ffRl=KRKw9izYgc1bV+%L!)=~g`8_>#jYx24ZXCh -dDrt?1pG8*?VgAolXcm?3F1P)vl~(K?@&8}0C|Cdh - 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 index f33ce913..01b208ed 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -2272,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 77149dfb..252ae3b0 100644 +index 27ca8755..a6b2c94e 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2605,19 +2451,18 @@ index b98ee6a7..ffe03816 100644 // Make the channel accessible public Channel getChannel() { 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 f04fdd9c..9aebc9e1 100644 +index 3a025312..5833b668 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 -@@ -126,7 +126,8 @@ public class PipelineUtils - }; - public static final Base BASE = new Base(); +@@ -130,7 +130,7 @@ public class PipelineUtils + public static final Base BASE = new Base( false ); + public static final Base BASE_SERVERSIDE = new Base( true ); private static final KickStringWriter legacyKicker = new KickStringWriter(); - private static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); -+ // FlameCord - Implement Libdeflate -+ public static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); ++ public static final Varint21LengthFieldPrepender framePrepender = new Varint21LengthFieldPrepender(); // FlameCord - Implement Libdeflate + private static final Varint21LengthFieldExtraBufPrepender serverFramePrepender = new Varint21LengthFieldExtraBufPrepender(); public static final String TIMEOUT_HANDLER = "timeout"; public static final String PACKET_DECODER = "packet-decoder"; - public static final String PACKET_ENCODER = "packet-encoder"; -- 2.37.3.windows.1 diff --git a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch index f6a8af44..cde06824 100644 --- a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch +++ b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch @@ -1,11 +1,11 @@ -From f33e0d4b04817d111c1cd4b76b95c86193146299 Mon Sep 17 00:00:00 2001 +From 0604d2c10875114e158a82a67cf7ac743c6c1e20 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:35:42 -0300 Subject: [PATCH] Optimize PipelineUtils 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 9aebc9e1..8580344d 100644 +index 5833b668..28223ec8 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 @@ -6,10 +6,12 @@ import dev._2lstudios.flamecord.FlameCord; @@ -21,7 +21,7 @@ index 9aebc9e1..8580344d 100644 import io.netty.channel.EventLoopGroup; import io.netty.channel.ServerChannel; import io.netty.channel.WriteBufferWaterMark; -@@ -50,7 +52,6 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; +@@ -53,7 +55,6 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; public class PipelineUtils { @@ -29,17 +29,11 @@ index 9aebc9e1..8580344d 100644 public static final AttributeKey LISTENER = AttributeKey.newInstance( "ListerInfo" ); public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() { -@@ -195,31 +196,35 @@ public class PipelineUtils - private static final int HIGH_MARK = Integer.getInteger( "net.md_5.bungee.high_mark", 2 << 20 ); // 2 mb - private static final WriteBufferWaterMark MARK = new WriteBufferWaterMark( LOW_MARK, HIGH_MARK ); - -+ // FlameCord start - Optimize PipelineUtils - public static final class Base extends ChannelInitializer - { - +@@ -209,26 +210,30 @@ public class PipelineUtils @Override public void initChannel(Channel ch) throws Exception { ++ // FlameCord start - Optimize PipelineUtils + ChannelPipeline pipeline = ch.pipeline(); + ChannelConfig channelConfig = ch.config(); try @@ -62,18 +56,19 @@ index 9aebc9e1..8580344d 100644 - ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() ); - ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); -- ch.pipeline().addLast( FRAME_PREPENDER, framePrepender ); + pipeline.addLast( FRAME_DECODER, new Varint21FrameDecoder() ); + pipeline.addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) ); -+ pipeline.addLast( FRAME_PREPENDER, framePrepender ); + // No encryption bungee -> server, therefore use extra buffer to avoid copying everything for length prepending + // Not used bungee -> client as header would need to be encrypted separately through expensive JNI call +- ch.pipeline().addLast( FRAME_PREPENDER, ( toServer ) ? serverFramePrepender : framePrepender ); ++ pipeline.addLast( FRAME_PREPENDER, ( toServer ) ? serverFramePrepender : framePrepender ); - ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); + pipeline.addLast( BOSS_HANDLER, new HandlerBoss() ); ++ // FlameCord end - Optimize PipelineUtils } -+ // FlameCord end - Optimize PipelineUtils // FlameCord - Close on exception caught - @Override -- 2.37.3.windows.1 From 04a0f02784ee298efe530506d1e04d951430f0b7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Mon, 27 Mar 2023 20:53:28 -0300 Subject: [PATCH 445/499] 1.4.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index fe24161f..bc35f067 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From a2b921fb0525f5af3562057eeec84c4b0c46ae37 Mon Sep 17 00:00:00 2001 +From 9653e319f08a8cb54a39301c84dd6f6d56896cc2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 821904f3..49adbde0 100644 +index 821904f3..596d5137 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 821904f3..49adbde0 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.1"; ++ return "1.4.2"; } public final void reloadMessages() From 69e82d078376d43bb148a10440006a1597457aa7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:38:03 -0300 Subject: [PATCH 446/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- ...se-connections-Don-t-flush-if-not-necessary.patch | 12 ++++++------ Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch | 6 +++--- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 8 ++++---- .../0040-Implement-libdeflate.patch | 8 ++++---- .../0043-Optimize-PipelineUtils.patch | 11 ++++++----- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Waterfall b/Waterfall index 0dc74bb2..fb7c7395 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit 0dc74bb24213c9e08dc78d9f3c53089b3b52118b +Subproject commit fb7c7395669840cdfc6d7bc34bc24ead466091ec diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 7209e8a1..71c6ae5f 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,4 +1,4 @@ -From 3fcd08a5340657c1144a5d9a2c919c2297937589 Mon Sep 17 00:00:00 2001 +From e801d03bfaa70492f0ad246397b0875c8fec9668 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary @@ -86,18 +86,18 @@ index 6dc5633f..8b0fac0a 100644 } 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 af65e192..993b55b0 100644 +index 6a045d16..9227db06 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 -@@ -5,6 +5,7 @@ import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; - import io.netty.buffer.PooledByteBufAllocator; +@@ -6,6 +6,7 @@ import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; import io.netty.channel.ChannelException; + import io.netty.channel.ChannelFactory; +import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; -@@ -101,6 +102,14 @@ public class PipelineUtils +@@ -102,6 +103,14 @@ public class PipelineUtils BungeeCord.getInstance().getPluginManager().callEvent(connectionInitEvent); } @@ -112,7 +112,7 @@ index af65e192..993b55b0 100644 }; public static final Base BASE = new Base( false ); public static final Base BASE_SERVERSIDE = new Base( true ); -@@ -203,5 +212,13 @@ public class PipelineUtils +@@ -244,5 +253,13 @@ public class PipelineUtils ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() ); } diff --git a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch index 64f1136e..d75eab91 100644 --- a/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch +++ b/Waterfall-Proxy-Patches/0027-TCP-Fast-Open.patch @@ -1,4 +1,4 @@ -From 7967c49c7a8e56c79de7d520f9ae03f2ed53af1e Mon Sep 17 00:00:00 2001 +From ac1ea510e73bdc4f02d4d73919edabd1313bc5ff Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:41:57 -0300 Subject: [PATCH] TCP Fast Open @@ -29,10 +29,10 @@ index b41ee92c..14665b1f 100644 } } 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 d9e360a1..156ea2aa 100644 +index f9227e01..1a5a0e08 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 -@@ -203,6 +203,8 @@ public class PipelineUtils +@@ -244,6 +244,8 @@ public class PipelineUtils // IP_TOS is not supported (Windows XP / Windows Server 2003) } ch.config().setOption( ChannelOption.TCP_NODELAY, true ); diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 080fc1a0..1872744d 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 87645acfa86b4bd64b98b3a6aef7e9727fb1f24c Mon Sep 17 00:00:00 2001 +From 4cf1d03c88fcca0a11057eed5ca57581ad9cc618 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1708,7 +1708,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c0a50444..08aa4318 100644 +index 51da85ac..998445a7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1962,10 +1962,10 @@ index 14e3004f..b61ed521 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 156ea2aa..3a025312 100644 +index 1a5a0e08..f32a3747 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 -@@ -62,6 +62,20 @@ public class PipelineUtils +@@ -63,6 +63,20 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 69bbcad9..d397977c 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,4 +1,4 @@ -From 482102b6fca099a58b23ed16997e4d8f0b063da3 Mon Sep 17 00:00:00 2001 +From 3aae0780d014478a4ad684b382bd2185ff9cfe8c Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 27ca8755..a6b2c94e 100644 +index 76f77a53..ddf80d6c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2451,10 +2451,10 @@ index b98ee6a7..ffe03816 100644 // Make the channel accessible public Channel getChannel() { 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 3a025312..5833b668 100644 +index f32a3747..19f0f076 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 -@@ -130,7 +130,7 @@ public class PipelineUtils +@@ -131,7 +131,7 @@ public class PipelineUtils public static final Base BASE = new Base( false ); public static final Base BASE_SERVERSIDE = new Base( true ); private static final KickStringWriter legacyKicker = new KickStringWriter(); diff --git a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch index cde06824..34d08a81 100644 --- a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch +++ b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch @@ -1,19 +1,20 @@ -From 0604d2c10875114e158a82a67cf7ac743c6c1e20 Mon Sep 17 00:00:00 2001 +From d3cfbc8aaa6a2d7080b45732ad6912595bc13f5f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:35:42 -0300 Subject: [PATCH] Optimize PipelineUtils 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 5833b668..28223ec8 100644 +index 19f0f076..f292db94 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 -@@ -6,10 +6,12 @@ import dev._2lstudios.flamecord.FlameCord; +@@ -6,11 +6,13 @@ import dev._2lstudios.flamecord.FlameCord; import io.github.waterfallmc.waterfall.event.ConnectionInitEvent; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; +import io.netty.channel.ChannelConfig; import io.netty.channel.ChannelException; + import io.netty.channel.ChannelFactory; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; @@ -21,7 +22,7 @@ index 5833b668..28223ec8 100644 import io.netty.channel.EventLoopGroup; import io.netty.channel.ServerChannel; import io.netty.channel.WriteBufferWaterMark; -@@ -53,7 +55,6 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; +@@ -54,7 +56,6 @@ import net.md_5.bungee.protocol.Varint21LengthFieldPrepender; public class PipelineUtils { @@ -29,7 +30,7 @@ index 5833b668..28223ec8 100644 public static final AttributeKey LISTENER = AttributeKey.newInstance( "ListerInfo" ); public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() { -@@ -209,26 +210,30 @@ public class PipelineUtils +@@ -250,26 +251,30 @@ public class PipelineUtils @Override public void initChannel(Channel ch) throws Exception { From 1f5d142bb6531981290309d0f4a135e3c448f9e4 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:39:30 -0300 Subject: [PATCH 447/499] 1.4.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index bc35f067..141d0345 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 9653e319f08a8cb54a39301c84dd6f6d56896cc2 Mon Sep 17 00:00:00 2001 +From 36c85f81c24cbbe2da2bbc437c79eac7fa338bbe Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 821904f3..596d5137 100644 +index 3e9be796..a57fccf1 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 821904f3..596d5137 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.2"; ++ return "1.4.3"; } public final void reloadMessages() From 9a4a0fc5c9e83f97056061ad22f5c64834e871f9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:45:09 -0300 Subject: [PATCH 448/499] Better version command --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 141d0345..64522402 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 36c85f81c24cbbe2da2bbc437c79eac7fa338bbe Mon Sep 17 00:00:00 2001 +From a49a93d24a083333541f9b78bd5e0477d343e979 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -32,7 +32,7 @@ index 3e9be796..a57fccf1 100644 public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03..aeda7963 100644 +index 820f7b03..76f5fed7 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -41,7 +41,7 @@ index 820f7b03..aeda7963 100644 { - sender.sendMessage( ChatColor.BLUE + "This server is running FlameCord version " + ProxyServer.getInstance().getVersion() + " by md_5" ); + // FlameCord - Use custom version message -+ sender.sendMessage( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bLinsaFTW & Sammwy&e." ) ); ++ sender.sendMessage( net.md_5.bungee.api.chat.TextComponent.fromLegacyText( ChatColor.translateAlternateColorCodes( '&', "&eThis server is running &c" + ProxyServer.getInstance().getName() + "&e version &a" + ProxyServer.getInstance().getVersion() + "&e by &bArkFlame Development&e." ) ) ); } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java From 996c333310d58785ac5ba78a74b15ae36b6f18d7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:35:42 -0300 Subject: [PATCH 449/499] Proxy Detection Service --- .../0028-Antibot-System.patch | 126 ++++++++++++++++-- .../0029-Allow-Invalid-Names.patch | 8 +- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +- .../0036-Bungee-Plugins-Command.patch | 10 +- .../0037-Bungee-IP-Command.patch | 10 +- .../0038-List-Command-Format.patch | 6 +- ...0039-InitialHandler-Processing-State.patch | 14 +- 7 files changed, 142 insertions(+), 38 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 1872744d..b3c74fc0 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 4cf1d03c88fcca0a11057eed5ca57581ad9cc618 Mon Sep 17 00:00:00 2001 +From 3274980088aa9779262e38e0d48beb33ba7d1a60 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -473,10 +473,10 @@ index 00000000..007be392 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 00000000..1503ac95 +index 00000000..6af48a4d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,44 @@ +package dev._2lstudios.flamecord.antibot; + +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; @@ -499,6 +499,8 @@ index 00000000..1503ac95 + private final ReconnectCheck reconnectCheck; + @Getter + private final PacketsCheck packetsCheck; ++ @Getter ++ private final ProxyCheck proxyCheck; + + public CheckManager(final AddressDataManager addressDataManager, final FlameCordConfiguration flameCordConfiguration) { + this.accountsCheck = new AccountsCheck(addressDataManager); @@ -509,8 +511,10 @@ index 00000000..1503ac95 + this.ratelimitCheck = new RatelimitCheck(addressDataManager); + this.reconnectCheck = new ReconnectCheck(addressDataManager); + this.packetsCheck = new PacketsCheck(); ++ this.proxyCheck = new ProxyCheck(addressDataManager); + + this.countryCheck.load(); ++ this.proxyCheck.updateProxies(); + } + + public void unload() { @@ -1081,6 +1085,99 @@ index 00000000..68555de3 + return repeatCount; + } +} +diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java +new file mode 100644 +index 00000000..eefc2153 +--- /dev/null ++++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java +@@ -0,0 +1,87 @@ ++package dev._2lstudios.flamecord.antibot; ++ ++import java.io.BufferedReader; ++import java.io.InputStreamReader; ++import java.net.HttpURLConnection; ++import java.net.SocketAddress; ++import java.net.URL; ++import java.util.logging.Level; ++ ++import dev._2lstudios.flamecord.FlameCord; ++ ++public class ProxyCheck { ++ private AddressDataManager addressDataManager; ++ public String proxies = ""; ++ ++ public ProxyCheck(AddressDataManager addressDataManager) { ++ this.addressDataManager = addressDataManager; ++ } ++ ++ public void updateProxies() { ++ // define the websites to get the proxies from ++ String[] websites = { ++ "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt", ++ "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", ++ "https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt" ++ }; ++ ++ // send updating proxies message ++ FlameCord.getInstance().getLoggerWrapper().log(Level.INFO, ++ "Updating proxy database from " + websites.length + " websites..."); ++ ++ // create a string builder to store the content ++ StringBuilder content = new StringBuilder(); ++ ++ // loop through each website ++ for (String website : websites) { ++ try { ++ // create a URL object with the website ++ URL url = new URL(website); ++ ++ // open a connection to the URL ++ HttpURLConnection con = (HttpURLConnection) url.openConnection(); ++ ++ // set the request method to GET ++ con.setRequestMethod("GET"); ++ ++ // get the response code ++ int responseCode = con.getResponseCode(); ++ ++ // if the response code is OK (200) ++ if (responseCode == HttpURLConnection.HTTP_OK) { ++ // create a buffered reader to read the response ++ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); ++ ++ // read each line of the response and append it to the content ++ String inputLine; ++ while ((inputLine = in.readLine()) != null) { ++ content.append(inputLine); ++ content.append("\n"); ++ } ++ ++ // close the buffered reader ++ in.close(); ++ } else { ++ // print an error message ++ FlameCord.getInstance().getLoggerWrapper().log(Level.INFO, "GET request failed for " + website); ++ } ++ } catch (Exception ex) { ++ // print an error message ++ FlameCord.getInstance().getLoggerWrapper().log(Level.INFO, "GET request failed for " + website); ++ } ++ } ++ ++ // set the updated proxy list ++ proxies = content.toString(); ++ } ++ ++ public boolean check(String ip) { ++ return !proxies.equals("") && proxies.contains(ip); ++ } ++ ++ public boolean check(SocketAddress address) { ++ AddressData addressData = addressDataManager.getAddressData(address); ++ ++ return check(addressData.getHostString()); ++ } ++} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 index 00000000..51c1866e @@ -1482,10 +1579,10 @@ index 14665b1f..0f12f4ae 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae179438..6175d8e2 100644 +index ae179438..35277c4c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -80,6 +80,22 @@ public class MessagesConfiguration extends FlameConfig { +@@ -80,6 +80,23 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); @@ -1498,6 +1595,7 @@ index ae179438..6175d8e2 100644 + setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_proxy", "&c&lFlameCord\n\n&cYou are using a Proxy/VPN! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); + + setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); @@ -1708,7 +1806,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 51da85ac..998445a7 100644 +index 6d798917..23d89781 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1724,7 +1822,7 @@ index 51da85ac..998445a7 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae..29afa82c 100644 +index d65884ae..8d7bb6bf 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1761,19 +1859,25 @@ index d65884ae..29afa82c 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -442,6 +458,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } + // FlameCord start - Antibot System + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ ++ if ( checkManager.getProxyCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_proxy" ) ); ++ return; ++ } + // FlameCord end - Antibot System + switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +480,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1791,7 +1895,7 @@ index d65884ae..29afa82c 100644 break; case 2: // Login -@@ -464,6 +496,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -464,6 +502,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1808,7 +1912,7 @@ index d65884ae..29afa82c 100644 if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -527,6 +569,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +575,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 2f46e925..7629146c 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 1e3a2975964623026cc90326efc27ccafb47ae51 Mon Sep 17 00:00:00 2001 +From 0223fa7bcd9bc22c97dc8ee8fe26966a62ec596f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 0f12f4ae6..6f463b9c6 100644 +index 0f12f4ae..6f463b9c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -30,10 +30,10 @@ index 0f12f4ae6..6f463b9c6 100644 } } 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 b88e64526..e8c14c552 100644 +index 8d7bb6bf..95f0e52c 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 -@@ -528,7 +528,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -534,7 +534,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index ef5d401a..8d603dc3 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From ab1e5d100f2d678f1471fa83226dc9a5af2d370b Mon Sep 17 00:00:00 2001 +From e00613f6a9cb19fbaddec2c4d51bd7feb6fcceea Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 e8c14c55..6d0719a0 100644 +index 95f0e52c..d2406a7e 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 -@@ -833,7 +833,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -839,7 +839,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch index a40ebcc6..54048b55 100644 --- a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch @@ -1,14 +1,14 @@ -From f37bca815bffe22461c5b2760596ef18d56a1070 Mon Sep 17 00:00:00 2001 +From 0923414d9063d29b476aaba8c1d2dc0c32f7d518 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 6175d8e2d..2ea33a94b 100644 +index 35277c4c..e385aaab 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig { +@@ -97,6 +97,11 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); // FlameCord end - Antibot System @@ -22,7 +22,7 @@ index 6175d8e2d..2ea33a94b 100644 diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java new file mode 100644 -index 000000000..2e20e9dca +index 00000000..2e20e9dc --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeePluginsCommand.java @@ -0,0 +1,45 @@ @@ -72,7 +72,7 @@ index 000000000..2e20e9dca + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 62712330e..ec5fd4af2 100644 +index 23d89781..e03c7877 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch index 0bc48e2d..62148dfc 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch @@ -1,14 +1,14 @@ -From 79f33268f3f154170f55362decf8fcc8b99a68f8 Mon Sep 17 00:00:00 2001 +From 15952aaaac9f80d0bf3f1d7adbd42e947572d78f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 2ea33a94b..e42bb29d5 100644 +index e385aaab..4d9ed0c7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig { +@@ -102,6 +102,12 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); @@ -23,7 +23,7 @@ index 2ea33a94b..e42bb29d5 100644 diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java new file mode 100644 -index 000000000..85313491e +index 00000000..85313491 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/BungeeIPCommand.java @@ -0,0 +1,45 @@ @@ -73,7 +73,7 @@ index 000000000..85313491e + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ec5fd4af2..f5059666e 100644 +index e03c7877..63ba56f4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; diff --git a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch index b4d4ca0b..80249e2b 100644 --- a/Waterfall-Proxy-Patches/0038-List-Command-Format.patch +++ b/Waterfall-Proxy-Patches/0038-List-Command-Format.patch @@ -1,14 +1,14 @@ -From 4bdecd3bce63e87e3c1388cf7bf9c67a9fa2c6d0 Mon Sep 17 00:00:00 2001 +From a4b4d829121fafb58860f8d4478e68517d0d8b75 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:03:34 -0300 Subject: [PATCH] List Command Format diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index e42bb29d..555319a7 100644 +index 4d9ed0c7..d64c5d7a 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -@@ -107,6 +107,9 @@ public class MessagesConfiguration extends FlameConfig { +@@ -108,6 +108,9 @@ public class MessagesConfiguration extends FlameConfig { setIfUnexistant("flamecord_bip_usage", "&c/bip ", configuration); setIfUnexistant("flamecord_bip", "&aInformation about {0}&a:\n&aUUID: &b{1}\n&aIP: &b{2}\n&aPing: &b{3}ms\n&aLocale: &b{4}\n&aView Distance: &b{5}\n&aCurrent Server: &b{6}", configuration); diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index 00c27323..8f664eec 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 477817bdc183b430c925b7b3841e5b51ac632852 Mon Sep 17 00:00:00 2001 +From 63c29065199a914dad97bfeed9c8ded1ee8ff340 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 6d0719a0..8beed72f 100644 +index d2406a7e..348a91b2 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,7 +64,7 @@ index 6d0719a0..8beed72f 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -491,6 +510,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection } // FlameCord end - Antibot System @@ -75,7 +75,7 @@ index 6d0719a0..8beed72f 100644 break; case 2: // Login -@@ -517,6 +540,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -523,6 +546,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index 6d0719a0..8beed72f 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -527,6 +555,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -533,6 +561,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index 6d0719a0..8beed72f 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -634,6 +666,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -640,6 +672,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index 6d0719a0..8beed72f 100644 } }; -@@ -647,6 +682,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -653,6 +688,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) From 98ffc13263a37145e9216d752e859c7e2f1bc1c9 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:41:35 -0300 Subject: [PATCH 450/499] Configuration options for proxy check --- .../0028-Antibot-System.patch | 54 +++++++++++++++---- .../0029-Allow-Invalid-Names.patch | 6 +-- .../0040-Implement-libdeflate.patch | 8 +-- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index b3c74fc0..4a892b1f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 3274980088aa9779262e38e0d48beb33ba7d1a60 Mon Sep 17 00:00:00 2001 +From 35f386ceb8c2b6d2e728f5a87f6a15cc7f70ae4f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -473,12 +473,13 @@ index 00000000..007be392 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 00000000..6af48a4d +index 00000000..e162de95 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -@@ -0,0 +1,44 @@ +@@ -0,0 +1,49 @@ +package dev._2lstudios.flamecord.antibot; + ++import dev._2lstudios.flamecord.FlameCord; +import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; +import lombok.Getter; + @@ -514,7 +515,11 @@ index 00000000..6af48a4d + this.proxyCheck = new ProxyCheck(addressDataManager); + + this.countryCheck.load(); -+ this.proxyCheck.updateProxies(); ++ ++ ++ if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotProxyEnabled()) { ++ this.proxyCheck.updateProxies(); ++ } + } + + public void unload() { @@ -1087,10 +1092,10 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..eefc2153 +index 00000000..69ba53e9 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,87 @@ +@@ -0,0 +1,104 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1101,13 +1106,18 @@ index 00000000..eefc2153 +import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; ++import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; + +public class ProxyCheck { ++ private FlameCordConfiguration config; ++ private LoggerWrapper logger; + private AddressDataManager addressDataManager; -+ public String proxies = ""; ++ private String proxies = ""; + + public ProxyCheck(AddressDataManager addressDataManager) { + this.addressDataManager = addressDataManager; ++ this.config = FlameCord.getInstance().getFlameCordConfiguration(); ++ this.logger = FlameCord.getInstance().getLoggerWrapper(); + } + + public void updateProxies() { @@ -1173,9 +1183,21 @@ index 00000000..eefc2153 + } + + public boolean check(SocketAddress address) { ++ if (!config.isAntibotProxyEnabled()) return false; ++ + AddressData addressData = addressDataManager.getAddressData(address); ++ String ip = addressData.getHostString(); + -+ return check(addressData.getHostString()); ++ // Check if it's a proxy ++ if (!proxies.equals("") && proxies.contains(ip)) { ++ if (config.isAntibotProxyLog()) { ++ logger.log(Level.INFO, "[FlameCord] [{0}] was blocked for using a VPN/Proxy service", address); ++ } ++ ++ return true; ++ } ++ ++ return false; + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -1377,10 +1399,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..0f12f4ae 100644 +index 14665b1f..9d095964 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,187 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,197 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1496,6 +1518,12 @@ index 14665b1f..0f12f4ae 100644 + @Getter + private double antibotPacketsVlsToCancel = 25; + ++ // Antibot proxy ++ @Getter ++ private boolean antibotProxyEnabled = true; ++ @Getter ++ private boolean antibotProxyLog = true; ++ + public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { + // Antibot accounts + this.antibotAccountsEnabled = setIfUnexistant("antibot.accounts.enabled", this.antibotAccountsEnabled, config); @@ -1563,12 +1591,16 @@ index 14665b1f..0f12f4ae 100644 + this.antibotPacketsVlsPerByte = setIfUnexistant("antibot.packets.vls-per-byte", this.antibotPacketsVlsPerByte, config); + this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); + this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); ++ ++ // Antibot-proxy ++ this.antibotProxyEnabled = setIfUnexistant("antibot.proxy.enabled", this.antibotProxyEnabled, config); ++ this.antibotProxyLog = setIfUnexistant("antibot.proxy.log", this.antibotProxyLog, config); + } + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +313,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +323,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 7629146c..830b9786 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 0223fa7bcd9bc22c97dc8ee8fe26966a62ec596f Mon Sep 17 00:00:00 2001 +From 66097efeee329a42b72bf50e458ad8eb090334c2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 0f12f4ae..6f463b9c 100644 +index 9d095964..996d94ea 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 0f12f4ae..6f463b9c 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -317,6 +321,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -327,6 +331,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index d397977c..5d556f8a 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 3aae0780d014478a4ad684b382bd2185ff9cfe8c Mon Sep 17 00:00:00 2001 +From 97c2f1c36b9e83d5a75c673d9265c4caa9ef3555 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 6f463b9c..6ec047ed 100644 +index 996d94ea..05321f0e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index 6f463b9c..6ec047ed 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -324,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -334,6 +336,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 76f77a53..ddf80d6c 100644 +index 63ba56f4..a9fb2388 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; From a7e801cd6e135e4b4563d6ac62100799e4c14748 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:18:54 -0300 Subject: [PATCH 451/499] Improve code for proxy check --- .../0028-Antibot-System.patch | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 4a892b1f..68c25145 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 35f386ceb8c2b6d2e728f5a87f6a15cc7f70ae4f Mon Sep 17 00:00:00 2001 +From 3e15de1f48767b39db352670c7f987334de4ab75 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -473,10 +473,10 @@ index 00000000..007be392 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 00000000..e162de95 +index 00000000..0de7d709 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -@@ -0,0 +1,49 @@ +@@ -0,0 +1,48 @@ +package dev._2lstudios.flamecord.antibot; + +import dev._2lstudios.flamecord.FlameCord; @@ -516,7 +516,6 @@ index 00000000..e162de95 + + this.countryCheck.load(); + -+ + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotProxyEnabled()) { + this.proxyCheck.updateProxies(); + } @@ -729,10 +728,10 @@ index 00000000..e2140887 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 00000000..df26a363 +index 00000000..5ae7580e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java -@@ -0,0 +1,28 @@ +@@ -0,0 +1,32 @@ +package dev._2lstudios.flamecord.antibot; + +import java.util.logging.Level; @@ -760,6 +759,10 @@ index 00000000..df26a363 + logger.log(level, msg, params); + } + } ++ ++ public Logger getLogger() { ++ return logger; ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 @@ -1092,10 +1095,10 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..69ba53e9 +index 00000000..ef64fd8c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,104 @@ +@@ -0,0 +1,103 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1129,8 +1132,7 @@ index 00000000..69ba53e9 + }; + + // send updating proxies message -+ FlameCord.getInstance().getLoggerWrapper().log(Level.INFO, -+ "Updating proxy database from " + websites.length + " websites..."); ++ FlameCord.getInstance().getLoggerWrapper().getLogger().info("Updating proxy database from " + websites.length + " websites..."); + + // create a string builder to store the content + StringBuilder content = new StringBuilder(); From 6dc9dd19561603a22cef244ead6a2aa1f6611114 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:40:09 -0300 Subject: [PATCH 452/499] 1.4.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 64522402..230cc3f9 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From a49a93d24a083333541f9b78bd5e0477d343e979 Mon Sep 17 00:00:00 2001 +From 2cbf811f1a1a4f1f93621747ff311a1a5398377f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796..a57fccf1 100644 +index 3e9be796..971f5b54 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796..a57fccf1 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.3"; ++ return "1.4.4"; } public final void reloadMessages() From 24a60ab157662627c877a478d511201f28440030 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 13 Apr 2023 21:39:29 -0300 Subject: [PATCH 453/499] Use external services for proxy check --- .../0028-Antibot-System.patch | 97 +++++++++++++++---- .../0029-Allow-Invalid-Names.patch | 8 +- ...0039-InitialHandler-Processing-State.patch | 6 +- .../0040-Implement-libdeflate.patch | 8 +- 4 files changed, 88 insertions(+), 31 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 68c25145..94fd24df 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 3e15de1f48767b39db352670c7f987334de4ab75 Mon Sep 17 00:00:00 2001 +From 0f74c662fa03c20ad745a5b6b70a92e1125fdf02 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1095,10 +1095,10 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..ef64fd8c +index 00000000..a387a473 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,103 @@ +@@ -0,0 +1,157 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1132,7 +1132,8 @@ index 00000000..ef64fd8c + }; + + // send updating proxies message -+ FlameCord.getInstance().getLoggerWrapper().getLogger().info("Updating proxy database from " + websites.length + " websites..."); ++ FlameCord.getInstance().getLoggerWrapper().getLogger() ++ .info("Updating proxy database from " + websites.length + " websites..."); + + // create a string builder to store the content + StringBuilder content = new StringBuilder(); @@ -1185,22 +1186,75 @@ index 00000000..ef64fd8c + } + + public boolean check(SocketAddress address) { -+ if (!config.isAntibotProxyEnabled()) return false; ++ if (!config.isAntibotProxyEnabled()) ++ return false; + + AddressData addressData = addressDataManager.getAddressData(address); + String ip = addressData.getHostString(); + + // Check if it's a proxy -+ if (!proxies.equals("") && proxies.contains(ip)) { ++ if ((!proxies.equals("") && proxies.contains(ip)) || isVPN(ip)) { + if (config.isAntibotProxyLog()) { + logger.log(Level.INFO, "[FlameCord] [{0}] was blocked for using a VPN/Proxy service", address); + } + ++ if (config.isAntibotProxyFirewall()) { ++ addressData.firewall("Using VPN/proxy services"); ++ } ++ + return true; + } + + return false; + } ++ ++ // Method to check if an IP address is a VPN using getipintel API ++ public boolean isVPN(String ip) { ++ try { ++ // Create a URL object with the API endpoint and the IP parameter ++ URL url = new URL("https://check.getipintel.net/check.php?ip=" + ip + "&contact=linsaftw@gmail.com"); ++ ++ // Open a connection to the URL ++ HttpURLConnection con = (HttpURLConnection) url.openConnection(); ++ ++ // Set the request method to GET ++ con.setRequestMethod("GET"); ++ ++ // Get the response code ++ int responseCode = con.getResponseCode(); ++ ++ // If the response code is 200 (OK), read the input stream ++ if (responseCode == 200) { ++ // Read the response from the input stream ++ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); ++ String line; ++ StringBuilder response = new StringBuilder(); ++ ++ while ((line = in.readLine()) != null) { ++ response.append(line); ++ } ++ in.close(); ++ ++ // Parse the response as a double ++ double result = Double.parseDouble(response.toString()); ++ ++ // If the result is greater than 0.99, it is a VPN ++ if (result > 0.99) { ++ System.out.println("5"); ++ return true; ++ } else { ++ System.out.println("4"); ++ return false; ++ } ++ } else { ++ System.out.println("2"); ++ return false; ++ } ++ } catch (Exception e) { ++ System.out.println("1"); ++ return false; ++ } ++ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 @@ -1401,10 +1455,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..9d095964 100644 +index 14665b1f..9e34075d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,197 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,200 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1525,6 +1579,8 @@ index 14665b1f..9d095964 100644 + private boolean antibotProxyEnabled = true; + @Getter + private boolean antibotProxyLog = true; ++ @Getter ++ private boolean antibotProxyFirewall = true; + + public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { + // Antibot accounts @@ -1597,12 +1653,13 @@ index 14665b1f..9d095964 100644 + // Antibot-proxy + this.antibotProxyEnabled = setIfUnexistant("antibot.proxy.enabled", this.antibotProxyEnabled, config); + this.antibotProxyLog = setIfUnexistant("antibot.proxy.log", this.antibotProxyLog, config); ++ this.antibotProxyFirewall = setIfUnexistant("antibot.proxy.firewall", this.antibotProxyFirewall, config); + } + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +323,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); @@ -1840,7 +1897,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 6d798917..23d89781 100644 +index bf126c81..0a75abc3 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1856,7 +1913,7 @@ index 6d798917..23d89781 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae..8d7bb6bf 100644 +index d65884ae..e76c0284 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1893,25 +1950,19 @@ index d65884ae..8d7bb6bf 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -442,6 +458,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } + // FlameCord start - Antibot System + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); -+ -+ if ( checkManager.getProxyCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_proxy" ) ); -+ return; -+ } + // FlameCord end - Antibot System + switch ( handshake.getRequestedProtocol() ) { case 1: -@@ -453,6 +480,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -1929,7 +1980,7 @@ index d65884ae..8d7bb6bf 100644 break; case 2: // Login -@@ -464,6 +502,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -464,6 +496,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); @@ -1941,6 +1992,12 @@ index d65884ae..8d7bb6bf 100644 + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } ++ ++ if ( checkManager.getProxyCheck().check( ch.getRemoteAddress() ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_proxy" ) ); ++ return; ++ } + // FlameCord end - Antibot System + if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 830b9786..cf847511 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 66097efeee329a42b72bf50e458ad8eb090334c2 Mon Sep 17 00:00:00 2001 +From 824fd89885d7acaa5957fef782ec33517baf7dab Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9d095964..996d94ea 100644 +index 9e34075d..b34daed7 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9d095964..996d94ea 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -327,6 +331,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -330,6 +334,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); @@ -30,7 +30,7 @@ index 9d095964..996d94ea 100644 } } 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 8d7bb6bf..95f0e52c 100644 +index e76c0284..bdef72db 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 @@ -534,7 +534,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index 8f664eec..c4d37d53 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 63c29065199a914dad97bfeed9c8ded1ee8ff340 Mon Sep 17 00:00:00 2001 +From d6f0cb1c437b43d272932b3c2f457921d9282b4e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 d2406a7e..348a91b2 100644 +index cf390c5f..c96f9da8 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,7 +64,7 @@ index d2406a7e..348a91b2 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -491,6 +510,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection } // FlameCord end - Antibot System diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 5d556f8a..073e8729 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 97c2f1c36b9e83d5a75c673d9265c4caa9ef3555 Mon Sep 17 00:00:00 2001 +From d303d32c4a69eb36d79d5457411ab60da98416ad Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 996d94ea..05321f0e 100644 +index b34daed7..4e9f4dc4 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index 996d94ea..05321f0e 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -334,6 +336,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -337,6 +339,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 63ba56f4..a9fb2388 100644 +index a59dfab3..be6a0d63 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; From 64cbeb656becf6fa4cb0678afc6b50022f672734 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata <25271111+linsaftw@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:58:25 -0300 Subject: [PATCH 454/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80bdf311..e70e0ee1 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Just drag an drop FlameCord.jar into your server folder and run it. You can customize many FlameCord features in the flamecord.yml file. - + ## 🤝 Contributing From d45486c33401df962b087ec7f705d6d01c07baf5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 19 Apr 2023 19:55:04 -0300 Subject: [PATCH 455/499] Configurable email for proxy check --- .../0028-Antibot-System.patch | 23 +++++++++---------- .../0029-Allow-Invalid-Names.patch | 6 ++--- .../0040-Implement-libdeflate.patch | 6 ++--- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 94fd24df..6028086a 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 0f74c662fa03c20ad745a5b6b70a92e1125fdf02 Mon Sep 17 00:00:00 2001 +From b960daca2f9bd96273afbbb4b017ac57d38d0808 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1095,10 +1095,10 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..a387a473 +index 00000000..09ac1145 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,157 @@ +@@ -0,0 +1,153 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1212,7 +1212,7 @@ index 00000000..a387a473 + public boolean isVPN(String ip) { + try { + // Create a URL object with the API endpoint and the IP parameter -+ URL url = new URL("https://check.getipintel.net/check.php?ip=" + ip + "&contact=linsaftw@gmail.com"); ++ URL url = new URL("https://check.getipintel.net/check.php?ip=" + ip + "&contact=" + FlameCord.getInstance().getFlameCordConfiguration().getAntibotProxyEmail()); + + // Open a connection to the URL + HttpURLConnection con = (HttpURLConnection) url.openConnection(); @@ -1240,18 +1240,14 @@ index 00000000..a387a473 + + // If the result is greater than 0.99, it is a VPN + if (result > 0.99) { -+ System.out.println("5"); + return true; + } else { -+ System.out.println("4"); + return false; + } + } else { -+ System.out.println("2"); + return false; + } + } catch (Exception e) { -+ System.out.println("1"); + return false; + } + } @@ -1455,10 +1451,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..9e34075d 100644 +index 14665b1f..019b17f5 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,200 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,203 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1581,6 +1577,8 @@ index 14665b1f..9e34075d 100644 + private boolean antibotProxyLog = true; + @Getter + private boolean antibotProxyFirewall = true; ++ @Getter ++ private String antibotProxyEmail = "flamecord@gmail.com"; + + public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { + // Antibot accounts @@ -1650,16 +1648,17 @@ index 14665b1f..9e34075d 100644 + this.antibotPacketsVlsPerPacket = setIfUnexistant("antibot.packets.vls-per-packet", this.antibotPacketsVlsPerPacket, config); + this.antibotPacketsVlsToKick = setIfUnexistant("antibot.packets.vls-to-kick", this.antibotPacketsVlsToKick, config); + -+ // Antibot-proxy ++ // Antibot proxy + this.antibotProxyEnabled = setIfUnexistant("antibot.proxy.enabled", this.antibotProxyEnabled, config); + this.antibotProxyLog = setIfUnexistant("antibot.proxy.log", this.antibotProxyLog, config); + this.antibotProxyFirewall = setIfUnexistant("antibot.proxy.firewall", this.antibotProxyFirewall, config); ++ this.antibotProxyEmail = setIfUnexistant("antibot.proxy.email", this.antibotProxyEmail, config); + } + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +326,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +329,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index cf847511..48d518b0 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 824fd89885d7acaa5957fef782ec33517baf7dab Mon Sep 17 00:00:00 2001 +From cf5b9b6fa8f63d3654b33f96c4c3fc0de585c570 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9e34075d..b34daed7 100644 +index 019b17f5..4dd59b2b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9e34075d..b34daed7 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -330,6 +334,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -333,6 +337,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 073e8729..773083fb 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From d303d32c4a69eb36d79d5457411ab60da98416ad Mon Sep 17 00:00:00 2001 +From d62bc19cc15ac54fc3a5bd127b859f336cd50415 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b34daed7..4e9f4dc4 100644 +index 4dd59b2b..6f8f1505 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index b34daed7..4e9f4dc4 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -337,6 +339,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -340,6 +342,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); From 6fb95ef6b06b1e45526635e2cf86a0f3e4b089f2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 3 May 2023 13:21:25 -0300 Subject: [PATCH 456/499] Big antibot optimization & Reconnect check improvement --- .../0028-Antibot-System.patch | 142 +++++++++--------- .../0029-Allow-Invalid-Names.patch | 8 +- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +- ...0039-InitialHandler-Processing-State.patch | 18 +-- .../0040-Implement-libdeflate.patch | 8 +- .../0043-Optimize-PipelineUtils.patch | 6 +- 6 files changed, 98 insertions(+), 90 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 6028086a..8b10f38f 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From b960daca2f9bd96273afbbb4b017ac57d38d0808 Mon Sep 17 00:00:00 2001 +From 21cc9400af684b1c25bb3bad6f555b195ae22e45 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -824,10 +824,10 @@ index 00000000..1b35fba5 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 00000000..a7bd9f15 +index 00000000..6249fe8e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java -@@ -0,0 +1,69 @@ +@@ -0,0 +1,63 @@ +package dev._2lstudios.flamecord.antibot; + +import java.net.SocketAddress; @@ -844,27 +844,24 @@ index 00000000..a7bd9f15 +public class PacketsCheck { + private Map packetsData = new HashMap<>(); + -+ // Time since the last clear passed -+ private long lastClear = System.currentTimeMillis(); -+ + public PacketsData getData(SocketAddress address) { ++ // Get the ip + String ip = address.toString(); + -+ if (System.currentTimeMillis() - lastClear >= 60000) { ++ // Check if 60 seconds passed ++ if (System.currentTimeMillis() % 60000 == 0) { + packetsData.clear(); -+ this.lastClear = System.currentTimeMillis(); + } + -+ PacketsData data; -+ + if (packetsData.containsKey(ip)) { -+ data = packetsData.get(ip); ++ return packetsData.get(ip); + } else { -+ data = new PacketsData(address); ++ PacketsData data = new PacketsData(address); ++ + packetsData.put(ip, data); -+ } + -+ return data; ++ return data; ++ } + } + + public PacketsCheckResult check(SocketAddress socketAddress, ByteBuf byteBuf) { @@ -893,9 +890,6 @@ index 00000000..a7bd9f15 + return PacketsCheckResult.NONE; + } + } -+ -+ public void printPackets(SocketAddress remoteAddress) { -+ } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 @@ -1451,7 +1445,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..019b17f5 100644 +index 14665b1f..9a960dde 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,203 @@ import net.md_5.bungee.config.Configuration; @@ -1544,7 +1538,7 @@ index 14665b1f..019b17f5 100644 + @Getter + private int antibotReconnectAttempts = 2; + @Getter -+ private int antibotReconnectPings = 0; ++ private int antibotReconnectPings = 1; + @Getter + private int antibotReconnectMaxTime = 10000; + @Getter @@ -1669,7 +1663,7 @@ index 14665b1f..019b17f5 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae179438..35277c4c 100644 +index ae179438..276e57ac 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -80,6 +80,23 @@ public class MessagesConfiguration extends FlameConfig { @@ -1683,7 +1677,7 @@ index ae179438..35277c4c 100644 + setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n&cRefresh {1} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_proxy", "&c&lFlameCord\n\n&cYou are using a Proxy/VPN! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); @@ -1912,7 +1906,7 @@ index bf126c81..0a75abc3 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae..e76c0284 100644 +index d65884ae..dcace904 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1949,60 +1943,85 @@ index d65884ae..e76c0284 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -442,6 +458,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection - return; +@@ -434,6 +450,60 @@ public class InitialHandler extends PacketHandler implements PendingConnection + handshake.setHost( handshake.getHost().substring( 0, handshake.getHost().length() - 1 ) ); } + // FlameCord start - Antibot System -+ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( ch.getRemoteAddress() ); ++ SocketAddress remoteAddress = ch.getRemoteAddress(); ++ AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( remoteAddress ); + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); -+ // FlameCord end - Antibot System -+ - switch ( handshake.getRequestedProtocol() ) - { - case 1: -@@ -453,6 +474,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - thisState = State.STATUS; - ch.setProtocol( Protocol.STATUS ); + -+ // FlameCord start - Antibot System ++ // Switch protocol (ping/connect) ++ switch ( protocol ) ++ { ++ // Checks for when user pings ++ case 1: + addressData.addPing(); + -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) ++ if ( checkManager.getRatelimitCheck().check( remoteAddress, 2 ) ) + { + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); + return; + } -+ // FlameCord end - Antibot System ++ // Checks for when users connect ++ case 2: ++ // Set state and protocol to allow disconnect messages ++ thisState = State.USERNAME; ++ ch.setProtocol( Protocol.LOGIN ); + - break; - case 2: - // Login -@@ -464,6 +496,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection - thisState = State.USERNAME; - ch.setProtocol( Protocol.LOGIN ); - -+ // FlameCord start - Antibot System + addressData.addConnection(); + -+ if ( checkManager.getRatelimitCheck().check( ch.getRemoteAddress(), 2 ) ) ++ if ( checkManager.getRatelimitCheck().check( remoteAddress, 2 ) ) + { + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } + -+ if ( checkManager.getProxyCheck().check( ch.getRemoteAddress() ) ) ++ if ( checkManager.getProxyCheck().check( remoteAddress ) ) + { + disconnect( bungee.getTranslation( "antibot_proxy" ) ); + return; + } -+ // FlameCord end - Antibot System + ++ if ( checkManager.getReconnectCheck().check( remoteAddress ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_reconnect", Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ), Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectPings() - addressData.getTotalPings() ) ) ); ++ return; ++ } ++ ++ if ( checkManager.getCountryCheck().check( remoteAddress ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); ++ return; ++ } ++ // Invalid protocol ++ default: ++ break; ++ } ++ // FlameCord end - Antibot System ++ + this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); + + // FlameCord - Make PlayerHandshakeEvent cancellable +@@ -453,6 +523,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + } + thisState = State.STATUS; + ch.setProtocol( Protocol.STATUS ); ++ + break; + case 2: + // Login +@@ -461,8 +532,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection + { + bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + } +- thisState = State.USERNAME; +- ch.setProtocol( Protocol.LOGIN ); + if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) { - if ( handshake.getProtocolVersion() > bungee.getProtocolVersion() ) -@@ -527,6 +575,38 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +596,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -2024,18 +2043,6 @@ index d65884ae..e76c0284 100644 + disconnect( bungee.getTranslation( "antibot_nickname", loginRequest.getData() ) ); + return; + } -+ -+ if ( checkManager.getReconnectCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_reconnect", FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ) ); -+ return; -+ } -+ -+ if ( checkManager.getCountryCheck().check( ch.getRemoteAddress() ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); -+ return; -+ } + // FlameCord end - Antibot System + // If offline mode and they are already on, don't allow connect @@ -2156,20 +2163,21 @@ index 14e3004f..b61ed521 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 1a5a0e08..f32a3747 100644 +index 1a5a0e08..9266ba8f 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 -@@ -63,6 +63,20 @@ public class PipelineUtils +@@ -63,6 +63,21 @@ public class PipelineUtils { SocketAddress remoteAddress = ( ch.remoteAddress() == null ) ? ch.parent().localAddress() : ch.remoteAddress(); + // FlameCord start - Antibot System -+ String firewallReason = FlameCord.getInstance().getAddressDataManager().getAddressData(ch.remoteAddress()).getFirewallReason(); ++ dev._2lstudios.flamecord.FlameCord flameCord = FlameCord.getInstance(); ++ String firewallReason = flameCord.getAddressDataManager().getAddressData(remoteAddress).getFirewallReason(); + if ( firewallReason != null ) + { -+ if ( FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog() ) ++ if ( flameCord.getFlameCordConfiguration().isAntibotFirewallLog() ) + { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ ch.remoteAddress(), firewallReason } ); ++ flameCord.getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ remoteAddress, firewallReason } ); + } + + ch.close(); diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 48d518b0..238246a0 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From cf5b9b6fa8f63d3654b33f96c4c3fc0de585c570 Mon Sep 17 00:00:00 2001 +From ab4d88befa2661678ddcc9621526dcc301ab2133 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 019b17f5..4dd59b2b 100644 +index 9a960dde..1fca5008 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -30,10 +30,10 @@ index 019b17f5..4dd59b2b 100644 } } 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 e76c0284..bdef72db 100644 +index dcace904..2d9fbe50 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 -@@ -534,7 +534,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -555,7 +555,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index 8d603dc3..cb387b49 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From e00613f6a9cb19fbaddec2c4d51bd7feb6fcceea Mon Sep 17 00:00:00 2001 +From ecefb9401dba175d256ae1ee86021357ec1ae93b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 95f0e52c..d2406a7e 100644 +index 2d9fbe50..9647e02e 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 -@@ -839,7 +839,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -848,7 +848,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index c4d37d53..58c21cda 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From d6f0cb1c437b43d272932b3c2f457921d9282b4e Mon Sep 17 00:00:00 2001 +From 05e0808429bde877d7e6a3cf57dd7ba8e82965e1 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 cf390c5f..c96f9da8 100644 +index 9647e02e..8fd79a99 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,9 +64,9 @@ index cf390c5f..c96f9da8 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -485,6 +504,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - } - // FlameCord end - Antibot System +@@ -524,6 +543,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + thisState = State.STATUS; + ch.setProtocol( Protocol.STATUS ); + // FlameCord start - InitialHandler Processing State + processing = false; @@ -75,7 +75,7 @@ index cf390c5f..c96f9da8 100644 break; case 2: // Login -@@ -523,6 +546,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -544,6 +567,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index cf390c5f..c96f9da8 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -533,6 +561,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -554,6 +582,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index cf390c5f..c96f9da8 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -640,6 +672,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -649,6 +681,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index cf390c5f..c96f9da8 100644 } }; -@@ -653,6 +688,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -662,6 +697,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 773083fb..3a4327df 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From d62bc19cc15ac54fc3a5bd127b859f336cd50415 Mon Sep 17 00:00:00 2001 +From 55a67c9c3deef49ba2d9a3b2603f9161822cd74a Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 4dd59b2b..6f8f1505 100644 +index 1fca5008..cd30973f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -2451,10 +2451,10 @@ index b98ee6a7..ffe03816 100644 // Make the channel accessible public Channel getChannel() { 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 f32a3747..19f0f076 100644 +index 9266ba8f..00d3096a 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 -@@ -131,7 +131,7 @@ public class PipelineUtils +@@ -132,7 +132,7 @@ public class PipelineUtils public static final Base BASE = new Base( false ); public static final Base BASE_SERVERSIDE = new Base( true ); private static final KickStringWriter legacyKicker = new KickStringWriter(); diff --git a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch index 34d08a81..9104a954 100644 --- a/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch +++ b/Waterfall-Proxy-Patches/0043-Optimize-PipelineUtils.patch @@ -1,11 +1,11 @@ -From d3cfbc8aaa6a2d7080b45732ad6912595bc13f5f Mon Sep 17 00:00:00 2001 +From b867ce525077abf99f35c0d942d619c7ce8ef0d2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:35:42 -0300 Subject: [PATCH] Optimize PipelineUtils 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 19f0f076..f292db94 100644 +index 00d3096a..faccdc6c 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 @@ -6,11 +6,13 @@ import dev._2lstudios.flamecord.FlameCord; @@ -30,7 +30,7 @@ index 19f0f076..f292db94 100644 public static final AttributeKey LISTENER = AttributeKey.newInstance( "ListerInfo" ); public static final ChannelInitializer SERVER_CHILD = new ChannelInitializer() { -@@ -250,26 +251,30 @@ public class PipelineUtils +@@ -251,26 +252,30 @@ public class PipelineUtils @Override public void initChannel(Channel ch) throws Exception { From cbc1e1c36eccc2bb34b47a2e3557928d6b6cadcc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 3 May 2023 13:31:50 -0300 Subject: [PATCH 457/499] 1.4.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 230cc3f9..8b1f70df 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 2cbf811f1a1a4f1f93621747ff311a1a5398377f Mon Sep 17 00:00:00 2001 +From 41616c083f5b8a7c370de7314481c356458ccd89 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36..966d2442 100644 +index da0efa36f..966d2442b 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796..971f5b54 100644 +index 3e9be796f..250510ba5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,12 +27,12 @@ index 3e9be796..971f5b54 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.4"; ++ return "1.4.5"; } public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03..76f5fed7 100644 +index 820f7b03c..76f5fed75 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03..76f5fed7 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8..b2b19996 100644 +index 0c1ecfb8e..b2b199969 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler From b3a1cfecb855cd5bd5b6de9156879213e3df3924 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 4 May 2023 16:27:29 -0300 Subject: [PATCH 458/499] Fix issues with virtual hosts --- .../0028-Antibot-System.patch | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 8b10f38f..3a42f3a7 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,11 +1,11 @@ -From 21cc9400af684b1c25bb3bad6f555b195ae22e45 Mon Sep 17 00:00:00 2001 +From c6f61a7e7aa5adc540efdc481559b792017f5ac2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd900..95bdf348 100644 +index 20edd9001..95bdf348c 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,16 @@ @@ -26,7 +26,7 @@ index 20edd900..95bdf348 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..3824cc53 100644 +index 676ba95b9..3824cc533 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -187,7 +187,7 @@ index 676ba95b..3824cc53 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..0295ea89 +index 000000000..0295ea89d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,48 @@ @@ -241,7 +241,7 @@ index 00000000..0295ea89 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 00000000..7aa15796 +index 000000000..7aa157966 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,170 @@ @@ -417,7 +417,7 @@ index 00000000..7aa15796 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 00000000..007be392 +index 000000000..007be392c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,50 @@ @@ -473,7 +473,7 @@ index 00000000..007be392 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 00000000..0de7d709 +index 000000000..0de7d709f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java @@ -0,0 +1,48 @@ @@ -527,7 +527,7 @@ index 00000000..0de7d709 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 00000000..9f65a2b3 +index 000000000..9f65a2b34 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,150 @@ @@ -683,7 +683,7 @@ index 00000000..9f65a2b3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 00000000..e2140887 +index 000000000..e21408873 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,39 @@ @@ -728,7 +728,7 @@ index 00000000..e2140887 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 00000000..5ae7580e +index 000000000..5ae7580e8 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,32 @@ @@ -766,7 +766,7 @@ index 00000000..5ae7580e +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 00000000..1b35fba5 +index 000000000..1b35fba5d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,52 @@ @@ -824,7 +824,7 @@ index 00000000..1b35fba5 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 00000000..6249fe8e +index 000000000..6249fe8e0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java @@ -0,0 +1,63 @@ @@ -893,7 +893,7 @@ index 00000000..6249fe8e +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 00000000..7189a7f3 +index 000000000..7189a7f37 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java @@ -0,0 +1,115 @@ @@ -1014,7 +1014,7 @@ index 00000000..7189a7f3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 00000000..68555de3 +index 000000000..68555de34 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,69 @@ @@ -1089,7 +1089,7 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..09ac1145 +index 000000000..09ac1145c --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java @@ -0,0 +1,153 @@ @@ -1248,7 +1248,7 @@ index 00000000..09ac1145 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 00000000..51c1866e +index 000000000..51c1866ec --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,52 @@ @@ -1306,7 +1306,7 @@ index 00000000..51c1866e +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 00000000..d38ffc9e +index 000000000..d38ffc9e3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,53 @@ @@ -1365,7 +1365,7 @@ index 00000000..d38ffc9e +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 00000000..44d773ab +index 000000000..44d773abe --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java @@ -0,0 +1,75 @@ @@ -1445,7 +1445,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..9a960dde 100644 +index 14665b1f6..9a960dde6 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,203 @@ import net.md_5.bungee.config.Configuration; @@ -1663,7 +1663,7 @@ index 14665b1f..9a960dde 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae179438..276e57ac 100644 +index ae1794385..276e57ac8 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -80,6 +80,23 @@ public class MessagesConfiguration extends FlameConfig { @@ -1692,7 +1692,7 @@ index ae179438..276e57ac 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 00000000..285810ea +index 000000000..285810ea1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ @@ -1703,7 +1703,7 @@ index 00000000..285810ea +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 -index 00000000..c19c4965 +index 000000000..c19c4965d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java @@ -0,0 +1,5 @@ @@ -1714,7 +1714,7 @@ index 00000000..c19c4965 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 00000000..7f26e7a0 +index 000000000..7f26e7a0d --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1747,7 +1747,7 @@ index 00000000..7f26e7a0 +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f..aa538f74 100644 +index 6316143f7..aa538f748 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1790,7 +1790,7 @@ index 6316143f..aa538f74 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c433ac4a..4ee05067 100644 +index c433ac4ab..4ee05067a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -751,4 +751,8 @@ public enum Protocol @@ -1803,7 +1803,7 @@ index c433ac4a..4ee05067 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index 3a802ca4..c23e6856 100644 +index 3a802ca42..c23e68569 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1820,7 +1820,7 @@ index 3a802ca4..c23e6856 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee..173b47f3 100644 +index fb81adee0..173b47f33 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1890,7 +1890,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index bf126c81..0a75abc3 100644 +index 2848faf3a..b94444081 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1906,7 +1906,7 @@ index bf126c81..0a75abc3 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae..dcace904 100644 +index d65884ae3..141dadc5c 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1943,9 +1943,9 @@ index d65884ae..dcace904 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -434,6 +450,60 @@ public class InitialHandler extends PacketHandler implements PendingConnection - handshake.setHost( handshake.getHost().substring( 0, handshake.getHost().length() - 1 ) ); - } +@@ -436,6 +452,60 @@ public class InitialHandler extends PacketHandler implements PendingConnection + + this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); + // FlameCord start - Antibot System + SocketAddress remoteAddress = ch.getRemoteAddress(); @@ -2001,9 +2001,9 @@ index d65884ae..dcace904 100644 + } + // FlameCord end - Antibot System + - this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); - // FlameCord - Make PlayerHandshakeEvent cancellable + if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { + ch.close(); @@ -453,6 +523,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; @@ -2049,7 +2049,7 @@ index d65884ae..dcace904 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4..c16e28c8 100644 +index 66332af4e..c16e28c80 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,11 +4,15 @@ import com.google.common.base.Preconditions; @@ -2092,7 +2092,7 @@ index 66332af4..c16e28c8 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e..d853b404 100644 +index e2911d5e4..d853b4044 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,6 +8,8 @@ import io.netty.handler.codec.http.HttpResponse; @@ -2120,7 +2120,7 @@ index e2911d5e..d853b404 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b3fa4835..6f1d8336 100644 +index b3fa48355..6f1d8336d 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -154,4 +154,11 @@ public class ChannelWrapper @@ -2136,7 +2136,7 @@ index b3fa4835..6f1d8336 100644 + // FlameCord end - Antibot System } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004f..b61ed521 100644 +index 14e3004fc..b61ed5218 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,7 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -2163,7 +2163,7 @@ index 14e3004f..b61ed521 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 1a5a0e08..9266ba8f 100644 +index 1a5a0e080..9266ba8f6 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 @@ -63,6 +63,21 @@ public class PipelineUtils From 85c69aba3a3f080cc6f2b998a5ab396b97a52a44 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 4 May 2023 16:29:57 -0300 Subject: [PATCH 459/499] 1.4.6 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 8b1f70df..94d7ccf2 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 41616c083f5b8a7c370de7314481c356458ccd89 Mon Sep 17 00:00:00 2001 +From 02050967eae083fd07e35dffd428c2876ea819b2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..250510ba5 100644 +index 3e9be796f..e56989b09 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796f..250510ba5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.5"; ++ return "1.4.6"; } public final void reloadMessages() From 943e18df7a2b285071c32831317c76a14629a8fd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 4 May 2023 18:01:41 -0300 Subject: [PATCH 460/499] Enhanced list of proxies for better detection --- .../0028-Antibot-System.patch | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 3a42f3a7..b0120bcf 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From c6f61a7e7aa5adc540efdc481559b792017f5ac2 Mon Sep 17 00:00:00 2001 +From fb10293b3f8e8f6be3138619dc03780982954805 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1089,10 +1089,10 @@ index 000000000..68555de34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 000000000..09ac1145c +index 000000000..daa168592 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,153 @@ +@@ -0,0 +1,165 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1122,7 +1122,9 @@ index 000000000..09ac1145c + String[] websites = { + "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt", + "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", -+ "https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt" ++ "https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt", ++ "https://raw.githubusercontent.com/scriptzteam/ProtonVPN-VPN-IPs/main/exit_ips.txt", ++ "https://raw.githubusercontent.com/mmpx12/proxy-list/master/ips-list.txt" + }; + + // send updating proxies message @@ -1132,6 +1134,9 @@ index 000000000..09ac1145c + // create a string builder to store the content + StringBuilder content = new StringBuilder(); + ++ // create the proxy count ++ int proxyCount = 0; ++ + // loop through each website + for (String website : websites) { + try { @@ -1155,8 +1160,11 @@ index 000000000..09ac1145c + // read each line of the response and append it to the content + String inputLine; + while ((inputLine = in.readLine()) != null) { -+ content.append(inputLine); -+ content.append("\n"); ++ if (content.indexOf(inputLine) == -1) { ++ content.append(inputLine); ++ content.append("\n"); ++ proxyCount++; ++ } + } + + // close the buffered reader @@ -1171,6 +1179,10 @@ index 000000000..09ac1145c + } + } + ++ // send updated proxies message ++ FlameCord.getInstance().getLoggerWrapper().getLogger() ++ .info("Loaded a total of " + proxyCount + " proxies to the database!"); ++ + // set the updated proxy list + proxies = content.toString(); + } @@ -1890,7 +1902,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 2848faf3a..b94444081 100644 +index 8e413ec14..fc7b553c6 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer From 84339fef3e83087c7627a8ef91619e9d2bed1805 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 4 May 2023 18:47:08 -0300 Subject: [PATCH 461/499] 1.4.7 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 94d7ccf2..afc64c48 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 02050967eae083fd07e35dffd428c2876ea819b2 Mon Sep 17 00:00:00 2001 +From e8c6fb2d999b92e2ca32a4417d6102d2aafb46c5 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..e56989b09 100644 +index 3e9be796f..68308c23f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796f..e56989b09 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.6"; ++ return "1.4.7"; } public final void reloadMessages() From ff8ed07aee8986fd1bde91a24651109598106f0d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 4 May 2023 23:03:02 -0300 Subject: [PATCH 462/499] More proxy lists & Configurable lists --- .../0028-Antibot-System.patch | 84 ++++++++++++------- .../0029-Allow-Invalid-Names.patch | 10 +-- ...Dont-Process-Links-For-Kick-Messages.patch | 8 +- ...0039-InitialHandler-Processing-State.patch | 14 ++-- .../0040-Implement-libdeflate.patch | 54 ++++++------ 5 files changed, 97 insertions(+), 73 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index b0120bcf..e209276c 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From fb10293b3f8e8f6be3138619dc03780982954805 Mon Sep 17 00:00:00 2001 +From 5fc5717ee2680fb61726b2c64d9ae4731af09b2e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -473,10 +473,10 @@ index 000000000..007be392c +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 000000000..0de7d709f +index 000000000..94fc76136 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java -@@ -0,0 +1,48 @@ +@@ -0,0 +1,49 @@ +package dev._2lstudios.flamecord.antibot; + +import dev._2lstudios.flamecord.FlameCord; @@ -517,7 +517,8 @@ index 000000000..0de7d709f + this.countryCheck.load(); + + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotProxyEnabled()) { -+ this.proxyCheck.updateProxies(); ++ // run on a separated thread to avoid lock ++ new Thread(() -> this.proxyCheck.updateProxies()).start(); + } + } + @@ -1089,10 +1090,10 @@ index 000000000..68555de34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 000000000..daa168592 +index 000000000..b0c5eb2db --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,165 @@ +@@ -0,0 +1,171 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1100,6 +1101,7 @@ index 000000000..daa168592 +import java.net.HttpURLConnection; +import java.net.SocketAddress; +import java.net.URL; ++import java.util.Collection; +import java.util.logging.Level; + +import dev._2lstudios.flamecord.FlameCord; @@ -1119,17 +1121,11 @@ index 000000000..daa168592 + + public void updateProxies() { + // define the websites to get the proxies from -+ String[] websites = { -+ "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt", -+ "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", -+ "https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt", -+ "https://raw.githubusercontent.com/scriptzteam/ProtonVPN-VPN-IPs/main/exit_ips.txt", -+ "https://raw.githubusercontent.com/mmpx12/proxy-list/master/ips-list.txt" -+ }; ++ Collection lists = config.getAntibotProxyLists(); + + // send updating proxies message + FlameCord.getInstance().getLoggerWrapper().getLogger() -+ .info("Updating proxy database from " + websites.length + " websites..."); ++ .info("[FlameCord] Updating proxy database from " + lists.size() + " websites... (It can take a while!)"); + + // create a string builder to store the content + StringBuilder content = new StringBuilder(); @@ -1137,8 +1133,11 @@ index 000000000..daa168592 + // create the proxy count + int proxyCount = 0; + ++ // create the time took ++ long timeTook = System.currentTimeMillis(); ++ + // loop through each website -+ for (String website : websites) { ++ for (String website : lists) { + try { + // create a URL object with the website + URL url = new URL(website); @@ -1146,6 +1145,10 @@ index 000000000..daa168592 + // open a connection to the URL + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + ++ // set timeouts ++ con.setConnectTimeout (5000); ++ con.setReadTimeout (5000); ++ + // set the request method to GET + con.setRequestMethod("GET"); + @@ -1160,7 +1163,8 @@ index 000000000..daa168592 + // read each line of the response and append it to the content + String inputLine; + while ((inputLine = in.readLine()) != null) { -+ if (content.indexOf(inputLine) == -1) { ++ // check if not a comment and content does not contain the ip already ++ if (!inputLine.startsWith("#") && content.indexOf(inputLine) == -1) { + content.append(inputLine); + content.append("\n"); + proxyCount++; @@ -1179,9 +1183,12 @@ index 000000000..daa168592 + } + } + ++ // update time took ++ timeTook = (System.currentTimeMillis() - timeTook) / 1000; ++ + // send updated proxies message + FlameCord.getInstance().getLoggerWrapper().getLogger() -+ .info("Loaded a total of " + proxyCount + " proxies to the database!"); ++ .info("[FlameCord] Loaded a total of " + proxyCount + " proxies to the database! (Took " + timeTook + " seconds)"); + + // set the updated proxy list + proxies = content.toString(); @@ -1457,10 +1464,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f6..9a960dde6 100644 +index 14665b1f6..33d9d510e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,203 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,217 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1585,6 +1592,19 @@ index 14665b1f6..9a960dde6 100644 + private boolean antibotProxyFirewall = true; + @Getter + private String antibotProxyEmail = "flamecord@gmail.com"; ++ @Getter ++ private Collection antibotProxyLists = Arrays.asList( ++ "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt", ++ "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", ++ "https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt", ++ "https://raw.githubusercontent.com/scriptzteam/ProtonVPN-VPN-IPs/main/exit_ips.txt", ++ "https://raw.githubusercontent.com/mmpx12/proxy-list/master/ips-list.txt", ++ "https://check.torproject.org/torbulkexitlist?ip=1.1.1.1", ++ "https://cinsscore.com/list/ci-badguys.txt", ++ "https://lists.blocklist.de/lists/all.txt", ++ "https://blocklist.greensnow.co/greensnow.txt", ++ "https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/stopforumspam_7d.ipset" ++ ); + + public void loadAntibot(final Configuration config, final Collection whitelistedAddresses) { + // Antibot accounts @@ -1659,12 +1679,13 @@ index 14665b1f6..9a960dde6 100644 + this.antibotProxyLog = setIfUnexistant("antibot.proxy.log", this.antibotProxyLog, config); + this.antibotProxyFirewall = setIfUnexistant("antibot.proxy.firewall", this.antibotProxyFirewall, config); + this.antibotProxyEmail = setIfUnexistant("antibot.proxy.email", this.antibotProxyEmail, config); ++ this.antibotProxyLists = setIfUnexistant("antibot.proxy.lists", this.antibotProxyLists, config); + } + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +329,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +343,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); @@ -1902,7 +1923,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8e413ec14..fc7b553c6 100644 +index 08455799c..4e65ad531 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1918,7 +1939,7 @@ index 8e413ec14..fc7b553c6 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae3..141dadc5c 100644 +index d65884ae3..d7553b117 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1955,7 +1976,7 @@ index d65884ae3..141dadc5c 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -436,6 +452,60 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -436,6 +452,64 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -2011,12 +2032,16 @@ index d65884ae3..141dadc5c 100644 + default: + break; + } ++ ++ // Reset state for event ++ thisState = State.HANDSHAKE; ++ ch.setProtocol( Protocol.HANDSHAKE ); + // FlameCord end - Antibot System + // FlameCord - Make PlayerHandshakeEvent cancellable if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ch.close(); -@@ -453,6 +523,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +527,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -2024,16 +2049,15 @@ index d65884ae3..141dadc5c 100644 break; case 2: // Login -@@ -461,8 +532,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +536,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } -- thisState = State.USERNAME; -- ch.setProtocol( Protocol.LOGIN ); ++ + thisState = State.USERNAME; + ch.setProtocol( Protocol.LOGIN ); - if ( !ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) - { -@@ -527,6 +596,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +603,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 238246a0..65ec96cf 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From ab4d88befa2661678ddcc9621526dcc301ab2133 Mon Sep 17 00:00:00 2001 +From 5c2ab0b1151faf9cb5e13191d885c65d61427a30 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 9a960dde..1fca5008 100644 +index 33d9d510e..e07f7c8eb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 9a960dde..1fca5008 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -333,6 +337,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -347,6 +351,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); @@ -30,10 +30,10 @@ index 9a960dde..1fca5008 100644 } } 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 dcace904..2d9fbe50 100644 +index d7553b117..e17b3f983 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 -@@ -555,7 +555,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -562,7 +562,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index cb387b49..ccb0302f 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,11 +1,11 @@ -From ecefb9401dba175d256ae1ee86021357ec1ae93b Mon Sep 17 00:00:00 2001 +From a2a0cf9475ddfb35f816817a97c35da8f62e7d63 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a..2bb27e67 100644 +index 4371374a9..2bb27e670 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent @@ -117,10 +117,10 @@ index 4371374a..2bb27e67 100644 * The text of the component that will be displayed to the client */ 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 2d9fbe50..9647e02e 100644 +index e17b3f983..9ac0c3f19 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 -@@ -848,7 +848,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -855,7 +855,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index 58c21cda..4257bb40 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 05e0808429bde877d7e6a3cf57dd7ba8e82965e1 Mon Sep 17 00:00:00 2001 +From d27f6f537e912dd54ba291a2a398059107b551ce Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 9647e02e..8fd79a99 100644 +index 9ac0c3f19..9296e8871 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,7 +64,7 @@ index 9647e02e..8fd79a99 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -524,6 +543,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -528,6 +547,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -75,7 +75,7 @@ index 9647e02e..8fd79a99 100644 break; case 2: // Login -@@ -544,6 +567,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -551,6 +574,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index 9647e02e..8fd79a99 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -554,6 +582,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -561,6 +589,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index 9647e02e..8fd79a99 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -649,6 +681,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -656,6 +688,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index 9647e02e..8fd79a99 100644 } }; -@@ -662,6 +697,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -669,6 +704,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 3a4327df..d3d7b969 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 55a67c9c3deef49ba2d9a3b2603f9161822cd74a Mon Sep 17 00:00:00 2001 +From 2ec33cb3a0c709a2d78dfb4b089a12bf71fc6293 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 1fca5008..cd30973f 100644 +index e07f7c8eb..0e7a92930 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index 1fca5008..cd30973f 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -340,6 +342,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -354,6 +356,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); @@ -29,7 +29,7 @@ index 1fca5008..cd30973f 100644 } diff --git a/native/compile-linux.sh b/native/compile-linux.sh new file mode 100644 -index 00000000..5442dce9 +index 000000000..5442dce9d --- /dev/null +++ b/native/compile-linux.sh @@ -0,0 +1,25 @@ @@ -61,7 +61,7 @@ index 00000000..5442dce9 \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c new file mode 100644 -index 00000000..aa7d1aba +index 000000000..aa7d1aba3 --- /dev/null +++ b/native/src/main/c/jni_cipher_macos.c @@ -0,0 +1,66 @@ @@ -134,7 +134,7 @@ index 00000000..aa7d1aba \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c new file mode 100644 -index 00000000..83515be5 +index 000000000..83515be52 --- /dev/null +++ b/native/src/main/c/jni_cipher_openssl.c @@ -0,0 +1,62 @@ @@ -203,7 +203,7 @@ index 00000000..83515be5 \ No newline at end of file diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c new file mode 100644 -index 00000000..1e2b6bd8 +index 000000000..1e2b6bd8c --- /dev/null +++ b/native/src/main/c/jni_util.c @@ -0,0 +1,12 @@ @@ -222,7 +222,7 @@ index 00000000..1e2b6bd8 \ No newline at end of file diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h new file mode 100644 -index 00000000..8938b26c +index 000000000..8938b26c8 --- /dev/null +++ b/native/src/main/c/jni_util.h @@ -0,0 +1,4 @@ @@ -233,7 +233,7 @@ index 00000000..8938b26c \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c new file mode 100644 -index 00000000..809a7f85 +index 000000000..809a7f857 --- /dev/null +++ b/native/src/main/c/jni_zlib_deflate.c @@ -0,0 +1,43 @@ @@ -283,7 +283,7 @@ index 00000000..809a7f85 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c new file mode 100644 -index 00000000..d9131908 +index 000000000..d91319089 --- /dev/null +++ b/native/src/main/c/jni_zlib_inflate.c @@ -0,0 +1,61 @@ @@ -351,7 +351,7 @@ index 00000000..d9131908 \ No newline at end of file diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java new file mode 100644 -index 00000000..4ba41fc1 +index 000000000..4ba41fc11 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java @@ -0,0 +1,15 @@ @@ -372,7 +372,7 @@ index 00000000..4ba41fc1 +} diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java new file mode 100644 -index 00000000..81d92e75 +index 000000000..81d92e75b --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java @@ -0,0 +1,17 @@ @@ -395,7 +395,7 @@ index 00000000..81d92e75 +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java new file mode 100644 -index 00000000..a16a2584 +index 000000000..a16a25844 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java @@ -0,0 +1,28 @@ @@ -430,7 +430,7 @@ index 00000000..a16a2584 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java new file mode 100644 -index 00000000..50f042bd +index 000000000..50f042bdf --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java @@ -0,0 +1,36 @@ @@ -473,7 +473,7 @@ index 00000000..50f042bd \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java new file mode 100644 -index 00000000..a6709a86 +index 000000000..a6709a869 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java @@ -0,0 +1,138 @@ @@ -618,7 +618,7 @@ index 00000000..a6709a86 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java new file mode 100644 -index 00000000..f28ae314 +index 000000000..f28ae3145 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java @@ -0,0 +1,16 @@ @@ -641,7 +641,7 @@ index 00000000..f28ae314 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java new file mode 100644 -index 00000000..3aed690a +index 000000000..3aed690ad --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java @@ -0,0 +1,13 @@ @@ -661,7 +661,7 @@ index 00000000..3aed690a \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java new file mode 100644 -index 00000000..7d99eb02 +index 000000000..7d99eb02b --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java @@ -0,0 +1,90 @@ @@ -757,7 +757,7 @@ index 00000000..7d99eb02 +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java new file mode 100644 -index 00000000..fd9f9007 +index 000000000..fd9f9007d --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java @@ -0,0 +1,83 @@ @@ -2061,7 +2061,7 @@ literal 0 HcmV?d00001 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 -index f33ce913..01b208ed 100644 +index f33ce913a..01b208ed2 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -30,6 +30,22 @@ public abstract class DefinedPacket @@ -2101,7 +2101,7 @@ index f33ce913..01b208ed 100644 { int low = buf.readUnsignedShort(); diff --git a/proxy/pom.xml b/proxy/pom.xml -index 02625018..37abc9f7 100644 +index 026250189..37abc9f7d 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -158,6 +158,12 @@ @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index a59dfab3..be6a0d63 100644 +index c5cc2bbfc..8adebefde 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2155,7 +2155,7 @@ index a59dfab3..be6a0d63 100644 /** diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf462..10cb0430 100644 +index d07cf4627..10cb0430c 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java @@ -1,45 +1,74 @@ @@ -2257,7 +2257,7 @@ index d07cf462..10cb0430 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -index eaedf4bc..066bdafc 100644 +index eaedf4bc4..066bdafc8 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java @@ -1,5 +1,6 @@ @@ -2383,7 +2383,7 @@ index eaedf4bc..066bdafc 100644 +} \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab..95ed3441 100644 +index 8d4439ab8..95ed34416 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -44,8 +44,8 @@ public class ForgeUtils @@ -2398,7 +2398,7 @@ index 8d4439ab..95ed3441 100644 modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a7..ffe03816 100644 +index b98ee6a75..ffe038168 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2451,7 +2451,7 @@ index b98ee6a7..ffe03816 100644 // Make the channel accessible public Channel getChannel() { 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 9266ba8f..00d3096a 100644 +index 9266ba8f6..00d3096af 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 @@ -132,7 +132,7 @@ public class PipelineUtils From 5833a09093b6df1705834c0e12ffc1bbd406943a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 5 May 2023 08:27:43 -0300 Subject: [PATCH 463/499] 1.4.8 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index afc64c48..73a243e1 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From e8c6fb2d999b92e2ca32a4417d6102d2aafb46c5 Mon Sep 17 00:00:00 2001 +From b63a87deca42f4ca00baadf5614dd0e5d764dc12 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..68308c23f 100644 +index 3e9be796f..d8eac0fc5 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796f..68308c23f 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.7"; ++ return "1.4.8"; } public final void reloadMessages() From 3e7e8762e17884a00affed193f488ec1abbe5058 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 6 May 2023 11:34:51 -0300 Subject: [PATCH 464/499] Fix errors when pinging --- .../0028-Antibot-System.patch | 20 +++++++++++-------- .../0029-Allow-Invalid-Names.patch | 6 +++--- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +++--- ...0039-InitialHandler-Processing-State.patch | 14 ++++++------- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index e209276c..9cfb9dba 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 5fc5717ee2680fb61726b2c64d9ae4731af09b2e Mon Sep 17 00:00:00 2001 +From 1e81ce57660090fbe134ca152289ae54d0c3280d Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1923,7 +1923,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 08455799c..4e65ad531 100644 +index 8ea0ab4d2..2336159b7 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1939,7 +1939,7 @@ index 08455799c..4e65ad531 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae3..d7553b117 100644 +index d65884ae3..c2a4f1e0b 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1976,7 +1976,7 @@ index d65884ae3..d7553b117 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -436,6 +452,64 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -436,6 +452,68 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -1990,6 +1990,10 @@ index d65884ae3..d7553b117 100644 + { + // Checks for when user pings + case 1: ++ // Set state and protocol to prevent errors ++ thisState = State.STATUS; ++ ch.setProtocol( Protocol.STATUS ); ++ + addressData.addPing(); + + if ( checkManager.getRatelimitCheck().check( remoteAddress, 2 ) ) @@ -1999,7 +2003,7 @@ index d65884ae3..d7553b117 100644 + } + // Checks for when users connect + case 2: -+ // Set state and protocol to allow disconnect messages ++ // Set state and protocol to prevent errors + thisState = State.USERNAME; + ch.setProtocol( Protocol.LOGIN ); + @@ -2041,7 +2045,7 @@ index d65884ae3..d7553b117 100644 // FlameCord - Make PlayerHandshakeEvent cancellable if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ch.close(); -@@ -453,6 +527,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +531,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -2049,7 +2053,7 @@ index d65884ae3..d7553b117 100644 break; case 2: // Login -@@ -461,6 +536,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +540,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } @@ -2057,7 +2061,7 @@ index d65884ae3..d7553b117 100644 thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); -@@ -527,6 +603,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +607,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 65ec96cf..0b8ec8f2 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From 5c2ab0b1151faf9cb5e13191d885c65d61427a30 Mon Sep 17 00:00:00 2001 +From c149e303da4613b54f63742e2a894bcfa6584964 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -30,10 +30,10 @@ index 33d9d510e..e07f7c8eb 100644 } } 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 d7553b117..e17b3f983 100644 +index c2a4f1e0b..335fc08dd 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 -@@ -562,7 +562,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -566,7 +566,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index ccb0302f..5838d770 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From a2a0cf9475ddfb35f816817a97c35da8f62e7d63 Mon Sep 17 00:00:00 2001 +From a58b481a70ed2e8a5d876468999daf60b65e3837 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 e17b3f983..9ac0c3f19 100644 +index 335fc08dd..094151d4b 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 -@@ -855,7 +855,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -859,7 +859,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index 4257bb40..da2b9406 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From d27f6f537e912dd54ba291a2a398059107b551ce Mon Sep 17 00:00:00 2001 +From 5b3e8c7bcad9866a3e91bb7d369cbf190f57e45f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 9ac0c3f19..9296e8871 100644 +index 094151d4b..06eb1f925 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,7 +64,7 @@ index 9ac0c3f19..9296e8871 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -528,6 +547,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -532,6 +551,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -75,7 +75,7 @@ index 9ac0c3f19..9296e8871 100644 break; case 2: // Login -@@ -551,6 +574,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -555,6 +578,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index 9ac0c3f19..9296e8871 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -561,6 +589,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -565,6 +593,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index 9ac0c3f19..9296e8871 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -656,6 +688,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -660,6 +692,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index 9ac0c3f19..9296e8871 100644 } }; -@@ -669,6 +704,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -673,6 +708,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) From c8252af32274ce882ac8537488a8eef64211603b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 6 May 2023 11:39:19 -0300 Subject: [PATCH 465/499] 1.4.9 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 73a243e1..08004495 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From b63a87deca42f4ca00baadf5614dd0e5d764dc12 Mon Sep 17 00:00:00 2001 +From a8f39e1303d06cce7c8b83aa84dd337626088bfd Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..d8eac0fc5 100644 +index 3e9be796f..8e15dd9c2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796f..d8eac0fc5 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.8"; ++ return "1.4.9"; } public final void reloadMessages() From e9aad1801663213ca5b23d31af646865dadde041 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Mon, 8 May 2023 11:22:39 -0400 Subject: [PATCH 466/499] sus --- README.md | 67 ++++++++++++++++++++++++++++++------------------------- pom.xml | 26 +++++++++++++++++++++ 2 files changed, 63 insertions(+), 30 deletions(-) create mode 100644 pom.xml diff --git a/README.md b/README.md index e70e0ee1..0c576e7b 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,56 @@ -# FlameCord - - - - - - - - - + -FlameCord is a fork of BungeeCord and Waterfall that protects your Minecraft or Spigot server from bot attacks and exploits with its advanced set of antibot filtering features. FlameCord also fixes bugs, improves performance and adds new functionalities to your server. FlameCord is the ultimate solution for a secure and fast Minecraft network.🔥 +A modified version of Flamecord and Waterfall that fixes netty exploits, improves performance, keeps your console clean & supports latest versions. -## ⭐ Features +## Links +Free download MangoCord: +https://github.com/LuciaNishimiya/MangoCord/releases +
+Discord Mango Studio: +https://discord.gg/PeS8h8eJZJ -FlameCord being a fork of Waterfall, has all its features, and some of its own, such as: +## Feactures +* Our features are focused on the security of your Minecraft server preventing hacking with crash exploits, bots and other kind of dos attacks on the application layer. -* **Exploit Fixes**: FlameCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in Waterfall. - -* **Antibot Features**: FlameCord brings swift bot protection for your Minecraft server to avoid extra CPU usage and crashes in your machines. +* **Bots**: We prevent bots using multiple security checks to minimize the damage. -* **Performance Improvements**: FlameCord tries to improve performance by removing unused features and disabling exception logs. +* **Anti-vpn/proxy**: VPN detection check. -## 💻 Why fork Waterfall? +* **Performance**: We reduce the amount of processing done to improve the speed of our servers. -FlameCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. +* **GeyserMC compatibility**: Set the GeyserMC configuration option “disable-compression” to false to fix compatibility with MangoCord. -FlameCord will track upstream Waterfall and merge changes as needed. +* **Motd**: Incorporates customizable an advanced motd system that protects against null pink attacks -## 🌱 Get Started +* **Languages Supported**: Fully configurable in messages.yml!!. -Just drag an drop FlameCord.jar into your server folder and run it. +* **Exploit Fixes**: MangoCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. -You can customize many FlameCord features in the flamecord.yml file. - +MangoCord is a FlameCord and Waterfall fork that protects your server from bot attacks and exploits done to your Minecraft Server by minimizing the impact received by those with our advanced set of antibot filtering features. MangoCord improves your server performance and reduces your CPU usage by cutting the amount of processes required to process packets. MangoCord has free official and community support on our Discord server. https://discord.gg/PeS8h8eJZJ . Visit our detailed guide to MangoCord configuration to know more about it's features and how to configure them. -## 🤝 Contributing -Contributions, issues and feature requests are welcome! -Feel free to check [issues page](https://github.com/2lstudios-mc/flamecord). +## Why fork Waterfall? + +MangoCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. + +MangoCord will track upstream Waterfall and merge changes as needed. + +## How to (Server Admins) + +Just drag an drop MangoCord .jar into your server folder and run it. + +You can customize many MangoCord features in the flamecord.yml file. + +## How To (Compiling from source) + +To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet connection. + +Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. -## 📝 License +## Contribute -Copyright © 2018-2023 [2LStudios](https://github.com/2lstudios-mc). -This project is [MIT License](LICENSE.txt) licensed. +* Feel free to open a PR! We accept contributions. diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..7c5aaff0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + + io.github.waterfallmc + waterfall-super + dev-SNAPSHOT + pom + + Waterfall-Super + Super project for MangoCord. + https://github.com/LuciaNishimiya/AkarinProxy + + + FlameCord-Proxy + + + + clean install + + + + UTF-8 + + + From c4bf8e8ac3c6acb6fb1eef6481da64a8f87d2aaf Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 18 May 2023 12:46:02 -0300 Subject: [PATCH 467/499] Only process early for connections, not pings --- .../0028-Antibot-System.patch | 98 +++++++++---------- .../0029-Allow-Invalid-Names.patch | 6 +- ...Dont-Process-Links-For-Kick-Messages.patch | 6 +- ...0039-InitialHandler-Processing-State.patch | 24 ++--- 4 files changed, 62 insertions(+), 72 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 9cfb9dba..53fc54f7 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 1e81ce57660090fbe134ca152289ae54d0c3280d Mon Sep 17 00:00:00 2001 +From 48b762798ac5158ece250a198dde624c3edbee0e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1923,7 +1923,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 8ea0ab4d2..2336159b7 100644 +index c20a6c9c4..5a3562fcc 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1939,7 +1939,7 @@ index 8ea0ab4d2..2336159b7 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae3..c2a4f1e0b 100644 +index d65884ae3..04744574f 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1976,7 +1976,7 @@ index d65884ae3..c2a4f1e0b 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -436,6 +452,68 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -436,6 +452,48 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -1985,56 +1985,36 @@ index d65884ae3..c2a4f1e0b 100644 + AddressData addressData = FlameCord.getInstance().getAddressDataManager().getAddressData( remoteAddress ); + CheckManager checkManager = FlameCord.getInstance().getCheckManager(); + -+ // Switch protocol (ping/connect) -+ switch ( protocol ) -+ { -+ // Checks for when user pings -+ case 1: -+ // Set state and protocol to prevent errors -+ thisState = State.STATUS; -+ ch.setProtocol( Protocol.STATUS ); -+ -+ addressData.addPing(); ++ if (protocol == 2) { ++ // Set state and protocol to prevent errors ++ thisState = State.USERNAME; ++ ch.setProtocol( Protocol.LOGIN ); + -+ if ( checkManager.getRatelimitCheck().check( remoteAddress, 2 ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getPingsSecond() ) ); -+ return; -+ } -+ // Checks for when users connect -+ case 2: -+ // Set state and protocol to prevent errors -+ thisState = State.USERNAME; -+ ch.setProtocol( Protocol.LOGIN ); ++ addressData.addConnection(); + -+ addressData.addConnection(); -+ -+ if ( checkManager.getRatelimitCheck().check( remoteAddress, 2 ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); -+ return; -+ } -+ -+ if ( checkManager.getProxyCheck().check( remoteAddress ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_proxy" ) ); -+ return; -+ } ++ if ( checkManager.getRatelimitCheck().check( remoteAddress, protocol ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); ++ return; ++ } ++ ++ if ( checkManager.getProxyCheck().check( remoteAddress ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_proxy" ) ); ++ return; ++ } + -+ if ( checkManager.getReconnectCheck().check( remoteAddress ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_reconnect", Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ), Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectPings() - addressData.getTotalPings() ) ) ); -+ return; -+ } -+ -+ if ( checkManager.getCountryCheck().check( remoteAddress ) ) -+ { -+ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); -+ return; -+ } -+ // Invalid protocol -+ default: -+ break; ++ if ( checkManager.getReconnectCheck().check( remoteAddress ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_reconnect", Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ), Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectPings() - addressData.getTotalPings() ) ) ); ++ return; ++ } ++ ++ if ( checkManager.getCountryCheck().check( remoteAddress ) ) ++ { ++ disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); ++ return; ++ } + } + + // Reset state for event @@ -2045,15 +2025,25 @@ index d65884ae3..c2a4f1e0b 100644 // FlameCord - Make PlayerHandshakeEvent cancellable if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ch.close(); -@@ -453,6 +531,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -453,6 +511,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); ++ ++ // FlameCord start - Antibot System ++ addressData.addPing(); ++ ++ if ( checkManager.getRatelimitCheck().check( remoteAddress, protocol ) ) ++ { ++ ch.close(); ++ return; ++ } ++ // FlameCord end - Antibot System + break; case 2: // Login -@@ -461,6 +540,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -461,6 +530,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } @@ -2061,7 +2051,7 @@ index d65884ae3..c2a4f1e0b 100644 thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); -@@ -527,6 +607,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -527,6 +597,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 0b8ec8f2..9ca3373a 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,4 +1,4 @@ -From c149e303da4613b54f63742e2a894bcfa6584964 Mon Sep 17 00:00:00 2001 +From aecfd85c3784db7294123feafafb35a4ddbed52c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names @@ -30,10 +30,10 @@ index 33d9d510e..e07f7c8eb 100644 } } 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 c2a4f1e0b..335fc08dd 100644 +index 04744574f..9ad5f5205 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 -@@ -566,7 +566,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -556,7 +556,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index 5838d770..1f74e30b 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,4 +1,4 @@ -From a58b481a70ed2e8a5d876468999daf60b65e3837 Mon Sep 17 00:00:00 2001 +From e74e3f56e2fdf688c56eab9f29ee8878a021d118 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages @@ -117,10 +117,10 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 335fc08dd..094151d4b 100644 +index 9ad5f5205..d237a711d 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 -@@ -859,7 +859,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -849,7 +849,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index da2b9406..976eae8f 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From 5b3e8c7bcad9866a3e91bb7d369cbf190f57e45f Mon Sep 17 00:00:00 2001 +From e6eb41f0e91bc6eb3b8f894530a0481dd8c2d7aa Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 094151d4b..06eb1f925 100644 +index d237a711d..bb397a22c 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -64,18 +64,18 @@ index 094151d4b..06eb1f925 100644 // FlameCord start - Antibot System // Close and firewall on invalid protocol int protocol = handshake.getRequestedProtocol(); -@@ -532,6 +551,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection - thisState = State.STATUS; - ch.setProtocol( Protocol.STATUS ); - +@@ -521,6 +540,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection + return; + } + // FlameCord end - Antibot System ++ + // FlameCord start - InitialHandler Processing State + processing = false; + // FlameCord end - InitialHandler Processing State -+ + break; case 2: - // Login -@@ -555,6 +578,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -545,6 +568,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +87,7 @@ index 094151d4b..06eb1f925 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -565,6 +593,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -555,6 +583,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +98,7 @@ index 094151d4b..06eb1f925 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -660,6 +692,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -650,6 +682,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +108,7 @@ index 094151d4b..06eb1f925 100644 } }; -@@ -673,6 +708,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -663,6 +698,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) From ef4a939cf96bf238f19ba45d7fee35ad500c4a1c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 18 May 2023 12:49:51 -0300 Subject: [PATCH 468/499] 1.5.0 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 08004495..4f72af68 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From a8f39e1303d06cce7c8b83aa84dd337626088bfd Mon Sep 17 00:00:00 2001 +From 2c0eaf43f5e991b63cac2bbafea89d938f73cd2e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..8e15dd9c2 100644 +index 3e9be796f..9529d1d0a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796f..8e15dd9c2 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.4.9"; ++ return "1.5.0"; } public final void reloadMessages() From e6b63ab6657ac59c3f178486ab8ad25088ad82cc Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 23 May 2023 18:08:58 -0300 Subject: [PATCH 469/499] Don't do online proxy checks by default --- .../0028-Antibot-System.patch | 80 ++++++++++--------- .../0029-Allow-Invalid-Names.patch | 8 +- .../0040-Implement-libdeflate.patch | 54 ++++++------- 3 files changed, 74 insertions(+), 68 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 53fc54f7..7e48d9ae 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,11 +1,11 @@ -From 48b762798ac5158ece250a198dde624c3edbee0e Mon Sep 17 00:00:00 2001 +From 3c1c6b50d0d78a409332452b39390ce5ed3ce871 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System diff --git a/flamecord/pom.xml b/flamecord/pom.xml -index 20edd9001..95bdf348c 100644 +index 20edd900..95bdf348 100644 --- a/flamecord/pom.xml +++ b/flamecord/pom.xml @@ -30,6 +30,16 @@ @@ -26,7 +26,7 @@ index 20edd9001..95bdf348c 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b9..3824cc533 100644 +index 676ba95b..3824cc53 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -187,7 +187,7 @@ index 676ba95b9..3824cc533 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 000000000..0295ea89d +index 00000000..0295ea89 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,48 @@ @@ -241,7 +241,7 @@ index 000000000..0295ea89d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java new file mode 100644 -index 000000000..7aa157966 +index 00000000..7aa15796 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressData.java @@ -0,0 +1,170 @@ @@ -417,7 +417,7 @@ index 000000000..7aa157966 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java new file mode 100644 -index 000000000..007be392c +index 00000000..007be392 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AddressDataManager.java @@ -0,0 +1,50 @@ @@ -473,7 +473,7 @@ index 000000000..007be392c +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java new file mode 100644 -index 000000000..94fc76136 +index 00000000..94fc7613 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CheckManager.java @@ -0,0 +1,49 @@ @@ -528,7 +528,7 @@ index 000000000..94fc76136 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java new file mode 100644 -index 000000000..9f65a2b34 +index 00000000..9f65a2b3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/CountryCheck.java @@ -0,0 +1,150 @@ @@ -684,7 +684,7 @@ index 000000000..9f65a2b34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java new file mode 100644 -index 000000000..e21408873 +index 00000000..e2140887 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/FastChatCheck.java @@ -0,0 +1,39 @@ @@ -729,7 +729,7 @@ index 000000000..e21408873 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java new file mode 100644 -index 000000000..5ae7580e8 +index 00000000..5ae7580e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/LoggerWrapper.java @@ -0,0 +1,32 @@ @@ -767,7 +767,7 @@ index 000000000..5ae7580e8 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java new file mode 100644 -index 000000000..1b35fba5d +index 00000000..1b35fba5 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/NicknameCheck.java @@ -0,0 +1,52 @@ @@ -825,7 +825,7 @@ index 000000000..1b35fba5d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java new file mode 100644 -index 000000000..6249fe8e0 +index 00000000..6249fe8e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsCheck.java @@ -0,0 +1,63 @@ @@ -894,7 +894,7 @@ index 000000000..6249fe8e0 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java new file mode 100644 -index 000000000..7189a7f37 +index 00000000..7189a7f3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PacketsData.java @@ -0,0 +1,115 @@ @@ -1015,7 +1015,7 @@ index 000000000..7189a7f37 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java new file mode 100644 -index 000000000..68555de34 +index 00000000..68555de3 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/PasswordCheck.java @@ -0,0 +1,69 @@ @@ -1090,10 +1090,10 @@ index 000000000..68555de34 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 000000000..b0c5eb2db +index 00000000..77e8004e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,171 @@ +@@ -0,0 +1,174 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1223,6 +1223,9 @@ index 000000000..b0c5eb2db + + // Method to check if an IP address is a VPN using getipintel API + public boolean isVPN(String ip) { ++ if (!config.isAntibotProxyOnlineCheck()) ++ return false; ++ + try { + // Create a URL object with the API endpoint and the IP parameter + URL url = new URL("https://check.getipintel.net/check.php?ip=" + ip + "&contact=" + FlameCord.getInstance().getFlameCordConfiguration().getAntibotProxyEmail()); @@ -1267,7 +1270,7 @@ index 000000000..b0c5eb2db +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java new file mode 100644 -index 000000000..51c1866ec +index 00000000..51c1866e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/RatelimitCheck.java @@ -0,0 +1,52 @@ @@ -1325,7 +1328,7 @@ index 000000000..51c1866ec +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java new file mode 100644 -index 000000000..d38ffc9e3 +index 00000000..d38ffc9e --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ReconnectCheck.java @@ -0,0 +1,53 @@ @@ -1384,7 +1387,7 @@ index 000000000..d38ffc9e3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java new file mode 100644 -index 000000000..44d773abe +index 00000000..44d773ab --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/StatsData.java @@ -0,0 +1,75 @@ @@ -1464,10 +1467,10 @@ index 000000000..44d773abe + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f6..33d9d510e 100644 +index 14665b1f..c59227cb 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,217 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,220 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1591,6 +1594,8 @@ index 14665b1f6..33d9d510e 100644 + @Getter + private boolean antibotProxyFirewall = true; + @Getter ++ private boolean antibotProxyOnlineCheck = false; ++ @Getter + private String antibotProxyEmail = "flamecord@gmail.com"; + @Getter + private Collection antibotProxyLists = Arrays.asList( @@ -1678,6 +1683,7 @@ index 14665b1f6..33d9d510e 100644 + this.antibotProxyEnabled = setIfUnexistant("antibot.proxy.enabled", this.antibotProxyEnabled, config); + this.antibotProxyLog = setIfUnexistant("antibot.proxy.log", this.antibotProxyLog, config); + this.antibotProxyFirewall = setIfUnexistant("antibot.proxy.firewall", this.antibotProxyFirewall, config); ++ this.antibotProxyOnlineCheck = setIfUnexistant("antibot.proxy.online-check", this.antibotProxyOnlineCheck, config); + this.antibotProxyEmail = setIfUnexistant("antibot.proxy.email", this.antibotProxyEmail, config); + this.antibotProxyLists = setIfUnexistant("antibot.proxy.lists", this.antibotProxyLists, config); + } @@ -1685,7 +1691,7 @@ index 14665b1f6..33d9d510e 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +343,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +346,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); @@ -1696,7 +1702,7 @@ index 14665b1f6..33d9d510e 100644 save(configuration, configurationFile); } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae1794385..276e57ac8 100644 +index ae179438..276e57ac 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -80,6 +80,23 @@ public class MessagesConfiguration extends FlameConfig { @@ -1725,7 +1731,7 @@ index ae1794385..276e57ac8 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java new file mode 100644 -index 000000000..285810ea1 +index 00000000..285810ea --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsCheckResult.java @@ -0,0 +1,5 @@ @@ -1736,7 +1742,7 @@ index 000000000..285810ea1 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java new file mode 100644 -index 000000000..c19c4965d +index 00000000..c19c4965 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/enums/PacketsViolationReason.java @@ -0,0 +1,5 @@ @@ -1747,7 +1753,7 @@ index 000000000..c19c4965d +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 000000000..7f26e7a0d +index 00000000..7f26e7a0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1780,7 +1786,7 @@ index 000000000..7f26e7a0d +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f7..aa538f748 100644 +index 6316143f..aa538f74 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder @@ -1823,7 +1829,7 @@ index 6316143f7..aa538f748 100644 if (in.readableBytes() == 0 && !server) { return; 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 -index c433ac4ab..4ee05067a 100644 +index c433ac4a..4ee05067 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -751,4 +751,8 @@ public enum Protocol @@ -1836,7 +1842,7 @@ index c433ac4ab..4ee05067a 100644 + } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java -index 3a802ca42..c23e68569 100644 +index 3a802ca4..c23e6856 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -5,11 +5,11 @@ import io.netty.buffer.Unpooled; @@ -1853,7 +1859,7 @@ index 3a802ca42..c23e68569 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee0..173b47f33 100644 +index fb81adee..173b47f3 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1923,7 +1929,7 @@ index fb81adee0..173b47f33 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c20a6c9c4..5a3562fcc 100644 +index bc3fd9eb..fabdb256 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1939,7 +1945,7 @@ index c20a6c9c4..5a3562fcc 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae3..04744574f 100644 +index d65884ae..04744574 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -2079,7 +2085,7 @@ index d65884ae3..04744574f 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4e..c16e28c80 100644 +index 66332af4..c16e28c8 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,11 +4,15 @@ import com.google.common.base.Preconditions; @@ -2122,7 +2128,7 @@ index 66332af4e..c16e28c80 100644 if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { diff --git a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java -index e2911d5e4..d853b4044 100644 +index e2911d5e..d853b404 100644 --- a/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/http/HttpHandler.java @@ -8,6 +8,8 @@ import io.netty.handler.codec.http.HttpResponse; @@ -2150,7 +2156,7 @@ index e2911d5e4..d853b4044 100644 { callback.done( null, cause ); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b3fa48355..6f1d8336d 100644 +index b3fa4835..6f1d8336 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -154,4 +154,11 @@ public class ChannelWrapper @@ -2166,7 +2172,7 @@ index b3fa48355..6f1d8336d 100644 + // FlameCord end - Antibot System } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 14e3004fc..b61ed5218 100644 +index 14e3004f..b61ed521 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -12,6 +12,7 @@ import io.netty.handler.timeout.ReadTimeoutException; @@ -2193,7 +2199,7 @@ index 14e3004fc..b61ed5218 100644 { boolean logExceptions = !( handler instanceof PingHandler ); 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 1a5a0e080..9266ba8f6 100644 +index 1a5a0e08..9266ba8f 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 @@ -63,6 +63,21 @@ public class PipelineUtils diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 9ca3373a..1a2a7784 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From aecfd85c3784db7294123feafafb35a4ddbed52c Mon Sep 17 00:00:00 2001 +From 542d393202ea9de9b5cafbf4acf34c49ca320b05 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 33d9d510e..e07f7c8eb 100644 +index c59227cb..ad1bcf44 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index 33d9d510e..e07f7c8eb 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -347,6 +351,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -350,6 +354,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); @@ -30,7 +30,7 @@ index 33d9d510e..e07f7c8eb 100644 } } 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 04744574f..9ad5f5205 100644 +index 04744574..9ad5f520 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 @@ -556,7 +556,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index d3d7b969..8727bfea 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 2ec33cb3a0c709a2d78dfb4b089a12bf71fc6293 Mon Sep 17 00:00:00 2001 +From 3239b8b4f31f0dab4647c938a32a9cf07a68c375 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index e07f7c8eb..0e7a92930 100644 +index ad1bcf44..70a783f9 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index e07f7c8eb..0e7a92930 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -354,6 +356,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -357,6 +359,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); @@ -29,7 +29,7 @@ index e07f7c8eb..0e7a92930 100644 } diff --git a/native/compile-linux.sh b/native/compile-linux.sh new file mode 100644 -index 000000000..5442dce9d +index 00000000..5442dce9 --- /dev/null +++ b/native/compile-linux.sh @@ -0,0 +1,25 @@ @@ -61,7 +61,7 @@ index 000000000..5442dce9d \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_macos.c b/native/src/main/c/jni_cipher_macos.c new file mode 100644 -index 000000000..aa7d1aba3 +index 00000000..aa7d1aba --- /dev/null +++ b/native/src/main/c/jni_cipher_macos.c @@ -0,0 +1,66 @@ @@ -134,7 +134,7 @@ index 000000000..aa7d1aba3 \ No newline at end of file diff --git a/native/src/main/c/jni_cipher_openssl.c b/native/src/main/c/jni_cipher_openssl.c new file mode 100644 -index 000000000..83515be52 +index 00000000..83515be5 --- /dev/null +++ b/native/src/main/c/jni_cipher_openssl.c @@ -0,0 +1,62 @@ @@ -203,7 +203,7 @@ index 000000000..83515be52 \ No newline at end of file diff --git a/native/src/main/c/jni_util.c b/native/src/main/c/jni_util.c new file mode 100644 -index 000000000..1e2b6bd8c +index 00000000..1e2b6bd8 --- /dev/null +++ b/native/src/main/c/jni_util.c @@ -0,0 +1,12 @@ @@ -222,7 +222,7 @@ index 000000000..1e2b6bd8c \ No newline at end of file diff --git a/native/src/main/c/jni_util.h b/native/src/main/c/jni_util.h new file mode 100644 -index 000000000..8938b26c8 +index 00000000..8938b26c --- /dev/null +++ b/native/src/main/c/jni_util.h @@ -0,0 +1,4 @@ @@ -233,7 +233,7 @@ index 000000000..8938b26c8 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_deflate.c b/native/src/main/c/jni_zlib_deflate.c new file mode 100644 -index 000000000..809a7f857 +index 00000000..809a7f85 --- /dev/null +++ b/native/src/main/c/jni_zlib_deflate.c @@ -0,0 +1,43 @@ @@ -283,7 +283,7 @@ index 000000000..809a7f857 \ No newline at end of file diff --git a/native/src/main/c/jni_zlib_inflate.c b/native/src/main/c/jni_zlib_inflate.c new file mode 100644 -index 000000000..d91319089 +index 00000000..d9131908 --- /dev/null +++ b/native/src/main/c/jni_zlib_inflate.c @@ -0,0 +1,61 @@ @@ -351,7 +351,7 @@ index 000000000..d91319089 \ No newline at end of file diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java new file mode 100644 -index 000000000..4ba41fc11 +index 00000000..4ba41fc1 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibDeflate.java @@ -0,0 +1,15 @@ @@ -372,7 +372,7 @@ index 000000000..4ba41fc11 +} diff --git a/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java new file mode 100644 -index 000000000..81d92e75b +index 00000000..81d92e75 --- /dev/null +++ b/native/src/main/java/com/velocitypowered/natives/compression/NativeZlibInflate.java @@ -0,0 +1,17 @@ @@ -395,7 +395,7 @@ index 000000000..81d92e75b +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java new file mode 100644 -index 000000000..a16a25844 +index 00000000..a16a2584 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/MoreByteBufUtils.java @@ -0,0 +1,28 @@ @@ -430,7 +430,7 @@ index 000000000..a16a25844 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java new file mode 100644 -index 000000000..50f042bdf +index 00000000..50f042bd --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/NativeEnvironmentDetector.java @@ -0,0 +1,36 @@ @@ -473,7 +473,7 @@ index 000000000..50f042bdf \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java new file mode 100644 -index 000000000..a6709a869 +index 00000000..a6709a86 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/Natives.java @@ -0,0 +1,138 @@ @@ -618,7 +618,7 @@ index 000000000..a6709a869 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java new file mode 100644 -index 000000000..f28ae3145 +index 00000000..f28ae314 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/Compressor.java @@ -0,0 +1,16 @@ @@ -641,7 +641,7 @@ index 000000000..f28ae3145 \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java new file mode 100644 -index 000000000..3aed690ad +index 00000000..3aed690a --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/CompressorFactory.java @@ -0,0 +1,13 @@ @@ -661,7 +661,7 @@ index 000000000..3aed690ad \ No newline at end of file diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java new file mode 100644 -index 000000000..7d99eb02b +index 00000000..7d99eb02 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/JavaCompressor.java @@ -0,0 +1,90 @@ @@ -757,7 +757,7 @@ index 000000000..7d99eb02b +} diff --git a/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java new file mode 100644 -index 000000000..fd9f9007d +index 00000000..fd9f9007 --- /dev/null +++ b/native/src/main/java/dev/_2lstudios/flamecord/natives/compress/LibdeflateCompressor.java @@ -0,0 +1,83 @@ @@ -2061,7 +2061,7 @@ literal 0 HcmV?d00001 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 -index f33ce913a..01b208ed2 100644 +index f33ce913..01b208ed 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -30,6 +30,22 @@ public abstract class DefinedPacket @@ -2101,7 +2101,7 @@ index f33ce913a..01b208ed2 100644 { int low = buf.readUnsignedShort(); diff --git a/proxy/pom.xml b/proxy/pom.xml -index 026250189..37abc9f7d 100644 +index 02625018..37abc9f7 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -158,6 +158,12 @@ @@ -2118,7 +2118,7 @@ index 026250189..37abc9f7d 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c5cc2bbfc..8adebefde 100644 +index 4e97d485..153ec3a9 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2155,7 +2155,7 @@ index c5cc2bbfc..8adebefde 100644 /** diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java -index d07cf4627..10cb0430c 100644 +index d07cf462..10cb0430 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketCompressor.java @@ -1,45 +1,74 @@ @@ -2257,7 +2257,7 @@ index d07cf4627..10cb0430c 100644 + } } diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java -index eaedf4bc4..066bdafc8 100644 +index eaedf4bc..066bdafc 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java @@ -1,5 +1,6 @@ @@ -2383,7 +2383,7 @@ index eaedf4bc4..066bdafc8 100644 +} \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index 8d4439ab8..95ed34416 100644 +index 8d4439ab..95ed3441 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -44,8 +44,8 @@ public class ForgeUtils @@ -2398,7 +2398,7 @@ index 8d4439ab8..95ed34416 100644 modTags.put( DefinedPacket.readString( buffer ), DefinedPacket.readString( buffer ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java -index b98ee6a75..ffe038168 100644 +index b98ee6a7..ffe03816 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -1,6 +1,10 @@ @@ -2451,7 +2451,7 @@ index b98ee6a75..ffe038168 100644 // Make the channel accessible public Channel getChannel() { 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 9266ba8f6..00d3096af 100644 +index 9266ba8f..00d3096a 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 @@ -132,7 +132,7 @@ public class PipelineUtils From 6e96f0be14d3fbdef5bf916ca3b434eb70f7ab0f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 23 May 2023 18:09:24 -0300 Subject: [PATCH 470/499] 1.5.1 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 4f72af68..719b979c 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,11 +1,11 @@ -From 2c0eaf43f5e991b63cac2bbafea89d938f73cd2e Mon Sep 17 00:00:00 2001 +From 52e4ef0367b9518b59667c87762cf14ac098eaea Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java -index da0efa36f..966d2442b 100644 +index da0efa36..966d2442 100644 --- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java +++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java @@ -68,7 +68,8 @@ public class WaterfallConfiguration extends Configuration { @@ -19,7 +19,7 @@ index da0efa36f..966d2442b 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796f..9529d1d0a 100644 +index 3e9be796..96f419bb 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,12 +27,12 @@ index 3e9be796f..9529d1d0a 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.5.0"; ++ return "1.5.1"; } public final void reloadMessages() diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java -index 820f7b03c..76f5fed75 100644 +index 820f7b03..76f5fed7 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -16,6 +16,7 @@ public class CommandBungee extends Command @@ -45,7 +45,7 @@ index 820f7b03c..76f5fed75 100644 } } diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java -index 0c1ecfb8e..b2b199969 100644 +index 0c1ecfb8..b2b19996 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -103,7 +103,8 @@ public class QueryHandler extends SimpleChannelInboundHandler From 1b12df9d518779b6b08a83af1826f5ec3e2c52e2 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 25 May 2023 10:58:01 -0300 Subject: [PATCH 471/499] Proxy check whitelist --- .../0028-Antibot-System.patch | 23 +++++++++++++------ .../0029-Allow-Invalid-Names.patch | 6 ++--- .../0040-Implement-libdeflate.patch | 8 +++---- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 7e48d9ae..8a384467 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 3c1c6b50d0d78a409332452b39390ce5ed3ce871 Mon Sep 17 00:00:00 2001 +From 5ab898235d0a3f199036d39c3215a28eab3445ad Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -1090,10 +1090,10 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..77e8004e +index 00000000..6b3ee3d0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java -@@ -0,0 +1,174 @@ +@@ -0,0 +1,180 @@ +package dev._2lstudios.flamecord.antibot; + +import java.io.BufferedReader; @@ -1204,6 +1204,12 @@ index 00000000..77e8004e + + AddressData addressData = addressDataManager.getAddressData(address); + String ip = addressData.getHostString(); ++ Collection whitelist = config.getAntibotProxyWhitelist(); ++ ++ // Check if the ip is whitelisted ++ if (whitelist.contains(ip)) { ++ return false; ++ } + + // Check if it's a proxy + if ((!proxies.equals("") && proxies.contains(ip)) || isVPN(ip)) { @@ -1467,10 +1473,10 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..c59227cb 100644 +index 14665b1f..950a189d 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -@@ -15,6 +15,220 @@ import net.md_5.bungee.config.Configuration; +@@ -15,6 +15,223 @@ import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.ConfigurationProvider; public class FlameCordConfiguration extends FlameConfig { @@ -1598,6 +1604,8 @@ index 14665b1f..c59227cb 100644 + @Getter + private String antibotProxyEmail = "flamecord@gmail.com"; + @Getter ++ private Collection antibotProxyWhitelist = Arrays.asList("127.0.0.1"); ++ @Getter + private Collection antibotProxyLists = Arrays.asList( + "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt", + "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", @@ -1685,13 +1693,14 @@ index 14665b1f..c59227cb 100644 + this.antibotProxyFirewall = setIfUnexistant("antibot.proxy.firewall", this.antibotProxyFirewall, config); + this.antibotProxyOnlineCheck = setIfUnexistant("antibot.proxy.online-check", this.antibotProxyOnlineCheck, config); + this.antibotProxyEmail = setIfUnexistant("antibot.proxy.email", this.antibotProxyEmail, config); ++ this.antibotProxyWhitelist = setIfUnexistant("antibot.proxy.whitelist", this.antibotProxyWhitelist, config); + this.antibotProxyLists = setIfUnexistant("antibot.proxy.lists", this.antibotProxyLists, config); + } + // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +346,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -132,6 +349,9 @@ public class FlameCordConfiguration extends FlameConfig { this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); @@ -1929,7 +1938,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index bc3fd9eb..fabdb256 100644 +index d48f9687..35850471 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 1a2a7784..79b46218 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From 542d393202ea9de9b5cafbf4acf34c49ca320b05 Mon Sep 17 00:00:00 2001 +From aaeb99f3105cfd5d5ee8721fa1a57e4eb3c72066 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index c59227cb..ad1bcf44 100644 +index 950a189d..ad7f8c8e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -19,7 +19,7 @@ index c59227cb..ad1bcf44 100644 // Antibot accounts @Getter private boolean antibotAccountsEnabled = true; -@@ -350,6 +354,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -353,6 +357,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Antibot System loadAntibot(configuration, whitelistedAddresses); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index 8727bfea..e34fc09d 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 3239b8b4f31f0dab4647c938a32a9cf07a68c375 Mon Sep 17 00:00:00 2001 +From 3bc1f1f17e6f7335fb1015936f220f279c7dc4c7 Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index ad1bcf44..70a783f9 100644 +index ad7f8c8e..024398a1 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -17,7 +17,7 @@ index ad1bcf44..70a783f9 100644 private boolean antibotFirewallLog = true; @Getter private boolean antibotFirewallIpset = true; -@@ -357,6 +359,9 @@ public class FlameCordConfiguration extends FlameConfig { +@@ -360,6 +362,9 @@ public class FlameCordConfiguration extends FlameConfig { // FlameCord - Allow Invalid Names this.allowInvalidNames = setIfUnexistant("allow-invalid-names", this.allowInvalidNames, configuration); @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4e97d485..153ec3a9 100644 +index c5fca906..78324f6a 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; From ac4568a574ab1fa9e46e5bfc20ffa61b4cdbb05e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 25 May 2023 11:01:13 -0300 Subject: [PATCH 472/499] 1.5.2 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 719b979c..a04db2e2 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 52e4ef0367b9518b59667c87762cf14ac098eaea Mon Sep 17 00:00:00 2001 +From e9df285a8afbc946556692fa9f484af5ea04e122 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796..96f419bb 100644 +index 3e9be796..dfab95e4 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796..96f419bb 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.5.1"; ++ return "1.5.2"; } public final void reloadMessages() From 2ae0ea5861834120ed1a3045eac633c1b39089ee Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 27 May 2023 12:24:27 -0400 Subject: [PATCH 473/499] Rename references update to Mangocord --- .../0002-Rename-references-from-Waterfall-to-FlameCord.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch index a5690f86..e7ed9a64 100644 --- a/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch +++ b/Waterfall-Proxy-Patches/0002-Rename-references-from-Waterfall-to-FlameCord.patch @@ -13,7 +13,7 @@ index 688f1b995..b0b0d33eb 100644 - Waterfall -+ FlameCord ++ Mangocord org.apache.maven.plugins @@ -61,7 +61,7 @@ index e0fcd8fbe..8617cdc7a 100644 public String getName() { - return "Waterfall"; -+ return "FlameCord"; ++ return "Mangocord"; } @Override From 6e76c48bb761e3ab8c0b069cd34b49758dbbc680 Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 27 May 2023 13:16:03 -0400 Subject: [PATCH 474/499] Rename references update to Mangocord --- ...0020-FlameCord-message-configuration.patch | 6 ++-- .../0028-Antibot-System.patch | 32 ++++++++--------- .../0040-Implement-libdeflate.patch | 2 +- flamecord | 35 ------------------- pom.xml | 2 +- 5 files changed, 21 insertions(+), 56 deletions(-) delete mode 100755 flamecord diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index e2b30aa7..befb2cda 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -64,7 +64,7 @@ index 00000000..ae179438 + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", -+ "&aFlameCord&b {0}&a by&b LinsaFTW\n&e /flamecord reload&7 >&b Reloads FlameCord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!", ++ "&aMangocord&b {0}&a by&b LuciaNishimiya\n&e /[Mangocord]&7 >&b Reloads Mangocord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!\n&c join our discord >&b https://discord.gg/VmcKYCmQPn ", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + @@ -98,7 +98,7 @@ index 00000000..ae179438 + setIfUnexistant("total_players", "Total players online: {0}", configuration); + setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); + setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authenticated with Minecraft.net", configuration); ++ setIfUnexistant("offline_mode_player", "Not authentic[Mangocord]ated with Minecraft.net", configuration); + setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); + setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); + setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); @@ -134,7 +134,7 @@ index 00000000..ae179438 + + public String getTranslation(final String name, final Object... args) { + if (!messages.containsKey(name)) { -+ logger.warning("[FlameCord] Tried to get translation '" + name ++ logger.warning("[Mangocord] Tried to get translation '" + name + + "' from messages.yml file but wasn't found. Please try resetting this file or report to a developer."); + } + diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 8a384467..2898c97b 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -225,7 +225,7 @@ index 00000000..0295ea89 + + if ( config.isAntibotAccountsLog() ) + { -+ logger.log( Level.INFO, "[FlameCord] [{0}] has too many accounts", remoteAddress ); ++ logger.log( Level.INFO, "[Mangocord] [{0}] has too many accounts", remoteAddress ); + } + + if (config.isAntibotAccountsFirewall()) { @@ -378,7 +378,7 @@ index 00000000..7aa15796 + this.firewallReason = reason; + + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotFirewallLog()) { -+ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] was firewalled because of " + reason, hostString ); ++ FlameCord.getInstance().getLoggerWrapper().log( Level.INFO, "[Mangocord] [{0}] was firewalled because of " + reason, hostString ); + } + + // Queue the firewall as a ipset linux command @@ -668,7 +668,7 @@ index 00000000..9f65a2b3 + if (country != null && isBlacklisted(config, country)) { + if (config.isAntibotCountryLog()) { + logger.log(Level.INFO, -+ "[FlameCord] [{0}] has his country blocked from the server", remoteAddress); ++ "[Mangocord] [{0}] has his country blocked from the server", remoteAddress); + } + + if (config.isAntibotCountryFirewall()) { @@ -713,7 +713,7 @@ index 00000000..e2140887 + + if (addressData.getTimeSinceLastConnection() <= config.getAntibotFastChatTime()) { + if (config.isAntibotFastChatLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is chatting too fast", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] is chatting too fast", remoteAddress); + } + + if (config.isAntibotFastChatFirewall()) { @@ -809,7 +809,7 @@ index 00000000..1b35fba5 + + if (isBlacklisted(config, nickname)) { + if (config.isAntibotNicknameLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has a blacklisted nickname (" + nickname + ")", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] has a blacklisted nickname (" + nickname + ")", remoteAddress); + } + + if (config.isAntibotNicknameFirewall()) { @@ -941,7 +941,7 @@ index 00000000..7189a7f3 + public void printKick() { + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog()) { + System.out -+ .println("[FlameCord] [" + address ++ .println("[Mangocord] [" + address + + "] was kicked because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " + + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); + } @@ -950,7 +950,7 @@ index 00000000..7189a7f3 + public void printCancel() { + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsLog() && !cancelPrinted) { + System.out -+ .println("[FlameCord] [" + address ++ .println("[Mangocord] [" + address + + "] was cancelled because of too many packets (Total: " + simplify(packetsVls) + "vls Size: " + + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); + this.cancelPrinted = true; @@ -961,7 +961,7 @@ index 00000000..7189a7f3 + if (FlameCord.getInstance().getFlameCordConfiguration().isAntibotPacketsDebug() + && simplify(this.packetsVls) > 0) { + System.out -+ .println("[FlameCord] [" + address ++ .println("[Mangocord] [" + address + + "] debug is enabled, showing stats (Total: " + simplify(packetsVls) + "vls Size: " + + simplify(packetsVlsSize) + "vls Rate: " + simplify(packetsVlsRate) + "vls)"); + for (Entry entry : this.vlsByPacketId.entrySet()) { @@ -1069,7 +1069,7 @@ index 00000000..68555de3 + + if (repeatCount >= config.getAntibotPasswordLimit()) { + if (config.isAntibotPasswordLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has entered a repeated password", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] has entered a repeated password", remoteAddress); + } + + if (config.isAntibotPasswordFirewall()) { @@ -1125,7 +1125,7 @@ index 00000000..6b3ee3d0 + + // send updating proxies message + FlameCord.getInstance().getLoggerWrapper().getLogger() -+ .info("[FlameCord] Updating proxy database from " + lists.size() + " websites... (It can take a while!)"); ++ .info("[Mangocord] Updating proxy database from " + lists.size() + " websites... (It can take a while!)"); + + // create a string builder to store the content + StringBuilder content = new StringBuilder(); @@ -1188,7 +1188,7 @@ index 00000000..6b3ee3d0 + + // send updated proxies message + FlameCord.getInstance().getLoggerWrapper().getLogger() -+ .info("[FlameCord] Loaded a total of " + proxyCount + " proxies to the database! (Took " + timeTook + " seconds)"); ++ .info("[Mangocord] Loaded a total of " + proxyCount + " proxies to the database! (Took " + timeTook + " seconds)"); + + // set the updated proxy list + proxies = content.toString(); @@ -1214,7 +1214,7 @@ index 00000000..6b3ee3d0 + // Check if it's a proxy + if ((!proxies.equals("") && proxies.contains(ip)) || isVPN(ip)) { + if (config.isAntibotProxyLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] was blocked for using a VPN/Proxy service", address); ++ logger.log(Level.INFO, "[Mangocord] [{0}] was blocked for using a VPN/Proxy service", address); + } + + if (config.isAntibotProxyFirewall()) { @@ -1311,9 +1311,9 @@ index 00000000..51c1866e + || addressData.getPingsSecond() >= config.getAntibotRatelimitPingsPerSecond()) { + if (config.isAntibotRatelimitLog()) { + if (protocol == 1) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is pinging too fast", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] is pinging too fast", remoteAddress); + } else { -+ logger.log(Level.INFO, "[FlameCord] [{0}] is connecting too fast", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] is connecting too fast", remoteAddress); + } + } + @@ -1377,7 +1377,7 @@ index 00000000..d38ffc9e + + if (tooSlow) { + if (config.isAntibotReconnectLog()) { -+ logger.log(Level.INFO, "[FlameCord] [{0}] has to reconnect to join", remoteAddress); ++ logger.log(Level.INFO, "[Mangocord] [{0}] has to reconnect to join", remoteAddress); + } + + addressData.setTotalConnections(0); @@ -2222,7 +2222,7 @@ index 1a5a0e08..9266ba8f 100644 + { + if ( flameCord.getFlameCordConfiguration().isAntibotFirewallLog() ) + { -+ flameCord.getLoggerWrapper().log( Level.INFO, "[FlameCord] [{0}] is firewalled from the server. ({1})", new Object[]{ remoteAddress, firewallReason } ); ++ flameCord.getLoggerWrapper().log( Level.INFO, "[Mangocord] [{0}] is firewalled from the server. ({1})", new Object[]{ remoteAddress, firewallReason } ); + } + + ch.close(); diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index e34fc09d..834528e5 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -2150,7 +2150,7 @@ index c5fca906..78324f6a 100644 - logger.info( "Using standard Java compressor." ); - } - } -+ logger.log(Level.INFO, "FlameCord is using " + Natives.getCompressorFactory().getName() + " compression"); ++ logger.log(Level.INFO, "Mangocord is using " + Natives.getCompressorFactory().getName() + " compression"); } /** diff --git a/flamecord b/flamecord deleted file mode 100755 index 744b8f56..00000000 --- a/flamecord +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -case "$1" in - "rb" | "rbp" | "rebuild") - scripts/rebuildPatches.sh - ;; - "p" | "patch") - scripts/build.sh - ;; - "m" | "up" | "merge") - scripts/mergeUpstream.sh - ;; - "b" | "build") - scripts/build.sh --jar - ;; - "e" | "edit") - scripts/edit.sh - ;; - "w" | "wiggle") - scripts/wigglePatch.py - ;; - *) - echo "FlameCord build tool command. This provides a variety of commands to control the FlameCord" - echo "build. View below for details of the available commands." - echo "" - echo "Commands:" - echo " * rb, rbp, rebuild | Rebuilds the patches" - echo " * p, patch | Applies all the patches to BungeeCord" - echo " * m, up, merge | Utility to aid in merging upstream" - echo " * b, build | Builds the project" - echo " | The bootstrap artifact can be found in FlameCord-Proxy/bootstrap/target/" - echo " * e, edit | Runs git rebase -i for Waterfall, allowing patches to be easily modified" - echo " * w, wiggle | Helps to apply patches that fail to using default Git." - ;; -esac diff --git a/pom.xml b/pom.xml index 7c5aaff0..f50fedab 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ Waterfall-Super Super project for MangoCord. - https://github.com/LuciaNishimiya/AkarinProxy + https://github.com/LuciaNishimiya/MangoCord FlameCord-Proxy From 974166607e6ba3a14511e138344b8834bf2597e8 Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 27 May 2023 13:28:03 -0400 Subject: [PATCH 475/499] Name references update to Mangocord --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0c576e7b..1112df18 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -A modified version of Flamecord and Waterfall that fixes netty exploits, improves performance, keeps your console clean & supports latest versions. +MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. MangoCord also fixes bugs, improves performance and adds new functionalities to your server. MangoCord is the ultimate solution for a secure and fast Minecraft network ## Links Free download MangoCord: @@ -47,9 +47,9 @@ You can customize many MangoCord features in the flamecord.yml file. To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet connection. -Clone this repo, run `./flamecord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` +Clone this repo, run `./mangocord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` -FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/2lstudios-mc/FlameCord/blob/master/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. +FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/LuciaNishimiya/MangoCord/blob/main/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. ## Contribute From ea662deb7331be6b26e68510b0b30a9256b6a1eb Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 27 May 2023 13:42:20 -0400 Subject: [PATCH 476/499] mangocord commands to compile --- mangocord | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 mangocord diff --git a/mangocord b/mangocord new file mode 100755 index 00000000..8b406fad --- /dev/null +++ b/mangocord @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +case "$1" in + "rb" | "rbp" | "rebuild") + scripts/rebuildPatches.sh + ;; + "p" | "patch") + scripts/build.sh + ;; + "m" | "up" | "merge") + scripts/mergeUpstream.sh + ;; + "b" | "build") + scripts/build.sh --jar + ;; + "e" | "edit") + scripts/edit.sh + ;; + "w" | "wiggle") + scripts/wigglePatch.py + ;; + *) + echo "Mangocord build tool command. This provides a variety of commands to control the Mangocord" + echo "build. View below for details of the available commands." + echo "" + echo "Commands:" + echo " * rb, rbp, rebuild | Rebuilds the patches" + echo " * p, patch | Applies all the patches to BungeeCord" + echo " * m, up, merge | Utility to aid in merging upstream" + echo " * b, build | Builds the project" + echo " | The bootstrap artifact can be found in FlameCord-Proxy/bootstrap/target/" + echo " * e, edit | Runs git rebase -i for Waterfall, allowing patches to be easily modified" + echo " * w, wiggle | Helps to apply patches that fail to using default Git." + ;; +esac From 40cd037ebc5d03df66345e94205e362b77df4d47 Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 27 May 2023 15:13:06 -0400 Subject: [PATCH 477/499] Name references update --- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 50 +++++++++---------- ...0020-FlameCord-message-configuration.patch | 2 +- .../0026-Custom-motd-system.patch | 4 +- .../0028-Antibot-System.patch | 20 ++++---- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index df486cd4..5126927b 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at our [Discord server](https://discord.gg/gF36AT3). +reported to the community leaders responsible for enforcement at our [Discord server](https://discord.gg/VmcKYCmQPn). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0494f946..1b4aefba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,33 +1,33 @@ -Contributing to FlameCord +Contributing to Mangocord ========================== -FlameCord follows the parameters of the WaterfallMC project when making a Pull Request. WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. +mangocord follows the parameters of the WaterfallMC project when making a Pull Request. WaterfallMC has a very lenient policy towards PRs, but would prefer that you try and adhere to the following guidelines. ## Understanding Patches -Patches to FlameCord are very simple, but center around the directory 'FlameCord-Proxy' +Patches to mangocord are very simple, but center around the directory 'flamecord-Proxy' Assuming you already have forked the repository: 1. Pull the latest changes from the main repository -2. Type `./flamecord p` in git bash to apply the changes from upstream -3. cd into `FlameCord-Proxy` for proxy changes +2. Type `./mangocord p` in git bash to apply the changes from upstream +3. cd into `flamecord-Proxy` for proxy changes This directory is not a git repository in the traditional sense: -- Every single commit in FlameCord-Proxy is a patch. -- 'origin/master' points to a directory similar to Waterfall-Proxy but for FlameCord -- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that FlameCord, Waterfall, and Bungeecord don't - - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update FlameCord +- Every single commit in mangocord-Proxy is a patch. +- 'origin/master' points to a directory similar to Waterfall-Proxy but for mangocord +- Typing `git status` should show that we are 10 or 11 commits ahead of master, meaning we have 10 or 11 patches that mangocord, Waterfall, and Bungeecord don't + - If it says something like `212 commits ahead, 207 commits behind`, then type `git fetch` to update mangocord ## Adding Patches -Adding patches to FlameCord is very simple: +Adding patches to mangocord is very simple: -1. Modify `FlameCord-Proxy` with the appropriate changes +1. Modify `flamecord-Proxy` with the appropriate changes 2. Type `git add .` to add your changes 3. Run `git commit` with the desired patch message -4. Run `./flamecord rb` in the main directory to convert your commit into a new patch +4. Run `./mangocord rb` in the main directory to convert your commit into a new patch 5. PR your patches back to this repository -Your commit will be converted into a patch that you can then PR into FlameCord +Your commit will be converted into a patch that you can then PR into mangocord ## Modifying Patches Modifying previous patches is a bit more complex: @@ -46,7 +46,7 @@ This method works by temporarily resetting HEAD to the desired commit to edit us - **MAKE SURE TO ADD `--amend`** or else a new patch will be created. - You can also modify the commit message here. 7. Type `git rebase --continue` to finish rebasing. -8. Type `./flamecord rb` in the main directory. +8. Type `./mangocord rb` in the main directory. - This will modify the appropriate patches based on your commits. 9. PR your modifications back to this project. @@ -57,27 +57,27 @@ If you are simply editing a more recent commit or your change is small, simply m 2. Make a temporary commit. You don't need to make a message for this. 3. Type `git rebase -i upstream/upstream`, move (cut) your temporary commit and move it under the line of the patch you wish to modify. 4. Change the `pick` with `f` (fixup) or `s` (squash) if you need to edit the commit message -5. Type `./flamecord rb` in the main directory. +5. Type `./mangocord rb` in the main directory. - This will modify the appropriate patches based on your commits. 6. PR your modifications to github ## PR Policy -We'll accept changes that make sense. You should be able to justify their existence, along with any maintenance costs that come with them. Remember, these changes will affect everyone who runs FlameCord, not just you and your server. +We'll accept changes that make sense. You should be able to justify their existence, along with any maintenance costs that come with them. Remember, these changes will affect everyone who runs mangocord, not just you and your server. While we will fix minor formatting issues, you should stick to the guide below when making and submitting changes. ## Formatting -All modifications to non-FlameCord files should be marked -- Multi line changes start with `// FlameCord start` and end with `// FlameCord end` -- You can put a messages with a change if it isn't obvious, like this: `// FlameCord start - reason +All modifications to non-mangocord files should be marked +- Multi line changes start with `// mangocord start` and end with `// mangocord end` +- You can put a messages with a change if it isn't obvious, like this: `// mangocord start - reason - Should generally be about the reason the change was made, what it was before, or what the change is - - Multi-line messages should start with `// FlameCord start` and use `/* Multi line message here */` for the message itself -- Single line changes should have `// FlameCord` or `// FlameCord - reason` + - Multi-line messages should start with `// mangocord start` and use `/* Multi line message here */` for the message itself +- Single line changes should have `// mangocord` or `// mangocord - reason` - For example: ````java -return getConfig().getNotStupid(); // FlameCord - was return getConfig().getStupid(); +return getConfig().getNotStupid(); // mangocord - was return getConfig().getStupid(); -// FlameCord start +// mangocord start // con.disconnect( bungee.getTranslation( "lost_connection" ) ); ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); ServerKickEvent event = bungee.getPluginManager().callEvent( new ServerKickEvent( con, server.getInfo(), TextComponent.fromLegacyText( bungee.getTranslation( "lost_connection" ) ), def, ServerKickEvent.State.CONNECTED, ServerKickEvent.Cause.LOST_CONNECTION ) ); @@ -85,12 +85,12 @@ if ( event.isCancelled() && event.getCancelServer() != null ) { server.setObsolete( true ); con.connectNow( event.getCancelServer() ); -} +}mangocord else { con.disconnect0( event.getKickReasonComponent() ); } -// FlameCord end +// mangocord end ```` - We generally follow usual java style, or what is programmed into most IDEs and formatters by default - This is also known as oracle style diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index befb2cda..3616ff92 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -98,7 +98,7 @@ index 00000000..ae179438 + setIfUnexistant("total_players", "Total players online: {0}", configuration); + setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); + setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); -+ setIfUnexistant("offline_mode_player", "Not authentic[Mangocord]ated with Minecraft.net", configuration); ++ setIfUnexistant("offline_mode_player", "[Mangocord] Not authenticated with Minecraft.net", configuration); + setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); + setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); + setIfUnexistant("secure_profile_invalid", "Secure profile invalid.", configuration); diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 2ecfe04a..72c7cf4f 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -72,12 +72,12 @@ index b563cbced..b41ee92cc 100644 + + @Getter + private boolean motdEnabled = false; -+ private List motds = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List motds = Collections.singletonList("&eDefault &cMangoCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); + private List hexMotds; + + @Getter + private boolean sampleEnabled = false; -+ private List samples = Collections.singletonList("&eDefault &cFlameCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); ++ private List samples = Collections.singletonList("&eDefault &cMangoCord&e server &7(%onlineplayers%/%maxplayers%)\n&eEdit on &cflamecord.yml&7 (IridiumColorAPI HEX)"); + private List hexSamples; + + @Getter diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 2898c97b..4435f8df 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1719,16 +1719,16 @@ index ae179438..276e57ac 100644 setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); + // FlameCord start - Antibot System -+ setIfUnexistant("antibot_accounts", "&c&lFlameCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_fastchat", "&c&lFlameCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_firewall", "&c&lFlameCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_nickname", "&c&lFlameCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_password", "&c&lFlameCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_ratelimit", "&c&lFlameCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_reconnect", "&c&lFlameCord\n\n&cReconnect {0} more times to enter!\n&cRefresh {1} more times to enter!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_proxy", "&c&lFlameCord\n\n&cYou are using a Proxy/VPN! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); -+ setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); ++ setIfUnexistant("antibot_accounts", "&c&lMangoCord\n\n&cYou have too many accounts! ({0})\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_fastchat", "&c&lMangoCord\n\n&cYou are chatting too fast!\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_firewall", "&c&lMangoCord\n\n&cYou are blocked from this server!\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_nickname", "&c&lMangoCord\n\n&cYour nickname was detected as bot! ({0})\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_password", "&c&lMangoCord\n\n&cYour password is used by other players! ({0})\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_ratelimit", "&c&lMangoCord\n\n&cYou are connecting too fast! ({0})\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_reconnect", "&c&lMangoCord\n\n&cReconnect {0} more times to enter!\n&cRefresh {1} more times to enter!\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_country", "&c&lMangoCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_proxy", "&c&lMangoCord\n\n&cYou are using a Proxy/VPN! ({0})\n\n&cError? Contact us on discord.gg/VmcKYCmQPn", configuration); ++ setIfUnexistant("antibot_stats", "&c&lMangoCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); + + setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); + setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); From a974de62e26799558aaa1c0efe50be8a2ac5dfd3 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sat, 27 May 2023 17:12:18 -0400 Subject: [PATCH 478/499] sus Update README.md sus --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1112df18..c200c608 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ You can customize many MangoCord features in the flamecord.yml file. ## How To (Compiling from source) -To compile FlameCord, you need JDK8 or above, git, bash, maven, and an internet connection. +To compile MangoCord, you need JDK8 or above, git, bash, maven, and an internet connection. Clone this repo, run `./mangocord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` From c8a105cb7221dc2de3172645b8988cde0cc652a6 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 27 May 2023 23:02:21 -0300 Subject: [PATCH 479/499] Fix ipset not working --- Waterfall-Proxy-Patches/0028-Antibot-System.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 8a384467..2e7be7a9 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From 5ab898235d0a3f199036d39c3215a28eab3445ad Mon Sep 17 00:00:00 2001 +From ced4f783a28958480837fc046cdb37c93690b855 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -26,7 +26,7 @@ index 20edd900..95bdf348 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..3824cc53 100644 +index 676ba95b..a58110b3 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -130,7 +130,7 @@ index 676ba95b..3824cc53 100644 + */ + public void runLinuxCommand(String command) { + try { -+ runtime.exec("/bin/sh -c " + command); ++ runtime.exec("/bin/sh -c '" + command + "'"); + } catch (IOException e) { + /* + * Windows throws exception. @@ -1938,7 +1938,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index d48f9687..35850471 100644 +index ca093303..2d0ebc0f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer From 590c75ba30415949cb95f875c301d5c30d3cc025 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sat, 27 May 2023 23:03:28 -0300 Subject: [PATCH 480/499] 1.5.3 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index a04db2e2..703f740f 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From e9df285a8afbc946556692fa9f484af5ea04e122 Mon Sep 17 00:00:00 2001 +From 40b76d79ee5086e76cbade316e80f824db4c6e6a Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796..dfab95e4 100644 +index 3e9be796..70707597 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796..dfab95e4 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.5.2"; ++ return "1.5.3"; } public final void reloadMessages() From 591d24338be58d17cf6c0a9b483db5286f9efd9b Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Wed, 31 May 2023 14:04:49 -0400 Subject: [PATCH 481/499] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c200c608..5875684e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft serv ## Links Free download MangoCord: https://github.com/LuciaNishimiya/MangoCord/releases +https://builtbybit.com/resources/mangocord-mitigate-bots-exploits.27316/
Discord Mango Studio: https://discord.gg/PeS8h8eJZJ From 81c389cc9a9cc873620afa8e6b168948e08d0d61 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Wed, 31 May 2023 14:05:19 -0400 Subject: [PATCH 482/499] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5875684e..5bfda099 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. MangoCord also fixes bugs, improves performance and adds new functionalities to your server. MangoCord is the ultimate solution for a secure and fast Minecraft network ## Links -Free download MangoCord: -https://github.com/LuciaNishimiya/MangoCord/releases +Free download MangoCord:
+https://github.com/LuciaNishimiya/MangoCord/releases
https://builtbybit.com/resources/mangocord-mitigate-bots-exploits.27316/
-Discord Mango Studio: +Discord Mango Studio:
https://discord.gg/PeS8h8eJZJ ## Feactures From 7bb727332144702f923dd8fe097d987b769440e0 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Wed, 31 May 2023 14:09:56 -0400 Subject: [PATCH 483/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bfda099..23958231 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ To compile MangoCord, you need JDK8 or above, git, bash, maven, and an internet Clone this repo, run `./mangocord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` -FlameCord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/LuciaNishimiya/MangoCord/blob/main/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. +Mangocord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/LuciaNishimiya/MangoCord/blob/main/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. ## Contribute From 7c20da5ad9bbfca206f70e1139fc15621a19a542 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Wed, 31 May 2023 14:13:01 -0400 Subject: [PATCH 484/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23958231..baf8b52c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft serv Free download MangoCord:
https://github.com/LuciaNishimiya/MangoCord/releases
https://builtbybit.com/resources/mangocord-mitigate-bots-exploits.27316/ -
+

Discord Mango Studio:
https://discord.gg/PeS8h8eJZJ From 1058f5fc0e47c75ae69b3b84e13a42138b9440cc Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 3 Jun 2023 15:33:32 -0300 Subject: [PATCH 485/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0004-1.7.x-support.patch | 70 +++++++------- ...ake-PlayerHandshakeEvent-cancellable.patch | 10 +- ...ections-Don-t-flush-if-not-necessary.patch | 12 +-- ...tom-uuids-even-if-onlineMode-is-true.patch | 8 +- ...-Don-t-declare-uuid-unless-it-s-null.patch | 8 +- .../0019-FlameCord-module-system.patch | 12 +-- .../0023-FlameCord-logger-options.patch | 16 ++-- .../0026-Custom-motd-system.patch | 24 ++--- .../0028-Antibot-System.patch | 92 +++++++++---------- .../0029-Allow-Invalid-Names.patch | 10 +- ...Dont-Process-Links-For-Kick-Messages.patch | 10 +- .../0036-Bungee-Plugins-Command.patch | 10 +- .../0037-Bungee-IP-Command.patch | 10 +- ...0039-InitialHandler-Processing-State.patch | 28 +++--- 15 files changed, 160 insertions(+), 162 deletions(-) diff --git a/Waterfall b/Waterfall index fb7c7395..d6761d60 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit fb7c7395669840cdfc6d7bc34bc24ead466091ec +Subproject commit d6761d60578c2eb923a9951a803809f90c955bc9 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 2bb78957..6bd0863f 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,11 +1,11 @@ -From f6c2732d23405260984a660dda715f6f03fab6b6 Mon Sep 17 00:00:00 2001 +From 5e44201df8cb6a999b7b367ca5829e84347bec2f Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support 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 -index 59f2cb73d..f33ce913a 100644 +index 59f2cb73..f33ce913 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -415,4 +415,36 @@ public abstract class DefinedPacket @@ -46,7 +46,7 @@ index 59f2cb73d..f33ce913a 100644 + // FlameCord end - 1.7.x support } 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 -index 8bf14d561..c433ac4ab 100644 +index 8bf14d56..c433ac4a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -66,7 +66,7 @@ public enum Protocol @@ -324,7 +324,7 @@ index 8bf14d561..c433ac4ab 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index fa625d964..34a90b85e 100644 +index fa625d96..34a90b85 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -358,7 +358,7 @@ index fa625d964..34a90b85e 100644 ProtocolConstants.MINECRAFT_1_9, ProtocolConstants.MINECRAFT_1_9_1, diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java -index dc9866097..230018aea 100644 +index dc986609..230018ae 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java @@ -41,6 +41,7 @@ public class Chat extends DefinedPacket @@ -378,7 +378,7 @@ index dc9866097..230018aea 100644 { buf.writeByte( position ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java -index d7d4e6ab4..570a89f0a 100644 +index d7d4e6ab..570a89f0 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientSettings.java @@ -34,6 +34,12 @@ public class ClientSettings extends DefinedPacket @@ -415,7 +415,7 @@ index d7d4e6ab4..570a89f0a 100644 buf.writeByte( viewDistance ); if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java -index a29524ca8..e78519964 100644 +index a29524ca..e7851996 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionRequest.java @@ -23,6 +23,16 @@ public class EncryptionRequest extends DefinedPacket @@ -453,7 +453,7 @@ index a29524ca8..e78519964 100644 writeArray( publicKey, buf ); writeArray( verifyToken, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java -index 545eec72f..eacdbe78a 100644 +index 545eec72..eacdbe78 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EncryptionResponse.java @@ -22,6 +22,15 @@ public class EncryptionResponse extends DefinedPacket @@ -489,7 +489,7 @@ index 545eec72f..eacdbe78a 100644 if ( verifyToken != null ) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java -index d11a9ea9d..0ed78a8c4 100644 +index d11a9ea9..0ed78a8c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -550,7 +550,7 @@ index d11a9ea9d..0ed78a8c4 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java -index 7ed2dc3ab..435b85789 100644 +index 7ed2dc3a..435b8578 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/EntityRemoveEffect.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; @@ -589,7 +589,7 @@ index 7ed2dc3ab..435b85789 100644 } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java -index b004bc416..a8c3e7736 100644 +index b004bc41..a8c3e773 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/KeepAlive.java @@ -21,12 +21,28 @@ public class KeepAlive extends DefinedPacket @@ -622,7 +622,7 @@ index b004bc416..a8c3e7736 100644 { buf.writeLong( randomId ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java -index 07fb3d79a..7d03cd10a 100644 +index 07fb3d79..7d03cd10 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java @@ -25,6 +25,11 @@ public class LoginSuccess extends DefinedPacket @@ -665,7 +665,7 @@ index 07fb3d79a..7d03cd10a 100644 + // FlameCord end - 1.7.x support } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java -index 9b9c412da..4c50d2378 100644 +index 9b9c412d..4c50d237 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java @@ -23,6 +23,18 @@ public class PlayerListItem extends DefinedPacket @@ -706,7 +706,7 @@ index 9b9c412da..4c50d2378 100644 DefinedPacket.writeVarInt( items.length, buf ); for ( Item item : items ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java -index 91f71c095..57a82d29e 100644 +index 91f71c09..57a82d29 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -73,6 +73,15 @@ public class PluginMessage extends DefinedPacket @@ -742,7 +742,7 @@ index 91f71c095..57a82d29e 100644 buf.writeBytes( data ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java -index 3c7905d54..75b371e9c 100644 +index 3c7905d5..75b371e9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardObjective.java @@ -28,6 +28,16 @@ public class ScoreboardObjective extends DefinedPacket @@ -780,7 +780,7 @@ index 3c7905d54..75b371e9c 100644 buf.writeByte( action ); if ( action == 0 || action == 2 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java -index 0b27fc86b..a812441d9 100644 +index 0b27fc86..a812441d 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ScoreboardScore.java @@ -27,6 +27,20 @@ public class ScoreboardScore extends DefinedPacket @@ -826,7 +826,7 @@ index 0b27fc86b..a812441d9 100644 buf.writeByte( action ); writeString( scoreName, buf ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java -index 80e4f85af..cab28b999 100644 +index 80e4f85a..cab28b99 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteRequest.java @@ -43,6 +43,7 @@ public class TabCompleteRequest extends DefinedPacket @@ -846,7 +846,7 @@ index 80e4f85af..cab28b999 100644 { if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java -index a5555f6af..1eb458b61 100644 +index a5555f6a..1eb458b6 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java @@ -55,12 +55,22 @@ public class Team extends DefinedPacket @@ -915,7 +915,7 @@ index a5555f6af..1eb458b61 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 4568e9b0b..d2b28ebb6 100644 +index b61f5759..ff6e0b2b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer @@ -934,7 +934,7 @@ index 4568e9b0b..d2b28ebb6 100644 private ConnectionThrottle connectionThrottle; private final ModuleManager moduleManager = new ModuleManager(); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java -index 1d377a655..0ea5f90b4 100644 +index 1d377a65..0ea5f90b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeTitle.java @@ -183,6 +183,7 @@ public class BungeeTitle implements Title @@ -946,7 +946,7 @@ index 1d377a655..0ea5f90b4 100644 sendPacket( player, reset ); sendPacket( player, times ); diff --git a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java -index 491cf1a16..6cd8ec3b4 100644 +index 491cf1a1..6cd8ec3b 100644 --- a/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java +++ b/proxy/src/main/java/net/md_5/bungee/PlayerInfoSerializer.java @@ -10,9 +10,23 @@ import com.google.gson.JsonSerializer; @@ -1000,7 +1000,7 @@ index 491cf1a16..6cd8ec3b4 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 8181d76bd..c23c7ff9b 100644 +index 8181d76b..c23c7ff9 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler @@ -1053,7 +1053,7 @@ index 8181d76bd..c23c7ff9b 100644 throw CancelSendSignal.INSTANCE; } 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 b44d13e59..2d72e26ea 100644 +index cf82c182..9fe97384 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -194,6 +194,8 @@ public final class UserConnection implements ProxiedPlayer @@ -1099,7 +1099,7 @@ index b44d13e59..2d72e26ea 100644 { this.compressionThreshold = compressionThreshold; 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 -index e01f65ace..c532d7f4c 100644 +index e01f65ac..c532d7f4 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -18,6 +18,7 @@ import io.netty.buffer.Unpooled; @@ -1168,7 +1168,7 @@ index e01f65ace..c532d7f4c 100644 con.unsafe().sendPacket( pluginMessage ); throw CancelSendSignal.INSTANCE; 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 a19bbdd0f..de417ecae 100644 +index ca0e3764..2d3182b9 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 @@ -3,6 +3,9 @@ package net.md_5.bungee.connection; @@ -1181,7 +1181,7 @@ index a19bbdd0f..de417ecae 100644 import java.math.BigInteger; import java.net.InetSocketAddress; import java.net.SocketAddress; -@@ -280,8 +283,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -290,8 +293,23 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -1208,7 +1208,7 @@ index a19bbdd0f..de417ecae 100644 { bungee.getConnectionThrottle().unthrottle( getSocketAddress() ); diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index 6df3f3dd9..a409d440b 100644 +index 6df3f3dd..a409d440 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -16,6 +16,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; @@ -1229,7 +1229,7 @@ index 6df3f3dd9..a409d440b 100644 ( (BungeeServerInfo) target ).cachePing( serverPing ); callback.done( serverPing, null ); 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 d72208e75..66332af4e 100644 +index 7fb79bfd..86c469ee 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 @@ -101,7 +101,12 @@ public class UpstreamBridge extends PacketHandler @@ -1247,7 +1247,7 @@ index d72208e75..66332af4e 100644 } con.getServer().disconnect( "Quitting" ); diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 28d2127f9..8fb6bf514 100644 +index 28d2127f..8fb6bf51 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -34,6 +34,12 @@ public abstract class EntityMap @@ -1265,7 +1265,7 @@ index 28d2127f9..8fb6bf514 100644 case ProtocolConstants.MINECRAFT_1_9: diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java new file mode 100644 -index 000000000..cdc07dc45 +index 00000000..cdc07dc4 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java @@ -0,0 +1,102 @@ @@ -1374,7 +1374,7 @@ index 000000000..cdc07dc45 \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java new file mode 100644 -index 000000000..cb9174b35 +index 00000000..cb9174b3 --- /dev/null +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_6.java @@ -0,0 +1,62 @@ @@ -1442,7 +1442,7 @@ index 000000000..cb9174b35 +// FlameCord end - 1.7.x support \ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java -index bea2bbff9..caed43849 100644 +index bea2bbff..caed4384 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -8,6 +8,7 @@ import lombok.Getter; @@ -1489,7 +1489,7 @@ index bea2bbff9..caed43849 100644 + // FlameCord end - 1.7.x support } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java -index 5e02f8c8a..85bc21b9f 100644 +index 5e02f8c8..85bc21b9 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandshakeState.java @@ -3,6 +3,7 @@ package net.md_5.bungee.forge; @@ -1524,7 +1524,7 @@ index 5e02f8c8a..85bc21b9f 100644 return WAITINGSERVERDATA; diff --git a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java -index f70d357a3..df6a4b12c 100644 +index f70d357a..df6a4b12 100644 --- a/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java +++ b/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java @@ -13,6 +13,7 @@ public class ServerUnique extends TabList @@ -1616,5 +1616,5 @@ index f70d357a3..df6a4b12c 100644 @Override -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch index 8e8d9017..86ee1e36 100644 --- a/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch +++ b/Waterfall-Proxy-Patches/0005-Make-PlayerHandshakeEvent-cancellable.patch @@ -1,11 +1,11 @@ -From 2a6878cb7a8c16bb76b79012db51d81f112636c9 Mon Sep 17 00:00:00 2001 +From ab954c61440b743371d5b235e016f099da3da176 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:57:23 +0800 Subject: [PATCH] Make PlayerHandshakeEvent cancellable diff --git a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java -index 2f7b38d9e..e29b0ed35 100644 +index 2f7b38d9..e29b0ed3 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/PlayerHandshakeEvent.java @@ -2,8 +2,11 @@ package net.md_5.bungee.api.event; @@ -35,10 +35,10 @@ index 2f7b38d9e..e29b0ed35 100644 /** * Connection attempting to login. 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 de417ecae..c3543a18d 100644 +index 2d3182b9..3d6bdf5c 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 -@@ -362,7 +362,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -372,7 +372,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -52,5 +52,5 @@ index de417ecae..c3543a18d 100644 switch ( handshake.getRequestedProtocol() ) { -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch index 71c6ae5f..52086605 100644 --- a/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch +++ b/Waterfall-Proxy-Patches/0010-Close-connections-Don-t-flush-if-not-necessary.patch @@ -1,14 +1,14 @@ -From e801d03bfaa70492f0ad246397b0875c8fec9668 Mon Sep 17 00:00:00 2001 +From c564761a0215ace19637a81e0cf21070f488c8dc Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:06:17 +0800 Subject: [PATCH] Close connections & Don't flush if not necessary 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 965a419f..99e2dafa 100644 +index 3d6bdf5c..ac20d5ad 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 -@@ -208,6 +208,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -218,6 +218,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection } ServerPing legacy = result.getResponse(); @@ -22,7 +22,7 @@ index 965a419f..99e2dafa 100644 String kickMessage; if ( v1_5 ) -@@ -283,6 +290,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -293,6 +300,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void done(ProxyPingEvent pingResult, Throwable error) { @@ -40,7 +40,7 @@ index 965a419f..99e2dafa 100644 // FlameCord start - 1.7.x support Gson gson = handshake.getProtocolVersion() == ProtocolConstants.MINECRAFT_1_7_2 ? BungeeCord.getInstance().gsonLegacy : BungeeCord.getInstance().gson; if ( ProtocolConstants.isBeforeOrEq( handshake.getProtocolVersion() , ProtocolConstants.MINECRAFT_1_8 ) ) -@@ -327,11 +345,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -337,11 +355,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public void handle(PingPacket ping) throws Exception { @@ -127,5 +127,5 @@ index 6a045d16..9227db06 100644 } } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch index 7bc2ea29..4afc6ec7 100644 --- a/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch +++ b/Waterfall-Proxy-Patches/0015-Allow-custom-uuids-even-if-onlineMode-is-true.patch @@ -1,14 +1,14 @@ -From 047ea04ae1cf8277e6c2eed87dc0d5fd901efe91 Mon Sep 17 00:00:00 2001 +From 799190416ca187a0f7021813a617a6031573710b Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:35:33 +0800 Subject: [PATCH] Allow custom uuids even if onlineMode is true 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 8ed26e5c..4242b9c8 100644 +index ac20d5ad..706fb321 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 -@@ -769,7 +769,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -779,7 +779,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void setUniqueId(UUID uuid) { Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" ); @@ -18,5 +18,5 @@ index 8ed26e5c..4242b9c8 100644 } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch index 9bc71fef..455cc792 100644 --- a/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch +++ b/Waterfall-Proxy-Patches/0017-Don-t-declare-uuid-unless-it-s-null.patch @@ -1,14 +1,14 @@ -From ac09d06618510ed85aadc83a5a6bb812bf109218 Mon Sep 17 00:00:00 2001 +From 768e32b3c1fc55c2722830698ef016d026f72a2e Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:43:17 +0800 Subject: [PATCH] Don't declare uuid unless it's null 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 8715821fe..1c10b5a93 100644 +index 706fb321..32c57dad 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 -@@ -559,7 +559,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -569,7 +569,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { loginProfile = obj; name = obj.getName(); @@ -21,5 +21,5 @@ index 8715821fe..1c10b5a93 100644 return; } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch index 57217719..9921c9a9 100644 --- a/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch +++ b/Waterfall-Proxy-Patches/0019-FlameCord-module-system.patch @@ -1,11 +1,11 @@ -From 681805834a7f83cccb8de7878b8ffacbdb4b6d0d Mon Sep 17 00:00:00 2001 +From 5991a1c9046328c99d25d66ac5b82650b0646e85 Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Sat, 1 May 2021 14:17:48 -0300 Subject: [PATCH] FlameCord module system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index f3d5c0290..fb3d8ca2e 100644 +index f3d5c029..fb3d8ca2 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -36,7 +36,7 @@ index f3d5c0290..fb3d8ca2e 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java new file mode 100644 -index 000000000..a6cb2638f +index 00000000..a6cb2638 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/ModulesConfiguration.java @@ -0,0 +1,35 @@ @@ -76,7 +76,7 @@ index 000000000..a6cb2638f + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 0d8f02d25..d58227fd9 100644 +index d9195f43..2cb0f332 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,8 @@ import com.google.gson.Gson; @@ -135,7 +135,7 @@ index 0d8f02d25..d58227fd9 100644 pluginManager.enablePlugins(); if ( config.getThrottle() > 0 ) -@@ -853,4 +859,53 @@ public class BungeeCord extends ProxyServer +@@ -857,4 +863,53 @@ public class BungeeCord extends ProxyServer { return new BungeeTitle(); } @@ -190,5 +190,5 @@ index 0d8f02d25..d58227fd9 100644 + } } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch index 6f49bf56..b23adf56 100644 --- a/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch +++ b/Waterfall-Proxy-Patches/0023-FlameCord-logger-options.patch @@ -1,11 +1,11 @@ -From 1d9ee842e043c343a64b8fe7ef6962ee0fb53041 Mon Sep 17 00:00:00 2001 +From f9ddbbef3ff312d6f1ef6a5520f9479b587e911b Mon Sep 17 00:00:00 2001 From: linsaftw <25271111+linsaftw@users.noreply.github.com> Date: Fri, 30 Apr 2021 23:51:51 -0300 Subject: [PATCH] FlameCord logger options diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 241e8ed9c..b563cbced 100644 +index 241e8ed9..b563cbce 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -11,10 +11,27 @@ import net.md_5.bungee.config.Configuration; @@ -37,7 +37,7 @@ index 241e8ed9c..b563cbced 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 e48f77131..909227970 100644 +index b8fb5a21..81ab6da0 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; @@ -61,10 +61,10 @@ index e48f77131..909227970 100644 } 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 22688a045..66a347542 100644 +index ac004603..c2f4ede9 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 -@@ -396,7 +396,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -406,7 +406,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection { case 1: // Ping @@ -74,7 +74,7 @@ index 22688a045..66a347542 100644 { bungee.getLogger().log( Level.INFO, "{0} has pinged", this ); } -@@ -405,7 +406,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -415,7 +416,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection break; case 2: // Login @@ -85,7 +85,7 @@ index 22688a045..66a347542 100644 bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 694ecdb01..14e3004fc 100644 +index 694ecdb0..14e3004f 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -46,7 +46,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter @@ -136,5 +136,5 @@ index 694ecdb01..14e3004fc 100644 { if ( cause instanceof ReadTimeoutException ) -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch index 2ecfe04a..e0e9d135 100644 --- a/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch +++ b/Waterfall-Proxy-Patches/0026-Custom-motd-system.patch @@ -1,11 +1,11 @@ -From 2072d8d33f059abfdb95c16158792887f3f701d3 Mon Sep 17 00:00:00 2001 +From 5d9b83db52a2a5f2431ed2b30da64e6119594011 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:37:24 -0300 Subject: [PATCH] Custom motd system diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index b563cbced..b41ee92cc 100644 +index b563cbce..b41ee92c 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -2,15 +2,94 @@ package dev._2lstudios.flamecord.configuration; @@ -128,7 +128,7 @@ index b563cbced..b41ee92cc 100644 } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java new file mode 100644 -index 000000000..9587bccda +index 00000000..9587bccd --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ColorUtil.java @@ -0,0 +1,48 @@ @@ -182,7 +182,7 @@ index 000000000..9587bccda +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java new file mode 100644 -index 000000000..6c386e16f +index 00000000..6c386e16 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/IridiumColorAPI.java @@ -0,0 +1,275 @@ @@ -463,7 +463,7 @@ index 000000000..6c386e16f +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java new file mode 100644 -index 000000000..c1f05cd0a +index 00000000..c1f05cd0 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/GradientPattern.java @@ -0,0 +1,33 @@ @@ -502,7 +502,7 @@ index 000000000..c1f05cd0a +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java new file mode 100644 -index 000000000..5457ead64 +index 00000000..5457ead6 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/Pattern.java @@ -0,0 +1,17 @@ @@ -525,7 +525,7 @@ index 000000000..5457ead64 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java new file mode 100644 -index 000000000..792e9f987 +index 00000000..792e9f98 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/RainbowPattern.java @@ -0,0 +1,28 @@ @@ -559,7 +559,7 @@ index 000000000..792e9f987 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java new file mode 100644 -index 000000000..0b039c797 +index 00000000..0b039c79 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/iridiumcolorapi/patterns/SolidPattern.java @@ -0,0 +1,29 @@ @@ -593,7 +593,7 @@ index 000000000..0b039c797 + +} 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 66a347542..58be68b02 100644 +index c2f4ede9..5396029c 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 @@ -23,6 +23,8 @@ import javax.crypto.spec.SecretKeySpec; @@ -605,7 +605,7 @@ index 66a347542..58be68b02 100644 import lombok.Getter; import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; -@@ -275,7 +277,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -285,7 +287,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); @@ -613,7 +613,7 @@ index 66a347542..58be68b02 100644 final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); Callback pingBack = new Callback() -@@ -338,7 +339,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -348,7 +349,56 @@ public class InitialHandler extends PacketHandler implements PendingConnection ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() ); } else { @@ -672,5 +672,5 @@ index 66a347542..58be68b02 100644 thisState = State.PING; -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0028-Antibot-System.patch b/Waterfall-Proxy-Patches/0028-Antibot-System.patch index 2e7be7a9..3cd125b3 100644 --- a/Waterfall-Proxy-Patches/0028-Antibot-System.patch +++ b/Waterfall-Proxy-Patches/0028-Antibot-System.patch @@ -1,4 +1,4 @@ -From ced4f783a28958480837fc046cdb37c93690b855 Mon Sep 17 00:00:00 2001 +From 086231f86b1e31c3915679124c5b358dd406f2c7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:35:53 -0300 Subject: [PATCH] Antibot System @@ -26,7 +26,7 @@ index 20edd900..95bdf348 100644 diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java -index 676ba95b..a58110b3 100644 +index 676ba95b..677b4a8e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -1,8 +1,16 @@ @@ -100,10 +100,10 @@ index 676ba95b..a58110b3 100644 + // Thread to run queued firewall linux commands + new Thread(() -> { + FlameCord flameCord = FlameCord.getInstance(); -+ ++ + while (!flameCord.isShuttingDown()) { + flameCord.runQueuedLinuxCommands(); -+ ++ + try { + Thread.sleep(1000); + } catch (InterruptedException e) { @@ -187,7 +187,7 @@ index 676ba95b..a58110b3 100644 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java new file mode 100644 -index 00000000..0295ea89 +index 00000000..5cd9782a --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/AccountsCheck.java @@ -0,0 +1,48 @@ @@ -222,7 +222,7 @@ index 00000000..0295ea89 + + if (nicknames.size() > config.getAntibotAccountsLimit()) { + nicknames.remove(nickname); -+ ++ + if ( config.isAntibotAccountsLog() ) + { + logger.log( Level.INFO, "[FlameCord] [{0}] has too many accounts", remoteAddress ); @@ -1090,7 +1090,7 @@ index 00000000..68555de3 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java new file mode 100644 -index 00000000..6b3ee3d0 +index 00000000..3b3d4d2f --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/antibot/ProxyCheck.java @@ -0,0 +1,180 @@ @@ -1147,7 +1147,7 @@ index 00000000..6b3ee3d0 + + // set timeouts + con.setConnectTimeout (5000); -+ con.setReadTimeout (5000); ++ con.setReadTimeout (5000); + + // set the request method to GET + con.setRequestMethod("GET"); @@ -1473,7 +1473,7 @@ index 00000000..44d773ab + } +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 14665b1f..950a189d 100644 +index 14665b1f..241f5a0e 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,223 @@ import net.md_5.bungee.config.Configuration; @@ -1700,18 +1700,18 @@ index 14665b1f..950a189d 100644 // FlameCord - TCP Fast Open @Getter private int tcpFastOpen = 3; -@@ -132,6 +349,9 @@ public class FlameCordConfiguration extends FlameConfig { - this.fakePlayersMode = setIfUnexistant("custom-motd.fakeplayers.mode", this.fakePlayersMode, configuration); +@@ -133,6 +350,9 @@ public class FlameCordConfiguration extends FlameConfig { this.tcpFastOpen = setIfUnexistant("tcp-fast-open", this.tcpFastOpen, configuration); -+ + + // FlameCord - Antibot System + loadAntibot(configuration, whitelistedAddresses); - ++ save(configuration, configurationFile); } + } diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index ae179438..276e57ac 100644 +index ae179438..820b012b 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -80,6 +80,23 @@ public class MessagesConfiguration extends FlameConfig { @@ -1729,7 +1729,7 @@ index ae179438..276e57ac 100644 + setIfUnexistant("antibot_country", "&c&lFlameCord\n\n&cYour country {0} is blacklisted!\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_proxy", "&c&lFlameCord\n\n&cYou are using a Proxy/VPN! ({0})\n\n&cError? Contact us on discord.gg/gF36AT3", configuration); + setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); -+ ++ + setIfUnexistant("flamecord_firewall_help", "&c/flamecord firewall ", configuration); + setIfUnexistant("flamecord_firewall_add", "&cThe ip {0} was added to the firewall!", configuration); + setIfUnexistant("flamecord_firewall_remove", "&cThe ip {0} was removed from the firewall!", configuration); @@ -1762,7 +1762,7 @@ index 00000000..c19c4965 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java new file mode 100644 -index 00000000..7f26e7a0 +index 00000000..901ab453 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/utils/ProtocolUtil.java @@ -0,0 +1,27 @@ @@ -1778,31 +1778,30 @@ index 00000000..7f26e7a0 + int value = 0; + int position = 0; + byte currentByte; -+ ++ + while (byteBuf.isReadable()) { + currentByte = byteBuf.readByte(); + value |= (currentByte & SEGMENT_BITS) << position; -+ ++ + if ((currentByte & CONTINUE_BIT) == 0) break; -+ ++ + position += 7; -+ ++ + if (position >= 32) throw new RuntimeException("VarInt is too big"); + } -+ ++ + return value; + } +} \ No newline at end of file diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 6316143f..aa538f74 100644 +index 6316143f..f2c8c58b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -@@ -51,12 +51,38 @@ public class MinecraftDecoder extends MessageToMessageDecoder - throw new FastDecoderException("Error decoding packet with too big capacity: " + capacity); +@@ -52,11 +52,37 @@ public class MinecraftDecoder extends MessageToMessageDecoder } } -+ + + // FlameCord start - Antibot Packet Check + if (prot == protocol.TO_SERVER) { + dev._2lstudios.flamecord.antibot.PacketsCheck packetsCheck = FlameCord.getInstance().getCheckManager().getPacketsCheck(); @@ -1825,7 +1824,7 @@ index 6316143f..aa538f74 100644 + } + } + // FlameCord end - Antibot Packet Check - ++ ByteBuf slice = in.duplicate(); // FlameCord - Duplicate buf instead of Copy Object packetTypeInfo = null; @@ -1868,7 +1867,7 @@ index 3a802ca4..c23e6856 100644 @Override diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java -index fb81adee..173b47f3 100644 +index fb81adee..56bc46eb 100644 --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -4,6 +4,7 @@ import java.util.Collection; @@ -1900,14 +1899,14 @@ index fb81adee..173b47f3 100644 + int totalConnections = statsData.getTotalConnections(); + int lastPings = statsData.getLastPings(); + int lastConnections = statsData.getLastConnections(); -+ ++ + sender.sendMessage(TextComponent.fromLegacyText(messagesConfiguration.getTranslation("antibot_stats", totalPings, totalConnections, lastPings, lastConnections))); + break; + } + case "firewall": { + if (args.length > 2) { + String ip = args[2]; -+ ++ + switch (args[1]) { + case "add": { + FlameCord.getInstance().getAddressDataManager().getAddressData(ip).firewall("Blacklisted by command"); @@ -1938,7 +1937,7 @@ index fb81adee..173b47f3 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index ca093303..2d0ebc0f 100644 +index d4e3ec6f..0d3bed74 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -533,6 +533,11 @@ public class BungeeCord extends ProxyServer @@ -1954,7 +1953,7 @@ index ca093303..2d0ebc0f 100644 // Need to close loggers after last message! org.apache.logging.log4j.LogManager.shutdown(); // Waterfall 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 d65884ae..04744574 100644 +index 5396029c..443e2718 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 @@ -22,8 +22,8 @@ import javax.crypto.SecretKey; @@ -1968,11 +1967,11 @@ index d65884ae..04744574 100644 import dev._2lstudios.flamecord.configuration.FlameCordConfiguration; import lombok.Getter; import lombok.RequiredArgsConstructor; -@@ -412,6 +412,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -422,6 +422,22 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -+ ++ + // FlameCord start - Antibot System + // Close and firewall on invalid protocol + int protocol = handshake.getRequestedProtocol(); @@ -1991,7 +1990,7 @@ index d65884ae..04744574 100644 this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); ch.getHandle().pipeline().remove( PipelineUtils.LEGACY_KICKER ); -@@ -436,6 +452,48 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -446,6 +462,48 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() ); @@ -2012,7 +2011,7 @@ index d65884ae..04744574 100644 + disconnect( bungee.getTranslation( "antibot_ratelimit", addressData.getConnectionsSecond() ) ); + return; + } -+ ++ + if ( checkManager.getProxyCheck().check( remoteAddress ) ) + { + disconnect( bungee.getTranslation( "antibot_proxy" ) ); @@ -2024,7 +2023,7 @@ index d65884ae..04744574 100644 + disconnect( bungee.getTranslation( "antibot_reconnect", Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectAttempts() - addressData.getTotalConnections() ), Math.max(0, FlameCord.getInstance().getFlameCordConfiguration().getAntibotReconnectPings() - addressData.getTotalPings() ) ) ); + return; + } -+ ++ + if ( checkManager.getCountryCheck().check( remoteAddress ) ) + { + disconnect( bungee.getTranslation( "antibot_country", addressData.getCountry() ) ); @@ -2040,7 +2039,7 @@ index d65884ae..04744574 100644 // FlameCord - Make PlayerHandshakeEvent cancellable if (bungee.getPluginManager().callEvent(new PlayerHandshakeEvent(InitialHandler.this, handshake)).isCancelled()) { ch.close(); -@@ -453,6 +511,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -463,6 +521,17 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.STATUS; ch.setProtocol( Protocol.STATUS ); @@ -2058,7 +2057,7 @@ index d65884ae..04744574 100644 break; case 2: // Login -@@ -461,6 +530,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -471,6 +540,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { bungee.getLogger().log( Level.INFO, "{0} has connected", this ); } @@ -2066,7 +2065,7 @@ index d65884ae..04744574 100644 thisState = State.USERNAME; ch.setProtocol( Protocol.LOGIN ); -@@ -527,6 +597,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -537,6 +607,26 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } @@ -2094,7 +2093,7 @@ index d65884ae..04744574 100644 // We can just check by UUID here as names are based on UUID if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) 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 66332af4..c16e28c8 100644 +index 86c469ee..a472535a 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,11 +4,15 @@ import com.google.common.base.Preconditions; @@ -2113,20 +2112,21 @@ index 66332af4..c16e28c8 100644 import net.md_5.bungee.BungeeCord; import net.md_5.bungee.ServerConnection.KeepAliveData; import net.md_5.bungee.UserConnection; -@@ -207,6 +211,22 @@ public class UpstreamBridge extends PacketHandler +@@ -210,6 +214,23 @@ public class UpstreamBridge extends PacketHandler + throw CancelSendSignal.INSTANCE; } - Preconditions.checkArgument(!empty, "Chat message is empty"); + // FlameCord start - Antibot System -+ final CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ CheckManager checkManager = FlameCord.getInstance().getCheckManager(); ++ java.net.SocketAddress socketAddress = con.getCh().getRemoteAddress(); + -+ if ( checkManager.getFastChatCheck().check( con.getCh().getRemoteAddress() ) ) ++ if ( checkManager.getFastChatCheck().check( socketAddress ) ) + { + con.disconnect( bungee.getTranslation( "antibot_fastchat" ) ); + throw CancelSendSignal.INSTANCE; + } + -+ if ( checkManager.getPasswordCheck().check( con.getCh().getRemoteAddress(), message ) ) ++ if ( checkManager.getPasswordCheck().check( socketAddress, message ) ) + { + con.disconnect( bungee.getTranslation( "antibot_password", checkManager.getPasswordCheck().getRepeatCount() ) ); + throw CancelSendSignal.INSTANCE; @@ -2234,5 +2234,5 @@ index 1a5a0e08..9266ba8f 100644 { ch.close(); -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch index 79b46218..ce35ab22 100644 --- a/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch +++ b/Waterfall-Proxy-Patches/0029-Allow-Invalid-Names.patch @@ -1,11 +1,11 @@ -From aaeb99f3105cfd5d5ee8721fa1a57e4eb3c72066 Mon Sep 17 00:00:00 2001 +From 4bf82b588cad66b7da4c19dc47c367e6ebe8118c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:09:35 -0300 Subject: [PATCH] Allow Invalid Names diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index 950a189d..ad7f8c8e 100644 +index 241f5a0e..59b2d94f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -15,6 +15,10 @@ import net.md_5.bungee.config.Configuration; @@ -30,10 +30,10 @@ index 950a189d..ad7f8c8e 100644 } } 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 04744574..9ad5f520 100644 +index 443e2718..6f336346 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 -@@ -556,7 +556,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -566,7 +566,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -43,5 +43,5 @@ index 04744574..9ad5f520 100644 disconnect( bungee.getTranslation( "name_invalid" ) ); return; -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch index 1f74e30b..f9d0d2af 100644 --- a/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch +++ b/Waterfall-Proxy-Patches/0035-Dont-Process-Links-For-Kick-Messages.patch @@ -1,11 +1,11 @@ -From e74e3f56e2fdf688c56eab9f29ee8878a021d118 Mon Sep 17 00:00:00 2001 +From 848eb1a30908c8d8b77197994412cfc01a3fd5db Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:37:13 -0300 Subject: [PATCH] Dont Process Links For Kick Messages diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java -index 4371374a9..2bb27e670 100644 +index 4371374a..2bb27e67 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -160,6 +160,107 @@ public final class TextComponent extends BaseComponent @@ -117,10 +117,10 @@ index 4371374a9..2bb27e670 100644 * The text of the component that will be displayed to the client */ 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 9ad5f5205..d237a711d 100644 +index 6f336346..a72b7520 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 -@@ -849,7 +849,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -859,7 +859,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection { if ( canSendKickMessage() ) { @@ -130,5 +130,5 @@ index 9ad5f5205..d237a711d 100644 { ch.close(); -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch index 54048b55..1c7b3c0f 100644 --- a/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch +++ b/Waterfall-Proxy-Patches/0036-Bungee-Plugins-Command.patch @@ -1,11 +1,11 @@ -From 0923414d9063d29b476aaba8c1d2dc0c32f7d518 Mon Sep 17 00:00:00 2001 +From bff382375e15745ed1976d87ea88ed220a5826a8 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:14:12 -0300 Subject: [PATCH] Bungee Plugins Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index 35277c4c..e385aaab 100644 +index 820b012b..9269a6ec 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -97,6 +97,11 @@ public class MessagesConfiguration extends FlameConfig { @@ -72,7 +72,7 @@ index 00000000..2e20e9dc + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 23d89781..e03c7877 100644 +index 0d3bed74..ee1fc481 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -83,7 +83,7 @@ index 23d89781..e03c7877 100644 import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -@@ -912,5 +913,8 @@ public class BungeeCord extends ProxyServer +@@ -916,5 +917,8 @@ public class BungeeCord extends ProxyServer // Flamecord Command pluginManager.registerCommand(null, new FlameCordCommand(this)); @@ -93,5 +93,5 @@ index 23d89781..e03c7877 100644 } } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch index 62148dfc..0bb6bf3f 100644 --- a/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch +++ b/Waterfall-Proxy-Patches/0037-Bungee-IP-Command.patch @@ -1,11 +1,11 @@ -From 15952aaaac9f80d0bf3f1d7adbd42e947572d78f Mon Sep 17 00:00:00 2001 +From 16dfe71d77ddbc0e57a8319efc208f930dedbb94 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:12:45 -0300 Subject: [PATCH] Bungee IP Command diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java -index e385aaab..4d9ed0c7 100644 +index 9269a6ec..bb5f1f1f 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java @@ -102,6 +102,12 @@ public class MessagesConfiguration extends FlameConfig { @@ -73,7 +73,7 @@ index 00000000..85313491 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index e03c7877..63ba56f4 100644 +index ee1fc481..0fd585e2 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -11,6 +11,7 @@ import com.google.gson.Gson; @@ -84,7 +84,7 @@ index e03c7877..63ba56f4 100644 import dev._2lstudios.flamecord.commands.BungeePluginsCommand; import dev._2lstudios.flamecord.commands.FlameCordCommand; import dev._2lstudios.flamecord.configuration.ModulesConfiguration; -@@ -916,5 +917,8 @@ public class BungeeCord extends ProxyServer +@@ -920,5 +921,8 @@ public class BungeeCord extends ProxyServer // FlameCord - Bungee Plugins Command pluginManager.registerCommand(null, new BungeePluginsCommand()); @@ -94,5 +94,5 @@ index e03c7877..63ba56f4 100644 } } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch index 976eae8f..a78aa080 100644 --- a/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch +++ b/Waterfall-Proxy-Patches/0039-InitialHandler-Processing-State.patch @@ -1,11 +1,11 @@ -From e6eb41f0e91bc6eb3b8f894530a0481dd8c2d7aa Mon Sep 17 00:00:00 2001 +From 5e278d2226c7e96c8ba384af1b3627108f97fa9c Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Sun, 22 Jan 2023 09:41:36 -0300 Subject: [PATCH] InitialHandler Processing State 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 d237a711d..bb397a22c 100644 +index a72b7520..a4860814 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 @@ -135,6 +135,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection @@ -19,7 +19,7 @@ index d237a711d..bb397a22c 100644 private boolean canSendKickMessage() { return thisState == State.USERNAME || thisState == State.ENCRYPT || thisState == State.FINISHING; -@@ -275,6 +279,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -285,6 +289,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(StatusRequest statusRequest) throws Exception { Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" ); @@ -30,7 +30,7 @@ index d237a711d..bb397a22c 100644 ServerInfo forced = AbstractReconnectHandler.getForcedHost( this ); final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion(); -@@ -392,6 +400,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -402,6 +410,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection } thisState = State.PING; @@ -40,7 +40,7 @@ index d237a711d..bb397a22c 100644 } private static final boolean ACCEPT_INVALID_PACKETS = Boolean.parseBoolean(System.getProperty("waterfall.acceptInvalidPackets", "false")); -@@ -401,6 +412,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -411,6 +422,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection { // FlameCord - Never accept invalid packets Preconditions.checkState( thisState == State.PING, "Not expecting PING" ); @@ -51,20 +51,18 @@ index d237a711d..bb397a22c 100644 unsafe.sendPacket( ping ); -@@ -412,7 +427,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -422,6 +437,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); -- + // FlameCord start - InitialHandler Processing State + Preconditions.checkState( !processing, "Cannot request HANDSHAKE while processing another packet"); + this.processing = true; + // FlameCord end - InitialHandler Processing State -+ + // FlameCord start - Antibot System // Close and firewall on invalid protocol - int protocol = handshake.getRequestedProtocol(); -@@ -521,6 +540,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -531,6 +550,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection return; } // FlameCord end - Antibot System @@ -75,7 +73,7 @@ index d237a711d..bb397a22c 100644 break; case 2: -@@ -545,6 +568,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -555,6 +578,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection } return; } @@ -87,7 +85,7 @@ index d237a711d..bb397a22c 100644 break; default: throw new QuietException( "Cannot request protocol " + handshake.getRequestedProtocol() ); -@@ -555,6 +583,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -565,6 +593,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); @@ -98,7 +96,7 @@ index d237a711d..bb397a22c 100644 if ( !FlameCord.getInstance().getFlameCordConfiguration().isAllowInvalidNames() && !AllowedCharacters.isValidName( loginRequest.getData(), onlineMode ) ) { -@@ -650,6 +682,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -660,6 +692,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection thisState = State.FINISHING; finish(); } @@ -108,7 +106,7 @@ index d237a711d..bb397a22c 100644 } }; -@@ -663,6 +698,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -673,6 +708,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); Preconditions.checkState( EncryptionUtil.check( loginRequest.getPublicKey(), encryptResponse, request ), "Invalid verification" ); thisState = State.FINISHING; // Waterfall - move earlier - There is no verification of this later (and this is not API) @@ -120,5 +118,5 @@ index d237a711d..bb397a22c 100644 SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); // Waterfall start -- -2.37.3.windows.1 +2.40.1.windows.1 From 594ae11aa1d0a82b255682e8af29180fa1af42b4 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 3 Jun 2023 21:45:59 -0300 Subject: [PATCH 486/499] 1.5.4 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 703f740f..3abd6640 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -27,7 +27,7 @@ index 3e9be796..70707597 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.5.3"; ++ return "1.5.4"; } public final void reloadMessages() From 099c996d6d7886bb89133d0f05330fa30aa0c274 Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Sat, 3 Jun 2023 23:49:29 -0400 Subject: [PATCH 487/499] sus --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index a9f790e6..c801f2a9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ out/ .project .settings - -pom.xml \ No newline at end of file From 876b92ba44aab97cbc8ba50f8a35b888912e220a Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sat, 3 Jun 2023 23:53:10 -0400 Subject: [PATCH 488/499] Change gitmodule url From b92cd8a965bdfc078048dd6310a84c82672dfa57 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sat, 3 Jun 2023 23:54:00 -0400 Subject: [PATCH 489/499] Change gitmodule url --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 88ee6b9c..f10907cb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "Waterfall"] path = Waterfall + url = https://github.com/LinsaFTW/Waterfall.git From 2a4b0098209b414b3be2d026399f69fc2481f92f Mon Sep 17 00:00:00 2001 From: linsaftw Date: Wed, 7 Jun 2023 18:45:49 -0300 Subject: [PATCH 490/499] Updated Upstream (Waterfall) --- Waterfall | 2 +- .../0001-FlameCord-POM-Changes.patch | 12 ++-- .../0004-1.7.x-support.patch | 20 +++---- .../0018-FlameCord-General-Patch.patch | 48 +++++++++++----- .../0021-Fix-ByteBuf-memory-leaks.patch | 10 ++-- ...0030-Disable-entity-Metadata-Rewrite.patch | 55 +++++++++---------- .../0040-Implement-libdeflate.patch | 12 ++-- 7 files changed, 89 insertions(+), 70 deletions(-) diff --git a/Waterfall b/Waterfall index d6761d60..3102433f 160000 --- a/Waterfall +++ b/Waterfall @@ -1 +1 @@ -Subproject commit d6761d60578c2eb923a9951a803809f90c955bc9 +Subproject commit 3102433f31c1bec78fbc74a7bd2b8424e6e78af8 diff --git a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch index 60a676c0..247208b7 100644 --- a/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch +++ b/Waterfall-Proxy-Patches/0001-FlameCord-POM-Changes.patch @@ -1,4 +1,4 @@ -From f549424aed518d36fb5d4b9ba3a6f42ca6559ba6 Mon Sep 17 00:00:00 2001 +From 26e96485a5f9ae0a87a69dbf7754f9920aec7aa0 Mon Sep 17 00:00:00 2001 From: foss-mc <69294560+foss-mc@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:59:15 +0800 Subject: [PATCH] FlameCord POM Changes @@ -55,7 +55,7 @@ index 00000000..20edd900 + +
diff --git a/pom.xml b/pom.xml -index 7ff4a013..378c5f7d 100644 +index d333a528..88d0f3fa 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ @@ -67,7 +67,7 @@ index 7ff4a013..378c5f7d 100644 diff --git a/protocol/pom.xml b/protocol/pom.xml -index 221469b9..5bc0cefd 100644 +index c6105b87..ae7cf9f7 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -63,5 +63,14 @@ @@ -86,10 +86,10 @@ index 221469b9..5bc0cefd 100644 diff --git a/proxy/pom.xml b/proxy/pom.xml -index d3801c9b..02625018 100644 +index 83d8719b..896770ae 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -150,6 +150,51 @@ +@@ -160,6 +160,51 @@ runtime @@ -142,5 +142,5 @@ index d3801c9b..02625018 100644 -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch index 6bd0863f..34e9adc3 100644 --- a/Waterfall-Proxy-Patches/0004-1.7.x-support.patch +++ b/Waterfall-Proxy-Patches/0004-1.7.x-support.patch @@ -1,4 +1,4 @@ -From 5e44201df8cb6a999b7b367ca5829e84347bec2f Mon Sep 17 00:00:00 2001 +From f6fcbbb9df037b9b94fa2b11dc91d90f171cb77e Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:54:33 -0300 Subject: [PATCH] 1.7.x support @@ -324,7 +324,7 @@ index 8bf14d56..c433ac4a 100644 TO_SERVER.registerPacket( LoginPayloadResponse.class, 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 -index fa625d96..34a90b85 100644 +index 18574b30..d7f430bd 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -7,6 +7,10 @@ public class ProtocolConstants @@ -338,7 +338,7 @@ index fa625d96..34a90b85 100644 public static final int MINECRAFT_1_8 = 47; public static final int MINECRAFT_1_9 = 107; public static final int MINECRAFT_1_9_1 = 108; -@@ -48,6 +52,7 @@ public class ProtocolConstants +@@ -49,6 +53,7 @@ public class ProtocolConstants static { ImmutableList.Builder supportedVersions = ImmutableList.builder().add( @@ -346,8 +346,8 @@ index fa625d96..34a90b85 100644 "1.8.x", "1.9.x", "1.10.x", -@@ -62,6 +67,10 @@ public class ProtocolConstants - "1.19.x" +@@ -64,6 +69,10 @@ public class ProtocolConstants + "1.20.x" ); ImmutableList.Builder supportedVersionIds = ImmutableList.builder().add( + // FlameCord start - 1.7.x support @@ -915,7 +915,7 @@ index a5555f6a..1eb458b6 100644 buf.writeByte( mode ); if ( mode == 0 || mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index b61f5759..ff6e0b2b 100644 +index f4667e30..f4333c6f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -171,6 +171,14 @@ public class BungeeCord extends ProxyServer @@ -1000,10 +1000,10 @@ index 491cf1a1..6cd8ec3b 100644 } } diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 8181d76b..c23c7ff9 100644 +index 60232e52..3c77da32 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -@@ -280,10 +280,20 @@ public class ServerConnector extends PacketHandler +@@ -282,10 +282,20 @@ public class ServerConnector extends PacketHandler user.getServer().disconnect( "Quitting" ); } else { @@ -1028,7 +1028,7 @@ index 8181d76b..c23c7ff9 100644 } user.setDimension( login.getDimension() ); -@@ -296,7 +306,7 @@ public class ServerConnector extends PacketHandler +@@ -298,7 +308,7 @@ public class ServerConnector extends PacketHandler if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall for ( Objective objective : serverScoreboard.getObjectives() ) { @@ -1247,7 +1247,7 @@ index 7fb79bfd..86c469ee 100644 } con.getServer().disconnect( "Quitting" ); diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 28d2127f..8fb6bf51 100644 +index 65ea8044..2fc16c5d 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -34,6 +34,12 @@ public abstract class EntityMap diff --git a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch index 396cf54d..c69dc8d9 100644 --- a/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch +++ b/Waterfall-Proxy-Patches/0018-FlameCord-General-Patch.patch @@ -1,12 +1,32 @@ -From f4ab4a93d462da9ff8375c432ea7824a189ca59a Mon Sep 17 00:00:00 2001 +From 25f0ce813e1f0dc75dda1fa9fc2dfba5da636f39 Mon Sep 17 00:00:00 2001 From: Juan Cruz Linsalata Date: Mon, 12 Oct 2020 15:40:53 -0300 Subject: [PATCH] FlameCord General Patch +diff --git a/flamecord/pom.xml b/flamecord/pom.xml +index 20edd900..fb80f233 100644 +--- a/flamecord/pom.xml ++++ b/flamecord/pom.xml +@@ -5,13 +5,13 @@ + + io.github.waterfallmc + waterfall-parent +- 1.19-R0.1-SNAPSHOT ++ 1.20-R0.1-SNAPSHOT + ../pom.xml + + + dev._2lstudios + waterfall-flamecord +- 1.19-R0.1-SNAPSHOT ++ 1.20-R0.1-SNAPSHOT + jar + + Waterfall-FlameCord diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java new file mode 100644 -index 000000000..f3d5c0290 +index 00000000..f3d5c029 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/FlameCord.java @@ -0,0 +1,31 @@ @@ -44,7 +64,7 @@ index 000000000..f3d5c0290 \ No newline at end of file diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java new file mode 100644 -index 000000000..e6c660d15 +index 00000000..e6c660d1 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameConfig.java @@ -0,0 +1,74 @@ @@ -124,7 +144,7 @@ index 000000000..e6c660d15 +} diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java new file mode 100644 -index 000000000..241e8ed9c +index 00000000..241e8ed9 --- /dev/null +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -0,0 +1,20 @@ @@ -149,7 +169,7 @@ index 000000000..241e8ed9c + } +} diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java -index 640f0ea26..70a1192e7 100644 +index 640f0ea2..70a1192e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -1,5 +1,6 @@ @@ -161,7 +181,7 @@ index 640f0ea26..70a1192e7 100644 import io.netty.channel.ChannelHandlerContext; diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java new file mode 100644 -index 000000000..021b38d43 +index 00000000..021b38d4 --- /dev/null +++ b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java @@ -0,0 +1,58 @@ @@ -224,7 +244,7 @@ index 000000000..021b38d43 + } +} diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 27d41dd00..0d8f02d25 100644 +index f4333c6f..91eaa39c 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -9,6 +9,8 @@ import com.google.common.collect.Sets; @@ -253,7 +273,7 @@ index 27d41dd00..0d8f02d25 100644 { registerChannel( ForgeConstants.FML_TAG ); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index da688839c..3a07c7c8a 100644 +index cba1515b..900d0e4d 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -2,6 +2,8 @@ package net.md_5.bungee; @@ -277,7 +297,7 @@ index da688839c..3a07c7c8a 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 94702434d..e48f77131 100644 +index 1c0827f1..b809e848 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -35,6 +35,7 @@ import net.md_5.bungee.api.SkinConfiguration; @@ -311,7 +331,7 @@ index 94702434d..e48f77131 100644 b.connect().addListener( listener ); } 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 3b1bffe6c..22688a045 100644 +index 32c57dad..ac004603 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 @@ -21,6 +21,8 @@ import java.util.logging.Level; @@ -335,7 +355,7 @@ index 3b1bffe6c..22688a045 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java -index a409d440b..3503c089d 100644 +index a409d440..3503c089 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/PingHandler.java @@ -1,6 +1,7 @@ @@ -347,7 +367,7 @@ index a409d440b..3503c089d 100644 import lombok.RequiredArgsConstructor; import net.md_5.bungee.BungeeCord; diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java -index 4820267b3..694ecdb01 100644 +index 4820267b..694ecdb0 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -1,6 +1,8 @@ @@ -360,7 +380,7 @@ index 4820267b3..694ecdb01 100644 import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.CorruptedFrameException; 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 a95193ba7..a4c3bd710 100644 +index 9227db06..f9227e01 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,8 @@ @@ -373,5 +393,5 @@ index a95193ba7..a4c3bd710 100644 import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch index 64b404e4..8bd1ef17 100644 --- a/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch +++ b/Waterfall-Proxy-Patches/0021-Fix-ByteBuf-memory-leaks.patch @@ -1,14 +1,14 @@ -From bdf1f938031bb0a6cb5a991cc9e353a82246a246 Mon Sep 17 00:00:00 2001 +From 02e31c9782d9d3d3247e14bc14cb734fbbb21911 Mon Sep 17 00:00:00 2001 From: linsaftw Date: Sat, 20 Mar 2021 12:36:25 -0300 Subject: [PATCH] Fix ByteBuf memory leaks diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -index 8fb6bf514..2ea419186 100644 +index 2fc16c5d..b8b9245b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java -@@ -157,11 +157,15 @@ public abstract class EntityMap +@@ -158,11 +158,15 @@ public abstract class EntityMap if ( readId == oldId || readId == newId ) { ByteBuf data = packet.copy(); @@ -30,7 +30,7 @@ index 8fb6bf514..2ea419186 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java -index cefa0206e..8d4439ab8 100644 +index cefa0206..8d4439ab 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeUtils.java @@ -38,16 +38,22 @@ public class ForgeUtils @@ -64,5 +64,5 @@ index cefa0206e..8d4439ab8 100644 } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch index c294fd87..5c9a7bd4 100644 --- a/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch +++ b/Waterfall-Proxy-Patches/0030-Disable-entity-Metadata-Rewrite.patch @@ -1,4 +1,4 @@ -From bc07ea7e84cdbce71415ceef9fa817a6211adb3d Mon Sep 17 00:00:00 2001 +From 28d3332a24dca17af7029dcc6d12a45b76af539b Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:23:55 -0300 Subject: [PATCH] Disable entity Metadata Rewrite @@ -239,7 +239,7 @@ index 966d2442..be337a68 100644 public boolean isDisableTabListRewrite() { return disableTabListRewrite; diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java -index 3a07c7c8..f51c668d 100644 +index 900d0e4d..ceb2b421 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -245,11 +245,6 @@ public class ServerConnector extends PacketHandler @@ -254,7 +254,7 @@ index 3a07c7c8..f51c668d 100644 if ( user.getForgeClientHandler().getClientModList() == null && !user.getForgeClientHandler().isHandshakeComplete() ) // Vanilla { user.getForgeClientHandler().setHandshakeComplete(); -@@ -308,20 +303,6 @@ public class ServerConnector extends PacketHandler +@@ -310,20 +305,6 @@ public class ServerConnector extends PacketHandler user.getTabListHandler().onServerChange(); Scoreboard serverScoreboard = user.getServerSentScoreboard(); @@ -275,13 +275,14 @@ index 3a07c7c8..f51c668d 100644 serverScoreboard.clear(); for ( UUID bossbar : user.getSentBossBars() ) -@@ -340,33 +321,27 @@ public class ServerConnector extends PacketHandler +@@ -342,31 +323,24 @@ public class ServerConnector extends PacketHandler } user.setDimensionChange( true ); - if ( !user.isDisableEntityMetadataRewrite() && login.getDimension() == user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), +- false, login.getDeathLocation(), login.getPortalCooldown() ) ); - } user.setServerEntityId( login.getEntityId() ); @@ -290,41 +291,38 @@ index 3a07c7c8..f51c668d 100644 - if ( user.isDisableEntityMetadataRewrite() ) { - // Ensure that we maintain consistency - user.setClientEntityId( login.getEntityId() ); -+ // Ensure that we maintain consistency -+ user.setClientEntityId( login.getEntityId() ); - - // Only send if we are not in the same dimension - if ( login.getDimension() != user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) ); - } -+ // Only send if we are not in the same dimension -+ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer -+ { -+ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); -+ } - - Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); +- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation(), login.getPortalCooldown() ); - user.unsafe().sendPacket(modLogin); -+ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), -+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() ); -+ user.unsafe().sendPacket(modLogin); - - // Only send if we're in the same dimension - if ( login.getDimension() == user.getDimension() ) // Waterfall - defer - { -- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); +- user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) ); - } ++ // Ensure that we maintain consistency ++ user.setClientEntityId( login.getEntityId() ); ++ // Only send if we are not in the same dimension ++ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer ++ { ++ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) ); ++ } ++ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), ++ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation(), login.getPortalCooldown() ); ++ user.unsafe().sendPacket(modLogin); + // Only send if we're in the same dimension + if ( login.getDimension() == user.getDimension() ) // Waterfall - defer + { -+ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); ++ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) ); } // Waterfall end - user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) ); + user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), 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 c006277f..8114095e 100644 +index 81ab6da0..47c5412a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -44,7 +44,6 @@ import net.md_5.bungee.api.event.ServerConnectEvent; @@ -433,7 +431,7 @@ index c532d7f4..5d7f92f8 100644 public void handle(Respawn respawn) { 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 c16e28c8..5a7f3880 100644 +index a472535a..aee6d88e 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 @@ -24,7 +24,6 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent; @@ -458,10 +456,10 @@ index c16e28c8..5a7f3880 100644 } diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java deleted file mode 100644 -index 2ea41918..00000000 +index b8b9245b..00000000 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ /dev/null -@@ -1,374 +0,0 @@ +@@ -1,375 +0,0 @@ -package net.md_5.bungee.entitymap; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -555,6 +553,7 @@ index 2ea41918..00000000 - case ProtocolConstants.MINECRAFT_1_19_3: - return EntityMap_1_16_2.INSTANCE_1_19_1; - case ProtocolConstants.MINECRAFT_1_19_4: +- case ProtocolConstants.MINECRAFT_1_20: - return EntityMap_1_16_2.INSTANCE_1_19_4; - } - throw new RuntimeException( "Version " + version + " has no entity map" ); @@ -3239,5 +3238,5 @@ index caed4384..af428090 100644 } -- -2.37.3.windows.1 +2.40.1.windows.1 diff --git a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch index e34fc09d..69782d29 100644 --- a/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch +++ b/Waterfall-Proxy-Patches/0040-Implement-libdeflate.patch @@ -1,11 +1,11 @@ -From 3bc1f1f17e6f7335fb1015936f220f279c7dc4c7 Mon Sep 17 00:00:00 2001 +From a5060bf4bc34170f6260c156a17a9a13cf982b2a Mon Sep 17 00:00:00 2001 From: xIsm4 Date: Fri, 27 Jan 2023 14:12:44 +0100 Subject: [PATCH] Implement libdeflate diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java -index ad7f8c8e..024398a1 100644 +index 59b2d94f..cc277990 100644 --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/FlameCordConfiguration.java @@ -59,6 +59,8 @@ public class FlameCordConfiguration extends FlameConfig { @@ -2101,10 +2101,10 @@ index f33ce913..01b208ed 100644 { int low = buf.readUnsignedShort(); diff --git a/proxy/pom.xml b/proxy/pom.xml -index 02625018..37abc9f7 100644 +index 896770ae..1b63f484 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml -@@ -158,6 +158,12 @@ +@@ -168,6 +168,12 @@ ${project.version} compile @@ -2118,7 +2118,7 @@ index 02625018..37abc9f7 100644 io.github.waterfallmc waterfall-module-cmd-alert diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index c5fca906..78324f6a 100644 +index ebbeae08..8de4bcae 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -17,6 +17,7 @@ import dev._2lstudios.flamecord.commands.FlameCordCommand; @@ -2464,5 +2464,5 @@ index 9266ba8f..00d3096a 100644 public static final String TIMEOUT_HANDLER = "timeout"; public static final String PACKET_DECODER = "packet-decoder"; -- -2.37.3.windows.1 +2.40.1.windows.1 From a0b047e45cd5bcaf8b4e206c0801448a456dd77a Mon Sep 17 00:00:00 2001 From: linsaftw Date: Wed, 7 Jun 2023 18:47:15 -0300 Subject: [PATCH 491/499] 1.5.5 --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 3abd6640..33e003a3 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -1,4 +1,4 @@ -From 40b76d79ee5086e76cbade316e80f824db4c6e6a Mon Sep 17 00:00:00 2001 +From 557632e0bdbbc0ddd6d9de6ed48773f00718f4b7 Mon Sep 17 00:00:00 2001 From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> Date: Tue, 8 Jun 2021 22:24:27 -0300 Subject: [PATCH] FlameCord rebrand @@ -19,7 +19,7 @@ index da0efa36..966d2442 100644 // Throttling options tabThrottle = config.getInt("throttling.tab_complete", tabThrottle); diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java -index 3e9be796..70707597 100644 +index d6bda021..77ababc1 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -551,7 +551,7 @@ public class BungeeCord extends ProxyServer @@ -27,7 +27,7 @@ index 3e9be796..70707597 100644 public String getVersion() { - return ( BungeeCord.class.getPackage().getImplementationVersion() == null ) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); -+ return "1.5.4"; ++ return "1.5.5"; } public final void reloadMessages() @@ -59,5 +59,5 @@ index 0c1ecfb8..b2b19996 100644 listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); QueryResult result = bungee.getPluginManager().callEvent(event).getResult(); -- -2.37.3.windows.1 +2.40.1.windows.1 From 65e3b97ae12ee567624107ffe8ffe3f9c1a0fd1f Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Thu, 8 Jun 2023 03:35:11 -0400 Subject: [PATCH 492/499] Update 0003-mango-rebrand.patch --- Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch index 33e003a3..8941b011 100644 --- a/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch +++ b/Waterfall-Proxy-Patches/0003-FlameCord-rebrand.patch @@ -53,7 +53,7 @@ index 0c1ecfb8..b2b19996 100644 List players = bungee.getPlayers().stream().map(ProxiedPlayer::getName).collect(Collectors.toList()); - ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "Waterfall_Proxy", -+ // FlameCord - Rebrand ++ // FlameCord - Rebrand + ProxyQueryEvent event = new ProxyQueryEvent(listener, new QueryResult(listener.getMotd(), "SMP", "FlameCord_Proxy", bungee.getOnlineCount(), listener.getMaxPlayers(), listener.getHost().getPort(), listener.getHost().getHostString(), "MINECRAFT", players, bungee.getGameVersion())); From 6531c88572a7889fb57be07df3e084719231e4c3 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Thu, 8 Jun 2023 03:37:42 -0400 Subject: [PATCH 493/499] Sus --- .github/FUNDING.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 5b3b2b0b..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: ['https://paypal.me/LinsaFTW'] From f1cd5a87dbe5ad4044f99cd9e79ed1a8cff2e6c5 Mon Sep 17 00:00:00 2001 From: LuciaNishimiya Date: Thu, 15 Jun 2023 22:30:51 -0400 Subject: [PATCH 494/499] add command to see antibot statistics --- .../0020-FlameCord-message-configuration.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch index 3616ff92..2b7a62cc 100644 --- a/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch +++ b/Waterfall-Proxy-Patches/0020-FlameCord-message-configuration.patch @@ -64,7 +64,7 @@ index 00000000..ae179438 + // FlameCord + setIfUnexistant("flamecord_reload", "&aAll files had been successfully reloaded!", configuration); + setIfUnexistant("flamecord_help", -+ "&aMangocord&b {0}&a by&b LuciaNishimiya\n&e /[Mangocord]&7 >&b Reloads Mangocord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord help&7 >&b Shows this message!\n&c join our discord >&b https://discord.gg/VmcKYCmQPn ", ++ "&aMangocord&b {0}&a by&b LuciaNishimiya\n&e /flamecord&7 >&b Reloads Mangocord files!\n&e /flamecord firewall &7 >&b Firewall certain ips!\n&e /bplugins&7 >&b Show the plugin list!\n&e /bip &7 >&b Show the ip and info of a player!\n&e /flamecord stats&7 >&b Displays flamecord stats!\n&e /flamecord help&7 >&b Shows this message!\n&c join our discord >&b https://discord.gg/VmcKYCmQPn ", + configuration); + setIfUnexistant("flamecord_nopermission", "&cYou don't have permission to do this!", configuration); + @@ -97,7 +97,7 @@ index 00000000..ae179438 + configuration); + setIfUnexistant("total_players", "Total players online: {0}", configuration); + setIfUnexistant("name_invalid", "Username contains invalid characters.", configuration); -+ setIfUnexistant("ping_cannot_connect", "&c[Bungee] Can't connect to server.", configuration); ++ setIfUnexistant("ping_cannot_connect", "&c[Mangocord] Can't connect to server.", configuration); + setIfUnexistant("offline_mode_player", "[Mangocord] Not authenticated with Minecraft.net", configuration); + setIfUnexistant("secure_profile_required", "A secure profile is required to join this server.", configuration); + setIfUnexistant("secure_profile_expired", "Secure profile expired.", configuration); From eff2184c6c425edbab21e210b80bf3a1444f29b9 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Fri, 23 Jun 2023 19:02:17 -0400 Subject: [PATCH 495/499] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index baf8b52c..78f319bf 100644 --- a/README.md +++ b/README.md @@ -14,17 +14,17 @@ https://discord.gg/PeS8h8eJZJ ## Feactures * Our features are focused on the security of your Minecraft server preventing hacking with crash exploits, bots and other kind of dos attacks on the application layer. -* **Bots**: We prevent bots using multiple security checks to minimize the damage. +* **Bots**: We provides a powerful anti-bot solution programmed directly into the core of BungeeCord, with the ability to mitigate these attacks without hindering your server's performance. -* **Anti-vpn/proxy**: VPN detection check. +* **Anti-vpn/proxy**: Checks whether a connection is a proxy/VPN by utilizing web databases from over 10 webs, and additional websites can be added as well. -* **Performance**: We reduce the amount of processing done to improve the speed of our servers. +* **Performance**: It reduces CPU usage and RAM usage by optimizing and reusing code, caching heavy getters, using libdeflate for faster compression/decompression of packets, and fixing memory leaks. -* **GeyserMC compatibility**: Set the GeyserMC configuration option “disable-compression” to false to fix compatibility with MangoCord. +* **GeyserMC compatibility**: MangoCord supports Geyser, a proxy that allows Bedrock Edition players to join Java Edition servers. It supports most Java features and cross-play between different platforms. * **Motd**: Incorporates customizable an advanced motd system that protects against null pink attacks -* **Languages Supported**: Fully configurable in messages.yml!!. +* **Languages Supported**: Provides you with absolute flexibility by allowing you to fully customize all messages and texts of your server through the messages.yml configuration file. * **Exploit Fixes**: MangoCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. From 880b2f43b515e5ebc0491b8e90b3d986b63d1047 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sun, 25 Jun 2023 19:57:41 -0400 Subject: [PATCH 496/499] Rename README.md to README.old --- README.md => README.old | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => README.old (100%) diff --git a/README.md b/README.old similarity index 100% rename from README.md rename to README.old From 95278e339195eb9096b5e465917975606df950ba Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sun, 25 Jun 2023 19:59:48 -0400 Subject: [PATCH 497/499] Create README.md --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..78f319bf --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ + + + +MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. MangoCord also fixes bugs, improves performance and adds new functionalities to your server. MangoCord is the ultimate solution for a secure and fast Minecraft network + +## Links +Free download MangoCord:
+https://github.com/LuciaNishimiya/MangoCord/releases
+https://builtbybit.com/resources/mangocord-mitigate-bots-exploits.27316/ +

+Discord Mango Studio:
+https://discord.gg/PeS8h8eJZJ + +## Feactures +* Our features are focused on the security of your Minecraft server preventing hacking with crash exploits, bots and other kind of dos attacks on the application layer. + +* **Bots**: We provides a powerful anti-bot solution programmed directly into the core of BungeeCord, with the ability to mitigate these attacks without hindering your server's performance. + +* **Anti-vpn/proxy**: Checks whether a connection is a proxy/VPN by utilizing web databases from over 10 webs, and additional websites can be added as well. + +* **Performance**: It reduces CPU usage and RAM usage by optimizing and reusing code, caching heavy getters, using libdeflate for faster compression/decompression of packets, and fixing memory leaks. + +* **GeyserMC compatibility**: MangoCord supports Geyser, a proxy that allows Bedrock Edition players to join Java Edition servers. It supports most Java features and cross-play between different platforms. + +* **Motd**: Incorporates customizable an advanced motd system that protects against null pink attacks + +* **Languages Supported**: Provides you with absolute flexibility by allowing you to fully customize all messages and texts of your server through the messages.yml configuration file. + +* **Exploit Fixes**: MangoCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. + + +MangoCord is a FlameCord and Waterfall fork that protects your server from bot attacks and exploits done to your Minecraft Server by minimizing the impact received by those with our advanced set of antibot filtering features. MangoCord improves your server performance and reduces your CPU usage by cutting the amount of processes required to process packets. MangoCord has free official and community support on our Discord server. https://discord.gg/PeS8h8eJZJ . Visit our detailed guide to MangoCord configuration to know more about it's features and how to configure them. + + +## Why fork Waterfall? + +MangoCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. + +MangoCord will track upstream Waterfall and merge changes as needed. + +## How to (Server Admins) + +Just drag an drop MangoCord .jar into your server folder and run it. + +You can customize many MangoCord features in the flamecord.yml file. + +## How To (Compiling from source) + +To compile MangoCord, you need JDK8 or above, git, bash, maven, and an internet connection. + +Clone this repo, run `./mangocord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` + +Mangocord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/LuciaNishimiya/MangoCord/blob/main/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. + +## Contribute + +* Feel free to open a PR! We accept contributions. From fd655fcecfda58e114d9ddf515a30ab82881c470 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sun, 25 Jun 2023 20:03:20 -0400 Subject: [PATCH 498/499] Update README.md --- README.md | 59 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 78f319bf..66877e86 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,2 @@ - - - -MangoCord is a fork of Waterfall and Flamecord that protects your Minecraft server from bot attacks and exploits with its advanced set of antibot filtering features. MangoCord also fixes bugs, improves performance and adds new functionalities to your server. MangoCord is the ultimate solution for a secure and fast Minecraft network - -## Links -Free download MangoCord:
-https://github.com/LuciaNishimiya/MangoCord/releases
-https://builtbybit.com/resources/mangocord-mitigate-bots-exploits.27316/ -

-Discord Mango Studio:
-https://discord.gg/PeS8h8eJZJ - -## Feactures -* Our features are focused on the security of your Minecraft server preventing hacking with crash exploits, bots and other kind of dos attacks on the application layer. - -* **Bots**: We provides a powerful anti-bot solution programmed directly into the core of BungeeCord, with the ability to mitigate these attacks without hindering your server's performance. - -* **Anti-vpn/proxy**: Checks whether a connection is a proxy/VPN by utilizing web databases from over 10 webs, and additional websites can be added as well. - -* **Performance**: It reduces CPU usage and RAM usage by optimizing and reusing code, caching heavy getters, using libdeflate for faster compression/decompression of packets, and fixing memory leaks. - -* **GeyserMC compatibility**: MangoCord supports Geyser, a proxy that allows Bedrock Edition players to join Java Edition servers. It supports most Java features and cross-play between different platforms. - -* **Motd**: Incorporates customizable an advanced motd system that protects against null pink attacks - -* **Languages Supported**: Provides you with absolute flexibility by allowing you to fully customize all messages and texts of your server through the messages.yml configuration file. - -* **Exploit Fixes**: MangoCord specializes in providing better server security by fixing major exploits, performance flaws and bugs that Bungeecord already has, and that have not yet been fixed in WaterfallMC. - - -MangoCord is a FlameCord and Waterfall fork that protects your server from bot attacks and exploits done to your Minecraft Server by minimizing the impact received by those with our advanced set of antibot filtering features. MangoCord improves your server performance and reduces your CPU usage by cutting the amount of processes required to process packets. MangoCord has free official and community support on our Discord server. https://discord.gg/PeS8h8eJZJ . Visit our detailed guide to MangoCord configuration to know more about it's features and how to configure them. - - -## Why fork Waterfall? - -MangoCord was forked out of a desire for greater protection to be afforded to a Bungeecord-based proxy, which Waterfall currently cannot offer. - -MangoCord will track upstream Waterfall and merge changes as needed. - -## How to (Server Admins) - -Just drag an drop MangoCord .jar into your server folder and run it. - -You can customize many MangoCord features in the flamecord.yml file. - -## How To (Compiling from source) - -To compile MangoCord, you need JDK8 or above, git, bash, maven, and an internet connection. - -Clone this repo, run `./mangocord b` from *bash*, get jar from `FlameCord-Proxy/bootstrap/target` - -Mangocord is compiled like Waterfall does; Please follow the [CONTRIBUTING.md](https://github.com/LuciaNishimiya/MangoCord/blob/main/CONTRIBUTING.md) file. If you need help you can always contact us on Discord. - -## Contribute - -* Feel free to open a PR! We accept contributions. +##This repository has been moved to the repository at the link below. +This repository has been moved to [link to the new repository](https://github.com/LuciaNishimiya/MangoCord) due to the risk of the original project creator deleting it. From 4318082a5c1afc8b3dde2109f6e7d8919e5af293 Mon Sep 17 00:00:00 2001 From: Lucia Nishimiya Date: Sun, 25 Jun 2023 20:03:31 -0400 Subject: [PATCH 499/499] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66877e86..4806ed2c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -##This repository has been moved to the repository at the link below. +## This repository has been moved to the repository at the link below. This repository has been moved to [link to the new repository](https://github.com/LuciaNishimiya/MangoCord) due to the risk of the original project creator deleting it.