mxkarma fix
This commit is contained in:
parent
14b2fac573
commit
7144f4264c
@ -221,6 +221,17 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
|||||||
* @param Map $map
|
* @param Map $map
|
||||||
*/
|
*/
|
||||||
public function handleBeginMap(Map $map) {
|
public function handleBeginMap(Map $map) {
|
||||||
|
//send Map Karma to MX from previous Map
|
||||||
|
if(isset($this->mxKarma['map'])){
|
||||||
|
$votes = array();
|
||||||
|
foreach($this->mxKarma['votes'] as $login => $value) {
|
||||||
|
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||||
|
array_push($votes, array("login" => $login, "nickname" => $player->rawNickname, "vote" => $value));
|
||||||
|
}
|
||||||
|
$this->postKarmaVotes($this->mxKarma['map'], $votes);
|
||||||
|
unset($this->mxKarma['map']);
|
||||||
|
}
|
||||||
|
|
||||||
unset($this->mxKarma['votes']);
|
unset($this->mxKarma['votes']);
|
||||||
$this->updateManialink = true;
|
$this->updateManialink = true;
|
||||||
}
|
}
|
||||||
@ -689,13 +700,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$votes = array();
|
$this->mxKarma['map'] = $map;
|
||||||
foreach($this->mxKarma['votes'] as $login => $value) {
|
|
||||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
|
||||||
array_push($votes, array("login" => $login, "nickname" => $player->rawNickname, "vote" => $value));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->postKarmaVotes($map, $votes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user