Collection Tick Stack Traceability

This commit is contained in:
Olof Larsson 2015-02-02 00:25:59 +01:00
parent ad529d7542
commit e93f7c12d8
6 changed files with 87 additions and 18 deletions

View File

@ -19,6 +19,16 @@ public class AspectColl extends Coll<Aspect>
super("massivecore_aspect", Aspect.class, MStore.getDb("default"), MassiveCore.get()); super("massivecore_aspect", Aspect.class, MStore.getDb("default"), MassiveCore.get());
} }
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- // // -------------------------------------------- //
// EXTRAS // EXTRAS
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -0,0 +1,45 @@
package com.massivecraft.massivecore;
import org.bukkit.plugin.Plugin;
import com.massivecraft.massivecore.store.Coll;
public class EngineCollTick extends EngineAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
protected static EngineCollTick i = new EngineCollTick();
public static EngineCollTick get() { return i; }
// -------------------------------------------- //
// OVERRIDE: ENGINE
// -------------------------------------------- //
@Override
public Plugin getPlugin()
{
return MassiveCore.get();
}
@Override
public Long getPeriod()
{
return 1L;
}
// -------------------------------------------- //
// OVERRIDE: RUNNABLE
// -------------------------------------------- //
@Override
public void run()
{
for (Coll<?> coll : Coll.getInstances())
{
coll.onTick();
}
}
}

View File

@ -44,7 +44,6 @@ import com.massivecraft.massivecore.integration.vault.IntegrationVault;
import com.massivecraft.massivecore.mixin.EngineTeleportMixinCause; import com.massivecraft.massivecore.mixin.EngineTeleportMixinCause;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.ps.PSAdapter; import com.massivecraft.massivecore.ps.PSAdapter;
import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.ExamineThread; import com.massivecraft.massivecore.store.ExamineThread;
import com.massivecraft.massivecore.teleport.EngineScheduledTeleport; import com.massivecraft.massivecore.teleport.EngineScheduledTeleport;
import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.IdUtil;
@ -141,19 +140,6 @@ public class MassiveCore extends MassivePlugin
private CmdMassiveCoreCmdurl outerCmdMassiveCoreCmdurl; private CmdMassiveCoreCmdurl outerCmdMassiveCoreCmdurl;
public CmdMassiveCoreCmdurl getOuterCmdMassiveCoreCmdurl() { return this.outerCmdMassiveCoreCmdurl; } public CmdMassiveCoreCmdurl getOuterCmdMassiveCoreCmdurl() { return this.outerCmdMassiveCoreCmdurl; }
// Runnables
// TODO: Make this one a singleton
private Runnable collTickTask = new Runnable()
{
public void run()
{
for (Coll<?> coll : Coll.getInstances())
{
coll.onTick();
}
}
};
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
// -------------------------------------------- // // -------------------------------------------- //
@ -178,7 +164,8 @@ public class MassiveCore extends MassivePlugin
// Setup IdUtil // Setup IdUtil
IdUtil.setup(); IdUtil.setup();
// Register events // Engine
EngineCollTick.get().activate();
MassiveCoreEngineMain.get().activate(); MassiveCoreEngineMain.get().activate();
MassiveCoreEngineVariable.get().activate(); MassiveCoreEngineVariable.get().activate();
EngineScheduledTeleport.get().activate(); EngineScheduledTeleport.get().activate();
@ -187,9 +174,6 @@ public class MassiveCore extends MassivePlugin
MassiveCoreEngineCommandRegistration.get().activate(); MassiveCoreEngineCommandRegistration.get().activate();
PlayerUtil.get().activate(); PlayerUtil.get().activate();
// Tasks
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, this.collTickTask, 1, 1);
// Collections // Collections
MultiverseColl.get().init(); MultiverseColl.get().init();
AspectColl.get().init(); AspectColl.get().init();

View File

@ -17,6 +17,16 @@ public class MassiveCoreMConfColl extends Coll<MassiveCoreMConf>
super("massivecore_mconf", MassiveCoreMConf.class, MStore.getDb(ConfServer.dburi), MassiveCore.get()); super("massivecore_mconf", MassiveCoreMConf.class, MStore.getDb(ConfServer.dburi), MassiveCore.get());
} }
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -16,6 +16,16 @@ public class MultiverseColl extends Coll<Multiverse>
super("massivecore_multiverse", Multiverse.class, MStore.getDb("default"), MassiveCore.get()); super("massivecore_multiverse", Multiverse.class, MStore.getDb("default"), MassiveCore.get());
} }
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- // // -------------------------------------------- //
// EXTRAS // EXTRAS
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -34,6 +34,16 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
super(name, entityClass, db, plugin, true, true, true); super(name, entityClass, db, plugin, true, true, true);
} }
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE: Coll // OVERRIDE: Coll
// -------------------------------------------- // // -------------------------------------------- //