From b0efe35531c20949407bed28c925530c15911ed7 Mon Sep 17 00:00:00 2001 From: Ty Sayers Date: Sun, 30 Aug 2015 13:14:01 -0700 Subject: [PATCH] Add restriction to ServerCommand that prevents players from directly connection to a Clans-X server, and instead insists that they join through a Clans hub. --- .../core/portal/Commands/ServerCommand.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java index 2162c3b85..b4ac74e62 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java @@ -43,7 +43,7 @@ public class ServerCommand extends CommandBase Plugin.doesServerExist(args[0], new Callback() { public void run(final Boolean serverExists) - { + { if (!serverExists) { UtilPlayer.message( @@ -84,6 +84,19 @@ public class ServerCommand extends CommandBase else deniedAccess = true; } + else if (servUp.contains("CLANS-")) + { + if (playerRank.has(Rank.MODERATOR)) + { + Plugin.sendPlayerToServer(player, args[0]); + } + else + { + UtilPlayer.message(player, + F.main(Plugin.getName(), C.cRed + "You must join clans through the hub! Join " + C.cGold + "ClansHub-1" + + C.cRed + "!")); + } + } else { Plugin.sendPlayerToServer(player, args[0]);