mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-24 09:37:42 +01:00
Implement #1483
This commit is contained in:
parent
74c06346d8
commit
6a5f335e16
@ -5,9 +5,12 @@ import fr.xephi.authme.ConsoleLogger;
|
|||||||
import fr.xephi.authme.security.HashAlgorithm;
|
import fr.xephi.authme.security.HashAlgorithm;
|
||||||
import fr.xephi.authme.security.crypts.Argon2;
|
import fr.xephi.authme.security.crypts.Argon2;
|
||||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
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.PluginSettings;
|
||||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import fr.xephi.authme.util.Utils;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -50,6 +53,14 @@ public class SettingsWarner {
|
|||||||
ConsoleLogger.warning("Warning: Session timeout needs to be positive in order to work!");
|
ConsoleLogger.warning("Warning: Session timeout needs to be positive in order to work!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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")
|
||||||
|
&& !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 AuthMeBungee" +
|
||||||
|
" add-on to work properly you have to enable this option!");
|
||||||
|
}
|
||||||
|
|
||||||
// Check if argon2 library is present and can be loaded
|
// Check if argon2 library is present and can be loaded
|
||||||
if (settings.getProperty(SecuritySettings.PASSWORD_HASH).equals(HashAlgorithm.ARGON2)
|
if (settings.getProperty(SecuritySettings.PASSWORD_HASH).equals(HashAlgorithm.ARGON2)
|
||||||
&& !Argon2.isLibraryLoaded()) {
|
&& !Argon2.isLibraryLoaded()) {
|
||||||
|
@ -22,6 +22,20 @@ public final class Utils {
|
|||||||
private Utils() {
|
private Utils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if the running server instance is craftbukkit or spigot based.
|
||||||
|
*
|
||||||
|
* @return true if the running server instance is spigot-based.
|
||||||
|
*/
|
||||||
|
public static boolean isSpigot() {
|
||||||
|
try {
|
||||||
|
Class.forName("org.spigotmc.SpigotConfig");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile Pattern sneaky without throwing Exception.
|
* Compile Pattern sneaky without throwing Exception.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user