shufflemapcommand

This commit is contained in:
kremsy authored and Steffen Schröder committed 2014-05-01 17:34:54 +02:00
1 parent 0b6a8b3912
commit 85e5c543e1
2 files changed
+42

No files matched your search

+18
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
*