callback implementation

This commit is contained in:
kremsy
2017-03-25 20:19:45 +01:00
parent 8a9ae9465a
commit d6995f211d
18 changed files with 380 additions and 45 deletions

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks;
use ManiaControl\Callbacks\Models\RecordCallback;
use ManiaControl\Callbacks\Structures\Trackmania\DefaultEventStructure;
use ManiaControl\Callbacks\Structures\TrackMania\OnDefaultEventStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Utils\Formatter;
@ -48,12 +48,12 @@ class TrackManiaCallbacks implements CallbackListener {
*/
public function handleScriptCallbacks($name, $data) {
if (!$this->maniaControl->getCallbackManager()->callbackListeningExists($name)) {
return;
//return; //Leave that disabled while testing/implementing Callbacks
}
switch ($name) {
//MP4 New Callbacks
case Callbacks::TM_EVENTDEFAULT:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_EVENTDEFAULT, new DefaultEventStructure($this->maniaControl, $data));
case Callbacks::TM_ONEVENTDEFAULT:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_ONEVENTDEFAULT, new OnDefaultEventStructure($this->maniaControl, $data));
break;
}
}