Core/PacketIO: Updated packet structures to 8.1.5

Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/31fda79556e55375962a3c9e46f6dbdbf6e90d18
This commit is contained in:
hondacrx
2019-06-22 18:42:45 -04:00
parent d500b65ad9
commit e4d500f4b5
54 changed files with 1179 additions and 1077 deletions
@@ -32,10 +32,12 @@ namespace Game.Network.Packets
{
_worldPacket.WriteUInt32(CurrentSeason);
_worldPacket.WriteUInt32(PreviousSeason);
_worldPacket.WriteUInt32(PvpSeasonID);
}
public uint PreviousSeason = 0;
public uint CurrentSeason = 0;
public uint PreviousSeason;
public uint CurrentSeason;
public uint PvpSeasonID;
}
public class AreaSpiritHealerQuery : ClientPacket
@@ -301,16 +303,17 @@ namespace Game.Network.Packets
public override void Read()
{
QueueID = _worldPacket.ReadUInt64();
var queueCount = _worldPacket.ReadUInt32();
Roles = _worldPacket.ReadUInt8();
BlacklistMap[0] = _worldPacket.ReadInt32();
BlacklistMap[1] = _worldPacket.ReadInt32();
JoinAsGroup = _worldPacket.HasBit();
for (var i = 0; i < queueCount; ++i)
QueueIDs[i] = _worldPacket.ReadUInt64();
}
public bool JoinAsGroup;
public Array<ulong> QueueIDs = new Array<ulong>(1);
public byte Roles;
public ulong QueueID;
public int[] BlacklistMap = new int[2];
}
@@ -550,21 +553,6 @@ namespace Game.Network.Packets
public override void Read() { }
}
public class ArenaError : ServerPacket
{
public ArenaError() : base(ServerOpcodes.ArenaError) { }
public override void Write()
{
_worldPacket.WriteUInt32(ErrorType);
if (ErrorType == ArenaErrorType.NoTeam)
_worldPacket.WriteUInt8(TeamSize);
}
public ArenaErrorType ErrorType;
public byte TeamSize;
}
//Structs
public struct BattlefieldStatusHeader
{
@@ -49,10 +49,14 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(Characters.Count);
_worldPacket.WriteInt32(MaxCharacterLevel);
_worldPacket.WriteUInt32(RaceUnlockData.Count);
_worldPacket.WriteUInt32(UnlockedConditionalAppearances.Count);
if (DisabledClassesMask.HasValue)
_worldPacket.WriteUInt32(DisabledClassesMask.Value);
foreach (UnlockedConditionalAppearance unlockedConditionalAppearance in UnlockedConditionalAppearances)
unlockedConditionalAppearance.Write(_worldPacket);
foreach (CharacterInfo charInfo in Characters)
charInfo.Write(_worldPacket);
@@ -72,6 +76,7 @@ namespace Game.Network.Packets
public List<CharacterInfo> Characters = new List<CharacterInfo>(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); //
public List<UnlockedConditionalAppearance> UnlockedConditionalAppearances = new List<UnlockedConditionalAppearance>();
public class CharacterInfo
{
@@ -169,7 +174,7 @@ namespace Game.Network.Packets
if (spec != null)
SpecID = (ushort)spec.Id;
LastLoginBuild = fields.Read<uint>(30);
LastLoginVersion = fields.Read<uint>(30);
for (byte slot = 0; slot < InventorySlots.BagEnd; ++slot)
{
@@ -217,7 +222,7 @@ namespace Game.Network.Packets
data.WriteUInt32(LastPlayedTime);
data.WriteUInt16(SpecID);
data.WriteUInt32(Unknown703);
data.WriteUInt32(LastLoginBuild);
data.WriteUInt32(LastLoginVersion);
data.WriteUInt32(Flags4);
data.WriteBits(Name.GetByteCount(), 6);
data.WriteBit(FirstLogin);
@@ -255,7 +260,7 @@ namespace Game.Network.Packets
public uint LastPlayedTime;
public ushort SpecID;
public uint Unknown703;
public uint LastLoginBuild;
public uint LastLoginVersion;
public PetInfo Pet = new PetInfo();
public bool BoostInProgress; // @todo
public uint[] ProfessionIds = new uint[2]; // @todo
@@ -274,6 +279,7 @@ namespace Game.Network.Packets
public uint DisplayEnchantId;
public byte InventoryType;
}
public struct PetInfo
{
public uint CreatureDisplayId; // PetCreatureDisplayID
@@ -298,6 +304,18 @@ namespace Game.Network.Packets
public bool HasAchievement;
public bool HasHeritageArmor;
}
public struct UnlockedConditionalAppearance
{
public void Write(WorldPacket data)
{
data.WriteInt32(AchievementID);
data.WriteInt32(Unused);
}
public int AchievementID;
public int Unused;
}
}
public class CreateCharacter : ClientPacket
+1 -1
View File
@@ -388,7 +388,7 @@ namespace Game.Network.Packets
public override void Write()
{
_worldPacket.WriteUInt32(MessageID);
_worldPacket.WriteInt32(MessageID);
_worldPacket.WriteBits(StringParam.GetByteCount(), 11);
_worldPacket.WriteString(StringParam);
@@ -443,7 +443,7 @@ namespace Game.Network.Packets
public int Unknown;
}
struct GarrisonMissionAreaBonus
struct GarrisonMissionBonusAbility
{
public void Write(WorldPacket data)
{
@@ -509,7 +509,7 @@ namespace Game.Network.Packets
missionRewardItem.Write(data);
}
foreach (GarrisonMissionAreaBonus areaBonus in MissionAreaBonuses)
foreach (GarrisonMissionBonusAbility areaBonus in MissionAreaBonuses)
areaBonus.Write(data);
foreach (GarrisonTalent talent in Talents)
@@ -541,7 +541,7 @@ namespace Game.Network.Packets
public List<GarrisonMission> Missions = new List<GarrisonMission>();
public List<List<GarrisonMissionReward>> MissionRewards = new List<List<GarrisonMissionReward>>();
public List<List<GarrisonMissionReward>> MissionOvermaxRewards = new List<List<GarrisonMissionReward>>();
public List<GarrisonMissionAreaBonus> MissionAreaBonuses = new List<GarrisonMissionAreaBonus>();
public List<GarrisonMissionBonusAbility> MissionAreaBonuses = new List<GarrisonMissionBonusAbility>();
public List<GarrisonTalent> Talents = new List<GarrisonTalent>();
public List<bool> CanStartMission = new List<bool>();
public List<int> ArchivedMissions = new List<int>();
@@ -44,6 +44,7 @@ namespace Game.Network.Packets
public override void Write()
{
_worldPacket.WritePackedGuid(GuildGUID);
_worldPacket.WritePackedGuid(PlayerGuid);
_worldPacket.WriteBit(HasGuildInfo);
_worldPacket.FlushBits();
@@ -75,6 +76,7 @@ namespace Game.Network.Packets
}
public ObjectGuid GuildGUID;
public ObjectGuid PlayerGuid;
public GuildInfo Info = new GuildInfo();
public bool HasGuildInfo;
+59 -19
View File
@@ -20,6 +20,7 @@ using Framework.Dynamic;
using Framework.IO;
using Game.Entities;
using System.Collections.Generic;
using System;
namespace Game.Network.Packets
{
@@ -78,23 +79,32 @@ namespace Game.Network.Packets
class AvailableHotfixes : ServerPacket
{
public AvailableHotfixes(int hotfixCacheVersion, Dictionary<ulong, int> hotfixes) : base(ServerOpcodes.AvailableHotfixes)
public AvailableHotfixes(int hotfixCacheVersion, uint hotfixCount, MultiMap<int, Tuple<uint, int>> hotfixes) : base(ServerOpcodes.AvailableHotfixes)
{
HotfixCacheVersion = hotfixCacheVersion;
HotfixCount = hotfixCount;
Hotfixes = hotfixes;
}
public override void Write()
{
_worldPacket.WriteInt32(HotfixCacheVersion);
_worldPacket.WriteUInt32(HotfixCount);
_worldPacket.WriteUInt32(Hotfixes.Count);
foreach (var hotfixEntry in Hotfixes)
_worldPacket.WriteInt64(hotfixEntry.Key);
foreach (var key in Hotfixes.Keys)
{
foreach (var tableRecord in Hotfixes[key])
{
_worldPacket.WriteUInt32(tableRecord.Item1);
_worldPacket.WriteInt32(tableRecord.Item2);
_worldPacket.WriteInt32(key);
}
}
}
public int HotfixCacheVersion;
public Dictionary<ulong, int> Hotfixes = new Dictionary<ulong, int>();
public uint HotfixCount;
public MultiMap<int, Tuple<uint, int>> Hotfixes;
}
class HotfixRequest : ClientPacket
@@ -103,15 +113,17 @@ namespace Game.Network.Packets
public override void Read()
{
uint hotfixCount = _worldPacket.ReadUInt32();
//if (hotfixCount > Global.DB2Mgr.GetHotfixData().Count)
//throw PacketArrayMaxCapacityException(hotfixCount, sDB2Manager.GetHotfixData().size());
ClientBuild = _worldPacket.ReadUInt32();
DataBuild = _worldPacket.ReadUInt32();
uint hotfixCount = _worldPacket.ReadUInt32();
for (var i = 0; i < hotfixCount; ++i)
Hotfixes.Add(_worldPacket.ReadUInt64());
Hotfixes.Add(new HotfixRecord(_worldPacket));
}
public List<ulong> Hotfixes = new List<ulong>();
public uint ClientBuild;
public uint DataBuild;
public List<HotfixRecord> Hotfixes = new List<HotfixRecord>();
}
class HotfixResponse : ServerPacket
@@ -123,27 +135,55 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(Hotfixes.Count);
foreach (HotfixData hotfix in Hotfixes)
hotfix.Write(_worldPacket);
_worldPacket.WriteUInt32(HotfixContent.GetSize());
_worldPacket.WriteBytes(HotfixContent);
}
public List<HotfixData> Hotfixes = new List<HotfixData>();
public ByteBuffer HotfixContent;
public class HotfixData
{
public void Write(WorldPacket data)
{
data.WriteInt64(ID);
data.WriteInt32(RecordID);
data.WriteBit(Data.HasValue);
if (Data.HasValue)
Record.Write(data);
if (Size.HasValue)
{
data.WriteUInt32(Data.Value.GetSize());
data.WriteBytes(Data.Value);
data.WriteUInt32(Size);
data.WriteBit(true);
}
else
{
data.WriteUInt32(0);
data.WriteBit(false);
}
data.FlushBits();
}
public ulong ID;
public int RecordID;
public Optional<ByteBuffer> Data;
public HotfixRecord Record;
public Optional<uint> Size;
}
}
public struct HotfixRecord
{
public HotfixRecord(WorldPacket data)
{
TableHash = data.ReadUInt32();
RecordID = data.ReadInt32();
HotfixID = data.ReadInt32();
}
public void Write(WorldPacket data)
{
data.WriteUInt32(TableHash);
data.WriteInt32(RecordID);
data.WriteInt32(HotfixID);
}
public uint TableHash;
public int RecordID;
public int HotfixID;
}
}
+13 -63
View File
@@ -48,6 +48,11 @@ namespace Game.Network.Packets
_worldPacket.WriteInt32(ClassID);
_worldPacket.WriteInt32(SpecializationID);
_worldPacket.WriteInt32(GenderID);
_worldPacket.WriteUInt8(LifetimeMaxRank);
_worldPacket.WriteUInt16(TodayHK);
_worldPacket.WriteUInt16(YesterdayHK);
_worldPacket.WriteInt32(LifetimeHK);
_worldPacket.WriteInt32(HonorLevel);
for (int i = 0; i < Glyphs.Count; ++i)
_worldPacket.WriteUInt16(Glyphs[i]);
@@ -62,13 +67,17 @@ namespace Game.Network.Packets
_worldPacket.WriteBit(AzeriteLevel.HasValue);
_worldPacket.FlushBits();
Items.ForEach(p => p.Write(_worldPacket));
foreach (PVPBracketData bracket in Bracket)
bracket.Write(_worldPacket);
if (GuildData.HasValue)
GuildData.Value.Write(_worldPacket);
if (AzeriteLevel.HasValue)
_worldPacket.WriteInt32(AzeriteLevel.Value);
foreach (InspectItemData item in Items)
item.Write(_worldPacket);
}
public ObjectGuid InspecteeGUID;
@@ -79,74 +88,16 @@ namespace Game.Network.Packets
public Class ClassID = Class.None;
public Gender GenderID = Gender.None;
public Optional<InspectGuildData> GuildData = new Optional<InspectGuildData>();
public Array<PVPBracketData> Bracket = new Array<PVPBracketData>(6);
public int SpecializationID;
public Optional<int> AzeriteLevel;
}
public class RequestHonorStats : ClientPacket
{
public RequestHonorStats(WorldPacket packet) : base(packet) { }
public override void Read()
{
TargetGUID = _worldPacket.ReadPackedGuid();
}
public ObjectGuid TargetGUID;
}
public class InspectHonorStats : ServerPacket
{
public InspectHonorStats() : base(ServerOpcodes.InspectHonorStats) { }
public override void Write()
{
_worldPacket.WritePackedGuid(PlayerGUID);
_worldPacket.WriteUInt8(LifetimeMaxRank);
_worldPacket.WriteUInt16(YesterdayHK); // @todo: confirm order
_worldPacket.WriteUInt16(TodayHK); // @todo: confirm order
_worldPacket.WriteUInt32(LifetimeHK);
}
public ObjectGuid PlayerGUID;
public uint LifetimeHK;
public ushort YesterdayHK;
public uint HonorLevel;
public ushort TodayHK;
public ushort YesterdayHK;
public byte LifetimeMaxRank;
}
public class InspectPVPRequest : ClientPacket
{
public InspectPVPRequest(WorldPacket packet) : base(packet) { }
public override void Read()
{
InspectTarget = _worldPacket.ReadPackedGuid();
InspectRealmAddress = _worldPacket.ReadUInt32();
}
public ObjectGuid InspectTarget;
public uint InspectRealmAddress;
}
public class InspectPVPResponse : ServerPacket
{
public InspectPVPResponse() : base(ServerOpcodes.InspectPvp) { }
public override void Write()
{
_worldPacket.WritePackedGuid(ClientGUID);
_worldPacket.WriteBits(Bracket.Count, 3);
_worldPacket.FlushBits();
Bracket.ForEach(p => p.Write(_worldPacket));
}
public List<PVPBracketData> Bracket = new List<PVPBracketData>();
public ObjectGuid ClientGUID;
}
public class QueryInspectAchievements : ClientPacket
{
public QueryInspectAchievements(WorldPacket packet) : base(packet) { }
@@ -272,7 +223,6 @@ namespace Game.Network.Packets
data.WriteInt32(Unk801_1);
data.WriteBit(Unk801_2);
data.FlushBits();
}
public int Rating;
+2 -17
View File
@@ -774,8 +774,6 @@ namespace Game.Network.Packets
public ItemInstance(Item item)
{
ItemID = item.GetEntry();
RandomPropertiesSeed = item.GetItemSuffixFactor();
RandomPropertiesID = (uint)item.GetItemRandomPropertyId();
var bonusListIds = item.GetDynamicValues(ItemDynamicFields.BonusListIds);
if (!bonusListIds.Empty())
{
@@ -800,9 +798,6 @@ namespace Game.Network.Packets
public ItemInstance(Loots.LootItem lootItem)
{
ItemID = lootItem.itemid;
RandomPropertiesSeed = lootItem.randomSuffix;
if (lootItem.randomPropertyId.Type != ItemRandomEnchantmentType.BonusList)
RandomPropertiesID = lootItem.randomPropertyId.Id;
if (!lootItem.BonusListIDs.Empty())
{
@@ -821,9 +816,6 @@ namespace Game.Network.Packets
public ItemInstance(VoidStorageItem voidItem)
{
ItemID = voidItem.ItemEntry;
RandomPropertiesSeed = voidItem.ItemSuffixFactor;
if (voidItem.ItemRandomPropertyId.Type != ItemRandomEnchantmentType.BonusList)
RandomPropertiesID = voidItem.ItemRandomPropertyId.Id;
if (voidItem.ItemUpgradeId != 0 || voidItem.FixedScalingLevel != 0 || voidItem.ArtifactKnowledgeLevel != 0)
{
@@ -861,8 +853,6 @@ namespace Game.Network.Packets
public void Write(WorldPacket data)
{
data.WriteUInt32(ItemID);
data.WriteUInt32(RandomPropertiesSeed);
data.WriteUInt32(RandomPropertiesID);
data.WriteBit(ItemBonus.HasValue);
data.WriteBit(Modifications.HasValue);
@@ -878,8 +868,6 @@ namespace Game.Network.Packets
public void Read(WorldPacket data)
{
ItemID = data.ReadUInt32();
RandomPropertiesSeed = data.ReadUInt32();
RandomPropertiesID = data.ReadUInt32();
ItemBonus.HasValue = data.HasBit();
Modifications.HasValue = data.HasBit();
@@ -894,8 +882,7 @@ namespace Game.Network.Packets
public override int GetHashCode()
{
return ItemID.GetHashCode() ^ RandomPropertiesSeed.GetHashCode() ^
RandomPropertiesID.GetHashCode() ^ ItemBonus.GetHashCode() ^ Modifications.GetHashCode();
return ItemID.GetHashCode() ^ ItemBonus.GetHashCode() ^ Modifications.GetHashCode();
}
public override bool Equals(object obj)
@@ -908,7 +895,7 @@ namespace Game.Network.Packets
public static bool operator ==(ItemInstance left, ItemInstance right)
{
if (left.ItemID != right.ItemID || left.RandomPropertiesID != right.RandomPropertiesID || left.RandomPropertiesSeed != right.RandomPropertiesSeed)
if (left.ItemID != right.ItemID)
return false;
if (left.ItemBonus.HasValue != right.ItemBonus.HasValue || left.Modifications.HasValue != right.Modifications.HasValue)
@@ -929,8 +916,6 @@ namespace Game.Network.Packets
}
public uint ItemID;
public uint RandomPropertiesSeed;
public uint RandomPropertiesID;
public Optional<ItemBonusInstanceData> ItemBonus;
public Optional<CompactArray> Modifications;
}
+14 -2
View File
@@ -235,13 +235,16 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt8(PartyIndex);
_worldPacket.WriteUInt8(RoleCheckStatus);
_worldPacket.WriteUInt32(JoinSlots.Count);
_worldPacket.WriteUInt64(BgQueueID);
_worldPacket.WriteUInt32(BgQueueIDs.Count);
_worldPacket.WriteUInt32(GroupFinderActivityID);
_worldPacket.WriteUInt32(Members.Count);
foreach (var slot in JoinSlots)
_worldPacket.WriteUInt32(slot);
foreach (ulong bgQueueID in BgQueueIDs)
_worldPacket.WriteUInt64(bgQueueID);
_worldPacket.WriteBit(IsBeginning);
_worldPacket.WriteBit(IsRequeue);
_worldPacket.FlushBits();
@@ -253,7 +256,7 @@ namespace Game.Network.Packets
public byte PartyIndex;
public byte RoleCheckStatus;
public List<uint> JoinSlots = new List<uint>();
public ulong BgQueueID;
public List<ulong> BgQueueIDs = new List<ulong>();
public int GroupFinderActivityID = 0;
public List<LFGRoleCheckUpdateMember> Members = new List<LFGRoleCheckUpdateMember>();
public bool IsBeginning;
@@ -271,15 +274,24 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt8(Result);
_worldPacket.WriteUInt8(ResultDetail);
_worldPacket.WriteUInt32(BlackList.Count);
_worldPacket.WriteUInt32(BlackListNames.Count);
foreach (LFGJoinBlackList blackList in BlackList)
blackList.Write(_worldPacket);
foreach (string str in BlackListNames)
_worldPacket.WriteBits(str.GetByteCount() + 1, 24);
foreach (string str in BlackListNames)
if (!str.IsEmpty())
_worldPacket.WriteCString(str);
}
public RideTicket Ticket = new RideTicket();
public byte Result;
public byte ResultDetail;
public List<LFGJoinBlackList> BlackList = new List<LFGJoinBlackList>();
public List<string> BlackListNames = new List<string>();
}
class LFGQueueStatus : ServerPacket
+4 -2
View File
@@ -143,12 +143,14 @@ namespace Game.Network.Packets
public override void Write()
{
_worldPacket.WriteUInt32(Money);
_worldPacket.WriteUInt64(Money);
_worldPacket.WriteUInt64(MoneyMod);
_worldPacket.WriteBit(SoleLooter);
_worldPacket.FlushBits();
}
public uint Money;
public ulong Money;
public ulong MoneyMod;
public bool SoleLooter;
}
+2 -2
View File
@@ -283,9 +283,9 @@ namespace Game.Network.Packets
}
}
public class NotifyRecievedMail : ServerPacket
public class NotifyReceivedMail : ServerPacket
{
public NotifyRecievedMail() : base(ServerOpcodes.NotifyReceivedMail) { }
public NotifyReceivedMail() : base(ServerOpcodes.NotifyReceivedMail) { }
public override void Write()
{
@@ -118,6 +118,9 @@ namespace Game.Network.Packets
_worldPacket.WriteBit(TrackedQuantity.HasValue);
_worldPacket.WriteBit(MaxQuantity.HasValue);
_worldPacket.WriteBit(SuppressChatLog);
_worldPacket.WriteBit(QuantityChange.HasValue);
_worldPacket.WriteBit(QuantityGainSource.HasValue);
_worldPacket.WriteBit(QuantityLostSource.HasValue);
_worldPacket.FlushBits();
if (WeeklyQuantity.HasValue)
@@ -128,6 +131,15 @@ namespace Game.Network.Packets
if (MaxQuantity.HasValue)
_worldPacket.WriteInt32(MaxQuantity.Value);
if (QuantityChange.HasValue)
_worldPacket.WriteInt32(QuantityChange.Value);
if (QuantityGainSource.HasValue)
_worldPacket.WriteInt32(QuantityGainSource.Value);
if (QuantityLostSource.HasValue)
_worldPacket.WriteInt32(QuantityLostSource.Value);
}
public uint Type;
@@ -136,6 +148,9 @@ namespace Game.Network.Packets
public Optional<int> WeeklyQuantity;
public Optional<int> TrackedQuantity;
public Optional<int> MaxQuantity;
public Optional<int> QuantityChange;
public Optional<int> QuantityGainSource;
public Optional<int> QuantityLostSource;
public bool SuppressChatLog;
}
@@ -1017,7 +1017,7 @@ namespace Game.Network.Packets
data.WriteBit(VehicleRecID.HasValue);
data.WriteBit(CollisionHeight.HasValue);
data.WriteBit(MovementForce_.HasValue);
data.WriteBit(Unknown.HasValue);
data.WriteBit(MovementForceGUID.HasValue);
data.FlushBits();
if (CollisionHeight.HasValue)
@@ -1041,8 +1041,8 @@ namespace Game.Network.Packets
if (VehicleRecID.HasValue)
data.WriteInt32(VehicleRecID.Value);
if (Unknown.HasValue)
data.WritePackedGuid(Unknown.Value);
if (MovementForceGUID.HasValue)
data.WritePackedGuid(MovementForceGUID.Value);
if (MovementForce_.HasValue)
MovementForce_.Value.Write(data);
@@ -1055,7 +1055,7 @@ namespace Game.Network.Packets
public Optional<int> VehicleRecID;
public Optional<CollisionHeightInfo> CollisionHeight;
public Optional<MovementForce> MovementForce_;
public Optional<ObjectGuid> Unknown;
public Optional<ObjectGuid> MovementForceGUID;
}
}
@@ -333,6 +333,7 @@ namespace Game.Network.Packets
data.WriteInt32(PlayerConditionFailed);
Item.Write(data);
data.WriteBit(DoNotFilterOnVendor);
data.WriteBit(Refundable);
data.FlushBits();
}
@@ -346,6 +347,7 @@ namespace Game.Network.Packets
public int ExtendedCostID;
public int PlayerConditionFailed;
public bool DoNotFilterOnVendor;
public bool Refundable;
}
public class TrainerListSpell
+9 -8
View File
@@ -201,6 +201,13 @@ namespace Game.Network.Packets
public string Name;
}
class GroupUninvite : ServerPacket
{
public GroupUninvite() : base(ServerOpcodes.GroupUninvite) { }
public override void Write() { }
}
class RequestPartyMemberStats : ClientPacket
{
public RequestPartyMemberStats(WorldPacket packet) : base(packet) { }
@@ -422,13 +429,6 @@ namespace Game.Network.Packets
public sbyte PartyIndex;
}
class GroupUninvite : ServerPacket
{
public GroupUninvite() : base(ServerOpcodes.GroupUninvite) { }
public override void Write() { }
}
class GroupDestroyed : ServerPacket
{
public GroupDestroyed() : base(ServerOpcodes.GroupDestroyed) { }
@@ -1042,7 +1042,8 @@ namespace Game.Network.Packets
data.WriteUInt8(RolesAssigned);
data.WriteUInt8(Class);
data.WriteString(Name);
data.WriteString(VoiceStateID);
if (!VoiceStateID.IsEmpty())
data.WriteString(VoiceStateID);
}
public ObjectGuid GUID;
@@ -131,6 +131,9 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(Stats.RequiredExpansion);
_worldPacket.WriteInt32(Stats.VignetteID);
_worldPacket.WriteInt32(Stats.Class);
_worldPacket.WriteFloat(Stats.FadeRegionRadius);
_worldPacket.WriteInt32(Stats.WidgetSetID);
_worldPacket.WriteInt32(Stats.WidgetSetUnitConditionID);
if (!Stats.Title.IsEmpty())
_worldPacket.WriteCString(Stats.Title);
@@ -738,6 +741,9 @@ namespace Game.Network.Packets
public uint RequiredExpansion;
public uint VignetteID;
public int Class;
public float FadeRegionRadius;
public int WidgetSetID;
public int WidgetSetUnitConditionID;
public uint[] Flags = new uint[2];
public uint[] ProxyCreatureID = new uint[SharedConst.MaxCreatureKillCredit];
public StringArray Name = new StringArray(SharedConst.MaxCreatureNames);
@@ -201,6 +201,7 @@ namespace Game.Network.Packets
_worldPacket.WriteInt64(Info.AllowableRaces);
_worldPacket.WriteInt32(Info.TreasurePickerID);
_worldPacket.WriteInt32(Info.Expansion);
_worldPacket.WriteInt32(Info.ManagedWorldStateID);
_worldPacket.WriteBits(Info.LogTitle.GetByteCount(), 9);
_worldPacket.WriteBits(Info.LogDescription.GetByteCount(), 12);
@@ -837,6 +838,7 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(Responses.Count);
_worldPacket.WritePackedGuid(SenderGUID);
_worldPacket.WriteInt32(UiTextureKitID);
_worldPacket.WriteUInt32(SoundKitID);
_worldPacket.WriteBits(Question.GetByteCount(), 8);
_worldPacket.WriteBit(CloseChoiceFrame);
_worldPacket.WriteBit(HideWarboardHeader);
@@ -852,6 +854,7 @@ namespace Game.Network.Packets
public ObjectGuid SenderGUID;
public int ChoiceID;
public int UiTextureKitID;
public uint SoundKitID;
public string Question;
public List<PlayerChoiceResponse> Responses = new List<PlayerChoiceResponse>();
public bool CloseChoiceFrame;
@@ -965,6 +968,7 @@ namespace Game.Network.Packets
public uint TimeAllowed;
public int TreasurePickerID;
public int Expansion;
public int ManagedWorldStateID;
public List<QuestObjective> Objectives = new List<QuestObjective>();
public uint[] RewardItems = new uint[SharedConst.QuestRewardItemCount];
public uint[] RewardAmount = new uint[SharedConst.QuestRewardItemCount];
@@ -1254,13 +1258,18 @@ namespace Game.Network.Packets
data.WriteInt32(ChoiceArtFileID);
data.WriteInt32(Flags);
data.WriteUInt32(WidgetSetID);
data.WriteUInt32(UiTextureAtlasElementID);
data.WriteUInt32(SoundKitID);
data.WriteUInt8(GroupID);
data.WriteBits(Answer.GetByteCount(), 9);
data.WriteBits(Header.GetByteCount(), 9);
data.WriteBits(SubHeader.GetByteCount(), 7);
data.WriteBits(ButtonTooltip.GetByteCount(), 9);
data.WriteBits(Description.GetByteCount(), 11);
data.WriteBits(Confirmation.GetByteCount(), 7);
data.WriteBit(RewardQuestID.HasValue);
data.WriteBit(Reward.HasValue);
data.FlushBits();
@@ -1269,19 +1278,29 @@ namespace Game.Network.Packets
data.WriteString(Answer);
data.WriteString(Header);
data.WriteString(SubHeader);
data.WriteString(ButtonTooltip);
data.WriteString(Description);
data.WriteString(Confirmation);
if (RewardQuestID.HasValue)
data.WriteUInt32(RewardQuestID.Value);
}
public int ResponseID;
public int ChoiceArtFileID;
public int Flags;
public uint WidgetSetID;
public uint UiTextureAtlasElementID;
public uint SoundKitID;
public byte GroupID;
public string Answer;
public string Header;
public string SubHeader;
public string ButtonTooltip;
public string Description;
public string Confirmation;
public Optional<PlayerChoiceResponseReward> Reward;
public Optional<uint> RewardQuestID;
}
}
@@ -22,7 +22,7 @@ namespace Game.Network.Packets
{
public class InitializeFactions : ServerPacket
{
const ushort FactionCount = 300;
const ushort FactionCount = 350;
public InitializeFactions() : base(ServerOpcodes.InitializeFactions, ConnectionType.Instance) { }
+58 -28
View File
@@ -691,8 +691,8 @@ namespace Game.Network.Packets
_worldPacket.WritePackedGuid(Target);
_worldPacket.WriteUInt32(SpellVisualID);
_worldPacket.WriteFloat(TravelSpeed);
_worldPacket.WriteFloat(UnkZero);
_worldPacket.WriteFloat(Unk801);
_worldPacket.WriteFloat(LaunchDelay);
_worldPacket.WriteFloat(MinDuration);
_worldPacket.WriteBit(SpeedAsTime);
_worldPacket.FlushBits();
}
@@ -702,8 +702,8 @@ namespace Game.Network.Packets
public uint SpellVisualID;
public bool SpeedAsTime;
public float TravelSpeed;
public float UnkZero; // Always zero
public float Unk801;
public float LaunchDelay; // Always zero
public float MinDuration;
public Vector3 SourceRotation; // Vector of rotations, Orientation is z
public Vector3 TargetLocation; // Exclusive with Target
}
@@ -716,29 +716,31 @@ namespace Game.Network.Packets
{
_worldPacket.WritePackedGuid(Source);
_worldPacket.WritePackedGuid(Target);
_worldPacket.WritePackedGuid(Unk801_1);
_worldPacket.WritePackedGuid(Transport);
_worldPacket.WriteVector3(TargetPosition);
_worldPacket.WriteUInt32(SpellVisualID);
_worldPacket.WriteFloat(TravelSpeed);
_worldPacket.WriteUInt16(HitReason);
_worldPacket.WriteUInt16(MissReason);
_worldPacket.WriteUInt16(ReflectStatus);
_worldPacket.WriteFloat(Orientation);
_worldPacket.WriteFloat(Unk801_2);
_worldPacket.WriteFloat(LaunchDelay);
_worldPacket.WriteFloat(MinDuration);
_worldPacket.WriteBit(SpeedAsTime);
_worldPacket.FlushBits();
}
public ObjectGuid Source;
public ObjectGuid Target; // Exclusive with TargetPosition
public ObjectGuid Unk801_1;
public ushort MissReason;
public uint SpellVisualID;
public bool SpeedAsTime;
public ushort ReflectStatus;
public float TravelSpeed;
public ObjectGuid Transport; // Used when Target = Empty && (SpellVisual::Flags & 0x400) == 0
public Vector3 TargetPosition; // Exclusive with Target
public float Orientation;
public float Unk801_2;
public uint SpellVisualID;
public float TravelSpeed;
public ushort HitReason;
public ushort MissReason;
public ushort ReflectStatus;
public float LaunchDelay;
public float MinDuration;
public bool SpeedAsTime;
}
class PlaySpellVisualKit : ServerPacket
@@ -1268,6 +1270,7 @@ namespace Game.Network.Packets
{
data.WriteInt16(PlayerLevelDelta);
data.WriteUInt16(PlayerItemLevel);
data.WriteUInt16(TargetItemLevel);
data.WriteUInt16(ScalingHealthItemLevelCurveID);
data.WriteUInt8(TargetLevel);
data.WriteUInt8(Expansion);
@@ -1282,6 +1285,7 @@ namespace Game.Network.Packets
public ContentTuningType TuningType;
public short PlayerLevelDelta;
public ushort PlayerItemLevel;
public ushort TargetItemLevel;
public ushort ScalingHealthItemLevelCurveID;
public byte TargetLevel;
public byte Expansion;
@@ -1401,7 +1405,7 @@ namespace Game.Network.Packets
{
public void Read(WorldPacket data)
{
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(25);
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(26);
SrcLocation.HasValue = data.HasBit();
DstLocation.HasValue = data.HasBit();
Orientation.HasValue = data.HasBit();
@@ -1428,7 +1432,7 @@ namespace Game.Network.Packets
public void Write(WorldPacket data)
{
data.WriteBits((uint)Flags, 25);
data.WriteBits((uint)Flags, 26);
data.WriteBit(SrcLocation.HasValue);
data.WriteBit(DstLocation.HasValue);
data.WriteBit(Orientation.HasValue);
@@ -1525,19 +1529,40 @@ namespace Game.Network.Packets
public uint[] Misc = new uint[2];
}
public struct SpellMissStatus
public struct SpellHitStatus
{
public SpellHitStatus(SpellMissInfo reason)
{
Reason = reason;
}
public void Write(WorldPacket data)
{
data.WriteBits(Reason, 4);
if (Reason == (byte)SpellMissInfo.Reflect)
data.WriteUInt8(Reason);
}
public SpellMissInfo Reason;
}
public struct SpellMissStatus
{
public SpellMissStatus(SpellMissInfo reason, SpellMissInfo reflectStatus)
{
Reason = reason;
ReflectStatus = reflectStatus;
}
public void Write(WorldPacket data)
{
data.WriteBits((byte)Reason, 4);
if (Reason == SpellMissInfo.Reflect)
data.WriteBits(ReflectStatus, 4);
data.FlushBits();
}
public byte Reason;
public byte ReflectStatus;
public SpellMissInfo Reason;
public SpellMissInfo ReflectStatus;
}
public struct SpellPowerData
@@ -1643,22 +1668,26 @@ namespace Game.Network.Packets
data.WriteBits(HitTargets.Count, 16);
data.WriteBits(MissTargets.Count, 16);
data.WriteBits(HitStatus.Count, 16);
data.WriteBits(MissStatus.Count, 16);
data.WriteBits(RemainingPower.Count, 9);
data.WriteBit(RemainingRunes.HasValue);
data.WriteBits(TargetPoints.Count, 16);
data.FlushBits();
foreach (SpellMissStatus status in MissStatus)
status.Write(data);
foreach (SpellMissStatus missStatus in MissStatus)
missStatus.Write(data);
Target.Write(data);
foreach (ObjectGuid target in HitTargets)
data.WritePackedGuid(target);
foreach (ObjectGuid hitTarget in HitTargets)
data.WritePackedGuid(hitTarget);
foreach (ObjectGuid target in MissTargets)
data.WritePackedGuid(target);
foreach (ObjectGuid missTarget in MissTargets)
data.WritePackedGuid(missTarget);
foreach (SpellHitStatus hitStatus in HitStatus)
hitStatus.Write(data);
foreach (SpellPowerData power in RemainingPower)
power.Write(data);
@@ -1681,6 +1710,7 @@ namespace Game.Network.Packets
public uint CastTime;
public List<ObjectGuid> HitTargets = new List<ObjectGuid>();
public List<ObjectGuid> MissTargets = new List<ObjectGuid>();
public List<SpellHitStatus> HitStatus = new List<SpellHitStatus>();
public List<SpellMissStatus> MissStatus = new List<SpellMissStatus>();
public SpellTargetData Target = new SpellTargetData();
public List<SpellPowerData> RemainingPower = new List<SpellPowerData>();
@@ -50,6 +50,7 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt32(BpayStoreProductDeliveryDelay);
_worldPacket.WriteUInt32(ClubsPresenceUpdateTimer);
_worldPacket.WriteUInt32(HiddenUIClubsPresenceUpdateTimer);
_worldPacket.WriteBit(VoiceEnabled);
_worldPacket.WriteBit(EuropaTicketSystemStatus.HasValue);
@@ -77,6 +78,7 @@ namespace Game.Network.Packets
_worldPacket.WriteBit(ClubsEnabled);
_worldPacket.WriteBit(ClubsBattleNetClubTypeAllowed);
_worldPacket.WriteBit(ClubsCharacterClubTypeAllowed);
_worldPacket.WriteBit(ClubsPresenceUpdateEnabled);
_worldPacket.WriteBit(VoiceChatDisabledByParentalControl);
_worldPacket.WriteBit(VoiceChatMutedByParentalControl);
_worldPacket.FlushBits();
@@ -159,6 +161,7 @@ namespace Game.Network.Packets
public long TokenBalanceAmount;
public uint BpayStoreProductDeliveryDelay;
public uint ClubsPresenceUpdateTimer;
public uint HiddenUIClubsPresenceUpdateTimer; // Timer for updating club presence when communities ui frame is hidden
public bool ItemRestorationButtonEnabled;
public bool CharUndeleteEnabled; // Implemented
public bool BpayStoreDisabledByParentalControls;
@@ -176,6 +179,7 @@ namespace Game.Network.Packets
public bool ClubsEnabled;
public bool ClubsBattleNetClubTypeAllowed;
public bool ClubsCharacterClubTypeAllowed;
public bool ClubsPresenceUpdateEnabled;
public bool VoiceChatDisabledByParentalControl;
public bool VoiceChatMutedByParentalControl;
+2 -2
View File
@@ -87,12 +87,12 @@ namespace Game.Network.Packets
_worldPacket.WriteUInt64(CurrentMarketPrice);
_worldPacket.WriteUInt32(UnkInt);
_worldPacket.WriteUInt32(Result);
_worldPacket.WriteUInt32(UnkInt2);
_worldPacket.WriteUInt32(AuctionDuration);
}
public ulong CurrentMarketPrice;
public uint UnkInt; // send CMSG_REQUEST_WOW_TOKEN_MARKET_PRICE
public TokenResult Result;
public uint UnkInt2 = 0;
public uint AuctionDuration; // preset auction duration enum
}
}
+23 -6
View File
@@ -18,6 +18,7 @@
using Framework.Constants;
using Game.Entities;
using System.Collections.Generic;
using System;
namespace Game.Network.Packets
{
@@ -54,20 +55,36 @@ namespace Game.Network.Packets
_worldPacket.WriteBit(IsFullUpdate);
_worldPacket.FlushBits();
// both lists have to have the same size
// all lists have to have the same size
_worldPacket.WriteUInt32(Toys.Count);
_worldPacket.WriteUInt32(Toys.Count);
_worldPacket.WriteUInt32(Toys.Count);
foreach (var item in Toys)
_worldPacket.WriteUInt32(item.Key);
foreach (var pair in Toys)
_worldPacket.WriteUInt32(pair.Key);
foreach (var favourite in Toys)
_worldPacket.WriteBit(favourite.Value);
foreach (var pair in Toys)
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.Favorite));
foreach (var pair in Toys)
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.HasFanfare));
_worldPacket.FlushBits();
}
public bool IsFullUpdate = false;
public Dictionary<uint, bool> Toys = new Dictionary<uint, bool>();
public Dictionary<uint, ToyFlags> Toys = new Dictionary<uint, ToyFlags>();
}
class ToyClearFanfare : ClientPacket
{
public ToyClearFanfare(WorldPacket packet) : base(packet) { }
public override void Read()
{
ItemID = _worldPacket.ReadUInt32();
}
public uint ItemID;
}
}