diff --git a/src/main/java/com/alecgorge/minecraft/jsonapi/JSONAPI.java b/src/main/java/com/alecgorge/minecraft/jsonapi/JSONAPI.java index ebd2c749..0c594fea 100644 --- a/src/main/java/com/alecgorge/minecraft/jsonapi/JSONAPI.java +++ b/src/main/java/com/alecgorge/minecraft/jsonapi/JSONAPI.java @@ -79,6 +79,7 @@ public class JSONAPI extends JavaPlugin implements JSONAPIMethodProvider { public String logFile = "false"; public String salt = ""; public int port = 20059; + public boolean allowSendingOldStreamMessages = true; private long startupDelay = 2000; public List whitelist = new ArrayList(); public List method_noauth_whitelist = new ArrayList(); @@ -416,6 +417,7 @@ public void onEnable() { port = yamlConfig.getInt("options.port", 20059); startupDelay = yamlConfig.getInt("options.startup-delay", 2000); anyoneCanUseCallAdmin = yamlConfig.getBoolean("options.anyone-can-use-calladmin", false); + allowSendingOldStreamMessages = yamlConfig.getBoolean("options.send-previous-stream-messages", true); serverName = getServer().getServerName(); if(yamlConfig.contains("options.use-new-api")) { useGroups = yamlConfig.getBoolean("options.use-new-api", false); @@ -561,7 +563,7 @@ public void onEnable() { adminium = new PushNotificationDaemon(new File(getDataFolder(), "adminium.yml"), this); adminium3 = new Adminium3(this); - + tickRateCounter = new TickRateCounter(this); // must load this after the tick counter exists! diff --git a/src/main/java/com/alecgorge/minecraft/jsonapi/api/JSONAPIStream.java b/src/main/java/com/alecgorge/minecraft/jsonapi/api/JSONAPIStream.java index ce9f3c23..9fb99b5f 100644 --- a/src/main/java/com/alecgorge/minecraft/jsonapi/api/JSONAPIStream.java +++ b/src/main/java/com/alecgorge/minecraft/jsonapi/api/JSONAPIStream.java @@ -47,7 +47,7 @@ public String getName() { * after registering? */ public void registerListener(JSONAPIStreamListener l, boolean feedOld) { - if (feedOld) { + if (feedOld && JSONAPI.instance.allowSendingOldStreamMessages) { synchronized (last50) { for (JSONAPIStreamMessage m : last50) { l.onMessage(m, this);