Package us.ajg0702.queue.api
Interface QueueManager
public interface QueueManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddToQueue(AdaptedPlayer player, String serverName) Adds a player to a queuebooleanaddToQueue(AdaptedPlayer player, QueueServer server) Adds a player to a queuebooleancanSendInstantly(AdaptedPlayer player, QueueServer queueServer) Checks if a player would be sent instantly if they were to join the queue right nowbooleancanSendInstantly(AdaptedPlayer player, QueueServer queueServer, boolean hasBypass) voidclear(AdaptedPlayer player) com.google.common.collect.ImmutableList<QueuePlayer>Finds QueuePlayers that represent this playercom.google.common.collect.ImmutableList<QueuePlayer>Finds QueuePlayers that have this usernamefindServer(String name) Find a server by its namecom.google.common.collect.ImmutableList<QueueServer>Gets all of the queues the player is currently queued forgetQueuedName(AdaptedPlayer player) Get the name of the server the player is queued for.com.google.common.collect.ImmutableList<String>Gets a list of QueueServer (servers and groups) namescom.google.common.collect.ImmutableList<QueueServer>Gets a list of QueueServers (servers and groups)getSingleQueuePlayer(AdaptedPlayer player) getSingleServer(AdaptedPlayer player) Get a single server the player is queued for.voidChecks servers that are in the proxy and adds any it doesn't know about.voidSends queue status action bars to players in queuesvoidsendMessage(QueuePlayer queuePlayer) Send a chat queue status message to a specific player in a specific queuevoidSends chat queue status messages to players in queuesvoidAttempts to send the first player in all queues to the server they are queued forvoidsendPlayers(QueueServer server) Attempts to send the first player in a specific queuevoidTell the spigot sides to call the queue scoreboard eventvoidSends queue status titles to players in queuesvoidUpdates info about the servers
-
Method Details
-
addToQueue
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
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
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
-
canSendInstantly
-
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<String> getServerNames()Gets a list of QueueServer (servers and groups) names- Returns:
- A list of QueueServer names
-
getSingleServer
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.
-
getSingleQueuePlayer
-
getQueuedName
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
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
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
Attempts to send the first player in a specific queue- Parameters:
server- The queue that we should try to send.
-
findPlayerInQueues
Finds QueuePlayers that represent this player- Parameters:
p- The player to look up- Returns:
- A list of QueuePlayers that represent this player
-
findPlayerInQueuesByName
Finds QueuePlayers that have this username- Parameters:
name- The username to look up- Returns:
- A list of QueuePlayers that have this username
-
getPlayerQueues
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
-
getSendingAttempts
Map<QueuePlayer,Integer> getSendingAttempts()
-