diff --git a/src/API/BanAPI.php b/src/API/BanAPI.php index f733927bd..743676f2c 100644 --- a/src/API/BanAPI.php +++ b/src/API/BanAPI.php @@ -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 [IP]\n"; + $output .= "Usage: /banip [IP | Player]\n"; break; } break;