Merge branch 'master' of ssh://dev.mineplex.com:7999/min/mineplex
This commit is contained in:
commit
40e49dd3d4
@ -1,6 +1,8 @@
|
||||
package mineplex.core.account;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.core.account.event.AsyncClientLoadEvent;
|
||||
import mineplex.core.account.event.ClientUnloadEvent;
|
||||
@ -10,6 +12,8 @@ import mineplex.core.account.repository.token.ClientToken;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
|
||||
@ -220,4 +224,17 @@ public class CoreClientManager implements Listener
|
||||
}
|
||||
}, name, rank, perm);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void cleanGlitchedClients(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
for (Iterator<Entry<String, CoreClient>> clientIterator = _clientList.entrySet().iterator(); clientIterator.hasNext();)
|
||||
{
|
||||
if (!clientIterator.next().getValue().GetPlayer().isOnline())
|
||||
clientIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
@ -289,4 +289,12 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
||||
|
||||
_progressCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Dispose()
|
||||
{
|
||||
super.Dispose();
|
||||
|
||||
Bukkit.getScheduler().cancelTask(_taskId);
|
||||
}
|
||||
}
|
||||
|
@ -17,29 +17,12 @@ public class Updater implements Runnable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
boolean second = false;
|
||||
|
||||
for (UpdateType updateType : UpdateType.values())
|
||||
{
|
||||
if (updateType.Elapsed())
|
||||
{
|
||||
if (updateType == UpdateType.SEC)
|
||||
second = true;
|
||||
|
||||
//updateType.StartTime();
|
||||
_plugin.getServer().getPluginManager().callEvent(new UpdateEvent(updateType));
|
||||
//updateType.StopTime();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (second)
|
||||
{
|
||||
for (UpdateType updateType : UpdateType.values())
|
||||
{
|
||||
updateType.PrintAndResetTime();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.energy.Energy;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import me.chiss.Core.Loot.LootFactory;
|
||||
import me.chiss.Core.MemoryFix.MemoryFix;
|
||||
import me.chiss.Core.Module.ModuleManager;
|
||||
import me.chiss.Core.Modules.*;
|
||||
import me.chiss.Core.Plugin.IPlugin;
|
||||
@ -127,6 +128,8 @@ public class Arcade extends JavaPlugin implements INautilusPlugin, IPlugin
|
||||
Scheduler.Initialize(this);
|
||||
//new Information(this);
|
||||
new Punish(this, GetWebServerAddress());
|
||||
new MemoryFix(this);
|
||||
|
||||
//Updates
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user