示例#1
0
 /**
  * Execute a command
  * @param CommandSender $ctx - Command context
  * @param str $cmdline - Command to execute
  * @param array $vars - Variables table for variable expansion
  */
 public function exec(CommandSender $ctx, $cmdline, $vars)
 {
     $cmdline = strtr($cmdline, $vars);
     if ($this->selector) {
         $cmds = CmdSelector::expandSelectors($this->getServer(), $ctx, $cmdline, $this->selector);
         if ($cmds == false) {
             $cmds = [$cmdline];
         }
     } else {
         $cmds = [$cmdline];
     }
     $cmdex = $this->perms;
     foreach ($cmds as $ln) {
         $cmdex($ctx, $ln);
     }
 }
示例#2
0
 protected function processCmd($cmd, CommandSender $sender)
 {
     return CmdSelector::expandSelectors($this->owner->getServer(), $sender, $cmd, $this->max);
 }