public interface BungeeCord
The returned futures should never be joined or waited for on
the Server thread.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_SERVERS
Server name to represent all servers on the proxy
|
static String |
ONLINE_SERVERS
Server name to represent only the online servers on the proxy
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect(Player player,
String serverName)
Connects a player to said subserver
|
void |
connectOther(String playerName,
String serverName)
Connects a named player to said subserver
|
void |
forward(String serverName,
String channelName,
byte[] data)
Sends a custom plugin message to a given server.
|
void |
forward(String serverName,
String channelName,
ByteArrayDataOutput data)
Sends a custom plugin message to a given server.
|
void |
forwardToPlayer(String playerName,
String channelName,
byte[] data)
Sends a custom plugin message to a given server.
|
void |
forwardToPlayer(String playerName,
String channelName,
ByteArrayDataOutput data)
Sends a custom plugin message to a given server.
|
Promise<String> |
getServer()
Gets this servers name, as defined in the BungeeCord config
|
Promise<List<String>> |
getServers()
Get a list of server name strings, as defined in the BungeeCord config
|
Promise<Map.Entry<String,Integer>> |
ip(Player player)
Get the real IP of a player
|
void |
kickPlayer(String playerName,
String reason)
Kick a player from the proxy
|
void |
message(String playerName,
String message)
Send a message (as in chat message) to the specified player
|
Promise<Integer> |
playerCount(String serverName)
Gets the amount of players on a certain server, or all servers
|
Promise<List<String>> |
playerList(String serverName)
Gets a list of players connected on a certain server, or all servers.
|
void |
registerForwardCallback(String channelName,
Predicate<ByteArrayDataInput> callback)
Registers a callback to listen for messages sent on forwarded subchannels.
|
void |
registerForwardCallbackRaw(String channelName,
Predicate<byte[]> callback)
Registers a callback to listen for messages sent on forwarded subchannels.
|
Promise<Map.Entry<String,Integer>> |
serverIp(String serverName)
Get the IP of any server connected to the proxy
|
Promise<UUID> |
uuid(Player player)
Get the UUID of a player
|
Promise<UUID> |
uuidOther(String playerName)
Get the UUID of any player connected to the proxy
|
static final String ALL_SERVERS
static final String ONLINE_SERVERS
void connect(@Nonnull Player player, @Nonnull String serverName)
player - the player to connectserverName - the name of the server to connect tovoid connectOther(@Nonnull String playerName, @Nonnull String serverName)
playerName - the username of the player to connectserverName - the name of the server to connect to@Nonnull Promise<Map.Entry<String,Integer>> ip(@Nonnull Player player)
player - the player to get the IP of@Nonnull Promise<Integer> playerCount(@Nonnull String serverName)
serverName - the name of the server to get the player count for. Use ALL_SERVERS to get the global count@Nonnull Promise<List<String>> playerList(@Nonnull String serverName)
serverName - the name of the server to get the player list for. Use ALL_SERVERS to get the global list@Nonnull Promise<List<String>> getServers()
void message(@Nonnull String playerName, @Nonnull String message)
playerName - the username of the player to send the message tomessage - the message to send@Nonnull Promise<String> getServer()
@Nonnull Promise<UUID> uuid(@Nonnull Player player)
player - the player to get the uuid of@Nonnull Promise<UUID> uuidOther(@Nonnull String playerName)
playerName - the username of the player to get the uuid of@Nonnull Promise<Map.Entry<String,Integer>> serverIp(@Nonnull String serverName)
serverName - the name of the server to get the ip ofvoid kickPlayer(@Nonnull String playerName, @Nonnull String reason)
playerName - the username of the player to kickreason - the reason to display to the player when they are kickedvoid forward(@Nonnull String serverName, @Nonnull String channelName, @Nonnull byte[] data)
You can use registerForwardCallbackRaw(String, Predicate) to register listeners on a given subchannel.
serverName - the name of the server to send to. use ALL_SERVERS to send to all servers, or ONLINE_SERVERS to only send to servers which are online.channelName - the name of the subchanneldata - the data to sendvoid forward(@Nonnull String serverName, @Nonnull String channelName, @Nonnull ByteArrayDataOutput data)
You can use registerForwardCallback(String, Predicate) to register listeners on a given subchannel.
serverName - the name of the server to send to. use ALL_SERVERS to send to all servers, or ONLINE_SERVERS to only send to servers which are online.channelName - the name of the subchanneldata - the data to sendvoid forwardToPlayer(@Nonnull String playerName, @Nonnull String channelName, @Nonnull byte[] data)
You can use registerForwardCallbackRaw(String, Predicate) to register listeners on a given subchannel.
playerName - the username of a player. BungeeCord will send the forward message to their server.channelName - the name of the subchanneldata - the data to sendvoid forwardToPlayer(@Nonnull String playerName, @Nonnull String channelName, @Nonnull ByteArrayDataOutput data)
You can use registerForwardCallback(String, Predicate) to register listeners on a given subchannel.
playerName - the username of a player. BungeeCord will send the forward message to their server.channelName - the name of the subchanneldata - the data to sendvoid registerForwardCallbackRaw(@Nonnull String channelName, @Nonnull Predicate<byte[]> callback)
Use forward(String, String, byte[]) to dispatch messages.
channelName - the name of the channel to listen oncallback - the callback. the predicate should return true when the callback should be unregistered.void registerForwardCallback(@Nonnull String channelName, @Nonnull Predicate<ByteArrayDataInput> callback)
Use forward(String, String, ByteArrayDataOutput) to dispatch messages.
channelName - the name of the channel to listen oncallback - the callback. the predicate should return true when the callback should be unregistered.Copyright © 2020. All rights reserved.