improved config loading and validation

This commit is contained in:
Steffen Schröder
2014-05-27 08:57:26 +02:00
parent 2818192102
commit f54ee6df64
3 changed files with 50 additions and 40 deletions

View File

@ -159,8 +159,8 @@ class ManiaControl implements CommandListener, TimerListener {
if (!$this->config) {
$this->quit("Error loading Configuration XML-File! ('{$configFileName}')", true);
}
if (!$this->config->server->port || $this->config->server->port == 'port') {
$this->quit("Your Configuration File ('{$configFileName}') doesn't seem to be maintained. Please check it again!", true);
if ($this->config->count() < 3) {
$this->quit("Your Configuration File ('{$configFileName}') doesn't seem to be maintained properly. Please check it again!", true);
}
}