Fix 2 log messages when player joined to game (#9477)
authorMaksim <MoNTE48@mail.ua>
Sun, 8 Mar 2020 17:24:32 +0000 (18:24 +0100)
committerGitHub <noreply@github.com>
Sun, 8 Mar 2020 17:24:32 +0000 (18:24 +0100)
src/server.cpp

index f9d8ed361ef9b51ab4b5dae1881ff86c3ff88327..239ddd92efd2eaf8c4762ac23b5e6f62dd9f820d 100644 (file)
@@ -1018,16 +1018,15 @@ PlayerSAO* Server::StageTwoClientInit(session_t peer_id)
        // Send Breath
        SendPlayerBreath(playersao);
 
-       Address addr = getPeerAddress(player->getPeerId());
-       std::string ip_str = addr.serializeString();
-       actionstream<<player->getName() <<" [" << ip_str << "] joins game. " << std::endl;
        /*
                Print out action
        */
        {
+               Address addr = getPeerAddress(player->getPeerId());
+               std::string ip_str = addr.serializeString();
                const std::vector<std::string> &names = m_clients.getPlayerNames();
 
-               actionstream << player->getName() << " joins game. List of players: ";
+               actionstream << player->getName() << " [" << ip_str << "] joins game. List of players: ";
 
                for (const std::string &name : names) {
                        actionstream << name << " ";