bug enclosing
This commit is contained in:
@@ -349,7 +349,7 @@ ServerGame::InternalStartGame()
|
||||
GetDatabase().AsyncCreateGame(GetId(), GetName());
|
||||
InitRankingMap(playerData);
|
||||
|
||||
// @TODO: here to save lastGames with mysql per player
|
||||
// @TODO: here to save last_games with mysql per player
|
||||
|
||||
//if (GetGameData().gameType == GAME_TYPE_RANKING)
|
||||
if(true)
|
||||
@@ -462,10 +462,10 @@ ServerGame::StoreLastGames(const PlayerDataList &playerDataList)
|
||||
// tmpPlayer->GetUniqueId()
|
||||
tmpPlayer->AddPlayerLastGame((long)time(NULL));
|
||||
LOG_ERROR("TimeStamp stored: " << tmpPlayer->GetPlayerLastGames().back());
|
||||
std::vector<long> lastGames = tmpPlayer->GetPlayerLastGames();
|
||||
LOG_ERROR("Ready for storing vector for player " << tmpPlayer->GetDBId() << " - lastGameTs " << lastGames.back());
|
||||
std::vector<long> last_games = tmpPlayer->GetPlayerLastGames();
|
||||
LOG_ERROR("Ready for storing vector for player " << tmpPlayer->GetDBId() << " - lastGameTs " << last_games.back());
|
||||
if(tmpPlayer->GetDBId() != DB_ID_INVALID){
|
||||
GetDatabase().SetPlayerLastGames(GetId(), tmpPlayer->GetDBId(), lastGames, GetSessionManager().GetSessionByUniquePlayerId(tmpPlayer->GetUniqueId())->GetClientAddr());
|
||||
GetDatabase().SetPlayerLastGames(GetId(), tmpPlayer->GetDBId(), last_games, GetSessionManager().GetSessionByUniquePlayerId(tmpPlayer->GetUniqueId())->GetClientAddr());
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -1811,16 +1811,16 @@ ServerLobbyThread::UserValid(unsigned playerId, const DBPlayerData &dbPlayerData
|
||||
if (tmpSession && tmpSession->GetPlayerData()) {
|
||||
tmpSession->GetPlayerData()->SetDBId(dbPlayerData.id);
|
||||
tmpSession->GetPlayerData()->SetCountry(dbPlayerData.country);
|
||||
LOG_ERROR("lastGames from db = " << dbPlayerData.lastGames);
|
||||
// std::vector<long> lastGames;
|
||||
// std::stringstream ss(dbPlayerData.lastGames);
|
||||
LOG_ERROR("last_games from db = " << dbPlayerData.last_games);
|
||||
// std::vector<long> last_games;
|
||||
// std::stringstream ss(dbPlayerData.last_games);
|
||||
// for (int i; ss >> i;) {
|
||||
// lastGames.push_back(i);
|
||||
// last_games.push_back(i);
|
||||
// if (ss.peek() == ',')
|
||||
// ss.ignore();
|
||||
// }
|
||||
// tmpSession->GetPlayerData()->SetPlayerLastGames(lastGames);
|
||||
// LOG_ERROR("lastGames first from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().front());
|
||||
// tmpSession->GetPlayerData()->SetPlayerLastGames(last_games);
|
||||
// LOG_ERROR("last_games first from vector after db = " << tmpSession->GetPlayerData()->GetPlayerLastGames().front());
|
||||
this->AuthChallenge(tmpSession, dbPlayerData.secret);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user