diff --git a/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java b/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java index b477971..8497be3 100644 --- a/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java +++ b/common/src/main/java/us/ajg0702/queue/common/EventHandlerImpl.java @@ -108,7 +108,13 @@ public class EventHandlerImpl implements EventHandler { String[] parts = s.split(":"); String from = parts[0]; QueueServer to = main.getQueueManager().findServer(parts[1]); - if(from.equalsIgnoreCase(serverName) && to != null) { + if( + from.equalsIgnoreCase(serverName) && to != null && + ( + !main.getConfig().getBoolean("require-queueserver-permission") || + player.hasPermission("ajqueue.queueserver." + to.getName()) + ) + ) { main.getQueueManager().addToQueue(player, to); } } diff --git a/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java b/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java index f144e6c..4426d6c 100644 --- a/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java +++ b/common/src/main/java/us/ajg0702/queue/common/QueueManagerImpl.java @@ -467,7 +467,13 @@ public class QueueManagerImpl implements QueueManager { } return; } - if(!getPlayerQueues(player).contains(to)) { + if( + !getPlayerQueues(player).contains(to) && + ( + !main.getConfig().getBoolean("require-queueserver-permission") || + player.hasPermission("ajqueue.queueserver." + to.getName()) + ) + ) { addToQueue(player, to); } }); diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index a4e6633..1025256 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -255,18 +255,25 @@ tab-complete-queues: true # Should we have no wait time for these servers? # If the server is joinable, the plugin will attempt to send players who join these queues as soon as they join. -# If the server is not immidiatly joinable, they will have to wait for the normal wait-time +# If the server is not immediately joinable, they will have to wait for the normal wait-time # This also works with group # NOTE: Server names are caps sensitive send-instantly: - "lobbys" -# After how many (unsuccessfull) attempts of sending the player should we remove them from the queue? +# Should we require permissions for queue-servers to work? +# If enabled, players will need to have the ajqueue.queueserver. permission +# being the target server +# Note that this will only affect queue-servers +# Default: false +require-queueserver-permission: false + +# After how many (unsuccessful) attempts of sending the player should we remove them from the queue? # Set to -1 to disable # Default: 10 max-tries: 10 -# Should we check to make sure that people dont get sent quicker than wait-time? +# Should we check to make sure that people don't get sent quicker than wait-time? # Default: true check-last-player-sent-time: true