small callback stability improvement
This commit is contained in:
parent
05f688b99f
commit
37e12ebf88
@ -30,8 +30,11 @@ class OnScoresStructure extends CommonScoresStructure {
|
||||
$jsonObj = $this->getPlainJsonObject();
|
||||
|
||||
foreach ($jsonObj->players as $jsonPlayer) {
|
||||
$player = $this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login);
|
||||
if($player){
|
||||
$playerScore = new PlayerScore();
|
||||
$playerScore->setPlayer($this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login));
|
||||
|
||||
$playerScore->setRank($jsonPlayer->rank);
|
||||
$playerScore->setRoundPoints($jsonPlayer->roundpoints);
|
||||
$playerScore->setMapPoints($jsonPlayer->mappoints);
|
||||
@ -39,6 +42,6 @@ class OnScoresStructure extends CommonScoresStructure {
|
||||
|
||||
$this->playerScores[$jsonPlayer->login] = $playerScore;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ namespace ManiaControl\Callbacks\Structures\TrackMania;
|
||||
|
||||
use ManiaControl\Callbacks\Structures\Common\CommonScoresStructure;
|
||||
use ManiaControl\Callbacks\Structures\TrackMania\Models\PlayerScore;
|
||||
use ManiaControl\Callbacks\Structures\TrackMania\Models\TeamScore;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
/**
|
||||
@ -29,6 +28,8 @@ class OnScoresStructure extends CommonScoresStructure {
|
||||
$jsonObj = $this->getPlainJsonObject();
|
||||
|
||||
foreach ($jsonObj->players as $jsonPlayer) {
|
||||
$player = $this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login);
|
||||
if ($player) {
|
||||
$playerScore = new PlayerScore();
|
||||
$playerScore->setPlayer($this->maniaControl->getPlayerManager()->getPlayer($jsonPlayer->login));
|
||||
$playerScore->setRank($jsonPlayer->rank);
|
||||
@ -46,3 +47,4 @@ class OnScoresStructure extends CommonScoresStructure {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user