cleanup command pre process

This commit is contained in:
DNx5
2015-11-02 05:51:07 +07:00
parent e60a5190f9
commit da9cfc93d3
2 changed files with 39 additions and 49 deletions
@@ -1,22 +1,16 @@
package fr.xephi.authme.settings;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.bukkit.configuration.file.YamlConfiguration;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.DataSource.DataSourceType;
import fr.xephi.authme.security.HashAlgorithm;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public final class Settings extends YamlConfiguration {
@@ -193,21 +187,22 @@ public final class Settings extends YamlConfiguration {
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
allowCommands = configFile.getStringList("settings.restrictions.allowCommands");
if (configFile.contains("allowCommands")) {
if (!allowCommands.contains("/login"))
allowCommands.add("/login");
if (!allowCommands.contains("/register"))
allowCommands.add("/register");
if (!allowCommands.contains("/l"))
allowCommands.add("/l");
if (!allowCommands.contains("/reg"))
allowCommands.add("/reg");
if (!allowCommands.contains("/email"))
allowCommands.add("/email");
if (!allowCommands.contains("/captcha"))
allowCommands.add("/captcha");
allowCommands = new ArrayList<>();
for (String cmd : configFile.getStringList("settings.restrictions.allowCommands")) {
allowCommands.add(cmd.toLowerCase());
}
if (!allowCommands.contains("/login"))
allowCommands.add("/login");
if (!allowCommands.contains("/register"))
allowCommands.add("/register");
if (!allowCommands.contains("/l"))
allowCommands.add("/l");
if (!allowCommands.contains("/reg"))
allowCommands.add("/reg");
if (!allowCommands.contains("/email"))
allowCommands.add("/email");
if (!allowCommands.contains("/captcha"))
allowCommands.add("/captcha");
rakamakUsers = configFile.getString("Converter.Rakamak.fileName", "users.rak");
rakamakUsersIp = configFile.getString("Converter.Rakamak.ipFileName", "UsersIp.rak");
rakamakUseIp = configFile.getBoolean("Converter.Rakamak.useIp", false);
@@ -491,8 +486,8 @@ public final class Settings extends YamlConfiguration {
changes = true;
}
if (!contains("DataSource.mySQLQueryCache")) {
set("DataSource.mySQLWebsite", false);
changes = true;
set("DataSource.mySQLWebsite", false);
changes = true;
}
if (changes) {