2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00

Minor refactor and fixes.

This commit is contained in:
Tux 2013-12-23 23:42:56 -05:00
parent d079990a3a
commit f240742489
3 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,6 @@ import java.util.logging.Level;
*/
public final class RedisBungee extends Plugin implements Listener {
private static final ServerPing.PlayerInfo[] EMPTY_PLAYERINFO = new ServerPing.PlayerInfo[]{};
private RedisBungeeCommandSender commandSender = new RedisBungeeCommandSender();
private static Configuration configuration;
private JedisPool pool;
private RedisBungee plugin;
@ -390,7 +389,7 @@ public final class RedisBungee extends Plugin implements Listener {
cmd = s2;
}
getLogger().info("Invoking command from PubSub: /" + s2);
getProxy().getPluginManager().dispatchCommand(commandSender, cmd);
getProxy().getPluginManager().dispatchCommand(RedisBungeeCommandSender.instance, cmd);
}
@Override

View File

@ -22,8 +22,10 @@ import java.util.Collections;
* @author tuxed
* @since 0.2.3
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RedisBungeeCommandSender implements CommandSender {
protected static RedisBungeeCommandSender instance = new RedisBungeeCommandSender();
@Override
public String getName() {
return "RedisBungee";

View File

@ -47,7 +47,7 @@ public class RedisBungeeCommands {
BaseComponent[] playersOnline = new ComponentBuilder("").color(ChatColor.YELLOW).append(String.valueOf(count))
.append(" player(s) are currently online.").create();
if (args.length > 0 && args[0].equals("showall")) {
if (RedisBungee.getConfiguration().getBoolean("canonical-glist", false)) {
if (RedisBungee.getConfiguration().getBoolean("canonical-glist", true)) {
Multimap<String, String> serverToPlayers = HashMultimap.create();
for (String p : RedisBungee.getApi().getPlayersOnline()) {
ServerInfo si = RedisBungee.getApi().getServerFor(p);