Esempio n. 1
0
 public function kick(ChannelSubscriber $kicker, ChannelSubscriber $target)
 {
     if (!$kicker->isOper() and $kicker !== $this->owner) {
         $kicker->tell(TextFormat::RED . "You don't have permission to kick a subscriber on channel #%s!", $this->name);
         return;
     }
     if ($target instanceof LegionPE) {
         $kicker->tell(TextFormat::RED . "You can't kick the server out of the channel!");
         return;
     }
     $target->unsubscribeFromChannel($this);
     if ($target === $this->owner) {
         $this->broadcast("The channel owner of #{$this} has been kicked. The owner of #{$this} is now Legion PE.", self::LEVEL_IMPORTANT_INFO);
         $this->owner = $this->owner->getMain();
     }
     $kicker->tell(TextFormat::GREEN . "{$target} has been kicked from #{$this}.");
 }