Skip to content

Commit

Permalink
option to prevent old stream messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgorge committed Jan 31, 2014
1 parent 9141ed0 commit 9ad612a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/alecgorge/minecraft/jsonapi/JSONAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> whitelist = new ArrayList<String>();
public List<String> method_noauth_whitelist = new ArrayList<String>();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9ad612a

Please sign in to comment.