Core/PacketIO: Fixed structure of SMSG_START_TIMER

This commit is contained in:
Shauren
2022-07-15 23:29:46 +02:00
parent ed93a97068
commit 06010c11b1
3 changed files with 12 additions and 6 deletions

View File

@@ -44,7 +44,6 @@
#include "Transport.h"
#include "Util.h"
#include "WorldStateMgr.h"
#include "WorldStatePackets.h"
#include <cstdarg>
template<class Do>
@@ -418,7 +417,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
Seconds countdownMaxForBGType = Seconds(isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX);
WorldPackets::Misc::StartTimer startTimer;
startTimer.Type = 0;
startTimer.Type = WorldPackets::Misc::StartTimer::Pvp;
startTimer.TimeLeft = std::chrono::duration_cast<Seconds>(countdownMaxForBGType - Milliseconds(GetElapsedTime()));
startTimer.TotalTime = countdownMaxForBGType;
@@ -1119,7 +1118,7 @@ void Battleground::AddPlayer(Player* player)
Seconds countdownMaxForBGType = Seconds(isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX);
WorldPackets::Misc::StartTimer startTimer;
startTimer.Type = 0;
startTimer.Type = WorldPackets::Misc::StartTimer::Pvp;
startTimer.TimeLeft = std::chrono::duration_cast<Seconds>(countdownMaxForBGType - Milliseconds(GetElapsedTime()));
startTimer.TotalTime = countdownMaxForBGType;
player->SendDirectMessage(startTimer.Write());

View File

@@ -724,8 +724,8 @@ void WorldPackets::Misc::CloseInteraction::Read()
WorldPacket const* WorldPackets::Misc::StartTimer::Write()
{
_worldPacket << TimeLeft;
_worldPacket << TotalTime;
_worldPacket << TimeLeft;
_worldPacket << int32(Type);
return &_worldPacket;

View File

@@ -931,13 +931,20 @@ namespace WorldPackets
class StartTimer final : public ServerPacket
{
public:
enum TimerType : int32
{
Pvp = 0,
ChallengeMode = 1,
PlayerCountdown = 2
};
StartTimer() : ServerPacket(SMSG_START_TIMER, 12) { }
WorldPacket const* Write() override;
int32 Type = 0;
Duration<Seconds> TimeLeft;
Duration<Seconds> TotalTime;
Duration<Seconds> TimeLeft;
TimerType Type = Pvp;
};
class ConversationLineStarted final : public ClientPacket