From 4c30f251f0b45b89aad52347e6c404d2866d9603 Mon Sep 17 00:00:00 2001 From: Kai Philipp Date: Fri, 13 Sep 2019 18:24:44 +0200 Subject: [PATCH] NULL check --- src/net/common/serverlobbythread.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index ca311174..988251a4 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1812,13 +1812,13 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id); tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country); LOG_ERROR("last_games from db = " << dbPlayerData.last_games); - // std::vector last_games; - // std::stringstream ss(dbPlayerData.last_games); - // for (string i; ss >> i;) { - // last_games.push_back(stol(i)); - // if (ss.peek() == ',') - // ss.ignore(); - // } + std::vector last_games; + std::stringstream ss(dbPlayerData.last_games); + for (string i; ss >> i;) { + last_games.push_back(tol(i)); + if (ss.peek() == ',') + ss.ignore(); + } //tmpSession->GetPlayerData()->SetPlayerLastGames(last_games); //LOG_ERROR("last_games first from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().front()); this->AuthChallenge(tmpSession, dbPlayerData.secret);