2014-04-24 17:41:05 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created by PhpStorm.
|
|
|
|
* User: Lukas
|
|
|
|
* Date: 24.04.14
|
|
|
|
* Time: 16:57
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks;
|
|
|
|
|
|
|
|
|
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
|
|
|
|
class LibXmlRpcCallbackManager implements CallbackListener{
|
|
|
|
/*
|
|
|
|
* Private Properties
|
|
|
|
*/
|
|
|
|
private $maniaControl = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new ShootMania Callbacks Instance
|
|
|
|
*
|
|
|
|
* @param ManiaControl $maniaControl
|
|
|
|
*/
|
|
|
|
public function __construct(ManiaControl $maniaControl, CallbackManager $callbackManager) {
|
|
|
|
$this->maniaControl = $maniaControl;
|
|
|
|
$callbackManager->registerCallbackListener(Callbacks::ScriptCallback, $this, 'handleScriptCallbacks');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handleScriptCallbacks($name, $data){
|
|
|
|
switch($name){
|
|
|
|
case 'LibXmlRpc_BeginMatch':
|
2014-04-24 17:54:13 +02:00
|
|
|
$this->maniaControl->callbackManager->triggerCallback(Callbacks::BeginMatch, $data[0]);
|
2014-04-24 17:41:05 +02:00
|
|
|
break;
|
|
|
|
case 'LibXmlRpc_LoadingMap':
|
2014-04-24 17:54:13 +02:00
|
|
|
$this->maniaControl->callbackManager->triggerCallback(Callbacks::LoadingMap, $data[0]);
|
2014-04-24 17:41:05 +02:00
|
|
|
break;
|
|
|
|
case 'LibXmlRpc_BeginMap':
|
2014-04-24 17:54:13 +02:00
|
|
|
//$this->maniaControl->callbackManager->triggerCallback(Callbacks::BeginMap, $data[0]);
|
|
|
|
$this->maniaControl->mapManager->handleScriptBeginMap($data[0]);
|
2014-04-24 17:41:05 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
var_dump($name);
|
|
|
|
var_dump($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|