i'm trying to code a multi-mode plugin to play sounds on triggers, such as beginning of round, kills, etc...
The main mode is SpeedBall but i can test on Siege or Elite if needed.
My main problem is the lake of documentation and explanation so i'm asking for help.
I've read many documentation but none can explain me the interactions between ShootMania, ManiaControl, Mode scripts and Plugin Script.
So, here's my 1st problem :
I'm catching a "LibXmlRpc_OnArmorEmpty" callback on my handleCallbacks() function but i can't get informations from this callback (shooter, victim, etc...).
A summary of my code :
Code: Select all
public function load(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
//Register callbacks
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACK, $this, 'handleCallbacks');
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_MODESCRIPTCALLBACKARRAY, $this, 'handleCallbacks');
}
public function handleCallbacks(array $callback) {
$callbackName = $callback[1][0];
switch($callbackName) {
case 'LibXmlRpc_OnArmorEmpty':
$data = $callback[1][1];
$info=json_decode($data, true);
$this->LibXmlRpc_OnArmorEmpty($info);
break;
}
}
You can download the full code of my plugin here : http://maniacontrol.com/plugins/70
1) In my LibXmlRpc_OnArmorEmpty() function, how could i get informations from my $callback ?
2) What kind of object is $info ?
3) Which function returns $callback ? The SpeedBall main script ?
4) Why do i get a "LibXmlRpc_OnArmorEmpty" callback while EliteX plugin (for example) get a "OnArmorEmpty" callback ? Does it depend on the mode ?
I've tried many ways to display information but none works...
​Could you help me please ?
I can join a TS server and try to speak English if it would ​be easier.
Thanks.