compatibility updates

This commit is contained in:
kremsy 2014-02-08 15:00:21 +01:00 committed by Steffen Schröder
parent 4385942d32
commit d478e81c08
5 changed files with 9 additions and 23 deletions

View File

@ -1,7 +1,7 @@
<?php
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\FileUtil;
use ManiaControl\Files\FileUtil;
use ManiaControl\ManiaControl;
use ManiaControl\Plugins\Plugin;

View File

@ -522,7 +522,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
// Background Quad
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);
$backgroundQuad->setSize($width, $height);
$backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
//Vote for label

View File

@ -2,6 +2,7 @@
use ManiaControl\ManiaControl;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Maps\Map;
use ManiaControl\Plugins\Plugin;
/**
@ -22,6 +23,7 @@ class EndurancePlugin implements CallbackListener, Plugin {
*/
/** @var maniaControl $maniaControl */
private $maniaControl = null;
/** @var Map $currentMap */
private $currentMap = null;
private $playerLapTimes = array();

View File

@ -174,7 +174,7 @@ class LocalRecordsPlugin implements CallbackListener, TimerListener, Plugin {
if (!$this->updateManialink) return;
$this->updateManialink = false;
$manialink = $this->buildManialink();
$this->sendManialink($manialink);
$this->maniaControl->manialinkManager->sendManialink($manialink);
}
/**
@ -270,24 +270,6 @@ class LocalRecordsPlugin implements CallbackListener, TimerListener, Plugin {
}
}
/**
* Send manialink to clients
*
* @param string $manialink
* @param string $login
*/
private function sendManialink($manialink, $login = null) {
if ($login) {
if (!$this->maniaControl->client->query('SendDisplayManialinkPageToLogin', $login, $manialink, 0, false)) {
trigger_error("Couldn't send manialink to player '{$login}'. " . $this->maniaControl->getClientErrorText());
}
return;
}
if (!$this->maniaControl->client->query('SendDisplayManialinkPage', $manialink, 0, false)) {
trigger_error("Couldn't send manialink to players. " . $this->maniaControl->getClientErrorText());
}
}
/**
* Handle ClientUpdated callback
*

View File

@ -126,8 +126,10 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
// Send jump callback
$params = explode(' ', $chatCallback[1][2], 2);
$param = $player->login . ";" . $params[1] . ";";
if (!$this->maniaControl->client->query('TriggerModeScriptEvent', self::CB_JUMPTO, $param)) {
trigger_error("Couldn't send jump callback for '{$player->login}'. " . $this->maniaControl->getClientErrorText());
try{
$this->maniaControl->client->triggerModeScriptEvent(self::CB_JUMPTO, $param);
} catch(\Exception $e){
trigger_error("Couldn't send jump callback for '{$player->login}'. " . $e->getMessage());
}
}