implements all shootmania and common methods

This commit is contained in:
kremsy 2017-03-27 22:45:40 +02:00
parent 5a7ee1c9be
commit a90b307bac
2 changed files with 106 additions and 2 deletions

View File

@ -14,6 +14,7 @@ use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerObjectStructure;
use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestActionChange; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestActionChange;
use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestRespawnStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerRequestRespawnStructure;
use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerTriggersSectorStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnPlayerTriggersSectorStructure;
use ManiaControl\Callbacks\Structures\ShootMania\OnScoresStructure;
use ManiaControl\Callbacks\Structures\ShootMania\OnShootStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnShootStructure;
use ManiaControl\Callbacks\Structures\ShootMania\OnShotDenyStructure; use ManiaControl\Callbacks\Structures\ShootMania\OnShotDenyStructure;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
@ -65,6 +66,10 @@ class ShootManiaCallbacks implements CallbackListener {
} }
switch ($name) { switch ($name) {
//MP4 New Callbacks //MP4 New Callbacks
case Callbacks::SM_SCORES:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_SCORES, new OnScoresStructure($this->maniaControl, $data));
break;
//TODO UI Properties Later
case Callbacks::SM_ONEVENTDEFAULT: case Callbacks::SM_ONEVENTDEFAULT:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ONEVENTDEFAULT, new OnDefaultEventStructure($this->maniaControl, $data)); $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SM_ONEVENTDEFAULT, new OnDefaultEventStructure($this->maniaControl, $data));
break; break;

View File

@ -40,7 +40,7 @@ class ModeScriptEventManager implements UsageInformationAble {
$this->getAllApiVersions(); $this->getAllApiVersions();
$this->getCallbacksList(); //TODO verify why this does not work $this->getCallbacksList();
} }
/** /**
@ -51,13 +51,52 @@ class ModeScriptEventManager implements UsageInformationAble {
} }
/** /**
* Request a list of all available callbacks. This method will trigger the "XmlRpc.CallbacksList" callback.
*
* @param string $responseId * @param string $responseId
* Triggers a Callback List Callback
*/ */
public function getCallbacksList($responseId = "DefaultResponseId") { public function getCallbacksList($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbacksList', array($responseId)); $this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbacksList', array($responseId));
} }
/**
* Request a list of all enabled callbacks. This method will trigger the "XmlRpc.CallbacksList_Enabled" callback.
*
* @param string $responseId
*/
public function getListOfEnabledCallbacks($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbacksList_Enabled', array($responseId));
}
/**
* Request a list of all disabled callbacks. This method will trigger the "XmlRpc.CallbacksList_Enabled" callback.
*
* @param string $responseId
*/
public function getListOfDisabledCallbacks($responseId) {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbacksList_Disabled', array($responseId));
}
/**
* Description: Request help about a callback. This method will trigger the "XmlRpc.CallbackHelp" callback.
*
* @param $callbackName
* @param string $responseId
*/
public function getCallbackHelp($callbackName, $responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbackHelp', array($callbackName, $responseId));
}
/**
* Request a list of all available methods. This method will trigger the "XmlRpc.MethodsList" callback.s
*
* @param string $responseId
*/
public function getMethodsList($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetMethodsList', array($responseId));
}
/** /**
* Sets the Api Version * Sets the Api Version
* *
@ -67,7 +106,67 @@ class ModeScriptEventManager implements UsageInformationAble {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.SetApiVersion', array($version)); $this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.SetApiVersion', array($version));
} }
/**
* Gets the Api Version
*
* @param string $version
*/
public function getApiVersion($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetApiVersion', array($responseId));
}
/**
* Request help about a method. This method will trigger the "XmlRpc.MethodHelp" callback.
*
* @param $callbackName
* @param string $responseId
*/
public function getMethodHelp($methodName, $responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetMethodHelp', array($methodName, $responseId));
}
/**
* Request the current game mode xmlrpc callbacks and methods documentation. This method will trigger the "XmlRpc.Documentation" callback.
*
* @param string $responseId
*/
public function getDocumentation($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetDocumentation', array($responseId));
}
/**
* Gets a List of All Api Version
*
* @param string $responseId
*/
public function getAllApiVersions($responseId = "DefaultResponseId") { public function getAllApiVersions($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetAllApiVersions', array($responseId)); $this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetAllApiVersions', array($responseId));
} }
/**
* Request the current scores. This method will trigger the "Shootmania.Scores" callback.
*
* @param string $responseId
*/
public function getShootmaniaScores($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetScores', array($responseId));
}
/**
* Request the current ui properties. This method will trigger the "Shootmania.UIProperties" callback.
*
* @param string $responseId
*/
public function getShootmaniaUIProperties($responseId = "DefaultResponseId") {
$this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetUIProperties', array($responseId));
}
/**
* Update the ui properties.
*
* @param string Json-Encoded Xml UI Property String
*/
public function setShootmaniaUIProperties($properties) {
$this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetUIProperties', array($properties));
}
} }