mapdir fix
This commit is contained in:
parent
3ad6c773a3
commit
b8a3192e6d
@ -570,13 +570,13 @@ class MapManager implements CallbackListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Download the file
|
//Download the file
|
||||||
$this->maniaControl->fileReader->loadFile($mapInfo->downloadurl, function ($file, $error) use (&$login, &$mapInfo, &$mapDir, &$update) {
|
$this->maniaControl->fileReader->loadFile($mapInfo->downloadurl, function ($file, $error) use (&$login, &$mapInfo, &$update) {
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
// Download error
|
// Download error
|
||||||
$this->maniaControl->chat->sendError('Download failed!', $login);
|
$this->maniaControl->chat->sendError('Download failed!', $login);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->processMapFile($file, $mapInfo, $mapDir, $login, $update);
|
$this->processMapFile($file, $mapInfo, $login, $update);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -587,11 +587,12 @@ class MapManager implements CallbackListener {
|
|||||||
*
|
*
|
||||||
* @param $file
|
* @param $file
|
||||||
* @param MXMapInfo $mapInfo
|
* @param MXMapInfo $mapInfo
|
||||||
* @param $mapDir
|
|
||||||
* @param $login
|
* @param $login
|
||||||
* @param $update
|
* @param $update
|
||||||
*/
|
*/
|
||||||
private function processMapFile($file, MXMapInfo $mapInfo, $mapDir, $login, $update) {
|
private function processMapFile($file, MXMapInfo $mapInfo, $login, $update) {
|
||||||
|
$mapDir = $this->maniaControl->client->getMapsDirectory();
|
||||||
|
|
||||||
//Check if map is already on the server
|
//Check if map is already on the server
|
||||||
if ($this->getMapByUid($mapInfo->uid) != null) {
|
if ($this->getMapByUid($mapInfo->uid) != null) {
|
||||||
// Download error
|
// Download error
|
||||||
|
Loading…
Reference in New Issue
Block a user