Package us.ajg0702.queue.api.server
Interface AdaptedServer
- All Superinterfaces:
Handle
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidTemporarily 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, String serverName) default intGets the maximum number of players that can join this server.getName()Gets the server's nameintGets the number of seconds this server has been offlinedefault intGets the number of players currently onlineGets the ServerInfo for this server(if the server is whitelisted) returns the list of players that are whitelisteddefault booleanisFull()default booleanisJoinable(AdaptedPlayer player) default booleanisJoinable(AdaptedPlayer player, boolean ignoreFull) default booleanisOnline()Gets if the last ping was successful (which almost always means the server is online)default booleanChecks if the spigot-side reports that the server is whitelistedbooleandefault CompletableFuture<AdaptedServerPing>ping()Pings the server and gets info backping(boolean debug, QueueLogger logger) boolean
-
Method Details
-
getServerInfo
AdaptedServerInfo getServerInfo()Gets the ServerInfo for this server- Returns:
- The AdaptedServerInfo for this server
-
getName
String getName()Gets the server's name- Returns:
- the server's name
-
ping
Pings the server and gets info back- Returns:
- A CompletableFuture with the ServerPing
-
ping
-
getLastPing
Optional<AdaptedServerPing> getLastPing() -
canAccess
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
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
-
canJoinFull
-
justWentOnline
boolean justWentOnline() -
isJoinable
-
isJoinable
-
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
(if the server is whitelisted) returns the list of players that are whitelisted- Returns:
- The list of players that are whitelisted
-