implemented new setting method

This commit is contained in:
Steffen Schröder
2014-05-13 16:03:26 +02:00
parent 1fa1d7ee7d
commit ef9c141786
33 changed files with 606 additions and 551 deletions

View File

@ -9,7 +9,7 @@ use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException;
/**
* ManiaControl Obstacle Plugin
@ -110,7 +110,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
* @return bool
*/
public function command_JumpTo(array $chatCallback, Player $player) {
$authLevel = $this->maniaControl->settingManager->getSetting($this, self::SETTING_JUMPTOAUTHLEVEL);
$authLevel = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_JUMPTOAUTHLEVEL);
if (!$this->maniaControl->authenticationManager->checkRight($player, $authLevel)) {
$this->maniaControl->authenticationManager->sendNotAllowed($player);
return;
@ -120,12 +120,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
$param = $player->login . ";" . $params[1] . ";";
try {
$this->maniaControl->client->triggerModeScriptEvent(self::CB_JUMPTO, $param);
} catch (Exception $e) {
if ($e->getMessage() == 'Not in script mode.') {
trigger_error("Couldn't send jump callback for '{$player->login}'. " . $e->getMessage());
return;
}
throw $e;
} catch (NotInScriptModeException $e) {
}
}