49 if(count($args) === 0){
53 $value = array_shift($args);
54 $reason = implode(
" ", $args);
56 if(inet_pton($value) !==
false){
57 $this->processIPBan($value, $sender, $reason);
59 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_banip_success($value));
61 if(($player = $sender->getServer()->getPlayerByPrefix($value)) instanceof
Player){
62 $ip = $player->getNetworkSession()->getIp();
63 $this->processIPBan($ip, $sender, $reason);
65 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_banip_success_players($ip, $player->getName()));
67 $sender->sendMessage(KnownTranslationFactory::commands_banip_invalid());
77 $sender->getServer()->getIPBans()->addBan($ip, $reason, null, $sender->getName());
81 $player->kick(KnownTranslationFactory::pocketmine_disconnect_ban($reason !==
"" ? $reason : KnownTranslationFactory::pocketmine_disconnect_ban_ip()));