mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 05:08:36 +00:00
/banip add <player> works banning the Player's IP
This commit is contained in:
parent
eac72bb8ae
commit
a3b7f12803
@ -216,6 +216,11 @@ class BanAPI{
|
|||||||
case "add":
|
case "add":
|
||||||
case "ban":
|
case "ban":
|
||||||
$ip = strtolower($params[0]);
|
$ip = strtolower($params[0]);
|
||||||
|
$player = $this->server->api->player->get($ip);
|
||||||
|
if($player instanceof Player){
|
||||||
|
$ip = $player->ip;
|
||||||
|
$player->close("banned");
|
||||||
|
}
|
||||||
$this->bannedIPs->set($ip);
|
$this->bannedIPs->set($ip);
|
||||||
$this->bannedIPs->save();
|
$this->bannedIPs->save();
|
||||||
$output .= "IP \"$ip\" added to ban list\n";
|
$output .= "IP \"$ip\" added to ban list\n";
|
||||||
@ -227,7 +232,7 @@ class BanAPI{
|
|||||||
$output .= "IP ban list: ".implode(", ", $this->bannedIPs->getAll(true))."\n";
|
$output .= "IP ban list: ".implode(", ", $this->bannedIPs->getAll(true))."\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$output .= "Usage: /banip <add | remove | list | reload> [IP]\n";
|
$output .= "Usage: /banip <add | remove | list | reload> [IP | Player]\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user