Add some command cost debugging messages to /ess debug

This commit is contained in:
KHobbits 2012-08-19 03:38:09 +01:00
parent 2f57961ce4
commit 9018fc8324

View file

@ -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;
}