summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-27 21:08:06 +0100
committerKHobbits <rob@khobbits.co.uk>2012-03-27 21:08:06 +0100
commita7df8a1a0ac858bd943a9987b33783dddda4ba4c (patch)
tree211d90851081c71152bd77e942a6cd043cee9046
parentb14e7c197fb6e11ed26703314308db99ca241208 (diff)
downloadEssentials-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.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/UserData.java11
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;