From 207d6630ee6d0cc0f12508b27e4747151d357023 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 9 May 2017 19:29:42 +0200 Subject: [PATCH] fixed mistake --- core/Admin/AuthenticationManager.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/Admin/AuthenticationManager.php b/core/Admin/AuthenticationManager.php index abb8d587..6fc07393 100644 --- a/core/Admin/AuthenticationManager.php +++ b/core/Admin/AuthenticationManager.php @@ -60,7 +60,7 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica public function __construct(ManiaControl $maniaControl) { $this->maniaControl = $maniaControl; $this->authCommands = new AuthCommands($maniaControl); - + // Callbacks $this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit'); @@ -287,6 +287,24 @@ class AuthenticationManager implements CallbackListener, EchoListener, Communica return $admins; } + /** + * Get all connected Players with less permission than the given Auth Level + * + * @api + * @param int $authLevel + * @return Player[] + */ + public function getConnectedPlayers($authLevel = self::AUTH_LEVEL_MODERATOR) { + $players = $this->maniaControl->getPlayerManager()->getPlayers(); + $playerArray = array(); + foreach ($players as $player) { + if (!self::checkRight($player, $authLevel)) { + array_push($playerArray, $player); + } + } + return $playerArray; + } + /** * Check whether the Player has enough Rights *