added permission check to SendTestMessageCommand
parent
5aa4730707
commit
7cc71b2a3d
|
@ -1,5 +1,7 @@
|
|||
package net.krakatoa.proxy.command;
|
||||
|
||||
import de.dytanic.cloudnet.driver.CloudNetDriver;
|
||||
import de.dytanic.cloudnet.driver.permission.IPermissionUser;
|
||||
import earth.krakatao.protocol.KraSocketClientProtocolMessage;
|
||||
import earth.krakatao.protocol.KraSocketClientProtocolStatus;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -11,6 +13,8 @@ import net.md_5.bungee.api.plugin.Command;
|
|||
|
||||
public class SendTestMessageCommand extends Command {
|
||||
|
||||
// /sendTestMessage <status> <cmdID> <dest> <cmdNumber> <msg>
|
||||
|
||||
public SendTestMessageCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
@ -20,8 +24,10 @@ public class SendTestMessageCommand extends Command {
|
|||
if (commandSender instanceof ProxiedPlayer) {
|
||||
ProxiedPlayer proxiedPlayer = (ProxiedPlayer) commandSender;
|
||||
|
||||
// /sendTestMessage <status> <cmdID> <dest> <cmdNumber> <msg>
|
||||
IPermissionUser permissionUser = CloudNetDriver.getInstance().getPermissionManagement()
|
||||
.getUser(proxiedPlayer.getUniqueId());
|
||||
|
||||
if (permissionUser != null && permissionUser.hasPermission("*").asBoolean()) {
|
||||
if (args.length == 5) {
|
||||
try {
|
||||
int cmdID;
|
||||
|
@ -67,3 +73,4 @@ public class SendTestMessageCommand extends Command {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue