Configurable email for proxy check

This commit is contained in:
LinsaFTW 2023-04-19 19:55:04 -03:00
parent 24a60ab157
commit d45486c334
3 changed files with 17 additions and 18 deletions

View File

@ -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<String> 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);

View File

@ -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);

View File

@ -1,11 +1,11 @@
From d303d32c4a69eb36d79d5457411ab60da98416ad Mon Sep 17 00:00:00 2001
From d62bc19cc15ac54fc3a5bd127b859f336cd50415 Mon Sep 17 00:00:00 2001
From: xIsm4 <soportexism4@gmail.com>
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);