small fix

This commit is contained in:
kremsy 2014-02-13 18:18:14 +01:00 committed by Steffen Schröder
parent 8275744fb2
commit 56ca076bec
2 changed files with 17 additions and 3 deletions

View File

@ -164,7 +164,12 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
* @return bool * @return bool
*/ */
public function enableAltMenu(Player $player) { public function enableAltMenu(Player $player) {
return $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_EnableAltMenu', $player->login); try {
$success = $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_EnableAltMenu', $player->login);
} catch(\Exception $e) {
return false;
}
return $success;
} }
/** /**
@ -174,7 +179,12 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
* @return bool * @return bool
*/ */
public function disableAltMenu(Player $player) { public function disableAltMenu(Player $player) {
return $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_DisableAltMenu', $player->login); try {
$success = $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_DisableAltMenu', $player->login);
} catch(\Exception $e) {
return false;
}
return $success;
} }
/** /**

View File

@ -43,7 +43,11 @@ class RankingManager implements CallbackListener {
* Initialize the Rankings * Initialize the Rankings
*/ */
public function onInit() { public function onInit() {
try {
$this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_GetRankings', ''); $this->maniaControl->client->triggerModeScriptEvent('LibXmlRpc_GetRankings', '');
} catch(\Exception $e) {
//do nothing
}
} }