Added ajqueue.make-room permission (disabled by default)

This commit is contained in:
ajgeiss0702
2023-07-25 14:37:14 -05:00
parent d935ae3370
commit d92d8796fd
8 changed files with 179 additions and 3 deletions
@@ -40,6 +40,12 @@ public abstract class AjQueueAPI {
*/
public abstract void setTimeBetweenPlayers();
/**
* Gets the server time manager instance, which tracks when players last changed servers
* @return The server time manager instance
*/
public abstract ServerTimeManager getServerTimeManager();
/**
* Gets the ajQueue config
* @return the ajQueue config
@@ -0,0 +1,12 @@
package us.ajg0702.queue.api;
import us.ajg0702.queue.api.players.AdaptedPlayer;
public interface ServerTimeManager {
/**
* Gets the time that the player specified was last seen switching servers
* @param player The player to check
* @return The time that they last switched servers, in miliseconds since midnight, January 1, 1970, UTC
*/
long getLastServerChange(AdaptedPlayer player);
}
@@ -59,7 +59,12 @@ public interface Logic {
}
if(fulljoinPriority > 0) {
if(server.isFull() && server.canJoinFull(player)) {
if(server.isFull() && (server.canJoinFull(player) ||
(
player.hasPermission("ajqueue.make-room") &&
AjQueueAPI.getInstance().getConfig().getBoolean("enable-make-room-permission")
)
)) {
highest = Math.max(highest, fulljoinPriority);
}
}