From 750f605d9638a37700f70e086346736b807186ab Mon Sep 17 00:00:00 2001 From: Jocy Date: Tue, 11 Apr 2017 15:03:45 +0200 Subject: [PATCH] Begin of map search in map list --- core/Maps/MapCommands.php | 1 - core/Maps/MapManager.php | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/core/Maps/MapCommands.php b/core/Maps/MapCommands.php index 0d84c9da..d3964e1b 100644 --- a/core/Maps/MapCommands.php +++ b/core/Maps/MapCommands.php @@ -350,7 +350,6 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb if (strstr($actionId, self::ACTION_SHOW_AUTHOR)) { $login = str_replace(self::ACTION_SHOW_AUTHOR, '', $actionId); - $this->maniaControl->getMapManager()->getMapList()->playerCloseWidget($player); $this->showMapListAuthor($login, $player); } } diff --git a/core/Maps/MapManager.php b/core/Maps/MapManager.php index fd3cabba..4cd952f8 100644 --- a/core/Maps/MapManager.php +++ b/core/Maps/MapManager.php @@ -993,6 +993,25 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform }); } + + /** + * Searches the ManiaControl maps database + * + * @param $searchString + * @return array + */ + public function searchMaps($searchString){ + + $result = array(); + foreach($this->maps as $map){ + if(strpos($map->name,$searchString) || strpos($map->authorLogin,$searchString));{ + array_push($result,$map); + } + } + + return $result; + } + /** * Initialize necessary database tables *