diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index a331b6378..fa8a39472 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -166,9 +166,17 @@ public class EssentialsPlayerListener implements Listener { return; } + ess.getBackup().onPlayerJoin(); final User user = ess.getUser(player); - user.setLastLogin(System.currentTimeMillis()); + + if (user.isNPC()) + { + user.setNPC(false); + } + + final long currentTime = System.currentTimeMillis(); + user.checkMuteTimeout(currentTime); user.updateActivity(false); ess.scheduleSyncDelayedTask(new Runnable() @@ -176,6 +184,7 @@ public class EssentialsPlayerListener implements Listener @Override public void run() { + user.setLastLogin(currentTime); user.setDisplayNick(); updateCompass(user); @@ -277,7 +286,6 @@ public class EssentialsPlayerListener implements Listener { switch (event.getResult()) { - case ALLOWED: case KICK_FULL: case KICK_BANNED: break; @@ -286,30 +294,25 @@ public class EssentialsPlayerListener implements Listener } final User user = ess.getUser(event.getPlayer()); - if (user.isNPC()) - { - user.setNPC(false); - } - final long currentTime = System.currentTimeMillis(); - final boolean banExpired = user.checkBanTimeout(currentTime); - user.checkMuteTimeout(currentTime); - user.checkJailTimeout(currentTime); - - if (!banExpired && (user.isBanned() || event.getResult() == Result.KICK_BANNED)) + if (event.getResult() == Result.KICK_BANNED || user.isBanned()) { - String banReason = user.getBanReason(); - if (banReason == null || banReason.isEmpty() || banReason.equalsIgnoreCase("ban")) + final boolean banExpired = user.checkBanTimeout(System.currentTimeMillis()); + if (!banExpired) { - banReason = _("defaultBanReason"); + String banReason = user.getBanReason(); + if (banReason == null || banReason.isEmpty() || banReason.equalsIgnoreCase("ban")) + { + banReason = _("defaultBanReason"); + } + if (user.getBanTimeout() > 0) + { + //TODO: TL This + banReason += "\n\n" + "Expires in " + Util.formatDateDiff(user.getBanTimeout()); + } + event.disallow(Result.KICK_BANNED, banReason); + return; } - if (user.getBanTimeout() > 0) - { - //TODO: TL This - banReason += "\n\n" + "Expires in " + Util.formatDateDiff(user.getBanTimeout()); - } - event.disallow(Result.KICK_BANNED, banReason); - return; } if (event.getResult() == Result.KICK_FULL && !user.isAuthorized("essentials.joinfullserver")) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 740ae0bff..4cffb125b 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -67,7 +67,7 @@ public class Jails extends AsyncStorageObjectHolder