Core/PacketIO: Fixed BattlefieldStatusHeader structure and QueueID values for other battleground types

This commit is contained in:
Shauren
2020-05-27 00:29:13 +02:00
parent eba31dea27
commit d435d5d5ba
5 changed files with 20 additions and 4 deletions

View File

@@ -1868,7 +1868,11 @@ char const* Battleground::GetName() const
uint64 Battleground::GetQueueId() const
{
return uint64(_battlegroundTemplate->Id) | UI64LIT(0x1F10000000000000);
BattlegroundQueueIdType type = BattlegroundQueueIdType::Battleground;
if (isArena())
type = isRated() ? BattlegroundQueueIdType::Arena : BattlegroundQueueIdType::ArenaSkirmish;
return uint64(_battlegroundTemplate->Id) | uint64(type) << 16 | UI64LIT(0x1F10000000000000);
}
BattlegroundTypeId Battleground::GetTypeID(bool getRandom) const

View File

@@ -230,6 +230,15 @@ enum BattlegroundPlayerPositionConstants
PLAYER_POSITION_ARENA_SLOT_5 = 6
};
enum class BattlegroundQueueIdType : uint8
{
Battleground = 0,
Arena = 1,
Wargame = 2,
Cheat = 3,
ArenaSkirmish = 4
};
/*
This class is used to:
1. Add player to battleground

View File

@@ -190,7 +190,7 @@ void BattlegroundMgr::BuildBattlegroundStatusHeader(WorldPackets::Battleground::
header->Ticket.Id = ticketId;
header->Ticket.Type = WorldPackets::LFG::RideType::Battlegrounds;
header->Ticket.Time = joinTime;
header->QueueID = bg->GetQueueId();
header->QueueID.push_back(bg->GetQueueId());
header->RangeMin = bg->GetMinLevel();
header->RangeMax = bg->GetMaxLevel();
header->TeamSize = bg->isArena() ? arenaType : 0;

View File

@@ -149,11 +149,14 @@ void WorldPackets::Battleground::BattlemasterJoinArena::Read()
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Battleground::BattlefieldStatusHeader const& header)
{
data << header.Ticket;
data << uint64(header.QueueID);
data << uint32(header.QueueID.size());
data << uint8(header.RangeMin);
data << uint8(header.RangeMax);
data << uint8(header.TeamSize);
data << uint32(header.InstanceID);
for (uint64 queueID : header.QueueID)
data << uint64(queueID);
data.WriteBit(header.RegisteredMatch);
data.WriteBit(header.TournamentRules);
data.FlushBits();

View File

@@ -150,7 +150,7 @@ namespace WorldPackets
struct BattlefieldStatusHeader
{
WorldPackets::LFG::RideTicket Ticket;
uint64 QueueID = 0;
std::vector<uint64> QueueID;
uint8 RangeMin = 0;
uint8 RangeMax = 0;
uint8 TeamSize = 0;