Package me.noahvdaa.uqueue.api.util
Interface QueueableServer
public interface QueueableServer
A server, that can be queued for.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToQueue(QueueablePlayer player)
Queues the specified player.Returns the amount of available slots this server has or null if it hasn't been pinged yet.getCachedPriority(UUID player)
Get the player's priority level when they joined the queue.getCachedPriority(QueueablePlayer player)
Get the player's priority level when they joined the queue.getCurrentPriority(UUID player)
Get the player's current priority level.getCurrentPriority(QueueablePlayer player)
Get the player's current priority level.Returns the display name of the server.getName()
Returns the server's name.Returns a list of all players queued for this server.Returns the total amount of people queued for this serve.getQueuePosition(QueueablePlayer player)
Returns the player's position in the queue or null if they aren't queued for this server.Returns the server's current status or null if it hasn't been pinged yet.Returns when the server's status was last updated or null if it hasn't been set yet.boolean
Returns true if the server is a server that can be used to "hold" players while they're queued for a different server.mayQueue(QueueablePlayer player)
Returns true if the specified player is allowed to queue for this server.void
removeFromQueue(QueueablePlayer player)
Un-queues the specified player.void
setAvailableSlots(int newAvailableSlots)
Set the available slots for this server.void
setHoldServer(boolean newHoldServer)
Set whether or not the server is a hold server.void
setStatus(ServerStatus newStatus)
Set the status for this server.
-
Method Details
-
getName
String getName()Returns the server's name.- Returns:
- The name of this server.
-
getDisplayName
String getDisplayName()Returns the display name of the server. This display name may be the same for multiple servers.- Returns:
- The display name of this server.
-
getQueuePosition
Returns the player's position in the queue or null if they aren't queued for this server. The first position in the queue is "1".- Parameters:
player
- The player to look up.- Returns:
- The position the player is in.
-
getQueueLength
Integer getQueueLength()Returns the total amount of people queued for this serve.- Returns:
- The amount of people in queue for this server.
-
getCurrentPriority
Get the player's current priority level. NOTE: This is a fairly intensive method! You might want to consider using getCachedPriority() instead.- Parameters:
player
- The player to look up.- Returns:
- The player's current priority level.
-
getCurrentPriority
Get the player's current priority level. NOTE: This is a fairly intensive method! You might want to consider using getCachedPriority() instead.- Parameters:
player
- The player to look up.- Returns:
- The player's current priority level.
-
getCachedPriority
Get the player's priority level when they joined the queue. Returns the player's current priority if no cached value exists.- Parameters:
player
- The player to look up.- Returns:
- The player's cached priority level.
-
getCachedPriority
Get the player's priority level when they joined the queue. Returns the player's current priority if no cached value exists.- Parameters:
player
- The player to look up.- Returns:
- The player's cached priority level.
-
mayQueue
Returns true if the specified player is allowed to queue for this server.- Parameters:
player
- The player to check permissions for.- Returns:
- Whether or not the player is allowed to queue.
-
isHoldServer
boolean isHoldServer()Returns true if the server is a server that can be used to "hold" players while they're queued for a different server.- Returns:
- Whether or not the server is a hold server.
-
getStatus
ServerStatus getStatus()Returns the server's current status or null if it hasn't been pinged yet.- Returns:
- The status of this server.
-
getStatusLastUpdated
Long getStatusLastUpdated()Returns when the server's status was last updated or null if it hasn't been set yet.- Returns:
- The epoch timestamp the server's status was last updated.
-
getAvailableSlots
Integer getAvailableSlots()Returns the amount of available slots this server has or null if it hasn't been pinged yet.- Returns:
- The available slots for this server.
-
getQueuedPlayers
Returns a list of all players queued for this server.- Returns:
- A list of all players that are queued for this server.
-
setHoldServer
void setHoldServer(boolean newHoldServer)Set whether or not the server is a hold server.- Parameters:
newHoldServer
- The new value of isHoldServer().
-
setStatus
Set the status for this server.- Parameters:
newStatus
- The new status to set.
-
setAvailableSlots
void setAvailableSlots(int newAvailableSlots)Set the available slots for this server.- Parameters:
newAvailableSlots
- The new available slots to set.
-
addToQueue
Queues the specified player. If the player was already queued, nothing will happen.- Parameters:
player
- The player to add to the queue.
-
removeFromQueue
Un-queues the specified player. If the player wasn't queued, nothing will happen.- Parameters:
player
- The player to remove from the queue.
-