new callbacks are only supported in some modes, so leave backwards compatiblity in

This commit is contained in:
kremsy 2017-03-22 19:12:38 +01:00
parent 4ab3bf7650
commit 8ab5d384da

View File

@ -36,7 +36,7 @@ class ScriptManager {
* @param bool $enable
* @return bool
*/
public function enableScriptCallbacks($enable = true) {
public function enableScriptCallbacks() {
if (!$this->isScriptMode()) {
return false;
}
@ -47,7 +47,14 @@ class ScriptManager {
return false;
}
//TODO verify that the old S_ isnt needed anymore
//TODO remove later, than only the last 2 lines are needed in future
if (!array_key_exists('S_UseScriptCallbacks', $scriptSettings)) {
return false;
}
$scriptSettings['S_UseScriptCallbacks'] = true;
$this->maniaControl->getClient()->setModeScriptSettings($scriptSettings);
$this->maniaControl->getModeScriptEventManager()->enableCallbacks();
Logger::logInfo("Script Callbacks successfully enabled!");