implemented SetPlayerLastGames db function
This commit is contained in:
@@ -454,23 +454,6 @@ void
|
||||
ServerGame::StoreLastGames(const PlayerDataList &playerDataList)
|
||||
{
|
||||
// Store players lastgames in database.
|
||||
|
||||
// RankingMap::const_iterator i = m_rankingMap.begin();
|
||||
// RankingMap::const_iterator end = m_rankingMap.end();
|
||||
// boost::shared_ptr<SessionData> tmpSession;
|
||||
// while (i != end) {
|
||||
// LOG_ERROR("iterating m_rankingMap ... userId " << (*i).second.dbid);
|
||||
// tmpSession = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid);
|
||||
// if(tmpSession){
|
||||
// tmpSession->GetPlayerData()->AddPlayerLastGame((long)time(NULL));
|
||||
// LOG_ERROR("TimeStamp stored: " << tmpSession->GetPlayerData()->GetPlayerLastGames().back());
|
||||
// std::vector<long> lastGames = tmpSession->GetPlayerData()->GetPlayerLastGames();
|
||||
// LOG_ERROR("Ready for storing vector: " << lastGames.back());
|
||||
// }else{
|
||||
// LOG_ERROR("no tmpSession for userId " << (*i).second.dbid);
|
||||
// }
|
||||
// ++i;
|
||||
// }
|
||||
PlayerDataList::const_iterator i = playerDataList.begin();
|
||||
PlayerDataList::const_iterator end = playerDataList.end();
|
||||
while (i != end) {
|
||||
@@ -480,6 +463,9 @@ ServerGame::StoreLastGames(const PlayerDataList &playerDataList)
|
||||
LOG_ERROR("TimeStamp stored: " << tmpPlayer->GetPlayerLastGames().back());
|
||||
std::vector<long> lastGames = tmpPlayer->GetPlayerLastGames();
|
||||
LOG_ERROR("Ready for storing vector for player " << tmpPlayer->GetUniqueId() << " - lastGameTs " << lastGames.back());
|
||||
if(tmpPlayer->GetUniqueId() != DB_ID_INVALID){
|
||||
GetDatabase().SetPlayerLastGames(GetId(), tmpPlayer->GetUniqueId(), lastGames);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user