Class AbstractRedisBungeeAPI
- Since:
- 0.8.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractRedisBungeeAPI
Get all the linked proxies in this network.Deprecated, for removal: This API element is subject to removal in a future version.final Collection<String>
Get a combined list of players on this network, as a collection of usernames.This gets Redis BungeeJedisPool
final long
getLastOnline
(@NonNull UUID player) Get the last time a player was on.getMode()
shows what mode is RedisBungee is on Basically what every redis mode is used like cluster or single instance.final String
getNameFromUuid
(@NonNull UUID uuid) Fetch a name from the specified UUID.final String
getNameFromUuid
(@NonNull UUID uuid, boolean expensiveLookups) Fetch a name from the specified UUID.final int
Get a combined count of all players on this network.final InetAddress
getPlayerIp
(@NonNull UUID player) Get theInetAddress
associated with this player.Get a combined list of players on this network.getPlayersOnProxy
(@NonNull String proxyID) Get a list of players on the specified proxy.getPlayersOnServer
(@NonNull String server) Get a list of players on the server with the given name.final String
Get the RedisBungee proxy ID this player is connected to.final String
Get the current BungeeCord / Velocity proxy ID for this server.final String
Deprecated, for removal: This API element is subject to removal in a future version.to avoid confusion between A server and A proxy see #getProxyId()final @Nullable String
getServerNameFor
(@NonNull UUID player) Get the server where the specified player is playing.Get a full list of players on all servers.Summoner<?>
returns Summoner class responsible for Single JedisJedisPooled
withJedisPool
, Cluster JedisJedisCluster
handlingfinal UUID
getUuidFromName
(@NonNull String name) Fetch a UUID from the specified name.final UUID
getUuidFromName
(@NonNull String name, boolean expensiveLookups) Fetch a UUID from the specified name.final boolean
isPlayerOnline
(@NonNull UUID player) Convenience method: Checks if the specified player is online.void
kickPlayer
(String playerName, String message) Deprecated, for removal: This API element is subject to removal in a future version.void
kickPlayer
(String playerName, Component message) Kicks a player from the network callsgetUuidFromName(String)
to get uuidvoid
kickPlayer
(UUID playerUUID, String message) Deprecated, for removal: This API element is subject to removal in a future version.void
kickPlayer
(UUID playerUUID, Component message) Kicks a player from the networkfinal void
registerPubSubChannels
(String... channels) Deprecated, for removal: This API element is subject to removal in a future version.No longer requiredDeprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
Deprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
Deprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
final void
sendChannelMessage
(@NonNull String channel, @NonNull String message) Sends a message to a PubSub channel which makes PubSubMessageEvent fire.final void
sendProxyCommand
(@NonNull String command) Sends a proxy command to all proxies.final void
sendProxyCommand
(@NonNull String proxyId, @NonNull String command) Sends a proxy command to the proxy with the given ID.final void
unregisterPubSubChannels
(String... channels) Deprecated, for removal: This API element is subject to removal in a future version.No longer required
-
Field Details
-
plugin
-
-
Constructor Details
-
AbstractRedisBungeeAPI
-
-
Method Details
-
getPlayerCount
public final int getPlayerCount()Get a combined count of all players on this network.- Returns:
- a count of all players found
-
getLastOnline
Get the last time a player was on. If the player is currently online, this will return 0. If the player has not been recorded, this will return -1. Otherwise it will return a value in milliseconds.- Parameters:
player
- a player name- Returns:
- the last time a player was on, if online returns a 0
-
getServerNameFor
Get the server where the specified player is playing. This function also deals with the case of local players as well, and will return local information on them.- Parameters:
player
- a player uuid- Returns:
- a String name for the server the player is on. Can be Null if plugins is doing weird stuff to the proxy internals
-
getPlayersOnline
Get a combined list of players on this network.Note that this function returns an instance of
ImmutableSet
.- Returns:
- a Set with all players found
-
getHumanPlayersOnline
Get a combined list of players on this network, as a collection of usernames.- Returns:
- a Set with all players found
- Since:
- 0.3
- See Also:
-
getServerToPlayers
Get a full list of players on all servers.- Returns:
- a immutable Multimap with all players found on this network
- Since:
- 0.2.5
-
getPlayersOnServer
Get a list of players on the server with the given name.- Parameters:
server
- a server name- Returns:
- a Set with all players found on this server
-
getPlayersOnProxy
Get a list of players on the specified proxy.- Parameters:
proxyID
- proxy id- Returns:
- a Set with all UUIDs found on this proxy
-
isPlayerOnline
Convenience method: Checks if the specified player is online.- Parameters:
player
- a player name- Returns:
- if the player is online
-
getPlayerIp
Get theInetAddress
associated with this player.- Parameters:
player
- the player to fetch the IP for- Returns:
- an
InetAddress
if the player is online, null otherwise - Since:
- 0.2.4
-
getProxy
Get the RedisBungee proxy ID this player is connected to.- Parameters:
player
- the player to fetch the IP for- Returns:
- the proxy the player is connected to, or null if they are offline
- Since:
- 0.3.3
-
sendProxyCommand
Sends a proxy command to all proxies.- Parameters:
command
- the command to send and execute- Since:
- 0.2.5
- See Also:
-
sendProxyCommand
Sends a proxy command to the proxy with the given ID. "allservers" means all proxies.- Parameters:
proxyId
- a proxy IDcommand
- the command to send and execute- Since:
- 0.2.5
- See Also:
-
sendChannelMessage
Sends a message to a PubSub channel which makes PubSubMessageEvent fire.Note: Since 0.12.0 registering a channel api is no longer required
- Parameters:
channel
- The PubSub channelmessage
- the message body to send- Since:
- 0.3.3
-
getProxyId
Get the current BungeeCord / Velocity proxy ID for this server.- Returns:
- the current server ID
- Since:
- 0.8.0
- See Also:
-
getServerId
Deprecated, for removal: This API element is subject to removal in a future version.to avoid confusion between A server and A proxy see #getProxyId()Get the current BungeeCord / Velocity proxy ID for this server.- Returns:
- the current server ID
- Since:
- 0.2.5
- See Also:
-
getAllProxies
Get all the linked proxies in this network.- Returns:
- the list of all proxies
- Since:
- 0.8.0
- See Also:
-
getAllServers
Deprecated, for removal: This API element is subject to removal in a future version.to avoid confusion between A server and A proxy see seegetAllProxies()
Get all the linked proxies in this network.- Returns:
- the list of all proxies
- Since:
- 0.2.5
- See Also:
-
registerPubSubChannels
Deprecated, for removal: This API element is subject to removal in a future version.No longer requiredRegister (a) PubSub channel(s), so that you may handle PubSubMessageEvent for it.- Parameters:
channels
- the channels to register- Since:
- 0.3
-
unregisterPubSubChannels
Deprecated, for removal: This API element is subject to removal in a future version.No longer requiredUnregister (a) PubSub channel(s).- Parameters:
channels
- the channels to unregister- Since:
- 0.3
-
getNameFromUuid
Fetch a name from the specified UUID. UUIDs are cached locally and in Redis. This function falls back to Mojang as a last resort, so calls may be blocking.For the common use case of translating a list of UUIDs into names, use
getHumanPlayersOnline()
instead.If performance is a concern, use
getNameFromUuid(java.util.UUID, boolean)
as this allows you to disable Mojang lookups.- Parameters:
uuid
- the UUID to fetch the name for- Returns:
- the name for the UUID
- Since:
- 0.3
-
getNameFromUuid
Fetch a name from the specified UUID. UUIDs are cached locally and in Redis. This function can fall back to Mojang as a last resort ifexpensiveLookups
is true, so calls may be blocking.For the common use case of translating the list of online players into names, use
getHumanPlayersOnline()
.If performance is a concern, set
expensiveLookups
to false as this will disable lookups via Mojang.- Parameters:
uuid
- the UUID to fetch the name forexpensiveLookups
- whether or not to perform potentially expensive lookups- Returns:
- the name for the UUID
- Since:
- 0.3.2
-
getUuidFromName
Fetch a UUID from the specified name. Names are cached locally and in Redis. This function falls back to Mojang as a last resort, so calls may be blocking.If performance is a concern, see
getUuidFromName(String, boolean)
, which disables the following functions:- Searching local entries case-insensitively
- Searching Mojang
- Parameters:
name
- the UUID to fetch the name for- Returns:
- the UUID for the name
- Since:
- 0.3
-
getUuidFromName
Fetch a UUID from the specified name. Names are cached locally and in Redis. This function falls back to Mojang as a last resort ifexpensiveLookups
is true, so calls may be blocking.If performance is a concern, set
expensiveLookups
to false to disable searching Mojang and searching for usernames case-insensitively.- Parameters:
name
- the UUID to fetch the name forexpensiveLookups
- whether or not to perform potentially expensive lookups- Returns:
- the
UUID
for the name - Since:
- 0.3.2
-
kickPlayer
Deprecated, for removal: This API element is subject to removal in a future version.Kicks a player from the network callsgetUuidFromName(String)
to get uuid- Parameters:
playerName
- player namemessage
- kick message that player will see on kick- Since:
- 0.8.0
-
kickPlayer
Deprecated, for removal: This API element is subject to removal in a future version.Kicks a player from the network- Parameters:
playerUUID
- player namemessage
- kick message that player will see on kick- Since:
- 0.8.0
-
kickPlayer
Kicks a player from the network callsgetUuidFromName(String)
to get uuid- Parameters:
playerName
- player namemessage
- kick message that player will see on kick- Since:
- 0.12.0
-
kickPlayer
Kicks a player from the network- Parameters:
playerUUID
- player namemessage
- kick message that player will see on kick- Since:
- 0.12.0
-
requestJedis
Deprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
This gives you instance of Jedis- Returns:
Jedis
- Throws:
IllegalStateException
- if thegetMode()
is not equal toRedisBungeeMode.SINGLE
- Since:
- 0.7.0
- See Also:
-
getJedisPool
This gets Redis BungeeJedisPool
- Returns:
JedisPool
- Throws:
IllegalStateException
- if thegetMode()
is not equal toRedisBungeeMode.SINGLE
IllegalStateException
- if JedisPool compatibility mode is disabled in the config- Since:
- 0.6.5
-
requestClusterJedis
Deprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
This gives you an instance of JedisCluster that can't be closed seeNotClosableJedisCluster
- Returns:
JedisCluster
- Throws:
IllegalStateException
- if thegetMode()
is not equal toRedisBungeeMode.CLUSTER
- Since:
- 0.8.0
-
requestJedisPooled
Deprecated, for removal: This API element is subject to removal in a future version.usegetSummoner()
This gives you an instance of JedisPooled that can't be closed seeNotClosableJedisPooled
- Returns:
JedisPooled
- Throws:
IllegalStateException
- if thegetMode()
is not equal toRedisBungeeMode.SINGLE
- Since:
- 0.8.0
-
getSummoner
returns Summoner class responsible for Single JedisJedisPooled
withJedisPool
, Cluster JedisJedisCluster
handling- Returns:
Summoner
- Since:
- 0.8.0
-
getMode
shows what mode is RedisBungee is on Basically what every redis mode is used like cluster or single instance.- Returns:
RedisBungeeMode
- Since:
- 0.8.0
-
getAbstractRedisBungeeAPI
-
getAllProxies()