mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
/banip add <player> works banning the Player's IP
This commit is contained in:
parent
eac72bb8ae
commit
a3b7f12803
1 changed files with 6 additions and 1 deletions
|
|
@ -216,6 +216,11 @@ class BanAPI{
|
|||
case "add":
|
||||
case "ban":
|
||||
$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->save();
|
||||
$output .= "IP \"$ip\" added to ban list\n";
|
||||
|
|
@ -227,7 +232,7 @@ class BanAPI{
|
|||
$output .= "IP ban list: ".implode(", ", $this->bannedIPs->getAll(true))."\n";
|
||||
break;
|
||||
default:
|
||||
$output .= "Usage: /banip <add | remove | list | reload> [IP]\n";
|
||||
$output .= "Usage: /banip <add | remove | list | reload> [IP | Player]\n";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue