summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-25 17:27:06 +0100
committerKHobbits <rob@khobbits.co.uk>2012-03-25 17:27:06 +0100
commitd2506cd928125c44023c6e4baed2d76f661aff21 (patch)
treebed78719f643c69fe93fb1660c33a334484fa0b6
parent1dbb11ea552bb7f576067e4ac184fd58db40eb80 (diff)
downloadEssentials-d2506cd928125c44023c6e4baed2d76f661aff21.tar
Essentials-d2506cd928125c44023c6e4baed2d76f661aff21.tar.gz
Essentials-d2506cd928125c44023c6e4baed2d76f661aff21.tar.lz
Essentials-d2506cd928125c44023c6e4baed2d76f661aff21.tar.xz
Essentials-d2506cd928125c44023c6e4baed2d76f661aff21.zip
Reorder login/join event calls.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index b45e1fb10..6b6b4a034 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -126,9 +126,13 @@ public class EssentialsPlayerListener implements Listener
{
ess.getBackup().onPlayerJoin();
final User user = ess.getUser(event.getPlayer());
+
user.setDisplayNick();
+ user.setLastLogin(System.currentTimeMillis());
user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
+
user.updateActivity(false);
+ updateCompass(user);
if (user.isAuthorized("essentials.sleepingignored"))
{
user.setSleepingIgnored(true);
@@ -184,7 +188,10 @@ public class EssentialsPlayerListener implements Listener
}
User user = ess.getUser(event.getPlayer());
- user.setNPC(false);
+ if (user.isNPC())
+ {
+ user.setNPC(false);
+ }
final long currentTime = System.currentTimeMillis();
final boolean banExpired = user.checkBanTimeout(currentTime);
@@ -204,9 +211,6 @@ public class EssentialsPlayerListener implements Listener
return;
}
event.allow();
-
- user.setLastLogin(System.currentTimeMillis());
- updateCompass(user);
}
private void updateCompass(final User user)