Adding option to log all eco api transactions.

This commit is contained in:
KHobbits 2012-02-27 15:31:43 +00:00
parent 340f0c68eb
commit 833a5b2b55
4 changed files with 12 additions and 2 deletions

View file

@ -119,6 +119,8 @@ public interface ISettings extends IConf
double getMinMoney();
boolean isEcoLogEnabled();
boolean isEcoLogUpdateEnabled();
boolean removeGodOnDisconnect();

View file

@ -559,6 +559,12 @@ public class Settings implements ISettings
{
return config.getBoolean("economy-log-enabled", false);
}
@Override
public boolean isEcoLogUpdateEnabled()
{
return config.getBoolean("economy-log-update-enabled", false);
}
@Override
public boolean removeGodOnDisconnect()

View file

@ -198,7 +198,8 @@ public class Trade
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
{
if (!ess.getSettings().isEcoLogEnabled())
if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled())
|| (loc != null && !ess.getSettings().isEcoLogEnabled()))
{
return;
}

View file

@ -385,8 +385,9 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
catch (Throwable ex)
{
}
}
}
super.setMoney(value);
Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess);
}
public void updateMoneyCache(final double value)