mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Battlegrounds: Change Battleground* argument to BattlegroundQueueTypeId (#26806)
This commit is contained in:
@@ -238,13 +238,13 @@ void BattlegroundMgr::BuildBattlegroundStatusQueued(WorldPackets::Battleground::
|
||||
battlefieldStatus->WaitTime = GetMSTimeDiffToNow(joinTime);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildBattlegroundStatusFailed(WorldPackets::Battleground::BattlefieldStatusFailed* battlefieldStatus, Battleground* bg, Player* pPlayer, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const* errorGuid /*= nullptr*/)
|
||||
void BattlegroundMgr::BuildBattlegroundStatusFailed(WorldPackets::Battleground::BattlefieldStatusFailed* battlefieldStatus, BattlegroundQueueTypeId queueId, Player* pPlayer, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const* errorGuid /*= nullptr*/)
|
||||
{
|
||||
battlefieldStatus->Ticket.RequesterGuid = pPlayer->GetGUID();
|
||||
battlefieldStatus->Ticket.Id = ticketId;
|
||||
battlefieldStatus->Ticket.Type = WorldPackets::LFG::RideType::Battlegrounds;
|
||||
battlefieldStatus->Ticket.Time = pPlayer->GetBattlegroundQueueJoinTime(bg->GetQueueId());
|
||||
battlefieldStatus->QueueID = bg->GetQueueId().GetPacked();
|
||||
battlefieldStatus->Ticket.Time = pPlayer->GetBattlegroundQueueJoinTime(queueId);
|
||||
battlefieldStatus->QueueID = queueId.GetPacked();
|
||||
battlefieldStatus->Reason = result;
|
||||
if (errorGuid && (result == ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND || result == ERR_BATTLEGROUND_JOIN_TIMED_OUT))
|
||||
battlefieldStatus->ClientID = *errorGuid;
|
||||
|
||||
@@ -90,7 +90,7 @@ class TC_GAME_API BattlegroundMgr
|
||||
void BuildBattlegroundStatusNeedConfirmation(WorldPackets::Battleground::BattlefieldStatusNeedConfirmation* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 timeout, uint32 arenaType);
|
||||
void BuildBattlegroundStatusActive(WorldPackets::Battleground::BattlefieldStatusActive* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 arenaType);
|
||||
void BuildBattlegroundStatusQueued(WorldPackets::Battleground::BattlefieldStatusQueued* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId, uint32 avgWaitTime, uint32 arenaType, bool asGroup);
|
||||
void BuildBattlegroundStatusFailed(WorldPackets::Battleground::BattlefieldStatusFailed* battlefieldStatus, Battleground* bg, Player* pPlayer, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const* errorGuid = nullptr);
|
||||
void BuildBattlegroundStatusFailed(WorldPackets::Battleground::BattlefieldStatusFailed* battlefieldStatus, BattlegroundQueueTypeId queueId, Player* pPlayer, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const* errorGuid = nullptr);
|
||||
void SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, ObjectGuid const& guid);
|
||||
|
||||
/* Battlegrounds */
|
||||
|
||||
@@ -114,7 +114,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
if (GetPlayer()->isUsingLfg())
|
||||
{
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
return;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
if (!_player->CanJoinToBattleground(bg))
|
||||
{
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
return;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
{
|
||||
// player is already in random queue
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, ERR_IN_RANDOM_BG);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, ERR_IN_RANDOM_BG);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
{
|
||||
// player is already in queue, can't start random queue
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, ERR_IN_NON_RANDOM_BG);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, ERR_IN_NON_RANDOM_BG);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
return;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
if (!_player->HasFreeBattlegroundQueueId())
|
||||
{
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, ERR_BATTLEGROUND_TOO_MANY_QUEUES);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, ERR_BATTLEGROUND_TOO_MANY_QUEUES);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
return;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
if (err)
|
||||
{
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, err, &errorGuid);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, err, &errorGuid);
|
||||
member->SendDirectMessage(battlefieldStatus.Write());
|
||||
continue;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
|
||||
{
|
||||
//send bg command result to show nice message
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, battlefieldPort.Ticket.Id, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, battlefieldPort.Ticket.Id, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
SendPacket(battlefieldStatus.Write());
|
||||
battlefieldPort.AcceptedInvite = false;
|
||||
TC_LOG_DEBUG("bg.battleground", "Player %s (%s) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUID().ToString().c_str());
|
||||
@@ -566,7 +566,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPackets::Battleground::Battl
|
||||
if (err)
|
||||
{
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bg, _player, 0, err, &errorGuid);
|
||||
sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId, _player, 0, err, &errorGuid);
|
||||
member->SendDirectMessage(battlefieldStatus.Write());
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user