changes too new structure
This commit is contained in:
		
				
					committed by
					
						
						Steffen Schröder
					
				
			
			
				
	
			
			
			
						parent
						
							af16f2ac8d
						
					
				
				
					commit
					027af49bc9
				
			@@ -91,8 +91,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
	 * @return bool
 | 
			
		||||
	 */
 | 
			
		||||
	public function loadSettingsFromDatabase() {
 | 
			
		||||
		$this->maniaControl->client->query('GetModeScriptSettings');
 | 
			
		||||
		$scriptSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$scriptSettings = (array)$this->maniaControl->client->getModeScriptSettings();
 | 
			
		||||
		if(isset($scriptSettings['faultString'])) {
 | 
			
		||||
			if($scriptSettings['faultString'] == 'Not in script mode.') {
 | 
			
		||||
				return false;
 | 
			
		||||
@@ -122,7 +121,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$success = $this->maniaControl->client->query('SetModeScriptSettings', $loadedSettings);
 | 
			
		||||
		$success = $this->maniaControl->client->setModeScriptSettings($loadedSettings);
 | 
			
		||||
		if(!$success) {
 | 
			
		||||
			trigger_error('Error occured: ' . $this->maniaControl->getClientErrorText());
 | 
			
		||||
			return false;
 | 
			
		||||
@@ -146,8 +145,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		$pagesId = 'ScriptSettingsPages';
 | 
			
		||||
		$frame   = new Frame();
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->client->query('GetModeScriptInfo');
 | 
			
		||||
		$scriptInfo = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
 | 
			
		||||
		if(isset($scriptInfo['faultCode'])) {
 | 
			
		||||
			// Not in script mode
 | 
			
		||||
			$label = new Label();
 | 
			
		||||
@@ -157,8 +155,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		}
 | 
			
		||||
		$scriptParams = $scriptInfo['ParamDescs'];
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->client->query('GetModeScriptSettings');
 | 
			
		||||
		$scriptSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$scriptSettings = (array)$this->maniaControl->client->getModeScriptSettings();
 | 
			
		||||
 | 
			
		||||
		// Config
 | 
			
		||||
		$pagerSize     = 9.;
 | 
			
		||||
@@ -285,8 +282,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->client->query('GetModeScriptSettings');
 | 
			
		||||
		$scriptSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
 | 
			
		||||
 | 
			
		||||
		$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
 | 
			
		||||
 | 
			
		||||
@@ -348,8 +344,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
	 * @param        $setting
 | 
			
		||||
	 */
 | 
			
		||||
	public function toggleBooleanSetting($setting, Player $player) {
 | 
			
		||||
		$this->maniaControl->client->query('GetModeScriptSettings');
 | 
			
		||||
		$scriptSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
 | 
			
		||||
 | 
			
		||||
		if(!isset($scriptSettings[$setting])) {
 | 
			
		||||
			var_dump('no setting ' . $setting);
 | 
			
		||||
@@ -373,7 +368,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		if(!$newSettings) {
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		$success = $this->maniaControl->client->query('SetModeScriptSettings', $newSettings);
 | 
			
		||||
		$success = $this->maniaControl->client->setModeScriptSettings($newSettings);
 | 
			
		||||
		if(!$success) {
 | 
			
		||||
			$this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login);
 | 
			
		||||
			return false;
 | 
			
		||||
 
 | 
			
		||||
@@ -99,8 +99,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->client->query('GetServerOptions');
 | 
			
		||||
		$serverSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$serverSettings = (array)$this->maniaControl->client->getServerOptions();
 | 
			
		||||
		$loadedSettings = array();
 | 
			
		||||
		while($row = $result->fetch_object()) {
 | 
			
		||||
			if(!isset($serverSettings[$row->settingName])) {
 | 
			
		||||
@@ -114,7 +113,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$success = $this->maniaControl->client->query('SetServerOptions', $loadedSettings);
 | 
			
		||||
		$success = $this->maniaControl->client->getServerOptions($loadedSettings);
 | 
			
		||||
		if(!$success) {
 | 
			
		||||
			trigger_error('Error occurred: ' . $this->maniaControl->getClientErrorText());
 | 
			
		||||
			return false;
 | 
			
		||||
@@ -138,8 +137,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		$pagesId = 'ServerSettingsPages';
 | 
			
		||||
		$frame   = new Frame();
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->client->query('GetServerOptions');
 | 
			
		||||
		$serverSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$serverSettings = $this->maniaControl->client->getServerOptions();
 | 
			
		||||
 | 
			
		||||
		// Config
 | 
			
		||||
		$pagerSize     = 9.;
 | 
			
		||||
@@ -270,8 +268,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Note on ServerOptions the whole Options have to be saved, otherwise a error will appear
 | 
			
		||||
		$this->maniaControl->client->query('GetServerOptions');
 | 
			
		||||
		$serverSettings = $this->maniaControl->client->getResponse();
 | 
			
		||||
		$serverSettings = $this->maniaControl->client->getServerOptions();
 | 
			
		||||
 | 
			
		||||
		$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
 | 
			
		||||
 | 
			
		||||
@@ -332,7 +329,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
			
		||||
		if(!$newSettings) {
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		$success = $this->maniaControl->client->query('SetServerOptions', $newSettings);
 | 
			
		||||
		$success = $this->maniaControl->client->setServerOptions($newSettings);
 | 
			
		||||
		if(!$success) {
 | 
			
		||||
			$this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login);
 | 
			
		||||
			return false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user