shufflemapcommand

This commit is contained in:
kremsy
2014-01-11 16:34:05 +01:00
committed by Steffen Schröder
parent 0b6a8b3912
commit 85e5c543e1
2 changed files with 42 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$this->maniaControl->commandManager->registerCommandListener('restartmap', $this, 'command_RestartMap', true);
$this->maniaControl->commandManager->registerCommandListener('addmap', $this, 'command_AddMap', true);
$this->maniaControl->commandManager->registerCommandListener(array('removemap', 'removethis', 'erasemap', 'erasethis'), $this, 'command_RemoveMap', true);
$this->maniaControl->commandManager->registerCommandListener('shufflemaps', $this, 'command_ShuffleMap', true);
// Register for player chat commands
$this->maniaControl->commandManager->registerCommandListener(array('maps', 'list'), $this, 'command_List');
@ -109,6 +110,23 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$this->maniaControl->mapManager->removeMap($player, $map->uid);
}
/**
* Handle addmap command
*
* @param array $chatCallback
* @param \ManiaControl\Players\Player $player
*/
public function command_ShuffleMaps(array $chatCallback, Player $player) {
if(!$this->maniaControl->authenticationManager->checkPermission($player, MapManager::SETTING_PERMISSION_SHUFFLE_MAPS)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player);
return;
}
// add Map from Mania Exchange
$this->maniaControl->mapManager->shuffleMapList();
//TODO message
}
/**
* Handle addmap command
*