checks for empty settings
This commit is contained in:
parent
3202194068
commit
417e460588
@ -107,10 +107,6 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
trigger_error($mysqli->error);
|
trigger_error($mysqli->error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($result->num_rows <= 0) {
|
|
||||||
$result->close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$loadedSettings = array();
|
$loadedSettings = array();
|
||||||
while ($row = $result->fetch_object()) {
|
while ($row = $result->fetch_object()) {
|
||||||
@ -119,6 +115,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
settype($loadedSettings[$row->settingName], gettype($scriptSettings[$row->settingName]));
|
settype($loadedSettings[$row->settingName], gettype($scriptSettings[$row->settingName]));
|
||||||
}
|
}
|
||||||
$result->close();
|
$result->close();
|
||||||
|
if (!$loadedSettings) return true;
|
||||||
|
|
||||||
$success = $this->maniaControl->client->query('SetModeScriptSettings', $loadedSettings);
|
$success = $this->maniaControl->client->query('SetModeScriptSettings', $loadedSettings);
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
|
@ -97,10 +97,6 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
trigger_error($mysqli->error);
|
trigger_error($mysqli->error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($result->num_rows <= 0) {
|
|
||||||
$result->close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->maniaControl->client->query('GetServerOptions');
|
$this->maniaControl->client->query('GetServerOptions');
|
||||||
$serverSettings = $this->maniaControl->client->getResponse();
|
$serverSettings = $this->maniaControl->client->getResponse();
|
||||||
@ -111,6 +107,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
settype($loadedSettings[$row->settingName], gettype($serverSettings[$row->settingName]));
|
settype($loadedSettings[$row->settingName], gettype($serverSettings[$row->settingName]));
|
||||||
}
|
}
|
||||||
$result->close();
|
$result->close();
|
||||||
|
if (!$loadedSettings) return true;
|
||||||
|
|
||||||
$success = $this->maniaControl->client->query('SetServerOptions', $loadedSettings);
|
$success = $this->maniaControl->client->query('SetServerOptions', $loadedSettings);
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user