structural changes for v0.2
This commit is contained in:
parent
df2d548755
commit
60524e9244
@ -26,6 +26,7 @@ use ManiaControl\Maps\MapManager;
|
|||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
use ManiaControl\Players\PlayerManager;
|
use ManiaControl\Players\PlayerManager;
|
||||||
use ManiaControl\Plugins\PluginManager;
|
use ManiaControl\Plugins\PluginManager;
|
||||||
|
use ManiaControl\Server\ModeScriptEventManager;
|
||||||
use ManiaControl\Server\Server;
|
use ManiaControl\Server\Server;
|
||||||
use ManiaControl\Settings\SettingManager;
|
use ManiaControl\Settings\SettingManager;
|
||||||
use ManiaControl\Statistics\StatisticManager;
|
use ManiaControl\Statistics\StatisticManager;
|
||||||
@ -47,11 +48,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
/*
|
/*
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
const VERSION = '0.166';
|
const VERSION = '0.200';
|
||||||
const API_VERSION = '2013-04-16';
|
const API_VERSION = '2013-04-16';
|
||||||
const MIN_DEDIVERSION = '2014-04-02_18_00';
|
const MIN_DEDIVERSION = '2014-04-02_18_00';
|
||||||
const SCRIPT_TIMEOUT = 10;
|
const SCRIPT_TIMEOUT = 10;
|
||||||
const URL_WEBSERVICE = 'https://ws.maniacontrol.com/';
|
const URL_WEBSERVICE = 'http://ws.maniacontrol.com/';
|
||||||
const SETTING_PERMISSION_SHUTDOWN = 'Shutdown ManiaControl';
|
const SETTING_PERMISSION_SHUTDOWN = 'Shutdown ManiaControl';
|
||||||
const SETTING_PERMISSION_RESTART = 'Restart ManiaControl';
|
const SETTING_PERMISSION_RESTART = 'Restart ManiaControl';
|
||||||
|
|
||||||
@ -171,8 +172,13 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
|
|
||||||
/** @var EchoManager $echoManager */
|
/** @var EchoManager $echoManager */
|
||||||
private $echoManager = null;
|
private $echoManager = null;
|
||||||
|
|
||||||
|
/** @var CommunicationManager $communicationManager */
|
||||||
private $communicationManager = null;
|
private $communicationManager = null;
|
||||||
|
|
||||||
|
/** @var ModeScriptEventManager $modeScriptEventManager */
|
||||||
|
private $modeScriptEventManager = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new ManiaControl instance
|
* Construct a new ManiaControl instance
|
||||||
*/
|
*/
|
||||||
@ -185,6 +191,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
|
|
||||||
// Load ManiaControl Modules
|
// Load ManiaControl Modules
|
||||||
$this->callbackManager = new CallbackManager($this);
|
$this->callbackManager = new CallbackManager($this);
|
||||||
|
$this->modeScriptEventManager = new ModeScriptEventManager($this);
|
||||||
$this->echoManager = new EchoManager($this);
|
$this->echoManager = new EchoManager($this);
|
||||||
$this->communicationManager = new CommunicationManager($this);
|
$this->communicationManager = new CommunicationManager($this);
|
||||||
$this->timerManager = new TimerManager($this);
|
$this->timerManager = new TimerManager($this);
|
||||||
@ -467,6 +474,13 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
return $this->billManager;
|
return $this->billManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ModeScriptEventManager
|
||||||
|
*/
|
||||||
|
public function getModeScriptEventManager() {
|
||||||
|
return $this->modeScriptEventManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check connection
|
* Check connection
|
||||||
*/
|
*/
|
||||||
@ -699,4 +713,6 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
public function handleServerStopCallback() {
|
public function handleServerStopCallback() {
|
||||||
$this->requestQuit('The Server has been shut down!');
|
$this->requestQuit('The Server has been shut down!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
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;
|
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!");
|
Logger::logInfo("Script Callbacks successfully enabled!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user