compatibility updates
This commit is contained in:
parent
4385942d32
commit
d478e81c08
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user