From 1a9c182f15bca8f645b28609e1ada1c6197471fc Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 14 Jan 2014 15:45:36 +0100 Subject: [PATCH] resolved two todos --- application/core/Maps/MapCommands.php | 5 ++--- application/core/Maps/MapManager.php | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/application/core/Maps/MapCommands.php b/application/core/Maps/MapCommands.php index d93295fc..89656182 100644 --- a/application/core/Maps/MapCommands.php +++ b/application/core/Maps/MapCommands.php @@ -106,7 +106,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb $this->maniaControl->chat->sendError("Couldn't remove map.", $player->login); return; } - //TODO message + //RemoveMap $this->maniaControl->mapManager->removeMap($player, $map->uid); } @@ -124,8 +124,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb } // Shuffles the maps - $this->maniaControl->mapManager->shuffleMapList(); - //TODO message + $this->maniaControl->mapManager->shuffleMapList($player); } /** diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index dc69028c..67b5c4dc 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -188,7 +188,7 @@ class MapManager implements CallbackListener { * * @return bool */ - public function shuffleMapList() { + public function shuffleMapList($admin = null) { shuffle($this->maps); $mapArray = array(); @@ -205,6 +205,12 @@ class MapManager implements CallbackListener { $this->fetchCurrentMap(); + if($admin != null) { + $message = '$<' . $admin->nickname . '$> shuffled the Maplist!'; + $this->maniaControl->chat->sendSuccess($message); + $this->maniaControl->log($message, true); + } + return true; }