2016-01-19 09:20:55 +01:00
|
|
|
package fr.xephi.authme.settings.properties;
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-12-23 23:22:05 +01:00
|
|
|
import ch.jalu.configme.Comment;
|
|
|
|
import ch.jalu.configme.SettingsHolder;
|
|
|
|
import ch.jalu.configme.properties.Property;
|
2016-01-03 15:22:32 +01:00
|
|
|
|
2015-12-31 16:35:38 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2016-12-23 23:22:05 +01:00
|
|
|
import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
|
|
|
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
2016-01-03 15:22:32 +01:00
|
|
|
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2017-03-05 10:58:29 +01:00
|
|
|
public final class ProtectionSettings implements SettingsHolder {
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-01-09 09:30:49 +01:00
|
|
|
@Comment("Enable some servers protection (country based login, antibot)")
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<Boolean> ENABLE_PROTECTION =
|
2016-03-16 19:07:00 +01:00
|
|
|
newProperty("Protection.enableProtection", false);
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-07-16 21:10:29 +02:00
|
|
|
@Comment("Apply the protection also to registered usernames")
|
|
|
|
public static final Property<Boolean> ENABLE_PROTECTION_REGISTERED =
|
|
|
|
newProperty("Protection.enableProtectionRegistered", true);
|
|
|
|
|
2023-09-24 17:26:16 +02:00
|
|
|
@Comment("Enable GeoIp database")
|
|
|
|
public static final Property<Boolean> ENABLE_GEOIP =
|
|
|
|
newProperty("Protection.geoIpDatabase.enabled", true);
|
|
|
|
|
2020-01-21 10:28:50 +01:00
|
|
|
@Comment({"The MaxMind clientId used to download the GeoIp database,",
|
2020-01-21 10:33:46 +01:00
|
|
|
"get one at https://www.maxmind.com/en/accounts/current/license-key",
|
|
|
|
"The EssentialsX project has a very useful tutorial on how to generate",
|
2021-12-25 15:38:07 +01:00
|
|
|
"the license key: https://github.com/EssentialsX/Wiki/blob/master/GeoIP.md"})
|
2020-01-21 10:28:50 +01:00
|
|
|
public static final Property<String> MAXMIND_API_CLIENT_ID =
|
|
|
|
newProperty("Protection.geoIpDatabase.clientId", "");
|
|
|
|
|
|
|
|
@Comment("The MaxMind licenseKey used to download the GeoIp database.")
|
|
|
|
public static final Property<String> MAXMIND_API_LICENSE_KEY =
|
|
|
|
newProperty("Protection.geoIpDatabase.licenseKey", "");
|
|
|
|
|
2016-10-23 21:12:49 +02:00
|
|
|
@Comment({
|
|
|
|
"Countries allowed to join the server and register. For country codes, see",
|
2018-03-17 03:00:24 +01:00
|
|
|
"https://dev.maxmind.com/geoip/legacy/codes/iso3166/",
|
2018-08-22 16:56:14 +02:00
|
|
|
"Use \"LOCALHOST\" for local addresses.",
|
2016-10-23 21:12:49 +02:00
|
|
|
"PLEASE USE QUOTES!"})
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<List<String>> COUNTRIES_WHITELIST =
|
2018-08-22 16:56:14 +02:00
|
|
|
newListProperty("Protection.countries", "US", "GB", "LOCALHOST");
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-10-23 21:12:49 +02:00
|
|
|
@Comment({
|
|
|
|
"Countries not allowed to join the server and register",
|
|
|
|
"PLEASE USE QUOTES!"})
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<List<String>> COUNTRIES_BLACKLIST =
|
2016-05-09 21:15:11 +02:00
|
|
|
newListProperty("Protection.countriesBlacklist", "A1");
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-01-09 09:30:49 +01:00
|
|
|
@Comment("Do we need to enable automatic antibot system?")
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<Boolean> ENABLE_ANTIBOT =
|
2016-05-23 10:03:10 +02:00
|
|
|
newProperty("Protection.enableAntiBot", true);
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-10-23 22:05:07 +02:00
|
|
|
@Comment("The interval in seconds")
|
|
|
|
public static final Property<Integer> ANTIBOT_INTERVAL =
|
|
|
|
newProperty("Protection.antiBotInterval", 5);
|
|
|
|
|
2016-10-23 21:12:49 +02:00
|
|
|
@Comment({
|
2016-10-23 22:05:07 +02:00
|
|
|
"Max number of players allowed to login in the interval",
|
2016-10-23 21:12:49 +02:00
|
|
|
"before the AntiBot system is enabled automatically"})
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<Integer> ANTIBOT_SENSIBILITY =
|
2016-05-23 10:03:10 +02:00
|
|
|
newProperty("Protection.antiBotSensibility", 10);
|
2015-12-31 16:35:38 +01:00
|
|
|
|
2016-01-09 09:30:49 +01:00
|
|
|
@Comment("Duration in minutes of the antibot automatic system")
|
2016-01-03 15:22:32 +01:00
|
|
|
public static final Property<Integer> ANTIBOT_DURATION =
|
2016-03-16 19:07:00 +01:00
|
|
|
newProperty("Protection.antiBotDuration", 10);
|
2016-01-03 15:22:32 +01:00
|
|
|
|
2016-10-05 22:08:29 +02:00
|
|
|
@Comment("Delay in seconds before the antibot activation")
|
|
|
|
public static final Property<Integer> ANTIBOT_DELAY =
|
|
|
|
newProperty("Protection.antiBotDelay", 60);
|
|
|
|
|
2018-03-05 21:00:24 +01:00
|
|
|
@Comment("Kicks the player that issued a command before the defined time after the join process")
|
2018-03-04 17:32:16 +01:00
|
|
|
public static final Property<Integer> QUICK_COMMANDS_DENIED_BEFORE_MILLISECONDS =
|
2018-03-05 21:00:24 +01:00
|
|
|
newProperty("Protection.quickCommands.denyCommandsBeforeMilliseconds", 1000);
|
2018-03-04 17:32:16 +01:00
|
|
|
|
2016-01-03 15:22:32 +01:00
|
|
|
private ProtectionSettings() {
|
|
|
|
}
|
|
|
|
|
2015-12-31 16:35:38 +01:00
|
|
|
}
|