Disabled redis pub commands.
Added getServerStatusesByPrefix to redis. Increased timeout for servers. Turned on DoubleGemWeekend
This commit is contained in:
parent
8cc60e1b65
commit
27c17eccfb
@ -490,6 +490,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
// 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<ClientMessage>
|
||||
|
||||
// Time to send the message!
|
||||
globalMessage.publish();
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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<PunishClientToken>()
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -51,6 +51,12 @@ public class RedisServerRepository implements ServerRepository
|
||||
|
||||
@Override
|
||||
public Collection<MinecraftServer> getServerStatuses()
|
||||
{
|
||||
return getServerStatusesByPrefix("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<MinecraftServer> getServerStatusesByPrefix(String prefix)
|
||||
{
|
||||
Collection<MinecraftServer> servers = new HashSet<MinecraftServer>();
|
||||
Jedis jedis = _readPool.getResource();
|
||||
@ -63,8 +69,11 @@ public class RedisServerRepository implements ServerRepository
|
||||
List<Response<String>> responses = new ArrayList<Response<String>>();
|
||||
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();
|
||||
@ -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
|
||||
|
@ -18,6 +18,8 @@ public interface ServerRepository
|
||||
*/
|
||||
public Collection<MinecraftServer> getServerStatuses();
|
||||
|
||||
public Collection<MinecraftServer> getServerStatusesByPrefix(String prefix);
|
||||
|
||||
public Collection<MinecraftServer> getServersByGroup(String serverGroup);
|
||||
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ public class GameGemManager implements Listener
|
||||
{
|
||||
ArcadeManager Manager;
|
||||
|
||||
boolean DoubleGem = false;
|
||||
boolean DoubleGem = true;
|
||||
|
||||
public GameGemManager(ArcadeManager manager)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user