From d0fafce5854ef8a33381762d26ff3cab8ce35520 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Wed, 2 Jul 2014 16:59:31 -0700 Subject: [PATCH] Reverted change to helper only joining full, now ultras can. Added check so BETA servers cannot be joined by less than Helper. Fixed message in AccountAdministrator for rankUpdate --- .../core/account/CoreClientManager.java | 2 +- .../src/mineplex/hub/HubManager.java | 2 +- .../nautilus/game/arcade/ArcadeManager.java | 31 +++++++++++++++++-- .../Models/AccountAdministrator.cs | 2 +- .../LOC.Website.Web.Publish.xml | 8 ++--- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index 60615cba1..2747a80cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -196,7 +196,7 @@ public class CoreClientManager extends MiniPlugin // Reserved Slot Check if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) { - if (client.GetRank().Has(event.getPlayer(), Rank.HELPER, false)) + if (client.GetRank().Has(event.getPlayer(), Rank.ULTRA, false)) { event.allow(); event.setResult(PlayerLoginEvent.Result.ALLOWED); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 1c6b00910..1fce65064 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -252,7 +252,7 @@ public class HubManager extends MiniClientPlugin // Reserved Slot Check if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) { - if (!client.GetRank().Has(Rank.HELPER)) + if (!client.GetRank().Has(Rank.ULTRA)) { Bukkit.getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable() { 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 6edbe2e0c..5141b22c0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -103,6 +103,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation private GameLobbyManager _gameLobbyManager; private GameStatsManager _gameStatsManager; private GameWorldManager _gameWorldManager; + private ServerStatusManager _serverStatusManager; private StatsManager _statsManager; private ClassManager _classManager; @@ -153,8 +154,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation } _clientManager = clientManager; - - _chat = new Chat(plugin, _clientManager, preferences, serverStatusManager.getCurrentServerName()); + _serverStatusManager = serverStatusManager; + _chat = new Chat(plugin, _clientManager, preferences, _serverStatusManager.getCurrentServerName()); _creature = creature; @@ -493,6 +494,32 @@ public class ArcadeManager extends MiniPlugin implements IRelation new String[] {"", ChatColor.RESET + "Click while holding this", ChatColor.RESET + "to return to the Hub."})); } + @EventHandler + public void Login(PlayerLoginEvent event) + { + // Reserved Slot Check + if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers()) + { + if (_serverStatusManager.getCurrentServerName().contains("BETA")) + { + if (_clientManager.Get(event.getPlayer().getName()).GetRank().Has(event.getPlayer(), Rank.HELPER, false)) + { + event.allow(); + event.setResult(PlayerLoginEvent.Result.ALLOWED); + return; + } + } + else if (_clientManager.Get(event.getPlayer().getName()).GetRank().Has(event.getPlayer(), Rank.ULTRA, false) || _donationManager.Get(event.getPlayer().getName()).OwnsUnknownPackage(_serverConfig.ServerType + " ULTRA")) + { + event.allow(); + event.setResult(PlayerLoginEvent.Result.ALLOWED); + return; + } + + event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Server Full > Purchase Ultra at www.mineplex.com/shop"); + } + } + public boolean IsAlive(Player player) { if (_game == null) diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 8ceeacb99..2e7543c43 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -507,7 +507,7 @@ return "ALL"; if (account.Rank.Name == "ADMIN" || account.Rank.Name == "OWNER" || account.Rank.Name == "DEVELOPER" || account.Rank.Name == "YOUTUBE") - return token.Rank; + return account.Rank.Name; if (rank == null) return account.Rank.ToString(); diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index 9d0471067..62e1e74fb 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -614,7 +614,7 @@ - + @@ -623,7 +623,7 @@ - + @@ -695,9 +695,9 @@ - + - +