2013-11-15 22:55:57 +00:00
|
|
|
/**
|
2015-06-09 23:37:01 +00:00
|
|
|
* This is free and unencumbered software released into the public domain.
|
2015-06-24 09:54:43 +00:00
|
|
|
*
|
2015-06-09 23:37:01 +00:00
|
|
|
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
|
|
* distribute this software, either in source code form or as a compiled
|
|
|
|
* binary, for any purpose, commercial or non-commercial, and by any
|
|
|
|
* means.
|
2015-06-24 09:54:43 +00:00
|
|
|
*
|
2015-06-09 23:37:01 +00:00
|
|
|
* In jurisdictions that recognize copyright laws, the author or authors
|
|
|
|
* of this software dedicate any and all copyright interest in the
|
|
|
|
* software to the public domain. We make this dedication for the benefit
|
|
|
|
* of the public at large and to the detriment of our heirs and
|
|
|
|
* successors. We intend this dedication to be an overt act of
|
|
|
|
* relinquishment in perpetuity of all present and future rights to this
|
|
|
|
* software under copyright law.
|
2015-06-24 09:54:43 +00:00
|
|
|
*
|
2015-06-09 23:37:01 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
2015-06-24 09:54:43 +00:00
|
|
|
*
|
2015-06-09 23:37:01 +00:00
|
|
|
* For more information, please refer to <http://unlicense.org/>
|
2013-11-15 22:55:57 +00:00
|
|
|
*/
|
|
|
|
package com.imaginarycode.minecraft.redisbungee;
|
|
|
|
|
|
|
|
import com.google.common.base.Joiner;
|
2014-04-20 05:12:28 +00:00
|
|
|
import com.google.common.collect.HashMultimap;
|
2013-11-15 22:55:57 +00:00
|
|
|
import com.google.common.collect.Multimap;
|
|
|
|
import net.md_5.bungee.api.ChatColor;
|
|
|
|
import net.md_5.bungee.api.CommandSender;
|
2013-12-14 14:28:51 +00:00
|
|
|
import net.md_5.bungee.api.chat.BaseComponent;
|
|
|
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
2013-12-15 18:33:04 +00:00
|
|
|
import net.md_5.bungee.api.chat.TextComponent;
|
2013-11-15 22:55:57 +00:00
|
|
|
import net.md_5.bungee.api.config.ServerInfo;
|
|
|
|
import net.md_5.bungee.api.plugin.Command;
|
|
|
|
|
2013-12-13 21:32:55 +00:00
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.text.SimpleDateFormat;
|
2014-04-20 05:12:28 +00:00
|
|
|
import java.util.Map;
|
2015-06-22 10:06:02 +00:00
|
|
|
import java.util.Set;
|
2013-12-14 05:31:57 +00:00
|
|
|
import java.util.TreeSet;
|
2014-04-20 05:12:28 +00:00
|
|
|
import java.util.UUID;
|
2013-11-15 22:55:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This class contains subclasses that are used for the commands RedisBungee overrides or includes: /glist, /find and /lastseen.
|
2014-09-21 17:56:46 +00:00
|
|
|
* <p>
|
2013-11-15 22:55:57 +00:00
|
|
|
* All classes use the {@link RedisBungeeAPI}.
|
|
|
|
*
|
|
|
|
* @author tuxed
|
|
|
|
* @since 0.2.3
|
|
|
|
*/
|
2013-12-24 05:15:06 +00:00
|
|
|
class RedisBungeeCommands {
|
2013-12-14 14:34:42 +00:00
|
|
|
private static final BaseComponent[] NO_PLAYER_SPECIFIED =
|
2014-01-17 02:28:25 +00:00
|
|
|
new ComponentBuilder("You must specify a player name.").color(ChatColor.RED).create();
|
2013-12-14 14:34:42 +00:00
|
|
|
private static final BaseComponent[] PLAYER_NOT_FOUND =
|
2014-01-17 02:28:25 +00:00
|
|
|
new ComponentBuilder("No such player found.").color(ChatColor.RED).create();
|
2014-01-17 00:49:57 +00:00
|
|
|
private static final BaseComponent[] NO_COMMAND_SPECIFIED =
|
2014-01-17 02:28:25 +00:00
|
|
|
new ComponentBuilder("You must specify a command to be run.").color(ChatColor.RED).create();
|
2013-12-14 14:34:42 +00:00
|
|
|
|
2015-06-22 10:06:02 +00:00
|
|
|
private static String playerPlural(int num) {
|
|
|
|
return num == 1 ? num + " player is" : num + " players are";
|
|
|
|
}
|
|
|
|
|
2013-11-15 22:55:57 +00:00
|
|
|
public static class GlistCommand extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
GlistCommand(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("glist", "bungeecord.command.list", "redisbungee", "rglist");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-20 05:12:28 +00:00
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
int count = RedisBungee.getApi().getPlayerCount();
|
2015-06-22 10:06:02 +00:00
|
|
|
BaseComponent[] playersOnline = new ComponentBuilder("").color(ChatColor.YELLOW)
|
|
|
|
.append(playerPlural(count) + " currently online.").create();
|
2014-04-20 05:12:28 +00:00
|
|
|
if (args.length > 0 && args[0].equals("showall")) {
|
2015-04-18 14:14:49 +00:00
|
|
|
Multimap<String, UUID> serverToPlayers = RedisBungee.getApi().getServerToPlayers();
|
|
|
|
Multimap<String, String> human = HashMultimap.create();
|
|
|
|
for (Map.Entry<String, UUID> entry : serverToPlayers.entries()) {
|
|
|
|
human.put(entry.getKey(), plugin.getUuidTranslator().getNameFromUuid(entry.getValue(), false));
|
|
|
|
}
|
|
|
|
for (String server : new TreeSet<>(serverToPlayers.keySet())) {
|
|
|
|
TextComponent serverName = new TextComponent();
|
|
|
|
serverName.setColor(ChatColor.GREEN);
|
|
|
|
serverName.setText("[" + server + "] ");
|
|
|
|
TextComponent serverCount = new TextComponent();
|
|
|
|
serverCount.setColor(ChatColor.YELLOW);
|
|
|
|
serverCount.setText("(" + serverToPlayers.get(server).size() + "): ");
|
|
|
|
TextComponent serverPlayers = new TextComponent();
|
|
|
|
serverPlayers.setColor(ChatColor.WHITE);
|
|
|
|
serverPlayers.setText(Joiner.on(", ").join(human.get(server)));
|
|
|
|
sender.sendMessage(serverName, serverCount, serverPlayers);
|
2014-04-20 05:12:28 +00:00
|
|
|
}
|
|
|
|
sender.sendMessage(playersOnline);
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(playersOnline);
|
|
|
|
sender.sendMessage(new ComponentBuilder("To see all players online, use /glist showall.").color(ChatColor.YELLOW).create());
|
2013-12-15 18:33:04 +00:00
|
|
|
}
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
2014-04-20 05:12:28 +00:00
|
|
|
});
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class FindCommand extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
FindCommand(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("find", "bungeecord.command.find", "rfind");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-20 05:12:28 +00:00
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (args.length > 0) {
|
2014-05-31 03:57:42 +00:00
|
|
|
UUID uuid = plugin.getUuidTranslator().getTranslatedUuid(args[0], true);
|
2014-04-20 14:50:45 +00:00
|
|
|
if (uuid == null) {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ServerInfo si = RedisBungee.getApi().getServerFor(uuid);
|
2014-04-20 05:12:28 +00:00
|
|
|
if (si != null) {
|
|
|
|
TextComponent message = new TextComponent();
|
|
|
|
message.setColor(ChatColor.BLUE);
|
|
|
|
message.setText(args[0] + " is on " + si.getName() + ".");
|
|
|
|
sender.sendMessage(message);
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(NO_PLAYER_SPECIFIED);
|
|
|
|
}
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
2014-04-20 05:12:28 +00:00
|
|
|
});
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class LastSeenCommand extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
LastSeenCommand(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("lastseen", "redisbungee.command.lastseen", "rlastseen");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-20 05:12:28 +00:00
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (args.length > 0) {
|
2014-05-31 03:57:42 +00:00
|
|
|
UUID uuid = plugin.getUuidTranslator().getTranslatedUuid(args[0], true);
|
2014-04-20 14:50:45 +00:00
|
|
|
if (uuid == null) {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
long secs = RedisBungee.getApi().getLastOnline(uuid);
|
2014-04-20 05:12:28 +00:00
|
|
|
TextComponent message = new TextComponent();
|
|
|
|
if (secs == 0) {
|
|
|
|
message.setColor(ChatColor.GREEN);
|
|
|
|
message.setText(args[0] + " is currently online.");
|
|
|
|
} else if (secs != -1) {
|
|
|
|
message.setColor(ChatColor.BLUE);
|
|
|
|
message.setText(args[0] + " was last online on " + new SimpleDateFormat().format(secs) + ".");
|
|
|
|
} else {
|
|
|
|
message.setColor(ChatColor.RED);
|
|
|
|
message.setText(args[0] + " has never been online.");
|
|
|
|
}
|
2014-05-23 04:22:13 +00:00
|
|
|
sender.sendMessage(message);
|
2014-04-20 05:12:28 +00:00
|
|
|
} else {
|
|
|
|
sender.sendMessage(NO_PLAYER_SPECIFIED);
|
|
|
|
}
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
2014-04-20 05:12:28 +00:00
|
|
|
});
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|
|
|
|
}
|
2013-12-13 21:32:55 +00:00
|
|
|
|
|
|
|
public static class IpCommand extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
IpCommand(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("ip", "redisbungee.command.ip", "playerip", "rip", "rplayerip");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2013-12-13 21:32:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-20 05:12:28 +00:00
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (args.length > 0) {
|
2014-05-31 03:57:42 +00:00
|
|
|
UUID uuid = plugin.getUuidTranslator().getTranslatedUuid(args[0], true);
|
2014-04-20 14:50:45 +00:00
|
|
|
if (uuid == null) {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
InetAddress ia = RedisBungee.getApi().getPlayerIp(uuid);
|
2014-04-20 05:12:28 +00:00
|
|
|
if (ia != null) {
|
|
|
|
TextComponent message = new TextComponent();
|
|
|
|
message.setColor(ChatColor.GREEN);
|
|
|
|
message.setText(args[0] + " is connected from " + ia.toString() + ".");
|
2014-05-23 04:22:13 +00:00
|
|
|
sender.sendMessage(message);
|
2014-04-20 05:12:28 +00:00
|
|
|
} else {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(NO_PLAYER_SPECIFIED);
|
|
|
|
}
|
2013-12-13 21:32:55 +00:00
|
|
|
}
|
2014-04-20 05:12:28 +00:00
|
|
|
});
|
2014-08-21 01:31:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class PlayerProxyCommand extends Command {
|
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
PlayerProxyCommand(RedisBungee plugin) {
|
|
|
|
super("pproxy", "redisbungee.command.pproxy");
|
|
|
|
this.plugin = plugin;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (args.length > 0) {
|
|
|
|
UUID uuid = plugin.getUuidTranslator().getTranslatedUuid(args[0], true);
|
|
|
|
if (uuid == null) {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String proxy = RedisBungee.getApi().getProxy(uuid);
|
|
|
|
if (proxy != null) {
|
|
|
|
TextComponent message = new TextComponent();
|
|
|
|
message.setColor(ChatColor.GREEN);
|
|
|
|
message.setText(args[0] + " is connected to " + proxy + ".");
|
|
|
|
sender.sendMessage(message);
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(PLAYER_NOT_FOUND);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(NO_PLAYER_SPECIFIED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2013-12-13 21:32:55 +00:00
|
|
|
}
|
|
|
|
}
|
2014-01-17 00:49:57 +00:00
|
|
|
|
|
|
|
public static class SendToAll extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
SendToAll(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("sendtoall", "redisbungee.command.sendtoall", "rsendtoall");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2014-01-17 00:49:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(CommandSender sender, String[] args) {
|
|
|
|
if (args.length > 0) {
|
|
|
|
String command = Joiner.on(" ").skipNulls().join(args);
|
|
|
|
RedisBungee.getApi().sendProxyCommand(command);
|
|
|
|
TextComponent message = new TextComponent();
|
|
|
|
message.setColor(ChatColor.GREEN);
|
|
|
|
message.setText("Sent the command /" + command + " to all proxies.");
|
2014-05-23 04:22:13 +00:00
|
|
|
sender.sendMessage(message);
|
2014-01-17 00:49:57 +00:00
|
|
|
} else {
|
|
|
|
sender.sendMessage(NO_COMMAND_SPECIFIED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-01-17 02:31:57 +00:00
|
|
|
|
|
|
|
public static class ServerId extends Command {
|
2014-04-20 05:12:28 +00:00
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
ServerId(RedisBungee plugin) {
|
2014-01-24 20:40:45 +00:00
|
|
|
super("serverid", "redisbungee.command.serverid", "rserverid");
|
2014-04-20 05:12:28 +00:00
|
|
|
this.plugin = plugin;
|
2014-01-17 02:31:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(CommandSender sender, String[] args) {
|
|
|
|
TextComponent textComponent = new TextComponent();
|
|
|
|
textComponent.setText("You are on " + RedisBungee.getApi().getServerId() + ".");
|
|
|
|
textComponent.setColor(ChatColor.YELLOW);
|
|
|
|
sender.sendMessage(textComponent);
|
|
|
|
}
|
|
|
|
}
|
2014-04-20 05:12:28 +00:00
|
|
|
|
|
|
|
public static class ServerIds extends Command {
|
|
|
|
public ServerIds() {
|
|
|
|
super("serverids", "redisbungee.command.serverids");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(CommandSender sender, String[] strings) {
|
|
|
|
TextComponent textComponent = new TextComponent();
|
|
|
|
textComponent.setText("All server IDs: " + Joiner.on(", ").join(RedisBungee.getApi().getAllServers()));
|
|
|
|
textComponent.setColor(ChatColor.YELLOW);
|
|
|
|
sender.sendMessage(textComponent);
|
|
|
|
}
|
|
|
|
}
|
2015-06-22 10:06:02 +00:00
|
|
|
|
|
|
|
public static class PlistCommand extends Command {
|
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
PlistCommand(RedisBungee plugin) {
|
2015-08-02 23:57:48 +00:00
|
|
|
super("plist", "redisbungee.command.plist", "rplist");
|
2015-06-22 10:06:02 +00:00
|
|
|
this.plugin = plugin;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
String proxy = args.length >= 1 ? args[0] : RedisBungee.getConfiguration().getServerId();
|
|
|
|
if (!plugin.getServerIds().contains(proxy)) {
|
|
|
|
sender.sendMessage(new ComponentBuilder(proxy + " is not a valid proxy. See /serverids for valid proxies.").color(ChatColor.RED).create());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Set<UUID> players = RedisBungee.getApi().getPlayersOnProxy(proxy);
|
|
|
|
BaseComponent[] playersOnline = new ComponentBuilder("").color(ChatColor.YELLOW)
|
|
|
|
.append(playerPlural(players.size()) + " currently on proxy " + proxy + ".").create();
|
|
|
|
if (args.length >= 2 && args[1].equals("showall")) {
|
|
|
|
Multimap<String, UUID> serverToPlayers = RedisBungee.getApi().getServerToPlayers();
|
|
|
|
Multimap<String, String> human = HashMultimap.create();
|
|
|
|
for (Map.Entry<String, UUID> entry : serverToPlayers.entries()) {
|
|
|
|
if (players.contains(entry.getValue())) {
|
|
|
|
human.put(entry.getKey(), plugin.getUuidTranslator().getNameFromUuid(entry.getValue(), false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (String server : new TreeSet<>(human.keySet())) {
|
|
|
|
TextComponent serverName = new TextComponent();
|
|
|
|
serverName.setColor(ChatColor.RED);
|
|
|
|
serverName.setText("[" + server + "] ");
|
|
|
|
TextComponent serverCount = new TextComponent();
|
|
|
|
serverCount.setColor(ChatColor.YELLOW);
|
|
|
|
serverCount.setText("(" + serverToPlayers.get(server).size() + "): ");
|
|
|
|
TextComponent serverPlayers = new TextComponent();
|
|
|
|
serverPlayers.setColor(ChatColor.WHITE);
|
|
|
|
serverPlayers.setText(Joiner.on(", ").join(human.get(server)));
|
|
|
|
sender.sendMessage(serverName, serverCount, serverPlayers);
|
|
|
|
}
|
|
|
|
sender.sendMessage(playersOnline);
|
|
|
|
} else {
|
|
|
|
sender.sendMessage(playersOnline);
|
|
|
|
sender.sendMessage(new ComponentBuilder("To see all players online, use /plist " + proxy + " showall.").color(ChatColor.YELLOW).create());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2015-08-02 23:57:48 +00:00
|
|
|
|
|
|
|
public static class DebugCommand extends Command {
|
|
|
|
private final RedisBungee plugin;
|
|
|
|
|
|
|
|
DebugCommand(RedisBungee plugin) {
|
|
|
|
super("rdebug", "redisbungee.command.debug");
|
|
|
|
this.plugin = plugin;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(final CommandSender sender, final String[] args) {
|
|
|
|
TextComponent poolActiveStat = new TextComponent("Currently active pool objects: " + plugin.getPool().getNumActive());
|
|
|
|
TextComponent poolIdleStat = new TextComponent("Currently idle pool objects: " + plugin.getPool().getNumIdle());
|
|
|
|
TextComponent poolWaitingStat = new TextComponent("Waiting on free objects: " + plugin.getPool().getNumWaiters());
|
|
|
|
sender.sendMessage(poolActiveStat);
|
|
|
|
sender.sendMessage(poolIdleStat);
|
|
|
|
sender.sendMessage(poolWaitingStat);
|
|
|
|
}
|
|
|
|
}
|
2013-11-15 22:55:57 +00:00
|
|
|
}
|