mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Fixed structure of SMSG_START_TIMER
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user