diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-27 21:08:06 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-27 21:08:06 +0100 |
commit | a7df8a1a0ac858bd943a9987b33783dddda4ba4c (patch) | |
tree | 211d90851081c71152bd77e942a6cd043cee9046 | |
parent | b14e7c197fb6e11ed26703314308db99ca241208 (diff) | |
download | Essentials-a7df8a1a0ac858bd943a9987b33783dddda4ba4c.tar Essentials-a7df8a1a0ac858bd943a9987b33783dddda4ba4c.tar.gz Essentials-a7df8a1a0ac858bd943a9987b33783dddda4ba4c.tar.lz Essentials-a7df8a1a0ac858bd943a9987b33783dddda4ba4c.tar.xz Essentials-a7df8a1a0ac858bd943a9987b33783dddda4ba4c.zip |
Try to reduce lag caused by join spam.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 1 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/UserData.java | 11 |
2 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 97ced232d..eb21aea39 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -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); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 3c8066cc9..abf338470 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -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; |