Interface QueueableServer


public interface QueueableServer
A server, that can be queued for.
  • 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

      Integer getQueuePosition(QueueablePlayer player)
      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

      Integer getCurrentPriority(QueueablePlayer player)
      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

      Integer getCurrentPriority(UUID player)
      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

      Integer getCachedPriority(QueueablePlayer player)
      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

      Integer getCachedPriority(UUID player)
      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

      Boolean mayQueue(QueueablePlayer player)
      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

      List<UUID> 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

      void setStatus(ServerStatus newStatus)
      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

      void addToQueue(QueueablePlayer player)
      Queues the specified player. If the player was already queued, nothing will happen.
      Parameters:
      player - The player to add to the queue.
    • removeFromQueue

      void removeFromQueue(QueueablePlayer player)
      Un-queues the specified player. If the player wasn't queued, nothing will happen.
      Parameters:
      player - The player to remove from the queue.