From a3b7f128032a49f9df4544f62278c611ad481182 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Tue, 9 Apr 2013 19:52:10 +0200 Subject: [PATCH] /banip add works banning the Player's IP --- src/API/BanAPI.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/API/BanAPI.php b/src/API/BanAPI.php index f733927b..743676f2 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;