Removed threading for ServerCommandManager

Removed target server check (some commands are broadcasted)

Disabled Message/Party crossserver listeners.
This commit is contained in:
Jonathan Williams 2015-03-06 04:12:11 -08:00
parent 2d7f65588c
commit c15c6e2dd8
3 changed files with 13 additions and 20 deletions

View File

@ -66,9 +66,9 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
ServerCommandManager.getInstance().registerCommandType("AnnouncementCommand", AnnouncementCommand.class,
new AnnouncementHandler());
ServerCommandManager.getInstance().registerCommandType("RedisMessage", RedisMessage.class, messageHandler);
ServerCommandManager.getInstance()
.registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler);
//ServerCommandManager.getInstance().registerCommandType("RedisMessage", RedisMessage.class, messageHandler);
//ServerCommandManager.getInstance()
// .registerCommandType("RedisMessageCallback", RedisMessageCallback.class, messageHandler);
}
public void addCommands()

View File

@ -40,8 +40,8 @@ public class PartyManager extends MiniPlugin
_preferenceManager = preferenceManager;
_serverName = getPlugin().getConfig().getString("serverstatus.name");
ServerCommandManager.getInstance().registerCommandType("RedisPartyData", RedisPartyData.class,
new RedisPartyHandler(this));
//ServerCommandManager.getInstance().registerCommandType("RedisPartyData", RedisPartyData.class,
// new RedisPartyHandler(this));
}
@Override

View File

@ -112,22 +112,15 @@ public class ServerCommandManager
{
Class<? extends ServerCommand> commandClazz = _commandTypes.get(commandType).getCommandType();
final ServerCommand serverCommand = Utility.deserialize(serializedCommand, commandClazz);
new Thread("Redis Command " + commandType)
// TODO: Run synchronously?
CommandCallback callback = _commandTypes.get(commandType).getCallback();
serverCommand.run(); // Run server command without callback
if (callback != null)
{
public void run()
{
// TODO: Run synchronously?
CommandCallback callback = _commandTypes.get(commandType).getCallback();
serverCommand.run(); // Run server command without callback
if (callback != null)
{
callback.run(serverCommand); // Run callback
}
}
}.start();
callback.run(serverCommand); // Run callback
}
}
}