From e6f630788d42cd2c7859001f76be091e08c887fb Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 14 Feb 2014 14:16:24 +0100 Subject: [PATCH] fixed todo --- application/core/Maps/MapManager.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 4f168025..56538238 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -222,7 +222,7 @@ class MapManager implements CallbackListener { if ($eraseFile) { // Check if ManiaControl can even write to the maps dir $mapDir = $this->maniaControl->client->getMapsDirectory(); - + // Delete map file if (!@unlink($mapDir . $map->fileName)) { trigger_error("Couldn't remove Map '{$mapDir}{$map->fileName}'."); @@ -346,7 +346,7 @@ class MapManager implements CallbackListener { * Updates the full Map list, needed on Init, addMap and on ShuffleMaps */ private function updateFullMapList() { - $maps = $this->maniaControl->client->getMapList(100, 0); + $maps = $this->maniaControl->client->getMapList(100, 0); $tempList = array(); foreach($maps as $rpcMap) { @@ -525,6 +525,8 @@ class MapManager implements CallbackListener { * @param $mapDir * @param $login * @param $update + * @throws \Exception + * @throws \Maniaplanet\DedicatedServer\Xmlrpc\Exception */ private function processMapFile($file, MXMapInfo $mapInfo, $mapDir, $login, $update) { //Check if map is already on the server @@ -563,9 +565,11 @@ class MapManager implements CallbackListener { try { $this->maniaControl->client->writeFileFromString($mapFileName, $file); } catch(Exception $e) { - // TODO: add check for error message - throw other stuff like connection errors - $this->maniaControl->chat->sendError("Map is too big for a remote save.", $login); - return; + if ($e->getMessage() == 'transport error - request too large!') { + $this->maniaControl->chat->sendError("Map is too big for a remote save.", $login); + return; + } + throw $e; } }