Wont check joinfrom permission unless the player actually executed the command (/ajq send bypasses joinfrom now)

This commit is contained in:
ajgeiss0702
2022-08-19 17:23:56 -07:00
parent 4f7a137ea8
commit fb1e8cd475
2 changed files with 4 additions and 5 deletions
@@ -63,6 +63,10 @@ public class QueueCommand extends BaseCommand {
sender.sendMessage(getMessages().getComponent("noperm")); sender.sendMessage(getMessages().getComponent("noperm"));
return; return;
} }
if(main.getConfig().getBoolean("joinfrom-server-permission") && !player.hasPermission("ajqueue.joinfrom."+player.getServerName())) {
player.sendMessage(getMessages().getComponent("errors.deny-joining-from-server"));
return;
}
main.getQueueManager().addToQueue(player, args[0]); main.getQueueManager().addToQueue(player, args[0]);
} else { } else {
sender.sendMessage(getMessages().getComponent("commands.joinqueue.usage")); sender.sendMessage(getMessages().getComponent("commands.joinqueue.usage"));
@@ -103,11 +103,6 @@ public class QueueManagerImpl implements QueueManager {
Debug.info("addToQueue method called for "+player.getName()+" to "+server.getName()); Debug.info("addToQueue method called for "+player.getName()+" to "+server.getName());
if(main.getConfig().getBoolean("joinfrom-server-permission") && !player.hasPermission("ajqueue.joinfrom."+player.getServerName())) {
player.sendMessage(msgs.getComponent("errors.deny-joining-from-server"));
return false;
}
int playerVersion = player.getProtocolVersion(); int playerVersion = player.getProtocolVersion();
List<Integer> supportedProtocols = server.getSupportedProtocols(); List<Integer> supportedProtocols = server.getSupportedProtocols();
if(!supportedProtocols.contains(playerVersion) && supportedProtocols.size() > 0) { if(!supportedProtocols.contains(playerVersion) && supportedProtocols.size() > 0) {