map adding

This commit is contained in:
steeffeen
2014-07-05 13:58:35 +02:00
parent 698cb7d146
commit 9fde082a71
3 changed files with 59 additions and 14 deletions

View File

@ -447,16 +447,6 @@ class MapManager implements CallbackListener {
public function initializeMap($rpcMap) {
$map = new Map($rpcMap);
$this->saveMap($map);
/*$mapsDirectory = $this->maniaControl->server->getMapsDirectory();
if (is_readable($mapsDirectory . $map->fileName)) {
$mapFetcher = new \GBXChallMapFetcher(true);
$mapFetcher->processFile($mapsDirectory . $map->fileName);
$map->authorNick = FORMATTER::stripDirtyCodes($mapFetcher->authorNick);
$map->authorEInfo = $mapFetcher->authorEInfo;
$map->authorZone = $mapFetcher->authorZone;
$map->comment = $mapFetcher->comment;
}*/
return $map;
}
@ -723,6 +713,14 @@ class MapManager implements CallbackListener {
$this->maniaControl->callbackManager->triggerCallback(Callbacks::ENDMAP, $this->currentMap);
}
public function fetchMapByFileName($relativeFileName) {
$mapInfo = $this->maniaControl->client->getMapInfo($relativeFileName);
if (!$mapInfo) {
return false;
}
return $this->initializeMap($mapInfo);
}
/**
* Handle BeginMap callback
*