From 3a47a161c5b519103f3eaee540fd00e17762d0f9 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 22 Aug 2014 22:53:15 -0500 Subject: [PATCH] Enabled snake parkour Updated servermanager/serverNpcPage to handle free and beta timers. --- .../mineplex/hub/modules/ParkourManager.java | 3 +-- .../mineplex/hub/server/ServerManager.java | 19 +++++++++---------- .../mineplex/hub/server/ui/ServerNpcPage.java | 16 +++++++++------- .../staffServer/helpdesk/HelpDeskManager.java | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java index 12e8b0d39..0fe0c7daf 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java @@ -89,7 +89,6 @@ public class ParkourManager extends MiniPlugin }, 4000, new Location(Manager.GetSpawn().getWorld(), -93,67,38), new Location(Manager.GetSpawn().getWorld(), -86,100,42), new Location(Manager.GetSpawn().getWorld(), -120,50,-17))); - /* _parkour.add(new ParkourSnake("Snake Parkour", new String[] { "This parkour requires incredible timing", @@ -97,7 +96,7 @@ public class ParkourManager extends MiniPlugin "by the devil as a cruel joke!" }, 8000, new Location(Manager.GetSpawn().getWorld(), 22,70,-54), new Location(Manager.GetSpawn().getWorld(), 28,-50,-88), new Location(Manager.GetSpawn().getWorld(), -24,90,-46))); -*/ + _lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5); _lavaParkourReturn.setYaw(90); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 70e090b22..9db284f4b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -63,6 +63,7 @@ import mineplex.serverdata.MinecraftServer; public class ServerManager extends MiniPlugin { private static final Long FREE_PORTAL_TIMER = 30000L; + private static final Long BETA_PORTAL_TIMER = 600000L; private CoreClientManager _clientManager; private DonationManager _donationManager; @@ -81,7 +82,7 @@ public class ServerManager extends MiniPlugin private NautHashMap _serverPortalLocations = new NautHashMap(); // Join Time for Free Players Timer - private NautHashMap _freeJoinTime = new NautHashMap(); + private NautHashMap _joinTime = new NautHashMap(); private QueueShop _domShop; private QuickShop _quickShop; @@ -141,7 +142,7 @@ public class ServerManager extends MiniPlugin if (!Recharge.Instance.use(player, "Portal Server", 1000, false, false)) return; - long timeUntilPortal = getMillisecondsUntilPortal(player); + long timeUntilPortal = getMillisecondsUntilPortal(player, false); if (!_hubManager.CanPortal(player) || timeUntilPortal > 0) { if (timeUntilPortal > 0) @@ -240,14 +241,14 @@ public class ServerManager extends MiniPlugin if (_clientManager.Get(event.getPlayer()).GetRank() == Rank.ALL) { - _freeJoinTime.put(event.getPlayer().getName(), System.currentTimeMillis()); + _joinTime.put(event.getPlayer().getName(), System.currentTimeMillis()); } } @EventHandler public void playerQuit(PlayerQuitEvent event) { - _freeJoinTime.remove(event.getPlayer().getName()); + _joinTime.remove(event.getPlayer().getName()); } @EventHandler(priority = EventPriority.LOWEST) @@ -263,19 +264,17 @@ public class ServerManager extends MiniPlugin } } - public Long getMillisecondsUntilPortal(Player player) + public Long getMillisecondsUntilPortal(Player player, boolean beta) { // Party party = _partyManager.GetParty(player); long timeLeft = 0; - if (_freeJoinTime.containsKey(player.getName())) + if (_joinTime.containsKey(player.getName())) { - timeLeft = (_freeJoinTime.get(player.getName()) - System.currentTimeMillis()) + FREE_PORTAL_TIMER; + timeLeft = (_joinTime.get(player.getName()) - System.currentTimeMillis()) + (beta ? BETA_PORTAL_TIMER : FREE_PORTAL_TIMER); + if (timeLeft <= 0) - { - _freeJoinTime.remove(player.getName()); timeLeft = 0; - } } // if (party != null) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index af09e5de9..832e84af7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -78,18 +78,18 @@ public class ServerNpcPage extends ShopPageBase im } } - private void showClock(long milliseconds) + private void showClock(long milliseconds, boolean beta) { int seconds = (int) (milliseconds / 1000); - String timeLeft = UtilTime.convertString(milliseconds, 0, UtilTime.TimeUnit.SECONDS); + String timeLeft = UtilTime.convertString(milliseconds, 0, UtilTime.TimeUnit.FIT); byte data = (byte) (milliseconds - (seconds * 1000) > 500 ? 15 : 14); - ShopItem item = new ShopItem(Material.WOOL, data, ChatColor.RESET + C.Bold + "Free Server Timer", null, new String[] { + ShopItem item = new ShopItem(Material.WOOL, data, ChatColor.RESET + C.Bold + (beta ? "Beta" : "Free") + " Server Timer", null, new String[] { ChatColor.RESET + C.cGreen + timeLeft + " Remaining...", ChatColor.RESET + "", - ChatColor.RESET + C.cYellow + "Free players must wait a short time", - ChatColor.RESET + C.cYellow + "to help lighten the load on our servers.", + ChatColor.RESET + C.cYellow + "Free players must wait a " + (beta ? "long" : "short") + " time", + ChatColor.RESET + C.cYellow + "to help lighten the load on our " + (beta ? "Beta" : "") + " servers.", ChatColor.RESET + "", ChatColor.RESET + C.cAqua + "Ultra and Hero players have", ChatColor.RESET + C.cAqua + "instant access to our servers!", @@ -186,10 +186,12 @@ public class ServerNpcPage extends ShopPageBase im int greenStartSlot = 18 + ((9 - serversToShow) / 2); boolean showGreen = true; - long portalTime = Plugin.getMillisecondsUntilPortal(Player); + boolean beta = serverList.size() > 0 && serverList.get(0).Name.contains("BETA"); + + long portalTime = Plugin.getMillisecondsUntilPortal(Player, beta); if (portalTime > 0) { - showClock(portalTime); + showClock(portalTime, beta); showGreen = false; } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/helpdesk/HelpDeskManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/helpdesk/HelpDeskManager.java index 860193f09..d07f71e74 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/helpdesk/HelpDeskManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/helpdesk/HelpDeskManager.java @@ -11,6 +11,6 @@ public class HelpDeskManager extends MiniPlugin { super("Help Desk", plugin); - new ApiGetCall("https://mineplex.jitbit.com/helpdesk/api", "Tickets"); + new ApiGetCall("https://mineplex.jitbit.com/helpdesk/api", "Tickets&"); } }