removed old callbacks

This commit is contained in:
kremsy 2017-05-09 11:05:19 +02:00
parent d22751d812
commit a15fcefba5

View File

@ -139,119 +139,7 @@ class LibXmlRpcCallbacks implements CallbackListener {
case Callbacks::MP_USES_TEAMMODE: case Callbacks::MP_USES_TEAMMODE:
$this->maniaControl->getCallbackManager()->triggerCallback($name, new ModeUseTeamsStructure($this->maniaControl, $data)); $this->maniaControl->getCallbackManager()->triggerCallback($name, new ModeUseTeamsStructure($this->maniaControl, $data));
break; break;
//OLD Callbacks
case 'LibXmlRpc_BeginMatch':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINMATCH, $data[0]);
break;
case 'LibXmlRpc_LoadingMap':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::LOADINGMAP, $data[0]);
break;
case 'BeginMap':
case 'LibXmlRpc_BeginMap':
if (!isset($data[2])) {
$data[2] = 'False';
}
$this->maniaControl->getMapManager()->handleScriptBeginMap($data[1], $data[2]);
break;
case 'LibXmlRpc_BeginSubmatch':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINSUBMATCH, $data[0]);
break;
case 'LibXmlRpc_BeginTurn':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINTURN, $data[0]);
break;
case 'LibXmlRpc_BeginTurnStop':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINTURNSTOP, $data[0]);
break;
case 'LibXmlRpc_BeginRound':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINROUND, $data[0]);
break;
case 'LibXmlRpc_BeginPlaying':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINPLAYING);
break;
case 'LibXmlRpc_EndPlaying':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDPLAYING);
break;
case 'LibXmlRpc_EndTurn':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDTURN, $data[0]);
break;
case 'LibXmlRpc_EndTurnStop':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDTURNSTOP, $data[0]);
break;
case 'LibXmlRpc_EndRound':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDROUND, $data[0]);
break;
case 'LibXmlRpc_EndRoundStop':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDROUNDSTOP, $data[0]);
break;
case 'LibXmlRpc_EndSubmatch':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDSUBMATCH, $data[0]);
break;
case 'EndMap':
case 'LibXmlRpc_EndMap':
$this->maniaControl->getMapManager()->handleScriptEndMap();
break;
case 'LibXmlRpc_BeginPodium':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINPODIUM);
break;
case 'LibXmlRpc_EndPodium':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDPODIUM);
break;
case 'LibXmlRpc_UnloadingMap':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::UNLOADINGMAP, $data[0]);
break;
case 'LibXmlRpc_EndMatch':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDMATCH, $data[0]);
break;
case 'LibXmlRpc_BeginWarmUp':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::BEGINWARMUP);
break;
case 'LibXmlRpc_EndWarmUp':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ENDWARMUP);
break;
case 'LibXmlRpc_PlayerRanking':
//TODO really useful? what does it have what RankingsManager not have?
$this->triggerPlayerRanking($data[0]);
break;
case 'LibXmlRpc_Rankings':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGS, $data[0]);
break;
case 'LibXmlRpc_OnStartLine':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONSTARTLINE, $data[0]);
break;
case 'LibXmlRpc_OnWayPoint':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONWAYPOINT, $data);
break;
case 'LibXmlRpc_OnGiveUp':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONGIVEUP, $data[0]);
break;
case 'LibXmlRpc_OnRespawn':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONRESPAWN, $data[0]);
break;
case 'LibXmlRpc_OnStunt':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONSTUNT, $data);
break;
case 'LibXmlRpc_OnPlayerRequestRespawn':
$player = $this->maniaControl->getPlayerManager()->getPlayer($data[0]);
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONPLAYERREQUESTRESPAWN, $player);
break;
case 'LibXmlRpc_Scores':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SCORES, $data);
break;
case 'LibXmlRpc_ScoresReady':
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::SCORESREADY, $data);
break;
} }
} }
/**
* Trigger the Ranking of a Player
*
* @param array $data
*/
private function triggerPlayerRanking(array $data) {
$player = $this->maniaControl->getPlayerManager()->getPlayer($data[1]);
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::PLAYERRANKING, $player, $data[0], $data[6], $data[5]);
}
} }