diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index feaa50e6..b79e5092 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -452,8 +452,11 @@ void ServerGame::StoreLastGames() { // Store players lastgames in database. - RankingMap::const_iterator i = m_rankingMap.begin(); - RankingMap::const_iterator end = m_rankingMap.end(); + + PlayerIdList plist = GetPlayerIdList(); + + RankingMap::const_iterator i = plist.info.players.begin(); + RankingMap::const_iterator end = plist.info.players.end(); while (i != end) { boost::shared_ptr tmpSession = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid); @@ -462,7 +465,7 @@ ServerGame::StoreLastGames() if(tmpSession){ std::vector lastGames = tmpSession->GetPlayerData()->GetPlayerLastGames(); - if(lastGames.size() > 0) + //if(lastGames.size() > 0) //GetLobbyThread().GetDatabase().SetGamePlayerPlace(GetId(), (*i).second.dbid, lastGames); LOG_VERBOSE("last timeStamp" << *lastGames.end() << "."); } diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 0004a231..fc0f4652 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -1440,7 +1440,7 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr sessio } else { // @FIXME: debug only - final position is gamestart session->GetPlayerData()->AddPlayerLastGame((long)time(NULL)); - LOG_ERROR("TimeStamp stored: " << *session->GetPlayerData()->GetPlayerLastGames().end()); + LOG_ERROR("TimeStamp stored: " << *session->GetPlayerData()->GetPlayerLastGames().back()); MoveSessionToGame(game, session, joinGame.autoleave(), false); } }