Core/Packets: (#24441)

* SMSG_START_MIRROR_TIMER
* SMSG_STOP_MIRROR_TIMER
* SMSG_PAUSE_MIRROR_TIMER -- not used

(cherry picked from commit 79bbca0bbf)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp

Co-authored-by: Golrag <golrag.jeremy@gmail.com>
This commit is contained in:
ForesterDev
2020-04-14 16:15:20 +04:00
committed by GitHub
parent c973c0260f
commit b712222a08
3 changed files with 70 additions and 11 deletions

View File

@@ -725,22 +725,14 @@ void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 Curre
StopMirrorTimer(Type);
return;
}
WorldPacket data(SMSG_START_MIRROR_TIMER, (21));
data << (uint32)Type;
data << CurrentValue;
data << MaxValue;
data << Regen;
data << (uint8)0;
data << (uint32)0; // spell id
SendDirectMessage(&data);
SendDirectMessage(WorldPackets::Misc::StartMirrorTimer(Type, CurrentValue, MaxValue, Regen, 0, 0).Write());
}
void Player::StopMirrorTimer(MirrorTimerType Type)
{
m_MirrorTimer[Type] = DISABLED_MIRROR_TIMER;
WorldPacket data(SMSG_STOP_MIRROR_TIMER, 4);
data << (uint32)Type;
SendDirectMessage(&data);
SendDirectMessage(WorldPackets::Misc::StopMirrorTimer(Type).Write());
}
bool Player::IsImmuneToEnvironmentalDamage() const

View File

@@ -41,6 +41,33 @@ WorldPacket const* WorldPackets::Misc::BinderConfirm::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::StartMirrorTimer::Write()
{
_worldPacket << uint32(Timer);
_worldPacket << uint32(Value);
_worldPacket << uint32(MaxValue);
_worldPacket << int32(Scale);
_worldPacket << uint8(Paused);
_worldPacket << uint32(SpellID);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::PauseMirrorTimer::Write()
{
_worldPacket << uint32(Timer);
_worldPacket << uint8(Paused);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::StopMirrorTimer::Write()
{
_worldPacket << uint32(Timer);
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::InvalidatePlayer::Write()
{
_worldPacket << Guid;

View File

@@ -64,6 +64,46 @@ namespace WorldPackets
ObjectGuid Unit;
};
class StartMirrorTimer final : public ServerPacket
{
public:
StartMirrorTimer() : ServerPacket(SMSG_START_MIRROR_TIMER, 21) { }
StartMirrorTimer(uint32 timer, uint32 value, uint32 maxValue, int32 scale, bool paused, uint32 spellID) :
ServerPacket(SMSG_START_MIRROR_TIMER, 21), Timer(timer), Value(value), MaxValue(maxValue), Scale(scale), Paused(paused), SpellID(spellID) { }
WorldPacket const* Write() override;
uint32 Timer = 0;
uint32 Value = 0;
uint32 MaxValue = 0;
int32 Scale = 0;
bool Paused = false;
uint32 SpellID = 0;
};
class PauseMirrorTimer final : public ServerPacket
{
public:
PauseMirrorTimer() : ServerPacket(SMSG_PAUSE_MIRROR_TIMER, 5) { }
PauseMirrorTimer(uint32 timer, bool paused) : ServerPacket(SMSG_PAUSE_MIRROR_TIMER, 5), Timer(timer), Paused(paused) { }
WorldPacket const* Write() override;
uint32 Timer = 0;
bool Paused = true;
};
class StopMirrorTimer final : public ServerPacket
{
public:
StopMirrorTimer() : ServerPacket(SMSG_STOP_MIRROR_TIMER, 4) { }
StopMirrorTimer(uint32 timer) : ServerPacket(SMSG_STOP_MIRROR_TIMER, 4), Timer(timer) { }
WorldPacket const* Write() override;
uint32 Timer = 0;
};
class InvalidatePlayer final : public ServerPacket
{
public: