Skip to content

Commit

Permalink
fixed security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ZetaMap authored Mar 14, 2023
1 parent 90c057c commit 225621f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/util/AntiVpn.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class AntiVpn {
public static String apiToken = "";

private boolean foundVpn = false;
private boolean requestFinished = false;

private AntiVpn() {
}
Expand All @@ -30,6 +31,7 @@ public static boolean checkIP(String ip) {

if (!content.has("security")) throw new Exception(content.getString("message"));
test.foundVpn = content.get("security").get("vpn").asBool();
test.requestFinished = true;

}, f -> {
Log.warn("Anti VPN: An error occurred while checking the player's IP");
Expand All @@ -41,8 +43,10 @@ public static boolean checkIP(String ip) {
test.foundVpn = vpnServersList.contains(ip);

} else Log.debug("The reference file was not loaded. The player's IP will therefore not be verified.");
test.requestFinished = true;
});


while (!test.requestFinished) {}
return test.foundVpn;
}

Expand Down

0 comments on commit 225621f

Please sign in to comment.