Add server getPlayer method and rename the ping/getPlayerCount methods.

This commit is contained in:
md_5 2013-01-12 14:40:58 +11:00
parent 6b6aae8020
commit a946e988bf
2 changed files with 13 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import java.util.Collection;
import java.util.logging.Logger;
import lombok.Getter;
import net.md_5.bungee.api.config.ConfigurationAdapter;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
public abstract class ProxyServer
@ -51,11 +52,11 @@ public abstract class ProxyServer
public abstract Logger getLogger();
/**
* Return all currently networked connections to this proxy.
* Return all players currently connected.
*
* @return all networked users
* @return all connected players
*/
public abstract Collection<Connection> getConnections();
public abstract Collection<ProxiedPlayer> getPlayers();
/**
* Get the {@link PluginManager} associated with loading plugins and

View File

@ -1,6 +1,7 @@
package net.md_5.bungee.api.connection;
import java.net.InetSocketAddress;
import java.util.Collection;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.md_5.bungee.api.Callback;
@ -40,5 +41,12 @@ public abstract class Server implements Connection
*
* @param callback the callback to call when the count has been retrieved.
*/
public abstract void getPlayerCount(Callback<ServerPing> callback);
public abstract void ping(Callback<ServerPing> callback);
/**
* Get all players on this instance connected to this server.
*
* @return all players connected to this server
*/
public abstract Collection<ProxiedPlayer> getPlayers();
}