Interface QueueServer


public interface QueueServer
Represents a server or a group that can be queued for
  • Method Details

    • getStatusString

      String getStatusString(AdaptedPlayer p)
      Get the status of the server as a string
      Parameters:
      p - The player that you are checking for. Used for checking restricted servers
      Returns:
      The status of the server as a string
    • getStatusString

      String getStatusString()
      Get the status of the server as a string. Does not check if the player has access using restricted mode. May show online if it is restricted
      Returns:
      The status of the server as a string
    • getStatus

      String getStatus(AdaptedPlayer p)
      Get the status of the server as a string (not from the messages file)
      Parameters:
      p - The player that you are checking for. Used for checking restricted servers
      Returns:
      The status of the server as a string
    • getStatus

      String getStatus()
      Get the status of the server as a string (not from the messages file) Does not check if the player has access using restricted mode. May show online if it is restricted
      Returns:
      The status of the server as a string
    • getLastSentTime

      long getLastSentTime()
      Gets how long since the last person was sent
      Returns:
      The number of miliseconds since the last person was sent
    • setLastSentTime

      void setLastSentTime(long lastSentTime)
      Sets the time the last person was sent
      Parameters:
      lastSentTime - the time the last person was sent
    • getAverageSendTime

      double getAverageSendTime()
      Gets the average time it takes to send a player to this server
      Returns:
      the average time it takes to send a player to this server
    • isJoinable

      boolean isJoinable(AdaptedPlayer p)
      Checks if the server is joinable by a player
      Parameters:
      p - The player to see if they can join
      Returns:
      If the server is joinable
    • isJoinable

      boolean isJoinable(AdaptedPlayer p, boolean ignoreFull)
    • getManualMaxPlayers

      int getManualMaxPlayers()
      Gets the manually-set max player count for this server/group
      Returns:
      The manually-set max player count
    • isManuallyFull

      boolean isManuallyFull()
      Checks if the total number of players in this server/group is above the manually-set max player count
      Returns:
      If the server is at or above the manually-set player limit
    • setPaused

      void setPaused(boolean paused)
      Pauses or unpauses a server
      Parameters:
      paused - true = paused, false = unpaused
    • isPaused

      boolean isPaused()
      Checks if the server is paused
      Returns:
      True if the server is paused, false if its not
    • removePlayer

      void removePlayer(QueuePlayer player)
      Removes a player from the queue
      Parameters:
      player - The player to remove
    • removePlayer

      void removePlayer(AdaptedPlayer player)
      Removes a player from the queue
      Parameters:
      player - The player to remove
    • addPlayer

      void addPlayer(QueuePlayer player)
      Adds a player to the end of the queue NOTE: It is reccomended to use QueueManager#addToQueue
      Parameters:
      player - The QueuePlayer t add
    • addPlayer

      void addPlayer(QueuePlayer player, int position)
      Adds a player to the specified position in the queue NOTE: It is reccomended to use QueueManager#addToQueue
      Parameters:
      player - The QueuePlayer to add
      position - The position to add them
    • sendPlayer

      void sendPlayer()
      Sends the first player in the queue to the server
    • getName

      String getName()
      Gets the name of the server/group
      Returns:
      The name of the server/group
    • canAccess

      boolean canAccess(AdaptedPlayer ply)
      If the player can access the server. (Bungeecord's restricted servers) If on a platform that doesnt have restricted servers, this will always return true.
      Parameters:
      ply - The player
      Returns:
      True if the player can join based on bungeecord's restricted servers system
    • getAlias

      String getAlias()
      The alias of this server. For displaying.
      Returns:
      The alias of this server
    • getServers

      com.google.common.collect.ImmutableList<AdaptedServer> getServers()
      Get the servers that this QueueServer represents
      Returns:
      A list of servers that this QueueServer represents
    • getServerNames

      com.google.common.collect.ImmutableList<String> getServerNames()
      Gets the names of the servers in this group
      Returns:
      A list of names
    • isOnline

      default boolean isOnline()
      Returns true if at least one server in the group is online
      Returns:
      true if the server is online
    • isGroup

      boolean isGroup()
      Returns if this server is a group
      Returns:
      True if this server is a group
    • findPlayer

      QueuePlayer findPlayer(String player)
      Finds the player in this queue and returns the representative QueuePlayer
      Returns:
      The QueuePlayer representing the player, null if not found
    • findPlayer

      QueuePlayer findPlayer(AdaptedPlayer player)
      Finds the player in this queue and returns the representative QueuePlayer
      Returns:
      The QueuePlayer representing the player, null if not found
    • findPlayer

      QueuePlayer findPlayer(UUID uuid)
      Finds the player with this uuid in this queue and returns the representative QueuePlayer
      Returns:
      The QueuePlayer representing the player, null if not found
    • getIdealServer

      AdaptedServer getIdealServer(AdaptedPlayer player)
      Gets the most ideal server in this group to join
      Parameters:
      player - The player that would be joining
      Returns:
      The ideal server to join
    • getSupportedProtocols

      List<Integer> getSupportedProtocols()
      Gets the protocol versions this queue supports. A blank list means all protocols are supported.
      Returns:
      The protocol versions this queue supports
    • setSupportedProtocols

      void setSupportedProtocols(List<Integer> list)
      Sets the protocols that are supported A blank list means all protocols are supported.
      Parameters:
      list - the list of protocols that are supported
    • isSupportedProtocol

      default boolean isSupportedProtocol(int protocol)
    • getBalancer

      Balancer getBalancer()
      Gets the balancer this server is using
      Returns:
      The balancer this server is using
    • getQueueHolder

      QueueHolder getQueueHolder()
      Gets the QueueHolder for this queue
      Returns:
      the QueueHolder that holds the queue
    • getPosition

      default int getPosition(QueuePlayer player)
    • getLastQueueSend

      QueueType getLastQueueSend()
      Gets the last queue type that was sent
      Returns:
      the last queue type that was sent
    • getSendCount

      int getSendCount()
      Returns:
      the number of players that have been sent since getLastQueueSend was changed
    • incrementSendCount

      void incrementSendCount()
      Increments sendCount by 1
    • resetSendCount

      void resetSendCount()
      Resets sendCount to 0
    • elliot_is_bad

      default boolean elliot_is_bad()
      elliot is bad
      Returns:
      true because elliot is bad