Added /list author command
This commit is contained in:
parent
1f988ab27e
commit
a9db406f9a
@ -329,12 +329,36 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
|
|||||||
$this->showMapListDate(true, $player);
|
$this->showMapListDate(true, $player);
|
||||||
} elseif($chatCommands[1] == 'oldest') {
|
} elseif($chatCommands[1] == 'oldest') {
|
||||||
$this->showMapListDate(false, $player);
|
$this->showMapListDate(false, $player);
|
||||||
|
} elseif($chatCommands[1] == 'author') {
|
||||||
|
if(isset($chatCommands[2])) {
|
||||||
|
$this->showMaplistAuthor($chatCommands[2], $player);
|
||||||
|
} else {
|
||||||
|
$this->maniaControl->chat->sendError('There are no maps to show!', $player->login);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->maniaControl->mapManager->mapList->showMapList($player);
|
$this->maniaControl->mapManager->mapList->showMapList($player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function showMapListAuthor($author, $player) {
|
||||||
|
$maps = $this->maniaControl->mapManager->getMaps();
|
||||||
|
$mapList = array();
|
||||||
|
/** @var Map $map */
|
||||||
|
foreach($maps as $map) {
|
||||||
|
if($map->authorLogin == $author) {
|
||||||
|
$mapList[] = $map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($mapList) == 0) {
|
||||||
|
$this->maniaControl->chat->sendError('There are no maps to show!', $player->login);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->maniaControl->mapManager->mapList->showMapList($player, $mapList);
|
||||||
|
}
|
||||||
|
|
||||||
private function showMapListKarma($best, $player) {
|
private function showMapListKarma($best, $player) {
|
||||||
/** @var \MCTeam\KarmaPlugin $karmaPlugin */
|
/** @var \MCTeam\KarmaPlugin $karmaPlugin */
|
||||||
$karmaPlugin = $this->maniaControl->pluginManager->getPlugin(MapList::DEFAULT_KARMA_PLUGIN);
|
$karmaPlugin = $this->maniaControl->pluginManager->getPlugin(MapList::DEFAULT_KARMA_PLUGIN);
|
||||||
|
Loading…
Reference in New Issue
Block a user