Package us.ajg0702.queue.api.server
Interface AdaptedServer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddPlayer()Temporarily adds one player to the player countbooleancanAccess(AdaptedPlayer player)If the player can access the server Uses bungeecord's restricted server feature Will always return true on other platformsdefault booleancanJoinFull(AdaptedPlayer player)static booleancanJoinFull(AdaptedPlayer player, java.lang.String serverName)java.util.Optional<AdaptedServerPing>getLastPing()default intgetMaxPlayers()Gets the maximum number of players that can join this server.java.lang.StringgetName()Gets the server's nameintgetOfflineTime()Gets the number of seconds this server has been offlinedefault intgetPlayerCount()Gets the number of players currently onlinejava.util.List<AdaptedPlayer>getPlayers()AdaptedServerInfogetServerInfo()Gets the ServerInfo for this serverdefault java.util.List<java.util.UUID>getWhitelistedPlayers()(if the server is whitelisted) returns the list of players that are whitelisteddefault booleanisFull()default booleanisJoinable(AdaptedPlayer player)default booleanisOnline()Gets if the last ping was successful (which almost always means the server is online)default booleanisWhitelisted()Checks if the spigot-side reports that the server is whitelistedbooleanjustWentOnline()default java.util.concurrent.CompletableFuture<AdaptedServerPing>ping()Pings the server and gets info backjava.util.concurrent.CompletableFuture<AdaptedServerPing>ping(boolean debug, QueueLogger logger)booleanshouldWaitAfterOnline()
-
-
-
Method Detail
-
getServerInfo
AdaptedServerInfo getServerInfo()
Gets the ServerInfo for this server- Returns:
- The AdaptedServerInfo for this server
-
getName
java.lang.String getName()
Gets the server's name- Returns:
- the server's name
-
ping
default java.util.concurrent.CompletableFuture<AdaptedServerPing> ping()
Pings the server and gets info back- Returns:
- A CompletableFuture with the ServerPing
-
ping
java.util.concurrent.CompletableFuture<AdaptedServerPing> ping(boolean debug, QueueLogger logger)
-
getLastPing
java.util.Optional<AdaptedServerPing> getLastPing()
-
canAccess
boolean canAccess(AdaptedPlayer player)
If the player can access the server Uses bungeecord's restricted server feature Will always return true on other platforms- Parameters:
player- The player to check- Returns:
- False if the server is restricted and the player does not have permission to join.
-
getPlayers
java.util.List<AdaptedPlayer> getPlayers()
-
getOfflineTime
int getOfflineTime()
Gets the number of seconds this server has been offline- Returns:
- The number of seconds this server has been offline
-
canJoinFull
default boolean canJoinFull(AdaptedPlayer player)
-
canJoinFull
static boolean canJoinFull(AdaptedPlayer player, java.lang.String serverName)
-
justWentOnline
boolean justWentOnline()
-
isJoinable
default boolean isJoinable(AdaptedPlayer player)
-
isFull
default boolean isFull()
-
isOnline
default boolean isOnline()
Gets if the last ping was successful (which almost always means the server is online)- Returns:
- If the server is determined to be online or not
-
shouldWaitAfterOnline
boolean shouldWaitAfterOnline()
-
getPlayerCount
default int getPlayerCount()
Gets the number of players currently online- Returns:
- The number of players online
-
getMaxPlayers
default int getMaxPlayers()
Gets the maximum number of players that can join this server.- Returns:
- The maximum number of players that can join this server
-
addPlayer
default void addPlayer()
Temporarily adds one player to the player count
-
isWhitelisted
default boolean isWhitelisted()
Checks if the spigot-side reports that the server is whitelisted- Returns:
- True if the server is whitelisted
-
getWhitelistedPlayers
default java.util.List<java.util.UUID> getWhitelistedPlayers()
(if the server is whitelisted) returns the list of players that are whitelisted- Returns:
- The list of players that are whitelisted
-
-