small fix

This commit is contained in:
kremsy 2014-02-01 20:03:17 +01:00 committed by Steffen Schröder
parent 0db776a2e5
commit 6a1a014696
2 changed files with 48 additions and 53 deletions

View File

@ -133,7 +133,6 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle() * @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
*/ */
public function getTitle() { public function getTitle() {
@ -141,7 +140,6 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu()
*/ */
public function getMenu($width, $height, Script $script) { public function getMenu($width, $height, Script $script) {
@ -280,7 +278,6 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData() * @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
*/ */
public function saveConfigData(array $configData, Player $player) { public function saveConfigData(array $configData, Player $player) {
@ -377,7 +374,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
} }
try { try {
$success = $this->maniaControl->client->setModeScriptSettings($newSettings); $this->maniaControl->client->setModeScriptSettings($newSettings);
} catch(\Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return false; return false;

View File

@ -123,7 +123,6 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle() * @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
*/ */
public function getTitle() { public function getTitle() {
@ -131,7 +130,6 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu()
*/ */
public function getMenu($width, $height, Script $script) { public function getMenu($width, $height, Script $script) {
@ -258,11 +256,9 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
} }
/** /**
*
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData() * @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
*/ */
public function saveConfigData(array $configData, Player $player) { public function saveConfigData(array $configData, Player $player) {
$prefix = explode(".", $configData[3][0]['Name']); $prefix = explode(".", $configData[3][0]['Name']);
if ($prefix[0] != self::ACTION_PREFIX_SETTING) { if ($prefix[0] != self::ACTION_PREFIX_SETTING) {
return; return;
@ -326,6 +322,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
* @return bool * @return bool
*/ */
private function applyNewServerSettings(array $newSettings, Player $player) { private function applyNewServerSettings(array $newSettings, Player $player) {
var_dump($newSettings);
if (!$newSettings) { if (!$newSettings) {
return true; return true;
} }
@ -361,9 +358,10 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
// $chatMessage = '$ff0' . $title . ' $<' . $player->nickname . '$> set ScriptSetting' . ($settingsCount > 1 ? 's' : '') . ' '; // $chatMessage = '$ff0' . $title . ' $<' . $player->nickname . '$> set ScriptSetting' . ($settingsCount > 1 ? 's' : '') . ' ';
foreach($newSettings as $setting => $value) { foreach($newSettings as $setting => $value) {
if($value == null) { if ($value === null) {
continue; continue;
} }
$statement->bind_param('iss', $this->maniaControl->server->index, $setting, $value); $statement->bind_param('iss', $this->maniaControl->server->index, $setting, $value);
$statement->execute(); $statement->execute();
if ($statement->error) { if ($statement->error) {