From 12b42cad29c85c473c4098ba6cb620c6ec2bb968 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 25 Jul 2014 23:38:21 -0700 Subject: [PATCH] Made tournament changes: Staff can't see team chat Bridge tournament time is 90 min Kits are not all free Removed twitch charity text/motd If team not picked, you go to spec. --- .../nautilus/game/arcade/ArcadeManager.java | 30 ++++++++++++++----- .../game/arcade/game/games/bridge/Bridge.java | 2 +- .../src/nautilus/game/arcade/kit/Kit.java | 6 ---- .../game/arcade/managers/GameChatManager.java | 2 +- .../arcade/managers/GameLobbyManager.java | 22 -------------- .../game/arcade/managers/GameManager.java | 4 +-- 6 files changed, 27 insertions(+), 39 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 1b91e43db..8d763e5e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -132,6 +132,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation if (serverConfig.Tournament) { AntiHack.Instance.SetEnabled(false); + Bukkit.getServer().setWhitelist(true); } //Modules @@ -419,13 +420,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation @EventHandler public void MessageMOTD(ServerListPingEvent event) - { - if (this.IsTournamentServer()) - { - event.setMotd(ChatColor.RED + "Twitch.tv "+ ChatColor.YELLOW + "Charity Event"); - return; - } - + { String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName()) + "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName); if (_game == null || _game.GetState() == GameState.Recruit) @@ -496,6 +491,26 @@ public class ArcadeManager extends MiniPlugin implements IRelation @EventHandler public void Login(PlayerLoginEvent event) { + if (Bukkit.getServer().hasWhitelist()) + { + if (_clientManager.Get(event.getPlayer().getName()).GetRank().Has(event.getPlayer(), Rank.MODERATOR, false)) + { + event.allow(); + event.setResult(PlayerLoginEvent.Result.ALLOWED); + + if (_serverConfig.Tournament) + { + event.getPlayer().setOp(true); + } + } + else + { + event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Server Whitelisted!"); + } + + return; + } + // Reserved Slot Check if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) { @@ -512,6 +527,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation { event.allow(); event.setResult(PlayerLoginEvent.Result.ALLOWED); + return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index e910626e6..55f1abaff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -130,7 +130,7 @@ public class Bridge extends TeamGame implements OreObsfucation _ore = new OreHider(); // Flags - GameTimeout = 96000000; + GameTimeout = Manager.IsTournamentServer() ? 5400000 : 1800000; DamageSelf = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/Kit.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/Kit.java index 7e3e9a7ac..a1d731a97 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/Kit.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/Kit.java @@ -49,12 +49,6 @@ public abstract class Kit implements Listener perk.SetHost(this); _kitAvailability = kitAvailability; - - //Change to Free - if (Manager.IsTournamentServer() && (kitAvailability == KitAvailability.Green || kitAvailability == KitAvailability.Blue)) - { - _kitAvailability = KitAvailability.Free; - } _entityType = entityType; _itemInHand = itemInHand; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java index 7321b86fd..40f29b298 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java @@ -104,7 +104,7 @@ public class GameChatManager implements Listener { Player receiver = recipientIterator.next(); - if (Manager.GetClients().Get(receiver).GetRank().Has(Rank.MODERATOR)) + if (!Manager.GetServerConfig().Tournament && Manager.GetClients().Get(receiver).GetRank().Has(Rank.MODERATOR)) continue; GameTeam recTeam = Manager.GetGame().GetTeam(receiver); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 90191fe1e..666667eeb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -707,28 +707,6 @@ public class GameLobbyManager implements IPacketRunnable, Listener { return; } - - if (Manager.IsTournamentServer()) - { - if (_advertiseStage == 0) - { - WriteAdvertiseLine("TWITCH.TV", 0, 159, (byte)4); - WriteAdvertiseLine("CHARITY EVENT", 1, 159, (byte)15); - WriteAdvertiseLine(" ", 2, 159, (byte)15); - WriteAdvertiseLine("PROUDLY SPONSORED BY", 3, 159, (byte)15); - WriteAdvertiseLine("www.mineplex.com", 4, 159, (byte)4); - } - else if (_advertiseStage == 1) - { - WriteAdvertiseLine("Supporting", 0, 159, (byte)15); - WriteAdvertiseLine("ChildsPlay", 1, 159, (byte)4); - WriteAdvertiseLine("AbleGamers", 2, 159, (byte)4); - WriteAdvertiseLine("Extra Life", 3, 159, (byte)4); - WriteAdvertiseLine("Stand for the Silent", 4, 159, (byte)4); - } - - return; - } if (_advertiseStage == 0) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 8e7b936e5..b11b82317 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -147,7 +147,7 @@ public class GameManager implements Listener } } } - else if (game.GetState() == GameState.Live && !Manager.IsTournamentServer()) + else if (game.GetState() == GameState.Live) { if (UtilTime.elapsed(game.GetStateTime(), game.GameTimeout)) { @@ -399,7 +399,7 @@ public class GameManager implements Listener { } - else if (!game.IsPlaying(player)) + else if (!game.IsPlaying(player) && !Manager.IsTournamentServer()) { PlayerAdd(game, player, null); }