summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-03-06 22:36:36 +0000
committerKHobbits <rob@khobbits.co.uk>2013-03-06 22:36:36 +0000
commit6dd9d29b5127445877f9d40e02c423b32002a971 (patch)
tree2c2b85856c9a3cdb474039c5efe79184c97fc63d
parent59dfaa1584150dce8f329a2d5562ce8a750a2ce5 (diff)
downloadEssentials-6dd9d29b5127445877f9d40e02c423b32002a971.tar
Essentials-6dd9d29b5127445877f9d40e02c423b32002a971.tar.gz
Essentials-6dd9d29b5127445877f9d40e02c423b32002a971.tar.lz
Essentials-6dd9d29b5127445877f9d40e02c423b32002a971.tar.xz
Essentials-6dd9d29b5127445877f9d40e02c423b32002a971.zip
Add cleanup logging to debug mode.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandessentials.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index 00153c61e..07f27b1be 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -247,14 +247,23 @@ public class Commandessentials extends EssentialsCommand
}
int ban = user.getBanReason().equals("") ? 0 : 1;
- long timeDiff = System.currentTimeMillis() - user.getLastLogout();
+ long lastLog = user.getLastLogout();
+ long timeDiff = System.currentTimeMillis() - lastLog;
long milliDays = daysArg * 24 * 60 * 60;
+ int homeCount = user.getHomes().size();
+ double moneyCount = user.getMoney();
- if ((ban > bansArg) || (timeDiff < milliDays)
- || (user.getHomes().size() > homesArg) || (user.getMoney() > moneyArg))
+ if ((lastLog == 0) || (ban > bansArg) || (timeDiff < milliDays)
+ || (homeCount > homesArg) || (moneyCount > moneyArg))
{
continue;
}
+
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().info("Deleting user: " + user.getName() + " Money: " + moneyCount + " Homes: " + homeCount + " Last seen: " + Util.formatDateDiff(lastLog));
+ }
+
user.reset();
}
sender.sendMessage(_("cleaned"));