added permission check to SendTestMessageCommand
parent
5aa4730707
commit
7cc71b2a3d
|
@ -1,5 +1,7 @@
|
||||||
package net.krakatoa.proxy.command;
|
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.KraSocketClientProtocolMessage;
|
||||||
import earth.krakatao.protocol.KraSocketClientProtocolStatus;
|
import earth.krakatao.protocol.KraSocketClientProtocolStatus;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
@ -11,6 +13,8 @@ import net.md_5.bungee.api.plugin.Command;
|
||||||
|
|
||||||
public class SendTestMessageCommand extends Command {
|
public class SendTestMessageCommand extends Command {
|
||||||
|
|
||||||
|
// /sendTestMessage <status> <cmdID> <dest> <cmdNumber> <msg>
|
||||||
|
|
||||||
public SendTestMessageCommand(String name) {
|
public SendTestMessageCommand(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
@ -20,8 +24,10 @@ public class SendTestMessageCommand extends Command {
|
||||||
if (commandSender instanceof ProxiedPlayer) {
|
if (commandSender instanceof ProxiedPlayer) {
|
||||||
ProxiedPlayer proxiedPlayer = (ProxiedPlayer) commandSender;
|
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) {
|
if (args.length == 5) {
|
||||||
try {
|
try {
|
||||||
int cmdID;
|
int cmdID;
|
||||||
|
@ -66,4 +72,5 @@ public class SendTestMessageCommand extends Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue