summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-08-19 03:38:09 +0100
committerKHobbits <rob@khobbits.co.uk>2012-08-19 03:38:09 +0100
commit9018fc8324c46359a7dccff1f23daa4cda4c51aa (patch)
tree92053d98da7cb4a8a886bb805a99a7538a603589
parent2f57961ce450a86501099081d493b7a383b7da6e (diff)
downloadEssentials-9018fc8324c46359a7dccff1f23daa4cda4c51aa.tar
Essentials-9018fc8324c46359a7dccff1f23daa4cda4c51aa.tar.gz
Essentials-9018fc8324c46359a7dccff1f23daa4cda4c51aa.tar.lz
Essentials-9018fc8324c46359a7dccff1f23daa4cda4c51aa.tar.xz
Essentials-9018fc8324c46359a7dccff1f23daa4cda4c51aa.zip
Add some command cost debugging messages to /ess debug
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index 3d3f36d8c..707665d93 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -63,6 +63,12 @@ public class Trade
public void isAffordableFor(final IUser user) throws ChargeException
{
+
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().log(Level.INFO, "checking if " + user.getName() + " can afford charge.");
+ }
+
if (getMoney() != null
&& getMoney() > 0
&& !user.canAfford(getMoney()))
@@ -206,8 +212,17 @@ public class Trade
cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
if (cost == 0.0 && fallbackCommand != null && !fallbackCommand.isEmpty())
{
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().log(Level.INFO, "checking fallback command cost (" + fallbackCommand + ") cost for " + user.getName());
+ }
cost = ess.getSettings().getCommandCost(fallbackCommand.charAt(0) == '/' ? fallbackCommand.substring(1) : fallbackCommand);
}
+
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().log(Level.INFO, "calculated command (" + command + ") cost for " + user.getName() + " as " + cost);
+ }
}
return cost;
}