diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CoreAI/PetAI.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Miscellaneous/SharedDefines.h | 2 | ||||
-rw-r--r-- | src/server/game/Server/WorldSession.cpp | 40 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 4 |
6 files changed, 30 insertions, 33 deletions
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index f0a75403c8c..7c640f9a66d 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -89,7 +89,8 @@ void PetAI::UpdateAI(uint32 diff) if (me->GetVictim() && me->EnsureVictim()->IsAlive()) { // is only necessary to stop casting, the pet must not exit combat - if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me)) + if (!me->GetCurrentSpell(CURRENT_CHANNELED_SPELL) && // ignore channeled spells (Pin, Seduction) + me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1e027925f25..3f1e1270706 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -754,7 +754,8 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (damagetype != NODAMAGE && damage) { - if (victim != this && victim->GetTypeId() == TYPEID_PLAYER) // does not support creature push_back + if (victim != this && victim->GetTypeId() == TYPEID_PLAYER && // does not support creature push_back + (!spellProto || !(spellProto->AttributesEx7 & SPELL_ATTR7_NO_PUSHBACK_ON_DAMAGE))) { if (damagetype != DOT) if (Spell* spell = victim->m_currentSpells[CURRENT_GENERIC_SPELL]) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 97433fc53c3..737197878fb 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -268,8 +268,6 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recvData*/) { - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, false); - // remove expired bans PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS); CharacterDatabase.Execute(stmt); @@ -706,7 +704,6 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte data << uint8(CHAR_CREATE_SUCCESS); SendPacket(&data); - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); std::string IP_str = GetRemoteAddress(); TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); sScriptMgr->OnPlayerCreate(&newChar); @@ -784,8 +781,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData) WorldPacket data(SMSG_CHAR_DELETE, 1); data << uint8(CHAR_DELETE_SUCCESS); SendPacket(&data); - - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); } void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData) @@ -1282,7 +1277,6 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData) void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult result, std::string const& newName) { - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); if (!result) { WorldPacket data(SMSG_CHAR_RENAME, 1); @@ -1533,8 +1527,6 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); stmt->setUInt32(0, GUID_LOPART(guid)); // TODO: Make async with callback - // TODO 2: Allow opcode at end of callback - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -1789,8 +1781,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint8 playerClass = nameData->m_class; uint8 level = nameData->m_level; - // TO Do: Make async and allow opcode on callback - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); + // TO Do: Make async PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_AT_LOGIN_TITLES); stmt->setUInt32(0, lowGuid); PreparedQueryResult result = CharacterDatabase.Query(stmt); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 89ddb6697e3..8a17536c9cc 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -542,7 +542,7 @@ enum SpellAttr7 SPELL_ATTR7_IS_CHEAT_SPELL = 0x00000008, // 3 Cannot cast if caster doesn't have UnitFlag2 & UNIT_FLAG2_ALLOW_CHEAT_SPELLS SPELL_ATTR7_UNK4 = 0x00000010, // 4 Only 47883 (Soulstone Resurrection) and test spell. SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman totems. - SPELL_ATTR7_UNK6 = 0x00000040, // 6 Dark Surge, Surge of Light, Burning Breath triggers (boss spells). + SPELL_ATTR7_NO_PUSHBACK_ON_DAMAGE = 0x00000040, // 6 Does not cause spell pushback on damage SPELL_ATTR7_UNK7 = 0x00000080, // 7 66218 (Launch) spell. SPELL_ATTR7_HORDE_ONLY = 0x00000100, // 8 Teleports, mounts and other spells. SPELL_ATTR7_ALLIANCE_ONLY = 0x00000200, // 9 Teleports, mounts and other spells. diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index c79dc06d65c..7c7c2613592 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -599,7 +599,6 @@ void WorldSession::LogoutPlayer(bool save) m_playerLogout = false; m_playerSave = false; m_playerRecentlyLogout = true; - AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, true); LogoutRequest(0); } @@ -1192,8 +1191,9 @@ 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: %s (0x%X), count: %u)", - Session->GetAccountId(), Session->GetRemoteAddress().c_str(), opcodeTable[p.GetOpcode()]->Name, p.GetOpcode(), packetCounter.amountCounter); + TC_LOG_WARN("network", "AntiDOS: Account %u, IP: %s, Character: %s, flooding packet (opc: %s (0x%X), count: %u)", + Session->GetAccountId(), Session->GetRemoteAddress().c_str(), Session->GetPlayerName().c_str(), + opcodeTable[p.GetOpcode()]->Name, p.GetOpcode(), packetCounter.amountCounter); } // Then check if player is sending packets not allowed @@ -1271,14 +1271,18 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case CMSG_GUILD_QUERY: case CMSG_NAME_QUERY: case CMSG_PET_NAME_QUERY: - case CMSG_GAMEOBJECT_QUERY: case CMSG_CREATURE_QUERY: case CMSG_NPC_TEXT_QUERY: + case CMSG_QUESTGIVER_STATUS_QUERY: + { + maxPacketCounterAllowed = 5000; + break; + } + case CMSG_ARENA_TEAM_QUERY: case CMSG_TAXINODE_STATUS_QUERY: case CMSG_TAXIQUERYAVAILABLENODES: case CMSG_QUESTGIVER_QUERY_QUEST: - case CMSG_QUEST_QUERY: case CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY: case CMSG_QUERY_QUESTS_COMPLETED: case CMSG_QUEST_POI_QUERY: @@ -1295,28 +1299,34 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case MSG_CORPSE_QUERY: case MSG_QUERY_NEXT_MAIL_TIME: case MSG_MOVE_SET_FACING: + case CMSG_INSPECT: { - maxPacketCounterAllowed = 200; + maxPacketCounterAllowed = 500; break; } case CMSG_REQUEST_PARTY_MEMBER_STATS: case CMSG_WHO: + case CMSG_SETSHEATHED: + case CMSG_CONTACT_LIST: + case CMSG_GUILD_MOTD: { maxPacketCounterAllowed = 50; break; } - case CMSG_SETSHEATHED: - case CMSG_CONTACT_LIST: + case CMSG_SPELLCLICK: + case CMSG_GAMEOBJ_USE: + case CMSG_GAMEOBJ_REPORT_USE: + case MSG_RAID_TARGET_UPDATE: + case CMSG_QUESTGIVER_COMPLETE_QUEST: + case CMSG_PLAYER_VEHICLE_ENTER: + case CMSG_PETITION_SIGN: { - maxPacketCounterAllowed = 10; + maxPacketCounterAllowed = 20; break; } - case CMSG_GAMEOBJ_USE: - case CMSG_GAMEOBJ_REPORT_USE: - case CMSG_SPELLCLICK: case CMSG_PLAYER_LOGOUT: case CMSG_LOGOUT_REQUEST: case CMSG_LOGOUT_CANCEL: @@ -1359,7 +1369,6 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case CMSG_REQUEST_VEHICLE_EXIT: case CMSG_LEARN_PREVIEW_TALENTS: case CMSG_LEARN_PREVIEW_TALENTS_PET: - case CMSG_PLAYER_VEHICLE_ENTER: case CMSG_EJECT_PASSENGER: case CMSG_EQUIPMENT_SET_SAVE: case CMSG_EQUIPMENT_SET_DELETE: @@ -1370,11 +1379,9 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co //case CMSG_QUESTGIVER_CANCEL: case CMSG_QUESTLOG_REMOVE_QUEST: case CMSG_QUEST_CONFIRM_ACCEPT: - case CMSG_QUESTGIVER_COMPLETE_QUEST: case CMSG_DISMISS_CRITTER: case CMSG_REPOP_REQUEST: case CMSG_PETITION_BUY: - case CMSG_PETITION_SIGN: case CMSG_TURN_IN_PETITION: case CMSG_COMPLETE_CINEMATIC: case CMSG_ITEM_REFUND: @@ -1420,8 +1427,6 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case CMSG_GUILD_LEAVE: case CMSG_GUILD_DISBAND: case CMSG_GUILD_SET_GUILD_MASTER: - case CMSG_GUILD_MOTD: - case SMSG_GUILD_NEWS_UPDATE: case CMSG_GUILD_QUERY_RANKS: case CMSG_GUILD_ADD_RANK: case CMSG_GUILD_DEL_RANK: @@ -1438,7 +1443,6 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case MSG_SET_DUNGEON_DIFFICULTY: case MSG_SET_RAID_DIFFICULTY: case MSG_RANDOM_ROLL: - case MSG_RAID_TARGET_UPDATE: case MSG_PARTY_ASSIGNMENT: case MSG_RAID_READY_CHECK: { diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index de82d1b9780..d804c0cfc8b 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -337,7 +337,7 @@ class spell_pri_divine_hymn : public SpellScriptLoader void Register() override { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_divine_hymn_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_divine_hymn_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -538,7 +538,7 @@ class spell_pri_hymn_of_hope : public SpellScriptLoader void Register() override { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_hymn_of_hope_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_hymn_of_hope_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ALLY); } }; |