Merge pull request #1 from NewboO/master
Adaptation to new dedicated-api
This commit is contained in:
@ -118,26 +118,16 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
if ($playerItem->playerId <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login);
|
||||
$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;
|
||||
$playerItem->downloadRate = $detailedPlayerInfo->downloadRate;
|
||||
$playerItem->uploadRate = $detailedPlayerInfo->uploadRate;
|
||||
|
||||
$playerItem->hoursSinceZoneInscription = $detailedPlayerInfo->hoursSinceZoneInscription;
|
||||
$detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login);
|
||||
|
||||
//Check if the Player is in a Team, to notify if its a TeamMode or not
|
||||
if ($playerItem->teamId != -1) {
|
||||
$this->maniaControl->server->setTeamMode(true);
|
||||
}
|
||||
|
||||
$player = new Player($playerItem);
|
||||
$player = new Player(true);
|
||||
$player->setInfo($playerItem);
|
||||
$player->setDetailedInfo($detailedPlayerInfo);
|
||||
$player->hasJoinedGame = true;
|
||||
$this->addPlayer($player);
|
||||
}
|
||||
@ -222,7 +212,8 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
$login = $callback[1][0];
|
||||
try {
|
||||
$playerInfo = $this->maniaControl->client->getDetailedPlayerInfo($login);
|
||||
$player = new Player($playerInfo);
|
||||
$player = new Player(true);
|
||||
$player->setDetailedInfo($playerInfo);
|
||||
|
||||
$this->addPlayer($player);
|
||||
} catch (LoginUnknownException $e) {
|
||||
@ -403,7 +394,7 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
$player = new Player(null);
|
||||
$player = new Player(false);
|
||||
$player->index = $row->index;
|
||||
$player->login = $row->login;
|
||||
$player->rawNickname = $row->nickname;
|
||||
@ -488,7 +479,7 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
$player = new Player(null);
|
||||
$player = new Player(false);
|
||||
$player->index = $playerIndex;
|
||||
$player->login = $row->login;
|
||||
$player->rawNickname = $row->nickname;
|
||||
|
Reference in New Issue
Block a user