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
+89 -100
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;