Fixes crash in BattleGrounds.

This commit is contained in:
hondacrx
2017-08-13 11:10:18 -04:00
parent b494d51816
commit 6e7c77a174
8 changed files with 16 additions and 19 deletions
+1 -1
View File
@@ -1559,7 +1559,7 @@ namespace Game.BattleGrounds
public void SendMessage2ToAll(CypherStrings entry, ChatMsg type, Player source, CypherStrings arg1 = 0, CypherStrings arg2 = 0) public void SendMessage2ToAll(CypherStrings entry, ChatMsg type, Player source, CypherStrings arg1 = 0, CypherStrings arg2 = 0)
{ {
var bg_builder = new BattlegroundChatBuilder(type, entry, source, arg1, arg2); var bg_builder = new Battleground2ChatBuilder(type, entry, source, arg1, arg2);
var bg_do = new LocalizedPacketDo(bg_builder); var bg_do = new LocalizedPacketDo(bg_builder);
BroadcastWorker(bg_do); BroadcastWorker(bg_do);
} }
@@ -125,6 +125,7 @@ namespace Game.BattleGrounds
void BuildBattlegroundStatusHeader(ref BattlefieldStatusHeader header, Battleground bg, Player player, uint ticketId, uint joinTime, ArenaTypes arenaType) void BuildBattlegroundStatusHeader(ref BattlefieldStatusHeader header, Battleground bg, Player player, uint ticketId, uint joinTime, ArenaTypes arenaType)
{ {
header.Ticket = new RideTicket();
header.Ticket.RequesterGuid = player.GetGUID(); header.Ticket.RequesterGuid = player.GetGUID();
header.Ticket.Id = ticketId; header.Ticket.Id = ticketId;
header.Ticket.Type = RideType.Battlegrounds; header.Ticket.Type = RideType.Battlegrounds;
-2
View File
@@ -567,10 +567,8 @@ namespace Game.BattleGrounds
m_PointState[i] = EotSPointState.Uncontrolled; m_PointState[i] = EotSPointState.Uncontrolled;
m_PointBarStatus[i] = EotSProgressBarConsts.ProgressBarStateMiddle; m_PointBarStatus[i] = EotSProgressBarConsts.ProgressBarStateMiddle;
m_PlayersNearPoint[i].Clear(); m_PlayersNearPoint[i].Clear();
//m_PlayersNearPoint[i].reserve(15); //tip size
} }
m_PlayersNearPoint[EotSPoints.PlayersOutOfPoints].Clear(); m_PlayersNearPoint[EotSPoints.PlayersOutOfPoints].Clear();
//m_PlayersNearPoint[EotSPoints.PlayersOutOfPoints].reserve(30);
} }
void RespawnFlag(bool send_message) void RespawnFlag(bool send_message)
+5 -1
View File
@@ -494,7 +494,11 @@ namespace Game.DungeonFinding
return; return;
} }
RideTicket ticket = new RideTicket(guid, GetQueueId(gguid), RideType.Lfg, (int)Time.UnixTime); RideTicket ticket = new RideTicket();
ticket.RequesterGuid = guid;
ticket.Id = GetQueueId(gguid);
ticket.Type = RideType.Lfg;
ticket.Time = (int)Time.UnixTime;
string debugNames = ""; string debugNames = "";
if (grp) // Begin rolecheck if (grp) // Begin rolecheck
-1
View File
@@ -5493,7 +5493,6 @@ namespace Game.Entities
SendPacket(sendSpellCharges); SendPacket(sendSpellCharges);
ActiveGlyphs activeGlyphs = new ActiveGlyphs(); ActiveGlyphs activeGlyphs = new ActiveGlyphs();
//activeGlyphs.Glyphs.reserve(GetGlyphs(GetActiveTalentGroup()).size());
foreach (uint glyphId in GetGlyphs(GetActiveTalentGroup())) foreach (uint glyphId in GetGlyphs(GetActiveTalentGroup()))
{ {
List<uint> bindableSpells = Global.DB2Mgr.GetGlyphBindableSpells(glyphId); List<uint> bindableSpells = Global.DB2Mgr.GetGlyphBindableSpells(glyphId);
+3 -3
View File
@@ -204,7 +204,7 @@ namespace Game.Network.Packets
Ticket.Write(_worldPacket); Ticket.Write(_worldPacket);
} }
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
} }
public class BattlefieldStatusNeedConfirmation : ServerPacket public class BattlefieldStatusNeedConfirmation : ServerPacket
@@ -286,7 +286,7 @@ namespace Game.Network.Packets
public ulong QueueID; public ulong QueueID;
public ObjectGuid ClientID; public ObjectGuid ClientID;
public int Reason; public int Reason;
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
} }
class BattlemasterJoin : ClientPacket class BattlemasterJoin : ClientPacket
@@ -339,7 +339,7 @@ namespace Game.Network.Packets
AcceptedInvite = _worldPacket.HasBit(); AcceptedInvite = _worldPacket.HasBit();
} }
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
public bool AcceptedInvite; public bool AcceptedInvite;
} }
+3 -11
View File
@@ -54,7 +54,7 @@ namespace Game.Network.Packets
Ticket.Read(_worldPacket); Ticket.Read(_worldPacket);
} }
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
} }
class DFProposalResponse : ClientPacket class DFProposalResponse : ClientPacket
@@ -69,7 +69,7 @@ namespace Game.Network.Packets
Accepted = _worldPacket.HasBit(); Accepted = _worldPacket.HasBit();
} }
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
public ulong InstanceID; public ulong InstanceID;
public uint ProposalID; public uint ProposalID;
public bool Accepted; public bool Accepted;
@@ -194,7 +194,7 @@ namespace Game.Network.Packets
_worldPacket.FlushBits(); _worldPacket.FlushBits();
} }
public RideTicket Ticket; public RideTicket Ticket = new RideTicket();
public byte SubType; public byte SubType;
public byte Reason; public byte Reason;
public List<uint> Slots = new List<uint>(); public List<uint> Slots = new List<uint>();
@@ -735,14 +735,6 @@ namespace Game.Network.Packets
public class RideTicket public class RideTicket
{ {
public RideTicket(ObjectGuid requesterGuid, uint id, RideType type, int time)
{
RequesterGuid = requesterGuid;
Id = id;
Type = type;
Time = time;
}
public void Read(WorldPacket data) public void Read(WorldPacket data)
{ {
RequesterGuid = data.ReadPackedGuid(); RequesterGuid = data.ReadPackedGuid();
+3
View File
@@ -307,7 +307,9 @@ namespace Game.Network.Packets
{ {
public void Read(WorldPacket data) public void Read(WorldPacket data)
{ {
RideTicket = new RideTicket();
RideTicket.Read(data); RideTicket.Read(data);
GroupFinderActivityID = data.ReadUInt32(); GroupFinderActivityID = data.ReadUInt32();
LastTitleAuthorGuid = data.ReadPackedGuid(); LastTitleAuthorGuid = data.ReadPackedGuid();
LastDescriptionAuthorGuid = data.ReadPackedGuid(); LastDescriptionAuthorGuid = data.ReadPackedGuid();
@@ -336,6 +338,7 @@ namespace Game.Network.Packets
{ {
public void Read(WorldPacket data) public void Read(WorldPacket data)
{ {
RideTicket = new RideTicket();
RideTicket.Read(data); RideTicket.Read(data);
Comment = data.ReadString(data.ReadBits<uint>(9)); Comment = data.ReadString(data.ReadBits<uint>(9));