From 9ceb4eee94d24643a1d28a4e00d17f379d0db58b Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Fri, 23 Oct 2015 00:48:31 -0400 Subject: [PATCH] - Take will and QA's suggestion about making the gameplay modifier a proper feature --- .../game/games/common/CaptureTheFlag.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java index 2d17859c7..c6eb244ea 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/CaptureTheFlag.java @@ -623,9 +623,23 @@ public class CaptureTheFlag extends TeamGame if (!InProgress()) return; - if (event.getMessage().equalsIgnoreCase("/suddendeath")) + if (event.getMessage().contains("/suddendeath")) { - if (Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.JNR_DEV)) + boolean authorized = Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.JNR_DEV); + + if (Manager.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing")) + if (Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.SNR_MODERATOR)) + authorized = true; + + if (Manager.GetGameHostManager().isPrivateServer()) + if (Manager.GetGameHostManager().isAdmin(event.getPlayer(), false)) + authorized = true; + + if (Manager.GetGameHostManager().isEventServer()) + if (Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.SNR_MODERATOR)) + authorized = true; + + if (authorized) { if (_redScore < _blueScore) _redScore = _blueScore; @@ -633,9 +647,12 @@ public class CaptureTheFlag extends TeamGame _blueScore = _redScore; _gameTime = (System.currentTimeMillis() - GetStateTime()) + 11; - event.setCancelled(true); Bukkit.broadcastMessage(C.cDPurple + C.Bold + event.getPlayer().getName() + " has equalized both teams and enabled Sudden Death!"); } + else + F.main("Game", "You do not have permission to use this game modifier!"); + + event.setCancelled(true); } }