Core/PacketIO: Reenabled most opcodes for WorldSession::DosProtection::GetMaxPacketCounterAllowed

This commit is contained in:
Shauren
2015-01-10 20:57:53 +01:00
parent bd5c7cc637
commit ec5800c845
9 changed files with 185 additions and 169 deletions

View File

@@ -17,31 +17,32 @@
*/
#include "Common.h"
#include "WorldPacket.h"
#include "DuelPackets.h"
#include "WorldSession.h"
#include "Log.h"
#include "Opcodes.h"
#include "UpdateData.h"
#include "Player.h"
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
void WorldSession::HandleDuelResponseOpcode(WorldPackets::Duel::DuelResponse& duelResponse)
{
ObjectGuid guid;
Player* player;
Player* plTarget;
recvPacket >> guid;
if (duelResponse.Accepted)
HandleDuelAccepted();
else
HandleDuelCancelled();
}
void WorldSession::HandleDuelAccepted()
{
if (!GetPlayer()->duel) // ignore accept from duel-sender
return;
player = GetPlayer();
plTarget = player->duel->opponent;
Player* player = GetPlayer();
Player* plTarget = player->duel->opponent;
if (player == player->duel->initiator || !plTarget || player == plTarget || player->duel->startTime != 0 || plTarget->duel->startTime != 0)
return;
//TC_LOG_DEBUG("network", "WORLD: Received CMSG_DUEL_ACCEPTED");
TC_LOG_DEBUG("network", "Player 1 is: %s (%s)", player->GetGUID().ToString().c_str(), player->GetName().c_str());
TC_LOG_DEBUG("network", "Player 2 is: %s (%s)", plTarget->GetGUID().ToString().c_str(), plTarget->GetName().c_str());
@@ -53,12 +54,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
plTarget->SendDuelCountdown(3000);
}
void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
void WorldSession::HandleDuelCancelled()
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_DUEL_CANCELLED");
ObjectGuid guid;
recvPacket >> guid;
// no duel requested
if (!GetPlayer()->duel)
return;

View File

@@ -863,31 +863,3 @@ void WorldSession::HandlePetLearnTalent(WorldPacket& recvData)
_player->LearnPetTalent(guid, talentId, requestedRank);
_player->SendTalentsInfoData(true);*/
}
void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recvData)
{
/* TODO: 6.x remove pet talents (add pet specializations)
TC_LOG_DEBUG("network", "CMSG_LEARN_PREVIEW_TALENTS_PET");
ObjectGuid guid;
recvData >> guid;
uint32 talentsCount;
recvData >> talentsCount;
uint32 talentId, talentRank;
// Client has max 19 talents, rounded up : 25
uint32 const MaxTalentsCount = 25;
for (uint32 i = 0; i < talentsCount && i < MaxTalentsCount; ++i)
{
recvData >> talentId >> talentRank;
_player->LearnPetTalent(guid, talentId, talentRank);
}
_player->SendTalentsInfoData(true);
recvData.rfinish();*/
}

View File

