diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java index 1a5ba9f5..f1590957 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java @@ -49,11 +49,15 @@ public class SendCommand extends SWCommand { @Register("to") public void sendCommand(Chatter sender, RegisteredServer toServer, Player... players) { String serverName = toServer.getServerInfo().getName(); + int count = 0; for (Player player : players) { - player.createConnectionRequest(toServer).fireAndForget(); - Chatter.of(player).send(true, null, null, new Message("SEND_MESSAGE", sender.user().getUserName(), serverName)); + if (sender.user().hasPerm(UserPerm.ADMINISTRATION) || check(sender.user(), player.getCurrentServer().map(ServerConnection::getServer).orElse(null))) { + player.createConnectionRequest(toServer).fireAndForget(); + Chatter.of(player).send(true, null, null, new Message("SEND_MESSAGE", sender.user().getUserName(), serverName)); + count++; + } } - sender.send(true, null, null, new Message("SEND_MESSAGE_SELF", players.length, serverName)); + sender.send(true, null, null, new Message("SEND_MESSAGE_SELF", count, serverName)); } private boolean check(SteamwarUser user, RegisteredServer registeredServer) {