Add a delay for sending the MOTD (#1396)

* Add delay-motd setting
* Move MOTD to Runnable
* Refactored according to comments
* Delay motd loading as well as sending
This commit is contained in:
md678685 2017-07-28 19:20:44 +01:00 committed by GitHub
parent d7685dc1bc
commit 50f2e7a95f
4 changed files with 50 additions and 23 deletions

View file

@ -24,7 +24,6 @@ import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.*;
import java.util.Locale.Category;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -33,8 +32,6 @@ import static com.earth2me.essentials.I18n.tl;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import com.google.common.base.Preconditions;
public class Settings implements net.ess3.api.ISettings {
private final transient EssentialsConf config;
@ -1414,4 +1411,9 @@ public class Settings implements net.ess3.api.ISettings {
public int getNotifyPlayerOfMailCooldown() {
return config.getInt("notify-player-of-mail-cooldown", 0);
}
@Override
public int getMotdDelay() {
return config.getInt("delay-motd", 0);
}
}