mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/NetworkIO: Adjust more packet throttling values
Adjust some more packet throttling values.
Revert b35f831f2b since it's no longer needed.
Modify the AntiDoS log to specify in a more readable way which opcode triggered the system and how many packets have been received.
This commit is contained in:
@@ -186,11 +186,6 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "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;
|
||||
|
||||
@@ -121,7 +121,6 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
|
||||
m_TutorialsChanged(false),
|
||||
recruiterId(recruiter),
|
||||
isRecruiter(isARecruiter),
|
||||
timeLastWhoCommand(0),
|
||||
_RBACData(NULL)
|
||||
{
|
||||
memset(m_Tutorials, 0, sizeof(m_Tutorials));
|
||||
@@ -1253,8 +1252,8 @@ bool WorldSession::DosProtection::EvaluateOpcode(WorldPacket& p, time_t time) co
|
||||
if (++packetCounter.amountCounter > maxPacketCounterAllowed)
|
||||
{
|
||||
dosTriggered = true;
|
||||
TC_LOG_WARN("network", "AntiDOS: Account %u, IP: %s, flooding packet (opc: %u, size: %u)",
|
||||
Session->GetAccountId(), Session->GetRemoteAddress().c_str(), p.GetOpcode(), (uint32)p.size());
|
||||
TC_LOG_WARN("network", "AntiDOS: Account %u, IP: %s, flooding packet (opc: %s (0x%X), count: %u)",
|
||||
Session->GetAccountId(), Session->GetRemoteAddress().c_str(), opcodeTable[p.GetOpcode()].name, p.GetOpcode(), packetCounter.amountCounter);
|
||||
}
|
||||
|
||||
// Then check if player is sending packets not allowed
|
||||
@@ -1304,6 +1303,13 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
|
||||
uint32 maxPacketCounterAllowed;
|
||||
switch (opcode)
|
||||
{
|
||||
case CMSG_MESSAGECHAT:
|
||||
{
|
||||
maxPacketCounterAllowed = 500;
|
||||
break;
|
||||
}
|
||||
|
||||
case CMSG_ATTACKSTOP:
|
||||
case CMSG_ITEM_QUERY_SINGLE:
|
||||
case CMSG_ITEM_NAME_QUERY:
|
||||
case CMSG_GUILD_QUERY:
|
||||
@@ -1339,19 +1345,20 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
|
||||
break;
|
||||
}
|
||||
|
||||
case CMSG_MESSAGECHAT:
|
||||
case CMSG_REQUEST_PARTY_MEMBER_STATS:
|
||||
case CMSG_WHO:
|
||||
{
|
||||
maxPacketCounterAllowed = 50;
|
||||
break;
|
||||
}
|
||||
|
||||
case CMSG_SETSHEATHED:
|
||||
case CMSG_CONTACT_LIST:
|
||||
{
|
||||
maxPacketCounterAllowed = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
case CMSG_WHO:
|
||||
case CMSG_GAMEOBJ_USE:
|
||||
case CMSG_GAMEOBJ_REPORT_USE:
|
||||
case CMSG_SPELLCLICK:
|
||||
@@ -1429,14 +1436,12 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
|
||||
case CMSG_GROUP_RAID_CONVERT:
|
||||
case CMSG_GROUP_CHANGE_SUB_GROUP:
|
||||
case CMSG_GROUP_ASSISTANT_LEADER:
|
||||
case CMSG_REQUEST_PARTY_MEMBER_STATS:
|
||||
case CMSG_OPT_OUT_OF_LOOT:
|
||||
case CMSG_BATTLEMASTER_JOIN_ARENA:
|
||||
case CMSG_LEAVE_BATTLEFIELD:
|
||||
case CMSG_REPORT_PVP_AFK:
|
||||
case CMSG_DUEL_ACCEPTED:
|
||||
case CMSG_DUEL_CANCELLED:
|
||||
case CMSG_SETSHEATHED:
|
||||
case CMSG_CALENDAR_GET_CALENDAR:
|
||||
case CMSG_CALENDAR_ADD_EVENT:
|
||||
case CMSG_CALENDAR_UPDATE_EVENT:
|
||||
|
||||
@@ -1020,7 +1020,6 @@ class WorldSession
|
||||
uint32 recruiterId;
|
||||
bool isRecruiter;
|
||||
ACE_Based::LockedQueue<WorldPacket*, ACE_Thread_Mutex> _recvQueue;
|
||||
time_t timeLastWhoCommand;
|
||||
rbac::RBACData* _RBACData;
|
||||
|
||||
WorldSession(WorldSession const& right) = delete;
|
||||
|
||||
Reference in New Issue
Block a user