mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 04:02:10 +01:00
Fixes
This commit is contained in:
parent
47211ab803
commit
88530542ac
@ -210,15 +210,18 @@ public class Utils {
|
|||||||
LOGGEDIN
|
LOGGEDIN
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void purgeDirectory(File dir) {
|
public static void purgeDirectory(File file){
|
||||||
if (dir != null && dir.listFiles() != null)
|
String files[] = file.list();
|
||||||
for (File file : dir.listFiles()) {
|
if (files != null && files.length != 0){
|
||||||
if (file != null){
|
for (String temp : files) {
|
||||||
if (file.isDirectory())
|
File fileDelete = new File(file, temp);
|
||||||
purgeDirectory(file);
|
if (fileDelete.isDirectory()){
|
||||||
file.delete();
|
purgeDirectory(fileDelete);
|
||||||
}
|
fileDelete.delete();
|
||||||
|
} else {
|
||||||
|
fileDelete.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
|
|
||||||
@ -198,9 +198,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
@ -537,22 +537,25 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
||||||
if (!file.exists()) {
|
if (file.list() != null) {
|
||||||
file = new File("cache/" + player.getName().toLowerCase() + ".cache");
|
Utils.purgeDirectory(file);
|
||||||
}
|
file.delete();
|
||||||
if (file.exists()) {
|
} else {
|
||||||
if (file.isDirectory() && file.listFiles() != null) {
|
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + player.getName().toLowerCase() + ".cache");
|
||||||
Utils.purgeDirectory(file);
|
if(file.isFile()){
|
||||||
} else file.delete();
|
file.delete();
|
||||||
|
} else {
|
||||||
|
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache, it doesn't exist!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ConsoleLogger.showError("File cannot be removed correctly :/");
|
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache :/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,9 +564,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
@ -438,7 +438,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
if (Settings.antiBotInAction){
|
if (Settings.antiBotInAction){
|
||||||
if (!plugin.database.isAuthAvailable(name)) {
|
if (!plugin.database.isAuthAvailable(name)) {
|
||||||
event.setKickMessage(m.send("AntiBot service in action! Non registered players can't connect until the bot attack stops!")[0]); //Need to add string to messages
|
event.setKickMessage("AntiBot service in action! Non registered players can't connect until the bot attack stops!"); //Need to add string to messages
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user