Only pull/push data on valid player data.

This commit is contained in:
KHobbits 2011-11-04 23:13:21 +00:00
parent 05242a7e8f
commit f0c49019dd
2 changed files with 2 additions and 2 deletions

View File

@ -168,6 +168,7 @@ public class EssentialsPlayerListener extends PlayerListener
{ {
user.setDisplayNick(user.getNick()); user.setDisplayNick(user.getNick());
} }
user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
user.updateActivity(false); user.updateActivity(false);
if (user.isAuthorized("essentials.sleepingignored")) if (user.isAuthorized("essentials.sleepingignored"))
{ {
@ -231,7 +232,6 @@ public class EssentialsPlayerListener extends PlayerListener
event.allow(); event.allow();
user.setLastLogin(System.currentTimeMillis()); user.setLastLogin(System.currentTimeMillis());
user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
updateCompass(user); updateCompass(user);
} }

View File

@ -290,7 +290,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override @Override
public String getDisplayName() public String getDisplayName()
{ {
if (ess.getSettings().changeDisplayName()) if (!(base instanceof OfflinePlayer) && ess.getSettings().changeDisplayName())
{ {
setDisplayNick(getNick()); setDisplayNick(getNick());
} }