diff --git a/src/com/massivecraft/massivecore/MassiveCoreMConf.java b/src/com/massivecraft/massivecore/MassiveCoreMConf.java index 83035cc1..1864fca3 100644 --- a/src/com/massivecraft/massivecore/MassiveCoreMConf.java +++ b/src/com/massivecraft/massivecore/MassiveCoreMConf.java @@ -9,6 +9,7 @@ import org.bukkit.permissions.Permissible; import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.PermUtil; +import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.xlib.mongodb.WriteConcern; public class MassiveCoreMConf extends Entity @@ -99,9 +100,9 @@ public class MassiveCoreMConf extends Entity // MSTORE CONFIGURATON // -------------------------------------------- // - public volatile long millisBetweenLocalPoll = 5_000; - public volatile long millisBetweenRemotePollWithoutPusher = 5_000; - public volatile long millisBetweenRemotePollWithPusher = 30_000; + public volatile long millisBetweenLocalPoll = TimeUnit.MILLIS_PER_MINUTE * 5; + public volatile long millisBetweenRemotePollWithoutPusher = TimeUnit.MILLIS_PER_SECOND * 10; + public volatile long millisBetweenRemotePollWithPusher = TimeUnit.MILLIS_PER_MINUTE * 1; public boolean warnOnLocalAlter = false; } diff --git a/src/com/massivecraft/massivecore/store/Coll.java b/src/com/massivecraft/massivecore/store/Coll.java index d18a08a6..847d6e97 100644 --- a/src/com/massivecraft/massivecore/store/Coll.java +++ b/src/com/massivecraft/massivecore/store/Coll.java @@ -192,10 +192,6 @@ public class Coll> extends CollAbstract @Override public boolean isLowercasing() { return this.lowercasing; } @Override public void setLowercasing(boolean lowercasing) { this.lowercasing = lowercasing; } - protected int localPollInfrequency = MStore.LOCAL_POLL_INFREQUENCY_DEFAULT; - @Override public int getLocalPollInfrequency() { return this.localPollInfrequency; } - @Override public void setLocalPollInfrequency(int infrequence) { this.localPollInfrequency = infrequence; } - // Should that instance be saved or not? // If it is default it should not be saved. @Override diff --git a/src/com/massivecraft/massivecore/store/CollInterface.java b/src/com/massivecraft/massivecore/store/CollInterface.java index 9c70536f..e15e69b4 100644 --- a/src/com/massivecraft/massivecore/store/CollInterface.java +++ b/src/com/massivecraft/massivecore/store/CollInterface.java @@ -93,9 +93,6 @@ public interface CollInterface> extends Named public boolean isLowercasing(); public void setLowercasing(boolean lowercasing); - public int getLocalPollInfrequency(); - public void setLocalPollInfrequency(int frequency); - // A default entity will not be saved. // This is often used together with creative collections to save disc space. public boolean isDefault(E entity); diff --git a/src/com/massivecraft/massivecore/store/MStore.java b/src/com/massivecraft/massivecore/store/MStore.java index c2b2a6f1..eb6d54b1 100644 --- a/src/com/massivecraft/massivecore/store/MStore.java +++ b/src/com/massivecraft/massivecore/store/MStore.java @@ -17,7 +17,6 @@ public class MStore // This class also serves the purpose of containing database related constants. public static final boolean DEBUG_ENABLED = false; - public static final int LOCAL_POLL_INFREQUENCY_DEFAULT = 10; // -------------------------------------------- // // DRIVER REGISTRY diff --git a/src/com/massivecraft/massivecore/store/ModificationPollerAbstract.java b/src/com/massivecraft/massivecore/store/ModificationPollerAbstract.java index d655f6e4..f8318830 100644 --- a/src/com/massivecraft/massivecore/store/ModificationPollerAbstract.java +++ b/src/com/massivecraft/massivecore/store/ModificationPollerAbstract.java @@ -67,5 +67,5 @@ public abstract class ModificationPollerAbstract extends Thread // -------------------------------------------- // public abstract long getMillisBetweenPoll(); - public abstract boolean poll(Coll coll, long iterationCount); + public abstract void poll(Coll coll, long iterationCount); } diff --git a/src/com/massivecraft/massivecore/store/ModificationPollerLocal.java b/src/com/massivecraft/massivecore/store/ModificationPollerLocal.java index 086c26a5..8ed3bab4 100644 --- a/src/com/massivecraft/massivecore/store/ModificationPollerLocal.java +++ b/src/com/massivecraft/massivecore/store/ModificationPollerLocal.java @@ -25,20 +25,13 @@ public class ModificationPollerLocal extends ModificationPollerAbstract @Override public long getMillisBetweenPoll() { - // The user specifies how often a default coll should be polled. - // Some colls might be polled more or less frequently. - return MassiveCoreMConf.get().millisBetweenLocalPoll / MStore.LOCAL_POLL_INFREQUENCY_DEFAULT; + return MassiveCoreMConf.get().millisBetweenLocalPoll; } @Override - public boolean poll(Coll coll, long iterationCount) + public void poll(Coll coll, long iterationCount) { - if (iterationCount % coll.getLocalPollInfrequency() == 0) - { coll.identifyLocalModifications(Modification.UNKNOWN_LOG); - return true; - } - return false; } } diff --git a/src/com/massivecraft/massivecore/store/ModificationPollerRemote.java b/src/com/massivecraft/massivecore/store/ModificationPollerRemote.java index 152cbff0..42c152e6 100644 --- a/src/com/massivecraft/massivecore/store/ModificationPollerRemote.java +++ b/src/com/massivecraft/massivecore/store/ModificationPollerRemote.java @@ -39,11 +39,9 @@ public class ModificationPollerRemote extends ModificationPollerAbstract } @Override - public boolean poll(Coll coll, long iterationCount) + public void poll(Coll coll, long iterationCount) { - //TODO: This could probably be true. coll.identifyRemoteModifications(Modification.UNKNOWN); - return true; } }