mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 04:35:12 +01:00
Fixed autopurge with UUIDS
This commit is contained in:
parent
79759bf139
commit
a06f3de35a
@ -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,9 +279,9 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.usePurge)
|
||||
autoPurge();
|
||||
autoPurge();
|
||||
|
||||
// Download GeoIp.dat file
|
||||
downloadGeoIp();
|
||||
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ public interface Module {
|
||||
public enum ModuleType {
|
||||
MANAGER,
|
||||
MYSQL,
|
||||
REDIS,
|
||||
ACTIONS,
|
||||
CONVERTERS,
|
||||
EMAILS,
|
||||
|
Loading…
Reference in New Issue
Block a user