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] 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 6689b7d..6459b3f 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 a2130a0..86692b8 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);