Exemplo n.º 1
0
 protected function getAveragePlayerLadder()
 {
     $logins = $this->matchMakingService->getPlayersPlaying($this->storage->serverLogin);
     $points = array();
     foreach ($logins as $login) {
         $player = Services\PlayerInfo::Get($login);
         if ($player) {
             $points[] = $player->ladderPoints;
         }
     }
     foreach (array_merge($this->storage->players, $this->storage->spectators) as $player) {
         $points[] = $player->ladderStats['PlayerRankings'][0]['Score'];
     }
     return count($points) == 0 ? 0.0 : array_sum($points) / count($points);
 }