diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 6210a704..ebe72c13 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1812,16 +1812,21 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData if (tmpSession && tmpSession->GetPlayerData()) { tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id); tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country); -LOG_ERROR("last_games from db = " << dbPlayerData.last_games); - vector last_games; - boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(",")); - - for (int i = 0; i < last_games.size(); i++){ - if(last_games[i].length() > 0) - tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i])); - } -LOG_ERROR("last_games last from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().back()); + if(dbPlayerData.last_games.length > 0){ + LOG_ERROR("last_games from db = " << dbPlayerData.last_games); + vector last_games; + boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(",")); + + for (int i = 0; i < last_games.size(); i++){ + if(last_games[i].length() > 0) + tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i])); + } + LOG_ERROR("last_games last from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().back()); + }else{ + LOG_ERROR("no lastGames from db"); + } + this->AuthChallenge(tmpSession, dbPlayerData.secret); } }