mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/PacketIO: Prevented excessive WhoOpcode spam - solves possible crash/lag method
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -949,6 +949,7 @@ class WorldSession
|
||||
uint32 recruiterId;
|
||||
bool isRecruiter;
|
||||
ACE_Based::LockedQueue<WorldPacket*, ACE_Thread_Mutex> _recvQueue;
|
||||
time_t timeLastWhoCommand;
|
||||
};
|
||||
#endif
|
||||
/// @}
|
||||
|
||||
Reference in New Issue
Block a user