Core/Battlegrounds: Change Battleground* argument to BattlegroundQueueTypeId
Port From (https://github.com/TrinityCore/TrinityCore/commit/20d70abb2c82798dd4a4338dcf3d80a61312d1fb)
This commit is contained in:
@@ -175,14 +175,14 @@ namespace Game.BattleGrounds
|
|||||||
battlefieldStatus.WaitTime = Time.GetMSTimeDiffToNow(joinTime);
|
battlefieldStatus.WaitTime = Time.GetMSTimeDiffToNow(joinTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildBattlegroundStatusFailed(out BattlefieldStatusFailed battlefieldStatus, Battleground bg, Player pPlayer, uint ticketId, GroupJoinBattlegroundResult result, ObjectGuid errorGuid = default)
|
public void BuildBattlegroundStatusFailed(out BattlefieldStatusFailed battlefieldStatus, BattlegroundQueueTypeId queueId, Player pPlayer, uint ticketId, GroupJoinBattlegroundResult result, ObjectGuid errorGuid = default)
|
||||||
{
|
{
|
||||||
battlefieldStatus = new BattlefieldStatusFailed();
|
battlefieldStatus = new BattlefieldStatusFailed();
|
||||||
battlefieldStatus.Ticket.RequesterGuid = pPlayer.GetGUID();
|
battlefieldStatus.Ticket.RequesterGuid = pPlayer.GetGUID();
|
||||||
battlefieldStatus.Ticket.Id = ticketId;
|
battlefieldStatus.Ticket.Id = ticketId;
|
||||||
battlefieldStatus.Ticket.Type = RideType.Battlegrounds;
|
battlefieldStatus.Ticket.Type = RideType.Battlegrounds;
|
||||||
battlefieldStatus.Ticket.Time = (int)pPlayer.GetBattlegroundQueueJoinTime(bg.GetQueueId());
|
battlefieldStatus.Ticket.Time = (int)pPlayer.GetBattlegroundQueueJoinTime(queueId);
|
||||||
battlefieldStatus.QueueID = bg.GetQueueId().GetPacked();
|
battlefieldStatus.QueueID = queueId.GetPacked();
|
||||||
battlefieldStatus.Reason = (int)result;
|
battlefieldStatus.Reason = (int)result;
|
||||||
if (!errorGuid.IsEmpty() && (result == GroupJoinBattlegroundResult.NotInBattleground || result == GroupJoinBattlegroundResult.JoinTimedOut))
|
if (!errorGuid.IsEmpty() && (result == GroupJoinBattlegroundResult.NotInBattleground || result == GroupJoinBattlegroundResult.JoinTimedOut))
|
||||||
battlefieldStatus.ClientID = errorGuid;
|
battlefieldStatus.ClientID = errorGuid;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
if (GetPlayer().IsUsingLfg())
|
if (GetPlayer().IsUsingLfg())
|
||||||
{
|
{
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, GroupJoinBattlegroundResult.LfgCantUseBattleground);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bgQueueTypeId, GetPlayer(), 0, GroupJoinBattlegroundResult.LfgCantUseBattleground);
|
||||||
SendPacket(battlefieldStatusFailed);
|
SendPacket(battlefieldStatusFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ namespace Game
|
|||||||
// check Deserter debuff
|
// check Deserter debuff
|
||||||
if (!GetPlayer().CanJoinToBattleground(bg))
|
if (!GetPlayer().CanJoinToBattleground(bg))
|
||||||
{
|
{
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, GroupJoinBattlegroundResult.Deserters);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bgQueueTypeId, GetPlayer(), 0, GroupJoinBattlegroundResult.Deserters);
|
||||||
SendPacket(battlefieldStatusFailed);
|
SendPacket(battlefieldStatusFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ namespace Game
|
|||||||
if (bgTypeId != BattlegroundTypeId.RB && bgTypeId != BattlegroundTypeId.RandomEpic && isInRandomBgQueue)
|
if (bgTypeId != BattlegroundTypeId.RB && bgTypeId != BattlegroundTypeId.RandomEpic && isInRandomBgQueue)
|
||||||
{
|
{
|
||||||
// player is already in random queue
|
// player is already in random queue
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, GroupJoinBattlegroundResult.InRandomBg);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bgQueueTypeId, GetPlayer(), 0, GroupJoinBattlegroundResult.InRandomBg);
|
||||||
SendPacket(battlefieldStatusFailed);
|
SendPacket(battlefieldStatusFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ namespace Game
|
|||||||
if (_player.InBattlegroundQueue() && !isInRandomBgQueue && (bgTypeId == BattlegroundTypeId.RB || bgTypeId == BattlegroundTypeId.RandomEpic))
|
if (_player.InBattlegroundQueue() && !isInRandomBgQueue && (bgTypeId == BattlegroundTypeId.RB || bgTypeId == BattlegroundTypeId.RandomEpic))
|
||||||
{
|
{
|
||||||
// player is already in queue, can't start random queue
|
// player is already in queue, can't start random queue
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, GroupJoinBattlegroundResult.InNonRandomBg);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bgQueueTypeId, GetPlayer(), 0, GroupJoinBattlegroundResult.InNonRandomBg);
|
||||||
SendPacket(battlefieldStatusFailed);
|
SendPacket(battlefieldStatusFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ namespace Game
|
|||||||
// check if has free queue slots
|
// check if has free queue slots
|
||||||
if (!GetPlayer().HasFreeBattlegroundQueueId())
|
if (!GetPlayer().HasFreeBattlegroundQueueId())
|
||||||
{
|
{
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, GroupJoinBattlegroundResult.TooManyQueues);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bgQueueTypeId, GetPlayer(), 0, GroupJoinBattlegroundResult.TooManyQueues);
|
||||||
SendPacket(battlefieldStatusFailed);
|
SendPacket(battlefieldStatusFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ namespace Game
|
|||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
BattlefieldStatusFailed battlefieldStatus;
|
BattlefieldStatusFailed battlefieldStatus;
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bg, GetPlayer(), 0, err, errorGuid);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bgQueueTypeId, GetPlayer(), 0, err, errorGuid);
|
||||||
member.SendPacket(battlefieldStatus);
|
member.SendPacket(battlefieldStatus);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
// send bg command result to show nice message
|
// send bg command result to show nice message
|
||||||
BattlefieldStatusFailed battlefieldStatus;
|
BattlefieldStatusFailed battlefieldStatus;
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bg, GetPlayer(), battlefieldPort.Ticket.Id, GroupJoinBattlegroundResult.Deserters);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bgQueueTypeId, GetPlayer(), battlefieldPort.Ticket.Id, GroupJoinBattlegroundResult.Deserters);
|
||||||
SendPacket(battlefieldStatus);
|
SendPacket(battlefieldStatus);
|
||||||
battlefieldPort.AcceptedInvite = false;
|
battlefieldPort.AcceptedInvite = false;
|
||||||
Log.outDebug(LogFilter.Battleground, "Player {0} ({1}) has a deserter debuff, do not port him to Battleground!", GetPlayer().GetName(), GetPlayer().GetGUID().ToString());
|
Log.outDebug(LogFilter.Battleground, "Player {0} ({1}) has a deserter debuff, do not port him to Battleground!", GetPlayer().GetName(), GetPlayer().GetGUID().ToString());
|
||||||
@@ -546,7 +546,7 @@ namespace Game
|
|||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
BattlefieldStatusFailed battlefieldStatus;
|
BattlefieldStatusFailed battlefieldStatus;
|
||||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bg, GetPlayer(), 0, err, errorGuid);
|
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatus, bgQueueTypeId, GetPlayer(), 0, err, errorGuid);
|
||||||
member.SendPacket(battlefieldStatus);
|
member.SendPacket(battlefieldStatus);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user