From 27c17eccfb97fdcfdd11af67ea0c1b0b788e4161 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 8 Mar 2015 13:47:49 -0700 Subject: [PATCH] Disabled redis pub commands. Added getServerStatusesByPrefix to redis. Increased timeout for servers. Turned on DoubleGemWeekend --- .../mineplex/core/message/MessageManager.java | 2 ++ .../src/mineplex/core/party/PartyManager.java | 2 ++ .../src/mineplex/core/punish/Punish.java | 4 ++-- .../core/status/ServerStatusManager.java | 2 +- .../src/mineplex/core/teleport/Teleport.java | 4 +++- .../serverdata/RedisServerRepository.java | 18 +++++++++++++++--- .../mineplex/serverdata/ServerRepository.java | 2 ++ .../game/arcade/managers/GameGemManager.java | 2 +- 8 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index 47b1948b5..6096e46e9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -490,6 +490,7 @@ public class MessageManager extends MiniClientPlugin // If this is a admin message, or the sender isn't muted/ignoring the target if (adminMessage || canSenderMessageThem(sender, playerTarget)) { + /* // Construct the command to send to redis RedisMessage globalMessage = new RedisMessage(_serverName, @@ -529,6 +530,7 @@ public class MessageManager extends MiniClientPlugin // Time to send the message! globalMessage.publish(); + */ } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/party/PartyManager.java b/Plugins/Mineplex.Core/src/mineplex/core/party/PartyManager.java index 5c334f60d..20601c066 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/party/PartyManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/party/PartyManager.java @@ -92,6 +92,7 @@ public class PartyManager extends MiniPlugin @EventHandler public void serverTransfer(ServerTransferEvent event) { + /* for (Party party : _parties) { if (party.GetLeader().equals(event.getPlayer().getName())) @@ -123,6 +124,7 @@ public class PartyManager extends MiniPlugin break; } } + */ } @EventHandler(priority = EventPriority.MONITOR) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java index ad0cf6594..e84a1c1bd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/Punish.java @@ -167,7 +167,7 @@ public class Punish extends MiniPlugin if (target != null) target.kickPlayer(kickReason); else - new mineplex.serverdata.transfers.PunishCommand(playerName, true, false, kickReason).publish(); + ;//new mineplex.serverdata.transfers.PunishCommand(playerName, true, false, kickReason).publish(); } }); @@ -193,7 +193,7 @@ public class Punish extends MiniPlugin target.playSound(target.getLocation(), Sound.CAT_MEOW, 1f, 1f); } else - new mineplex.serverdata.transfers.PunishCommand(playerName, false, finalDuration != 0, F.main("Punish", F.elem(C.cGray + C.Bold + (finalDuration != 0 ? "Mute" : "Warning") + " Reason: ") + reason)).publish(); + ;//new mineplex.serverdata.transfers.PunishCommand(playerName, false, finalDuration != 0, F.main("Punish", F.elem(C.cGray + C.Bold + (finalDuration != 0 ? "Mute" : "Warning") + " Reason: ") + reason)).publish(); _repository.LoadPunishClient(playerName, new Callback() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java index f466d2c37..e8dba0b5f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusManager.java @@ -26,7 +26,7 @@ import mineplex.serverdata.transfers.SuicideCommand; public class ServerStatusManager extends MiniPlugin { // The default timeout (in seconds) before the ServerStatus expires. - public final int DEFAULT_SERVER_TIMEOUT = 15; + public final int DEFAULT_SERVER_TIMEOUT = 30; private ServerRepository _repository; private CoreClientManager _clientManager; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java index 67dd351f0..6e13426a4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/teleport/Teleport.java @@ -46,17 +46,19 @@ public class Teleport extends MiniPlugin _serverName = getPlugin().getConfig().getString("serverstatus.name"); + /* RedisLocateHandler locateHandler = new RedisLocateHandler(this); ServerCommandManager.getInstance().registerCommandType("RedisLocate", RedisLocate.class, locateHandler); ServerCommandManager.getInstance().registerCommandType("RedisLocateCallback", RedisLocateCallback.class, locateHandler); + */ } @Override public void addCommands() { addCommand(new TeleportCommand(this)); - addCommand(new LocateCommand(this)); + //addCommand(new LocateCommand(this)); } public void handleLocateCallback(RedisLocateCallback callback) diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/RedisServerRepository.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/RedisServerRepository.java index a0b5bab4f..03e4a1be7 100644 --- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/RedisServerRepository.java +++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/RedisServerRepository.java @@ -51,6 +51,12 @@ public class RedisServerRepository implements ServerRepository @Override public Collection getServerStatuses() + { + return getServerStatusesByPrefix(""); + } + + @Override + public Collection getServerStatusesByPrefix(String prefix) { Collection servers = new HashSet(); Jedis jedis = _readPool.getResource(); @@ -63,8 +69,11 @@ public class RedisServerRepository implements ServerRepository List> responses = new ArrayList>(); for (String serverName : getActiveNames(setKey)) { - String dataKey = concatenate(setKey, serverName); - responses.add(pipeline.get(dataKey)); + if (prefix.isEmpty() || serverName.startsWith(prefix)) + { + String dataKey = concatenate(setKey, serverName); + responses.add(pipeline.get(dataKey)); + } } pipeline.sync(); @@ -96,7 +105,7 @@ public class RedisServerRepository implements ServerRepository return servers; } - + @Override public Collection getServersByGroup(String serverGroup) { @@ -146,6 +155,7 @@ public class RedisServerRepository implements ServerRepository @Override public void updataServerStatus(MinecraftServer serverData, int timeout) { + long time = System.currentTimeMillis(); Jedis jedis = _writePool.getResource(); try @@ -174,6 +184,8 @@ public class RedisServerRepository implements ServerRepository _writePool.returnResource(jedis); } } + + System.out.println("Finished update - " + (System.currentTimeMillis() - time) + "ms"); } @Override diff --git a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerRepository.java b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerRepository.java index cd5e4a881..1c2bd5146 100644 --- a/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerRepository.java +++ b/Plugins/Mineplex.ServerData/src/mineplex/serverdata/ServerRepository.java @@ -18,6 +18,8 @@ public interface ServerRepository */ public Collection getServerStatuses(); + public Collection getServerStatusesByPrefix(String prefix); + public Collection getServersByGroup(String serverGroup); /** diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java index 27ded40e6..7f781e56f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java @@ -30,7 +30,7 @@ public class GameGemManager implements Listener { ArcadeManager Manager; - boolean DoubleGem = false; + boolean DoubleGem = true; public GameGemManager(ArcadeManager manager) {