Core/Refactor: Part 2

This commit is contained in:
hondacrx
2018-05-07 22:07:35 -04:00
parent 216db1c23a
commit 9b40067017
93 changed files with 321 additions and 388 deletions
@@ -230,7 +230,7 @@ namespace Game.Network.Packets
public override void Write()
{
_worldPacket.WriteUInt32(Earned.Count());
_worldPacket.WriteUInt32(Earned.Count);
foreach (EarnedAchievement earned in Earned)
earned.Write(_worldPacket);
@@ -148,8 +148,9 @@ namespace Game.Network.Packets
data.WriteInt32(PrimaryTalentTree);
data.WriteInt32(PrimaryTalentTreeNameIndex);
data.WriteInt32(PlayerRace);
if (!Stats.Empty())
Stats.ForEach(id => data.WriteUInt32(id));
foreach (var id in Stats)
data.WriteUInt32(id);
data.WriteBit(Faction);
data.WriteBit(IsInWorld);
@@ -366,8 +367,9 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt8(MinLevel);
_worldPacket.WriteUInt8(MaxLevel);
_worldPacket.WriteUInt32(Battlefields.Count);
if (!Battlefields.Empty())
Battlefields.ForEach(field => _worldPacket.WriteInt32(field));
foreach (var field in Battlefields)
_worldPacket.WriteInt32(field);
_worldPacket.WriteBit(PvpAnywhere);
_worldPacket.WriteBit(HasRandomWinToday);
@@ -464,8 +466,9 @@ namespace Game.Network.Packets
public override void Write()
{
_worldPacket .WriteUInt32(FlagCarriers.Count);
FlagCarriers.ForEach(pos => pos.Write(_worldPacket));
_worldPacket.WriteUInt32(FlagCarriers.Count);
foreach (var pos in FlagCarriers)
pos.Write(_worldPacket);
}
public List<BattlegroundPlayerPosition> FlagCarriers = new List<BattlegroundPlayerPosition>();
@@ -515,8 +515,8 @@ namespace Game.Network.Packets
foreach (GarrisonTalent talent in Talents)
talent.Write(data);
if (!ArchivedMissions.Empty())
ArchivedMissions.ForEach(id => data.WriteInt32(id));
foreach(var id in ArchivedMissions)
data.WriteInt32(id);
foreach (GarrisonBuildingInfo building in Buildings)
building.Write(data);
+2 -2
View File
@@ -680,8 +680,8 @@ namespace Game.Network.Packets
public uint Level = 0;
public uint HealthDelta = 0;
public uint[] PowerDelta = new uint[6];
public uint[] StatDelta = new uint[(int)Stats.Max];
public int[] PowerDelta = new int[6];
public int[] StatDelta = new int[(int)Stats.Max];
public int Cp = 0;
}
+3 -3
View File
@@ -283,8 +283,8 @@ namespace Game.Network.Packets
statsData.WriteFloat(Stats.Size);
statsData.WriteUInt8(Stats.QuestItems.Count);
foreach (int questItem in Stats.QuestItems)
statsData.WriteInt32(questItem);
foreach (uint questItem in Stats.QuestItems)
statsData.WriteUInt32(questItem);
statsData.WriteUInt32(Stats.RequiredLevel);
@@ -731,7 +731,7 @@ namespace Game.Network.Packets
public uint DisplayID;
public int[] Data = new int[33];
public float Size;
public List<int> QuestItems = new List<int>();
public List<uint> QuestItems = new List<uint>();
public uint RequiredLevel;
}
+2 -2
View File
@@ -422,8 +422,8 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(Objectives.Count);
_worldPacket.WriteInt32(QuestStartItemID);
foreach (int spell in LearnSpells)
_worldPacket.WriteInt32(spell);
foreach (uint spell in LearnSpells)
_worldPacket.WriteUInt32(spell);
foreach (QuestDescEmote emote in DescEmotes)
{
+2 -2
View File
@@ -330,8 +330,8 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(SpellID.Count);
_worldPacket.WriteUInt32(FavoriteSpellID.Count);
foreach (int spell in SpellID)
_worldPacket.WriteInt32(spell);
foreach (uint spell in SpellID)
_worldPacket.WriteUInt32(spell);
foreach (int spell in FavoriteSpellID)
_worldPacket.WriteInt32(spell);