Fixed autopurge with UUIDS

This commit is contained in:
Gabriele C 2015-07-29 14:49:14 +02:00
parent 79759bf139
commit a06f3de35a
3 changed files with 21 additions and 7 deletions

View File

@ -250,11 +250,11 @@ public class AuthMe extends JavaPlugin {
ConsoleLogger.showError("WARNING!!! By disabling ForceSingleSession, your server protection is inadequate!");
}
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled){
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled) {
ConsoleLogger.showError("WARNING!!! You set session timeout to 0, this may cause security issues!");
}
if (Settings.reloadSupport)
if (Settings.reloadSupport) {
try {
int playersOnline = 0;
try {
@ -279,8 +279,8 @@ public class AuthMe extends JavaPlugin {
}
} catch (Exception ex) {
}
}
if (Settings.usePurge)
autoPurge();
// Download GeoIp.dat file
@ -545,13 +545,13 @@ public class AuthMe extends JavaPlugin {
return;
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
if (Settings.purgeEssentialsFile && this.ess != null)
dataManager.purgeEssentials(cleared);
dataManager.purgeEssentials(cleared); // name to UUID convertion needed with latest versions
if (Settings.purgePlayerDat)
dataManager.purgeDat(cleared);
dataManager.purgeDat(cleared); // name to UUID convertion needed with latest versions of MC
if (Settings.purgeLimitedCreative)
dataManager.purgeLimitedCreative(cleared);
if (Settings.purgeAntiXray)
dataManager.purgeAntiXray(cleared);
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or names... (Actually it purges only names!)
if (Settings.purgePermissions)
dataManager.purgePermissions(cleared, permission);
}

View File

@ -109,6 +109,12 @@ public class DataManager {
if (playerFile.exists()) {
playerFile.delete();
i++;
} else {
playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
}
} catch (Exception e) {
}
@ -116,6 +122,7 @@ public class DataManager {
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
}
@SuppressWarnings("deprecation")
public void purgeEssentials(List<String> cleared) {
int i = 0;
for (String name : cleared) {
@ -124,6 +131,12 @@ public class DataManager {
if (playerFile.exists()) {
playerFile.delete();
i++;
} else {
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + Bukkit.getOfflinePlayer(name).getUniqueId() + ".yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
}
} catch (Exception e) {
}

View File

@ -13,6 +13,7 @@ public interface Module {
public enum ModuleType {
MANAGER,
MYSQL,
REDIS,
ACTIONS,
CONVERTERS,
EMAILS,