public function getPlayerInfo($login, $forceNew = false)
    {
        if (!isset($this->online[$login]) || $forceNew) {
            // to make sure even if an exception happens, player has login and basic nickname
            $playerInformation = new PlayerInfo();
            $playerInformation->login = $login;
            $playerDetails = new PlayerDetailedInfo();
            $playerDetails->nickName = $login;

            try {
                //fetch additional informations
                $playerInformation = $this->factory->getConnection()->getPlayerInfo($login);
                $playerDetails = $this->factory->getConnection()->getDetailedPlayerInfo($login);
            } catch (InvalidArgumentException $e) {
                $this->logger->error("Login unknown: $login", ["exception" => $e]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$e->getMessage());
            } catch (FaultException $ex) {
                $this->logger->error("Login unknown: $login", ["exception" => $ex]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$ex->getMessage());
            }
            return $this->playerFactory->createPlayer($playerInformation, $playerDetails);
        }

        return $this->online[$login];
    }
public function getPlayerInfo($login, $forceNew = false)
    {
        if (!isset($this->online[$login]) || $forceNew) {
            // to make sure even if an exception happens, player has login and basic nickname
            $playerInformation = new PlayerInfo();
            $playerInformation->login = $login;
            $playerDetails = new PlayerDetailedInfo();
            $playerDetails->nickName = $login;

            try {
                //fetch additional informations
                $playerInformation = $this->factory->getConnection()->getPlayerInfo($login);
                $playerDetails = $this->factory->getConnection()->getDetailedPlayerInfo($login);
            } catch (InvalidArgumentException $e) {
                $this->logger->error("Login unknown: $login", ["exception" => $e]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$e->getMessage());
            } catch (FaultException $ex) {
                $this->logger->error("Login unknown: $login", ["exception" => $ex]);
                $this->console->writeln('$f00Login Unknown: '.$login.' dedicated server said: $fff'.$ex->getMessage());
            }
            return $this->playerFactory->createPlayer($playerInformation, $playerDetails);
        }

        return $this->online[$login];
    }
public function getPlayerInfo ( $ login , $ forceNew = false ) { if ( ! isset ( $ this -> online [ $ login ] ) || $ forceNew ) { // to make sure even if an exception happens, player has login and basic nickname $ playerInformation = new PlayerInfo ( ) ; $ playerInformation -> login = $ login ; $ playerDetails = new PlayerDetailedInfo ( ) ; $ playerDetails -> nickName = $ login ; try { //fetch additional informations $ playerInformation = $ this -> factory -> getConnection ( ) -> getPlayerInfo ( $ login ) ; $ playerDetails = $ this -> factory -> getConnection ( ) -> getDetailedPlayerInfo ( $ login ) ; } catch ( InvalidArgumentException $ e ) { $ this -> logger -> error ( "Login unknown: $login" , [ "exception" => $ e ] ) ; $ this -> console -> writeln ( '$f00Login Unknown: ' . $ login . ' dedicated server said: $fff' . $ e -> getMessage ( ) ) ; } catch ( FaultException $ ex ) { $ this -> logger -> error ( "Login unknown: $login" , [ "exception" => $ ex ] ) ; $ this -> console -> writeln ( '$f00Login Unknown: ' . $ login . ' dedicated server said: $fff' . $ ex -> getMessage ( ) ) ; } return $ this -> playerFactory -> createPlayer ( $ playerInformation , $ playerDetails ) ; } return $ this -> online [ $ login ] ; }
Get information about a player.

@param string $login
@param bool   $forceNew

@return Player
Get information about a player .