structural changes for v0.2
This commit is contained in:
41
core/Server/ModeScriptEventManager.php
Normal file
41
core/Server/ModeScriptEventManager.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Manager for Mode Script Events
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
namespace ManiaControl\Server;
|
||||
|
||||
//TODO maybe own folder
|
||||
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
class ModeScriptEventManager {
|
||||
/** @var ManiaControl $maniaControl */
|
||||
private $maniaControl;
|
||||
|
||||
/**
|
||||
* Construct a new ranking manager instance
|
||||
*
|
||||
* @param ManiaControl $maniaControl
|
||||
*/
|
||||
public function __construct(ManiaControl $maniaControl) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables XmlRpc Callbacks
|
||||
*/
|
||||
public function enableCallbacks() {
|
||||
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('true'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables XmlRpc Callbacks
|
||||
*/
|
||||
public function disableCallbacks() {
|
||||
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('false'));
|
||||
}
|
||||
}
|
@ -47,7 +47,9 @@ class ScriptManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('true'));
|
||||
//TODO verify that the old S_ isnt needed anymore
|
||||
|
||||
$this->maniaControl->getModeScriptEventManager()->enableCallbacks();
|
||||
Logger::logInfo("Script Callbacks successfully enabled!");
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user