diff --git a/src/net/common/sessiondata.cpp b/src/net/common/sessiondata.cpp index a8114682..41b0fe5c 100644 --- a/src/net/common/sessiondata.cpp +++ b/src/net/common/sessiondata.cpp @@ -404,14 +404,14 @@ SessionData::GetPlayerData() } void -SessionData::SetPlayerLastGames(std::vector lastGames) +SessionData::SetPlayerLastGames(std::vector lastGames) { boost::mutex::scoped_lock lock(m_dataMutex); m_lastGames = lastGames; } void -SessionData::AddPlayerLastGame(long lastGame) +SessionData::AddPlayerLastGame(unsigned long lastGame) { boost::mutex::scoped_lock lock(m_dataMutex); @@ -420,7 +420,7 @@ SessionData::AddPlayerLastGame(long lastGame) // @TODO: remove overdued entries } -std::vector +std::vector SessionData::GetPlayerLastGames() { boost::mutex::scoped_lock lock(m_dataMutex); @@ -443,13 +443,12 @@ SessionData::IsPlayerAllowedToJoinLimitRank() long num = (long)SERVER_ALLOWED_RANKING_GAMES_PER_MINUTES; long count = 0; - auto timeStamp = m_lastGames.begin(); - while (timeStamp != m_lastGames.end()) - { - if((long)timeStamp > then) + + for(std::vector::iterator timeStamp = m_lastGames.begin(); timeStamp != m_lastGames.end(); ++timeStamp) { + if(*timeStamp > then) count++; else - m_lastGames.erase(timeStamp); + m_lastGames.erase(*timeStamp); } if(count < num)