This commit is contained in:
Gabriele C 2015-10-12 18:16:56 +02:00
parent 9e6db7b9f8
commit 92777cd383
3 changed files with 11 additions and 21 deletions

View File

@ -104,20 +104,16 @@ public class DataManager {
for (String name : cleared) { for (String name : cleared) {
try { try {
org.bukkit.OfflinePlayer player = getOfflinePlayer(name); org.bukkit.OfflinePlayer player = getOfflinePlayer(name);
File playerFile = null;
if (player == null) { if (player == null) {
continue; continue;
} }
try { try {
playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat"); File playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat");
} catch(Exception ignore) {
}
if (playerFile.exists()) {
playerFile.delete(); playerFile.delete();
i++; i++;
} else { } catch(Exception ignore) {
playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getName() + ".dat"); File playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getName() + ".dat");
if (playerFile.exists()) { if (playerFile.exists()) {
playerFile.delete(); playerFile.delete();
i++; i++;
@ -134,22 +130,15 @@ public class DataManager {
int i = 0; int i = 0;
for (String name : cleared) { for (String name : cleared) {
try { try {
File playerFile = null; File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + plugin.getServer().getOfflinePlayer(name).getUniqueId() + ".yml");
try {
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + plugin.getServer().getOfflinePlayer(name).getUniqueId() + ".yml");
} catch(Exception ignore) {
}
if (playerFile.exists()) {
playerFile.delete(); playerFile.delete();
i++; i++;
} else {
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
}
} catch (Exception e) { } catch (Exception e) {
File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
} }
} }
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " EssentialsFiles"); ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " EssentialsFiles");

View File

@ -255,6 +255,7 @@ public class AdminCommand implements CommandExecutor {
} }
} }
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() { plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@SuppressWarnings("deprecation")
@Override @Override
public void run() { public void run() {
try { try {

View File

@ -9,6 +9,8 @@ import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Bukkit;
import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource; import com.zaxxer.hikari.HikariDataSource;
import com.zaxxer.hikari.pool.PoolInitializationException; import com.zaxxer.hikari.pool.PoolInitializationException;
@ -19,8 +21,6 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.security.HashAlgorithm; import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
import org.bukkit.Bukkit;
public class MySQL implements DataSource { public class MySQL implements DataSource {
private String host; private String host;