Package us.ajg0702.queue.api
Interface QueueManager
-
public interface QueueManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addToQueue(AdaptedPlayer player, java.lang.String serverName)
Adds a player to a queueboolean
addToQueue(AdaptedPlayer player, QueueServer server)
Adds a player to a queueboolean
canSendInstantly(AdaptedPlayer player, QueueServer queueServer)
Checks if a player would be sent instantly if they were to join the queue right nowvoid
clear(AdaptedPlayer player)
com.google.common.collect.ImmutableList<QueuePlayer>
findPlayerInQueues(AdaptedPlayer p)
Finds QueuePlayers that represent this playercom.google.common.collect.ImmutableList<QueuePlayer>
findPlayerInQueuesByName(java.lang.String name)
Finds QueuePlayers that have this usernameQueueServer
findServer(java.lang.String name)
Find a server by its namecom.google.common.collect.ImmutableList<QueueServer>
getPlayerQueues(AdaptedPlayer p)
Gets all of the queues the player is currently queued forjava.lang.String
getQueuedName(AdaptedPlayer player)
Get the name of the server the player is queued for.java.util.Map<QueuePlayer,java.lang.Integer>
getSendingAttempts()
com.google.common.collect.ImmutableList<java.lang.String>
getServerNames()
Gets a list of QueueServer (servers and groups) namescom.google.common.collect.ImmutableList<QueueServer>
getServers()
Gets a list of QueueServers (servers and groups)QueueServer
getSingleServer(AdaptedPlayer player)
Get a single server the player is queued for.void
reloadServers()
Checks servers that are in the proxy and adds any it doesn't know about.void
sendActionBars()
Sends queue status action bars to players in queuesvoid
sendMessage(QueuePlayer queuePlayer)
Send a chat queue status message to a specific player in a specific queuevoid
sendMessages()
Sends chat queue status messages to players in queuesvoid
sendPlayers()
Attempts to send the first player in all queues to the server they are queued forvoid
sendPlayers(QueueServer server)
Attempts to send the first player in a specific queuevoid
sendQueueEvents()
Tell the spigot sides to call the queue scoreboard eventvoid
sendTitles()
Sends queue status titles to players in queuesvoid
updateServers()
Updates info about the servers
-
-
-
Method Detail
-
addToQueue
boolean addToQueue(AdaptedPlayer player, QueueServer server)
Adds a player to a queue- Parameters:
player
- The player to be addedserver
- The server or group to add the player to- Returns:
- True if adding was successful, false if not.
-
addToQueue
boolean addToQueue(AdaptedPlayer player, java.lang.String serverName)
Adds a player to a queue- Parameters:
player
- The player to be addedserverName
- The name of the server or group to add the player too- Returns:
- True if adding was successful, false if not.
-
canSendInstantly
boolean canSendInstantly(AdaptedPlayer player, QueueServer queueServer)
Checks if a player would be sent instantly if they were to join the queue right now- Parameters:
player
- the player to checkqueueServer
- The QueueServer to check for- Returns:
- if the player would be sent instantly if they join the queue now
-
getServers
com.google.common.collect.ImmutableList<QueueServer> getServers()
Gets a list of QueueServers (servers and groups)- Returns:
- A list of QueueServers
-
getServerNames
com.google.common.collect.ImmutableList<java.lang.String> getServerNames()
Gets a list of QueueServer (servers and groups) names- Returns:
- A list of QueueServer names
-
getSingleServer
QueueServer getSingleServer(AdaptedPlayer player)
Get a single server the player is queued for. Depends on the multi-server-queue-pick option in the config- Parameters:
player
- The player- Returns:
- The server that was chosen that the player is queued for.
-
getQueuedName
java.lang.String getQueuedName(AdaptedPlayer player)
Get the name of the server the player is queued for. If multiple servers are queued for, it will use the multi-server-queue-pick option in the config- Parameters:
player
- The player- Returns:
- The name of the server, the placeholder none message if not queued
-
reloadServers
void reloadServers()
Checks servers that are in the proxy and adds any it doesn't know about. (and removes any that no longer exist) Also creates/edits server groups
-
sendActionBars
void sendActionBars()
Sends queue status action bars to players in queues
-
sendTitles
void sendTitles()
Sends queue status titles to players in queues
-
sendQueueEvents
void sendQueueEvents()
Tell the spigot sides to call the queue scoreboard event
-
sendMessages
void sendMessages()
Sends chat queue status messages to players in queues
-
sendMessage
void sendMessage(QueuePlayer queuePlayer)
Send a chat queue status message to a specific player in a specific queue- Parameters:
queuePlayer
- The player that is in the queue
-
updateServers
void updateServers()
Updates info about the servers
-
findServer
QueueServer findServer(java.lang.String name)
Find a server by its name- Parameters:
name
- The name to look for- Returns:
- The QueueServer if found, null if not
-
sendPlayers
void sendPlayers()
Attempts to send the first player in all queues to the server they are queued for
-
sendPlayers
void sendPlayers(QueueServer server)
Attempts to send the first player in a specific queue- Parameters:
server
- The queue that we should try to send.
-
findPlayerInQueues
com.google.common.collect.ImmutableList<QueuePlayer> findPlayerInQueues(AdaptedPlayer p)
Finds QueuePlayers that represent this player- Parameters:
p
- The player to look up- Returns:
- A list of QueuePlayers that represent this player
-
findPlayerInQueuesByName
com.google.common.collect.ImmutableList<QueuePlayer> findPlayerInQueuesByName(java.lang.String name)
Finds QueuePlayers that have this username- Parameters:
name
- The username to look up- Returns:
- A list of QueuePlayers that have this username
-
getPlayerQueues
com.google.common.collect.ImmutableList<QueueServer> getPlayerQueues(AdaptedPlayer p)
Gets all of the queues the player is currently queued for- Parameters:
p
- The player- Returns:
- A list of QueueServers that this player is queued for
-
clear
void clear(AdaptedPlayer player)
-
getSendingAttempts
java.util.Map<QueuePlayer,java.lang.Integer> getSendingAttempts()
-
-