Merge pull request #4680 from daniik/master

Core/PacketIO: Prevented excessive WhoOpcode spam - solves possible crash/lag method
This commit is contained in:
Machiavelli
2012-01-07 03:50:09 -08:00
3 changed files with 7 additions and 1 deletions
@@ -169,6 +169,11 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message");
time_t now = time(NULL);
if (now - timeLastWhoCommand < 5)
return;
else timeLastWhoCommand = now;
uint32 matchcount = 0;
uint32 level_min, level_max, racemask, classmask, zones_count, str_count;
+1 -1
View File
@@ -94,7 +94,7 @@ m_playerRecentlyLogout(false), m_playerSave(false),
m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)),
m_sessionDbLocaleIndex(locale),
m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter),
isRecruiter(isARecruiter)
isRecruiter(isARecruiter), timeLastWhoCommand(0)
{
if (sock)
{
+1
View File
@@ -949,6 +949,7 @@ class WorldSession
uint32 recruiterId;
bool isRecruiter;
ACE_Based::LockedQueue<WorldPacket*, ACE_Thread_Mutex> _recvQueue;
time_t timeLastWhoCommand;
};
#endif
/// @}