From ae80995be64df4a4eeef2b9fc2e743137c2a87e9 Mon Sep 17 00:00:00 2001 From: kremsy Date: Wed, 15 Jan 2014 16:49:50 +0100 Subject: [PATCH] bugfix --- application/core/Maps/MapManager.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 67b5c4dc..78ba12e3 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -411,6 +411,14 @@ class MapManager implements CallbackListener { $this->maniaControl->chat->sendError('Download failed!', $login); return; } + + //Check if map is already on the server + if($this->getMapByUid($mapInfo->uid) != null) { + // Download error + $this->maniaControl->chat->sendError('Map is already on the server!', $login); + return; + } + // Save map $fileName = $mapId . '_' . $mapInfo->name . '.Map.Gbx'; $fileName = FileUtil::getClearedFileName($fileName); @@ -433,6 +441,7 @@ class MapManager implements CallbackListener { $this->maniaControl->chat->sendError("Invalid map type.", $login); return; } + // Add map to map list if(!$this->maniaControl->client->query('InsertMap', $mapFileName)) { $this->maniaControl->chat->sendError("Couldn't add map to match settings!", $login);