Remove custom OptionalType and use the default c# nullable type.

This commit is contained in:
hondacrx
2022-03-01 17:27:56 -05:00
parent cc08afe269
commit c14f1eb3dc
89 changed files with 924 additions and 976 deletions
@@ -90,7 +90,7 @@ namespace Game.Networking.Packets
public long CurrentTime;
public uint ElapsedTime;
public long CreationTime;
public Optional<ulong> RafAcceptanceID;
public ulong? RafAcceptanceID;
}
class AccountCriteriaUpdate : ServerPacket
@@ -350,7 +350,7 @@ namespace Game.Networking.Packets
public long Date;
public uint TimeFromStart;
public uint TimeFromCreate;
public Optional<ulong> RafAcceptanceID;
public ulong? RafAcceptanceID;
}
public struct GuildCriteriaProgress
@@ -69,24 +69,24 @@ namespace Game.Networking.Packets
{
_worldPacket.WritePackedGuid(TriggerGUID);
_worldPacket.WriteBit(AreaTriggerSpline.HasValue);
_worldPacket.WriteBit(AreaTriggerOrbit.HasValue);
_worldPacket.WriteBit(AreaTriggerSpline != null);
_worldPacket.WriteBit(AreaTriggerOrbit != null);
_worldPacket.WriteBit(AreaTriggerMovementScript.HasValue);
_worldPacket.FlushBits();
if (AreaTriggerSpline.HasValue)
AreaTriggerSpline.Value.Write(_worldPacket);
if (AreaTriggerSpline != null)
AreaTriggerSpline.Write(_worldPacket);
if (AreaTriggerMovementScript.HasValue)
AreaTriggerMovementScript.Value.Write(_worldPacket);
if (AreaTriggerOrbit.HasValue)
AreaTriggerOrbit.Value.Write(_worldPacket);
if (AreaTriggerOrbit != null)
AreaTriggerOrbit.Write(_worldPacket);
}
public Optional<AreaTriggerSplineInfo> AreaTriggerSpline;
public Optional<AreaTriggerOrbitInfo> AreaTriggerOrbit;
public Optional<AreaTriggerMovementScriptInfo> AreaTriggerMovementScript;
public AreaTriggerSplineInfo AreaTriggerSpline;
public AreaTriggerOrbitInfo AreaTriggerOrbit;
public AreaTriggerMovementScriptInfo? AreaTriggerMovementScript;
public ObjectGuid TriggerGUID;
}
@@ -31,7 +31,7 @@ namespace Game.Networking.Packets
public AuctionHouseFilterMask Filters;
public Array<byte> KnownPets = new(SharedConst.MaxBattlePetSpeciesId / 8 + 1);
public sbyte MaxPetLevel;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public string Name;
public Array<AuctionListFilterClass> ItemClassFilters = new(7);
public Array<AuctionSortDef> Sorts = new(2);
@@ -51,7 +51,7 @@ namespace Game.Networking.Packets
KnownPets[i] = _worldPacket.ReadUInt8();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint nameLength = _worldPacket.ReadBits<uint>(8);
uint itemClassFilterCount = _worldPacket.ReadBits<uint>(3);
@@ -72,7 +72,7 @@ namespace Game.Networking.Packets
class AuctionCancelCommoditiesPurchase : ClientPacket
{
public ObjectGuid Auctioneer;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionCancelCommoditiesPurchase(WorldPacket packet) : base(packet) { }
@@ -82,7 +82,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -93,7 +93,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public int ItemID;
public uint Quantity;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionConfirmCommoditiesPurchase(WorldPacket packet) : base(packet) { }
@@ -105,7 +105,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -129,7 +129,7 @@ namespace Game.Networking.Packets
public uint Offset;
public List<uint> AuctionItemIDs = new();
public Array<AuctionSortDef> Sorts = new(2);
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionListBiddedItems(WorldPacket packet) : base(packet) { }
@@ -138,7 +138,7 @@ namespace Game.Networking.Packets
Auctioneer = _worldPacket.ReadPackedGuid();
Offset = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint auctionIDCount = _worldPacket.ReadBits<uint>(7);
uint sortCount = _worldPacket.ReadBits<uint>(2);
@@ -157,7 +157,7 @@ namespace Game.Networking.Packets
class AuctionListBucketsByBucketKeys : ClientPacket
{
public ObjectGuid Auctioneer;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionBucketKey> BucketKeys = new(100);
public Array<AuctionSortDef> Sorts = new(2);
@@ -167,7 +167,7 @@ namespace Game.Networking.Packets
{
Auctioneer = _worldPacket.ReadPackedGuid();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint bucketKeysCount = _worldPacket.ReadBits<uint>(7);
uint sortCount = _worldPacket.ReadBits<uint>(2);
@@ -188,7 +188,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public uint Offset;
public sbyte Unknown830;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionSortDef> Sorts = new(2);
public AuctionBucketKey BucketKey;
@@ -200,7 +200,7 @@ namespace Game.Networking.Packets
Offset = _worldPacket.ReadUInt32();
Unknown830 = _worldPacket.ReadInt8();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint sortCount = _worldPacket.ReadBits<uint>(2);
for (var i = 0; i < sortCount; ++i)
@@ -219,7 +219,7 @@ namespace Game.Networking.Packets
public uint ItemID;
public int SuffixItemNameDescriptionID;
public uint Offset;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionSortDef> Sorts = new(2);
public AuctionListItemsByItemID(WorldPacket packet) : base(packet) { }
@@ -232,7 +232,7 @@ namespace Game.Networking.Packets
Offset = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint sortCount = _worldPacket.ReadBits<uint>(2);
@@ -248,7 +248,7 @@ namespace Game.Networking.Packets
{
public ObjectGuid Auctioneer;
public uint Offset;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionSortDef> Sorts = new(2);
public AuctionListOwnedItems(WorldPacket packet) : base(packet) { }
@@ -258,7 +258,7 @@ namespace Game.Networking.Packets
Auctioneer = _worldPacket.ReadPackedGuid();
Offset = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint sortCount = _worldPacket.ReadBits<uint>(2);
@@ -275,7 +275,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public ulong BidAmount;
public uint AuctionID;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionPlaceBid(WorldPacket packet) : base(packet) { }
@@ -287,7 +287,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -297,7 +297,7 @@ namespace Game.Networking.Packets
{
public ObjectGuid Auctioneer;
public uint AuctionID;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionRemoveItem(WorldPacket packet) : base(packet) { }
@@ -308,7 +308,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -321,7 +321,7 @@ namespace Game.Networking.Packets
public uint ChangeNumberCursor;
public uint ChangeNumberTombstone;
public uint Count;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionReplicateItems(WorldPacket packet) : base(packet) { }
@@ -335,7 +335,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -346,7 +346,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public ulong UnitPrice;
public uint RunTime;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionItemForSale> Items = new(64);
public AuctionSellCommodity(WorldPacket packet) : base(packet) { }
@@ -357,7 +357,7 @@ namespace Game.Networking.Packets
UnitPrice = _worldPacket.ReadUInt64();
RunTime = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint itemCount = _worldPacket.ReadBits<uint>(6);
@@ -375,7 +375,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public ulong MinBid;
public uint RunTime;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public Array<AuctionItemForSale> Items = new(1);
public AuctionSellItem(WorldPacket packet) : base(packet) { }
@@ -388,7 +388,7 @@ namespace Game.Networking.Packets
RunTime = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
TaintedBy.Value = new();
TaintedBy = new();
uint itemCount = _worldPacket.ReadBits<uint>(6);
@@ -419,7 +419,7 @@ namespace Game.Networking.Packets
public ObjectGuid Auctioneer;
public int ItemID;
public uint Quantity;
public Optional<AddOnInfo> TaintedBy;
public AddOnInfo? TaintedBy;
public AuctionGetCommodityQuote(WorldPacket packet) : base(packet) { }
@@ -431,7 +431,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
TaintedBy.Value = new();
TaintedBy = new();
TaintedBy.Value.Read(_worldPacket);
}
}
@@ -482,9 +482,9 @@ namespace Game.Networking.Packets
class AuctionGetCommodityQuoteResult : ServerPacket
{
public Optional<ulong> TotalPrice;
public Optional<uint> Quantity;
public Optional<int> QuoteDuration;
public ulong? TotalPrice;
public uint? Quantity;
public int? QuoteDuration;
public int ItemID;
public uint DesiredDelay;
@@ -716,8 +716,8 @@ namespace Game.Networking.Packets
{
public uint ItemID;
public ushort ItemLevel;
public Optional<ushort> BattlePetSpeciesID = new();
public Optional<ushort> SuffixItemNameDescriptionID = new();
public ushort? BattlePetSpeciesID;
public ushort? SuffixItemNameDescriptionID;
public AuctionBucketKey() { }
@@ -727,30 +727,25 @@ namespace Game.Networking.Packets
ItemLevel = key.ItemLevel;
if (key.BattlePetSpeciesId != 0)
BattlePetSpeciesID.Set(key.BattlePetSpeciesId);
BattlePetSpeciesID = key.BattlePetSpeciesId;
if (key.SuffixItemNameDescriptionId != 0)
SuffixItemNameDescriptionID.Set(key.SuffixItemNameDescriptionId);
SuffixItemNameDescriptionID = key.SuffixItemNameDescriptionId;
}
public AuctionBucketKey(WorldPacket data)
{
data.ResetBitPos();
ItemID = data.ReadBits<uint>(20);
if (data.HasBit())
BattlePetSpeciesID.Value = new();
bool hasBattlePetSpeciesId = data.HasBit();
ItemLevel = data.ReadBits<ushort>(11);
bool hasSuffixItemNameDescriptionId = data.HasBit();
if (data.HasBit())
SuffixItemNameDescriptionID.Value = new();
if (hasBattlePetSpeciesId)
BattlePetSpeciesID = data.ReadUInt16();
if (BattlePetSpeciesID.HasValue)
BattlePetSpeciesID.Set(data.ReadUInt16());
if (SuffixItemNameDescriptionID.HasValue)
SuffixItemNameDescriptionID.Set(data.ReadUInt16());
if (hasSuffixItemNameDescriptionId)
SuffixItemNameDescriptionID = data.ReadUInt16();
}
public void Write(WorldPacket data)
@@ -882,10 +877,10 @@ namespace Game.Networking.Packets
public ulong MinPrice;
public int RequiredLevel;
public List<uint> ItemModifiedAppearanceIDs = new();
public Optional<byte> MaxBattlePetQuality;
public Optional<byte> MaxBattlePetLevel;
public Optional<byte> BattlePetBreedID;
public Optional<uint> Unk901_1;
public byte? MaxBattlePetQuality;
public byte? MaxBattlePetLevel;
public byte? BattlePetBreedID;
public uint? Unk901_1;
public bool ContainsOwnerItem;
public bool ContainsOnlyCollectedAppearances;
@@ -926,17 +921,17 @@ namespace Game.Networking.Packets
public class AuctionItem
{
public Optional<ItemInstance> Item;
public ItemInstance Item;
public int Count;
public int Charges;
public List<ItemEnchantData> Enchantments = new();
public uint Flags;
public uint AuctionID;
public ObjectGuid Owner;
public Optional<ulong> MinBid;
public Optional<ulong> MinIncrement;
public Optional<ulong> BuyoutPrice;
public Optional<ulong> UnitPrice;
public ulong? MinBid;
public ulong? MinIncrement;
public ulong? BuyoutPrice;
public ulong? UnitPrice;
public int DurationLeft;
public byte DeleteReason;
public bool CensorServerSideInfo;
@@ -944,15 +939,15 @@ namespace Game.Networking.Packets
public ObjectGuid ItemGuid;
public ObjectGuid OwnerAccountID;
public uint EndTime;
public Optional<ObjectGuid> Bidder;
public Optional<ulong> BidAmount;
public ObjectGuid? Bidder;
public ulong? BidAmount;
public List<ItemGemData> Gems = new();
public Optional<AuctionBucketKey> AuctionBucketKey;
public Optional<ObjectGuid> Creator;
public AuctionBucketKey AuctionBucketKey;
public ObjectGuid? Creator;
public void Write(WorldPacket data)
{
data.WriteBit(Item.HasValue);
data.WriteBit(Item != null);
data.WriteBits(Enchantments.Count, 4);
data.WriteBits(Gems.Count, 2);
data.WriteBit(MinBid.HasValue);
@@ -961,7 +956,7 @@ namespace Game.Networking.Packets
data.WriteBit(UnitPrice.HasValue);
data.WriteBit(CensorServerSideInfo);
data.WriteBit(CensorBidInfo);
data.WriteBit(AuctionBucketKey.HasValue);
data.WriteBit(AuctionBucketKey != null);
data.WriteBit(Creator.HasValue);
if (!CensorBidInfo)
{
@@ -971,8 +966,8 @@ namespace Game.Networking.Packets
data.FlushBits();
if (Item.HasValue)
Item.Value.Write(data);
if (Item != null)
Item.Write(data);
data.WriteInt32(Count);
data.WriteInt32(Charges);
@@ -1019,8 +1014,8 @@ namespace Game.Networking.Packets
foreach (ItemGemData gem in Gems)
gem.Write(data);
if (AuctionBucketKey.HasValue)
AuctionBucketKey.Value.Write(data);
if (AuctionBucketKey != null)
AuctionBucketKey.Write(data);
}
}
@@ -106,33 +106,29 @@ namespace Game.Networking.Packets
class AuthResponse : ServerPacket
{
public AuthResponse() : base(ServerOpcodes.AuthResponse)
{
WaitInfo = new Optional<AuthWaitInfo>();
SuccessInfo = new Optional<AuthSuccessInfo>();
}
public AuthResponse() : base(ServerOpcodes.AuthResponse) { }
public override void Write()
{
_worldPacket.WriteUInt32((uint)Result);
_worldPacket.WriteBit(SuccessInfo.HasValue);
_worldPacket.WriteBit(SuccessInfo != null);
_worldPacket.WriteBit(WaitInfo.HasValue);
_worldPacket.FlushBits();
if (SuccessInfo.HasValue)
if (SuccessInfo != null)
{
_worldPacket.WriteUInt32(SuccessInfo.Value.VirtualRealmAddress);
_worldPacket.WriteInt32(SuccessInfo.Value.VirtualRealms.Count);
_worldPacket.WriteUInt32(SuccessInfo.Value.TimeRested);
_worldPacket.WriteUInt8(SuccessInfo.Value.ActiveExpansionLevel);
_worldPacket.WriteUInt8(SuccessInfo.Value.AccountExpansionLevel);
_worldPacket.WriteUInt32(SuccessInfo.Value.TimeSecondsUntilPCKick);
_worldPacket.WriteInt32(SuccessInfo.Value.AvailableClasses.Count);
_worldPacket.WriteInt32(SuccessInfo.Value.Templates.Count);
_worldPacket.WriteUInt32(SuccessInfo.Value.CurrencyID);
_worldPacket.WriteInt64(SuccessInfo.Value.Time);
_worldPacket.WriteUInt32(SuccessInfo.VirtualRealmAddress);
_worldPacket.WriteInt32(SuccessInfo.VirtualRealms.Count);
_worldPacket.WriteUInt32(SuccessInfo.TimeRested);
_worldPacket.WriteUInt8(SuccessInfo.ActiveExpansionLevel);
_worldPacket.WriteUInt8(SuccessInfo.AccountExpansionLevel);
_worldPacket.WriteUInt32(SuccessInfo.TimeSecondsUntilPCKick);
_worldPacket.WriteInt32(SuccessInfo.AvailableClasses.Count);
_worldPacket.WriteInt32(SuccessInfo.Templates.Count);
_worldPacket.WriteUInt32(SuccessInfo.CurrencyID);
_worldPacket.WriteInt64(SuccessInfo.Time);
foreach (var raceClassAvailability in SuccessInfo.Value.AvailableClasses)
foreach (var raceClassAvailability in SuccessInfo.AvailableClasses)
{
_worldPacket.WriteUInt8(raceClassAvailability.RaceID);
_worldPacket.WriteInt32(raceClassAvailability.Classes.Count);
@@ -145,37 +141,37 @@ namespace Game.Networking.Packets
}
}
_worldPacket.WriteBit(SuccessInfo.Value.IsExpansionTrial);
_worldPacket.WriteBit(SuccessInfo.Value.ForceCharacterTemplate);
_worldPacket.WriteBit(SuccessInfo.Value.NumPlayersHorde.HasValue);
_worldPacket.WriteBit(SuccessInfo.Value.NumPlayersAlliance.HasValue);
_worldPacket.WriteBit(SuccessInfo.Value.ExpansionTrialExpiration.HasValue);
_worldPacket.WriteBit(SuccessInfo.IsExpansionTrial);
_worldPacket.WriteBit(SuccessInfo.ForceCharacterTemplate);
_worldPacket.WriteBit(SuccessInfo.NumPlayersHorde.HasValue);
_worldPacket.WriteBit(SuccessInfo.NumPlayersAlliance.HasValue);
_worldPacket.WriteBit(SuccessInfo.ExpansionTrialExpiration.HasValue);
_worldPacket.FlushBits();
{
_worldPacket.WriteUInt32(SuccessInfo.Value.GameTimeInfo.BillingPlan);
_worldPacket.WriteUInt32(SuccessInfo.Value.GameTimeInfo.TimeRemain);
_worldPacket.WriteUInt32(SuccessInfo.Value.GameTimeInfo.Unknown735);
_worldPacket.WriteUInt32(SuccessInfo.GameTimeInfo.BillingPlan);
_worldPacket.WriteUInt32(SuccessInfo.GameTimeInfo.TimeRemain);
_worldPacket.WriteUInt32(SuccessInfo.GameTimeInfo.Unknown735);
// 3x same bit is not a mistake - preserves legacy client behavior of BillingPlanFlags::SESSION_IGR
_worldPacket.WriteBit(SuccessInfo.Value.GameTimeInfo.InGameRoom); // inGameRoom check in function checking which lua event to fire when remaining time is near end - BILLING_NAG_DIALOG vs IGR_BILLING_NAG_DIALOG
_worldPacket.WriteBit(SuccessInfo.Value.GameTimeInfo.InGameRoom); // inGameRoom lua return from Script_GetBillingPlan
_worldPacket.WriteBit(SuccessInfo.Value.GameTimeInfo.InGameRoom); // not used anywhere in the client
_worldPacket.WriteBit(SuccessInfo.GameTimeInfo.InGameRoom); // inGameRoom check in function checking which lua event to fire when remaining time is near end - BILLING_NAG_DIALOG vs IGR_BILLING_NAG_DIALOG
_worldPacket.WriteBit(SuccessInfo.GameTimeInfo.InGameRoom); // inGameRoom lua return from Script_GetBillingPlan
_worldPacket.WriteBit(SuccessInfo.GameTimeInfo.InGameRoom); // not used anywhere in the client
_worldPacket.FlushBits();
}
if (SuccessInfo.Value.NumPlayersHorde.HasValue)
_worldPacket.WriteUInt16(SuccessInfo.Value.NumPlayersHorde.Value);
if (SuccessInfo.NumPlayersHorde.HasValue)
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersHorde.Value);
if (SuccessInfo.Value.NumPlayersAlliance.HasValue)
_worldPacket.WriteUInt16(SuccessInfo.Value.NumPlayersAlliance.Value);
if (SuccessInfo.NumPlayersAlliance.HasValue)
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersAlliance.Value);
if(SuccessInfo.Value.ExpansionTrialExpiration.HasValue)
_worldPacket.WriteInt32(SuccessInfo.Value.ExpansionTrialExpiration.Value);
if(SuccessInfo.ExpansionTrialExpiration.HasValue)
_worldPacket.WriteInt32(SuccessInfo.ExpansionTrialExpiration.Value);
foreach (VirtualRealmInfo virtualRealm in SuccessInfo.Value.VirtualRealms)
foreach (VirtualRealmInfo virtualRealm in SuccessInfo.VirtualRealms)
virtualRealm.Write(_worldPacket);
foreach (var templat in SuccessInfo.Value.Templates)
foreach (var templat in SuccessInfo.Templates)
{
_worldPacket.WriteUInt32(templat.TemplateSetId);
_worldPacket.WriteInt32(templat.Classes.Count);
@@ -198,8 +194,8 @@ namespace Game.Networking.Packets
WaitInfo.Value.Write(_worldPacket);
}
public Optional<AuthSuccessInfo> SuccessInfo; // contains the packet data in case that it has account information (It is never set when WaitInfo is set), otherwise its contents are undefined.
public Optional<AuthWaitInfo> WaitInfo; // contains the queue wait information in case the account is in the login queue.
public AuthSuccessInfo SuccessInfo; // contains the packet data in case that it has account information (It is never set when WaitInfo is set), otherwise its contents are undefined.
public AuthWaitInfo? WaitInfo; // contains the queue wait information in case the account is in the login queue.
public BattlenetRpcErrorCode Result; // the result of the authentication process, possible values are @ref BattlenetRpcErrorCode
public class AuthSuccessInfo
@@ -222,9 +218,9 @@ namespace Game.Networking.Packets
public bool IsExpansionTrial;
public bool ForceCharacterTemplate; // forces the client to always use a character template when creating a new character. @see Templates. @todo implement
public Optional<ushort> NumPlayersHorde; // number of horde players in this realm. @todo implement
public Optional<ushort> NumPlayersAlliance; // number of alliance players in this realm. @todo implement
public Optional<int> ExpansionTrialExpiration; // expansion trial expiration unix timestamp
public ushort? NumPlayersHorde; // number of horde players in this realm. @todo implement
public ushort? NumPlayersAlliance; // number of alliance players in this realm. @todo implement
public int? ExpansionTrialExpiration; // expansion trial expiration unix timestamp
public struct GameTime
{
@@ -502,16 +502,16 @@ namespace Game.Networking.Packets
{
_worldPacket.WriteUInt8(Winner);
_worldPacket.WriteInt32(Duration);
_worldPacket.WriteBit(LogData.HasValue);
_worldPacket.WriteBit(LogData != null);
_worldPacket.FlushBits();
if (LogData.HasValue)
LogData.Value.Write(_worldPacket);
if (LogData != null)
LogData.Write(_worldPacket);
}
public byte Winner;
public int Duration;
public Optional<PVPMatchStatistics> LogData;
public PVPMatchStatistics LogData;
}
//Structs
@@ -561,7 +561,7 @@ namespace Game.Networking.Packets
public class PVPMatchStatistics
{
public List<PVPMatchPlayerStatistics> Statistics = new();
public Optional<RatingData> Ratings;
public RatingData Ratings;
public sbyte[] PlayerCount = new sbyte[2];
public class RatingData
@@ -664,13 +664,13 @@ namespace Game.Networking.Packets
public uint Kills;
public byte Faction;
public bool IsInWorld;
public Optional<HonorData> Honor;
public HonorData? Honor;
public uint DamageDone;
public uint HealingDone;
public Optional<uint> PreMatchRating;
public Optional<int> RatingChange;
public Optional<uint> PreMatchMMR;
public Optional<int> MmrChange;
public uint? PreMatchRating;
public int? RatingChange;
public uint? PreMatchMMR;
public int? MmrChange;
public List<PVPMatchPlayerPVPStat> Stats = new();
public int PrimaryTalentTree;
public int Sex;
@@ -682,13 +682,13 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data)
{
data.WriteBit(Ratings.HasValue);
data.WriteBit(Ratings != null);
data.WriteInt32(Statistics.Count);
foreach (var count in PlayerCount)
data.WriteInt8(count);
if (Ratings.HasValue)
Ratings.Value.Write(data);
if (Ratings != null)
Ratings.Write(data);
foreach (var player in Statistics)
player.Write(data);
@@ -139,7 +139,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
DeclinedNames.Set(new DeclinedName());
DeclinedNames = new();
byte[] declinedNameLengths = new byte[SharedConst.MaxDeclinedNameCases];
@@ -147,7 +147,7 @@ namespace Game.Networking.Packets
declinedNameLengths[i] = _worldPacket.ReadBits<byte>(7);
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; ++i)
DeclinedNames.Value.name[i] = _worldPacket.ReadString(declinedNameLengths[i]);
DeclinedNames.name[i] = _worldPacket.ReadString(declinedNameLengths[i]);
}
Name = _worldPacket.ReadString(nameLength);
@@ -155,7 +155,7 @@ namespace Game.Networking.Packets
public ObjectGuid PetGuid;
public string Name;
public Optional<DeclinedName> DeclinedNames;
public DeclinedName DeclinedNames;
}
class QueryBattlePetName : ClientPacket
@@ -355,7 +355,7 @@ namespace Game.Networking.Packets
public uint MaxHealth;
public uint Speed;
public byte Quality;
public Optional<BattlePetOwnerInfo> OwnerInfo;
public BattlePetOwnerInfo? OwnerInfo;
public string Name;
}
@@ -746,19 +746,19 @@ namespace Game.Networking.Packets
bool hasUnused801_3 = data.HasBit();
if (hasUnused801_1)
Unused801_1.Set(data.ReadPackedGuid());
Unused801_1 = data.ReadPackedGuid();
if (hasUnused801_2)
Unused801_2.Set(data.ReadUInt64());
Unused801_2 = data.ReadUInt64();
if (hasUnused801_3)
Unused801_3.Set(data.ReadUInt64());
Unused801_3 = data.ReadUInt64();
}
public ObjectGuid Guid;
public byte Status;
public byte Moderator;
public Optional<ObjectGuid> Unused801_1;
public Optional<ulong> Unused801_2;
public Optional<ulong> Unused801_3;
public ObjectGuid? Unused801_1;
public ulong? Unused801_2;
public ulong? Unused801_3;
}
class CalendarAddEventInfo
@@ -72,7 +72,7 @@ namespace Game.Networking.Packets
public bool IsAlliedRacesCreationAllowed;
public int MaxCharacterLevel = 1;
public Optional<uint> DisabledClassesMask = new();
public uint? DisabledClassesMask = new();
public List<CharacterInfo> Characters = new(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new(); //
@@ -364,7 +364,7 @@ namespace Game.Networking.Packets
CreateInfo.Name = _worldPacket.ReadString(nameLength);
if (CreateInfo.TemplateSet.HasValue)
CreateInfo.TemplateSet.Set(_worldPacket.ReadUInt32());
CreateInfo.TemplateSet = _worldPacket.ReadUInt32();
for (var i = 0; i < customizationCount; ++i)
{
@@ -435,10 +435,7 @@ namespace Game.Networking.Packets
public class CharacterRenameResult : ServerPacket
{
public CharacterRenameResult() : base(ServerOpcodes.CharacterRenameResult)
{
Guid = new Optional<ObjectGuid>();
}
public CharacterRenameResult() : base(ServerOpcodes.CharacterRenameResult) { }
public override void Write()
{
@@ -454,8 +451,8 @@ namespace Game.Networking.Packets
}
public string Name;
public ResponseCodes Result = 0;
public Optional<ObjectGuid> Guid;
public ResponseCodes Result;
public ObjectGuid? Guid;
}
public class CharCustomize : ClientPacket
@@ -523,27 +520,24 @@ namespace Game.Networking.Packets
public class CharFactionChangeResult : ServerPacket
{
public CharFactionChangeResult() : base(ServerOpcodes.CharFactionChangeResult)
{
Display = new Optional<CharFactionChangeDisplayInfo>();
}
public CharFactionChangeResult() : base(ServerOpcodes.CharFactionChangeResult) { }
public override void Write()
{
_worldPacket.WriteUInt8((byte)Result);
_worldPacket.WritePackedGuid(Guid);
_worldPacket.WriteBit(Display.HasValue);
_worldPacket.WriteBit(Display != null);
_worldPacket.FlushBits();
if (Display.HasValue)
if (Display != null)
{
_worldPacket.WriteBits(Display.Value.Name.GetByteCount(), 6);
_worldPacket.WriteUInt8(Display.Value.SexID);
_worldPacket.WriteUInt8(Display.Value.RaceID);
_worldPacket.WriteInt32(Display.Value.Customizations.Count);
_worldPacket.WriteString(Display.Value.Name);
_worldPacket.WriteBits(Display.Name.GetByteCount(), 6);
_worldPacket.WriteUInt8(Display.SexID);
_worldPacket.WriteUInt8(Display.RaceID);
_worldPacket.WriteInt32(Display.Customizations.Count);
_worldPacket.WriteString(Display.Name);
foreach (ChrCustomizationChoice customization in Display.Value.Customizations)
foreach (ChrCustomizationChoice customization in Display.Customizations)
{
_worldPacket.WriteUInt32(customization.ChrCustomizationOptionID);
_worldPacket.WriteUInt32(customization.ChrCustomizationChoiceID);
@@ -553,7 +547,7 @@ namespace Game.Networking.Packets
public ResponseCodes Result = 0;
public ObjectGuid Guid;
public Optional<CharFactionChangeDisplayInfo> Display;
public CharFactionChangeDisplayInfo Display;
public class CharFactionChangeDisplayInfo
{
@@ -1085,7 +1079,7 @@ namespace Game.Networking.Packets
public Class ClassId = Class.None;
public Gender Sex = Gender.None;
public Array<ChrCustomizationChoice> Customizations = new(50);
public Optional<uint> TemplateSet = new();
public uint? TemplateSet;
public bool IsTrialBoost;
public bool UseNPE;
public string Name;
@@ -97,13 +97,13 @@ namespace Game.Networking.Packets
{
uint targetLen = _worldPacket.ReadBits<uint>(9);
Params.Read(_worldPacket);
ChannelGUID.Set(_worldPacket.ReadPackedGuid());
ChannelGUID = _worldPacket.ReadPackedGuid();
Target = _worldPacket.ReadString(targetLen);
}
public string Target;
public ChatAddonMessageParams Params = new();
public Optional<ObjectGuid> ChannelGUID; // not optional in the packet. Optional for api reasons
public ObjectGuid? ChannelGUID; // not optional in the packet. Optional for api reasons
}
public class ChatMessageDND : ClientPacket
@@ -266,10 +266,10 @@ namespace Game.Networking.Packets
public uint AchievementID;
public ChatFlags _ChatFlags;
public float DisplayTime;
public Optional<uint> Unused_801;
public uint? Unused_801;
public bool HideChatLog;
public bool FakeSenderName;
public Optional<ObjectGuid> ChannelGUID;
public ObjectGuid? ChannelGUID;
}
public class EmoteMessage : ServerPacket
@@ -81,11 +81,11 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(Flags, 7);
_worldPacket.WriteBit(false); // Debug info
WriteLogDataBit();
_worldPacket.WriteBit(ContentTuning.HasValue);
_worldPacket.WriteBit(ContentTuning != null);
FlushBits();
WriteLogData();
if (ContentTuning.HasValue)
ContentTuning.Value.Write(_worldPacket);
if (ContentTuning != null)
ContentTuning.Write(_worldPacket);
}
public ObjectGuid Me;
@@ -103,7 +103,7 @@ namespace Game.Networking.Packets
public int Absorbed;
public int Flags;
// Optional<SpellNonMeleeDamageLogDebugInfo> DebugInfo;
public Optional<ContentTuningParams> ContentTuning = new();
public ContentTuningParams ContentTuning;
}
class EnvironmentalDamageLog : CombatLogServerPacket
@@ -213,7 +213,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(CritRollMade.HasValue);
_worldPacket.WriteBit(CritRollNeeded.HasValue);
WriteLogDataBit();
_worldPacket.WriteBit(ContentTuning.HasValue);
_worldPacket.WriteBit(ContentTuning != null);
FlushBits();
WriteLogData();
@@ -224,8 +224,8 @@ namespace Game.Networking.Packets
if (CritRollNeeded.HasValue)
_worldPacket.WriteFloat(CritRollNeeded.Value);
if (ContentTuning.HasValue)
ContentTuning.Value.Write(_worldPacket);
if (ContentTuning != null)
ContentTuning.Write(_worldPacket);
}
public ObjectGuid CasterGUID;
@@ -236,9 +236,9 @@ namespace Game.Networking.Packets
public uint OverHeal;
public uint Absorbed;
public bool Crit;
public Optional<float> CritRollMade;
public Optional<float> CritRollNeeded;
Optional<ContentTuningParams> ContentTuning = new();
public float? CritRollMade;
public float? CritRollNeeded;
public ContentTuningParams ContentTuning;
}
class SpellPeriodicAuraLog : CombatLogServerPacket
@@ -284,11 +284,11 @@ namespace Game.Networking.Packets
data.WriteBit(Crit);
data.WriteBit(DebugInfo.HasValue);
data.WriteBit(ContentTuning.HasValue);
data.WriteBit(ContentTuning != null);
data.FlushBits();
if (ContentTuning.HasValue)
ContentTuning.Value.Write(data);
if (ContentTuning != null)
ContentTuning.Write(data);
if (DebugInfo.HasValue)
{
@@ -305,8 +305,8 @@ namespace Game.Networking.Packets
public uint AbsorbedOrAmplitude;
public uint Resisted;
public bool Crit;
public Optional<PeriodicalAuraLogEffectDebugInfo> DebugInfo;
public Optional<ContentTuningParams> ContentTuning = new();
public PeriodicalAuraLogEffectDebugInfo? DebugInfo;
public ContentTuningParams ContentTuning;
}
}
@@ -450,8 +450,8 @@ namespace Game.Networking.Packets
public ObjectGuid Caster;
public ObjectGuid Target;
public uint SpellID;
public Optional<float> Rolled;
public Optional<float> Needed;
public float? Rolled;
public float? Needed;
}
class SpellOrDamageImmune : ServerPacket
@@ -505,10 +505,7 @@ namespace Game.Networking.Packets
class AttackerStateUpdate : CombatLogServerPacket
{
public AttackerStateUpdate() : base(ServerOpcodes.AttackerStateUpdate, ConnectionType.Instance)
{
SubDmg = new Optional<SubDamage>();
}
public AttackerStateUpdate() : base(ServerOpcodes.AttackerStateUpdate, ConnectionType.Instance) { }
public override void Write()
{
@@ -587,7 +584,7 @@ namespace Game.Networking.Packets
public int Damage;
public int OriginalDamage;
public int OverDamage = -1; // (damage - health) or -1 if unit is still alive
public Optional<SubDamage> SubDmg;
public SubDamage? SubDmg;
public byte VictimState;
public uint AttackerState;
public uint MeleeSpellID;
@@ -684,7 +681,6 @@ namespace Game.Networking.Packets
{
Victim = victim;
MissReason = missReason;
Debug = new Optional<SpellLogMissDebug>();
}
public void Write(WorldPacket data)
@@ -699,15 +695,15 @@ namespace Game.Networking.Packets
public ObjectGuid Victim;
public byte MissReason;
Optional<SpellLogMissDebug> Debug;
SpellLogMissDebug? Debug;
}
struct SpellDispellData
{
public uint SpellID;
public bool Harmful;
public Optional<int> Rolled;
public Optional<int> Needed;
public int? Rolled;
public int? Needed;
}
public struct SubDamage
@@ -441,11 +441,11 @@ namespace Game.Networking.Packets
data.WriteUInt32(FollowerXP);
data.WriteUInt32(GarrMssnBonusAbilityID);
data.WriteInt32(ItemFileDataID);
data.WriteBit(ItemInstance.HasValue);
data.WriteBit(ItemInstance != null);
data.FlushBits();
if (ItemInstance.HasValue)
ItemInstance.Value.Write(data);
if (ItemInstance != null)
ItemInstance.Write(data);
}
public int ItemID;
@@ -455,7 +455,7 @@ namespace Game.Networking.Packets
public uint FollowerXP;
public uint GarrMssnBonusAbilityID;
public int ItemFileDataID;
public Optional<ItemInstance> ItemInstance;
public ItemInstance ItemInstance;
}
struct GarrisonMissionBonusAbility
@@ -501,7 +501,7 @@ namespace Game.Networking.Packets
public int Rank;
public long ResearchStartTime;
public int Flags;
public Optional<GarrisonTalentSocketData> Socket;
public GarrisonTalentSocketData? Socket;
}
struct GarrisonCollectionEntry
+25 -25
View File
@@ -234,11 +234,11 @@ namespace Game.Networking.Packets
Name = _worldPacket.ReadString(nameLen);
if (hasUnused910)
Unused910.Set(_worldPacket.ReadInt32());
Unused910 = _worldPacket.ReadInt32();
}
public string Name;
public Optional<int> Unused910;
public int? Unused910;
}
public class GuildInvite : ServerPacket
@@ -1094,13 +1094,13 @@ namespace Game.Networking.Packets
ContainerItemSlot = _worldPacket.ReadUInt8();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
}
@@ -1116,13 +1116,13 @@ namespace Game.Networking.Packets
ContainerItemSlot = _worldPacket.ReadUInt8();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
}
@@ -1138,13 +1138,13 @@ namespace Game.Networking.Packets
ContainerItemSlot = _worldPacket.ReadUInt8();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
}
@@ -1199,13 +1199,13 @@ namespace Game.Networking.Packets
StackCount = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
public uint StackCount;
}
@@ -1223,13 +1223,13 @@ namespace Game.Networking.Packets
StackCount = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
public uint StackCount;
}
@@ -1247,13 +1247,13 @@ namespace Game.Networking.Packets
StackCount = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
public uint StackCount;
}
@@ -1271,13 +1271,13 @@ namespace Game.Networking.Packets
StackCount = _worldPacket.ReadUInt32();
if (_worldPacket.HasBit())
ContainerSlot.Set(_worldPacket.ReadUInt8());
ContainerSlot = _worldPacket.ReadUInt8();
}
public ObjectGuid Banker;
public byte BankTab;
public byte BankSlot;
public Optional<byte> ContainerSlot;
public byte? ContainerSlot;
public byte ContainerItemSlot;
public uint StackCount;
}
@@ -1398,7 +1398,7 @@ namespace Game.Networking.Packets
public int Tab;
public List<GuildBankLogEntry> Entry;
public Optional<ulong> WeeklyBonusMoney;
public ulong? WeeklyBonusMoney;
}
public class GuildBankTextQuery : ClientPacket
@@ -1765,10 +1765,10 @@ namespace Game.Networking.Packets
public ObjectGuid PlayerGUID;
public uint TimeOffset;
public sbyte EntryType;
public Optional<ulong> Money;
public Optional<int> ItemID;
public Optional<int> Count;
public Optional<sbyte> OtherTab;
public ulong? Money;
public int? ItemID;
public int? Count;
public sbyte? OtherTab;
}
public class GuildNewsEvent
@@ -1789,11 +1789,11 @@ namespace Game.Networking.Packets
foreach (ObjectGuid memberGuid in MemberList)
data.WritePackedGuid(memberGuid);
data.WriteBit(Item.HasValue);
data.WriteBit(Item != null);
data.FlushBits();
if (Item.HasValue)
Item.Value.Write(data);
if (Item != null)
Item.Write(data);
}
public int Id;
@@ -1803,6 +1803,6 @@ namespace Game.Networking.Packets
public int[] Data = new int[2];
public ObjectGuid MemberGuid;
public List<ObjectGuid> MemberList = new();
public Optional<ItemInstance> Item;
public ItemInstance Item;
}
}
@@ -82,7 +82,7 @@ namespace Game.Networking.Packets
public List<ushort> Glyphs = new();
public List<ushort> Talents = new();
public Array<ushort> PvpTalents = new(PlayerConst.MaxPvpTalentSlots, 0);
public Optional<InspectGuildData> GuildData = new();
public InspectGuildData? GuildData;
public Array<PVPBracketData> Bracket = new(6, default);
public uint? AzeriteLevel;
public int ItemLevel;
+23 -26
View File
@@ -148,15 +148,15 @@ namespace Game.Networking.Packets
{
_worldPacket.WritePackedGuid(ItemGUID);
_worldPacket.WriteUInt8(Result);
_worldPacket.WriteBit(Contents.HasValue);
_worldPacket.WriteBit(Contents != null);
_worldPacket.FlushBits();
if (Contents.HasValue)
Contents.Value.Write(_worldPacket);
if (Contents != null)
Contents.Write(_worldPacket);
}
public byte Result;
public ObjectGuid ItemGUID;
public Optional<ItemPurchaseContents> Contents;
public ItemPurchaseContents Contents;
}
class ItemExpirePurchaseRefund : ServerPacket
@@ -844,7 +844,7 @@ namespace Game.Networking.Packets
public class ItemInstance
{
public uint ItemID;
public Optional<ItemBonuses> ItemBonus;
public ItemBonuses ItemBonus;
public ItemModList Modifications = new();
public ItemInstance() { }
@@ -855,9 +855,9 @@ namespace Game.Networking.Packets
List<uint> bonusListIds = item.m_itemData.BonusListIDs;
if (!bonusListIds.Empty())
{
ItemBonus.Value = new();
ItemBonus.Value.BonusListIDs.AddRange(bonusListIds);
ItemBonus.Value.Context = item.GetContext();
ItemBonus = new();
ItemBonus.BonusListIDs.AddRange(bonusListIds);
ItemBonus.Context = item.GetContext();
}
foreach (var mod in item.m_itemData.Modifiers.GetValue().Values)
@@ -870,11 +870,11 @@ namespace Game.Networking.Packets
if (!lootItem.BonusListIDs.Empty() || lootItem.randomBonusListId != 0)
{
ItemBonus.Value = new();
ItemBonus.Value.BonusListIDs = lootItem.BonusListIDs;
ItemBonus.Value.Context = lootItem.context;
ItemBonus = new();
ItemBonus.BonusListIDs = lootItem.BonusListIDs;
ItemBonus.Context = lootItem.context;
if (lootItem.randomBonusListId != 0)
ItemBonus.Value.BonusListIDs.Add(lootItem.randomBonusListId);
ItemBonus.BonusListIDs.Add(lootItem.randomBonusListId);
}
}
@@ -890,9 +890,9 @@ namespace Game.Networking.Packets
if (!voidItem.BonusListIDs.Empty())
{
ItemBonus.Value = new();
ItemBonus.Value.Context = voidItem.Context;
ItemBonus.Value.BonusListIDs = voidItem.BonusListIDs;
ItemBonus = new();
ItemBonus.Context = voidItem.Context;
ItemBonus.BonusListIDs = voidItem.BonusListIDs;
}
}
@@ -907,20 +907,20 @@ namespace Game.Networking.Packets
bonus.BonusListIDs.Add(bonusListId);
if (bonus.Context != 0 || !bonus.BonusListIDs.Empty())
ItemBonus.Set(bonus);
ItemBonus = bonus;
}
public void Write(WorldPacket data)
{
data.WriteUInt32(ItemID);
data.WriteBit(ItemBonus.HasValue);
data.WriteBit(ItemBonus != null);
data.FlushBits();
Modifications.Write(data);
if (ItemBonus.HasValue)
ItemBonus.Value.Write(data);
if (ItemBonus != null)
ItemBonus.Write(data);
}
public void Read(WorldPacket data)
@@ -928,14 +928,14 @@ namespace Game.Networking.Packets
ItemID = data.ReadUInt32();
if (data.HasBit())
ItemBonus.Value = new();
ItemBonus = new();
data.ResetBitPos();
Modifications.Read(data);
if (ItemBonus.HasValue)
ItemBonus.Value.Read(data);
if (ItemBonus != null)
ItemBonus.Read(data);
}
public override int GetHashCode()
@@ -956,15 +956,12 @@ namespace Game.Networking.Packets
if (left.ItemID != right.ItemID)
return false;
if (left.ItemBonus.HasValue != right.ItemBonus.HasValue)
if (left.ItemBonus != null && right.ItemBonus != null && left.ItemBonus != right.ItemBonus)
return false;
if (left.Modifications != right.Modifications)
return false;
if (left.ItemBonus.HasValue && left.ItemBonus.Value != right.ItemBonus.Value)
return false;
return true;
}
+19 -16
View File
@@ -468,7 +468,7 @@ namespace Game.Networking.Packets
public class LFGBlackList
{
public Optional<ObjectGuid> PlayerGuid;
public ObjectGuid? PlayerGuid;
public List<LFGBlackListSlot> Slot = new();
public void Write(WorldPacket data)
@@ -564,10 +564,10 @@ namespace Game.Networking.Packets
public List<LfgPlayerQuestRewardItem> Item = new();
public List<LfgPlayerQuestRewardCurrency> Currency = new();
public List<LfgPlayerQuestRewardCurrency> BonusCurrency = new();
public Optional<int> RewardSpellID; // Only used by SMSG_LFG_PLAYER_INFO
public Optional<int> Unused1;
public Optional<ulong> Unused2;
public Optional<int> Honor; // Only used by SMSG_REQUEST_PVP_REWARDS_RESPONSE
public int? RewardSpellID; // Only used by SMSG_LFG_PLAYER_INFO
public int? Unused1;
public ulong? Unused2;
public int? Honor; // Only used by SMSG_REQUEST_PVP_REWARDS_RESPONSE
}
public class LfgPlayerDungeonInfo
@@ -659,7 +659,7 @@ namespace Game.Networking.Packets
slot.Write(data);
}
public Optional<ObjectGuid> PlayerGuid;
public ObjectGuid? PlayerGuid;
public List<LFGBlackListSlot> Slot = new();
}
@@ -669,34 +669,37 @@ namespace Game.Networking.Packets
{
Quantity = quantity;
BonusQuantity = bonusQuantity;
RewardItem = new Optional<ItemInstance>();
RewardCurrency = new Optional<uint>();
RewardItem = null;
RewardCurrency = null;
if (!isCurrency)
{
RewardItem.Value = new();
RewardItem.Value.ItemID = id;
RewardItem = new();
RewardItem.ItemID = id;
}
else
{
RewardCurrency.Set(id);
RewardCurrency = id;
}
}
public void Write(WorldPacket data)
{
data.WriteBit(RewardItem.HasValue);
data.WriteBit(RewardItem != null);
data.WriteBit(RewardCurrency.HasValue);
if (RewardItem.HasValue)
RewardItem.Value.Write(data);
if (RewardItem != null)
RewardItem.Write(data);
data.WriteUInt32(Quantity);
data.WriteInt32(BonusQuantity);
if (RewardCurrency.HasValue)
data.WriteUInt32(RewardCurrency.Value);
}
public Optional<ItemInstance> RewardItem;
public Optional<uint> RewardCurrency;
public ItemInstance RewardItem;
public uint? RewardCurrency;
public uint Quantity;
public int BonusQuantity;
}
@@ -247,8 +247,8 @@ namespace Game.Networking.Packets
public ObjectGuid Owner;
public ObjectGuid LootObj;
public Optional<ObjectGuid> Master;
public Optional<ObjectGuid> RoundRobinWinner;
public ObjectGuid? Master;
public ObjectGuid? RoundRobinWinner;
}
class SetLootSpecialization : ClientPacket
@@ -384,13 +384,13 @@ namespace Game.Networking.Packets
switch (mail.messageType)
{
case MailMessageType.Normal:
SenderCharacter.Set(ObjectGuid.Create(HighGuid.Player, mail.sender));
SenderCharacter = ObjectGuid.Create(HighGuid.Player, mail.sender);
break;
case MailMessageType.Creature:
case MailMessageType.Gameobject:
case MailMessageType.Auction:
case MailMessageType.Calendar:
AltSenderID.Set((uint)mail.sender);
AltSenderID = (uint)mail.sender;
break;
}
@@ -443,8 +443,8 @@ namespace Game.Networking.Packets
public int MailID;
public byte SenderType;
public Optional<ObjectGuid> SenderCharacter;
public Optional<uint> AltSenderID;
public ObjectGuid? SenderCharacter;
public uint? AltSenderID;
public ulong Cod;
public int StationeryID;
public ulong SentMoney;
+23 -23
View File
@@ -156,13 +156,13 @@ namespace Game.Networking.Packets
public uint Type;
public int Quantity;
public uint Flags;
public Optional<int> WeeklyQuantity;
public Optional<int> TrackedQuantity;
public Optional<int> MaxQuantity;
public Optional<int> Unused901;
public Optional<int> QuantityChange;
public Optional<int> QuantityGainSource;
public Optional<int> QuantityLostSource;
public int? WeeklyQuantity;
public int? TrackedQuantity;
public int? MaxQuantity;
public int? Unused901;
public int? QuantityChange;
public int? QuantityGainSource;
public int? QuantityLostSource;
public bool SuppressChatLog;
}
@@ -232,11 +232,11 @@ namespace Game.Networking.Packets
{
public uint Type;
public uint Quantity;
public Optional<uint> WeeklyQuantity; // Currency count obtained this Week.
public Optional<uint> MaxWeeklyQuantity; // Weekly Currency cap.
public Optional<uint> TrackedQuantity;
public Optional<int> MaxQuantity;
public Optional<int> Unused901;
public uint? WeeklyQuantity; // Currency count obtained this Week.
public uint? MaxWeeklyQuantity; // Weekly Currency cap.
public uint? TrackedQuantity;
public int? MaxQuantity;
public int? Unused901;
public byte Flags; // 0 = none,
}
}
@@ -358,10 +358,10 @@ namespace Game.Networking.Packets
{
public WorldServerInfo() : base(ServerOpcodes.WorldServerInfo, ConnectionType.Instance)
{
InstanceGroupSize = new Optional<uint>();
InstanceGroupSize = new uint?();
RestrictedAccountMaxLevel = new Optional<uint>();
RestrictedAccountMaxMoney = new Optional<ulong>();
RestrictedAccountMaxLevel = new uint?();
RestrictedAccountMaxMoney = new ulong?();
}
public override void Write()
@@ -390,9 +390,9 @@ namespace Game.Networking.Packets
public bool XRealmPvpAlert;
public bool BlockExitingLoadingScreen; // when set to true, sending SMSG_UPDATE_OBJECT with CreateObject Self bit = true will not hide loading screen
// instead it will be done after this packet is sent again with false in this bit and SMSG_UPDATE_OBJECT Values for player
public Optional<uint> RestrictedAccountMaxLevel;
public Optional<ulong> RestrictedAccountMaxMoney;
public Optional<uint> InstanceGroupSize;
public uint? RestrictedAccountMaxLevel;
public ulong? RestrictedAccountMaxMoney;
public uint? InstanceGroupSize;
}
public class SetDungeonDifficulty : ClientPacket
@@ -1306,12 +1306,12 @@ namespace Game.Networking.Packets
public DisplayGameError(GameError error, int arg) : this(error)
{
Arg.Set(arg);
Arg = arg;
}
public DisplayGameError(GameError error, int arg1, int arg2) : this(error)
{
Arg.Set(arg1);
Arg2.Set(arg2);
Arg = arg1;
Arg2 = arg2;
}
public override void Write()
@@ -1329,8 +1329,8 @@ namespace Game.Networking.Packets
}
GameError Error;
Optional<int> Arg;
Optional<int> Arg2;
int? Arg;
int? Arg2;
}
class AccountMountUpdate : ServerPacket
@@ -207,9 +207,9 @@ namespace Game.Networking.Packets
bool hasFadeObjectTime = data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.FadeObject) && moveSpline.effect_start_time < moveSpline.Duration());
data.WriteBits(moveSpline.GetPath().Length, 16);
data.WriteBit(false); // HasSplineFilter
data.WriteBit(moveSpline.spell_effect_extra.HasValue); // HasSpellEffectExtraData
bool hasJumpExtraData = data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.Parabolic) && (!moveSpline.spell_effect_extra.HasValue || moveSpline.effect_start_time != 0));
data.WriteBit(moveSpline.anim_tier.HasValue); // HasAnimationTierTransition
data.WriteBit(moveSpline.spell_effect_extra != null); // HasSpellEffectExtraData
bool hasJumpExtraData = data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.Parabolic) && (moveSpline.spell_effect_extra == null || moveSpline.effect_start_time != 0));
data.WriteBit(moveSpline.anim_tier != null); // HasAnimationTierTransition
data.WriteBit(false); // HasUnknown901
data.FlushBits();
@@ -245,12 +245,12 @@ namespace Game.Networking.Packets
foreach (var vec in moveSpline.GetPath())
data.WriteVector3(vec);
if (moveSpline.spell_effect_extra.HasValue)
if (moveSpline.spell_effect_extra != null)
{
data.WritePackedGuid(moveSpline.spell_effect_extra.Value.Target);
data.WriteUInt32(moveSpline.spell_effect_extra.Value.SpellVisualId);
data.WriteUInt32(moveSpline.spell_effect_extra.Value.ProgressCurveId);
data.WriteUInt32(moveSpline.spell_effect_extra.Value.ParabolicCurveId);
data.WritePackedGuid(moveSpline.spell_effect_extra.Target);
data.WriteUInt32(moveSpline.spell_effect_extra.SpellVisualId);
data.WriteUInt32(moveSpline.spell_effect_extra.ProgressCurveId);
data.WriteUInt32(moveSpline.spell_effect_extra.ParabolicCurveId);
}
if (hasJumpExtraData)
@@ -260,12 +260,12 @@ namespace Game.Networking.Packets
data.WriteUInt32(0); // Duration (override)
}
if (moveSpline.anim_tier.HasValue)
if (moveSpline.anim_tier != null)
{
data.WriteUInt32(moveSpline.anim_tier.Value.TierTransitionId);
data.WriteUInt32(moveSpline.anim_tier.TierTransitionId);
data.WriteInt32(moveSpline.effect_start_time);
data.WriteUInt32(0);
data.WriteUInt8(moveSpline.anim_tier.Value.AnimTier);
data.WriteUInt8(moveSpline.anim_tier.AnimTier);
}
//if (HasUnknown901)
@@ -377,32 +377,35 @@ namespace Game.Networking.Packets
if (splineFlags.HasFlag(SplineFlag.Animation))
{
movementSpline.AnimTierTransition.Value = new();
movementSpline.AnimTierTransition.Value.TierTransitionID = (int)moveSpline.anim_tier.Value.TierTransitionId;
movementSpline.AnimTierTransition.Value.StartTime = (uint)moveSpline.effect_start_time;
movementSpline.AnimTierTransition.Value.AnimTier = moveSpline.anim_tier.Value.AnimTier;
MonsterSplineAnimTierTransition animTierTransition = new();
animTierTransition.TierTransitionID = (int)moveSpline.anim_tier.TierTransitionId;
animTierTransition.StartTime = (uint)moveSpline.effect_start_time;
animTierTransition.AnimTier = moveSpline.anim_tier.AnimTier;
movementSpline.AnimTierTransition = animTierTransition;
}
movementSpline.MoveTime = (uint)moveSpline.Duration();
if (splineFlags.HasFlag(SplineFlag.Parabolic) && (!moveSpline.spell_effect_extra.HasValue || moveSpline.effect_start_time != 0))
if (splineFlags.HasFlag(SplineFlag.Parabolic) && (moveSpline.spell_effect_extra == null || moveSpline.effect_start_time != 0))
{
movementSpline.JumpExtraData.Value = new();
movementSpline.JumpExtraData.Value.JumpGravity = moveSpline.vertical_acceleration;
movementSpline.JumpExtraData.Value.StartTime = (uint)moveSpline.effect_start_time;
MonsterSplineJumpExtraData jumpExtraData = new();
jumpExtraData.JumpGravity = moveSpline.vertical_acceleration;
jumpExtraData.StartTime = (uint)moveSpline.effect_start_time;
movementSpline.JumpExtraData = jumpExtraData;
}
if (splineFlags.HasFlag(SplineFlag.FadeObject))
movementSpline.FadeObjectTime = (uint)moveSpline.effect_start_time;
if (moveSpline.spell_effect_extra.HasValue)
if (moveSpline.spell_effect_extra != null)
{
movementSpline.SpellEffectExtraData.Value = new();
movementSpline.SpellEffectExtraData.Value.TargetGuid = moveSpline.spell_effect_extra.Value.Target;
movementSpline.SpellEffectExtraData.Value.SpellVisualID = moveSpline.spell_effect_extra.Value.SpellVisualId;
movementSpline.SpellEffectExtraData.Value.ProgressCurveID = moveSpline.spell_effect_extra.Value.ProgressCurveId;
movementSpline.SpellEffectExtraData.Value.ParabolicCurveID = moveSpline.spell_effect_extra.Value.ParabolicCurveId;
movementSpline.SpellEffectExtraData.Value.JumpGravity = moveSpline.vertical_acceleration;
MonsterSplineSpellEffectExtraData spellEffectExtraData = new();
spellEffectExtraData.TargetGuid = moveSpline.spell_effect_extra.Target;
spellEffectExtraData.SpellVisualID = moveSpline.spell_effect_extra.SpellVisualId;
spellEffectExtraData.ProgressCurveID = moveSpline.spell_effect_extra.ProgressCurveId;
spellEffectExtraData.ParabolicCurveID = moveSpline.spell_effect_extra.ParabolicCurveId;
spellEffectExtraData.JumpGravity = moveSpline.vertical_acceleration;
movementSpline.SpellEffectExtraData = spellEffectExtraData;
}
Spline spline = moveSpline.spline;
@@ -540,11 +543,7 @@ namespace Game.Networking.Packets
public class TransferPending : ServerPacket
{
public TransferPending() : base(ServerOpcodes.TransferPending)
{
Ship = new Optional<ShipTransferPending>();
TransferSpellID = new Optional<int>();
}
public TransferPending() : base(ServerOpcodes.TransferPending) { }
public override void Write()
{
@@ -566,8 +565,8 @@ namespace Game.Networking.Packets
public int MapID = -1;
public Position OldMapPosition;
public Optional<ShipTransferPending> Ship;
public Optional<int> TransferSpellID;
public ShipTransferPending? Ship;
public int? TransferSpellID;
public struct ShipTransferPending
{
@@ -649,10 +648,10 @@ namespace Game.Networking.Packets
}
public Position Pos;
public Optional<VehicleTeleport> Vehicle;
public VehicleTeleport? Vehicle;
public uint SequenceIndex;
public ObjectGuid MoverGUID;
public Optional<ObjectGuid> TransportGUID;
public ObjectGuid? TransportGUID;
public float Facing;
public byte PreloadWorld;
}
@@ -711,15 +710,15 @@ namespace Game.Networking.Packets
public MovementInfo Status;
public List<MovementForce> MovementForces;
public Optional<float> SwimBackSpeed;
public Optional<float> FlightSpeed;
public Optional<float> SwimSpeed;
public Optional<float> WalkSpeed;
public Optional<float> TurnRate;
public Optional<float> RunSpeed;
public Optional<float> FlightBackSpeed;
public Optional<float> RunBackSpeed;
public Optional<float> PitchRate;
public float? SwimBackSpeed;
public float? FlightSpeed;
public float? SwimSpeed;
public float? WalkSpeed;
public float? TurnRate;
public float? RunSpeed;
public float? FlightBackSpeed;
public float? RunBackSpeed;
public float? PitchRate;
}
class MoveApplyMovementForce : ServerPacket
@@ -915,13 +914,13 @@ namespace Game.Networking.Packets
Ack.Read(_worldPacket);
if (_worldPacket.HasBit())
{
Speeds.Value = new();
Speeds = new();
Speeds.Value.Read(_worldPacket);
}
}
public MovementAck Ack;
public Optional<MoveKnockBackSpeeds> Speeds;
public MoveKnockBackSpeeds? Speeds;
}
class MoveSetCollisionHeight : ServerPacket
@@ -1167,12 +1166,12 @@ namespace Game.Networking.Packets
data.WriteBit(KnockBack.HasValue);
data.WriteBit(VehicleRecID.HasValue);
data.WriteBit(CollisionHeight.HasValue);
data.WriteBit(MovementForce_.HasValue);
data.WriteBit(@MovementForce != null);
data.WriteBit(MovementForceGUID.HasValue);
data.FlushBits();
if (MovementForce_.HasValue)
MovementForce_.Value.Write(data);
if (@MovementForce != null)
@MovementForce.Write(data);
@@ -1203,12 +1202,12 @@ namespace Game.Networking.Packets
public ServerOpcodes MessageID;
public uint SequenceIndex;
public Optional<float> Speed;
public Optional<KnockBackInfo> KnockBack;
public Optional<int> VehicleRecID;
public Optional<CollisionHeightInfo> CollisionHeight;
public Optional<MovementForce> MovementForce_;
public Optional<ObjectGuid> MovementForceGUID;
public float? Speed;
public KnockBackInfo? KnockBack;
public int? VehicleRecID;
public CollisionHeightInfo? CollisionHeight;
public MovementForce MovementForce;
public ObjectGuid? MovementForceGUID;
}
}
@@ -1363,15 +1362,15 @@ namespace Game.Networking.Packets
data.WriteBit(VehicleExitVoluntary);
data.WriteBit(Interpolate);
data.WriteBits(PackedDeltas.Count, 16);
data.WriteBit(SplineFilter.HasValue);
data.WriteBit(SplineFilter != null);
data.WriteBit(SpellEffectExtraData.HasValue);
data.WriteBit(JumpExtraData.HasValue);
data.WriteBit(AnimTierTransition.HasValue);
data.WriteBit(Unknown901.HasValue);
data.WriteBit(Unknown901 != null);
data.FlushBits();
if (SplineFilter.HasValue)
SplineFilter.Value.Write(data);
if (SplineFilter != null)
SplineFilter.Write(data);
switch (Face)
{
@@ -1402,8 +1401,8 @@ namespace Game.Networking.Packets
if (AnimTierTransition.HasValue)
AnimTierTransition.Value.Write(data);
if (Unknown901.HasValue)
Unknown901.Value.Write(data);
if (Unknown901 != null)
Unknown901.Write(data);
}
public uint Flags; // Spline flags
@@ -1418,11 +1417,11 @@ namespace Game.Networking.Packets
public ObjectGuid TransportGUID;
public sbyte VehicleSeat = -1;
public List<Vector3> PackedDeltas = new();
public Optional<MonsterSplineFilter> SplineFilter;
public Optional<MonsterSplineSpellEffectExtraData> SpellEffectExtraData;
public Optional<MonsterSplineJumpExtraData> JumpExtraData;
public Optional<MonsterSplineAnimTierTransition> AnimTierTransition;
public Optional<MonsterSplineUnknown901> Unknown901;
public MonsterSplineFilter SplineFilter;
public MonsterSplineSpellEffectExtraData? SpellEffectExtraData;
public MonsterSplineJumpExtraData? JumpExtraData;
public MonsterSplineAnimTierTransition? AnimTierTransition;
public MonsterSplineUnknown901 Unknown901;
public float FaceDirection;
public ObjectGuid FaceGUID;
public Vector3 FaceSpot;
+1 -1
View File
@@ -329,7 +329,7 @@ namespace Game.Networking.Packets
public string Text;
public string Confirm;
public TreasureLootList Treasure = new();
public Optional<int> SpellID;
public int? SpellID;
}
public class ClientGossipText
+16 -16
View File
@@ -150,12 +150,12 @@ namespace Game.Networking.Packets
bool hasRolesDesired = _worldPacket.HasBit();
if (hasRolesDesired)
RolesDesired.Set(_worldPacket.ReadUInt32());
RolesDesired = _worldPacket.ReadUInt32();
}
public byte PartyIndex;
public bool Accept;
public Optional<uint> RolesDesired;
public uint? RolesDesired;
}
class PartyUninvite : ClientPacket
@@ -319,14 +319,14 @@ namespace Game.Networking.Packets
{
Pet pet = player.GetPet();
MemberStats.PetStats.Value = new();
MemberStats.PetStats = new();
MemberStats.PetStats.Value.GUID = pet.GetGUID();
MemberStats.PetStats.Value.Name = pet.GetName();
MemberStats.PetStats.Value.ModelId = (short)pet.GetDisplayId();
MemberStats.PetStats.GUID = pet.GetGUID();
MemberStats.PetStats.Name = pet.GetName();
MemberStats.PetStats.ModelId = (short)pet.GetDisplayId();
MemberStats.PetStats.Value.CurrentHealth = (int)pet.GetHealth();
MemberStats.PetStats.Value.MaxHealth = (int)pet.GetMaxHealth();
MemberStats.PetStats.CurrentHealth = (int)pet.GetHealth();
MemberStats.PetStats.MaxHealth = (int)pet.GetMaxHealth();
foreach (AuraApplication aurApp in pet.GetVisibleAuras())
{
@@ -348,7 +348,7 @@ namespace Game.Networking.Packets
}
}
MemberStats.PetStats.Value.Auras.Add(aura);
MemberStats.PetStats.Auras.Add(aura);
}
}
@@ -771,9 +771,9 @@ namespace Game.Networking.Packets
public List<PartyPlayerInfo> PlayerList = new();
public Optional<PartyLFGInfo> LfgInfos;
public Optional<PartyLootSettings> LootSettings;
public Optional<PartyDifficultySettings> DifficultySettings;
public PartyLFGInfo? LfgInfos;
public PartyLootSettings? LootSettings;
public PartyDifficultySettings? DifficultySettings;
}
class SetEveryoneIsAssistant : ClientPacket
@@ -999,13 +999,13 @@ namespace Game.Networking.Packets
foreach (PartyMemberAuraStates aura in Auras)
aura.Write(data);
data.WriteBit(PetStats.HasValue);
data.WriteBit(PetStats != null);
data.FlushBits();
DungeonScore.Write(data);
if (PetStats.HasValue)
PetStats.Value.Write(data);
if (PetStats != null)
PetStats.Write(data);
}
public ushort Level;
@@ -1027,7 +1027,7 @@ namespace Game.Networking.Packets
public PartyMemberPhaseStates Phases = new();
public List<PartyMemberAuraStates> Auras = new();
public Optional<PartyMemberPetStats> PetStats;
public PartyMemberPetStats PetStats;
public ushort PowerDisplayID;
public ushort SpecID;
@@ -596,8 +596,8 @@ namespace Game.Networking.Packets
data.WriteUInt32(NativeRealmAddress.Value);
}
public Optional<uint> VirtualRealmAddress = new(); // current realm (?) (identifier made from the Index, BattleGroup and Region)
public Optional<uint> NativeRealmAddress = new(); // original realm (?) (identifier made from the Index, BattleGroup and Region)
public uint? VirtualRealmAddress = new(); // current realm (?) (identifier made from the Index, BattleGroup and Region)
public uint? NativeRealmAddress = new(); // original realm (?) (identifier made from the Index, BattleGroup and Region)
}
public class PlayerGuidLookupData
@@ -1313,9 +1313,9 @@ namespace Game.Networking.Packets
public string ButtonTooltip;
public string Description;
public string Confirmation;
public Optional<PlayerChoiceResponseReward> Reward;
public Optional<uint> RewardQuestID;
public Optional<PlayerChoiceResponseMawPower> MawPower;
public PlayerChoiceResponseReward Reward;
public uint? RewardQuestID;
public PlayerChoiceResponseMawPower? MawPower;
public void Write(WorldPacket data)
{
@@ -1337,12 +1337,12 @@ namespace Game.Networking.Packets
data.WriteBits(Confirmation.GetByteCount(), 7);
data.WriteBit(RewardQuestID.HasValue);
data.WriteBit(Reward.HasValue);
data.WriteBit(Reward != null);
data.WriteBit(MawPower.HasValue);
data.FlushBits();
if (Reward.HasValue)
Reward.Value.Write(data);
if (Reward != null)
Reward.Write(data);
data.WriteString(Answer);
data.WriteString(Header);
+38 -42
View File
@@ -851,9 +851,9 @@ namespace Game.Networking.Packets
public int SpellID;
public SpellCastVisual Visual;
public Optional<SpellChannelStartInterruptImmunities> InterruptImmunities;
public SpellChannelStartInterruptImmunities? InterruptImmunities;
public ObjectGuid CasterGUID;
public Optional<SpellTargetedHealPrediction> HealPrediction;
public SpellTargetedHealPrediction? HealPrediction;
public uint ChannelDuration;
}
@@ -1080,7 +1080,7 @@ namespace Game.Networking.Packets
_worldPacket.ResetBitPos();
if (hasStatus)
Status.Set(MovementExtensions.ReadMovementInfo(_worldPacket));
Status = MovementExtensions.ReadMovementInfo(_worldPacket);
}
public ObjectGuid Guid;
@@ -1091,7 +1091,7 @@ namespace Game.Networking.Packets
public float Speed;
public Vector3 FirePos;
public Vector3 ImpactPos;
public Optional<MovementInfo> Status;
public MovementInfo Status;
}
public class SpellDelayed : ServerPacket
@@ -1434,10 +1434,10 @@ namespace Game.Networking.Packets
data.WriteBit(TimeMod.HasValue);
data.WriteBits(Points.Count, 6);
data.WriteBits(EstimatedPoints.Count, 6);
data.WriteBit(ContentTuning.HasValue);
data.WriteBit(ContentTuning != null);
if (ContentTuning.HasValue)
ContentTuning.Value.Write(data);
if (ContentTuning != null)
ContentTuning.Write(data);
if (CastUnit.HasValue)
data.WritePackedGuid(CastUnit.Value);
@@ -1466,11 +1466,11 @@ namespace Game.Networking.Packets
public ushort CastLevel = 1;
public byte Applications = 1;
public int ContentTuningID;
Optional<ContentTuningParams> ContentTuning;
public Optional<ObjectGuid> CastUnit;
public Optional<int> Duration;
public Optional<int> Remaining;
Optional<float> TimeMod;
ContentTuningParams ContentTuning;
public ObjectGuid? CastUnit;
public int? Duration;
public int? Remaining;
float? TimeMod;
public List<float> Points = new();
public List<float> EstimatedPoints = new();
}
@@ -1480,15 +1480,15 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data)
{
data .WriteUInt8(Slot);
data.WriteBit(AuraData.HasValue);
data.WriteBit(AuraData != null);
data.FlushBits();
if (AuraData.HasValue)
AuraData.Value.Write(data);
if (AuraData != null)
AuraData.Write(data);
}
public byte Slot;
public Optional<AuraDataInfo> AuraData;
public AuraDataInfo AuraData;
}
public struct TargetLocation
@@ -1520,16 +1520,13 @@ namespace Game.Networking.Packets
{
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(26);
if (data.HasBit())
SrcLocation.Value = new();
SrcLocation = new();
if (data.HasBit())
DstLocation.Value = new();
DstLocation = new();
if (data.HasBit())
Orientation.Value = new();
if (data.HasBit())
MapID.Value = new();
bool hasOrientation = data.HasBit();
bool hasMapId = data.HasBit();
uint nameLength = data.ReadBits<uint>(7);
@@ -1542,11 +1539,11 @@ namespace Game.Networking.Packets
if (DstLocation.HasValue)
DstLocation.Value.Read(data);
if (Orientation.HasValue)
Orientation.Value = data.ReadFloat();
if (hasOrientation)
Orientation = data.ReadFloat();
if (MapID.HasValue)
MapID.Value = data.ReadInt32();
if (hasMapId)
MapID = data.ReadInt32();
Name = data.ReadString(nameLength);
}
@@ -1582,10 +1579,10 @@ namespace Game.Networking.Packets
public SpellCastTargetFlags Flags;
public ObjectGuid Unit;
public ObjectGuid Item;
public Optional<TargetLocation> SrcLocation;
public Optional<TargetLocation> DstLocation;
public Optional<float> Orientation;
public Optional<int> MapID;
public TargetLocation? SrcLocation;
public TargetLocation? DstLocation;
public float? Orientation;
public int? MapID;
public string Name = "";
}
@@ -1640,7 +1637,7 @@ namespace Game.Networking.Packets
public uint SendCastFlags;
public SpellTargetData Target = new();
public MissileTrajectoryRequest MissileTrajectory;
public Optional<MovementInfo> MoveUpdate;
public MovementInfo MoveUpdate;
public List<SpellWeight> Weight = new();
public Array<SpellOptionalReagent> OptionalReagents = new(3);
public Array<SpellExtraCurrencyCost> OptionalCurrencies = new(5 /*MAX_ITEM_EXT_COST_CURRENCIES*/);
@@ -1669,14 +1666,13 @@ namespace Game.Networking.Packets
OptionalCurrencies[i].Read(data);
SendCastFlags = data.ReadBits<uint>(5);
if (data.HasBit())
MoveUpdate.Value = new();
bool hasMoveUpdate = data.HasBit();
var weightCount = data.ReadBits<uint>(2);
Target.Read(data);
if (MoveUpdate.HasValue)
MoveUpdate.Value = MovementExtensions.ReadMovementInfo(data);
if (hasMoveUpdate)
MoveUpdate = MovementExtensions.ReadMovementInfo(data);
for (var i = 0; i < weightCount; ++i)
{
@@ -1834,7 +1830,7 @@ namespace Game.Networking.Packets
data.WriteBits(HitStatus.Count, 16);
data.WriteBits(MissStatus.Count, 16);
data.WriteBits(RemainingPower.Count, 9);
data.WriteBit(RemainingRunes.HasValue);
data.WriteBit(RemainingRunes != null);
data.WriteBits(TargetPoints.Count, 16);
data.FlushBits();
@@ -1855,8 +1851,8 @@ namespace Game.Networking.Packets
foreach (SpellPowerData power in RemainingPower)
power.Write(data);
if (RemainingRunes.HasValue)
RemainingRunes.Value.Write(data);
if (RemainingRunes != null)
RemainingRunes.Write(data);
foreach (TargetLocation targetLoc in TargetPoints)
targetLoc.Write(data);
@@ -1877,7 +1873,7 @@ namespace Game.Networking.Packets
public List<SpellMissStatus> MissStatus = new();
public SpellTargetData Target = new();
public List<SpellPowerData> RemainingPower = new();
public Optional<RuneData> RemainingRunes;
public RuneData RemainingRunes;
public MissileTrajectoryResult MissileTrajectory;
public SpellAmmo Ammo;
public byte DestLocSpellCastIndex;
@@ -1960,8 +1956,8 @@ namespace Game.Networking.Packets
public int CategoryRecoveryTime;
public float ModRate = 1.0f;
public bool OnHold;
Optional<uint> unused622_1; // This field is not used for anything in the client in 6.2.2.20444
Optional<uint> unused622_2; // This field is not used for anything in the client in 6.2.2.20444
uint? unused622_1; // This field is not used for anything in the client in 6.2.2.20444
uint? unused622_2; // This field is not used for anything in the client in 6.2.2.20444
}
public class SpellChargeEntry
@@ -25,11 +25,7 @@ namespace Game.Networking.Packets
{
public class FeatureSystemStatus : ServerPacket
{
public FeatureSystemStatus() : base(ServerOpcodes.FeatureSystemStatus)
{
SessionAlert = new Optional<SessionAlertConfig>();
EuropaTicketSystemStatus = new Optional<EuropaTicketConfig>();
}
public FeatureSystemStatus() : base(ServerOpcodes.FeatureSystemStatus) { }
public override void Write()
{
@@ -140,10 +136,10 @@ namespace Game.Networking.Packets
public bool BrowserEnabled;
public bool BpayStoreAvailable;
public bool BpayStoreEnabled;
public Optional<SessionAlertConfig> SessionAlert;
public SessionAlertConfig? SessionAlert;
public uint ScrollOfResurrectionMaxRequestsPerDay;
public bool ScrollOfResurrectionEnabled;
public Optional<EuropaTicketConfig> EuropaTicketSystemStatus;
public EuropaTicketConfig? EuropaTicketSystemStatus;
public uint ScrollOfResurrectionRequestsRemaining;
public uint CfgRealmID;
public byte ComplaintStatus;
@@ -303,7 +299,7 @@ namespace Game.Networking.Packets
public bool LiveRegionAccountCopyEnabled; // NYI
public bool LiveRegionKeyBindingsCopyEnabled = false;
public bool Unknown901CheckoutRelated = false; // NYI
public Optional<EuropaTicketConfig> EuropaTicketSystemStatus;
public EuropaTicketConfig? EuropaTicketSystemStatus;
public List<int> LiveRegionCharacterCopySourceRegions = new();
public uint TokenPollTimeSeconds; // NYI
public long TokenBalanceAmount; // NYI
@@ -73,7 +73,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8(node);
}
public Optional<ShowTaxiNodesWindowInfo> WindowInfo;
public ShowTaxiNodesWindowInfo? WindowInfo;
public byte[] CanLandNodes = null; // Nodes known by player
public byte[] CanUseNodes = null; // Nodes available for use - this can temporarily disable a known node
}
+36 -44
View File
@@ -147,8 +147,9 @@ namespace Game.Networking.Packets
if (hasClubMessage)
{
CommunityMessage.Value = new();
CommunityMessage.Value.IsPlayerUsingVoice = _worldPacket.HasBit();
SupportTicketCommunityMessage communityMessage = new();
communityMessage.IsPlayerUsingVoice = _worldPacket.HasBit();
CommunityMessage = communityMessage;
_worldPacket.ResetBitPos();
}
@@ -158,49 +159,49 @@ namespace Game.Networking.Packets
if (hasMailInfo)
{
MailInfo.Value = new();
MailInfo = new();
MailInfo.Value.Read(_worldPacket);
}
if (hasCalendarInfo)
{
CalenderInfo.Value = new();
CalenderInfo = new();
CalenderInfo.Value.Read(_worldPacket);
}
if (hasPetInfo)
{
PetInfo.Value = new();
PetInfo = new();
PetInfo.Value.Read(_worldPacket);
}
if (hasGuildInfo)
{
GuildInfo.Value = new();
GuildInfo = new();
GuildInfo.Value.Read(_worldPacket);
}
if (hasLFGListSearchResult)
{
LFGListSearchResult.Value = new();
LFGListSearchResult = new();
LFGListSearchResult.Value.Read(_worldPacket);
}
if (hasLFGListApplicant)
{
LFGListApplicant.Value = new();
LFGListApplicant = new();
LFGListApplicant.Value.Read(_worldPacket);
}
if (hasClubFinderResult)
{
ClubFinderResult.Value = new();
ClubFinderResult = new();
ClubFinderResult.Value.Read(_worldPacket);
}
if (hasUnk910)
{
Unused910.Value = new();
Unused910 = new();
Unused910.Value.Read(_worldPacket);
}
}
@@ -211,15 +212,15 @@ namespace Game.Networking.Packets
public byte ComplaintType;
public string Note;
public SupportTicketHorusChatLog HorusChatLog;
public Optional<SupportTicketMailInfo> MailInfo;
public Optional<SupportTicketCalendarEventInfo> CalenderInfo;
public Optional<SupportTicketPetInfo> PetInfo;
public Optional<SupportTicketGuildInfo> GuildInfo;
public Optional<SupportTicketLFGListSearchResult> LFGListSearchResult;
public Optional<SupportTicketLFGListApplicant> LFGListApplicant;
public Optional<SupportTicketCommunityMessage> CommunityMessage;
public Optional<SupportTicketClubFinderResult> ClubFinderResult;
public Optional<SupportTicketUnused910> Unused910;
public SupportTicketMailInfo? MailInfo;
public SupportTicketCalendarEventInfo? CalenderInfo;
public SupportTicketPetInfo? PetInfo;
public SupportTicketGuildInfo? GuildInfo;
public SupportTicketLFGListSearchResult? LFGListSearchResult;
public SupportTicketLFGListApplicant? LFGListApplicant;
public SupportTicketCommunityMessage? CommunityMessage;
public SupportTicketClubFinderResult? ClubFinderResult;
public SupportTicketUnused910? Unused910;
public struct SupportTicketChatLine
{
@@ -250,20 +251,19 @@ namespace Game.Networking.Packets
public void Read(WorldPacket data)
{
uint linesCount = data.ReadUInt32();
if (data.HasBit())
ReportLineIndex.Value = new();
bool hasReportLineIndex = data.HasBit();
data.ResetBitPos();
for (uint i = 0; i < linesCount; i++)
Lines.Add(new SupportTicketChatLine(data));
if (ReportLineIndex.HasValue)
ReportLineIndex.Value = data.ReadUInt32();
if (hasReportLineIndex)
ReportLineIndex = data.ReadUInt32();
}
public List<SupportTicketChatLine> Lines = new();
public Optional<uint> ReportLineIndex;
public uint? ReportLineIndex;
}
public struct SupportTicketHorusChatLine
@@ -280,30 +280,22 @@ namespace Game.Networking.Packets
uint textLength = data.ReadBits<uint>(12);
if (hasClubID)
{
ClubID.Value = new();
ClubID.Value = data.ReadUInt64();
}
ClubID = data.ReadUInt64();
if (hasChannelGUID)
{
ChannelGUID.Value = new();
ChannelGUID.Value = data.ReadPackedGuid();
}
ChannelGUID = data.ReadPackedGuid();
if (hasRealmAddress)
{
RealmAddress.Value = new();
RealmAddress.Value.VirtualRealmAddress = data.ReadUInt32();
RealmAddress.Value.field_4 = data.ReadUInt16();
RealmAddress.Value.field_6 = data.ReadUInt8();
SenderRealm senderRealm = new();
senderRealm.VirtualRealmAddress = data.ReadUInt32();
senderRealm.field_4 = data.ReadUInt16();
senderRealm.field_6 = data.ReadUInt8();
RealmAddress = senderRealm;
}
if (hasSlashCmd)
{
SlashCmd.Value = new();
SlashCmd.Value = data.ReadInt32();
}
SlashCmd = data.ReadInt32();
Text = data.ReadString(textLength);
}
@@ -317,10 +309,10 @@ namespace Game.Networking.Packets
public long Timestamp;
public ObjectGuid AuthorGUID;
public Optional<ulong> ClubID;
public Optional<ObjectGuid> ChannelGUID;
public Optional<SenderRealm> RealmAddress;
public Optional<int> SlashCmd;
public ulong? ClubID;
public ObjectGuid? ChannelGUID;
public SenderRealm? RealmAddress;
public int? SlashCmd;
public string Text;
}
@@ -241,18 +241,18 @@ namespace Game.Networking.Packets
data.WriteInt32(StackCount);
data.WritePackedGuid(GiftCreator);
Item.Write(data);
data.WriteBit(Unwrapped.HasValue);
data.WriteBit(Unwrapped != null);
data.FlushBits();
if (Unwrapped.HasValue)
Unwrapped.Value.Write(data);
if (Unwrapped != null)
Unwrapped.Write(data);
}
public byte Slot;
public ItemInstance Item = new();
public int StackCount;
public ObjectGuid GiftCreator;
public Optional<UnwrappedTradeItem> Unwrapped;
public UnwrappedTradeItem Unwrapped;
}
public ulong Gold;
+2 -2
View File
@@ -118,7 +118,7 @@ namespace Game.Networking.Packets
ShowArenaPlayers = data.HasBit();
ExactName = data.HasBit();
if (data.HasBit())
ServerInfo.Value = new();
ServerInfo = new();
data.ResetBitPos();
@@ -149,7 +149,7 @@ namespace Game.Networking.Packets
public bool ShowEnemies;
public bool ShowArenaPlayers;
public bool ExactName;
public Optional<WhoRequestServerInfo> ServerInfo;
public WhoRequestServerInfo? ServerInfo;
}
public class WhoEntry