mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-27 16:02:32 +00:00
Adding option to log all eco api transactions.
This commit is contained in:
parent
1b780a4364
commit
1c2221f52f
4 changed files with 12 additions and 2 deletions
|
@ -119,6 +119,8 @@ public interface ISettings extends IConf
|
||||||
double getMinMoney();
|
double getMinMoney();
|
||||||
|
|
||||||
boolean isEcoLogEnabled();
|
boolean isEcoLogEnabled();
|
||||||
|
|
||||||
|
boolean isEcoLogUpdateEnabled();
|
||||||
|
|
||||||
boolean removeGodOnDisconnect();
|
boolean removeGodOnDisconnect();
|
||||||
|
|
||||||
|
|
|
@ -559,6 +559,12 @@ public class Settings implements ISettings
|
||||||
{
|
{
|
||||||
return config.getBoolean("economy-log-enabled", false);
|
return config.getBoolean("economy-log-enabled", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEcoLogUpdateEnabled()
|
||||||
|
{
|
||||||
|
return config.getBoolean("economy-log-update-enabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removeGodOnDisconnect()
|
public boolean removeGodOnDisconnect()
|
||||||
|
|
|
@ -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)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,8 +385,9 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
catch (Throwable ex)
|
catch (Throwable ex)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.setMoney(value);
|
super.setMoney(value);
|
||||||
|
Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateMoneyCache(final double value)
|
public void updateMoneyCache(final double value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue