This commit is contained in:
kremsy 2014-01-15 16:49:50 +01:00 committed by Steffen Schröder
parent a286655da5
commit ae80995be6

View File

@ -411,6 +411,14 @@ class MapManager implements CallbackListener {
$this->maniaControl->chat->sendError('Download failed!', $login); $this->maniaControl->chat->sendError('Download failed!', $login);
return; 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 // Save map
$fileName = $mapId . '_' . $mapInfo->name . '.Map.Gbx'; $fileName = $mapId . '_' . $mapInfo->name . '.Map.Gbx';
$fileName = FileUtil::getClearedFileName($fileName); $fileName = FileUtil::getClearedFileName($fileName);
@ -433,6 +441,7 @@ class MapManager implements CallbackListener {
$this->maniaControl->chat->sendError("Invalid map type.", $login); $this->maniaControl->chat->sendError("Invalid map type.", $login);
return; return;
} }
// Add map to map list // Add map to map list
if(!$this->maniaControl->client->query('InsertMap', $mapFileName)) { if(!$this->maniaControl->client->query('InsertMap', $mapFileName)) {
$this->maniaControl->chat->sendError("Couldn't add map to match settings!", $login); $this->maniaControl->chat->sendError("Couldn't add map to match settings!", $login);