Make the lag warning configurable, useful to debug economy lag on larger servers.

This commit is contained in:
KHobbits 2013-05-12 04:32:56 +01:00
parent af2c514f2a
commit 8ebe55a294
4 changed files with 52 additions and 16 deletions

View file

@ -454,22 +454,25 @@ public class Settings implements ISettings
{
return config.getBoolean("per-warp-permission", false);
}
@Override
public Map<String, Object> getListGroupConfig()
{
if (config.isConfigurationSection("list"))
{
{
Map<String, Object> values = config.getConfigurationSection("list").getValues(false);
if (!values.isEmpty()) {
if (!values.isEmpty())
{
return values;
}
}
Map<String, Object> defaultMap = new HashMap<String, Object>();
if (config.getBoolean("sort-list-by-groups", false)) {
if (config.getBoolean("sort-list-by-groups", false))
{
defaultMap.put("ListByGroup", "ListByGroup");
}
else {
else
{
defaultMap.put("Players", "*");
}
return defaultMap;
@ -510,6 +513,9 @@ public class Settings implements ISettings
mailsPerMinute = _getMailsPerMinute();
maxMoney = _getMaxMoney();
minMoney = _getMinMoney();
economyLagWarning = _getEconomyLagWarning();
economyLog = _isEcoLogEnabled();
economyLogUpdate = _isEcoLogUpdateEnabled();
}
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
@ -636,12 +642,14 @@ public class Settings implements ISettings
return config.getString("currency-symbol", "$").concat("$").substring(0, 1).replaceAll("[0-9]", "$");
}
// #easteregg
@Override
public boolean isTradeInStacks(int id)
{
return config.getBoolean("trade-in-stacks-" + id, false);
}
// #easteregg
@Override
public boolean isEcoDisabled()
{
@ -721,15 +729,28 @@ public class Settings implements ISettings
{
return minMoney;
}
private boolean economyLog = false;
@Override
public boolean isEcoLogEnabled()
{
return economyLog;
}
public boolean _isEcoLogEnabled()
{
return config.getBoolean("economy-log-enabled", false);
}
// #easteregg
private boolean economyLogUpdate = false;
@Override
public boolean isEcoLogUpdateEnabled()
{
return economyLogUpdate;
}
public boolean _isEcoLogUpdateEnabled()
{
return config.getBoolean("economy-log-update-enabled", false);
}
@ -794,6 +815,7 @@ public class Settings implements ISettings
{
return prefixsuffixconfigured ? addprefixsuffix : essentialsChatActive;
}
// #easteregg
private boolean disablePrefix = false;
private boolean _disablePrefix()
@ -806,6 +828,7 @@ public class Settings implements ISettings
{
return disablePrefix;
}
// #easteregg
private boolean disableSuffix = false;
private boolean _disableSuffix()
@ -1035,8 +1058,6 @@ public class Settings implements ISettings
return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed);
}
//This option does not exist in the config.yml because it wasn't yet implemented in bukkit
//The code was commented out in the /speed command
@Override
public double getMaxWalkSpeed()
{
@ -1055,6 +1076,19 @@ public class Settings implements ISettings
{
return mailsPerMinute;
}
// #easteregg
private long economyLagWarning;
private long _getEconomyLagWarning()
{
return config.getLong("economy-lag-warning", 20000000L); // Default to 20ms
}
@Override
public long getEconomyLagWarning()
{
return economyLagWarning;
}
@Override
public long getMaxTempban()