Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 1141-optional-additional-2fa-auth

# Conflicts:
#	src/main/java/fr/xephi/authme/permission/PlayerPermission.java
#	src/main/java/fr/xephi/authme/service/BukkitService.java
This commit is contained in:
ljacqu
2018-03-20 23:07:25 +01:00
43 changed files with 306 additions and 50 deletions
@@ -4,15 +4,15 @@ import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.security.crypts.Argon2;
import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.settings.properties.EmailSettings;
import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.PluginSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.settings.properties.SecuritySettings;
import fr.xephi.authme.util.Utils;
import org.bukkit.Bukkit;
import javax.inject.Inject;
import java.util.Optional;
/**
* Logs warning messages in cases where the configured values suggest a misconfiguration.
@@ -29,6 +29,9 @@ public class SettingsWarner {
@Inject
private AuthMe authMe;
@Inject
private BukkitService bukkitService;
SettingsWarner() {
}
@@ -54,7 +57,7 @@ public class SettingsWarner {
}
// Warn if spigot.yml has settings.bungeecord set to true but config.yml has Hooks.bungeecord set to false
if (Utils.isSpigot() && Bukkit.spigot().getConfig().getBoolean("settings.bungeecord")
if (isTrue(bukkitService.isBungeeCordConfiguredForSpigot())
&& !settings.getProperty(HooksSettings.BUNGEECORD)) {
ConsoleLogger.warning("Note: Hooks.bungeecord is set to false but your server appears to be running in"
+ " bungeecord mode (see your spigot.yml). In order to allow the datasource caching and the"
@@ -69,4 +72,8 @@ public class SettingsWarner {
authMe.stopOrUnload();
}
}
private static boolean isTrue(Optional<Boolean> value) {
return value.isPresent() && value.get();
}
}
@@ -55,6 +55,10 @@ public final class ProtectionSettings implements SettingsHolder {
public static final Property<Integer> ANTIBOT_DELAY =
newProperty("Protection.antiBotDelay", 60);
@Comment("Kicks the player that issued a command before the defined time after the join process")
public static final Property<Integer> QUICK_COMMANDS_DENIED_BEFORE_MILLISECONDS =
newProperty("Protection.quickCommands.denyCommandsBeforeMilliseconds", 1000);
private ProtectionSettings() {
}