diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 00000000..658f1529 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index be85aa37..99aec2a9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,9 @@ + + + + @@ -12,5 +16,5 @@ - + \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/admin/ActivityLogEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/admin/ActivityLogEntry.java index d384d221..eb056fcb 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/admin/ActivityLogEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/admin/ActivityLogEntry.java @@ -72,7 +72,15 @@ public class ActivityLogEntry implements IConfig public void addLogout() { - String lastLoginString = timestamps.get(timestamps.size() - 1); // there's a bug with subtracting the -1 here + // Fix of Array index out of bonds issue: FS-131 + String lastLoginString; + if(timestamps.size() > 1) + { + lastLoginString = timestamps.get(timestamps.size() - 1); + }else + { + lastLoginString = timestamps.get(0); + } Date currentTime = Date.from(Instant.now()); timestamps.add("Logout: " + FUtil.dateToString(currentTime)); lastLoginString = lastLoginString.replace("Login: ", ""); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java b/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java index 7ed0b9fa..fa4797e6 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java @@ -240,7 +240,13 @@ public class AdminList extends FreedomService public boolean isVerifiedAdmin(Player player) { - return verifiedNoAdmin.contains(player.getName()) && verifiedNoAdminIps.get(player.getName()).contains(FUtil.getIp(player)); + // Fix of issue: FS-33 + if(verifiedNoAdmin.contains(player.getName()) || verifiedNoAdminIps.get(player.getName()).contains(FUtil.getIp(player))) + { + return false; + } + + return true; } public boolean isIdentityMatched(Player player)