Package net.md_5.bungee.api.config
Interface ServerInfo
public interface ServerInfo
Class used to represent a server to connect to.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAccess
(CommandSender sender) Whether the player can access this server.Deprecated.BungeeCord can connect via Unix domain socketsgetMotd()
Returns the MOTD which should be used when this server is a forced host.getName()
Get the name of this server.Get the permission required to access this server.Get the set of all players on this server.Gets the connectable address for this server.boolean
Whether this server is restricted and therefore only players with the given permission can access it.void
ping
(Callback<ServerPing> callback) Asynchronously gets the current player count on this server.void
Send data by any available means to this server.boolean
Send data by any available means to this server.
-
Method Details
-
getName
String getName()Get the name of this server.- Returns:
- the configured name for this server address
-
getAddress
Deprecated.BungeeCord can connect via Unix domain socketsGets the connectable host + port pair for this server. Implementations expect this to be used as the unique identifier per each instance of this class.- Returns:
- the IP and port pair for this server
-
getSocketAddress
SocketAddress getSocketAddress()Gets the connectable address for this server. Implementations expect this to be used as the unique identifier per each instance of this class.- Returns:
- the address for this server
-
getPlayers
Collection<ProxiedPlayer> getPlayers()Get the set of all players on this server.- Returns:
- an unmodifiable collection of all players on this server
-
getMotd
String getMotd()Returns the MOTD which should be used when this server is a forced host.- Returns:
- the motd
-
isRestricted
boolean isRestricted()Whether this server is restricted and therefore only players with the given permission can access it.- Returns:
- if restricted
-
getPermission
String getPermission()Get the permission required to access this server. Only enforced when the server is restricted.- Returns:
- access permission
-
canAccess
Whether the player can access this server. It will only return false when the player has no permission and this server is restricted.- Parameters:
sender
- the player to check access for- Returns:
- whether access is granted to this server
-
sendData
Send data by any available means to this server. This data may be queued and there is no guarantee of its timely arrival. In recent Minecraft versions channel names must contain a colon separator and consist of [a-z0-9/._-]. This will be enforced in a future version. The "BungeeCord" channel is an exception and may only take this form.- Parameters:
channel
- the channel to send this data viadata
- the data to send
-
sendData
Send data by any available means to this server. In recent Minecraft versions channel names must contain a colon separator and consist of [a-z0-9/._-]. This will be enforced in a future version. The "BungeeCord" channel is an exception and may only take this form.- Parameters:
channel
- the channel to send this data viadata
- the data to sendqueue
- hold the message for later sending if it cannot be sent immediately.- Returns:
true
if the message was sent immediately,false
otherwise if queue is true, it has been queued, if it is false it has been discarded.
-
ping
Asynchronously gets the current player count on this server.- Parameters:
callback
- the callback to call when the count has been retrieved.
-