Close #449 Rename NewSetting class to Settings :)
This commit is contained in:
@@ -4,7 +4,7 @@ import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -20,7 +20,7 @@ import static fr.xephi.authme.util.BukkitService.TICKS_PER_SECOND;
|
||||
*/
|
||||
public class AntiBot {
|
||||
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
private final Messages messages;
|
||||
private final PermissionsManager permissionsManager;
|
||||
private final BukkitService bukkitService;
|
||||
@@ -29,7 +29,7 @@ public class AntiBot {
|
||||
private AntiBotStatus antiBotStatus = AntiBotStatus.DISABLED;
|
||||
|
||||
@Inject
|
||||
AntiBot(NewSetting settings, Messages messages, PermissionsManager permissionsManager,
|
||||
AntiBot(Settings settings, Messages messages, PermissionsManager permissionsManager,
|
||||
BukkitService bukkitService) {
|
||||
this.settings = settings;
|
||||
this.messages = messages;
|
||||
|
||||
@@ -34,7 +34,7 @@ import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PermissionsSystemType;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.security.crypts.SHA256;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SettingsMigrationService;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
@@ -103,7 +103,7 @@ public class AuthMe extends JavaPlugin {
|
||||
private Management management;
|
||||
private CommandHandler commandHandler;
|
||||
private PermissionsManager permsMan;
|
||||
private NewSetting newSettings;
|
||||
private Settings settings;
|
||||
private Messages messages;
|
||||
private DataSource database;
|
||||
private PluginHooks pluginHooks;
|
||||
@@ -193,8 +193,8 @@ public class AuthMe extends JavaPlugin {
|
||||
ConsoleLogger.setLogFile(new File(getDataFolder(), "authme.log"));
|
||||
|
||||
// Load settings and custom configurations, if it fails, stop the server due to security reasons.
|
||||
newSettings = createNewSetting();
|
||||
if (newSettings == null) {
|
||||
settings = createSettings();
|
||||
if (settings == null) {
|
||||
getLogger().warning("Could not load configuration. Aborting.");
|
||||
getServer().shutdown();
|
||||
setEnabled(false);
|
||||
@@ -202,11 +202,11 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
|
||||
// Apply settings to the logger
|
||||
ConsoleLogger.setLoggingOptions(newSettings);
|
||||
ConsoleLogger.setLoggingOptions(settings);
|
||||
|
||||
// Connect to the database and setup tables
|
||||
try {
|
||||
setupDatabase(newSettings);
|
||||
setupDatabase(settings);
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.logException("Fatal error occurred during database connection! "
|
||||
+ "Authme initialization aborted!", e);
|
||||
@@ -214,7 +214,7 @@ public class AuthMe extends JavaPlugin {
|
||||
return;
|
||||
}
|
||||
// Convert deprecated PLAINTEXT hash entries
|
||||
MigrationService.changePlainTextToSha256(newSettings, database, new SHA256());
|
||||
MigrationService.changePlainTextToSha256(settings, database, new SHA256());
|
||||
|
||||
// Injector initialization
|
||||
injector = new InjectorBuilder().addDefaultHandlers("fr.xephi.authme").create();
|
||||
@@ -227,20 +227,20 @@ public class AuthMe extends JavaPlugin {
|
||||
injector.provide(DataFolder.class, getDataFolder());
|
||||
|
||||
// Register elements we instantiate manually
|
||||
injector.register(NewSetting.class, newSettings);
|
||||
injector.register(Settings.class, settings);
|
||||
injector.register(DataSource.class, database);
|
||||
|
||||
instantiateServices(injector);
|
||||
|
||||
// Set up Metrics
|
||||
MetricsStarter.setupMetrics(this, newSettings);
|
||||
MetricsStarter.setupMetrics(this, settings);
|
||||
|
||||
// Set console filter
|
||||
setupConsoleFilter();
|
||||
|
||||
// Do a backup on start
|
||||
// TODO: maybe create a backup manager?
|
||||
new PerformBackup(this, newSettings).doBackup(PerformBackup.BackupCause.START);
|
||||
new PerformBackup(this, settings).doBackup(PerformBackup.BackupCause.START);
|
||||
|
||||
// Set up the BungeeCord hook
|
||||
setupBungeeCordHook();
|
||||
@@ -297,13 +297,13 @@ public class AuthMe extends JavaPlugin {
|
||||
*/
|
||||
private void showSettingsWarnings() {
|
||||
// Force single session disabled
|
||||
if (!newSettings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)) {
|
||||
if (!settings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)) {
|
||||
ConsoleLogger.warning("WARNING!!! By disabling ForceSingleSession, your server protection is inadequate!");
|
||||
}
|
||||
|
||||
// Session timeout disabled
|
||||
if (newSettings.getProperty(PluginSettings.SESSIONS_TIMEOUT) == 0
|
||||
&& newSettings.getProperty(PluginSettings.SESSIONS_ENABLED)) {
|
||||
if (settings.getProperty(PluginSettings.SESSIONS_TIMEOUT) == 0
|
||||
&& settings.getProperty(PluginSettings.SESSIONS_ENABLED)) {
|
||||
ConsoleLogger.warning("WARNING!!! You set session timeout to 0, this may cause security issues!");
|
||||
}
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class AuthMe extends JavaPlugin {
|
||||
int playersOnline = bukkitService.getOnlinePlayers().size();
|
||||
if (playersOnline < 1) {
|
||||
database.purgeLogged();
|
||||
} else if (newSettings.getProperty(SecuritySettings.USE_RELOAD_COMMAND_SUPPORT)) {
|
||||
} else if (settings.getProperty(SecuritySettings.USE_RELOAD_COMMAND_SUPPORT)) {
|
||||
for (PlayerAuth auth : database.getLoggedPlayers()) {
|
||||
if (auth != null) {
|
||||
auth.setLastLogin(new Date().getTime());
|
||||
@@ -357,7 +357,7 @@ public class AuthMe extends JavaPlugin {
|
||||
* Set up the BungeeCord hook.
|
||||
*/
|
||||
private void setupBungeeCordHook() {
|
||||
if (newSettings.getProperty(HooksSettings.BUNGEECORD)) {
|
||||
if (settings.getProperty(HooksSettings.BUNGEECORD)) {
|
||||
Messenger messenger = Bukkit.getMessenger();
|
||||
messenger.registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
messenger.registerIncomingPluginChannel(this, "BungeeCord", injector.getSingleton(BungeeCordMessage.class));
|
||||
@@ -369,12 +369,12 @@ public class AuthMe extends JavaPlugin {
|
||||
*
|
||||
* @return The settings instance, or null if it could not be constructed
|
||||
*/
|
||||
private NewSetting createNewSetting() {
|
||||
private Settings createSettings() {
|
||||
File configFile = new File(getDataFolder(), "config.yml");
|
||||
PropertyMap properties = SettingsFieldRetriever.getAllPropertyFields();
|
||||
SettingsMigrationService migrationService = new SettingsMigrationService();
|
||||
return FileUtils.copyFileFromResource(configFile, "config.yml")
|
||||
? new NewSetting(configFile, getDataFolder(), properties, migrationService)
|
||||
? new Settings(configFile, getDataFolder(), properties, migrationService)
|
||||
: null;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public class AuthMe extends JavaPlugin {
|
||||
* Set up the console filter.
|
||||
*/
|
||||
private void setupConsoleFilter() {
|
||||
if (!newSettings.getProperty(SecuritySettings.REMOVE_PASSWORD_FROM_CONSOLE)) {
|
||||
if (!settings.getProperty(SecuritySettings.REMOVE_PASSWORD_FROM_CONSOLE)) {
|
||||
return;
|
||||
}
|
||||
// Try to set the log4j filter
|
||||
@@ -414,8 +414,8 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
|
||||
// Do backup on stop if enabled
|
||||
if (newSettings != null) {
|
||||
new PerformBackup(this, newSettings).doBackup(PerformBackup.BackupCause.STOP);
|
||||
if (settings != null) {
|
||||
new PerformBackup(this, settings).doBackup(PerformBackup.BackupCause.STOP);
|
||||
}
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@@ -474,7 +474,7 @@ public class AuthMe extends JavaPlugin {
|
||||
|
||||
// Stop/unload the server/plugin as defined in the configuration
|
||||
public void stopOrUnload() {
|
||||
if (newSettings == null || newSettings.getProperty(SecuritySettings.STOP_SERVER_ON_PROBLEM)) {
|
||||
if (settings == null || settings.getProperty(SecuritySettings.STOP_SERVER_ON_PROBLEM)) {
|
||||
ConsoleLogger.warning("THE SERVER IS GOING TO SHUT DOWN AS DEFINED IN THE CONFIGURATION!");
|
||||
getServer().shutdown();
|
||||
} else {
|
||||
@@ -492,7 +492,7 @@ public class AuthMe extends JavaPlugin {
|
||||
* @throws IOException if flat file cannot be read
|
||||
* @see AuthMe#database
|
||||
*/
|
||||
public void setupDatabase(NewSetting settings) throws ClassNotFoundException, SQLException, IOException {
|
||||
public void setupDatabase(Settings settings) throws ClassNotFoundException, SQLException, IOException {
|
||||
if (this.database != null) {
|
||||
this.database.close();
|
||||
}
|
||||
@@ -552,7 +552,7 @@ public class AuthMe extends JavaPlugin {
|
||||
limboCache.restoreData(player);
|
||||
limboCache.removeFromCache(player);
|
||||
} else {
|
||||
if (newSettings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
Location loc = spawnLoader.getPlayerLocationOrSpawn(player);
|
||||
final PlayerAuth auth = PlayerAuth.builder()
|
||||
.name(player.getName().toLowerCase())
|
||||
@@ -560,8 +560,8 @@ public class AuthMe extends JavaPlugin {
|
||||
.location(loc).build();
|
||||
database.updateQuitLoc(auth);
|
||||
}
|
||||
if (newSettings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)
|
||||
&& !newSettings.getProperty(RestrictionSettings.NO_TELEPORT)) {
|
||||
if (settings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)
|
||||
&& !settings.getProperty(RestrictionSettings.NO_TELEPORT)) {
|
||||
PlayerDataStorage playerDataStorage = injector.getIfAvailable(PlayerDataStorage.class);
|
||||
if (playerDataStorage != null && !playerDataStorage.hasData(player)) {
|
||||
playerDataStorage.saveData(player);
|
||||
@@ -576,7 +576,7 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
|
||||
private void scheduleRecallEmailTask() {
|
||||
if (!newSettings.getProperty(RECALL_PLAYERS)) {
|
||||
if (!settings.getProperty(RECALL_PLAYERS)) {
|
||||
return;
|
||||
}
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(this, new Runnable() {
|
||||
@@ -592,7 +592,7 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1, 1200 * newSettings.getProperty(EmailSettings.DELAY_RECALL));
|
||||
}, 1, 1200 * settings.getProperty(EmailSettings.DELAY_RECALL));
|
||||
}
|
||||
|
||||
public String replaceAllInfo(String message, Player player) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.xephi.authme;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import fr.xephi.authme.output.LogLevel;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
@@ -58,7 +58,7 @@ public final class ConsoleLogger {
|
||||
*
|
||||
* @param settings The settings instance
|
||||
*/
|
||||
public static void setLoggingOptions(NewSetting settings) {
|
||||
public static void setLoggingOptions(Settings settings) {
|
||||
ConsoleLogger.logLevel = settings.getProperty(PluginSettings.LOG_LEVEL);
|
||||
ConsoleLogger.useLogging = settings.getProperty(SecuritySettings.USE_LOGGING);
|
||||
if (useLogging) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme;
|
||||
|
||||
import fr.xephi.authme.datasource.DataSourceType;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.BackupSettings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
@@ -30,7 +30,7 @@ public class PerformBackup {
|
||||
private final String tblname;
|
||||
private final String path;
|
||||
private final File dataFolder;
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
|
||||
/**
|
||||
* Constructor for PerformBackup.
|
||||
@@ -38,7 +38,7 @@ public class PerformBackup {
|
||||
* @param instance AuthMe
|
||||
* @param settings The plugin settings
|
||||
*/
|
||||
public PerformBackup(AuthMe instance, NewSetting settings) {
|
||||
public PerformBackup(AuthMe instance, Settings settings) {
|
||||
this.dataFolder = instance.getDataFolder();
|
||||
this.settings = settings;
|
||||
this.dbName = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ package fr.xephi.authme.cache;
|
||||
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -21,7 +21,7 @@ public class CaptchaManager implements SettingsDependent {
|
||||
private int captchaLength;
|
||||
|
||||
@Inject
|
||||
CaptchaManager(NewSetting settings) {
|
||||
CaptchaManager(Settings settings) {
|
||||
this.playerCounts = new ConcurrentHashMap<>();
|
||||
this.captchaCodes = new ConcurrentHashMap<>();
|
||||
reload(settings);
|
||||
@@ -123,7 +123,7 @@ public class CaptchaManager implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
this.isEnabled = settings.getProperty(SecuritySettings.USE_CAPTCHA);
|
||||
this.threshold = settings.getProperty(SecuritySettings.MAX_LOGIN_TRIES_BEFORE_CAPTCHA);
|
||||
this.captchaLength = settings.getProperty(SecuritySettings.CAPTCHA_LENGTH);
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package fr.xephi.authme.cache;
|
||||
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -22,7 +22,7 @@ public class SessionManager implements SettingsDependent {
|
||||
private int timeoutInMinutes;
|
||||
|
||||
@Inject
|
||||
SessionManager(NewSetting settings) {
|
||||
SessionManager(Settings settings) {
|
||||
reload(settings);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SessionManager implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
timeoutInMinutes = settings.getProperty(PluginSettings.SESSIONS_TIMEOUT);
|
||||
boolean oldEnabled = enabled;
|
||||
enabled = timeoutInMinutes > 0 && settings.getProperty(PluginSettings.SESSIONS_ENABLED);
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ package fr.xephi.authme.cache;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
@@ -30,7 +30,7 @@ public class TempbanManager implements SettingsDependent {
|
||||
private int length;
|
||||
|
||||
@Inject
|
||||
TempbanManager(BukkitService bukkitService, Messages messages, NewSetting settings) {
|
||||
TempbanManager(BukkitService bukkitService, Messages messages, Settings settings) {
|
||||
this.ipLoginFailureCounts = new ConcurrentHashMap<>();
|
||||
this.bukkitService = bukkitService;
|
||||
this.messages = messages;
|
||||
@@ -108,7 +108,7 @@ public class TempbanManager implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
this.isEnabled = settings.getProperty(SecuritySettings.TEMPBAN_ON_MAX_LOGINS);
|
||||
this.threshold = settings.getProperty(SecuritySettings.MAX_LOGIN_TEMPBAN);
|
||||
this.length = settings.getProperty(SecuritySettings.TEMPBAN_LENGTH);
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.xephi.authme.cache.limbo;
|
||||
|
||||
import fr.xephi.authme.cache.backup.PlayerDataStorage;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
@@ -23,12 +23,12 @@ public class LimboCache {
|
||||
private final Map<String, PlayerData> cache = new ConcurrentHashMap<>();
|
||||
|
||||
private PlayerDataStorage playerDataStorage;
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
private PermissionsManager permissionsManager;
|
||||
private SpawnLoader spawnLoader;
|
||||
|
||||
@Inject
|
||||
LimboCache(NewSetting settings, PermissionsManager permissionsManager,
|
||||
LimboCache(Settings settings, PermissionsManager permissionsManager,
|
||||
SpawnLoader spawnLoader, PlayerDataStorage playerDataStorage) {
|
||||
this.settings = settings;
|
||||
this.permissionsManager = permissionsManager;
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.xephi.authme.command;
|
||||
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.domain.Property;
|
||||
import fr.xephi.authme.util.ValidationService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -18,7 +18,7 @@ public class CommandService {
|
||||
@Inject
|
||||
private Messages messages;
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
@Inject
|
||||
private ValidationService validationService;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CommandService {
|
||||
*
|
||||
* @return The settings manager
|
||||
*/
|
||||
public NewSetting getSettings() {
|
||||
public Settings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ReloadCommand implements ExecutableCommand {
|
||||
private Injector injector;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
|
||||
@@ -10,7 +10,7 @@ import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.permission.DefaultPermission;
|
||||
import fr.xephi.authme.permission.PermissionNode;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -48,7 +48,7 @@ public class HelpProvider implements SettingsDependent {
|
||||
private String helpHeader;
|
||||
|
||||
@Inject
|
||||
HelpProvider(PermissionsManager permissionsManager, NewSetting settings) {
|
||||
HelpProvider(PermissionsManager permissionsManager, Settings settings) {
|
||||
this.permissionsManager = permissionsManager;
|
||||
reload(settings);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class HelpProvider implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
helpHeader = settings.getProperty(PluginSettings.HELP_HEADER);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.ConverterSettings;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -20,11 +20,11 @@ import java.io.IOException;
|
||||
public class CrazyLoginConverter implements Converter {
|
||||
|
||||
private final DataSource database;
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
private final File dataFolder;
|
||||
|
||||
@Inject
|
||||
CrazyLoginConverter(@DataFolder File dataFolder, DataSource dataSource, NewSetting settings) {
|
||||
CrazyLoginConverter(@DataFolder File dataFolder, DataSource dataSource, Settings settings) {
|
||||
this.dataFolder = dataFolder;
|
||||
this.database = dataSource;
|
||||
this.settings = settings;
|
||||
|
||||
@@ -6,7 +6,7 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.ConverterSettings;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -24,12 +24,12 @@ import java.util.Map.Entry;
|
||||
public class RakamakConverter implements Converter {
|
||||
|
||||
private final DataSource database;
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
private final File pluginFolder;
|
||||
private final PasswordSecurity passwordSecurity;
|
||||
|
||||
@Inject
|
||||
RakamakConverter(@DataFolder File dataFolder, DataSource dataSource, NewSetting settings,
|
||||
RakamakConverter(@DataFolder File dataFolder, DataSource dataSource, Settings settings,
|
||||
PasswordSecurity passwordSecurity) {
|
||||
this.database = dataSource;
|
||||
this.settings = settings;
|
||||
|
||||
@@ -7,19 +7,19 @@ import fr.xephi.authme.datasource.DataSourceType;
|
||||
import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class SqliteToSql implements Converter {
|
||||
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
private final DataSource dataSource;
|
||||
private final Messages messages;
|
||||
|
||||
@Inject
|
||||
SqliteToSql(NewSetting settings, DataSource dataSource, Messages messages) {
|
||||
SqliteToSql(Settings settings, DataSource dataSource, Messages messages) {
|
||||
this.settings = settings;
|
||||
this.dataSource = dataSource;
|
||||
this.messages = messages;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.xephi.authme.datasource;
|
||||
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ public final class Columns {
|
||||
public final String ID;
|
||||
public final String IS_LOGGED;
|
||||
|
||||
public Columns(NewSetting settings) {
|
||||
public Columns(Settings settings) {
|
||||
NAME = settings.getProperty(DatabaseSettings.MYSQL_COL_NAME);
|
||||
REAL_NAME = settings.getProperty(DatabaseSettings.MYSQL_COL_REALNAME);
|
||||
PASSWORD = settings.getProperty(DatabaseSettings.MYSQL_COL_PASSWORD);
|
||||
|
||||
@@ -8,7 +8,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.security.crypts.XFBCRYPT;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
@@ -45,7 +45,7 @@ public class MySQL implements DataSource {
|
||||
private int phpBbGroup;
|
||||
private String wordpressPrefix;
|
||||
|
||||
public MySQL(NewSetting settings) throws ClassNotFoundException, SQLException, PoolInitializationException {
|
||||
public MySQL(Settings settings) throws ClassNotFoundException, SQLException, PoolInitializationException {
|
||||
setParameters(settings);
|
||||
|
||||
// Set the connection arguments (and check if connection is ok)
|
||||
@@ -76,12 +76,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
MySQL(NewSetting settings, HikariDataSource hikariDataSource) {
|
||||
MySQL(Settings settings, HikariDataSource hikariDataSource) {
|
||||
ds = hikariDataSource;
|
||||
setParameters(settings);
|
||||
}
|
||||
|
||||
private void setParameters(NewSetting settings) {
|
||||
private void setParameters(Settings settings) {
|
||||
this.host = settings.getProperty(DatabaseSettings.MYSQL_HOST);
|
||||
this.port = settings.getProperty(DatabaseSettings.MYSQL_PORT);
|
||||
this.username = settings.getProperty(DatabaseSettings.MYSQL_USERNAME);
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.google.common.annotations.VisibleForTesting;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SQLite implements DataSource {
|
||||
* @throws ClassNotFoundException if no driver could be found for the datasource
|
||||
* @throws SQLException when initialization of a SQL datasource failed
|
||||
*/
|
||||
public SQLite(NewSetting settings) throws ClassNotFoundException, SQLException {
|
||||
public SQLite(Settings settings) throws ClassNotFoundException, SQLException {
|
||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||
this.col = new Columns(settings);
|
||||
@@ -53,7 +53,7 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
SQLite(NewSetting settings, Connection connection) {
|
||||
SQLite(Settings settings, Connection connection) {
|
||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||
this.col = new Columns(settings);
|
||||
|
||||
@@ -7,7 +7,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
@@ -27,7 +27,7 @@ public class BungeeCordMessage implements PluginMessageListener {
|
||||
private PlayerCache playerCache;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
BungeeCordMessage() { }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.xephi.authme.initialization;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import org.mcstats.Metrics;
|
||||
@@ -15,7 +15,7 @@ public class MetricsStarter {
|
||||
private MetricsStarter() {
|
||||
}
|
||||
|
||||
public static void setupMetrics(AuthMe plugin, NewSetting settings) {
|
||||
public static void setupMetrics(AuthMe plugin, Settings settings) {
|
||||
try {
|
||||
final Metrics metrics = new Metrics(plugin);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.xephi.authme.initialization;
|
||||
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
* Interface for classes that keep a local copy of certain settings.
|
||||
@@ -12,5 +12,5 @@ public interface SettingsDependent {
|
||||
*
|
||||
* @param settings the settings instance
|
||||
*/
|
||||
void reload(NewSetting settings);
|
||||
void reload(Settings settings);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
@@ -56,7 +56,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
public static final ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<>();
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
@Inject
|
||||
private Messages m;
|
||||
@Inject
|
||||
|
||||
@@ -4,7 +4,7 @@ import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.util.ValidationService;
|
||||
import org.bukkit.entity.Entity;
|
||||
@@ -27,7 +27,7 @@ class ListenerService implements SettingsDependent {
|
||||
private boolean isRegistrationForced;
|
||||
|
||||
@Inject
|
||||
ListenerService(NewSetting settings, DataSource dataSource, PluginHooks pluginHooks,
|
||||
ListenerService(Settings settings, DataSource dataSource, PluginHooks pluginHooks,
|
||||
PlayerCache playerCache, ValidationService validationService) {
|
||||
this.dataSource = dataSource;
|
||||
this.pluginHooks = pluginHooks;
|
||||
@@ -74,7 +74,7 @@ class ListenerService implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
isRegistrationForced = settings.getProperty(RegistrationSettings.FORCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
@@ -32,7 +32,7 @@ import java.util.regex.Pattern;
|
||||
class OnJoinVerifier implements Reloadable {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
@Inject
|
||||
|
||||
@@ -5,7 +5,7 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -30,7 +30,7 @@ public class ProtocolLibService implements SettingsDependent {
|
||||
private PlayerCache playerCache;
|
||||
|
||||
@Inject
|
||||
ProtocolLibService(AuthMe plugin, NewSetting settings, BukkitService bukkitService, PlayerCache playerCache) {
|
||||
ProtocolLibService(AuthMe plugin, Settings settings, BukkitService bukkitService, PlayerCache playerCache) {
|
||||
this.plugin = plugin;
|
||||
this.bukkitService = bukkitService;
|
||||
this.playerCache = playerCache;
|
||||
@@ -99,7 +99,7 @@ public class ProtocolLibService implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
boolean oldProtectInventory = this.protectInvBeforeLogin;
|
||||
|
||||
this.protectInvBeforeLogin = settings.getProperty(RestrictionSettings.PROTECT_INVENTORY_BEFORE_LOGIN);
|
||||
|
||||
@@ -3,7 +3,7 @@ package fr.xephi.authme.mail;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
@@ -33,7 +33,7 @@ public class SendMailSSL {
|
||||
@Inject
|
||||
private AuthMe plugin;
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.xephi.authme.output;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -30,7 +30,7 @@ public class Messages implements SettingsDependent {
|
||||
* @param settings The settings
|
||||
*/
|
||||
@Inject
|
||||
Messages(NewSetting settings) {
|
||||
Messages(Settings settings) {
|
||||
reload(settings);
|
||||
this.defaultFile = settings.getDefaultMessagesFile();
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class Messages implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
File messageFile = settings.getMessagesFile();
|
||||
this.configuration = YamlConfiguration.loadConfiguration(messageFile);
|
||||
this.fileName = messageFile.getName();
|
||||
|
||||
@@ -4,7 +4,7 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.PlayerData;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
@@ -22,7 +22,7 @@ public class AuthGroupHandler implements Reloadable {
|
||||
private PermissionsManager permissionsManager;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private LimboCache limboCache;
|
||||
|
||||
@@ -6,7 +6,7 @@ import fr.xephi.authme.permission.AuthGroupHandler;
|
||||
import fr.xephi.authme.permission.AuthGroupType;
|
||||
import fr.xephi.authme.permission.PermissionNode;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.domain.Property;
|
||||
import fr.xephi.authme.util.ValidationService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -20,7 +20,7 @@ import javax.inject.Inject;
|
||||
public class ProcessService {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private Messages messages;
|
||||
@@ -50,7 +50,7 @@ public class ProcessService {
|
||||
*
|
||||
* @return settings manager
|
||||
*/
|
||||
public NewSetting getSettings() {
|
||||
public Settings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import fr.xephi.authme.events.PasswordEncryptionEvent;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.security.crypts.EncryptionMethod;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
@@ -19,7 +19,7 @@ import javax.inject.Inject;
|
||||
public class PasswordSecurity implements Reloadable {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
|
||||
@@ -5,7 +5,7 @@ import fr.xephi.authme.security.crypts.description.HasSalt;
|
||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||
import fr.xephi.authme.security.crypts.description.SaltType;
|
||||
import fr.xephi.authme.security.crypts.description.Usage;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class BCRYPT implements EncryptionMethod {
|
||||
private final int bCryptLog2Rounds;
|
||||
|
||||
@Inject
|
||||
public BCRYPT(NewSetting settings) {
|
||||
public BCRYPT(Settings settings) {
|
||||
bCryptLog2Rounds = settings.getProperty(HooksSettings.BCRYPT_LOG2_ROUND);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import fr.xephi.authme.security.crypts.description.HasSalt;
|
||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||
import fr.xephi.authme.security.crypts.description.SaltType;
|
||||
import fr.xephi.authme.security.crypts.description.Usage;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -19,7 +19,7 @@ public class SALTED2MD5 extends SeparateSaltMethod {
|
||||
private final int saltLength;
|
||||
|
||||
@Inject
|
||||
public SALTED2MD5(NewSetting settings) {
|
||||
public SALTED2MD5(Settings settings) {
|
||||
saltLength = settings.getProperty(SecuritySettings.DOUBLE_MD5_SALT_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.google.common.io.ByteStreams;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -30,7 +30,7 @@ public class BungeeService implements SettingsDependent {
|
||||
* @param settings AuthMe settings.
|
||||
*/
|
||||
@Inject
|
||||
BungeeService(AuthMe plugin, BukkitService bukkitService, NewSetting settings) {
|
||||
BungeeService(AuthMe plugin, BukkitService bukkitService, Settings settings) {
|
||||
this.plugin = plugin;
|
||||
this.bukkitService = bukkitService;
|
||||
reload(settings);
|
||||
@@ -100,7 +100,7 @@ public class BungeeService implements SettingsDependent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload(NewSetting settings) {
|
||||
public void reload(Settings settings) {
|
||||
this.isEnabled = settings.getProperty(HooksSettings.BUNGEECORD);
|
||||
this.bungeeServer = settings.getProperty(HooksSettings.BUNGEECORD_SERVER);
|
||||
}
|
||||
|
||||
+6
-6
@@ -28,9 +28,9 @@ import java.util.Map;
|
||||
import static fr.xephi.authme.util.FileUtils.copyFileFromResource;
|
||||
|
||||
/**
|
||||
* The new settings manager.
|
||||
* The AuthMe settings manager.
|
||||
*/
|
||||
public class NewSetting {
|
||||
public class Settings {
|
||||
|
||||
private final File pluginFolder;
|
||||
private final File configFile;
|
||||
@@ -50,8 +50,8 @@ public class NewSetting {
|
||||
* @param propertyMap Collection of all available settings
|
||||
* @param migrationService Migration service to check the settings file with
|
||||
*/
|
||||
public NewSetting(File configFile, File pluginFolder, PropertyMap propertyMap,
|
||||
SettingsMigrationService migrationService) {
|
||||
public Settings(File configFile, File pluginFolder, PropertyMap propertyMap,
|
||||
SettingsMigrationService migrationService) {
|
||||
this.configuration = YamlConfiguration.loadConfiguration(configFile);
|
||||
this.configFile = configFile;
|
||||
this.pluginFolder = pluginFolder;
|
||||
@@ -70,8 +70,8 @@ public class NewSetting {
|
||||
* @param migrationService Migration service, or null to skip migration checks
|
||||
*/
|
||||
@VisibleForTesting
|
||||
NewSetting(FileConfiguration configuration, File configFile, File pluginFolder, PropertyMap propertyMap,
|
||||
SettingsMigrationService migrationService) {
|
||||
Settings(FileConfiguration configuration, File configFile, File pluginFolder, PropertyMap propertyMap,
|
||||
SettingsMigrationService migrationService) {
|
||||
this.configuration = configuration;
|
||||
this.configFile = configFile;
|
||||
this.pluginFolder = pluginFolder;
|
||||
@@ -31,7 +31,7 @@ import java.io.IOException;
|
||||
public class SpawnLoader implements Reloadable {
|
||||
|
||||
private final File authMeConfigurationFile;
|
||||
private final NewSetting settings;
|
||||
private final Settings settings;
|
||||
private final PluginHooks pluginHooks;
|
||||
private FileConfiguration authMeConfiguration;
|
||||
private String[] spawnPriority;
|
||||
@@ -46,7 +46,7 @@ public class SpawnLoader implements Reloadable {
|
||||
* @param dataSource The plugin auth database instance
|
||||
*/
|
||||
@Inject
|
||||
SpawnLoader(@DataFolder File pluginFolder, NewSetting settings, PluginHooks pluginHooks,
|
||||
SpawnLoader(@DataFolder File pluginFolder, Settings settings, PluginHooks pluginHooks,
|
||||
DataSource dataSource) {
|
||||
File spawnFile = new File(pluginFolder, "spawn.yml");
|
||||
// TODO ljacqu 20160312: Check if resource could be copied and handle the case if not
|
||||
|
||||
@@ -6,7 +6,7 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.PlayerData;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
@@ -26,7 +26,7 @@ public class PlayerDataTaskManager {
|
||||
private Messages messages;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@@ -4,7 +4,7 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PurgeSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
@@ -24,7 +24,7 @@ import static fr.xephi.authme.util.StringUtils.makePath;
|
||||
class PurgeExecutor {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
|
||||
@@ -3,7 +3,7 @@ package fr.xephi.authme.task.purge;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PurgeSettings;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import fr.xephi.authme.util.CollectionUtils;
|
||||
@@ -25,7 +25,7 @@ public class PurgeService {
|
||||
private DataSource dataSource;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private PermissionsManager permissionsManager;
|
||||
|
||||
@@ -10,7 +10,7 @@ import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.security.crypts.SHA256;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
|
||||
@@ -31,7 +31,7 @@ public final class MigrationService {
|
||||
* @param dataSource The data source
|
||||
* @param authmeSha256 Instance to the AuthMe SHA256 encryption method implementation
|
||||
*/
|
||||
public static void changePlainTextToSha256(NewSetting settings, DataSource dataSource,
|
||||
public static void changePlainTextToSha256(Settings settings, DataSource dataSource,
|
||||
SHA256 authmeSha256) {
|
||||
if (HashAlgorithm.PLAINTEXT == settings.getProperty(SecuritySettings.PASSWORD_HASH)) {
|
||||
ConsoleLogger.warning("Your HashAlgorithm has been detected as plaintext and is now deprecated;"
|
||||
@@ -61,7 +61,7 @@ public final class MigrationService {
|
||||
* @param dataSource The data source
|
||||
* @return The converted datasource (SQLite), or null if no migration was necessary
|
||||
*/
|
||||
public static DataSource convertFlatfileToSqlite(NewSetting settings, DataSource dataSource) {
|
||||
public static DataSource convertFlatfileToSqlite(Settings settings, DataSource dataSource) {
|
||||
if (DataSourceType.FILE == settings.getProperty(DatabaseSettings.BACKEND)) {
|
||||
ConsoleLogger.warning("FlatFile backend has been detected and is now deprecated; it will be changed "
|
||||
+ "to SQLite... Connection will be impossible until conversion is done!");
|
||||
|
||||
@@ -10,7 +10,7 @@ import fr.xephi.authme.events.AuthMeTeleportEvent;
|
||||
import fr.xephi.authme.events.FirstSpawnTeleportEvent;
|
||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import org.bukkit.Location;
|
||||
@@ -30,7 +30,7 @@ import static fr.xephi.authme.settings.properties.RestrictionSettings.TELEPORT_U
|
||||
public class TeleportationService implements Reloadable {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.permission.PermissionsManager;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.domain.Property;
|
||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
||||
@@ -27,7 +27,7 @@ import java.util.regex.Pattern;
|
||||
public class ValidationService implements Reloadable {
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
private Settings settings;
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
@Inject
|
||||
|
||||
Reference in New Issue
Block a user