bugfix vector erase
This commit is contained in:
@@ -1812,16 +1812,21 @@ 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);
|
|
||||||
|
|
||||||
vector<string> last_games;
|
if(dbPlayerData.last_games.length > 0){
|
||||||
boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(","));
|
LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
|
||||||
|
vector<string> last_games;
|
||||||
|
boost::split(last_games, dbPlayerData.last_games, boost::is_any_of(","));
|
||||||
|
|
||||||
for (int i = 0; i < last_games.size(); i++){
|
for (int i = 0; i < last_games.size(); i++){
|
||||||
if(last_games[i].length() > 0)
|
if(last_games[i].length() > 0)
|
||||||
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());
|
||||||
|
}else{
|
||||||
|
LOG_ERROR("no lastGames from db");
|
||||||
}
|
}
|
||||||
LOG_ERROR("last_games last from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().back());
|
|
||||||
this->AuthChallenge(tmpSession, dbPlayerData.secret);
|
this->AuthChallenge(tmpSession, dbPlayerData.secret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user