Update 3.3.6 - Emergency Fix
//Changes 3.3.6:// * **Emergency fix: Email recovery method are now fixed and safety to use** * Support all craftbukkit builds * Now Support our sponsor ipClean feature ( Get player real ip through their servers ) * Now Cache correctly Item Custom Names and Lores * Fix FlatToSQL converter * Add /authme getip <playername> command, perm : authme.admin.getip * Implement correctly XenForo Support * Fix maxregperip * Fix maxloginperip * Add ForceCommandsAsConsole config * Preparation for next features, coming soon !
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package fr.xephi.authme.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class OtherAccounts extends CustomConfiguration {
|
||||
private static OtherAccounts others = null;
|
||||
|
||||
public OtherAccounts() {
|
||||
super(new File("./plugins/AuthMe/otheraccounts.yml"));
|
||||
others = this;
|
||||
load();
|
||||
save();
|
||||
}
|
||||
|
||||
public void clear(UUID uuid) {
|
||||
set(uuid.toString(), new ArrayList<String>());
|
||||
save();
|
||||
}
|
||||
|
||||
public static OtherAccounts getInstance() {
|
||||
if (others == null) {
|
||||
others = new OtherAccounts();
|
||||
}
|
||||
return others;
|
||||
}
|
||||
|
||||
public void addPlayer(UUID uuid) {
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
if (player == null) return;
|
||||
if (!this.getStringList(uuid.toString()).contains(player.getName())) {
|
||||
this.getStringList(uuid.toString()).add(player.getName());
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
public void removePlayer(UUID uuid) {
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
if (player == null) return;
|
||||
if (this.getStringList(uuid.toString()).contains(player.getName())) {
|
||||
this.getStringList(uuid.toString()).remove(player.getName());
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getAllPlayersByUUID(UUID uuid) {
|
||||
return this.getStringList(uuid.toString());
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ public final class Settings extends YamlConfiguration {
|
||||
public static List<String> countries = null;
|
||||
public static List<String> countriesBlacklist = null;
|
||||
public static List<String> forceCommands = null;
|
||||
public static List<String> forceCommandsAsConsole = null;
|
||||
private AuthMe plugin;
|
||||
private final File file;
|
||||
public static DataSourceType getDataSource;
|
||||
@@ -229,6 +230,7 @@ public void loadConfigOptions() {
|
||||
antiBotSensibility = configFile.getInt("Protection.antiBotSensibility", 5);
|
||||
antiBotDuration = configFile.getInt("Protection.antiBotDuration", 10);
|
||||
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
|
||||
forceCommandsAsConsole = (List<String>) configFile.getList("settings.forceCommandsAsConsole", new ArrayList<String>());
|
||||
recallEmail = configFile.getBoolean("Email.recallPlayers", false);
|
||||
delayRecall = configFile.getInt("Email.delayRecall", 5);
|
||||
useWelcomeMessage = configFile.getBoolean("settings.useWelcomeMessage", true);
|
||||
@@ -387,6 +389,7 @@ public static void reloadConfigOptions(YamlConfiguration newConfig) {
|
||||
antiBotSensibility = configFile.getInt("Protection.antiBotSensibility", 5);
|
||||
antiBotDuration = configFile.getInt("Protection.antiBotDuration", 10);
|
||||
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
|
||||
forceCommandsAsConsole = (List<String>) configFile.getList("settings.forceCommandsAsConsole", new ArrayList<String>());
|
||||
recallEmail = configFile.getBoolean("Email.recallPlayers", false);
|
||||
delayRecall = configFile.getInt("Email.delayRecall", 5);
|
||||
useWelcomeMessage = configFile.getBoolean("settings.useWelcomeMessage", true);
|
||||
@@ -439,6 +442,10 @@ public static void reloadConfigOptions(YamlConfiguration newConfig) {
|
||||
set("settings.forceCommands", new ArrayList<String>());
|
||||
changes = true;
|
||||
}
|
||||
if(!contains("settings.forceCommandsAsConsole")) {
|
||||
set("settings.forceCommandsAsConsole", new ArrayList<String>());
|
||||
changes = true;
|
||||
}
|
||||
if(!contains("Email.recallPlayers")) {
|
||||
set("Email.recallPlayers", false);
|
||||
changes = true;
|
||||
|
||||
Reference in New Issue
Block a user