This commit is contained in:
Ty Sayers 2015-03-12 18:20:08 -04:00
commit f812243185
8 changed files with 564 additions and 1250 deletions

Binary file not shown.

View File

@ -66,9 +66,9 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
ServerCommandManager.getInstance().registerCommandType("AnnouncementCommand", AnnouncementCommand.class, ServerCommandManager.getInstance().registerCommandType("AnnouncementCommand", AnnouncementCommand.class,
new AnnouncementHandler()); new AnnouncementHandler());
//ServerCommandManager.getInstance().registerCommandType("RedisMessage", RedisMessage.class, messageHandler); ServerCommandManager.getInstance().registerCommandType("RedisMessage", RedisMessage.class, messageHandler);
//ServerCommandManager.getInstance() ServerCommandManager.getInstance()
// .registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler); .registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler);
} }
public void addCommands() public void addCommands()
@ -113,7 +113,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
public String canReceiverMessageThem(String sender, Player target) public String canReceiverMessageThem(String sender, Player target)
{ {
// If the receiver has turned off private messaging and the sender isn't a mod // If the receiver has turned off private messaging and the sender isn't a mod
if (!_preferences.Get(target).PrivateMessaging) if (!_preferences.Get(target).PrivateMessaging)
{ {
@ -311,7 +310,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
public void receiveMessage(Player to, RedisMessage globalMessage) public void receiveMessage(Player to, RedisMessage globalMessage)
{ {
if (globalMessage.isStaffMessage()) if (globalMessage.isStaffMessage())
{ {
// Message the receiver // Message the receiver
@ -490,7 +488,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
// If this is a admin message, or the sender isn't muted/ignoring the target // If this is a admin message, or the sender isn't muted/ignoring the target
if (adminMessage || canSenderMessageThem(sender, playerTarget)) if (adminMessage || canSenderMessageThem(sender, playerTarget))
{ {
/*
// Construct the command to send to redis // Construct the command to send to redis
RedisMessage globalMessage = new RedisMessage(_serverName, RedisMessage globalMessage = new RedisMessage(_serverName,
@ -530,7 +527,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
// Time to send the message! // Time to send the message!
globalMessage.publish(); globalMessage.publish();
*/
} }
} }
} }

View File

@ -40,8 +40,8 @@ public class PartyManager extends MiniPlugin
_preferenceManager = preferenceManager; _preferenceManager = preferenceManager;
_serverName = getPlugin().getConfig().getString("serverstatus.name"); _serverName = getPlugin().getConfig().getString("serverstatus.name");
//ServerCommandManager.getInstance().registerCommandType("RedisPartyData", RedisPartyData.class, ServerCommandManager.getInstance().registerCommandType("RedisPartyData", RedisPartyData.class,
// new RedisPartyHandler(this)); new RedisPartyHandler(this));
} }
@Override @Override
@ -92,7 +92,6 @@ public class PartyManager extends MiniPlugin
@EventHandler @EventHandler
public void serverTransfer(ServerTransferEvent event) public void serverTransfer(ServerTransferEvent event)
{ {
/*
for (Party party : _parties) for (Party party : _parties)
{ {
if (party.GetLeader().equals(event.getPlayer().getName())) if (party.GetLeader().equals(event.getPlayer().getName()))
@ -124,7 +123,6 @@ public class PartyManager extends MiniPlugin
break; break;
} }
} }
*/
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)

View File

@ -17,9 +17,14 @@ public class RedisPartyHandler implements CommandCallback
@Override @Override
public void run(ServerCommand command) public void run(ServerCommand command)
{ {
RedisPartyData data = (RedisPartyData) command; final RedisPartyData data = (RedisPartyData) command;
_partyManager.addParty(new Party(_partyManager, data)); _partyManager.getPlugin().getServer().getScheduler().runTask(_partyManager.getPlugin(), new Runnable()
{
public void run()
{
_partyManager.addParty(new Party(_partyManager, data));
}
});
} }
} }

View File

@ -167,7 +167,7 @@ public class Punish extends MiniPlugin
if (target != null) if (target != null)
target.kickPlayer(kickReason); target.kickPlayer(kickReason);
else 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); target.playSound(target.getLocation(), Sound.CAT_MEOW, 1f, 1f);
} }
else 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>() _repository.LoadPunishClient(playerName, new Callback<PunishClientToken>()
{ {

View File

@ -46,19 +46,17 @@ public class Teleport extends MiniPlugin
_serverName = getPlugin().getConfig().getString("serverstatus.name"); _serverName = getPlugin().getConfig().getString("serverstatus.name");
/*
RedisLocateHandler locateHandler = new RedisLocateHandler(this); RedisLocateHandler locateHandler = new RedisLocateHandler(this);
ServerCommandManager.getInstance().registerCommandType("RedisLocate", RedisLocate.class, locateHandler); ServerCommandManager.getInstance().registerCommandType("RedisLocate", RedisLocate.class, locateHandler);
ServerCommandManager.getInstance().registerCommandType("RedisLocateCallback", RedisLocateCallback.class, locateHandler); ServerCommandManager.getInstance().registerCommandType("RedisLocateCallback", RedisLocateCallback.class, locateHandler);
*/
} }
@Override @Override
public void addCommands() public void addCommands()
{ {
addCommand(new TeleportCommand(this)); addCommand(new TeleportCommand(this));
//addCommand(new LocateCommand(this)); addCommand(new LocateCommand(this));
} }
public void handleLocateCallback(RedisLocateCallback callback) public void handleLocateCallback(RedisLocateCallback callback)

View File

@ -9,6 +9,7 @@ import java.util.UUID;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.database.DBPool;
import mineplex.core.database.RepositoryBase; import mineplex.core.database.RepositoryBase;
import mineplex.core.database.ResultSetCallable; import mineplex.core.database.ResultSetCallable;
import mineplex.core.database.column.ColumnBoolean; import mineplex.core.database.column.ColumnBoolean;
@ -59,7 +60,7 @@ public class ClanRepository extends RepositoryBase
public ClanRepository(JavaPlugin plugin, String serverName) public ClanRepository(JavaPlugin plugin, String serverName)
{ {
super(plugin, "jdbc:mysql://db.mineplex.com:3306/Account?autoReconnect=true&failOverReadOnly=false&maxReconnects=10", "root", "tAbechAk3wR7tuTh"); super(plugin, DBPool.ACCOUNT);
_serverName = serverName; _serverName = serverName;
} }