From d82a7b353fad9760966360335142e8aa06ac954a Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Mon, 25 Jan 2016 08:42:38 +0000 Subject: [PATCH 1/2] allow C.Mods to join all server regardless of home servers --- .../game/clans/clans/commands/ClansLoginManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansLoginManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansLoginManager.java index 1267209fb..7432c7a66 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansLoginManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansLoginManager.java @@ -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 _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(); 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); From 0b7cec60ae7e657fb3263146844523bc786ae15c Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Mon, 25 Jan 2016 08:44:17 +0000 Subject: [PATCH 2/2] put cmod above support so that support can't bypass clans home block --- Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java index 5a7388fc9..8ff80d801 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java @@ -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"),