code formatting
This commit is contained in:
parent
cfd27070ce
commit
a169255346
@ -151,15 +151,6 @@ class MapManager implements CallbackListener {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the map queue
|
|
||||||
*
|
|
||||||
* @return MapQueue
|
|
||||||
*/
|
|
||||||
public function getMapQueue() {
|
|
||||||
return $this->mapQueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the map commands
|
* Return the map commands
|
||||||
*
|
*
|
||||||
@ -205,15 +196,6 @@ class MapManager implements CallbackListener {
|
|||||||
return $this->mxList;
|
return $this->mxList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the mx manager
|
|
||||||
*
|
|
||||||
* @return ManiaExchangeManager
|
|
||||||
*/
|
|
||||||
public function getMXManager() {
|
|
||||||
return $this->mxManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a Map from Mania Exchange
|
* Update a Map from Mania Exchange
|
||||||
*
|
*
|
||||||
@ -321,6 +303,24 @@ class MapManager implements CallbackListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the map queue
|
||||||
|
*
|
||||||
|
* @return MapQueue
|
||||||
|
*/
|
||||||
|
public function getMapQueue() {
|
||||||
|
return $this->mapQueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the mx manager
|
||||||
|
*
|
||||||
|
* @return ManiaExchangeManager
|
||||||
|
*/
|
||||||
|
public function getMXManager() {
|
||||||
|
return $this->mxManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a Map from Mania Exchange
|
* Adds a Map from Mania Exchange
|
||||||
*
|
*
|
||||||
@ -382,8 +382,7 @@ class MapManager implements CallbackListener {
|
|||||||
$fullMapFileName = $downloadDirectory . $fileName;
|
$fullMapFileName = $downloadDirectory . $fileName;
|
||||||
|
|
||||||
// Check if it can get written locally
|
// Check if it can get written locally
|
||||||
if ($this->maniaControl->getServer()->checkAccess($mapDir)
|
if ($this->maniaControl->getServer()->checkAccess($mapDir)) {
|
||||||
) {
|
|
||||||
// Create download directory if necessary
|
// Create download directory if necessary
|
||||||
if (!is_dir($downloadDirectory) && !mkdir($downloadDirectory) || !is_writable($downloadDirectory)) {
|
if (!is_dir($downloadDirectory) && !mkdir($downloadDirectory) || !is_writable($downloadDirectory)) {
|
||||||
$this->maniaControl->getChat()->sendError("ManiaControl doesn't have to rights to save maps in '{$downloadDirectory}'.", $login);
|
$this->maniaControl->getChat()->sendError("ManiaControl doesn't have to rights to save maps in '{$downloadDirectory}'.", $login);
|
||||||
@ -470,21 +469,6 @@ class MapManager implements CallbackListener {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get's a Map by it's Mania-Exchange Id
|
|
||||||
*
|
|
||||||
* @param $mxId
|
|
||||||
* @return Map
|
|
||||||
*/
|
|
||||||
public function getMapByMxId($mxId) {
|
|
||||||
foreach ($this->maps as $map) {
|
|
||||||
if ($map->mx->id == $mxId) {
|
|
||||||
return $map;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
||||||
*/
|
*/
|
||||||
@ -590,6 +574,21 @@ class MapManager implements CallbackListener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get's a Map by it's Mania-Exchange Id
|
||||||
|
*
|
||||||
|
* @param $mxId
|
||||||
|
* @return Map
|
||||||
|
*/
|
||||||
|
public function getMapByMxId($mxId) {
|
||||||
|
foreach ($this->maps as $map) {
|
||||||
|
if ($map->mx->id == $mxId) {
|
||||||
|
return $map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffles the MapList
|
* Shuffles the MapList
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user