cleanup / improvements

This commit is contained in:
kremsy 2014-01-10 12:32:11 +01:00
parent b37a1ed3b7
commit c28cb01f9e
2 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$this->maniaControl->commandManager->registerCommandListener('nextmap', $this, 'command_NextMap', true); $this->maniaControl->commandManager->registerCommandListener('nextmap', $this, 'command_NextMap', true);
$this->maniaControl->commandManager->registerCommandListener('restartmap', $this, 'command_RestartMap', true); $this->maniaControl->commandManager->registerCommandListener('restartmap', $this, 'command_RestartMap', true);
$this->maniaControl->commandManager->registerCommandListener('addmap', $this, 'command_AddMap', true); $this->maniaControl->commandManager->registerCommandListener('addmap', $this, 'command_AddMap', true);
$this->maniaControl->commandManager->registerCommandListener('removemap', $this, 'command_RemoveMap', true); $this->maniaControl->commandManager->registerCommandListener(array('removemap', 'removethis', 'erasemap', 'erasethis'), $this, 'command_RemoveMap', true);
// Register for player chat commands // Register for player chat commands
$this->maniaControl->commandManager->registerCommandListener(array('maps', 'list'), $this, 'command_List'); $this->maniaControl->commandManager->registerCommandListener(array('maps', 'list'), $this, 'command_List');
@ -105,8 +105,8 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$this->maniaControl->chat->sendError("Couldn't remove map.", $player->login); $this->maniaControl->chat->sendError("Couldn't remove map.", $player->login);
return; return;
} }
//RemoveMap
$this->maniaControl->mapManager->removeMap($player, $map); $this->maniaControl->mapManager->removeMap($player, $map->uid);
} }
/** /**
@ -120,7 +120,6 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$this->maniaControl->authenticationManager->sendNotAllowed($player); $this->maniaControl->authenticationManager->sendNotAllowed($player);
return; return;
} }
// TODO: Use MX fetcher
$params = explode(' ', $chatCallback[1][2], 2); $params = explode(' ', $chatCallback[1][2], 2);
if(count($params) < 2) { if(count($params) < 2) {
$this->maniaControl->chat->sendUsageInfo('Usage example: //addmap 1234', $player->login); $this->maniaControl->chat->sendUsageInfo('Usage example: //addmap 1234', $player->login);

View File

@ -150,8 +150,9 @@ class MapManager implements CallbackListener {
return; return;
} }
$this->maniaControl->chat->sendSuccess('$<' . $admin->nickname . '$> removed $<' . $map->name . '$>'); $message = '$<' . $admin->nickname . '$> removed $<' . $map->name . '$>!';
$this->maniaControl->log('$<' . $admin->nickname . '$> removed $<' . $map->name . '$>', true); $this->maniaControl->chat->sendSuccess($message);
$this->maniaControl->log($message, true);
unset($this->maps[$uid]); unset($this->maps[$uid]);
} }
@ -272,7 +273,7 @@ class MapManager implements CallbackListener {
* @return array * @return array
*/ */
public function getMaps() { public function getMaps() {
return $this->maps; return array_values($this->maps);
} }
/** /**