@@ -41,11 +41,6 @@ void WorldSession::HandleLearnTalentOpcode(WorldPackets::Talent::LearnTalent& pa
_player->SendTalentsInfoData();
}
void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
{
TC_LOG_DEBUG("network", "CMSG_LEARN_PREVIEW_TALENTS");
}
void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "MSG_TALENT_WIPE_CONFIRM");

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "DuelPackets.h"
void WorldPackets::Duel::DuelResponse::Read()
{
_worldPacket >> ArbiterGUID;
Accepted = _worldPacket.ReadBit();
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DuelPackets_h__
#define DuelPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
namespace WorldPackets
{
namespace Duel
{
class DuelResponse : public ClientPacket
{
public:
DuelResponse(WorldPacket&& packet) : ClientPacket(CMSG_DUEL_RESPONSE, std::move(packet)) { }
void Read() override;
ObjectGuid ArbiterGUID;
bool Accepted = false;
};
}
}
#endif // DuelPackets_h__

View File

@@ -24,6 +24,7 @@
#include "Packets/ChatPackets.h"
#include "Packets/ClientConfigPackets.h"
#include "Packets/CombatPackets.h"
#include "Packets/DuelPackets.h"
#include "Packets/EquipmentSetPackets.h"
#include "Packets/GameObjectPackets.h"
#include "Packets/GuildPackets.h"
@@ -288,8 +289,7 @@ void OpcodeTable::Initialize()
DEFINE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Item::DestroyItem, &WorldSession::HandleDestroyItemOpcode);
DEFINE_OPCODE_HANDLER_OLD(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle );
DEFINE_OPCODE_HANDLER_OLD(CMSG_DISMISS_CRITTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter );
DEFINE_OPCODE_HANDLER_OLD(CMSG_DUEL_ACCEPTED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode );
DEFINE_OPCODE_HANDLER_OLD(CMSG_DUEL_CANCELLED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode );
DEFINE_HANDLER(CMSG_DUEL_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Duel::DuelResponse, &WorldSession::HandleDuelResponseOpcode);
DEFINE_OPCODE_HANDLER_OLD(CMSG_EJECT_PASSENGER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
DEFINE_OPCODE_HANDLER_OLD(CMSG_EMOTE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode );
DEFINE_OPCODE_HANDLER_OLD(CMSG_ENABLETAXI, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes );
@@ -385,8 +385,6 @@ void OpcodeTable::Initialize()
DEFINE_OPCODE_HANDLER_OLD(CMSG_ITEM_TEXT_QUERY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery );
DEFINE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Channel::JoinChannel, &WorldSession::HandleJoinChannel);
DEFINE_OPCODE_HANDLER_OLD(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess );
DEFINE_OPCODE_HANDLER_OLD(CMSG_LEARN_PREVIEW_TALENTS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents );
DEFINE_OPCODE_HANDLER_OLD(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet );
DEFINE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Talent::LearnTalent, &WorldSession::HandleLearnTalentOpcode);
DEFINE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Channel::LeaveChannel, &WorldSession::HandleLeaveChannel);
DEFINE_OPCODE_HANDLER_OLD(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleLfgGetStatus );
@@ -559,7 +557,6 @@ void OpcodeTable::Initialize()
DEFINE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::GenerateRandomCharacterName, &WorldSession::HandleRandomizeCharNameOpcode);
DEFINE_OPCODE_HANDLER_OLD(CMSG_READ_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem );
DEFINE_OPCODE_HANDLER_OLD(CMSG_REALM_NAME_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
DEFINE_OPCODE_HANDLER_OLD(CMSG_REALM_SPLIT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode );
DEFINE_OPCODE_HANDLER_OLD(CMSG_RECLAIM_CORPSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode );
DEFINE_OPCODE_HANDLER_OLD(CMSG_RECRUIT_A_FRIEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
DEFINE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::ReorderCharacters, &WorldSession::HandleReorderCharacters);

View File

@@ -207,8 +207,7 @@ enum OpcodeClient : uint32
CMSG_DESTROY_ITEM = 0x01EE,
CMSG_DISMISS_CONTROLLED_VEHICLE = 0xBADD,
CMSG_DISMISS_CRITTER = 0xBADD,
CMSG_DUEL_ACCEPTED = 0xBADD,
CMSG_DUEL_CANCELLED = 0xBADD,
CMSG_DUEL_RESPONSE = 0x1BD2,
CMSG_EJECT_PASSENGER = 0xBADD,
CMSG_EMOTE = 0xBADD,
CMSG_ENABLETAXI = 0x00D2,
@@ -304,7 +303,7 @@ enum OpcodeClient : uint32
CMSG_GUILD_SET_NOTE = 0xBADD,
CMSG_GUILD_SET_RANK_PERMISSIONS = 0x0E38,
CMSG_GUILD_SWITCH_RANK = 0xBADD,
CMSG_HEARTH_AND_RESURRECT = 0xBADD,
CMSG_HEARTH_AND_RESURRECT = 0x0D9D,
CMSG_IGNORE_TRADE = 0xBADD,
CMSG_INITIATE_TRADE = 0xBADD,
CMSG_INSPECT = 0x01EC,
@@ -315,8 +314,6 @@ enum OpcodeClient : uint32
CMSG_ITEM_TEXT_QUERY = 0xBADD,
CMSG_JOIN_CHANNEL = 0x0B4B,
CMSG_KEEP_ALIVE = 0xBADD,
CMSG_LEARN_PREVIEW_TALENTS = 0xBADD,
CMSG_LEARN_PREVIEW_TALENTS_PET = 0xBADD,
CMSG_LEARN_TALENT = 0x0BB6,
CMSG_LEAVE_CHANNEL = 0x19F2,
CMSG_LFG_GET_STATUS = 0x1BA4,
@@ -451,7 +448,7 @@ enum OpcodeClient : uint32
CMSG_PETITION_SHOWLIST = 0xBADD,
CMSG_PETITION_SHOW_SIGNATURES = 0xBADD,
CMSG_PETITION_SIGN = 0xBADD,
CMSG_PET_ABANDON = 0xBADD,
CMSG_PET_ABANDON = 0x0005,
CMSG_PET_ACTION = 0x133A,
CMSG_PET_CANCEL_AURA = 0xBADD,
CMSG_PET_CAST_SPELL = 0x0286,
@@ -466,7 +463,6 @@ enum OpcodeClient : uint32
CMSG_PLAYED_TIME = 0x1BB2,
CMSG_PLAYER_DIFFICULTY_CHANGE = 0xBADD,
CMSG_PLAYER_LOGIN = 0x0B1D,
CMSG_PLAYER_LOGOUT = 0xBADD,
CMSG_PLAYER_VEHICLE_ENTER = 0xBADD,
CMSG_PLAY_DANCE = 0xBADD,
CMSG_PUSHQUESTTOPARTY = 0xBADD,
@@ -502,13 +498,12 @@ enum OpcodeClient : uint32
CMSG_RANDOMIZE_CHAR_NAME = 0x1981,
CMSG_READ_ITEM = 0xBADD,
CMSG_REALM_NAME_QUERY = 0x1189,
CMSG_REALM_SPLIT = 0xBADD,
CMSG_RECLAIM_CORPSE = 0xBADD,
CMSG_RECRUIT_A_FRIEND = 0x07BA,
CMSG_REORDER_CHARACTERS = 0x0DAA,
CMSG_REPAIR_ITEM = 0x0B54,
CMSG_REPLACE_ACCOUNT_DATA = 0xBADD,
CMSG_REPOP_REQUEST = 0xBADD,
CMSG_REPOP_REQUEST = 0x1BC2,
CMSG_REPORT_PVP_AFK = 0xBADD,
CMSG_REQUEST_ACCOUNT_DATA = 0x0F3E,
CMSG_REQUEST_CATEGORY_COOLDOWNS = 0xBADD,
@@ -522,12 +517,13 @@ enum OpcodeClient : uint32
CMSG_REQUEST_RATED_BG_INFO = 0xBADD,
CMSG_REQUEST_RATED_BG_STATS = 0xBADD,
CMSG_REQUEST_RESEARCH_HISTORY = 0xBADD,
CMSG_REQUEST_STABLED_PETS = 0x059D,
CMSG_REQUEST_VEHICLE_EXIT = 0xBADD,
CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xBADD,
CMSG_REQUEST_VEHICLE_PREV_SEAT = 0xBADD,
CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0xBADD,
CMSG_RESET_FACTION_CHEAT = 0xBADD,
CMSG_RESET_INSTANCES = 0xBADD,
CMSG_RESET_INSTANCES = 0x0389,
CMSG_RESURRECT_RESPONSE = 0xBADD,
CMSG_RETURN_TO_GRAVEYARD = 0x12EA,
CMSG_ROLE_POLL_BEGIN = 0xBADD,
@@ -536,7 +532,7 @@ enum OpcodeClient : uint32
CMSG_SAVE_PLAYER = 0xBADD,
CMSG_SEARCH_LFG_JOIN = 0xBADD,
CMSG_SEARCH_LFG_LEAVE = 0xBADD,
CMSG_SELF_RES = 0xBADD,
CMSG_SELF_RES = 0x1343,
CMSG_SELL_ITEM = 0x0351,
CMSG_SEND_MAIL = 0x0910,
CMSG_SEND_SOR_REQUEST_VIA_ADDRESS = 0xBADD,
@@ -607,7 +603,7 @@ enum OpcodeClient : uint32
CMSG_TIME_ADJUSTMENT_RESPONSE = 0xBADD,
CMSG_TIME_SYNC_RESP = 0x0003,
CMSG_TIME_SYNC_RESP_FAILED = 0xBADD,
CMSG_TOGGLE_PVP = 0xBADD,
CMSG_TOGGLE_PVP = 0x149B,
CMSG_TOTEM_DESTROYED = 0xBADD,
CMSG_TRAINER_BUY_SPELL = 0x0A28,
CMSG_TRAINER_LIST = 0x0A2E,

View File

@@ -1202,7 +1202,6 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
uint32 maxPacketCounterAllowed;
switch (opcode)
{
/*
// CPU usage sending 2000 packets/second on a 3.70 GHz 4 cores on Win x64
// [% CPU mysqld] [%CPU worldserver RelWithDebInfo]
case CMSG_PLAYER_LOGIN: // 0 0.5
@@ -1210,38 +1209,36 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
case CMSG_PET_NAME_QUERY: // 0 1
case CMSG_NPC_TEXT_QUERY: // 0 1
case CMSG_ATTACKSTOP: // 0 1
case CMSG_QUERY_QUESTS_COMPLETED: // 0 1
case CMSG_QUERY_TIME: // 0 1
case CMSG_CORPSE_MAP_POSITION_QUERY: // 0 1
//case CMSG_QUERY_QUESTS_COMPLETED: // 0 1
//case CMSG_QUERY_TIME: // 0 1
//case CMSG_CORPSE_MAP_POSITION_QUERY: // 0 1
case CMSG_MOVE_TIME_SKIPPED: // 0 1
case MSG_QUERY_NEXT_MAIL_TIME: // 0 1
//case MSG_QUERY_NEXT_MAIL_TIME: // 0 1
case CMSG_SETSHEATHED: // 0 1
case MSG_RAID_TARGET_UPDATE: // 0 1
case CMSG_PLAYER_LOGOUT: // 0 1
//case MSG_RAID_TARGET_UPDATE: // 0 1
case CMSG_LOGOUT_REQUEST: // 0 1
case CMSG_PET_RENAME: // 0 1
//case CMSG_PET_RENAME: // 0 1
case CMSG_QUESTGIVER_REQUEST_REWARD: // 0 1
case CMSG_COMPLETE_CINEMATIC: // 0 1
//case CMSG_COMPLETE_CINEMATIC: // 0 1
case CMSG_BANKER_ACTIVATE: // 0 1
case CMSG_BUY_BANK_SLOT: // 0 1
case CMSG_OPT_OUT_OF_LOOT: // 0 1
case CMSG_DUEL_ACCEPTED: // 0 1
case CMSG_DUEL_CANCELLED: // 0 1
case CMSG_CALENDAR_COMPLAIN: // 0 1
//case CMSG_OPT_OUT_OF_LOOT: // 0 1
case CMSG_DUEL_RESPONSE: // 0 1
//case CMSG_CALENDAR_COMPLAIN: // 0 1
case CMSG_QUEST_QUERY: // 0 1.5
case CMSG_GAMEOBJECT_QUERY: // 0 1.5
case CMSG_CREATURE_QUERY: // 0 1.5
case CMSG_QUESTGIVER_STATUS_QUERY: // 0 1.5
case CMSG_GUILD_QUERY: // 0 1.5
case CMSG_ARENA_TEAM_QUERY: // 0 1.5
//case CMSG_ARENA_TEAM_QUERY: // 0 1.5
case CMSG_TAXINODE_STATUS_QUERY: // 0 1.5
case CMSG_TAXIQUERYAVAILABLENODES: // 0 1.5
//case CMSG_TAXIQUERYAVAILABLENODES: // 0 1.5
case CMSG_QUESTGIVER_QUERY_QUEST: // 0 1.5
case CMSG_PAGE_TEXT_QUERY: // 0 1.5
case CMSG_GUILD_BANK_QUERY_TEXT: // 0 1.5
case MSG_CORPSE_QUERY: // 0 1.5
case MSG_MOVE_SET_FACING: // 0 1.5
case CMSG_REQUEST_PARTY_MEMBER_STATS: // 0 1.5
//case CMSG_GUILD_BANK_QUERY_TEXT: // 0 1.5
//case MSG_CORPSE_QUERY: // 0 1.5
case CMSG_MOVE_SET_FACING: // 0 1.5
//case CMSG_REQUEST_PARTY_MEMBER_STATS: // 0 1.5
case CMSG_QUESTGIVER_COMPLETE_QUEST: // 0 1.5
case CMSG_SET_ACTION_BUTTON: // 0 1.5
case CMSG_RESET_INSTANCES: // 0 1.5
@@ -1254,32 +1251,28 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
case CMSG_UNLEARN_SKILL: // 0 1.5
case CMSG_EQUIPMENT_SET_SAVE: // 0 1.5
case CMSG_EQUIPMENT_SET_DELETE: // 0 1.5
case CMSG_DISMISS_CRITTER: // 0 1.5
//case CMSG_DISMISS_CRITTER: // 0 1.5
case CMSG_REPOP_REQUEST: // 0 1.5
case CMSG_GROUP_INVITE: // 0 1.5
case CMSG_GROUP_INVITE_RESPONSE: // 0 1.5
case CMSG_GROUP_UNINVITE_GUID: // 0 1.5
case CMSG_GROUP_DISBAND: // 0 1.5
//case CMSG_GROUP_INVITE: // 0 1.5
//case CMSG_GROUP_INVITE_RESPONSE: // 0 1.5
//case CMSG_GROUP_UNINVITE_GUID: // 0 1.5
//case CMSG_GROUP_DISBAND: // 0 1.5
case CMSG_BATTLEMASTER_JOIN_ARENA: // 0 1.5
case CMSG_BATTLEFIELD_LEAVE: // 0 1.5
case CMSG_GUILD_BANK_LOG_QUERY: // 0 2
case CMSG_LOGOUT_CANCEL: // 0 2
case CMSG_REALM_SPLIT: // 0 2
case CMSG_ALTER_APPEARANCE: // 0 2
case CMSG_QUEST_CONFIRM_ACCEPT: // 0 2
//case CMSG_QUEST_CONFIRM_ACCEPT: // 0 2
case CMSG_GUILD_EVENT_LOG_QUERY: // 0 2.5
case CMSG_READY_FOR_ACCOUNT_DATA_TIMES: // 0 2.5
case CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY: // 0 2.5
case CMSG_BEGIN_TRADE: // 0 2.5
case CMSG_INITIATE_TRADE: // 0 3
case CMSG_MESSAGECHAT_ADDON_BATTLEGROUND: // 0 3.5
//case CMSG_BEGIN_TRADE: // 0 2.5
//case CMSG_INITIATE_TRADE: // 0 3
case CMSG_MESSAGECHAT_ADDON_GUILD: // 0 3.5
case CMSG_MESSAGECHAT_ADDON_OFFICER: // 0 3.5
case CMSG_MESSAGECHAT_ADDON_PARTY: // 0 3.5
case CMSG_MESSAGECHAT_ADDON_RAID: // 0 3.5
case CMSG_MESSAGECHAT_ADDON_WHISPER: // 0 3.5
case CMSG_MESSAGECHAT_AFK: // 0 3.5
case CMSG_MESSAGECHAT_BATTLEGROUND: // 0 3.5
case CMSG_MESSAGECHAT_CHANNEL: // 0 3.5
case CMSG_MESSAGECHAT_DND: // 0 3.5
case CMSG_MESSAGECHAT_EMOTE: // 0 3.5
@@ -1292,9 +1285,9 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
case CMSG_MESSAGECHAT_WHISPER: // 0 3.5
case CMSG_MESSAGECHAT_YELL: // 0 3.5
case CMSG_INSPECT: // 0 3.5
case CMSG_AREA_SPIRIT_HEALER_QUERY: // not profiled
//case CMSG_AREA_SPIRIT_HEALER_QUERY: // not profiled
case CMSG_STANDSTATECHANGE: // not profiled
case MSG_RANDOM_ROLL: // not profiled
case CMSG_RANDOM_ROLL: // not profiled
case CMSG_TIME_SYNC_RESP: // not profiled
case CMSG_TRAINER_BUY_SPELL: // not profiled
{
@@ -1305,29 +1298,27 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
}
case CMSG_QUESTGIVER_ACCEPT_QUEST: // 0 4
case CMSG_QUESTLOG_REMOVE_QUEST: // 0 4
//case CMSG_QUESTLOG_REMOVE_QUEST: // 0 4
case CMSG_QUESTGIVER_CHOOSE_REWARD: // 0 4
case CMSG_CONTACT_LIST: // 0 5
case CMSG_LEARN_PREVIEW_TALENTS: // 0 6
//case CMSG_CONTACT_LIST: // 0 5
case CMSG_AUTOBANK_ITEM: // 0 6
case CMSG_AUTOSTORE_BANK_ITEM: // 0 6
case CMSG_WHO: // 0 7
case CMSG_PLAYER_VEHICLE_ENTER: // 0 8
case CMSG_LEARN_PREVIEW_TALENTS_PET: // not profiled
case MSG_MOVE_HEARTBEAT:
//case CMSG_PLAYER_VEHICLE_ENTER: // 0 8
case CMSG_MOVE_HEARTBEAT:
{
maxPacketCounterAllowed = 200;
break;
}
case CMSG_GUILD_SET_NOTE: // 1 2 1 async db query
case CMSG_SET_CONTACT_NOTES: // 1 2.5 1 async db query
case CMSG_CALENDAR_GET_CALENDAR: // 0 1.5 medium upload bandwidth usage
//case CMSG_GUILD_SET_NOTE: // 1 2 1 async db query
//case CMSG_SET_CONTACT_NOTES: // 1 2.5 1 async db query
//case CMSG_CALENDAR_GET_CALENDAR: // 0 1.5 medium upload bandwidth usage
case CMSG_GUILD_BANK_QUERY_TAB: // 0 3.5 medium upload bandwidth usage
case CMSG_QUERY_INSPECT_ACHIEVEMENTS: // 0 13 high upload bandwidth usage
//case CMSG_QUERY_INSPECT_ACHIEVEMENTS: // 0 13 high upload bandwidth usage
case CMSG_GAMEOBJ_REPORT_USE: // not profiled
case CMSG_GAMEOBJ_USE: // not profiled
case MSG_PETITION_DECLINE: // not profiled
//case MSG_PETITION_DECLINE: // not profiled
{
maxPacketCounterAllowed = 50;
break;
@@ -1339,42 +1330,41 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
break;
}
case CMSG_GM_REPORT_LAG: // 1 3 1 async db query
//case CMSG_GM_REPORT_LAG: // 1 3 1 async db query
case CMSG_SPELLCLICK: // not profiled
case CMSG_DISMISS_CONTROLLED_VEHICLE: // not profiled
//case CMSG_DISMISS_CONTROLLED_VEHICLE: // not profiled
{
maxPacketCounterAllowed = 20;
break;
}
case CMSG_PETITION_SIGN: // 9 4 2 sync 1 async db queries
case CMSG_TURN_IN_PETITION: // 8 5.5 2 sync db query
case CMSG_GROUP_CHANGE_SUB_GROUP: // 6 5 1 sync 1 async db queries
case CMSG_PETITION_QUERY: // 4 3.5 1 sync db query
case CMSG_CHAR_RACE_CHANGE: // 5 4 1 sync db query
//case CMSG_PETITION_SIGN: // 9 4 2 sync 1 async db queries
//case CMSG_TURN_IN_PETITION: // 8 5.5 2 sync db query
//case CMSG_GROUP_CHANGE_SUB_GROUP: // 6 5 1 sync 1 async db queries
//case CMSG_PETITION_QUERY: // 4 3.5 1 sync db query
case CMSG_CHAR_CUSTOMIZE: // 5 5 1 sync db query
case CMSG_CHAR_FACTION_CHANGE: // 5 5 1 sync db query
case CMSG_CHAR_RACE_OR_FACTION_CHANGE: // 5 5 1 sync db query
case CMSG_CHAR_DELETE: // 4 4 1 sync db query
case CMSG_DEL_FRIEND: // 7 5 1 async db query
case CMSG_ADD_FRIEND: // 6 4 1 async db query
case CMSG_CHAR_RENAME: // 5 3 1 async db query
case CMSG_GMSURVEY_SUBMIT: // 2 3 1 async db query
case CMSG_BUG: // 1 1 1 async db query
case CMSG_GROUP_SET_LEADER: // 1 2 1 async db query
case CMSG_GROUP_RAID_CONVERT: // 1 5 1 async db query
case CMSG_GROUP_ASSISTANT_LEADER: // 1 2 1 async db query
case CMSG_CALENDAR_ADD_EVENT: // 21 10 2 async db query
case CMSG_PETITION_BUY: // not profiled 1 sync 1 async db queries
case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: // not profiled
case CMSG_REQUEST_VEHICLE_PREV_SEAT: // not profiled
case CMSG_REQUEST_VEHICLE_NEXT_SEAT: // not profiled
case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: // not profiled
case CMSG_REQUEST_VEHICLE_EXIT: // not profiled
case CMSG_EJECT_PASSENGER: // not profiled
case CMSG_ITEM_REFUND: // not profiled
//case CMSG_GMSURVEY_SUBMIT: // 2 3 1 async db query
//case CMSG_BUG: // 1 1 1 async db query
//case CMSG_GROUP_SET_LEADER: // 1 2 1 async db query
//case CMSG_GROUP_RAID_CONVERT: // 1 5 1 async db query
//case CMSG_GROUP_ASSISTANT_LEADER: // 1 2 1 async db query
//case CMSG_CALENDAR_ADD_EVENT: // 21 10 2 async db query
//case CMSG_PETITION_BUY: // not profiled 1 sync 1 async db queries
//case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: // not profiled
//case CMSG_REQUEST_VEHICLE_PREV_SEAT: // not profiled
//case CMSG_REQUEST_VEHICLE_NEXT_SEAT: // not profiled
//case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: // not profiled
//case CMSG_REQUEST_VEHICLE_EXIT: // not profiled
//case CMSG_EJECT_PASSENGER: // not profiled
//case CMSG_ITEM_REFUND: // not profiled
case CMSG_SOCKET_GEMS: // not profiled
case CMSG_WRAP_ITEM: // not profiled
case CMSG_REPORT_PVP_AFK: // not profiled
//case CMSG_WRAP_ITEM: // not profiled
//case CMSG_REPORT_PVP_AFK: // not profiled
{
maxPacketCounterAllowed = 10;
break;
@@ -1382,49 +1372,49 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
case CMSG_CHAR_CREATE: // 7 5 3 async db queries
case CMSG_CHAR_ENUM: // 22 3 2 async db queries
case CMSG_GMTICKET_CREATE: // 1 25 1 async db query
case CMSG_GMTICKET_UPDATETEXT: // 0 15 1 async db query
case CMSG_GMTICKET_DELETETICKET: // 1 25 1 async db query
case CMSG_GMRESPONSE_RESOLVE: // 1 25 1 async db query
case CMSG_CALENDAR_UPDATE_EVENT: // not profiled
case CMSG_CALENDAR_REMOVE_EVENT: // not profiled
case CMSG_CALENDAR_COPY_EVENT: // not profiled
case CMSG_CALENDAR_EVENT_INVITE: // not profiled
case CMSG_CALENDAR_EVENT_SIGNUP: // not profiled
case CMSG_CALENDAR_EVENT_RSVP: // not profiled
case CMSG_CALENDAR_EVENT_REMOVE_INVITE: // not profiled
case CMSG_CALENDAR_EVENT_MODERATOR_STATUS: // not profiled
case CMSG_ARENA_TEAM_INVITE: // not profiled
case CMSG_ARENA_TEAM_ACCEPT: // not profiled
case CMSG_ARENA_TEAM_DECLINE: // not profiled
case CMSG_ARENA_TEAM_LEAVE: // not profiled
case CMSG_ARENA_TEAM_DISBAND: // not profiled
case CMSG_ARENA_TEAM_REMOVE: // not profiled
case CMSG_ARENA_TEAM_LEADER: // not profiled
//case CMSG_GMTICKET_CREATE: // 1 25 1 async db query
//case CMSG_GMTICKET_UPDATETEXT: // 0 15 1 async db query
//case CMSG_GMTICKET_DELETETICKET: // 1 25 1 async db query
//case CMSG_GMRESPONSE_RESOLVE: // 1 25 1 async db query
//case CMSG_CALENDAR_UPDATE_EVENT: // not profiled
//case CMSG_CALENDAR_REMOVE_EVENT: // not profiled
//case CMSG_CALENDAR_COPY_EVENT: // not profiled
//case CMSG_CALENDAR_EVENT_INVITE: // not profiled
//case CMSG_CALENDAR_EVENT_SIGNUP: // not profiled
//case CMSG_CALENDAR_EVENT_RSVP: // not profiled
//case CMSG_CALENDAR_EVENT_REMOVE_INVITE: // not profiled
//case CMSG_CALENDAR_EVENT_MODERATOR_STATUS: // not profiled
//case CMSG_ARENA_TEAM_INVITE: // not profiled
//case CMSG_ARENA_TEAM_ACCEPT: // not profiled
//case CMSG_ARENA_TEAM_DECLINE: // not profiled
//case CMSG_ARENA_TEAM_LEAVE: // not profiled
//case CMSG_ARENA_TEAM_DISBAND: // not profiled
//case CMSG_ARENA_TEAM_REMOVE: // not profiled
//case CMSG_ARENA_TEAM_LEADER: // not profiled
case CMSG_LOOT_METHOD: // not profiled
case CMSG_GUILD_INVITE: // not profiled
case CMSG_GUILD_ACCEPT: // not profiled
//case CMSG_GUILD_ACCEPT: // not profiled
case CMSG_GUILD_DECLINE: // not profiled
case CMSG_GUILD_LEAVE: // not profiled
case CMSG_GUILD_DISBAND: // not profiled
case CMSG_GUILD_SET_GUILD_MASTER: // not profiled
case CMSG_GUILD_MOTD: // not profiled
//case CMSG_GUILD_MOTD: // not profiled
case CMSG_GUILD_SET_RANK_PERMISSIONS: // not profiled
case CMSG_GUILD_ADD_RANK: // not profiled
case CMSG_GUILD_DEL_RANK: // not profiled
case CMSG_GUILD_INFO_TEXT: // not profiled
case CMSG_GUILD_BANK_DEPOSIT_MONEY: // not profiled
case CMSG_GUILD_BANK_WITHDRAW_MONEY: // not profiled
//case CMSG_GUILD_BANK_WITHDRAW_MONEY: // not profiled
case CMSG_GUILD_BANK_BUY_TAB: // not profiled
case CMSG_GUILD_BANK_UPDATE_TAB: // not profiled
case CMSG_SET_GUILD_BANK_TEXT: // not profiled
case MSG_SAVE_GUILD_EMBLEM: // not profiled
case MSG_PETITION_RENAME: // not profiled
case MSG_TALENT_WIPE_CONFIRM: // not profiled
case MSG_SET_DUNGEON_DIFFICULTY: // not profiled
case MSG_SET_RAID_DIFFICULTY: // not profiled
case MSG_PARTY_ASSIGNMENT: // not profiled
case MSG_RAID_READY_CHECK: // not profiled
//case CMSG_GUILD_BANK_UPDATE_TAB: // not profiled
//case CMSG_SET_GUILD_BANK_TEXT: // not profiled
//case MSG_SAVE_GUILD_EMBLEM: // not profiled
//case MSG_PETITION_RENAME: // not profiled
//case MSG_TALENT_WIPE_CONFIRM: // not profiled
case CMSG_SET_DUNGEON_DIFFICULTY: // not profiled
case CMSG_SET_RAID_DIFFICULTY: // not profiled
//case MSG_PARTY_ASSIGNMENT: // not profiled
//case MSG_RAID_READY_CHECK: // not profiled
{
maxPacketCounterAllowed = 3;
break;
@@ -1435,7 +1425,6 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
maxPacketCounterAllowed = PLAYER_SLOTS_COUNT;
break;
}
*/
default:
{
maxPacketCounterAllowed = 100;

View File

@@ -130,6 +130,11 @@ namespace WorldPackets
class AttackStop;
}
namespace Duel
{
class DuelResponse;
}
namespace EquipmentSet
{
class SaveEquipmentSet;
@@ -848,8 +853,9 @@ class WorldSession
void HandleStableSwapPetCallback(PreparedQueryResult result, uint32 petId);
void SendTrainerBuyFailed(ObjectGuid guid, uint32 spellId, uint32 reason);
void HandleDuelAcceptedOpcode(WorldPacket& recvPacket);
void HandleDuelCancelledOpcode(WorldPacket& recvPacket);
void HandleDuelResponseOpcode(WorldPackets::Duel::DuelResponse& duelResponse);
void HandleDuelAccepted();
void HandleDuelCancelled();
void HandleAcceptTradeOpcode(WorldPacket& recvPacket);
void HandleBeginTradeOpcode(WorldPacket& recvPacket);
@@ -914,7 +920,6 @@ class WorldSession
void HandleCancelAutoRepeatSpellOpcode(WorldPacket& recvPacket);
void HandleLearnTalentOpcode(WorldPackets::Talent::LearnTalent& packet);
void HandleLearnPreviewTalents(WorldPacket& recvPacket);
void HandleTalentWipeConfirmOpcode(WorldPacket& recvPacket);
void HandleUnlearnSkillOpcode(WorldPacket& recvPacket);
void HandleSetSpecializationOpcode(WorldPackets::Talent::SetSpecialization& packet);
@@ -993,7 +998,6 @@ class WorldSession
void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket);
void HandlePetCastSpellOpcode(WorldPackets::Spells::SpellCastRequest& castRequest);
void HandlePetLearnTalent(WorldPacket& recvPacket);
void HandleLearnPreviewTalentsPet(WorldPacket& recvPacket);
void HandleSetActionBarToggles(WorldPacket& recvData);