cleanup scriptsettings
This commit is contained in:
parent
dff10f74ee
commit
dc56815f02
@ -92,6 +92,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
*/
|
*/
|
||||||
public function loadSettingsFromDatabase() {
|
public function loadSettingsFromDatabase() {
|
||||||
$scriptSettings = (array)$this->maniaControl->client->getModeScriptSettings();
|
$scriptSettings = (array)$this->maniaControl->client->getModeScriptSettings();
|
||||||
|
|
||||||
if(isset($scriptSettings['faultString'])) {
|
if(isset($scriptSettings['faultString'])) {
|
||||||
if($scriptSettings['faultString'] == 'Not in script mode.') {
|
if($scriptSettings['faultString'] == 'Not in script mode.') {
|
||||||
return false;
|
return false;
|
||||||
@ -99,6 +100,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
trigger_error('Error occured: ' . $scriptSettings['faultString']);
|
trigger_error('Error occured: ' . $scriptSettings['faultString']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mysqli = $this->maniaControl->database->mysqli;
|
$mysqli = $this->maniaControl->database->mysqli;
|
||||||
$serverId = $this->maniaControl->server->index;
|
$serverId = $this->maniaControl->server->index;
|
||||||
$query = "SELECT * FROM `" . self::TABLE_SCRIPT_SETTINGS . "` WHERE serverIndex = " . $serverId . ";";
|
$query = "SELECT * FROM `" . self::TABLE_SCRIPT_SETTINGS . "` WHERE serverIndex = " . $serverId . ";";
|
||||||
@ -146,17 +148,16 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$frame = new Frame();
|
$frame = new Frame();
|
||||||
|
|
||||||
$scriptInfo = $this->maniaControl->client->getModeScriptInfo();
|
$scriptInfo = $this->maniaControl->client->getModeScriptInfo();
|
||||||
//$scriptInfo = $this->maniaControl->client->execute('GetModeScriptInfo');
|
|
||||||
|
|
||||||
//TODO:
|
//TODO check error on not script modes, maybe exception happen, or dunno what, there is no faultString property?
|
||||||
/*if(isset($scriptInfo['faultCode'])) {
|
/*if(isset($scriptInfo['faultCode'])) {
|
||||||
// Not in script mode
|
// Not in script mode
|
||||||
$label = new Label();
|
$label = new Label();
|
||||||
$frame->add($label);
|
$frame->add($label);
|
||||||
$label->setText($scriptInfo['faultString']);
|
$label->setText($scriptInfo['faultString']);
|
||||||
return $frame;
|
return $frame;
|
||||||
}
|
}
|
||||||
$scriptParams = $scriptInfo['ParamDescs'];*/
|
*/
|
||||||
|
|
||||||
$scriptParams = $scriptInfo->paramDescs;
|
$scriptParams = $scriptInfo->paramDescs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user