Preventing spam of report avatar function on server side.

This commit is contained in:
lotodore
2010-12-25 21:54:26 +00:00
parent a06c1b6ac1
commit 609a0c4f82
3 changed files with 50 additions and 9 deletions
+18
View File
@@ -644,6 +644,24 @@ ServerGame::IsPlayerInvited(unsigned playerId) const
return retVal;
}
void
ServerGame::AddReportedAvatar(unsigned playerId)
{
boost::mutex::scoped_lock lock(m_reportedAvatarListMutex);
m_reportedAvatarList.push_back(playerId);
}
bool
ServerGame::IsAvatarReported(unsigned playerId) const
{
bool retVal = false;
boost::mutex::scoped_lock lock(m_reportedAvatarListMutex);
PlayerIdList::const_iterator pos = find(m_reportedAvatarList.begin(), m_reportedAvatarList.end(), playerId);
if (pos != m_reportedAvatarList.end())
retVal = true;
return retVal;
}
void
ServerGame::AddComputerPlayer(boost::shared_ptr<PlayerData> player)
{