Merge pull request #8048 from Tuxity/battlegrounds_stuff
[434] Battlegrounds
This commit is contained in:
@@ -34,13 +34,12 @@
|
||||
|
||||
Battlefield::Battlefield()
|
||||
{
|
||||
m_Guid = MAKE_NEW_GUID(m_TypeId, 0, HIGHGUID_TYPE_BATTLEGROUND);
|
||||
|
||||
m_Timer = 0;
|
||||
m_IsEnabled = true;
|
||||
m_isActive = false;
|
||||
m_DefenderTeam = TEAM_NEUTRAL;
|
||||
|
||||
m_Guid = 0;
|
||||
m_TypeId = 0;
|
||||
m_BattleId = 0;
|
||||
m_ZoneId = 0;
|
||||
|
||||
@@ -131,7 +131,7 @@ void Battleground::BroadcastWorker(Do& _do)
|
||||
|
||||
Battleground::Battleground()
|
||||
{
|
||||
m_Guid = MAKE_NEW_GUID(m_TypeID, 0, HIGHGUID_TYPE_BATTLEGROUND);
|
||||
m_Guid = 0;
|
||||
m_TypeID = BATTLEGROUND_TYPE_NONE;
|
||||
m_RandomTypeID = BATTLEGROUND_TYPE_NONE;
|
||||
m_InstanceID = 0;
|
||||
@@ -273,7 +273,7 @@ void Battleground::Update(uint32 diff)
|
||||
// after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
if (isArena())
|
||||
{
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)
|
||||
if (GetElapsedTime() >= 47*MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
@@ -456,6 +456,10 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
// *********************************************************
|
||||
ModifyStartDelayTime(diff);
|
||||
|
||||
// I know it's a too big but it's the value sent in packet, I get it from retail sniff.
|
||||
// I think it's link to the countdown when bgs start
|
||||
SetRemainingTime(300000);
|
||||
|
||||
if (m_ResetStatTimer > 5000)
|
||||
{
|
||||
m_ResetStatTimer = 0;
|
||||
@@ -521,7 +525,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
WorldPacket status;
|
||||
BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType());
|
||||
uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType());
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetElapsedTime(), GetArenaType());
|
||||
player->GetSession()->SendPacket(&status);
|
||||
|
||||
player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||
@@ -560,6 +564,9 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EndTime > 0 && (m_EndTime -= diff) > 0)
|
||||
m_EndTime -= diff;
|
||||
}
|
||||
|
||||
inline void Battleground::_ProcessLeave(uint32 diff)
|
||||
@@ -758,7 +765,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
|
||||
SetStatus(STATUS_WAIT_LEAVE);
|
||||
//we must set it this way, because end time is sent in packet!
|
||||
m_EndTime = TIME_TO_AUTOREMOVE;
|
||||
m_EndTime = TIME_AUTOCLOSE_BATTLEGROUND;
|
||||
|
||||
// arena rating calculation
|
||||
if (isArena() && isRated())
|
||||
@@ -919,9 +926,9 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
player->GetSession()->SendPacket(&pvpLogData);
|
||||
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType());
|
||||
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType());
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1);
|
||||
}
|
||||
|
||||
@@ -992,10 +999,11 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
|
||||
RemovePlayer(player, guid, team); // BG subclass specific code
|
||||
|
||||
BattlegroundTypeId bgTypeId = GetTypeID();
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
|
||||
|
||||
if (participant) // if the player was a match participant, remove auras, calc rating, update queue
|
||||
{
|
||||
BattlegroundTypeId bgTypeId = GetTypeID();
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
|
||||
if (player)
|
||||
{
|
||||
player->ClearAfkReports();
|
||||
@@ -1023,7 +1031,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (SendPacket)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -1071,6 +1079,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE); // We're not in BG.
|
||||
// reset destination bg team
|
||||
player->SetBGTeam(0);
|
||||
player->RemoveBattlegroundQueueJoinTime(bgTypeId);
|
||||
|
||||
if (Transport)
|
||||
player->TeleportToBGEntryPoint();
|
||||
@@ -1086,8 +1095,8 @@ void Battleground::Reset()
|
||||
{
|
||||
SetWinner(WINNER_NONE);
|
||||
SetStatus(STATUS_WAIT_QUEUE);
|
||||
SetStartTime(0);
|
||||
SetEndTime(0);
|
||||
SetElapsedTime(0);
|
||||
SetRemainingTime(0);
|
||||
SetLastResurrectTime(0);
|
||||
SetArenaType(0);
|
||||
SetRated(false);
|
||||
@@ -1113,7 +1122,7 @@ void Battleground::Reset()
|
||||
|
||||
void Battleground::StartBattleground()
|
||||
{
|
||||
SetStartTime(0);
|
||||
SetElapsedTime(0);
|
||||
SetLastResurrectTime(0);
|
||||
// add BG to free slot queue
|
||||
AddToBGFreeSlotQueue();
|
||||
@@ -1152,11 +1161,11 @@ void Battleground::AddPlayer(Player* player)
|
||||
SendPacketToTeam(team, &data, player, false);
|
||||
|
||||
// BG Status packet
|
||||
WorldPacket status;
|
||||
BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType());
|
||||
uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1);
|
||||
player->GetSession()->SendPacket(&status);
|
||||
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType(), isArena() ? 0 : 1);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||
|
||||
@@ -1738,7 +1747,7 @@ void Battleground::EndNow()
|
||||
{
|
||||
RemoveFromBGFreeSlotQueue();
|
||||
SetStatus(STATUS_WAIT_LEAVE);
|
||||
SetEndTime(0);
|
||||
SetRemainingTime(0);
|
||||
}
|
||||
|
||||
// To be removed
|
||||
@@ -1858,7 +1867,7 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player)
|
||||
sBattlegroundMgr->BuildPvpLogDataPacket(&data, this);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType());
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType());
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ enum BattlegroundTimeIntervals
|
||||
RESURRECTION_INTERVAL = 30000, // ms
|
||||
//REMIND_INTERVAL = 10000, // ms
|
||||
INVITATION_REMIND_TIME = 20000, // ms
|
||||
INVITE_ACCEPT_WAIT_TIME = 40000, // ms
|
||||
TIME_TO_AUTOREMOVE = 120000, // ms
|
||||
INVITE_ACCEPT_WAIT_TIME = 90000, // ms
|
||||
TIME_AUTOCLOSE_BATTLEGROUND = 120000, // ms
|
||||
MAX_OFFLINE_TIME = 300, // secs
|
||||
RESPAWN_ONE_DAY = 86400, // secs
|
||||
RESPAWN_IMMEDIATELY = 0, // secs
|
||||
@@ -257,23 +257,33 @@ enum BattlegroundStartingEventsIds
|
||||
|
||||
enum GroupJoinBattlegroundResult
|
||||
{
|
||||
// positive values are indexes in BattlemasterList.dbc
|
||||
ERR_GROUP_JOIN_BATTLEGROUND_FAIL = 0, // Your group has joined a battleground queue, but you are not eligible (showed for non existing BattlemasterList.dbc indexes)
|
||||
ERR_BATTLEGROUND_NONE = -1, // not show anything
|
||||
ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = -2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter.
|
||||
ERR_ARENA_TEAM_PARTY_SIZE = -3, // Incorrect party size for this arena.
|
||||
ERR_BATTLEGROUND_TOO_MANY_QUEUES = -4, // You can only be queued for 2 battles at once
|
||||
ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = -5, // You cannot queue for a rated match while queued for other battles
|
||||
ERR_BATTLEDGROUND_QUEUED_FOR_RATED = -6, // You cannot queue for another battle while queued for a rated arena match
|
||||
ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = -7, // Your team has left the arena queue
|
||||
ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = -8, // You can't do that in a battleground.
|
||||
ERR_BATTLEGROUND_JOIN_XP_GAIN = -9, // wtf, doesn't exist in client...
|
||||
ERR_BATTLEGROUND_JOIN_RANGE_INDEX = -10, // Cannot join the queue unless all members of your party are in the same battleground level range.
|
||||
ERR_BATTLEGROUND_JOIN_TIMED_OUT = -11, // %s was unavailable to join the queue. (uint64 guid exist in client cache)
|
||||
ERR_BATTLEGROUND_JOIN_FAILED = -12, // Join as a group failed (uint64 guid doesn't exist in client cache)
|
||||
ERR_LFG_CANT_USE_BATTLEGROUND = -13, // You cannot queue for a battleground or arena while using the dungeon system.
|
||||
ERR_IN_RANDOM_BG = -14, // Can't do that while in a Random Battleground queue.
|
||||
ERR_IN_NON_RANDOM_BG = -15 // Can't queue for Random Battleground while in another Battleground queue.
|
||||
ERR_BATTLEGROUND_NONE = 0,
|
||||
ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = 2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter.
|
||||
ERR_ARENA_TEAM_PARTY_SIZE = 3, // Incorrect party size for this arena.
|
||||
ERR_BATTLEGROUND_TOO_MANY_QUEUES = 4, // You can only be queued for 2 battles at once
|
||||
ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = 5, // You cannot queue for a rated match while queued for other battles
|
||||
ERR_BATTLEDGROUND_QUEUED_FOR_RATED = 6, // You cannot queue for another battle while queued for a rated arena match
|
||||
ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 7, // Your team has left the arena queue
|
||||
ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = 8, // You can't do that in a battleground.
|
||||
ERR_BATTLEGROUND_JOIN_XP_GAIN = 9, // wtf, doesn't exist in client...
|
||||
ERR_BATTLEGROUND_JOIN_RANGE_INDEX = 10, // Cannot join the queue unless all members of your party are in the same battleground level range.
|
||||
ERR_BATTLEGROUND_JOIN_TIMED_OUT = 11, // %s was unavailable to join the queue. (uint64 guid exist in client cache)
|
||||
//ERR_BATTLEGROUND_JOIN_TIMED_OUT = 12, // same as 11
|
||||
//ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 13, // same as 7
|
||||
ERR_LFG_CANT_USE_BATTLEGROUND = 14, // You cannot queue for a battleground or arena while using the dungeon system.
|
||||
ERR_IN_RANDOM_BG = 15, // Can't do that while in a Random Battleground queue.
|
||||
ERR_IN_NON_RANDOM_BG = 16, // Can't queue for Random Battleground while in another Battleground queue.
|
||||
ERR_BG_DEVELOPER_ONLY = 17,
|
||||
ERR_BATTLEGROUND_INVITATION_DECLINED = 18,
|
||||
ERR_MEETING_STONE_NOT_FOUND = 19,
|
||||
ERR_WARGAME_REQUEST_FAILURE = 20,
|
||||
ERR_BATTLEFIELD_TEAM_PARTY_SIZE = 22,
|
||||
ERR_NOT_ON_TOURNAMENT_REALM = 23,
|
||||
ERR_BATTLEGROUND_PLAYERS_FROM_DIFFERENT_REALMS = 24,
|
||||
ERR_REMOVE_FROM_PVP_QUEUE_GRANT_LEVEL = 33,
|
||||
ERR_REMOVE_FROM_PVP_QUEUE_FACTION_CHANGE = 34,
|
||||
ERR_BATTLEGROUND_JOIN_FAILED = 35,
|
||||
ERR_BATTLEGROUND_DUPE_QUEUE = 43
|
||||
};
|
||||
|
||||
struct BattlegroundScore
|
||||
@@ -341,8 +351,8 @@ class Battleground
|
||||
uint32 GetInstanceID() const { return m_InstanceID; }
|
||||
BattlegroundStatus GetStatus() const { return m_Status; }
|
||||
uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
|
||||
uint32 GetStartTime() const { return m_StartTime; }
|
||||
uint32 GetEndTime() const { return m_EndTime; }
|
||||
uint32 GetElapsedTime() const { return m_StartTime; }
|
||||
uint32 GetRemainingTime() const { return m_EndTime; }
|
||||
uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
|
||||
uint32 GetMaxPlayers() const { return m_MaxPlayers; }
|
||||
uint32 GetMinPlayers() const { return m_MinPlayers; }
|
||||
@@ -361,6 +371,7 @@ class Battleground
|
||||
bool IsRandom() const { return m_IsRandom; }
|
||||
|
||||
// Set methods:
|
||||
void SetGuid(uint64 newGuid) { m_Guid = newGuid; }
|
||||
void SetName(char const* Name) { m_Name = Name; }
|
||||
void SetTypeID(BattlegroundTypeId TypeID) { m_TypeID = TypeID; }
|
||||
void SetRandomTypeID(BattlegroundTypeId TypeID) { m_RandomTypeID = TypeID; }
|
||||
@@ -369,8 +380,8 @@ class Battleground
|
||||
void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
|
||||
void SetStatus(BattlegroundStatus Status) { m_Status = Status; }
|
||||
void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
|
||||
void SetStartTime(uint32 Time) { m_StartTime = Time; }
|
||||
void SetEndTime(uint32 Time) { m_EndTime = Time; }
|
||||
void SetElapsedTime(uint32 Time) { m_StartTime = Time; }
|
||||
void SetRemainingTime(uint32 Time) { m_EndTime = Time; }
|
||||
void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
|
||||
void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; }
|
||||
void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; }
|
||||
|
||||
@@ -163,7 +163,7 @@ void BattlegroundMgr::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 /*arenatype*/, uint8 /*uiFrame*/)
|
||||
void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/)
|
||||
{
|
||||
if (!bg)
|
||||
StatusID = STATUS_NONE;
|
||||
@@ -175,73 +175,30 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
{
|
||||
case STATUS_NONE:
|
||||
{
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED);
|
||||
ObjectGuid unkGuid1 = 0; // Not seen packets
|
||||
ObjectGuid unkGuid2 = 0; // Not seen packets
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS);
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED);
|
||||
data->WriteBit(guidBytes1[0]);
|
||||
data->WriteBit(guidBytes1[4]);
|
||||
data->WriteBit(guidBytes1[7]);
|
||||
data->WriteBit(guidBytes1[1]);
|
||||
data->WriteBit(guidBytes1[6]);
|
||||
data->WriteBit(guidBytes1[3]);
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
|
||||
data->WriteBit(guidBytes2[3]);
|
||||
data->WriteBit(unkGuid2[3]);
|
||||
data->WriteBit(unkGuid1[3]);
|
||||
data->WriteBit(unkGuid2[0]);
|
||||
data->WriteBit(guidBytes2[6]);
|
||||
data->WriteBit(unkGuid1[5]);
|
||||
data->WriteBit(unkGuid1[6]);
|
||||
data->WriteBit(unkGuid1[4]);
|
||||
data->FlushBits();
|
||||
|
||||
data->WriteBit(unkGuid1[2]);
|
||||
data->WriteBit(unkGuid2[1]);
|
||||
data->WriteBit(guidBytes2[1]);
|
||||
data->WriteBit(unkGuid2[5]);
|
||||
data->WriteBit(unkGuid2[6]);
|
||||
data->WriteBit(unkGuid1[1]);
|
||||
data->WriteBit(guidBytes2[7]);
|
||||
data->WriteBit(unkGuid2[4]);
|
||||
|
||||
data->WriteBit(guidBytes2[2]);
|
||||
data->WriteBit(guidBytes2[5]);
|
||||
data->WriteBit(unkGuid2[7]);
|
||||
data->WriteBit(guidBytes2[4]);
|
||||
data->WriteBit(guidBytes2[0]);
|
||||
data->WriteBit(unkGuid1[0]);
|
||||
data->WriteBit(unkGuid2[2]);
|
||||
data->WriteBit(unkGuid1[7]);
|
||||
|
||||
data->WriteByteSeq(guidBytes2[1]);
|
||||
|
||||
*data << uint32(bg->GetStatus());
|
||||
*data << uint32(QueueSlot);
|
||||
|
||||
data->WriteByteSeq(unkGuid1[6]);
|
||||
data->WriteByteSeq(unkGuid1[3]);
|
||||
data->WriteByteSeq(unkGuid1[7]);
|
||||
data->WriteByteSeq(unkGuid1[4]);
|
||||
data->WriteByteSeq(guidBytes2[0]);
|
||||
data->WriteByteSeq(unkGuid1[5]);
|
||||
data->WriteByteSeq(guidBytes2[7]);
|
||||
data->WriteByteSeq(guidBytes2[6]);
|
||||
data->WriteByteSeq(guidBytes2[2]);
|
||||
data->WriteByteSeq(unkGuid2[6]);
|
||||
data->WriteByteSeq(unkGuid2[3]);
|
||||
data->WriteByteSeq(unkGuid1[1]);
|
||||
data->WriteByteSeq(guidBytes2[3]);
|
||||
data->WriteByteSeq(unkGuid2[0]);
|
||||
data->WriteByteSeq(unkGuid2[1]);
|
||||
data->WriteByteSeq(unkGuid2[4]);
|
||||
data->WriteByteSeq(unkGuid1[0]);
|
||||
data->WriteByteSeq(guidBytes2[5]);
|
||||
data->WriteByteSeq(unkGuid2[7]);
|
||||
data->WriteByteSeq(guidBytes2[4]);
|
||||
data->WriteByteSeq(unkGuid1[2]);
|
||||
|
||||
*data << uint32(bg->GetTypeID());
|
||||
|
||||
data->WriteByteSeq(unkGuid2[2]);
|
||||
|
||||
*data << uint32(time(NULL));
|
||||
|
||||
data->WriteByteSeq(unkGuid2[5]);
|
||||
data->WriteByteSeq(guidBytes1[5]);
|
||||
data->WriteByteSeq(guidBytes1[6]);
|
||||
data->WriteByteSeq(guidBytes1[7]);
|
||||
data->WriteByteSeq(guidBytes1[2]);
|
||||
*data << uint32(1); // unk, always 1
|
||||
data->WriteByteSeq(guidBytes1[3]);
|
||||
data->WriteByteSeq(guidBytes1[1]);
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
*data << uint32(Time1); // Join Time
|
||||
data->WriteByteSeq(guidBytes1[0]);
|
||||
data->WriteByteSeq(guidBytes1[4]);
|
||||
break;
|
||||
}
|
||||
case STATUS_WAIT_QUEUE:
|
||||
@@ -252,7 +209,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
data->WriteBit(guidBytes1[0]);
|
||||
data->WriteBit(guidBytes2[3]);
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
data->WriteBit(0); // unk
|
||||
data->WriteBit(1); // Eligible In Queue
|
||||
data->WriteBit(0); // Join Failed
|
||||
data->WriteBit(guidBytes2[2]);
|
||||
data->WriteBit(guidBytes1[1]);
|
||||
@@ -265,53 +222,52 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
data->WriteBit(guidBytes2[5]);
|
||||
data->WriteBit(guidBytes1[4]);
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(0); // unk
|
||||
data->WriteBit(0); // unk
|
||||
data->WriteBit(bg->isRated()); // Is Rated
|
||||
data->WriteBit(0); // Waiting On Other Activity
|
||||
data->WriteBit(guidBytes2[1]);
|
||||
|
||||
data->FlushBits();
|
||||
|
||||
data->WriteByteSeq(guidBytes1[0]);
|
||||
*data << uint32(0); // unk
|
||||
*data << uint32(1); // unk, always 1
|
||||
data->WriteByteSeq(guidBytes2[5]);
|
||||
data->WriteByteSeq(guidBytes1[3]);
|
||||
*data << uint32(0); // unk
|
||||
*data << uint32(Time1); // Estimated Wait Time
|
||||
data->WriteByteSeq(guidBytes2[7]);
|
||||
data->WriteByteSeq(guidBytes2[1]);
|
||||
data->WriteByteSeq(guidBytes2[2]);
|
||||
*data << uint8(0); // unk
|
||||
data->WriteByteSeq(guidBytes2[4]);
|
||||
data->WriteByteSeq(guidBytes1[2]);
|
||||
*data << uint8(0); // unk
|
||||
*data << uint8(0); // Player count in rated mode
|
||||
data->WriteByteSeq(guidBytes2[6]);
|
||||
data->WriteByteSeq(guidBytes1[7]);
|
||||
data->WriteByteSeq(guidBytes2[3]);
|
||||
data->WriteByteSeq(guidBytes1[6]);
|
||||
data->WriteByteSeq(guidBytes2[0]);
|
||||
*data << uint32(bg->GetStartTime()); // Time
|
||||
*data << uint32(0); // unk
|
||||
*data << uint32(Time2); // Join Time
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
*data << uint8(bg->GetMinLevel()); // Min Level
|
||||
*data << uint32(0); // unk
|
||||
*data << uint32(GetMSTimeDiffToNow(Time2)); // Time since joined
|
||||
data->WriteByteSeq(guidBytes1[1]);
|
||||
data->WriteByteSeq(guidBytes1[5]);
|
||||
*data << uint32(0); // unk
|
||||
*data << uint32(bg->GetClientInstanceID()); // Client Instance ID
|
||||
data->WriteByteSeq(guidBytes1[4]);
|
||||
|
||||
break;
|
||||
}
|
||||
case STATUS_WAIT_JOIN:
|
||||
{
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION, 44);
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION);
|
||||
|
||||
*data << uint32(bg->GetClientInstanceID()); // Client Instance ID
|
||||
*data << uint32(Time1); // Time until closed
|
||||
*data << uint8(0); // unk
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
*data << uint32(Time2); // Time
|
||||
*data << uint32(Time2); // Join Time
|
||||
*data << uint8(bg->GetMinLevel()); // Min Level
|
||||
*data << uint32(bg->GetStatus()); // Status
|
||||
*data << uint32(1); // unk, always 1
|
||||
*data << uint32(bg->GetMapId()); // Map Id
|
||||
*data << uint8(0); // unk
|
||||
*data << uint8(0); // Player count in rated mode
|
||||
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
@@ -353,20 +309,20 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
}
|
||||
case STATUS_IN_PROGRESS:
|
||||
{
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE, 49);
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE);
|
||||
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
data->WriteBit(guidBytes1[7]);
|
||||
data->WriteBit(guidBytes2[7]);
|
||||
data->WriteBit(guidBytes2[1]);
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(0); // Unk
|
||||
data->WriteBit(bg->GetPlayerTeam(guidBytes1) == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance )
|
||||
data->WriteBit(guidBytes2[0]);
|
||||
data->WriteBit(guidBytes1[1]);
|
||||
data->WriteBit(guidBytes2[3]);
|
||||
data->WriteBit(guidBytes1[6]);
|
||||
data->WriteBit(guidBytes2[5]);
|
||||
data->WriteBit(0); // Unk Bit 64
|
||||
data->WriteBit(0); // unk, Bit 64
|
||||
data->WriteBit(guidBytes1[4]);
|
||||
data->WriteBit(guidBytes2[6]);
|
||||
data->WriteBit(guidBytes2[4]);
|
||||
@@ -385,22 +341,21 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
data->WriteByteSeq(guidBytes2[7]);
|
||||
data->WriteByteSeq(guidBytes1[6]);
|
||||
|
||||
*data << uint32(Time2); // Time
|
||||
*data << uint8(bg->GetPlayersCountByTeam(bg->GetPlayerTeam(pPlayer->GetGUID()))); // Teamsize
|
||||
*data << uint32(Time1); // Join Time
|
||||
*data << uint8(arenatype); // Teamsize (0 if not arena)
|
||||
|
||||
data->WriteByteSeq(guidBytes1[4]);
|
||||
data->WriteByteSeq(guidBytes1[1]);
|
||||
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
*data << uint8(bg->GetMaxLevel()); // Max Level
|
||||
*data << uint32(bg->GetStatus()); // Status
|
||||
*data << uint8(0); // Player count in rated mode
|
||||
*data << uint32(1); // unk, always 1
|
||||
*data << uint32(bg->GetMapId()); // Map Id
|
||||
*data << uint8(bg->GetMinLevel()); // Min Level
|
||||
*data << uint32(Time1); // Time until closed
|
||||
*data << uint32(Time2); // Elapsed Time
|
||||
|
||||
data->WriteByteSeq(guidBytes1[2]);
|
||||
|
||||
*data << uint32(bg->GetStartTime()); // Time since started
|
||||
*data << uint32(getMSTimeDiff(bg->GetRemainingTime(), Time2)); // Remaining Time
|
||||
|
||||
data->WriteByteSeq(guidBytes1[0]);
|
||||
data->WriteByteSeq(guidBytes1[3]);
|
||||
@@ -413,61 +368,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
break;
|
||||
}
|
||||
case STATUS_WAIT_LEAVE:
|
||||
{
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS, 48);
|
||||
|
||||
*data << uint8(0); // unk
|
||||
*data << uint32(bg->GetStatus()); // Status
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
*data << uint32(Time1); // Time until closed
|
||||
*data << uint32(0); // unk
|
||||
*data << uint8(0); // unk
|
||||
*data << uint8(0); // unk
|
||||
*data << uint8(bg->GetMinLevel()); // Min Level
|
||||
*data << uint8(0); // unk
|
||||
*data << uint8(0); // unk
|
||||
*data << uint32(bg->GetMapId()); // Map Id
|
||||
*data << uint32(Time2); // Time
|
||||
*data << uint8(0); // unk
|
||||
|
||||
data->WriteBit(guidBytes2[0]);
|
||||
data->WriteBit(guidBytes2[1]);
|
||||
data->WriteBit(guidBytes2[7]);
|
||||
data->WriteBit(guidBytes1[7]);
|
||||
data->WriteBit(guidBytes1[0]);
|
||||
data->WriteBit(guidBytes2[4]);
|
||||
data->WriteBit(guidBytes1[6]);
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
data->WriteBit(guidBytes1[3]);
|
||||
data->WriteBit(guidBytes2[3]);
|
||||
data->WriteBit(guidBytes1[4]);
|
||||
data->WriteBit(guidBytes2[5]);
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(guidBytes2[2]);
|
||||
data->WriteBit(bg->isRated()); // Is Rated
|
||||
data->WriteBit(guidBytes1[1]);
|
||||
data->WriteBit(guidBytes2[6]);
|
||||
|
||||
data->FlushBits();
|
||||
|
||||
data->WriteByteSeq(guidBytes1[0]);
|
||||
data->WriteByteSeq(guidBytes2[4]);
|
||||
data->WriteByteSeq(guidBytes1[3]);
|
||||
data->WriteByteSeq(guidBytes2[1]);
|
||||
data->WriteByteSeq(guidBytes2[0]);
|
||||
data->WriteByteSeq(guidBytes2[2]);
|
||||
data->WriteByteSeq(guidBytes1[2]);
|
||||
data->WriteByteSeq(guidBytes2[7]);
|
||||
data->WriteByteSeq(guidBytes1[1]);
|
||||
data->WriteByteSeq(guidBytes1[6]);
|
||||
data->WriteByteSeq(guidBytes2[6]);
|
||||
data->WriteByteSeq(guidBytes2[5]);
|
||||
data->WriteByteSeq(guidBytes1[5]);
|
||||
data->WriteByteSeq(guidBytes1[4]);
|
||||
data->WriteByteSeq(guidBytes1[7]);
|
||||
data->WriteByteSeq(guidBytes2[3]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,13 +606,75 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
|
||||
*data << uint8(0); // unk
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* /*bg*/, Player* /*player*/, GroupJoinBattlegroundResult /*result*/)
|
||||
void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result)
|
||||
{
|
||||
//ObjectGuid guidBytes1 = player->GetGUID();
|
||||
//ObjectGuid guidBytes2 = bg->GetGUID();
|
||||
ObjectGuid guidBytes1 = pPlayer ? pPlayer->GetGUID() : 0; // player who caused the error
|
||||
ObjectGuid guidBytes2 = bg->GetGUID();
|
||||
ObjectGuid unkGuid3 = 0;
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED);
|
||||
|
||||
data->WriteBit(guidBytes2[3]);
|
||||
data->WriteBit(unkGuid3[3]);
|
||||
data->WriteBit(guidBytes1[3]);
|
||||
data->WriteBit(unkGuid3[0]);
|
||||
data->WriteBit(guidBytes2[6]);
|
||||
data->WriteBit(guidBytes1[5]);
|
||||
data->WriteBit(guidBytes1[6]);
|
||||
data->WriteBit(guidBytes1[4]);
|
||||
|
||||
data->WriteBit(guidBytes1[2]);
|
||||
data->WriteBit(unkGuid3[1]);
|
||||
data->WriteBit(guidBytes2[1]);
|
||||
data->WriteBit(unkGuid3[5]);
|
||||
data->WriteBit(unkGuid3[6]);
|
||||
data->WriteBit(guidBytes1[1]);
|
||||
data->WriteBit(guidBytes2[7]);
|
||||
data->WriteBit(unkGuid3[4]);
|
||||
|
||||
data->WriteBit(guidBytes2[2]);
|
||||
data->WriteBit(guidBytes2[5]);
|
||||
data->WriteBit(unkGuid3[7]);
|
||||
data->WriteBit(guidBytes2[4]);
|
||||
data->WriteBit(guidBytes2[0]);
|
||||
data->WriteBit(guidBytes1[0]);
|
||||
data->WriteBit(unkGuid3[2]);
|
||||
data->WriteBit(guidBytes1[7]);
|
||||
|
||||
data->WriteByteSeq(guidBytes2[1]);
|
||||
|
||||
*data << uint32(bg->GetStatus()); // Status
|
||||
*data << uint32(QueueSlot); // Queue slot
|
||||
|
||||
data->WriteByteSeq(guidBytes1[6]);
|
||||
data->WriteByteSeq(guidBytes1[3]);
|
||||
data->WriteByteSeq(guidBytes1[7]);
|
||||
data->WriteByteSeq(guidBytes1[4]);
|
||||
data->WriteByteSeq(guidBytes2[0]);
|
||||
data->WriteByteSeq(guidBytes1[5]);
|
||||
data->WriteByteSeq(guidBytes2[7]);
|
||||
data->WriteByteSeq(guidBytes2[6]);
|
||||
data->WriteByteSeq(guidBytes2[2]);
|
||||
data->WriteByteSeq(unkGuid3[6]);
|
||||
data->WriteByteSeq(unkGuid3[3]);
|
||||
data->WriteByteSeq(guidBytes1[1]);
|
||||
data->WriteByteSeq(guidBytes2[3]);
|
||||
data->WriteByteSeq(unkGuid3[0]);
|
||||
data->WriteByteSeq(unkGuid3[1]);
|
||||
data->WriteByteSeq(unkGuid3[4]);
|
||||
data->WriteByteSeq(guidBytes1[0]);
|
||||
data->WriteByteSeq(guidBytes2[5]);
|
||||
data->WriteByteSeq(unkGuid3[7]);
|
||||
data->WriteByteSeq(guidBytes2[4]);
|
||||
data->WriteByteSeq(guidBytes1[2]);
|
||||
|
||||
*data << uint32(result); // Result
|
||||
|
||||
data->WriteByteSeq(unkGuid3[2]);
|
||||
|
||||
*data << uint32(time(NULL)); // Time
|
||||
|
||||
data->WriteByteSeq(unkGuid3[5]);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value)
|
||||
@@ -955,6 +918,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
|
||||
bg->SetRandomTypeID(bgTypeId);
|
||||
bg->SetRated(isRated);
|
||||
bg->SetRandom(isRandom);
|
||||
bg->SetGuid(MAKE_NEW_GUID(bgTypeId, 0, HIGHGUID_TYPE_BATTLEGROUND));
|
||||
|
||||
return bg;
|
||||
}
|
||||
@@ -1030,6 +994,7 @@ bool BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data)
|
||||
bg->SetStartMaxDist(data.StartMaxDist);
|
||||
bg->SetLevelRange(data.LevelMin, data.LevelMax);
|
||||
bg->SetScriptId(data.scriptId);
|
||||
bg->SetGuid(MAKE_NEW_GUID(data.bgTypeId, 0, HIGHGUID_TYPE_BATTLEGROUND));
|
||||
|
||||
AddBattleground(bg);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class BattlegroundMgr
|
||||
void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid);
|
||||
void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid);
|
||||
void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId);
|
||||
void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* bg, Player* player, GroupJoinBattlegroundResult result);
|
||||
void BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result);
|
||||
void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value);
|
||||
void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg);
|
||||
void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType, uint8 uiFrame = 1);
|
||||
|
||||
@@ -394,7 +394,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to
|
||||
// queue->removeplayer, it causes bugs
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, 0, 0, 0);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, group->JoinTime, 0, 0);
|
||||
plr2->GetSession()->SendPacket(&data);
|
||||
}
|
||||
// then actually delete, this may delete the group as well!
|
||||
@@ -479,7 +479,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg,
|
||||
player->GetName(), player->GetGUIDLow(), bg->GetInstanceID(), queueSlot, bg->GetTypeID());
|
||||
|
||||
// send status packet
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, player->GetBattlegroundQueueJoinTime(bgTypeId), ginfo->ArenaType);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
return true;
|
||||
@@ -1001,7 +1001,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
{
|
||||
WorldPacket data;
|
||||
//we must send remaining time in queue
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, player->GetBattlegroundQueueJoinTime(m_BgTypeId), m_ArenaType);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
@@ -1049,7 +1049,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId());
|
||||
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_NONE, 0, 0, 0);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_NONE, player->GetBattlegroundQueueJoinTime(m_BgTypeId), 0, 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
if (GetStartTime() >= 27*MINUTE*IN_MILLISECONDS)
|
||||
if (GetElapsedTime() >= 27*MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
if (GetTeamScore(TEAM_ALLIANCE) == 0)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
|
||||
EndBattleground(ALLIANCE);
|
||||
}
|
||||
// first update needed after 1 minute of game already in progress
|
||||
else if (GetStartTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS)
|
||||
else if (GetElapsedTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS)
|
||||
{
|
||||
++_minutesElapsed;
|
||||
UpdateWorldState(BG_WS_STATE_TIMER, 25 - _minutesElapsed);
|
||||
|
||||
@@ -1038,12 +1038,14 @@ class Player;
|
||||
struct BGData
|
||||
{
|
||||
BGData() : bgInstanceID(0), bgTypeID(BATTLEGROUND_TYPE_NONE), bgAfkReportedCount(0), bgAfkReportedTimer(0),
|
||||
bgTeam(0), mountSpell(0) { ClearTaxiPath(); }
|
||||
bgTeam(0), mountSpell(0) { bgQueuesJoinedTime.clear(); ClearTaxiPath(); }
|
||||
|
||||
uint32 bgInstanceID; ///< This variable is set to bg->m_InstanceID,
|
||||
/// when player is teleported to BG - (it is battleground's GUID)
|
||||
BattlegroundTypeId bgTypeID;
|
||||
|
||||
std::map<uint32, uint32> bgQueuesJoinedTime;
|
||||
|
||||
std::set<uint32> bgAfkReporter;
|
||||
uint8 bgAfkReportedCount;
|
||||
time_t bgAfkReportedTimer;
|
||||
@@ -2320,6 +2322,16 @@ class Player : public Unit, public GridObject<Player>
|
||||
BattlegroundTypeId GetBattlegroundTypeId() const { return m_bgData.bgTypeID; }
|
||||
Battleground* GetBattleground() const;
|
||||
|
||||
uint32 GetBattlegroundQueueJoinTime(uint32 bgTypeId) const { return m_bgData.bgQueuesJoinedTime.find(bgTypeId)->second; }
|
||||
void AddBattlegroundQueueJoinTime(uint32 bgTypeId, uint32 joinTime)
|
||||
{
|
||||
m_bgData.bgQueuesJoinedTime[bgTypeId] = joinTime;
|
||||
}
|
||||
void RemoveBattlegroundQueueJoinTime(uint32 bgTypeId)
|
||||
{
|
||||
m_bgData.bgQueuesJoinedTime.erase(m_bgData.bgQueuesJoinedTime.find(bgTypeId)->second);
|
||||
}
|
||||
|
||||
bool InBattlegroundQueue() const
|
||||
{
|
||||
for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
|
||||
|
||||
@@ -1815,7 +1815,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
|
||||
BattlemasterListEntry const* bgEntry = sBattlemasterListStore.LookupEntry(bgOrTemplate->GetTypeID());
|
||||
if (!bgEntry)
|
||||
return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED; // shouldn't happen
|
||||
|
||||
// check for min / max count
|
||||
uint32 memberscount = GetMembersCount();
|
||||
|
||||
@@ -140,16 +140,15 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
GroupJoinBattlegroundResult err;
|
||||
GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE;
|
||||
|
||||
// check queue conditions
|
||||
if (!asGroup)
|
||||
{
|
||||
if (GetPlayer()->isUsingLfg())
|
||||
{
|
||||
// player is using dungeon finder or raid finder
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||
GetPlayer()->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -158,7 +157,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
if (!_player->CanJoinToBattleground())
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -167,7 +166,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
{
|
||||
// player is already in random queue
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_RANDOM_BG);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_RANDOM_BG);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -176,7 +175,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
{
|
||||
// player is already in queue, can't start random queue
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_NON_RANDOM_BG);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_NON_RANDOM_BG);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -190,33 +189,37 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
if (!_player->HasFreeBattlegroundQueueId())
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_BATTLEGROUND_TOO_MANY_QUEUES);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_BATTLEGROUND_TOO_MANY_QUEUES);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
|
||||
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
// already checked if queueSlot is valid, now just get it
|
||||
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
|
||||
// add joined time data
|
||||
_player->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime);
|
||||
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, ginfo->ArenaType);
|
||||
SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",
|
||||
bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
grp = _player->GetGroup();
|
||||
// no group found, error
|
||||
|
||||
if (!grp)
|
||||
return;
|
||||
|
||||
if (grp->GetLeaderGUID() != _player->GetGUID())
|
||||
return;
|
||||
|
||||
err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0);
|
||||
isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam());
|
||||
|
||||
@@ -224,7 +227,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
GroupQueueInfo* ginfo = NULL;
|
||||
uint32 avgTime = 0;
|
||||
|
||||
if (err > 0)
|
||||
if (!err)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: the following players are joining as group:");
|
||||
ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
|
||||
@@ -237,11 +240,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
if (!member)
|
||||
continue; // this should never happen
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if (err <= 0)
|
||||
if (err)
|
||||
{
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err);
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
continue;
|
||||
}
|
||||
@@ -249,16 +251,19 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
|
||||
// add to queue
|
||||
uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
||||
// send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err);
|
||||
// add joined time data
|
||||
member->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime);
|
||||
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, ginfo->ArenaType);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName());
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: group end");
|
||||
|
||||
}
|
||||
|
||||
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
@@ -396,14 +401,14 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message");
|
||||
|
||||
uint32 time;
|
||||
uint32 type; // guessed
|
||||
uint32 bgTypeId_; // type id from dbc
|
||||
uint8 action; // enter battle 0x1, leave queue 0x0
|
||||
uint32 queueSlot;
|
||||
uint32 unk;
|
||||
uint8 action; // enter battle 0x1, leave queue 0x0
|
||||
ObjectGuid guid;
|
||||
|
||||
recvData >> time;
|
||||
recvData >> type;
|
||||
recvData >> bgTypeId_;
|
||||
recvData >> queueSlot;
|
||||
recvData >> unk;
|
||||
|
||||
guid[0] = recvData.ReadBit();
|
||||
guid[1] = recvData.ReadBit();
|
||||
@@ -425,22 +430,22 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
recvData.ReadByteSeq(guid[6]);
|
||||
recvData.ReadByteSeq(guid[4]);
|
||||
|
||||
if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: invalid bgtype (%u) with player (Name: %s, GUID: %u) received.", bgTypeId_, _player->GetName(), _player->GetGUIDLow());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->InBattlegroundQueue())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (Name: %s, GUID: %u), he is not in bg_queue.", _player->GetName(), _player->GetGUIDLow());
|
||||
return;
|
||||
}
|
||||
|
||||
//get GroupQueueInfo from BattlegroundQueue
|
||||
BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_);
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, type);
|
||||
BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(queueSlot);
|
||||
if (bgQueueTypeId == BATTLEGROUND_QUEUE_NONE)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: invalid queueSlot (%u) received.", queueSlot);
|
||||
return;
|
||||
}
|
||||
|
||||
BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(bgQueueTypeId);
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
|
||||
//we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function
|
||||
GroupQueueInfo ginfo;
|
||||
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
|
||||
@@ -479,7 +484,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
{
|
||||
//send bg command result to show nice message
|
||||
WorldPacket data2;
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data2, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
_player->GetSession()->SendPacket(&data2);
|
||||
action = 0;
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
|
||||
@@ -492,7 +497,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
action = 0;
|
||||
}
|
||||
}
|
||||
uint32 queueSlot = _player->GetBattlegroundQueueIndex(bgQueueTypeId);
|
||||
|
||||
WorldPacket data;
|
||||
switch (action)
|
||||
{
|
||||
@@ -516,7 +521,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
_player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), bg->GetArenaType());
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
// remove battleground queue status from BGmgr
|
||||
bgQueue.RemovePlayer(_player->GetGUID(), false);
|
||||
@@ -551,7 +556,8 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
}
|
||||
}
|
||||
_player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, 0, 0, 0);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, _player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0);
|
||||
|
||||
bgQueue.RemovePlayer(_player->GetGUID(), true);
|
||||
// player left queue, we should update it - do not update Arena Queue
|
||||
if (!ginfo.ArenaType)
|
||||
@@ -581,7 +587,7 @@ void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
// empty opcode
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status");
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_STATUS Message");
|
||||
|
||||
WorldPacket data;
|
||||
// we must update all queues here
|
||||
@@ -600,13 +606,14 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
|
||||
//so i must use bg pointer to get that information
|
||||
if (bg && bg->GetArenaType() == arenaType)
|
||||
{
|
||||
// this line is checked, i only don't know if GetStartTime is changing itself after bg end!
|
||||
// this line is checked, i only don't know if GetElapsedTime() is changing itself after bg end!
|
||||
// send status in Battleground
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), arenaType);
|
||||
SendPacket(&data);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//we are sending update to player about queue - he can be invited there!
|
||||
//get GroupQueueInfo for queue status
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
@@ -618,9 +625,9 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
|
||||
bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
|
||||
if (!bg)
|
||||
continue;
|
||||
uint32 remainingTime = getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime);
|
||||
|
||||
// send status invited to Battleground
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_JOIN, getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime), _player->GetBattlegroundQueueJoinTime(bgTypeId), arenaType);
|
||||
SendPacket(&data);
|
||||
}
|
||||
else
|
||||
@@ -636,7 +643,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
|
||||
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, bracketEntry->GetBracketId());
|
||||
// send status in Battleground Queue
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_QUEUE, avgTime, _player->GetBattlegroundQueueJoinTime(bgTypeId), arenaType);
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
@@ -705,7 +712,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
GroupJoinBattlegroundResult err = ERR_GROUP_JOIN_BATTLEGROUND_FAIL;
|
||||
GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE;
|
||||
|
||||
if (!asGroup)
|
||||
{
|
||||
@@ -753,8 +760,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
if (asGroup)
|
||||
{
|
||||
uint32 avgTime = 0;
|
||||
GroupQueueInfo* ginfo;
|
||||
|
||||
if (err > 0)
|
||||
if (!err)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena join as group start");
|
||||
if (isRated)
|
||||
@@ -765,7 +773,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
else
|
||||
bg->SetRated(false);
|
||||
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId);
|
||||
ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId);
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
@@ -775,11 +783,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
if (!member)
|
||||
continue;
|
||||
|
||||
WorldPacket data;
|
||||
|
||||
if (err <= 0)
|
||||
if (err)
|
||||
{
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err);
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
continue;
|
||||
}
|
||||
@@ -787,11 +794,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
// add to queue
|
||||
uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
||||
// send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err);
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName());
|
||||
}
|
||||
}
|
||||
@@ -801,10 +807,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype);
|
||||
SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName());
|
||||
}
|
||||
sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
|
||||
Reference in New Issue
Block a user