Skip to content

Commit d79050e

Browse files
committed
Check manual blocks before hosting and proxy
1 parent 04e4441 commit d79050e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

common/src/main/java/ru/violence/antivpn/common/model/checker/IPAPIChecker.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ public void checkPlayer(@NotNull IPChecker ipChecker, @NotNull String playerName
5757
throw BypassedException.INSTANCE;
5858
}
5959

60+
if (database.isBlocked(FieldType.PLAYER_NAME, playerName) ||
61+
database.isBlocked(FieldType.ISP, result.getIsp()) ||
62+
database.isBlocked(FieldType.ORG, result.getOrg()) ||
63+
database.isBlocked(FieldType.AS, result.getAs()) ||
64+
database.isBlocked(FieldType.ASNAME, result.getAsname())) {
65+
throw new ManuallyBlockedException(result);
66+
}
67+
6068
if (Config.IpApi.DENY_HOSTING && result.isHosting()) {
6169
if (Config.IpApi.BYPASS_COUNTRIES_HOSTING.contains(result.getCountryCode())) return;
6270
throw new HostingBlockedException(result);
@@ -66,14 +74,6 @@ public void checkPlayer(@NotNull IPChecker ipChecker, @NotNull String playerName
6674
if (Config.IpApi.BYPASS_COUNTRIES_PROXY.contains(result.getCountryCode())) return;
6775
throw new ProxyBlockedException(result);
6876
}
69-
70-
if (database.isBlocked(FieldType.PLAYER_NAME, playerName) ||
71-
database.isBlocked(FieldType.ISP, result.getIsp()) ||
72-
database.isBlocked(FieldType.ORG, result.getOrg()) ||
73-
database.isBlocked(FieldType.AS, result.getAs()) ||
74-
database.isBlocked(FieldType.ASNAME, result.getAsname())) {
75-
throw new ManuallyBlockedException(result);
76-
}
7777
}
7878

7979
@Override

0 commit comments

Comments
 (0)