mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-06-03 10:22:21 +00:00
Adding mongo support and /antivpn clearcache command
This commit is contained in:
@@ -16,12 +16,11 @@ public class VelocityConfig implements VPNConfig {
|
||||
"database.type", VelocityPlugin.INSTANCE),
|
||||
defaultDatabaseName = new ConfigDefault<>("kaurivpn",
|
||||
"database.database", VelocityPlugin.INSTANCE),
|
||||
defaultMongoURL = new ConfigDefault<>("", "database.mongoURL", VelocityPlugin.INSTANCE),
|
||||
defaultUsername = new ConfigDefault<>("root",
|
||||
"database.username", VelocityPlugin.INSTANCE),
|
||||
defaultPassword = new ConfigDefault<>("password",
|
||||
"database.password", VelocityPlugin.INSTANCE),
|
||||
defaultAuthDatabase = new ConfigDefault<>("admin",
|
||||
"database.auth", VelocityPlugin.INSTANCE),
|
||||
defaultIp = new ConfigDefault<>("localhost", "database.ip", VelocityPlugin.INSTANCE),
|
||||
defaultAlertMsg = new ConfigDefault<>("&8[&6KauriVPN&8] &e%player% &7has joined on a VPN/proxy" +
|
||||
" &8(&f%reason%&8) &7in location &8(&f%city%&7, &f%country%&8)", "alerts.message",
|
||||
@@ -32,6 +31,8 @@ public class VelocityConfig implements VPNConfig {
|
||||
VelocityPlugin.INSTANCE), defaultCommandsEnable = new ConfigDefault<>(false,
|
||||
"commands.enabled", VelocityPlugin.INSTANCE), defaultKickPlayers
|
||||
= new ConfigDefault<>(true, "kickPlayers", VelocityPlugin.INSTANCE),
|
||||
defaultUseCredentials = new ConfigDefault<>(true,
|
||||
"database.useCredentials", VelocityPlugin.INSTANCE),
|
||||
defaultAlertToStaff = new ConfigDefault<>(true, "alerts.enabled",
|
||||
VelocityPlugin.INSTANCE),
|
||||
defaultMetrics = new ConfigDefault<>(true, "bstats", VelocityPlugin.INSTANCE);
|
||||
@@ -42,10 +43,10 @@ public class VelocityConfig implements VPNConfig {
|
||||
Collections.singletonList("kick %player% VPNs are not allowed on our server!"), "commands.execute",
|
||||
VelocityPlugin.INSTANCE);
|
||||
|
||||
private String license, kickMessage, databaseType, databaseName, username, password, ip, alertMsg;
|
||||
private String license, kickMessage, databaseType, databaseName, mongoURL, username, password, ip, alertMsg;
|
||||
private List<String> prefixWhitelists, commands;
|
||||
private int port;
|
||||
private boolean cacheResults, databaseEnabled, commandsEnabled, kickPlayers, alertToStaff, metrics;
|
||||
private boolean cacheResults, useCredentials, databaseEnabled, commandsEnabled, kickPlayers, alertToStaff, metrics;
|
||||
|
||||
@Override
|
||||
public String getLicense() {
|
||||
@@ -97,6 +98,16 @@ public class VelocityConfig implements VPNConfig {
|
||||
return databaseEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useDatabaseCreds() {
|
||||
return useCredentials;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String mongoDatabaseURL() {
|
||||
return mongoURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDatabaseType() {
|
||||
return databaseType;
|
||||
@@ -150,8 +161,10 @@ public class VelocityConfig implements VPNConfig {
|
||||
cacheResults = cacheResultsDefault.get();
|
||||
prefixWhitelists = prefixWhitelistsDefault.get();
|
||||
databaseEnabled = defaultDatabaseEnabled.get();
|
||||
useCredentials = defaultUseCredentials.get();
|
||||
databaseType = defaultDatabaseType.get();
|
||||
databaseName = defaultDatabaseName.get();
|
||||
mongoURL = defaultMongoURL.get();
|
||||
username = defaultUsername.get();
|
||||
password = defaultPassword.get();
|
||||
ip = defaultIp.get();
|
||||
|
||||
Reference in New Issue
Block a user