mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-06-03 18:32:19 +00:00
Adding universal config API and adding allowed/blocked country config
This commit is contained in:
@@ -41,10 +41,14 @@ public class VelocityConfig implements VPNConfig {
|
||||
private final ConfigDefault<List<String>> prefixWhitelistsDefault = new ConfigDefault<>(new ArrayList<>(),
|
||||
"prefixWhitelists", VelocityPlugin.INSTANCE), defaultCommands = new ConfigDefault<>(
|
||||
Collections.singletonList("kick %player% VPNs are not allowed on our server!"), "commands.execute",
|
||||
VelocityPlugin.INSTANCE);
|
||||
VelocityPlugin.INSTANCE),
|
||||
defBlockedCountries = new ConfigDefault<>(new ArrayList<>(), "blockedCountries",
|
||||
VelocityPlugin.INSTANCE),
|
||||
defAllowedCountries = new ConfigDefault<>(new ArrayList<>(), "allowedCountries",
|
||||
VelocityPlugin.INSTANCE);
|
||||
|
||||
private String license, kickMessage, databaseType, databaseName, mongoURL, username, password, ip, alertMsg;
|
||||
private List<String> prefixWhitelists, commands;
|
||||
private List<String> prefixWhitelists, commands, allowedCountries, blockedCountries;
|
||||
private int port;
|
||||
private boolean cacheResults, useCredentials, databaseEnabled, commandsEnabled, kickPlayers, alertToStaff, metrics;
|
||||
|
||||
@@ -133,6 +137,16 @@ public class VelocityConfig implements VPNConfig {
|
||||
return ip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> allowedCountries() {
|
||||
return allowedCountries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> blockedCountries() {
|
||||
return blockedCountries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
if(port == -1) {
|
||||
@@ -175,5 +189,7 @@ public class VelocityConfig implements VPNConfig {
|
||||
alertToStaff = defaultAlertToStaff.get();
|
||||
alertMsg = defaultAlertMsg.get();
|
||||
metrics = defaultMetrics.get();
|
||||
blockedCountries = defBlockedCountries.get();
|
||||
allowedCountries = defAllowedCountries.get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user