small bugfix
This commit is contained in:
parent
0587d811c9
commit
1d644dfa18
@ -100,22 +100,21 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$serverSettings = $this->maniaControl->client->getServerOptions()->toArray();
|
$serverSettings = $this->maniaControl->client->getServerOptions()->toArray();
|
||||||
|
|
||||||
$loadedSettings = array();
|
|
||||||
while($row = $result->fetch_object()) {
|
while($row = $result->fetch_object()) {
|
||||||
if(!isset($serverSettings[$row->settingName])) {
|
if(!isset($serverSettings[$row->settingName])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$loadedSettings[$row->settingName] = $row->settingValue;
|
$oldType = gettype($serverSettings[$row->settingName]);
|
||||||
settype($loadedSettings[$row->settingName], gettype($serverSettings[$row->settingName]));
|
$serverSettings[$row->settingName] = $row->settingValue;
|
||||||
|
settype($serverSettings[$row->settingName], $oldType);
|
||||||
}
|
}
|
||||||
$result->close();
|
$result->close();
|
||||||
if(!$loadedSettings) {
|
if(!$serverSettings) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->maniaControl->client->setServerOptions($loadedSettings);
|
$this->maniaControl->client->setServerOptions($serverSettings);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
trigger_error('Error occured: ' . $e->getMessage());
|
trigger_error('Error occured: ' . $e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user