aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-08 21:49:14 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-08 21:49:14 +0200
commitf0f027a79e2ee316f1a2dda6439950fbf8ab9e93 (patch)
treeac94c7900515bb79351dabdf32cfd8e59c30f987 /src
parente53f89d8364e98843cb24c45784bf8930c054548 (diff)
Core/PacketIO: Removed sending SMSG_CATEGORY_COOLDOWN as part of SendInitialPacketsBeforeAddToMap and only send it when requested or when SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN is added or removed
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp3
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp2
-rw-r--r--src/server/game/Server/Packets/SpellPackets.h8
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp2
-rw-r--r--src/server/game/Server/WorldSession.h3
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp11
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
7 files changed, 23 insertions, 7 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 7e49ddd007d..d491818a290 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -22442,9 +22442,6 @@ void Player::SendInitialPacketsBeforeAddToMap()
/// Pass 'this' as argument because we're not stored in ObjectAccessor yet
GetSocial()->SendSocialList(this, SOCIAL_FLAG_ALL);
- /// SMSG_SPELL_CATEGORY_COOLDOWN
- GetSession()->SendSpellCategoryCooldowns();
-
/// SMSG_BINDPOINTUPDATE
SendBindPointUpdate();
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 4c8fd4a674f..eb8dc67ef91 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -616,7 +616,7 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
caster->SendMessageToSet(&data, true);
}
-void WorldSession::HandleRequestCategoryCooldowns(WorldPacket& /*recvPacket*/)
+void WorldSession::HandleRequestCategoryCooldowns(WorldPackets::Spells::RequestCategoryCooldowns& /*requestCategoryCooldowns*/)
{
SendSpellCategoryCooldowns();
}
diff --git a/src/server/game/Server/Packets/SpellPackets.h b/src/server/game/Server/Packets/SpellPackets.h
index 86bbf76b0c0..3bcf5b79039 100644
--- a/src/server/game/Server/Packets/SpellPackets.h
+++ b/src/server/game/Server/Packets/SpellPackets.h
@@ -38,6 +38,14 @@ namespace WorldPackets
int32 SpellID = 0;
};
+ class RequestCategoryCooldowns final : public ClientPacket
+ {
+ public:
+ RequestCategoryCooldowns(WorldPacket&& packet) : ClientPacket(CMSG_REQUEST_CATEGORY_COOLDOWNS, std::move(packet)) { }
+
+ void Read() override { }
+ };
+
class CategoryCooldown final : public ServerPacket
{
public:
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 87849d0f144..a61333f93b0 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -662,7 +662,7 @@ void OpcodeTable::Initialize()
DEFINE_OPCODE_HANDLER_OLD(CMSG_REPORT_PVP_PLAYER_AFK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK );
DEFINE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::ClientConfig::RequestAccountData, &WorldSession::HandleRequestAccountData);
DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_BATTLEFIELD_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestBattlefieldStatusOpcode);
- DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleRequestCategoryCooldowns );
+ DEFINE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Spells::RequestCategoryCooldowns, &WorldSession::HandleRequestCategoryCooldowns);
DEFINE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Misc::RequestCemeteryList, &WorldSession::HandleRequestCemeteryList);
DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_CONQUEST_FORMULA_CONSTANTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_FORCED_REACTIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 43b49090108..faf5edfbe73 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -375,6 +375,7 @@ namespace WorldPackets
namespace Spells
{
class CancelAura;
+ class RequestCategoryCooldowns;
class CancelCast;
class CastSpell;
class PetCastSpell;
@@ -1379,7 +1380,7 @@ class WorldSession
void HandleUpdateMissileTrajectory(WorldPacket& recvPacket);
void HandleViolenceLevel(WorldPackets::Misc::ViolenceLevel& violenceLevel);
void HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket);
- void HandleRequestCategoryCooldowns(WorldPacket& recvPacket);
+ void HandleRequestCategoryCooldowns(WorldPackets::Spells::RequestCategoryCooldowns& requestCategoryCooldowns);
void SendSpellCategoryCooldowns();
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index e1dd5505eab..956bf6ea882 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -401,7 +401,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS
&AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE
&AuraEffect::HandleNULL, //340 SPELL_AURA_MOD_RESURRECTED_HEALTH_BY_GUILD_MEMBER
- &AuraEffect::HandleNULL, //341 SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN
+ &AuraEffect::HandleModSpellCategoryCooldown, //341 SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN
&AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2
&AuraEffect::HandleNULL, //343 SPELL_AURA_MOD_MELEE_DAMAGE_FROM_CASTER
&AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE
@@ -6634,3 +6634,12 @@ void AuraEffect::HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode,
else
aurApp->GetTarget()->SetMaxPower(POWER_ALTERNATE_POWER, 0);
}
+
+void AuraEffect::HandleModSpellCategoryCooldown(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ return;
+
+ if (aurApp->GetTarget()->GetTypeId() == TYPEID_PLAYER)
+ aurApp->GetTarget()->ToPlayer()->GetSession()->SendSpellCategoryCooldowns();
+}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 41eb2ab91ed..e8431e202ba 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -300,6 +300,7 @@ class AuraEffect
void HandleMastery(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleModSpellCategoryCooldown(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// aura effect periodic tick handlers
void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;