mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/PacketIO: Fixed BattlefieldStatusHeader structure and QueueID values for other battleground types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user