@@ 313-317 (lines=5) @@ | ||
310 | */ |
|
311 | public function kickPlayer($player, $reason = 'Admin Kick') |
|
312 | { |
|
313 | if (!is_int($player) && !is_string($player)) { |
|
314 | throw new \Exception( |
|
315 | sprintf('Expected parameter 1 to be string or integer, got %s', gettype($player)) |
|
316 | ); |
|
317 | } |
|
318 | if (!is_string($reason)) { |
|
319 | throw new \Exception( |
|
320 | sprintf('Expected parameter 2 to be string, got %s', gettype($reason)) |
|
@@ 476-480 (lines=5) @@ | ||
473 | */ |
|
474 | public function banPlayer($player, $reason = 'Banned', $time = 0) |
|
475 | { |
|
476 | if (!is_string($player) && !is_int($player)) { |
|
477 | throw new \Exception( |
|
478 | sprintf('Expected parameter 1 to be integer or string, got %s', gettype($player)) |
|
479 | ); |
|
480 | } |
|
481 | if (!is_string($reason) || !is_int($time)) { |
|
482 | throw new \Exception('Wrong parameter type(s)!'); |
|
483 | } |
|
@@ 505-507 (lines=3) @@ | ||
502 | */ |
|
503 | public function addBan($player, $reason = 'Banned', $time = 0) |
|
504 | { |
|
505 | if (!is_string($player) || !is_string($reason) || !is_int($time)) { |
|
506 | throw new \Exception('Wrong parameter type(s)!'); |
|
507 | } |
|
508 | $this->send("addBan $player $time $reason"); |
|
509 | ||
510 | if ($this->options['autosavebans']) { |