diff --git a/application/core/ManiaControl.php b/application/core/ManiaControl.php index 16ad3ef1..63be8bad 100644 --- a/application/core/ManiaControl.php +++ b/application/core/ManiaControl.php @@ -45,6 +45,7 @@ class ManiaControl implements CommandListener, TimerListener { */ const VERSION = '0.01'; const API_VERSION = '2013-04-16'; + const MIN_DEDIVERSION = '2014-04-02_18_00'; const OS_UNIX = 'Unix'; const OS_WIN = 'Windows'; const CONNECT_TIMEOUT = 50; @@ -292,6 +293,12 @@ class ManiaControl implements CommandListener, TimerListener { // Connect to server $this->connect(); + + // Check if the version of the server is high enough + $version = $this->client->getVersion(); + if($version->build < self::MIN_DEDIVERSION) { + trigger_error("The server has version ".$version->build.", while at least ".self::MIN_DEDIVERSION." is required!", E_USER_ERROR); + } // OnInit callback $this->callbackManager->triggerCallback(CallbackManager::CB_ONINIT);