merged
This commit is contained in:
parent
8575e6b291
commit
b84ba8bb07
@ -55,12 +55,11 @@ class CustomUIManager implements CallbackListener, TimerListener {
|
||||
* @param Player $player
|
||||
*/
|
||||
private function updateManialink(Player $player = null) {
|
||||
$manialinkText = $this->customUI->render()->saveXML();
|
||||
if ($player) {
|
||||
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $player->login);
|
||||
$this->maniaControl->manialinkManager->sendManialink($this->customUI, $player->login);
|
||||
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) {
|
||||
$this->updateManialink($player);
|
||||
//send it again after 5 secs
|
||||
$this->maniaControl->timerManager->registerOneTimeListening($this, function($time) use (&$player){
|
||||
$this->updateManialink($player);
|
||||
},5000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -202,6 +202,9 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
||||
$this->fetchDedimaniaRecords(true);
|
||||
}
|
||||
}
|
||||
|
||||
$manialink = $this->buildManialink();
|
||||
$this->maniaControl->manialinkManager->sendManialink($manialink, $player->login);
|
||||
}
|
||||
} else {
|
||||
if (!$data) {
|
||||
@ -209,10 +212,6 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
|
||||
var_dump($data);
|
||||
}
|
||||
}
|
||||
|
||||
$manialink = $this->buildManialink();
|
||||
$this->maniaControl->manialinkManager->sendManialink($manialink, $player->login);
|
||||
|
||||
return true;
|
||||
}, $content, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user