bugfix vector erase

This commit is contained in:
Kai Philipp
2019-09-14 18:51:18 +02:00
parent 9062317a38
commit 8120e1772f
+6 -1
View File
@@ -1812,8 +1812,9 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData
if (tmpSession && tmpSession->GetPlayerData()) { if (tmpSession && tmpSession->GetPlayerData()) {
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id); tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country); tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country);
LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
if(dbPlayerData.last_games.length > 0){
LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
vector<string> last_games; vector<string> last_games;
boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(",")); boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(","));
@@ -1822,6 +1823,10 @@ LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i])); tmpSession->GetPlayerData()->AddPlayerLastGame(stol(last_games[i]));
} }
LOG_ERROR("last_games last from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().back()); 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); this->AuthChallenge(tmpSession, dbPlayerData.secret);
} }
} }