added dedibuild to error and usage reporting

This commit is contained in:
kremsy
2017-03-26 13:58:23 +02:00
parent f2ab40a50f
commit d46eb59fb9
5 changed files with 150 additions and 142 deletions

View File

@ -183,6 +183,8 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
/** @var ModeScriptEventManager $modeScriptEventManager */
private $modeScriptEventManager = null;
private $dedicatedServerBuildVersion = "";
/**
* Construct a new ManiaControl instance
*/
@ -216,7 +218,6 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
$this->pluginManager = new PluginManager($this);
$this->updateManager = new UpdateManager($this);
$this->getErrorHandler()->init();
// Permissions
@ -565,6 +566,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
$this->requestQuitMessage = $message;
}
/**
* Run ManiaControl
*/
@ -576,9 +578,10 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
$this->connect();
// Check if the version of the server is high enough
$version = $this->getClient()->getVersion();
if ($version->build < self::MIN_DEDIVERSION) {
$this->quit("The Server has Version '{$version->build}', while at least '" . self::MIN_DEDIVERSION . "' is required!", true);
$version = $this->getClient()->getVersion();
$this->dedicatedServerBuildVersion = $version->build;
if ($this->dedicatedServerBuildVersion < self::MIN_DEDIVERSION) {
$this->quit("The Server has Version '{$this->dedicatedServerBuildVersion}', while at least '" . self::MIN_DEDIVERSION . "' is required!", true);
}
// Listen for shutdown
@ -651,6 +654,16 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
$this->getServer()->getScriptManager()->enableScriptCallbacks();
}
/**
* Get The Build Version of the Dedicated Server
*
* @return string
*/
public function getDedicatedServerBuildVersion() {
return $this->dedicatedServerBuildVersion;
}
/**
* Return the server
*