Merge branch 'master' of ssh://dev.mineplex.com:7999/min/mineplex

This commit is contained in:
Chiss 2013-10-16 08:11:04 +11:00
commit 40e49dd3d4
4 changed files with 28 additions and 17 deletions

View File

@ -1,6 +1,8 @@
package mineplex.core.account; package mineplex.core.account;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import mineplex.core.account.event.AsyncClientLoadEvent; import mineplex.core.account.event.AsyncClientLoadEvent;
import mineplex.core.account.event.ClientUnloadEvent; 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.Rank;
import mineplex.core.common.util.Callback; import mineplex.core.common.util.Callback;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson; import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
@ -220,4 +224,17 @@ public class CoreClientManager implements Listener
} }
}, name, rank, perm); }, 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();
}
}
} }

View File

@ -289,4 +289,12 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
_progressCount++; _progressCount++;
} }
@Override
public void Dispose()
{
super.Dispose();
Bukkit.getScheduler().cancelTask(_taskId);
}
} }

View File

@ -17,29 +17,12 @@ public class Updater implements Runnable
@Override @Override
public void run() public void run()
{ {
boolean second = false;
for (UpdateType updateType : UpdateType.values()) for (UpdateType updateType : UpdateType.values())
{ {
if (updateType.Elapsed()) if (updateType.Elapsed())
{ {
if (updateType == UpdateType.SEC)
second = true;
//updateType.StartTime();
_plugin.getServer().getPluginManager().callEvent(new UpdateEvent(updateType)); _plugin.getServer().getPluginManager().callEvent(new UpdateEvent(updateType));
//updateType.StopTime();
} }
} }
/*
if (second)
{
for (UpdateType updateType : UpdateType.values())
{
updateType.PrintAndResetTime();
}
}
*/
} }
} }

View File

@ -21,6 +21,7 @@ import mineplex.core.donation.DonationManager;
import mineplex.core.energy.Energy; import mineplex.core.energy.Energy;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import me.chiss.Core.Loot.LootFactory; import me.chiss.Core.Loot.LootFactory;
import me.chiss.Core.MemoryFix.MemoryFix;
import me.chiss.Core.Module.ModuleManager; import me.chiss.Core.Module.ModuleManager;
import me.chiss.Core.Modules.*; import me.chiss.Core.Modules.*;
import me.chiss.Core.Plugin.IPlugin; import me.chiss.Core.Plugin.IPlugin;
@ -127,6 +128,8 @@ public class Arcade extends JavaPlugin implements INautilusPlugin, IPlugin
Scheduler.Initialize(this); Scheduler.Initialize(this);
//new Information(this); //new Information(this);
new Punish(this, GetWebServerAddress()); new Punish(this, GetWebServerAddress());
new MemoryFix(this);
//Updates //Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
} }