From a946e988bf57eedf2331efb47b9be9e85f66b9f8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 Jan 2013 14:40:58 +1100 Subject: [PATCH] Add server getPlayer method and rename the ping/getPlayerCount methods. --- api/src/main/java/net/md_5/bungee/api/ProxyServer.java | 7 ++++--- .../java/net/md_5/bungee/api/connection/Server.java | 10 +++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java index 0f38f5b28..b95321cd9 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java @@ -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 getConnections(); + public abstract Collection getPlayers(); /** * Get the {@link PluginManager} associated with loading plugins and diff --git a/api/src/main/java/net/md_5/bungee/api/connection/Server.java b/api/src/main/java/net/md_5/bungee/api/connection/Server.java index 268f63e85..692729ad3 100644 --- a/api/src/main/java/net/md_5/bungee/api/connection/Server.java +++ b/api/src/main/java/net/md_5/bungee/api/connection/Server.java @@ -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 callback); + public abstract void ping(Callback callback); + + /** + * Get all players on this instance connected to this server. + * + * @return all players connected to this server + */ + public abstract Collection getPlayers(); }