This commit is contained in:
kremsy 2014-03-02 13:55:58 +01:00 committed by Steffen Schröder
parent 8575e6b291
commit b84ba8bb07
2 changed files with 9 additions and 7 deletions

View File

@ -55,12 +55,11 @@ class CustomUIManager implements CallbackListener, TimerListener {
* @param Player $player * @param Player $player
*/ */
private function updateManialink(Player $player = null) { private function updateManialink(Player $player = null) {
$manialinkText = $this->customUI->render()->saveXML();
if ($player) { if ($player) {
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $player->login); $this->maniaControl->manialinkManager->sendManialink($this->customUI, $player->login);
return; return;
} }
$this->maniaControl->manialinkManager->sendManialink($manialinkText); $this->maniaControl->manialinkManager->sendManialink($this->customUI);
} }
/** /**
@ -83,6 +82,10 @@ class CustomUIManager implements CallbackListener, TimerListener {
*/ */
public function handlePlayerJoined(Player $player) { public function handlePlayerJoined(Player $player) {
$this->updateManialink($player); $this->updateManialink($player);
//send it again after 5 secs
$this->maniaControl->timerManager->registerOneTimeListening($this, function($time) use (&$player){
$this->updateManialink($player);
},5000);
} }
/** /**

View File

@ -202,6 +202,9 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
$this->fetchDedimaniaRecords(true); $this->fetchDedimaniaRecords(true);
} }
} }
$manialink = $this->buildManialink();
$this->maniaControl->manialinkManager->sendManialink($manialink, $player->login);
} }
} else { } else {
if (!$data) { if (!$data) {
@ -209,10 +212,6 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
var_dump($data); var_dump($data);
} }
} }
$manialink = $this->buildManialink();
$this->maniaControl->manialinkManager->sendManialink($manialink, $player->login);
return true; return true;
}, $content, true); }, $content, true);
} }