Try to reduce lag caused by join spam.

This commit is contained in:
KHobbits 2012-03-27 21:08:06 +01:00
parent b14e7c197f
commit a7df8a1a0a
2 changed files with 8 additions and 4 deletions

View File

@ -129,7 +129,6 @@ public class EssentialsPlayerListener implements Listener
user.setDisplayNick();
user.setLastLogin(System.currentTimeMillis());
user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
user.updateActivity(false);
updateCompass(user);

View File

@ -621,10 +621,16 @@ public abstract class UserData extends PlayerExtension implements IConf
return lastLogin;
}
public void setLastLogin(long time)
private void _setLastLogin(long time)
{
lastLogin = time;
config.setProperty("timestamps.login", time);
}
public void setLastLogin(long time)
{
_setLastLogin(time);
_setLastLoginAddress(base.getAddress().getAddress().getHostAddress());
config.save();
}
private long lastLogout;
@ -657,11 +663,10 @@ public abstract class UserData extends PlayerExtension implements IConf
return lastLoginAddress;
}
public void setLastLoginAddress(String address)
private void _setLastLoginAddress(String address)
{
lastLoginAddress = address;
config.setProperty("ipAddress", address);
config.save();
}
private boolean afk;