From 273509adb54863bbdf75004e53213fe7eb7f79c1 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 25 Jan 2014 11:40:34 +0100 Subject: [PATCH] small optimation, untested --- application/core/Players/PlayerManager.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/application/core/Players/PlayerManager.php b/application/core/Players/PlayerManager.php index 148576f2..ec87917e 100644 --- a/application/core/Players/PlayerManager.php +++ b/application/core/Players/PlayerManager.php @@ -117,19 +117,17 @@ class PlayerManager implements CallbackListener { if($playerItem->playerId <= 0) { continue; } - $playerInfo = $this->maniaControl->client->getPlayerInfo($playerItem->login); - //TODO just a workaround due nadeos bad structure $detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login); - $playerInfo->path = $detailedPlayerInfo->path; - $playerInfo->language = $detailedPlayerInfo->language; - $playerInfo->clientVersion = $detailedPlayerInfo->clientVersion; - $playerInfo->iPAddress = $detailedPlayerInfo->iPAddress; - $playerInfo->isSpectator = $detailedPlayerInfo->isSpectator; - $playerInfo->avatar = $detailedPlayerInfo->avatar; - $playerInfo->ladderStats = $detailedPlayerInfo->ladderStats; + $playerItem->path = $detailedPlayerInfo->path; + $playerItem->language = $detailedPlayerInfo->language; + $playerItem->clientVersion = $detailedPlayerInfo->clientVersion; + $playerItem->iPAddress = $detailedPlayerInfo->iPAddress; + $playerItem->isSpectator = $detailedPlayerInfo->isSpectator; + $playerItem->avatar = $detailedPlayerInfo->avatar; + $playerItem->ladderStats = $detailedPlayerInfo->ladderStats; - $player = new Player($playerInfo); + $player = new Player($playerItem); $player->hasJoinedGame = true; $this->addPlayer($player); }