allow C.Mods to join all server regardless of home servers

This commit is contained in:
NewGarbo 2016-01-25 08:42:38 +00:00
parent 1f7e1fb6cf
commit d82a7b353f

View File

@ -14,6 +14,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.account.ILoginProcessor;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.portal.Portal;
@ -25,7 +26,9 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
private boolean _enabled;
private String _serverName;
private ConcurrentLinkedQueue<String> _queue;
private CoreClientManager _clientManager;
public ClansLoginManager(JavaPlugin plugin, CoreClientManager clientManager, String serverName)
{
super("Clans Login Manager", plugin);
@ -34,12 +37,13 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
_enabled = true;
_queue = new ConcurrentLinkedQueue<String>();
clientManager.addStoredProcedureLoginProcessor(this);
_clientManager = clientManager;
}
@EventHandler
public void onPlayerJoin(PlayerLoginEvent event)
{
if (_queue.contains(event.getPlayer().getName()) && !event.getPlayer().isOp())
if (_queue.contains(event.getPlayer().getName()) && !event.getPlayer().isOp() && _clientManager.hasRank(event.getPlayer(), Rank.CMOD))
{
event.setKickMessage("This is not your Clans home server");
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);