Merge branch 'clans/alpha' of ssh://184.154.0.242:7999/min/Mineplex into clans/beta

This commit is contained in:
NewGarbo 2016-01-25 08:47:08 +00:00
commit fde5a5af28
2 changed files with 7 additions and 3 deletions

View File

@ -14,8 +14,8 @@ public enum Rank
DEVELOPER("Dev", ChatColor.GOLD, "Developers make new games,\nand new features for you to enjoy"),
ADMIN("Admin", ChatColor.GOLD, "Administrators have their own\nSenior Moderator team that they lead!"),
JNR_DEV("Jr.Dev", ChatColor.GOLD, "Junior Developers make new games,\nand new features for you to enjoy"),
SUPPORT("Support", ChatColor.BLUE, "Support Agents take care of all the tickets\nthat get sent to mineplex.com/support"),
CMOD("C.Mod", ChatColor.GOLD, "Clan Moderators are Senior Moderators in\nthe Clans Management team.\nThey mainly moderate only the Clans servers.\nThey are around to help you with any problems on Clans servers."),
SUPPORT("Support", ChatColor.BLUE, "Support Agents take care of all the tickets\nthat get sent to mineplex.com/support"),
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD, "Senior Moderators are in a special\nSenior Moderator team where they have to fulfill team tasks.\nThey are similar to Moderators who you can always ask for help!\nIf you have any questions, just message them using /a"),
MODERATOR("Mod", ChatColor.GOLD, "Moderators are here to moderate\nand help players with any concerns they have.\nIf you have any questions, just message them using /a"),
HELPER("Trainee", ChatColor.DARK_AQUA, "Trainees are staff in training,\nand are here to help players and moderate!\nIf you have any questions, just message them using /a"),

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;
@ -26,6 +27,8 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
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);