Remove custom OptionalType and use the default c# nullable type.
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Framework.Dynamic
|
||||
{
|
||||
public struct Optional<T>
|
||||
{
|
||||
private bool _hasValue;
|
||||
public T Value;
|
||||
|
||||
public Optional(T value)
|
||||
{
|
||||
Value = value;
|
||||
_hasValue = true;
|
||||
}
|
||||
|
||||
public bool HasValue
|
||||
{
|
||||
get { return _hasValue; }
|
||||
}
|
||||
|
||||
public void Set(T value)
|
||||
{
|
||||
Value = value;
|
||||
_hasValue = true;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_hasValue = false;
|
||||
Value = default;
|
||||
}
|
||||
|
||||
public T ValueOr(T otherValue)
|
||||
{
|
||||
return HasValue ? Value : otherValue;
|
||||
}
|
||||
|
||||
public static explicit operator T(Optional<T> optional)
|
||||
{
|
||||
return optional.Value;
|
||||
}
|
||||
|
||||
public static implicit operator Optional<T>(T value)
|
||||
{
|
||||
return new Optional<T>(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -403,7 +403,7 @@ namespace Framework.Dynamic
|
||||
{
|
||||
_end = end;
|
||||
_duration = duration;
|
||||
_group.Set(group);
|
||||
_group = group;
|
||||
_repeated = repeated;
|
||||
_task = task;
|
||||
}
|
||||
@@ -427,12 +427,12 @@ namespace Framework.Dynamic
|
||||
/// <returns></returns>
|
||||
public bool IsInGroup(uint group)
|
||||
{
|
||||
return _group.HasValue && _group.Value == group;
|
||||
return _group.HasValue && _group == group;
|
||||
}
|
||||
|
||||
internal DateTime _end;
|
||||
internal TimeSpan _duration;
|
||||
internal Optional<uint> _group;
|
||||
internal uint? _group;
|
||||
internal uint _repeated;
|
||||
internal Action<TaskContext> _task;
|
||||
}
|
||||
@@ -551,7 +551,7 @@ namespace Framework.Dynamic
|
||||
/// <returns></returns>
|
||||
TaskContext SetGroup(uint group)
|
||||
{
|
||||
_task._group.Set(group);
|
||||
_task._group = group;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ namespace Framework.Dynamic
|
||||
/// <returns></returns>
|
||||
TaskContext ClearGroup()
|
||||
{
|
||||
_task._group.Clear();
|
||||
_task._group = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2079,10 +2079,10 @@ namespace Game.Achievements
|
||||
|
||||
foreach (Garrison.Plot plot in garrison.GetPlots())
|
||||
{
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null)
|
||||
continue;
|
||||
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
if (building == null || building.UpgradeLevel < reqValue || building.BuildingType != secondaryAsset)
|
||||
continue;
|
||||
|
||||
@@ -2109,7 +2109,7 @@ namespace Game.Achievements
|
||||
return false;
|
||||
|
||||
foreach (var plot in garrison.GetPlots())
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -2131,10 +2131,10 @@ namespace Game.Achievements
|
||||
|
||||
foreach (Garrison.Plot plot in garrison.GetPlots())
|
||||
{
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue || plot.BuildingInfo.PacketInfo.Value.GarrBuildingID != reqValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null || plot.BuildingInfo.PacketInfo.GarrBuildingID != reqValue)
|
||||
continue;
|
||||
|
||||
return !plot.BuildingInfo.PacketInfo.Value.Active;
|
||||
return !plot.BuildingInfo.PacketInfo.Active;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2148,10 +2148,10 @@ namespace Game.Achievements
|
||||
|
||||
foreach (Garrison.Plot plot in garrison.GetPlots())
|
||||
{
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null)
|
||||
continue;
|
||||
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
if (building == null || building.UpgradeLevel != secondaryAsset || building.BuildingType != reqValue)
|
||||
continue;
|
||||
|
||||
@@ -2276,10 +2276,10 @@ namespace Game.Achievements
|
||||
|
||||
foreach (var plot in garrison.GetPlots())
|
||||
{
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue || plot.BuildingInfo.PacketInfo.Value.GarrBuildingID != miscValue1)
|
||||
if (plot.BuildingInfo.PacketInfo == null || plot.BuildingInfo.PacketInfo.GarrBuildingID != miscValue1)
|
||||
continue;
|
||||
|
||||
var building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
var building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
if (building == null || building.UpgradeLevel != reqValue)
|
||||
continue;
|
||||
|
||||
@@ -2297,7 +2297,7 @@ namespace Game.Achievements
|
||||
if (plot == null)
|
||||
return false;
|
||||
|
||||
if (!plot.BuildingInfo.CanActivate() || !plot.BuildingInfo.PacketInfo.HasValue || plot.BuildingInfo.PacketInfo.Value.Active)
|
||||
if (!plot.BuildingInfo.CanActivate() || plot.BuildingInfo.PacketInfo == null || plot.BuildingInfo.PacketInfo.Active)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -2398,10 +2398,10 @@ namespace Game.Achievements
|
||||
|
||||
foreach (var plot in garrison.GetPlots())
|
||||
{
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null)
|
||||
return false;
|
||||
|
||||
var building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
var building = CliDB.GarrBuildingStorage.LookupByKey(plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
if (building == null || building.UpgradeLevel != reqValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -104,12 +104,12 @@ namespace Game.Arenas
|
||||
|
||||
if (IsRated())
|
||||
{
|
||||
pvpLogData.Ratings.Value = new();
|
||||
pvpLogData.Ratings = new();
|
||||
for (byte i = 0; i < SharedConst.PvpTeamsCount; ++i)
|
||||
{
|
||||
pvpLogData.Ratings.Value.Postmatch[i] = _arenaTeamScores[i].PostMatchRating;
|
||||
pvpLogData.Ratings.Value.Prematch[i] = _arenaTeamScores[i].PreMatchRating;
|
||||
pvpLogData.Ratings.Value.PrematchMMR[i] = _arenaTeamScores[i].PreMatchMMR;
|
||||
pvpLogData.Ratings.Postmatch[i] = _arenaTeamScores[i].PostMatchRating;
|
||||
pvpLogData.Ratings.Prematch[i] = _arenaTeamScores[i].PreMatchRating;
|
||||
pvpLogData.Ratings.PrematchMMR[i] = _arenaTeamScores[i].PreMatchMMR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,16 +34,16 @@ namespace Game.Arenas
|
||||
base.BuildPvPLogPlayerDataPacket(out playerData);
|
||||
|
||||
if (PreMatchRating != 0)
|
||||
playerData.PreMatchRating.Set(PreMatchRating);
|
||||
playerData.PreMatchRating = PreMatchRating;
|
||||
|
||||
if (PostMatchRating != PreMatchRating)
|
||||
playerData.RatingChange.Set((int)(PostMatchRating - PreMatchRating));
|
||||
playerData.RatingChange = (int)(PostMatchRating - PreMatchRating);
|
||||
|
||||
if (PreMatchMMR != 0)
|
||||
playerData.PreMatchMMR.Set(PreMatchMMR);
|
||||
playerData.PreMatchMMR = PreMatchMMR;
|
||||
|
||||
if (PostMatchMMR != PreMatchMMR)
|
||||
playerData.MmrChange.Set((int)(PostMatchMMR - PreMatchMMR));
|
||||
playerData.MmrChange = (int)(PostMatchMMR - PreMatchMMR);
|
||||
}
|
||||
|
||||
// For Logging purpose
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Entities;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
using System;
|
||||
|
||||
namespace Game.Arenas
|
||||
{
|
||||
@@ -44,7 +45,7 @@ namespace Game.Arenas
|
||||
for (int i = DalaranSewersObjectTypes.Buff1; i <= DalaranSewersObjectTypes.Buff2; ++i)
|
||||
SpawnBGObject(i, 60);
|
||||
|
||||
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
|
||||
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax);
|
||||
_events.ScheduleEvent(DalaranSewersEvents.PipeKnockback, DalaranSewersData.PipeKnockbackFirstDelay);
|
||||
|
||||
SpawnBGObject(DalaranSewersObjectTypes.Water2, BattlegroundConst.RespawnImmediately);
|
||||
@@ -148,7 +149,7 @@ namespace Game.Arenas
|
||||
DoorOpen(DalaranSewersObjectTypes.Water1);
|
||||
DoorOpen(DalaranSewersObjectTypes.Water2);
|
||||
_events.CancelEvent(DalaranSewersEvents.WaterfallKnockback);
|
||||
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
|
||||
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax);
|
||||
break;
|
||||
case DalaranSewersEvents.WaterfallKnockback:
|
||||
{
|
||||
@@ -218,14 +219,14 @@ namespace Game.Arenas
|
||||
struct DalaranSewersData
|
||||
{
|
||||
// These values are NOT blizzlike... need the correct data!
|
||||
public const uint WaterfallTimerMin = 30000;
|
||||
public const uint WaterfallTimerMax = 60000;
|
||||
public const uint WaterWarningDuration = 5000;
|
||||
public const uint WaterfallDuration = 30000;
|
||||
public const uint WaterfallKnockbackTimer = 1500;
|
||||
public static TimeSpan WaterfallTimerMin = TimeSpan.FromSeconds(30);
|
||||
public static TimeSpan WaterfallTimerMax = TimeSpan.FromSeconds(60);
|
||||
public static TimeSpan WaterWarningDuration = TimeSpan.FromSeconds(5);
|
||||
public static TimeSpan WaterfallDuration = TimeSpan.FromSeconds(30);
|
||||
public static TimeSpan WaterfallKnockbackTimer = TimeSpan.FromSeconds(1.5);
|
||||
|
||||
public const uint PipeKnockbackFirstDelay = 5000;
|
||||
public const uint PipeKnockbackDelay = 3000;
|
||||
public static TimeSpan PipeKnockbackFirstDelay = TimeSpan.FromSeconds(5);
|
||||
public static TimeSpan PipeKnockbackDelay = TimeSpan.FromSeconds(3);
|
||||
public const uint PipeKnockbackTotalCount = 2;
|
||||
|
||||
public const uint NpcWaterSpout = 28567;
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Entities;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
using System;
|
||||
|
||||
namespace Game.Arenas
|
||||
{
|
||||
@@ -95,7 +96,7 @@ namespace Game.Arenas
|
||||
DoorOpen(RingofValorObjectTypes.Elevator1);
|
||||
DoorOpen(RingofValorObjectTypes.Elevator2);
|
||||
|
||||
_events.ScheduleEvent(RingofValorEvents.OpenFences, 20133);
|
||||
_events.ScheduleEvent(RingofValorEvents.OpenFences, TimeSpan.FromSeconds(20));
|
||||
|
||||
// Should be false at first, TogglePillarCollision will do it.
|
||||
TogglePillarCollision(true);
|
||||
@@ -141,17 +142,17 @@ namespace Game.Arenas
|
||||
// Open fire (only at game start)
|
||||
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
|
||||
DoorOpen(i);
|
||||
_events.ScheduleEvent(RingofValorEvents.CloseFire, 5000);
|
||||
_events.ScheduleEvent(RingofValorEvents.CloseFire, TimeSpan.FromSeconds(5));
|
||||
break;
|
||||
case RingofValorEvents.CloseFire:
|
||||
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
|
||||
DoorClose(i);
|
||||
// Fire got closed after five seconds, leaves twenty seconds before toggling pillars
|
||||
_events.ScheduleEvent(RingofValorEvents.SwitchPillars, 20000);
|
||||
_events.ScheduleEvent(RingofValorEvents.SwitchPillars, TimeSpan.FromSeconds(20));
|
||||
break;
|
||||
case RingofValorEvents.SwitchPillars:
|
||||
TogglePillarCollision(true);
|
||||
_events.Repeat(25000);
|
||||
_events.Repeat(TimeSpan.FromSeconds(25));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -817,7 +817,7 @@ namespace Game
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
public void BuildListBuckets(AuctionListBucketsResult listBucketsResult, Player player, string name, byte minLevel, byte maxLevel, AuctionHouseFilterMask filters, Optional<AuctionSearchClassFilters> classFilters,
|
||||
public void BuildListBuckets(AuctionListBucketsResult listBucketsResult, Player player, string name, byte minLevel, byte maxLevel, AuctionHouseFilterMask filters, AuctionSearchClassFilters classFilters,
|
||||
byte[] knownPetBits, int knownPetBitsCount, byte maxKnownPetLevel, uint offset, AuctionSortDef[] sorts, int sortCount)
|
||||
{
|
||||
List<uint> knownAppearanceIds = new();
|
||||
@@ -860,21 +860,21 @@ namespace Game
|
||||
if (!filters.HasFlag(bucketData.QualityMask))
|
||||
continue;
|
||||
|
||||
if (classFilters.HasValue)
|
||||
if (classFilters != null)
|
||||
{
|
||||
// if we dont want any class filters, Optional is not initialized
|
||||
// if we dont want this class included, SubclassMask is set to FILTER_SKIP_CLASS
|
||||
// if we want this class and did not specify and subclasses, its set to FILTER_SKIP_SUBCLASS
|
||||
// otherwise full restrictions apply
|
||||
if (classFilters.Value.Classes[bucketData.ItemClass].SubclassMask == AuctionSearchClassFilters.FilterType.SkipClass)
|
||||
if (classFilters.Classes[bucketData.ItemClass].SubclassMask == AuctionSearchClassFilters.FilterType.SkipClass)
|
||||
continue;
|
||||
|
||||
if (classFilters.Value.Classes[bucketData.ItemClass].SubclassMask != AuctionSearchClassFilters.FilterType.SkipSubclass)
|
||||
if (classFilters.Classes[bucketData.ItemClass].SubclassMask != AuctionSearchClassFilters.FilterType.SkipSubclass)
|
||||
{
|
||||
if (!classFilters.Value.Classes[bucketData.ItemClass].SubclassMask.HasAnyFlag((AuctionSearchClassFilters.FilterType)(1 << bucketData.ItemSubClass)))
|
||||
if (!classFilters.Classes[bucketData.ItemClass].SubclassMask.HasAnyFlag((AuctionSearchClassFilters.FilterType)(1 << bucketData.ItemSubClass)))
|
||||
continue;
|
||||
|
||||
if (!classFilters.Value.Classes[bucketData.ItemClass].InvTypes[bucketData.ItemSubClass].HasAnyFlag(1u << bucketData.InventoryType))
|
||||
if (!classFilters.Classes[bucketData.ItemClass].InvTypes[bucketData.ItemSubClass].HasAnyFlag(1u << bucketData.InventoryType))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1244,7 +1244,7 @@ namespace Game
|
||||
return false;
|
||||
}
|
||||
|
||||
Optional<ObjectGuid> uniqueSeller = new();
|
||||
ObjectGuid? uniqueSeller = new();
|
||||
|
||||
// prepare items
|
||||
List<MailedItemsBatch> items = new();
|
||||
@@ -1257,9 +1257,9 @@ namespace Game
|
||||
{
|
||||
AuctionPosting auction = bucketItr.Auctions[i++];
|
||||
if (!uniqueSeller.HasValue)
|
||||
uniqueSeller.Set(auction.Owner);
|
||||
else if (uniqueSeller.Value != auction.Owner)
|
||||
uniqueSeller.Set(ObjectGuid.Empty);
|
||||
uniqueSeller = auction.Owner;
|
||||
else if (uniqueSeller != auction.Owner)
|
||||
uniqueSeller = ObjectGuid.Empty;
|
||||
|
||||
uint boughtFromAuction = 0;
|
||||
int removedItems = 0;
|
||||
@@ -1657,17 +1657,13 @@ namespace Game
|
||||
if (IsCommodity())
|
||||
{
|
||||
if (alwaysSendItem)
|
||||
{
|
||||
auctionItem.Item.Value = new();
|
||||
auctionItem.Item.Value = new ItemInstance(Items[0]);
|
||||
}
|
||||
auctionItem.Item = new ItemInstance(Items[0]);
|
||||
|
||||
auctionItem.UnitPrice.Set(BuyoutOrUnitPrice);
|
||||
auctionItem.UnitPrice = BuyoutOrUnitPrice;
|
||||
}
|
||||
else
|
||||
{
|
||||
auctionItem.Item.Value = new();
|
||||
auctionItem.Item.Value = new ItemInstance(Items[0]);
|
||||
auctionItem.Item = new ItemInstance(Items[0]);
|
||||
auctionItem.Charges = new[] { Items[0].GetSpellCharges(0), Items[0].GetSpellCharges(1), Items[0].GetSpellCharges(2), Items[0].GetSpellCharges(3), Items[0].GetSpellCharges(4) }.Max();
|
||||
for (EnchantmentSlot enchantmentSlot = 0; enchantmentSlot < EnchantmentSlot.MaxInspected; enchantmentSlot++)
|
||||
{
|
||||
@@ -1691,14 +1687,14 @@ namespace Game
|
||||
}
|
||||
|
||||
if (MinBid != 0)
|
||||
auctionItem.MinBid.Set(MinBid);
|
||||
auctionItem.MinBid = MinBid;
|
||||
|
||||
ulong minIncrement = CalculateMinIncrement();
|
||||
if (minIncrement != 0)
|
||||
auctionItem.MinIncrement.Set(minIncrement);
|
||||
auctionItem.MinIncrement = minIncrement;
|
||||
|
||||
if (BuyoutOrUnitPrice != 0)
|
||||
auctionItem.BuyoutPrice.Set(BuyoutOrUnitPrice);
|
||||
auctionItem.BuyoutPrice = BuyoutOrUnitPrice;
|
||||
}
|
||||
|
||||
// all (not optional<>)
|
||||
@@ -1715,17 +1711,17 @@ namespace Game
|
||||
auctionItem.CensorBidInfo = censorBidInfo;
|
||||
if (!Bidder.IsEmpty())
|
||||
{
|
||||
auctionItem.Bidder.Set(Bidder);
|
||||
auctionItem.BidAmount.Set(BidAmount);
|
||||
auctionItem.Bidder = Bidder;
|
||||
auctionItem.BidAmount = BidAmount;
|
||||
}
|
||||
|
||||
// SMSG_AUCTION_LIST_BIDDER_ITEMS_RESULT, SMSG_AUCTION_LIST_OWNER_ITEMS_RESULT, SMSG_AUCTION_REPLICATE_RESPONSE (if commodity)
|
||||
if (sendKey)
|
||||
auctionItem.AuctionBucketKey.Set(new AuctionBucketKey(AuctionsBucketKey.ForItem(Items[0])));
|
||||
auctionItem.AuctionBucketKey = new(AuctionsBucketKey.ForItem(Items[0]));
|
||||
|
||||
// all
|
||||
if (!Items[0].m_itemData.Creator._value.IsEmpty())
|
||||
auctionItem.Creator.Set(Items[0].m_itemData.Creator);
|
||||
auctionItem.Creator = Items[0].m_itemData.Creator;
|
||||
}
|
||||
|
||||
public static ulong CalculateMinIncrement(ulong bidAmount)
|
||||
@@ -1837,9 +1833,9 @@ namespace Game
|
||||
byte quality = (byte)((breedData >> 24) & 0xFF);
|
||||
byte level = (byte)(item.GetModifier(ItemModifier.BattlePetLevel));
|
||||
|
||||
bucketInfo.MaxBattlePetQuality.Set(bucketInfo.MaxBattlePetQuality.HasValue ? Math.Max(bucketInfo.MaxBattlePetQuality.Value, quality) : quality);
|
||||
bucketInfo.MaxBattlePetLevel.Set(bucketInfo.MaxBattlePetLevel.HasValue ? Math.Max(bucketInfo.MaxBattlePetLevel.Value, level) : level);
|
||||
bucketInfo.BattlePetBreedID.Set((byte)breedId);
|
||||
bucketInfo.MaxBattlePetQuality = bucketInfo.MaxBattlePetQuality.HasValue ? Math.Max(bucketInfo.MaxBattlePetQuality.Value, quality) : quality;
|
||||
bucketInfo.MaxBattlePetLevel = bucketInfo.MaxBattlePetLevel.HasValue ? Math.Max(bucketInfo.MaxBattlePetLevel.Value, level) : level;
|
||||
bucketInfo.BattlePetBreedID = (byte)breedId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -702,8 +702,7 @@ namespace Game.BattleGrounds
|
||||
PVPMatchComplete pvpMatchComplete = new();
|
||||
pvpMatchComplete.Winner = (byte)GetWinner();
|
||||
pvpMatchComplete.Duration = (int)Math.Max(0, (GetElapsedTime() - (int)BattlegroundStartTimeIntervals.Delay2m) / Time.InMilliseconds);
|
||||
pvpMatchComplete.LogData.Value = new();
|
||||
BuildPvPLogDataPacket(out pvpMatchComplete.LogData.Value);
|
||||
BuildPvPLogDataPacket(out pvpMatchComplete.LogData);
|
||||
pvpMatchComplete.Write();
|
||||
|
||||
foreach (var pair in m_Players)
|
||||
|
||||
@@ -65,10 +65,11 @@ namespace Game.BattleGrounds
|
||||
playerData.Faction = (byte)TeamId;
|
||||
if (HonorableKills != 0 || Deaths != 0 || BonusHonor != 0)
|
||||
{
|
||||
playerData.Honor.Value = new();
|
||||
playerData.Honor.Value.HonorKills = HonorableKills;
|
||||
playerData.Honor.Value.Deaths = Deaths;
|
||||
playerData.Honor.Value.ContributionPoints = BonusHonor;
|
||||
PVPMatchStatistics.HonorData playerDataHonor = new();
|
||||
playerDataHonor.HonorKills = HonorableKills;
|
||||
playerDataHonor.Deaths = Deaths;
|
||||
playerDataHonor.ContributionPoints = BonusHonor;
|
||||
playerData.Honor = playerDataHonor;
|
||||
}
|
||||
|
||||
playerData.DamageDone = DamageDone;
|
||||
|
||||
@@ -230,10 +230,11 @@ namespace Game.BattlePets
|
||||
|
||||
if (!ownerGuid.IsEmpty())
|
||||
{
|
||||
pet.PacketInfo.OwnerInfo.Value = new();
|
||||
pet.PacketInfo.OwnerInfo.Value.Guid = ownerGuid;
|
||||
pet.PacketInfo.OwnerInfo.Value.PlayerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
pet.PacketInfo.OwnerInfo.Value.PlayerNativeRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
BattlePetStruct.BattlePetOwnerInfo battlePetOwnerInfo = new();
|
||||
battlePetOwnerInfo.Guid = ownerGuid;
|
||||
battlePetOwnerInfo.PlayerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
battlePetOwnerInfo.PlayerNativeRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
pet.PacketInfo.OwnerInfo = battlePetOwnerInfo;
|
||||
}
|
||||
|
||||
pet.SaveInfo = BattlePetSaveInfo.Unchanged;
|
||||
@@ -398,10 +399,11 @@ namespace Game.BattlePets
|
||||
Player player = _owner.GetPlayer();
|
||||
if (battlePetSpecies.GetFlags().HasFlag(BattlePetSpeciesFlags.NotAccountWide))
|
||||
{
|
||||
pet.PacketInfo.OwnerInfo.Value = new();
|
||||
pet.PacketInfo.OwnerInfo.Value.Guid = player.GetGUID();
|
||||
pet.PacketInfo.OwnerInfo.Value.PlayerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
pet.PacketInfo.OwnerInfo.Value.PlayerNativeRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
BattlePetStruct.BattlePetOwnerInfo battlePetOwnerInfo = new();
|
||||
battlePetOwnerInfo.Guid = player.GetGUID();
|
||||
battlePetOwnerInfo.PlayerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
battlePetOwnerInfo.PlayerNativeRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
pet.PacketInfo.OwnerInfo = battlePetOwnerInfo;
|
||||
}
|
||||
|
||||
pet.SaveInfo = BattlePetSaveInfo.New;
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace Game.BlackMarket
|
||||
|
||||
if (!bonusListIDs.Empty())
|
||||
{
|
||||
Item.ItemBonus.Value = new();
|
||||
Item.ItemBonus.Value.BonusListIDs = bonusListIDs;
|
||||
Item.ItemBonus = new();
|
||||
Item.ItemBonus.BonusListIDs = bonusListIDs;
|
||||
}
|
||||
|
||||
if (Global.ObjectMgr.GetCreatureTemplate(SellerNPC) == null)
|
||||
|
||||
@@ -244,9 +244,9 @@ namespace Game.BlackMarket
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
if (templ.Item.ItemBonus.HasValue)
|
||||
if (templ.Item.ItemBonus != null)
|
||||
{
|
||||
foreach (uint bonusList in templ.Item.ItemBonus.Value.BonusListIDs)
|
||||
foreach (uint bonusList in templ.Item.ItemBonus.BonusListIDs)
|
||||
item.AddBonuses(bonusList);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Game.Chat
|
||||
packet.Data.TargetGUID = _guid;
|
||||
}
|
||||
|
||||
packet.Data.ChannelGUID.Set(_channelGuid);
|
||||
packet.Data.ChannelGUID = _channelGuid;
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
@@ -163,12 +163,10 @@ namespace Game.Collision
|
||||
float liquidLevel = 0;
|
||||
if (reqLiquidType == 0 || (Global.DB2Mgr.GetLiquidFlags(liquidType) & reqLiquidType) != 0)
|
||||
if (intersectionCallBack.GetHitModel().GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), ref liquidLevel))
|
||||
data.liquidInfo.Set(new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel));
|
||||
data.liquidInfo = new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel);
|
||||
|
||||
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(intersectionCallBack.GetHitModel().GetNameSetId(),
|
||||
intersectionCallBack.GetLocationInfo().rootId,
|
||||
(int)intersectionCallBack.GetLocationInfo().hitModel.GetWmoID(),
|
||||
intersectionCallBack.GetLocationInfo().hitModel.GetMogpFlags()));
|
||||
data.areaInfo = new(intersectionCallBack.GetHitModel().GetNameSetId(), intersectionCallBack.GetLocationInfo().rootId,
|
||||
(int)intersectionCallBack.GetLocationInfo().hitModel.GetWmoID(), intersectionCallBack.GetLocationInfo().hitModel.GetMogpFlags());
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Game.Collision
|
||||
int adtId, rootId, groupId;
|
||||
uint flags;
|
||||
if (GetAreaInfo(mapId, x, y, ref data.floorZ, out flags, out adtId, out rootId, out groupId))
|
||||
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(adtId, rootId, groupId, flags));
|
||||
data.areaInfo = new(adtId, rootId, groupId, flags);
|
||||
return data;
|
||||
}
|
||||
var instanceTree = iInstanceMapTrees.LookupByKey(mapId);
|
||||
@@ -275,10 +275,10 @@ namespace Game.Collision
|
||||
float liquidLevel = 0;
|
||||
if (reqLiquidType == 0 || Convert.ToBoolean(Global.DB2Mgr.GetLiquidFlags(liquidType) & reqLiquidType))
|
||||
if (info.hitInstance.GetLiquidLevel(pos, info, ref liquidLevel))
|
||||
data.liquidInfo.Set(new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel));
|
||||
data.liquidInfo = new(liquidType, liquidLevel);
|
||||
|
||||
if (!Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, (byte)DisableFlags.VmapLiquidStatus))
|
||||
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(info.hitInstance.adtId, info.rootId, (int)info.hitModel.GetWmoID(), info.hitModel.GetMogpFlags()));
|
||||
data.areaInfo = new(info.hitInstance.adtId, info.rootId, (int)info.hitModel.GetWmoID(), info.hitModel.GetMogpFlags());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace Game.Collision
|
||||
}
|
||||
|
||||
public float floorZ = MapConst.VMAPInvalidHeightValue;
|
||||
public Optional<AreaInfo> areaInfo;
|
||||
public Optional<LiquidInfo> liquidInfo;
|
||||
public AreaInfo? areaInfo;
|
||||
public LiquidInfo? liquidInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Game.DataStorage
|
||||
orbitInfo.CounterClockwise = circularMovementInfos.Read<bool>(6);
|
||||
orbitInfo.CanLoop = circularMovementInfos.Read<bool>(7);
|
||||
|
||||
createProperties.OrbitInfo.Set(orbitInfo);
|
||||
createProperties.OrbitInfo = orbitInfo;
|
||||
}
|
||||
while (circularMovementInfos.NextRow());
|
||||
}
|
||||
|
||||
@@ -172,13 +172,13 @@ namespace Game.Entities
|
||||
|
||||
uint timeToTarget = GetCreateProperties().TimeToTarget != 0 ? GetCreateProperties().TimeToTarget : m_areaTriggerData.Duration;
|
||||
|
||||
if (GetCreateProperties().OrbitInfo.HasValue)
|
||||
if (GetCreateProperties().OrbitInfo != null)
|
||||
{
|
||||
AreaTriggerOrbitInfo orbit = GetCreateProperties().OrbitInfo.Value;
|
||||
AreaTriggerOrbitInfo orbit = GetCreateProperties().OrbitInfo;
|
||||
if (target && GetTemplate() != null && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached))
|
||||
orbit.PathTarget.Set(target.GetGUID());
|
||||
orbit.PathTarget = target.GetGUID();
|
||||
else
|
||||
orbit.Center.Set(new Vector3(pos.posX, pos.posY, pos.posZ));
|
||||
orbit.Center = new(pos.posX, pos.posY, pos.posZ);
|
||||
|
||||
InitOrbit(orbit, timeToTarget);
|
||||
}
|
||||
@@ -759,10 +759,10 @@ namespace Game.Entities
|
||||
|
||||
AreaTriggerRePath reshape = new();
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
reshape.AreaTriggerSpline.Value = new();
|
||||
reshape.AreaTriggerSpline.Value.ElapsedTimeForMovement = GetElapsedTimeForMovement();
|
||||
reshape.AreaTriggerSpline.Value.TimeToTarget = timeToTarget;
|
||||
reshape.AreaTriggerSpline.Value.Points = splinePoints;
|
||||
reshape.AreaTriggerSpline = new();
|
||||
reshape.AreaTriggerSpline.ElapsedTimeForMovement = GetElapsedTimeForMovement();
|
||||
reshape.AreaTriggerSpline.TimeToTarget = timeToTarget;
|
||||
reshape.AreaTriggerSpline.Points = splinePoints;
|
||||
SendMessageToSet(reshape, true);
|
||||
}
|
||||
|
||||
@@ -781,10 +781,10 @@ namespace Game.Entities
|
||||
m_areaTriggerData.ClearChanged(m_areaTriggerData.TimeToTarget);
|
||||
});
|
||||
|
||||
_orbitInfo.Set(orbit);
|
||||
_orbitInfo = orbit;
|
||||
|
||||
_orbitInfo.Value.TimeToTarget = timeToTarget;
|
||||
_orbitInfo.Value.ElapsedTimeForMovement = 0;
|
||||
_orbitInfo.TimeToTarget = timeToTarget;
|
||||
_orbitInfo.ElapsedTimeForMovement = 0;
|
||||
|
||||
if (IsInWorld)
|
||||
{
|
||||
@@ -798,23 +798,23 @@ namespace Game.Entities
|
||||
|
||||
public bool HasOrbit()
|
||||
{
|
||||
return _orbitInfo.HasValue;
|
||||
return _orbitInfo != null;
|
||||
}
|
||||
|
||||
Position GetOrbitCenterPosition()
|
||||
{
|
||||
if (!_orbitInfo.HasValue)
|
||||
if (_orbitInfo == null)
|
||||
return null;
|
||||
|
||||
if (_orbitInfo.Value.PathTarget.HasValue)
|
||||
if (_orbitInfo.PathTarget.HasValue)
|
||||
{
|
||||
WorldObject center = Global.ObjAccessor.GetWorldObject(this, _orbitInfo.Value.PathTarget.Value);
|
||||
WorldObject center = Global.ObjAccessor.GetWorldObject(this, _orbitInfo.PathTarget.Value);
|
||||
if (center)
|
||||
return center;
|
||||
}
|
||||
|
||||
if (_orbitInfo.Value.Center.HasValue)
|
||||
return new Position(_orbitInfo.Value.Center.Value);
|
||||
if (_orbitInfo.Center.HasValue)
|
||||
return new Position(_orbitInfo.Center.Value);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -825,7 +825,7 @@ namespace Game.Entities
|
||||
if (centerPos == null)
|
||||
return GetPosition();
|
||||
|
||||
AreaTriggerOrbitInfo cmi = _orbitInfo.Value;
|
||||
AreaTriggerOrbitInfo cmi = _orbitInfo;
|
||||
|
||||
// AreaTrigger make exactly "Duration / TimeToTarget" loops during his life time
|
||||
float pathProgress = (float)cmi.ElapsedTimeForMovement / cmi.TimeToTarget;
|
||||
@@ -858,10 +858,10 @@ namespace Game.Entities
|
||||
|
||||
void UpdateOrbitPosition(uint diff)
|
||||
{
|
||||
if (_orbitInfo.Value.StartDelay > GetElapsedTimeForMovement())
|
||||
if (_orbitInfo.StartDelay > GetElapsedTimeForMovement())
|
||||
return;
|
||||
|
||||
_orbitInfo.Value.ElapsedTimeForMovement = (int)(GetElapsedTimeForMovement() - _orbitInfo.Value.StartDelay);
|
||||
_orbitInfo.ElapsedTimeForMovement = (int)(GetElapsedTimeForMovement() - _orbitInfo.StartDelay);
|
||||
|
||||
Position pos = CalculateOrbitPosition();
|
||||
|
||||
@@ -1066,7 +1066,7 @@ namespace Game.Entities
|
||||
public Spline GetSpline() { return _spline; }
|
||||
public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } // @todo: research the right value, in sniffs both timers are nearly identical
|
||||
|
||||
public Optional<AreaTriggerOrbitInfo> GetCircularMovementInfo() { return _orbitInfo; }
|
||||
public AreaTriggerOrbitInfo GetCircularMovementInfo() { return _orbitInfo; }
|
||||
|
||||
AreaTriggerFieldData m_areaTriggerData;
|
||||
|
||||
@@ -1093,7 +1093,7 @@ namespace Game.Entities
|
||||
int _lastSplineIndex;
|
||||
uint _movementTime;
|
||||
|
||||
Optional<AreaTriggerOrbitInfo> _orbitInfo;
|
||||
AreaTriggerOrbitInfo _orbitInfo;
|
||||
|
||||
AreaTriggerCreateProperties _areaTriggerCreateProperties;
|
||||
AreaTriggerTemplate _areaTriggerTemplate;
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Game.Entities
|
||||
public bool IsCylinder() { return TriggerType == AreaTriggerTypes.Cylinder; }
|
||||
}
|
||||
|
||||
public struct AreaTriggerOrbitInfo
|
||||
public class AreaTriggerOrbitInfo
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
@@ -236,8 +236,8 @@ namespace Game.Entities
|
||||
data.WriteVector3(Center.Value);
|
||||
}
|
||||
|
||||
public Optional<ObjectGuid> PathTarget;
|
||||
public Optional<Vector3> Center;
|
||||
public ObjectGuid? PathTarget;
|
||||
public Vector3? Center;
|
||||
public bool CounterClockwise;
|
||||
public bool CanLoop;
|
||||
public uint TimeToTarget;
|
||||
@@ -315,7 +315,7 @@ namespace Game.Entities
|
||||
public List<Vector2> PolygonVertices = new();
|
||||
public List<Vector2> PolygonVerticesTarget = new();
|
||||
public List<Vector3> SplinePoints = new();
|
||||
public Optional<AreaTriggerOrbitInfo> OrbitInfo;
|
||||
public AreaTriggerOrbitInfo OrbitInfo;
|
||||
|
||||
public uint ScriptId;
|
||||
}
|
||||
|
||||
@@ -2828,9 +2828,9 @@ namespace Game.Entities
|
||||
|
||||
public BonusData(ItemInstance itemInstance) : this(Global.ObjectMgr.GetItemTemplate(itemInstance.ItemID))
|
||||
{
|
||||
if (itemInstance.ItemBonus.HasValue)
|
||||
if (itemInstance.ItemBonus != null)
|
||||
{
|
||||
foreach (uint bonusListID in itemInstance.ItemBonus.Value.BonusListIDs)
|
||||
foreach (uint bonusListID in itemInstance.ItemBonus.BonusListIDs)
|
||||
AddBonusList(bonusListID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,35 @@ namespace Game.Entities
|
||||
public T GetValue() { return _value; }
|
||||
}
|
||||
|
||||
public class OptionalUpdateField<T> : IUpdateField<T> where T : new()
|
||||
{
|
||||
bool _hasValue;
|
||||
public T _value;
|
||||
public int BlockBit;
|
||||
public int Bit;
|
||||
|
||||
public OptionalUpdateField(int blockBit, int bit)
|
||||
{
|
||||
BlockBit = blockBit;
|
||||
Bit = bit;
|
||||
}
|
||||
|
||||
public static implicit operator T(OptionalUpdateField<T> updateField)
|
||||
{
|
||||
return updateField._value;
|
||||
}
|
||||
|
||||
public void SetValue(T value)
|
||||
{
|
||||
_hasValue = true;
|
||||
_value = value;
|
||||
}
|
||||
|
||||
public T GetValue() { return _value; }
|
||||
|
||||
public bool HasValue() { return _hasValue; }
|
||||
}
|
||||
|
||||
public class UpdateFieldArray<T> where T : new()
|
||||
{
|
||||
public T[] _values;
|
||||
@@ -351,6 +380,12 @@ namespace Game.Entities
|
||||
((IHasChangesMask)updateField._value).ClearChangesMask();
|
||||
}
|
||||
|
||||
public void ClearChangesMask<U>(OptionalUpdateField<U> updateField) where U : new()
|
||||
{
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)))
|
||||
((IHasChangesMask)updateField._value).ClearChangesMask();
|
||||
}
|
||||
|
||||
public void ClearChangesMask<U>(UpdateFieldArray<U> updateField) where U : new()
|
||||
{
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)))
|
||||
|
||||
@@ -3548,7 +3548,7 @@ namespace Game.Entities
|
||||
public UpdateField<uint> HonorNextLevel = new(98, 103);
|
||||
public UpdateField<byte> NumBankSlots = new(98, 104);
|
||||
public UpdateField<ActivePlayerUnk901> Field_1410 = new(98, 106);
|
||||
public UpdateField<Optional<QuestSession>> QuestSession = new(98, 105);
|
||||
public OptionalUpdateField<QuestSession> QuestSession = new(98, 105);
|
||||
public UpdateField<int> UiChromieTimeExpansionID = new(98, 107);
|
||||
public UpdateField<int> TransportServerTime = new(98, 108);
|
||||
public UpdateField<uint> WeeklyRewardsPeriodSinceOrigin = new(98, 109); // week count since Cfg_RegionsEntry::ChallengeOrigin
|
||||
@@ -3830,11 +3830,11 @@ namespace Game.Entities
|
||||
data.WriteBit(BankAutoSortDisabled);
|
||||
data.WriteBit(SortBagsRightToLeft);
|
||||
data.WriteBit(InsertItemsLeftToRight);
|
||||
data.WriteBits(QuestSession.GetValue().HasValue, 1);
|
||||
data.WriteBits(QuestSession.HasValue(), 1);
|
||||
((ActivePlayerUnk901)Field_1410).WriteCreate(data, owner, receiver);
|
||||
if (QuestSession.GetValue().HasValue)
|
||||
if (QuestSession.HasValue())
|
||||
{
|
||||
QuestSession.GetValue().Value.WriteCreate(data, owner, receiver);
|
||||
QuestSession.GetValue().WriteCreate(data, owner, receiver);
|
||||
}
|
||||
DungeonScore._value.Write(data);
|
||||
for (int i = 0; i < CharacterRestrictions.Size(); ++i)
|
||||
@@ -4599,16 +4599,16 @@ namespace Game.Entities
|
||||
}
|
||||
if (changesMask[98])
|
||||
{
|
||||
data.WriteBits(QuestSession.GetValue().HasValue, 1);
|
||||
data.WriteBits(QuestSession.HasValue(), 1);
|
||||
if (changesMask[106])
|
||||
{
|
||||
((ActivePlayerUnk901)Field_1410).WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
if (changesMask[105])
|
||||
{
|
||||
if (QuestSession.GetValue().HasValue)
|
||||
if (QuestSession.HasValue())
|
||||
{
|
||||
QuestSession.GetValue().Value.WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
QuestSession.GetValue().WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
}
|
||||
if (changesMask[111])
|
||||
|
||||
@@ -522,7 +522,7 @@ namespace Game.Entities
|
||||
// *data << *areaTrigger.GetMovementScript(); // AreaTriggerMovementScriptInfo
|
||||
|
||||
if (hasOrbit)
|
||||
areaTrigger.GetCircularMovementInfo().Value.Write(data);
|
||||
areaTrigger.GetCircularMovementInfo().Write(data);
|
||||
}
|
||||
|
||||
if (flags.GameObject)
|
||||
@@ -960,7 +960,7 @@ namespace Game.Entities
|
||||
if (GetTypeId() == TypeId.Player)
|
||||
return;
|
||||
|
||||
m_visibilityDistanceOverride.Set(SharedConst.VisibilityDistances[(int)type]);
|
||||
m_visibilityDistanceOverride = SharedConst.VisibilityDistances[(int)type];
|
||||
}
|
||||
|
||||
public virtual void CleanupsBeforeDelete(bool finalCleanup = true)
|
||||
@@ -3577,7 +3577,7 @@ namespace Game.Entities
|
||||
string _name;
|
||||
protected bool m_isActive;
|
||||
bool m_isFarVisible;
|
||||
Optional<float> m_visibilityDistanceOverride;
|
||||
float? m_visibilityDistanceOverride;
|
||||
bool m_isWorldObject;
|
||||
public ZoneScript m_zoneScript;
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace Game.Entities
|
||||
public class PlayerInfo
|
||||
{
|
||||
public CreatePosition createPosition;
|
||||
public Optional<CreatePosition> createPositionNPE;
|
||||
public CreatePosition? createPositionNPE;
|
||||
|
||||
public List<PlayerCreateInfoItem> item = new();
|
||||
public List<uint> customSpells = new();
|
||||
@@ -273,9 +273,9 @@ namespace Game.Entities
|
||||
public List<PlayerCreateInfoAction> action = new();
|
||||
public List<SkillRaceClassInfoRecord> skills = new();
|
||||
|
||||
public Optional<uint> introMovieId;
|
||||
public Optional<uint> introSceneId;
|
||||
public Optional<uint> introSceneIdNPE;
|
||||
public uint? introMovieId;
|
||||
public uint? introSceneId;
|
||||
public uint? introSceneIdNPE;
|
||||
|
||||
public PlayerLevelInfo[] levelInfo = new PlayerLevelInfo[WorldConfig.GetIntValue(WorldCfg.MaxPlayerLevel)];
|
||||
|
||||
|
||||
@@ -200,12 +200,12 @@ namespace Game.Entities
|
||||
itemPurchaseRefundResult.Result = error;
|
||||
if (error == 0)
|
||||
{
|
||||
itemPurchaseRefundResult.Contents.Value = new();
|
||||
itemPurchaseRefundResult.Contents.Value.Money = item.GetPaidMoney();
|
||||
itemPurchaseRefundResult.Contents = new();
|
||||
itemPurchaseRefundResult.Contents.Money = item.GetPaidMoney();
|
||||
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) // item cost data
|
||||
{
|
||||
itemPurchaseRefundResult.Contents.Value.Items[i].ItemCount = iece.ItemCount[i];
|
||||
itemPurchaseRefundResult.Contents.Value.Items[i].ItemID = iece.ItemID[i];
|
||||
itemPurchaseRefundResult.Contents.Items[i].ItemCount = iece.ItemCount[i];
|
||||
itemPurchaseRefundResult.Contents.Items[i].ItemID = iece.ItemID[i];
|
||||
}
|
||||
|
||||
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) // currency cost data
|
||||
@@ -213,8 +213,8 @@ namespace Game.Entities
|
||||
if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
|
||||
continue;
|
||||
|
||||
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
|
||||
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyID = iece.CurrencyID[i];
|
||||
itemPurchaseRefundResult.Contents.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
|
||||
itemPurchaseRefundResult.Contents.Currencies[i].CurrencyID = iece.CurrencyID[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -787,16 +787,16 @@ namespace Game.Entities
|
||||
SendPacket(raidInstanceMessage);
|
||||
}
|
||||
|
||||
public override void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, Optional<LiquidData> newLiquidData)
|
||||
public override void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, LiquidData newLiquidData)
|
||||
{
|
||||
// process liquid auras using generic unit code
|
||||
base.ProcessTerrainStatusUpdate(oldLiquidStatus, newLiquidData);
|
||||
|
||||
// player specific logic for mirror timers
|
||||
if (GetLiquidStatus() != 0 && newLiquidData.HasValue)
|
||||
if (GetLiquidStatus() != 0 && newLiquidData != null)
|
||||
{
|
||||
// Breath bar state (under water in any liquid type)
|
||||
if (newLiquidData.Value.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.AllLiquids))
|
||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.AllLiquids))
|
||||
{
|
||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.UnderWater))
|
||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InWater;
|
||||
@@ -805,13 +805,13 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// Fatigue bar state (if not on flight path or transport)
|
||||
if (newLiquidData.Value.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.DarkWater) && !IsInFlight() && !GetTransport())
|
||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.DarkWater) && !IsInFlight() && !GetTransport())
|
||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InDarkWater;
|
||||
else
|
||||
m_MirrorTimerFlags &= ~PlayerUnderwaterState.InDarkWater;
|
||||
|
||||
// Lava state (any contact)
|
||||
if (newLiquidData.Value.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Magma))
|
||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Magma))
|
||||
{
|
||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InLava;
|
||||
@@ -820,7 +820,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// Slime state (any contact)
|
||||
if (newLiquidData.Value.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Slime))
|
||||
if (newLiquidData.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Slime))
|
||||
{
|
||||
if (GetLiquidStatus().HasAnyFlag(ZLiquidStatus.InContact))
|
||||
m_MirrorTimerFlags |= PlayerUnderwaterState.InSlime;
|
||||
|
||||
@@ -1238,10 +1238,10 @@ namespace Game.Entities
|
||||
packet.Type = (uint)id;
|
||||
packet.Quantity = newTotalCount;
|
||||
packet.SuppressChatLog = !printLog;
|
||||
packet.WeeklyQuantity.Set(newWeekCount);
|
||||
packet.TrackedQuantity.Set(newTrackedCount);
|
||||
packet.WeeklyQuantity = newWeekCount;
|
||||
packet.TrackedQuantity = newTrackedCount;
|
||||
packet.Flags = playerCurrency.Flags;
|
||||
packet.QuantityChange.Set(count);
|
||||
packet.QuantityChange = count;
|
||||
|
||||
SendPacket(packet);
|
||||
}
|
||||
@@ -1835,9 +1835,10 @@ namespace Game.Entities
|
||||
transport = GetTransport();
|
||||
if (transport)
|
||||
{
|
||||
transferPending.Ship.Value = new();
|
||||
transferPending.Ship.Value.Id = transport.GetEntry();
|
||||
transferPending.Ship.Value.OriginMapID = (int)GetMapId();
|
||||
TransferPending.ShipTransferPending shipTransferPending = new();
|
||||
shipTransferPending.Id = transport.GetEntry();
|
||||
shipTransferPending.OriginMapID = (int)GetMapId();
|
||||
transferPending.Ship = shipTransferPending;
|
||||
}
|
||||
|
||||
SendPacket(transferPending);
|
||||
@@ -1879,7 +1880,7 @@ namespace Game.Entities
|
||||
return TeleportTo(m_bgData.joinPos);
|
||||
}
|
||||
|
||||
public uint GetStartLevel(Race race, Class playerClass, Optional<uint> characterTemplateId = default)
|
||||
public uint GetStartLevel(Race race, Class playerClass, uint? characterTemplateId = null)
|
||||
{
|
||||
uint startLevel = WorldConfig.GetUIntValue(WorldCfg.StartPlayerLevel);
|
||||
if (CliDB.ChrRacesStorage.LookupByKey(race).GetFlags().HasAnyFlag(ChrRacesFlag.IsAlliedRace))
|
||||
@@ -4980,32 +4981,32 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (playerChoiceResponseTemplate.Reward.HasValue)
|
||||
if (playerChoiceResponseTemplate.Reward != null)
|
||||
{
|
||||
var reward = new Networking.Packets.PlayerChoiceResponseReward();
|
||||
reward.TitleID = playerChoiceResponseTemplate.Reward.Value.TitleId;
|
||||
reward.PackageID = playerChoiceResponseTemplate.Reward.Value.PackageId;
|
||||
reward.SkillLineID = playerChoiceResponseTemplate.Reward.Value.SkillLineId;
|
||||
reward.SkillPointCount = playerChoiceResponseTemplate.Reward.Value.SkillPointCount;
|
||||
reward.ArenaPointCount = playerChoiceResponseTemplate.Reward.Value.ArenaPointCount;
|
||||
reward.HonorPointCount = playerChoiceResponseTemplate.Reward.Value.HonorPointCount;
|
||||
reward.Money = playerChoiceResponseTemplate.Reward.Value.Money;
|
||||
reward.Xp = playerChoiceResponseTemplate.Reward.Value.Xp;
|
||||
reward.TitleID = playerChoiceResponseTemplate.Reward.TitleId;
|
||||
reward.PackageID = playerChoiceResponseTemplate.Reward.PackageId;
|
||||
reward.SkillLineID = playerChoiceResponseTemplate.Reward.SkillLineId;
|
||||
reward.SkillPointCount = playerChoiceResponseTemplate.Reward.SkillPointCount;
|
||||
reward.ArenaPointCount = playerChoiceResponseTemplate.Reward.ArenaPointCount;
|
||||
reward.HonorPointCount = playerChoiceResponseTemplate.Reward.HonorPointCount;
|
||||
reward.Money = playerChoiceResponseTemplate.Reward.Money;
|
||||
reward.Xp = playerChoiceResponseTemplate.Reward.Xp;
|
||||
|
||||
foreach (var item in playerChoiceResponseTemplate.Reward.Value.Items)
|
||||
foreach (var item in playerChoiceResponseTemplate.Reward.Items)
|
||||
{
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = item.Id;
|
||||
rewardEntry.Quantity = item.Quantity;
|
||||
if (!item.BonusListIDs.Empty())
|
||||
{
|
||||
rewardEntry.Item.ItemBonus.Value = new();
|
||||
rewardEntry.Item.ItemBonus.Value.BonusListIDs = item.BonusListIDs;
|
||||
rewardEntry.Item.ItemBonus = new();
|
||||
rewardEntry.Item.ItemBonus.BonusListIDs = item.BonusListIDs;
|
||||
}
|
||||
reward.Items.Add(rewardEntry);
|
||||
}
|
||||
|
||||
foreach (var currency in playerChoiceResponseTemplate.Reward.Value.Currency)
|
||||
foreach (var currency in playerChoiceResponseTemplate.Reward.Currency)
|
||||
{
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = currency.Id;
|
||||
@@ -5013,7 +5014,7 @@ namespace Game.Entities
|
||||
reward.Items.Add(rewardEntry);
|
||||
}
|
||||
|
||||
foreach (var faction in playerChoiceResponseTemplate.Reward.Value.Faction)
|
||||
foreach (var faction in playerChoiceResponseTemplate.Reward.Faction)
|
||||
{
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = faction.Id;
|
||||
@@ -5021,21 +5022,21 @@ namespace Game.Entities
|
||||
reward.Items.Add(rewardEntry);
|
||||
}
|
||||
|
||||
foreach (PlayerChoiceResponseRewardItem item in playerChoiceResponseTemplate.Reward.Value.ItemChoices)
|
||||
foreach (PlayerChoiceResponseRewardItem item in playerChoiceResponseTemplate.Reward.ItemChoices)
|
||||
{
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = item.Id;
|
||||
rewardEntry.Quantity = item.Quantity;
|
||||
if (!item.BonusListIDs.Empty())
|
||||
{
|
||||
rewardEntry.Item.ItemBonus.Value = new();
|
||||
rewardEntry.Item.ItemBonus.Value.BonusListIDs = item.BonusListIDs;
|
||||
rewardEntry.Item.ItemBonus = new();
|
||||
rewardEntry.Item.ItemBonus.BonusListIDs = item.BonusListIDs;
|
||||
}
|
||||
|
||||
reward.ItemChoices.Add(rewardEntry);
|
||||
}
|
||||
|
||||
playerChoiceResponse.Reward.Set(reward);
|
||||
playerChoiceResponse.Reward = reward;
|
||||
displayPlayerChoice.Responses[i] = playerChoiceResponse;
|
||||
}
|
||||
|
||||
@@ -5050,7 +5051,7 @@ namespace Game.Entities
|
||||
mawPower.SpellID = playerChoiceResponse.MawPower.Value.SpellID;
|
||||
mawPower.MaxStacks = playerChoiceResponse.MawPower.Value.MaxStacks;
|
||||
|
||||
playerChoiceResponse.MawPower.Set(mawPower);
|
||||
playerChoiceResponse.MawPower = mawPower;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5662,10 +5663,10 @@ namespace Game.Entities
|
||||
|
||||
// SMSG_WORLD_SERVER_INFO
|
||||
WorldServerInfo worldServerInfo = new();
|
||||
worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); // @todo
|
||||
worldServerInfo.InstanceGroupSize = GetMap().GetMapDifficulty().MaxPlayers; // @todo
|
||||
worldServerInfo.IsTournamentRealm = 0; // @todo
|
||||
worldServerInfo.RestrictedAccountMaxLevel.Clear(); // @todo
|
||||
worldServerInfo.RestrictedAccountMaxMoney.Clear(); // @todo
|
||||
worldServerInfo.RestrictedAccountMaxLevel = null; // @todo
|
||||
worldServerInfo.RestrictedAccountMaxMoney = null; // @todo
|
||||
worldServerInfo.DifficultyID = (uint)GetMap().GetDifficultyID();
|
||||
// worldServerInfo.XRealmPvpAlert; // @todo
|
||||
SendPacket(worldServerInfo);
|
||||
@@ -6240,9 +6241,9 @@ namespace Game.Entities
|
||||
SetupCurrency.Record record = new();
|
||||
record.Type = entry.Id;
|
||||
record.Quantity = Curr.Quantity;
|
||||
record.WeeklyQuantity.Set(Curr.WeeklyQuantity);
|
||||
record.MaxWeeklyQuantity.Set(GetCurrencyWeekCap(entry));
|
||||
record.TrackedQuantity.Set(Curr.TrackedQuantity);
|
||||
record.WeeklyQuantity = Curr.WeeklyQuantity;
|
||||
record.MaxWeeklyQuantity = GetCurrencyWeekCap(entry);
|
||||
record.TrackedQuantity = Curr.TrackedQuantity;
|
||||
record.Flags = Curr.Flags;
|
||||
|
||||
packet.Data.Add(record);
|
||||
@@ -6265,9 +6266,9 @@ namespace Game.Entities
|
||||
SetupCurrency.Record record = new();
|
||||
record.Type = entry.Id;
|
||||
record.Quantity = pair.Value.Quantity;
|
||||
record.WeeklyQuantity.Set(pair.Value.WeeklyQuantity);
|
||||
record.MaxWeeklyQuantity.Set(GetCurrencyWeekCap(entry));
|
||||
record.TrackedQuantity.Set(pair.Value.TrackedQuantity);
|
||||
record.WeeklyQuantity = pair.Value.WeeklyQuantity;
|
||||
record.MaxWeeklyQuantity = GetCurrencyWeekCap(entry);
|
||||
record.TrackedQuantity = pair.Value.TrackedQuantity;
|
||||
record.Flags = pair.Value.Flags;
|
||||
|
||||
packet.Data.Add(record);
|
||||
|
||||
@@ -616,7 +616,7 @@ namespace Game.Entities
|
||||
subDmg.Damage = (int)damageInfo.Damage; // Sub Damage
|
||||
subDmg.Absorbed = (int)damageInfo.Absorb;
|
||||
subDmg.Resisted = (int)damageInfo.Resist;
|
||||
packet.SubDmg.Set(subDmg);
|
||||
packet.SubDmg = subDmg;
|
||||
|
||||
packet.VictimState = (byte)damageInfo.TargetState;
|
||||
packet.BlockAmount = (int)damageInfo.Blocked;
|
||||
|
||||
@@ -825,7 +825,7 @@ namespace Game.Entities
|
||||
ProcessTerrainStatusUpdate(oldLiquidStatus, data.LiquidInfo);
|
||||
}
|
||||
|
||||
public virtual void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, Optional<LiquidData> newLiquidData)
|
||||
public virtual void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, LiquidData newLiquidData)
|
||||
{
|
||||
if (!IsControlledByPlayer())
|
||||
return;
|
||||
@@ -838,8 +838,8 @@ namespace Game.Entities
|
||||
|
||||
// liquid aura handling
|
||||
LiquidTypeRecord curLiquid = null;
|
||||
if (IsInWater() && newLiquidData.HasValue)
|
||||
curLiquid = CliDB.LiquidTypeStorage.LookupByKey(newLiquidData.Value.entry);
|
||||
if (IsInWater() && newLiquidData != null)
|
||||
curLiquid = CliDB.LiquidTypeStorage.LookupByKey(newLiquidData.entry);
|
||||
if (curLiquid != _lastLiquid)
|
||||
{
|
||||
if (_lastLiquid != null && _lastLiquid.SpellID != 0)
|
||||
@@ -1804,7 +1804,8 @@ namespace Game.Entities
|
||||
moveTeleport.MoverGUID = GetGUID();
|
||||
moveTeleport.Pos = new Position(x, y, z, o);
|
||||
if (GetTransGUID() != ObjectGuid.Empty)
|
||||
moveTeleport.TransportGUID.Set(GetTransGUID());
|
||||
moveTeleport.TransportGUID = GetTransGUID();
|
||||
|
||||
moveTeleport.Facing = o;
|
||||
moveTeleport.SequenceIndex = m_movementCounter++;
|
||||
playerMover.SendPacket(moveTeleport);
|
||||
|
||||
@@ -2092,7 +2092,7 @@ namespace Game.Entities
|
||||
|
||||
ContentTuningParams contentTuningParams = new();
|
||||
if (contentTuningParams.GenerateDataForUnits(log.attacker, log.target))
|
||||
packet.ContentTuning.Set(contentTuningParams);
|
||||
packet.ContentTuning = contentTuningParams;
|
||||
|
||||
SendCombatLogMessage(packet);
|
||||
}
|
||||
@@ -2121,7 +2121,7 @@ namespace Game.Entities
|
||||
ContentTuningParams contentTuningParams = new();
|
||||
Unit caster = Global.ObjAccessor.GetUnit(this, aura.GetCasterGUID());
|
||||
if (caster && contentTuningParams.GenerateDataForUnits(caster, this))
|
||||
spellLogEffect.ContentTuning.Set(contentTuningParams);
|
||||
spellLogEffect.ContentTuning = contentTuningParams;
|
||||
|
||||
data.Effects.Add(spellLogEffect);
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ namespace Game.Garrisons
|
||||
long timeBuilt = buildings.Read<long>(2);
|
||||
bool active = buildings.Read<bool>(3);
|
||||
|
||||
|
||||
Plot plot = GetPlot(plotInstanceId);
|
||||
if (plot == null)
|
||||
continue;
|
||||
@@ -77,11 +76,11 @@ namespace Game.Garrisons
|
||||
if (!CliDB.GarrBuildingStorage.ContainsKey(buildingId))
|
||||
continue;
|
||||
|
||||
plot.BuildingInfo.PacketInfo.Value = new();
|
||||
plot.BuildingInfo.PacketInfo.Value.GarrPlotInstanceID = plotInstanceId;
|
||||
plot.BuildingInfo.PacketInfo.Value.GarrBuildingID = buildingId;
|
||||
plot.BuildingInfo.PacketInfo.Value.TimeBuilt = timeBuilt;
|
||||
plot.BuildingInfo.PacketInfo.Value.Active = active;
|
||||
plot.BuildingInfo.PacketInfo = new();
|
||||
plot.BuildingInfo.PacketInfo.GarrPlotInstanceID = plotInstanceId;
|
||||
plot.BuildingInfo.PacketInfo.GarrBuildingID = buildingId;
|
||||
plot.BuildingInfo.PacketInfo.TimeBuilt = timeBuilt;
|
||||
plot.BuildingInfo.PacketInfo.Active = active;
|
||||
|
||||
} while (buildings.NextRow());
|
||||
}
|
||||
@@ -159,14 +158,14 @@ namespace Game.Garrisons
|
||||
|
||||
foreach (var plot in _plots.Values)
|
||||
{
|
||||
if (plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo != null)
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_GARRISON_BUILDINGS);
|
||||
stmt.AddValue(0, _owner.GetGUID().GetCounter());
|
||||
stmt.AddValue(1, plot.BuildingInfo.PacketInfo.Value.GarrPlotInstanceID);
|
||||
stmt.AddValue(2, plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
stmt.AddValue(3, plot.BuildingInfo.PacketInfo.Value.TimeBuilt);
|
||||
stmt.AddValue(4, plot.BuildingInfo.PacketInfo.Value.Active);
|
||||
stmt.AddValue(1, plot.BuildingInfo.PacketInfo.GarrPlotInstanceID);
|
||||
stmt.AddValue(2, plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
stmt.AddValue(3, plot.BuildingInfo.PacketInfo.TimeBuilt);
|
||||
stmt.AddValue(4, plot.BuildingInfo.PacketInfo.Active);
|
||||
trans.Append(stmt);
|
||||
}
|
||||
}
|
||||
@@ -369,9 +368,9 @@ namespace Game.Garrisons
|
||||
if (map)
|
||||
plot.DeleteGameObject(map);
|
||||
|
||||
if (plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo != null)
|
||||
{
|
||||
oldBuildingId = plot.BuildingInfo.PacketInfo.Value.GarrBuildingID;
|
||||
oldBuildingId = plot.BuildingInfo.PacketInfo.GarrBuildingID;
|
||||
if (CliDB.GarrBuildingStorage.LookupByKey(oldBuildingId).BuildingType != building.BuildingType)
|
||||
plot.ClearBuildingInfo(GetGarrisonType(), _owner);
|
||||
}
|
||||
@@ -413,7 +412,7 @@ namespace Game.Garrisons
|
||||
Plot plot = GetPlot(garrPlotInstanceId);
|
||||
|
||||
buildingRemoved.GarrPlotInstanceID = garrPlotInstanceId;
|
||||
buildingRemoved.GarrBuildingID = plot.BuildingInfo.PacketInfo.Value.GarrBuildingID;
|
||||
buildingRemoved.GarrBuildingID = plot.BuildingInfo.PacketInfo.GarrBuildingID;
|
||||
|
||||
Map map = FindMap();
|
||||
if (map)
|
||||
@@ -461,9 +460,9 @@ namespace Game.Garrisons
|
||||
Plot plot = GetPlot(garrPlotInstanceId);
|
||||
if (plot != null)
|
||||
{
|
||||
if (plot.BuildingInfo.CanActivate() && plot.BuildingInfo.PacketInfo.HasValue && !plot.BuildingInfo.PacketInfo.Value.Active)
|
||||
if (plot.BuildingInfo.CanActivate() && plot.BuildingInfo.PacketInfo != null && !plot.BuildingInfo.PacketInfo.Active)
|
||||
{
|
||||
plot.BuildingInfo.PacketInfo.Value.Active = true;
|
||||
plot.BuildingInfo.PacketInfo.Active = true;
|
||||
Map map = FindMap();
|
||||
if (map)
|
||||
{
|
||||
@@ -477,7 +476,7 @@ namespace Game.Garrisons
|
||||
buildingActivated.GarrPlotInstanceID = garrPlotInstanceId;
|
||||
_owner.SendPacket(buildingActivated);
|
||||
|
||||
_owner.UpdateCriteria(CriteriaType.ActivateAnyGarrisonBuilding, plot.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
_owner.UpdateCriteria(CriteriaType.ActivateAnyGarrisonBuilding, plot.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,8 +544,8 @@ namespace Game.Garrisons
|
||||
foreach (var plot in _plots.Values)
|
||||
{
|
||||
garrison.Plots.Add(plot.PacketInfo);
|
||||
if (plot.BuildingInfo.PacketInfo.HasValue)
|
||||
garrison.Buildings.Add(plot.BuildingInfo.PacketInfo.Value);
|
||||
if (plot.BuildingInfo.PacketInfo != null)
|
||||
garrison.Buildings.Add(plot.BuildingInfo.PacketInfo);
|
||||
}
|
||||
|
||||
foreach (var follower in _followers.Values)
|
||||
@@ -568,8 +567,8 @@ namespace Game.Garrisons
|
||||
GarrisonRemoteSiteInfo remoteSiteInfo = new();
|
||||
remoteSiteInfo.GarrSiteLevelID = _siteLevel.Id;
|
||||
foreach (var p in _plots)
|
||||
if (p.Value.BuildingInfo.PacketInfo.HasValue)
|
||||
remoteSiteInfo.Buildings.Add(new GarrisonRemoteBuildingInfo(p.Key, p.Value.BuildingInfo.PacketInfo.Value.GarrBuildingID));
|
||||
if (p.Value.BuildingInfo.PacketInfo != null)
|
||||
remoteSiteInfo.Buildings.Add(new GarrisonRemoteBuildingInfo(p.Key, p.Value.BuildingInfo.PacketInfo.GarrBuildingID));
|
||||
|
||||
remoteInfo.Sites.Add(remoteSiteInfo);
|
||||
_owner.SendPacket(remoteInfo);
|
||||
@@ -589,9 +588,9 @@ namespace Game.Garrisons
|
||||
|
||||
foreach (var plot in _plots.Values)
|
||||
{
|
||||
if (plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo != null)
|
||||
{
|
||||
uint garrBuildingPlotInstId = Global.GarrisonMgr.GetGarrBuildingPlotInst(plot.BuildingInfo.PacketInfo.Value.GarrBuildingID, plot.GarrSiteLevelPlotInstId);
|
||||
uint garrBuildingPlotInstId = Global.GarrisonMgr.GetGarrBuildingPlotInst(plot.BuildingInfo.PacketInfo.GarrBuildingID, plot.GarrSiteLevelPlotInstId);
|
||||
if (garrBuildingPlotInstId != 0)
|
||||
mapData.Buildings.Add(new GarrisonBuildingMapData(garrBuildingPlotInstId, plot.PacketInfo.PlotPos));
|
||||
}
|
||||
@@ -635,9 +634,9 @@ namespace Game.Garrisons
|
||||
GarrBuildingRecord existingBuilding;
|
||||
foreach (var p in _plots)
|
||||
{
|
||||
if (p.Value.BuildingInfo.PacketInfo.HasValue)
|
||||
if (p.Value.BuildingInfo.PacketInfo != null)
|
||||
{
|
||||
existingBuilding = CliDB.GarrBuildingStorage.LookupByKey(p.Value.BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
existingBuilding = CliDB.GarrBuildingStorage.LookupByKey(p.Value.BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
if (existingBuilding.BuildingType == building.BuildingType)
|
||||
if (p.Key != garrPlotInstanceId || existingBuilding.UpgradeLevel + 1 != building.UpgradeLevel) // check if its an upgrade in same plot
|
||||
return GarrisonError.BuildingExists;
|
||||
@@ -651,8 +650,8 @@ namespace Game.Garrisons
|
||||
return GarrisonError.NotEnoughGold;
|
||||
|
||||
// New building cannot replace another building currently under construction
|
||||
if (plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (!plot.BuildingInfo.PacketInfo.Value.Active)
|
||||
if (plot.BuildingInfo.PacketInfo != null)
|
||||
if (!plot.BuildingInfo.PacketInfo.Active)
|
||||
return GarrisonError.NoBuilding;
|
||||
|
||||
return GarrisonError.Success;
|
||||
@@ -664,7 +663,7 @@ namespace Game.Garrisons
|
||||
if (plot == null)
|
||||
return GarrisonError.InvalidPlotInstanceId;
|
||||
|
||||
if (!plot.BuildingInfo.PacketInfo.HasValue)
|
||||
if (plot.BuildingInfo.PacketInfo == null)
|
||||
return GarrisonError.NoBuilding;
|
||||
|
||||
if (plot.BuildingInfo.CanActivate())
|
||||
@@ -688,10 +687,10 @@ namespace Game.Garrisons
|
||||
{
|
||||
public bool CanActivate()
|
||||
{
|
||||
if (PacketInfo.HasValue)
|
||||
if (PacketInfo != null)
|
||||
{
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.Value.GarrBuildingID);
|
||||
if (PacketInfo.Value.TimeBuilt + building.BuildSeconds <= GameTime.GetGameTime())
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.GarrBuildingID);
|
||||
if (PacketInfo.TimeBuilt + building.BuildSeconds <= GameTime.GetGameTime())
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -700,7 +699,7 @@ namespace Game.Garrisons
|
||||
|
||||
public ObjectGuid Guid;
|
||||
public List<ObjectGuid> Spawns = new();
|
||||
public Optional<GarrisonBuildingInfo> PacketInfo;
|
||||
public GarrisonBuildingInfo PacketInfo;
|
||||
}
|
||||
|
||||
public class Plot
|
||||
@@ -708,14 +707,14 @@ namespace Game.Garrisons
|
||||
public GameObject CreateGameObject(Map map, uint faction)
|
||||
{
|
||||
uint entry = EmptyGameObjectId;
|
||||
if (BuildingInfo.PacketInfo.HasValue)
|
||||
if (BuildingInfo.PacketInfo != null)
|
||||
{
|
||||
GarrPlotInstanceRecord plotInstance = CliDB.GarrPlotInstanceStorage.LookupByKey(PacketInfo.GarrPlotInstanceID);
|
||||
GarrPlotRecord plot = CliDB.GarrPlotStorage.LookupByKey(plotInstance.GarrPlotID);
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(BuildingInfo.PacketInfo.Value.GarrBuildingID);
|
||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(BuildingInfo.PacketInfo.GarrBuildingID);
|
||||
|
||||
entry = faction == GarrisonFactionIndex.Horde ? plot.HordeConstructObjID : plot.AllianceConstructObjID;
|
||||
if (BuildingInfo.PacketInfo.Value.Active || entry == 0)
|
||||
if (BuildingInfo.PacketInfo.Active || entry == 0)
|
||||
entry = faction == GarrisonFactionIndex.Horde ? building.HordeGameObjectID : building.AllianceGameObjectID;
|
||||
}
|
||||
|
||||
@@ -729,7 +728,7 @@ namespace Game.Garrisons
|
||||
if (!go)
|
||||
return null;
|
||||
|
||||
if (BuildingInfo.CanActivate() && BuildingInfo.PacketInfo.HasValue && !BuildingInfo.PacketInfo.Value.Active)
|
||||
if (BuildingInfo.CanActivate() && BuildingInfo.PacketInfo != null && !BuildingInfo.PacketInfo.Active)
|
||||
{
|
||||
FinalizeGarrisonPlotGOInfo finalizeInfo = Global.GarrisonMgr.GetPlotFinalizeGOInfo(PacketInfo.GarrPlotInstanceID);
|
||||
if (finalizeInfo != null)
|
||||
@@ -815,19 +814,19 @@ namespace Game.Garrisons
|
||||
plotPlaced.PlotInfo = PacketInfo;
|
||||
owner.SendPacket(plotPlaced);
|
||||
|
||||
BuildingInfo.PacketInfo.Clear();
|
||||
BuildingInfo.PacketInfo = null;
|
||||
}
|
||||
|
||||
public void SetBuildingInfo(GarrisonBuildingInfo buildingInfo, Player owner)
|
||||
{
|
||||
if (!BuildingInfo.PacketInfo.HasValue)
|
||||
if (BuildingInfo.PacketInfo == null)
|
||||
{
|
||||
GarrisonPlotRemoved plotRemoved = new();
|
||||
plotRemoved.GarrPlotInstanceID = PacketInfo.GarrPlotInstanceID;
|
||||
owner.SendPacket(plotRemoved);
|
||||
}
|
||||
|
||||
BuildingInfo.PacketInfo.Set(buildingInfo);
|
||||
BuildingInfo.PacketInfo = buildingInfo;
|
||||
}
|
||||
|
||||
T BuildingSpawnHelper<T>(GameObject building, ulong spawnId, Map map) where T : WorldObject, new()
|
||||
|
||||
@@ -5872,22 +5872,24 @@ namespace Game
|
||||
|
||||
if (!result.IsNull(7))
|
||||
{
|
||||
info.createPositionNPE.Value = new();
|
||||
PlayerInfo.CreatePosition createPosition = new();
|
||||
|
||||
info.createPositionNPE.Value.Loc = new WorldLocation(result.Read<uint>(7), result.Read<float>(8), result.Read<float>(9), result.Read<float>(10), result.Read<float>(11));
|
||||
createPosition.Loc = new WorldLocation(result.Read<uint>(7), result.Read<float>(8), result.Read<float>(9), result.Read<float>(10), result.Read<float>(11));
|
||||
if (!result.IsNull(12))
|
||||
info.createPositionNPE.Value.TransportGuid = result.Read<ulong>(12);
|
||||
createPosition.TransportGuid = result.Read<ulong>(12);
|
||||
|
||||
info.createPositionNPE = createPosition;
|
||||
|
||||
if (!CliDB.MapStorage.ContainsKey(info.createPositionNPE.Value.Loc.GetMapId()))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Invalid NPE map id {info.createPositionNPE.Value.Loc.GetMapId()} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||
info.createPositionNPE.Clear();
|
||||
info.createPositionNPE = null;
|
||||
}
|
||||
|
||||
if (info.createPositionNPE.HasValue && info.createPositionNPE.Value.TransportGuid.HasValue && Global.TransportMgr.GetTransportSpawn(info.createPositionNPE.Value.TransportGuid.Value) == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Invalid NPE transport spawn id {info.createPositionNPE.Value.TransportGuid.Value} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||
info.createPositionNPE.Clear(); // remove entire NPE data - assume user put transport offsets into npe_position fields
|
||||
info.createPositionNPE = null; // remove entire NPE data - assume user put transport offsets into npe_position fields
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5895,7 +5897,7 @@ namespace Game
|
||||
{
|
||||
uint introMovieId = result.Read<uint>(13);
|
||||
if (CliDB.MovieStorage.ContainsKey(introMovieId))
|
||||
info.introMovieId.Set(introMovieId);
|
||||
info.introMovieId = introMovieId;
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Invalid intro movie id {introMovieId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||
}
|
||||
@@ -5904,7 +5906,7 @@ namespace Game
|
||||
{
|
||||
uint introSceneId = result.Read<uint>(14);
|
||||
if (GetSceneTemplate(introSceneId) != null)
|
||||
info.introSceneId.Set(introSceneId);
|
||||
info.introSceneId = introSceneId;
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Invalid intro scene id {introSceneId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||
}
|
||||
@@ -5913,7 +5915,7 @@ namespace Game
|
||||
{
|
||||
uint introSceneId = result.Read<uint>(15);
|
||||
if (GetSceneTemplate(introSceneId) != null)
|
||||
info.introSceneIdNPE.Set(introSceneId);
|
||||
info.introSceneIdNPE = introSceneId;
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Invalid NPE intro scene id {introSceneId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||
}
|
||||
@@ -9620,7 +9622,7 @@ namespace Game
|
||||
response.Description = responses.Read<string>(14);
|
||||
response.Confirmation = responses.Read<string>(15);
|
||||
if (!responses.IsNull(16))
|
||||
response.RewardQuestID.Set(responses.Read<uint>(16));
|
||||
response.RewardQuestID = responses.Read<uint>(16);
|
||||
|
||||
choice.Responses.Add(response);
|
||||
|
||||
@@ -9680,7 +9682,7 @@ namespace Game
|
||||
reward.SkillPointCount = 0;
|
||||
}
|
||||
|
||||
response.Reward.Set(reward);
|
||||
response.Reward = reward;
|
||||
++rewardCount;
|
||||
|
||||
} while (rewards.NextRow());
|
||||
@@ -9718,7 +9720,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!response.Reward.HasValue)
|
||||
if (response.Reward == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `playerchoice_response_reward_item` references non-existing player choice reward for ChoiceId {choiceId}, ResponseId: {responseId}, skipped");
|
||||
continue;
|
||||
@@ -9730,7 +9732,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
response.Reward.Value.Items.Add(new PlayerChoiceResponseRewardItem(itemId, bonusListIds, quantity));
|
||||
response.Reward.Items.Add(new PlayerChoiceResponseRewardItem(itemId, bonusListIds, quantity));
|
||||
itemRewardCount++;
|
||||
|
||||
} while (rewardItem.NextRow());
|
||||
@@ -9760,7 +9762,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!response.Reward.HasValue)
|
||||
if (response.Reward == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `playerchoice_response_reward_currency` references non-existing player choice reward for ChoiceId {choiceId}, ResponseId: {responseId}, skipped");
|
||||
continue;
|
||||
@@ -9772,7 +9774,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
response.Reward.Value.Currency.Add(new PlayerChoiceResponseRewardEntry(currencyId, quantity));
|
||||
response.Reward.Currency.Add(new PlayerChoiceResponseRewardEntry(currencyId, quantity));
|
||||
currencyRewardCount++;
|
||||
|
||||
} while (rewardCurrency.NextRow());
|
||||
@@ -9802,7 +9804,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!response.Reward.HasValue)
|
||||
if (response.Reward == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `playerchoice_response_reward_faction` references non-existing player choice reward for ChoiceId {choiceId}, ResponseId: {responseId}, skipped");
|
||||
continue;
|
||||
@@ -9814,7 +9816,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
response.Reward.Value.Faction.Add(new PlayerChoiceResponseRewardEntry(factionId, quantity));
|
||||
response.Reward.Faction.Add(new PlayerChoiceResponseRewardEntry(factionId, quantity));
|
||||
factionRewardCount++;
|
||||
|
||||
} while (rewardFaction.NextRow());
|
||||
@@ -9849,7 +9851,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!response.Reward.HasValue)
|
||||
if (response.Reward == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `playerchoice_response_reward_item_choice` references non-existing player choice reward for ChoiceId {choiceId}, ResponseId: {responseId}, skipped");
|
||||
continue;
|
||||
@@ -9861,7 +9863,7 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
response.Reward.Value.ItemChoices.Add(new PlayerChoiceResponseRewardItem(itemId, bonusListIds, quantity));
|
||||
response.Reward.ItemChoices.Add(new PlayerChoiceResponseRewardItem(itemId, bonusListIds, quantity));
|
||||
itemChoiceRewardCount++;
|
||||
|
||||
} while (rewards.NextRow());
|
||||
@@ -9895,7 +9897,7 @@ namespace Game
|
||||
mawPower.RarityColor = mawPowersResult.Read<uint>(4);
|
||||
mawPower.SpellID = mawPowersResult.Read<int>(5);
|
||||
mawPower.MaxStacks = mawPowersResult.Read<int>(6);
|
||||
response.MawPower.Set(mawPower);
|
||||
response.MawPower = mawPower;
|
||||
|
||||
++mawPowersCount;
|
||||
|
||||
@@ -10027,9 +10029,9 @@ namespace Game
|
||||
float speed = result.Read<float>(1);
|
||||
bool treatSpeedAsMoveTimeSeconds = result.Read<bool>(2);
|
||||
float jumpGravity = result.Read<float>(3);
|
||||
Optional<uint> spellVisualId = new();
|
||||
Optional<uint> progressCurveId = new();
|
||||
Optional<uint> parabolicCurveId = new();
|
||||
uint? spellVisualId = null;
|
||||
uint? progressCurveId = null;
|
||||
uint? parabolicCurveId = null;
|
||||
|
||||
if (speed <= 0.0f)
|
||||
{
|
||||
@@ -10046,7 +10048,7 @@ namespace Game
|
||||
if (!result.IsNull(4))
|
||||
{
|
||||
if (CliDB.SpellVisualStorage.ContainsKey(result.Read<uint>(4)))
|
||||
spellVisualId.Set(result.Read<uint>(4));
|
||||
spellVisualId = result.Read<uint>(4);
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Table `jump_charge_params` references non-existing SpellVisual: {result.Read<uint>(4)} for id {id}, ignored.");
|
||||
}
|
||||
@@ -10054,7 +10056,7 @@ namespace Game
|
||||
if (!result.IsNull(5))
|
||||
{
|
||||
if (CliDB.CurveStorage.ContainsKey(result.Read<uint>(5)))
|
||||
progressCurveId.Set(result.Read<uint>(5));
|
||||
progressCurveId = result.Read<uint>(5);
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Table `jump_charge_params` references non-existing progress Curve: {result.Read<uint>(5)} for id {id}, ignored.");
|
||||
}
|
||||
@@ -10062,7 +10064,7 @@ namespace Game
|
||||
if (!result.IsNull(6))
|
||||
{
|
||||
if (CliDB.CurveStorage.ContainsKey(result.Read<uint>(6)))
|
||||
parabolicCurveId.Set(result.Read<uint>(6));
|
||||
parabolicCurveId = result.Read<uint>(6);
|
||||
else
|
||||
Log.outError(LogFilter.Sql, $"Table `jump_charge_params` references non-existing parabolic Curve: {result.Read<uint>(6)} for id {id}, ignored.");
|
||||
}
|
||||
@@ -11825,9 +11827,9 @@ namespace Game
|
||||
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 class PlayerChoice
|
||||
|
||||
+28
-22
@@ -957,10 +957,10 @@ namespace Game.Groups
|
||||
lootList.LootObj = creature.loot.GetGUID();
|
||||
|
||||
if (GetLootMethod() == LootMethod.MasterLoot && creature.loot.HasOverThresholdItem())
|
||||
lootList.Master.Set(GetMasterLooterGuid());
|
||||
lootList.Master = GetMasterLooterGuid();
|
||||
|
||||
if (groupLooter)
|
||||
lootList.RoundRobinWinner.Set(groupLooter.GetGUID());
|
||||
lootList.RoundRobinWinner = groupLooter.GetGUID();
|
||||
|
||||
BroadcastPacket(lootList, false);
|
||||
}
|
||||
@@ -1483,46 +1483,52 @@ namespace Game.Groups
|
||||
if (GetMembersCount() > 1)
|
||||
{
|
||||
// LootSettings
|
||||
partyUpdate.LootSettings.Value = new();
|
||||
PartyLootSettings lootSettings = new();
|
||||
|
||||
partyUpdate.LootSettings.Value.Method = (byte)m_lootMethod;
|
||||
partyUpdate.LootSettings.Value.Threshold = (byte)m_lootThreshold;
|
||||
partyUpdate.LootSettings.Value.LootMaster = m_lootMethod == LootMethod.MasterLoot ? m_masterLooterGuid : ObjectGuid.Empty;
|
||||
lootSettings.Method = (byte)m_lootMethod;
|
||||
lootSettings.Threshold = (byte)m_lootThreshold;
|
||||
lootSettings.LootMaster = m_lootMethod == LootMethod.MasterLoot ? m_masterLooterGuid : ObjectGuid.Empty;
|
||||
|
||||
partyUpdate.LootSettings = lootSettings;
|
||||
|
||||
// Difficulty Settings
|
||||
partyUpdate.DifficultySettings.Value = new();
|
||||
PartyDifficultySettings difficultySettings = new();
|
||||
|
||||
partyUpdate.DifficultySettings.Value.DungeonDifficultyID = (uint)m_dungeonDifficulty;
|
||||
partyUpdate.DifficultySettings.Value.RaidDifficultyID = (uint)m_raidDifficulty;
|
||||
partyUpdate.DifficultySettings.Value.LegacyRaidDifficultyID = (uint)m_legacyRaidDifficulty;
|
||||
difficultySettings.DungeonDifficultyID = (uint)m_dungeonDifficulty;
|
||||
difficultySettings.RaidDifficultyID = (uint)m_raidDifficulty;
|
||||
difficultySettings.LegacyRaidDifficultyID = (uint)m_legacyRaidDifficulty;
|
||||
|
||||
partyUpdate.DifficultySettings = difficultySettings;
|
||||
}
|
||||
|
||||
// LfgInfos
|
||||
if (IsLFGGroup())
|
||||
{
|
||||
partyUpdate.LfgInfos.Value = new();
|
||||
PartyLFGInfo lfgInfos = new();
|
||||
|
||||
partyUpdate.LfgInfos.Value.Slot = Global.LFGMgr.GetLFGDungeonEntry(Global.LFGMgr.GetDungeon(m_guid));
|
||||
partyUpdate.LfgInfos.Value.BootCount = 0;
|
||||
partyUpdate.LfgInfos.Value.Aborted = false;
|
||||
lfgInfos.Slot = Global.LFGMgr.GetLFGDungeonEntry(Global.LFGMgr.GetDungeon(m_guid));
|
||||
lfgInfos.BootCount = 0;
|
||||
lfgInfos.Aborted = false;
|
||||
|
||||
partyUpdate.LfgInfos.Value.MyFlags = (byte)(Global.LFGMgr.GetState(m_guid) == LfgState.FinishedDungeon ? 2 : 0);
|
||||
partyUpdate.LfgInfos.Value.MyRandomSlot = Global.LFGMgr.GetSelectedRandomDungeon(player.GetGUID());
|
||||
lfgInfos.MyFlags = (byte)(Global.LFGMgr.GetState(m_guid) == LfgState.FinishedDungeon ? 2 : 0);
|
||||
lfgInfos.MyRandomSlot = Global.LFGMgr.GetSelectedRandomDungeon(player.GetGUID());
|
||||
|
||||
partyUpdate.LfgInfos.Value.MyPartialClear = 0;
|
||||
partyUpdate.LfgInfos.Value.MyGearDiff = 0.0f;
|
||||
partyUpdate.LfgInfos.Value.MyFirstReward = false;
|
||||
lfgInfos.MyPartialClear = 0;
|
||||
lfgInfos.MyGearDiff = 0.0f;
|
||||
lfgInfos.MyFirstReward = false;
|
||||
|
||||
DungeonFinding.LfgReward reward = Global.LFGMgr.GetRandomDungeonReward(partyUpdate.LfgInfos.Value.MyRandomSlot, player.GetLevel());
|
||||
if (reward != null)
|
||||
{
|
||||
Quest quest = Global.ObjectMgr.GetQuestTemplate(reward.firstQuest);
|
||||
if (quest != null)
|
||||
partyUpdate.LfgInfos.Value.MyFirstReward = player.CanRewardQuest(quest, false);
|
||||
lfgInfos.MyFirstReward = player.CanRewardQuest(quest, false);
|
||||
}
|
||||
|
||||
partyUpdate.LfgInfos.Value.MyStrangerCount = 0;
|
||||
partyUpdate.LfgInfos.Value.MyKickVoteCount = 0;
|
||||
lfgInfos.MyStrangerCount = 0;
|
||||
lfgInfos.MyKickVoteCount = 0;
|
||||
|
||||
partyUpdate.LfgInfos = lfgInfos;
|
||||
}
|
||||
|
||||
player.SendPacket(partyUpdate);
|
||||
|
||||
@@ -3019,16 +3019,16 @@ namespace Game.Guilds
|
||||
bankLogEntry.EntryType = (sbyte)m_eventType;
|
||||
|
||||
if (hasStack)
|
||||
bankLogEntry.Count.Set(m_itemStackCount);
|
||||
bankLogEntry.Count = m_itemStackCount;
|
||||
|
||||
if (IsMoneyEvent())
|
||||
bankLogEntry.Money.Set(m_itemOrMoney);
|
||||
bankLogEntry.Money = m_itemOrMoney;
|
||||
|
||||
if (hasItem)
|
||||
bankLogEntry.ItemID.Set((int)m_itemOrMoney);
|
||||
bankLogEntry.ItemID = (int)m_itemOrMoney;
|
||||
|
||||
if (itemMoved)
|
||||
bankLogEntry.OtherTab.Set((sbyte)m_destTabId);
|
||||
bankLogEntry.OtherTab = (sbyte)m_destTabId;
|
||||
|
||||
packet.Entry.Add(bankLogEntry);
|
||||
}
|
||||
@@ -3109,7 +3109,7 @@ namespace Game.Guilds
|
||||
{
|
||||
ItemInstance itemInstance = new();
|
||||
itemInstance.ItemID = GetValue();
|
||||
newsEvent.Item.Set(itemInstance);
|
||||
newsEvent.Item = itemInstance;
|
||||
}
|
||||
|
||||
newsPacket.NewsEvents.Add(newsEvent);
|
||||
|
||||
@@ -52,12 +52,12 @@ namespace Game
|
||||
|
||||
Log.outDebug(LogFilter.Auctionhouse, $"Auctionhouse search ({browseQuery.Auctioneer}), searchedname: {browseQuery.Name}, levelmin: {browseQuery.MinLevel}, levelmax: {browseQuery.MaxLevel}, filters: {browseQuery.Filters}");
|
||||
|
||||
Optional<AuctionSearchClassFilters> classFilters = new();
|
||||
AuctionSearchClassFilters classFilters = null;
|
||||
|
||||
AuctionListBucketsResult listBucketsResult = new();
|
||||
if (!browseQuery.ItemClassFilters.Empty())
|
||||
{
|
||||
classFilters.Value = new();
|
||||
classFilters = new();
|
||||
|
||||
foreach (var classFilter in browseQuery.ItemClassFilters)
|
||||
{
|
||||
@@ -67,14 +67,14 @@ namespace Game
|
||||
{
|
||||
if (classFilter.ItemClass < (int)ItemClass.Max)
|
||||
{
|
||||
classFilters.Value.Classes[classFilter.ItemClass].SubclassMask |= (AuctionSearchClassFilters.FilterType)(1 << subClassFilter.ItemSubclass);
|
||||
classFilters.Classes[classFilter.ItemClass].SubclassMask |= (AuctionSearchClassFilters.FilterType)(1 << subClassFilter.ItemSubclass);
|
||||
if (subClassFilter.ItemSubclass < ItemConst.MaxItemSubclassTotal)
|
||||
classFilters.Value.Classes[classFilter.ItemClass].InvTypes[subClassFilter.ItemSubclass] = subClassFilter.InvTypeMask;
|
||||
classFilters.Classes[classFilter.ItemClass].InvTypes[subClassFilter.ItemSubclass] = subClassFilter.InvTypeMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
classFilters.Value.Classes[classFilter.ItemClass].SubclassMask = AuctionSearchClassFilters.FilterType.SkipSubclass;
|
||||
classFilters.Classes[classFilter.ItemClass].SubclassMask = AuctionSearchClassFilters.FilterType.SkipSubclass;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,9 +949,9 @@ namespace Game
|
||||
CommodityQuote quote = auctionHouse.CreateCommodityQuote(_player, (uint)getCommodityQuote.ItemID, getCommodityQuote.Quantity);
|
||||
if (quote != null)
|
||||
{
|
||||
commodityQuoteResult.TotalPrice.Set(quote.TotalPrice);
|
||||
commodityQuoteResult.Quantity.Set(quote.Quantity);
|
||||
commodityQuoteResult.QuoteDuration.Set((int)(quote.ValidTo - GameTime.GetGameTimeSteadyPoint()).TotalMilliseconds);
|
||||
commodityQuoteResult.TotalPrice = quote.TotalPrice;
|
||||
commodityQuoteResult.Quantity = quote.Quantity;
|
||||
commodityQuoteResult.QuoteDuration = (int)(quote.ValidTo - GameTime.GetGameTimeSteadyPoint()).TotalMilliseconds;
|
||||
}
|
||||
|
||||
commodityQuoteResult.ItemID = getCommodityQuote.ItemID;
|
||||
|
||||
@@ -29,30 +29,31 @@ namespace Game
|
||||
|
||||
if (code == BattlenetRpcErrorCode.Ok)
|
||||
{
|
||||
response.SuccessInfo.Value = new();
|
||||
response.SuccessInfo = new();
|
||||
|
||||
response.SuccessInfo.Value = new AuthResponse.AuthSuccessInfo();
|
||||
response.SuccessInfo.Value.ActiveExpansionLevel = (byte)GetExpansion();
|
||||
response.SuccessInfo.Value.AccountExpansionLevel = (byte)GetAccountExpansion();
|
||||
response.SuccessInfo.Value.VirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
response.SuccessInfo.Value.Time = (uint)GameTime.GetGameTime();
|
||||
response.SuccessInfo = new AuthResponse.AuthSuccessInfo();
|
||||
response.SuccessInfo.ActiveExpansionLevel = (byte)GetExpansion();
|
||||
response.SuccessInfo.AccountExpansionLevel = (byte)GetAccountExpansion();
|
||||
response.SuccessInfo.VirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
|
||||
response.SuccessInfo.Time = (uint)GameTime.GetGameTime();
|
||||
|
||||
var realm = Global.WorldMgr.GetRealm();
|
||||
|
||||
// Send current home realm. Also there is no need to send it later in realm queries.
|
||||
response.SuccessInfo.Value.VirtualRealms.Add(new VirtualRealmInfo(realm.Id.GetAddress(), true, false, realm.Name, realm.NormalizedName));
|
||||
response.SuccessInfo.VirtualRealms.Add(new VirtualRealmInfo(realm.Id.GetAddress(), true, false, realm.Name, realm.NormalizedName));
|
||||
|
||||
if (HasPermission(RBACPermissions.UseCharacterTemplates))
|
||||
foreach (var templ in Global.CharacterTemplateDataStorage.GetCharacterTemplates().Values)
|
||||
response.SuccessInfo.Value.Templates.Add(templ);
|
||||
response.SuccessInfo.Templates.Add(templ);
|
||||
|
||||
response.SuccessInfo.Value.AvailableClasses = Global.ObjectMgr.GetClassExpansionRequirements();
|
||||
response.SuccessInfo.AvailableClasses = Global.ObjectMgr.GetClassExpansionRequirements();
|
||||
}
|
||||
|
||||
if (queued)
|
||||
{
|
||||
response.WaitInfo.Value = new();
|
||||
response.WaitInfo.Value.WaitCount = queuePos;
|
||||
AuthWaitInfo waitInfo = new();
|
||||
waitInfo.WaitCount = queuePos;
|
||||
response.WaitInfo = waitInfo;
|
||||
}
|
||||
|
||||
SendPacket(response);
|
||||
@@ -110,7 +111,7 @@ namespace Game
|
||||
europaTicketConfig.ComplaintsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportComplaintsEnabled);
|
||||
europaTicketConfig.SuggestionsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportSuggestionsEnabled);
|
||||
|
||||
features.EuropaTicketSystemStatus.Set(europaTicketConfig);
|
||||
features.EuropaTicketSystemStatus = europaTicketConfig;
|
||||
|
||||
SendPacket(features);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.BattlePetModifyName)]
|
||||
void HandleBattlePetModifyName(BattlePetModifyName battlePetModifyName)
|
||||
{
|
||||
GetBattlePetMgr().ModifyName(battlePetModifyName.PetGuid, battlePetModifyName.Name, battlePetModifyName.DeclinedNames.Value);
|
||||
GetBattlePetMgr().ModifyName(battlePetModifyName.PetGuid, battlePetModifyName.Name, battlePetModifyName.DeclinedNames);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.QueryBattlePetName)]
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Game
|
||||
EnumCharactersResult charResult = new();
|
||||
charResult.Success = true;
|
||||
charResult.IsDeletedCharacters = holder.IsDeletedCharacters();
|
||||
charResult.DisabledClassesMask.Set(WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask));
|
||||
charResult.DisabledClassesMask = WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask);
|
||||
|
||||
if (!charResult.IsDeletedCharacters)
|
||||
_legitCharacters.Clear();
|
||||
@@ -157,7 +157,7 @@ namespace Game
|
||||
EnumCharactersResult charEnum = new();
|
||||
charEnum.Success = true;
|
||||
charEnum.IsDeletedCharacters = true;
|
||||
charEnum.DisabledClassesMask.Set(WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask));
|
||||
charEnum.DisabledClassesMask = WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask);
|
||||
|
||||
if (!result.IsEmpty())
|
||||
{
|
||||
@@ -1099,19 +1099,21 @@ namespace Game
|
||||
features.VoiceEnabled = false;
|
||||
features.BrowserEnabled = false; // Has to be false, otherwise client will crash if "Customer Support" is opened
|
||||
|
||||
features.EuropaTicketSystemStatus.Value = new();
|
||||
features.EuropaTicketSystemStatus.Value.ThrottleState.MaxTries = 10;
|
||||
features.EuropaTicketSystemStatus.Value.ThrottleState.PerMilliseconds = 60000;
|
||||
features.EuropaTicketSystemStatus.Value.ThrottleState.TryCount = 1;
|
||||
features.EuropaTicketSystemStatus.Value.ThrottleState.LastResetTimeBeforeNow = 111111;
|
||||
EuropaTicketConfig europaTicketSystemStatus = new();
|
||||
europaTicketSystemStatus.ThrottleState.MaxTries = 10;
|
||||
europaTicketSystemStatus.ThrottleState.PerMilliseconds = 60000;
|
||||
europaTicketSystemStatus.ThrottleState.TryCount = 1;
|
||||
europaTicketSystemStatus.ThrottleState.LastResetTimeBeforeNow = 111111;
|
||||
features.TutorialsEnabled = true;
|
||||
features.NPETutorialsEnabled = true;
|
||||
// END OF DUMMY VALUES
|
||||
|
||||
features.EuropaTicketSystemStatus.Value.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled);
|
||||
features.EuropaTicketSystemStatus.Value.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled);
|
||||
features.EuropaTicketSystemStatus.Value.ComplaintsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportComplaintsEnabled);
|
||||
features.EuropaTicketSystemStatus.Value.SuggestionsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportSuggestionsEnabled);
|
||||
europaTicketSystemStatus.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled);
|
||||
europaTicketSystemStatus.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled);
|
||||
europaTicketSystemStatus.ComplaintsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportComplaintsEnabled);
|
||||
europaTicketSystemStatus.SuggestionsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportSuggestionsEnabled);
|
||||
|
||||
features.EuropaTicketSystemStatus = europaTicketSystemStatus;
|
||||
|
||||
features.CharUndeleteEnabled = WorldConfig.GetBoolValue(WorldCfg.FeatureSystemCharacterUndeleteEnabled);
|
||||
features.BpayStoreEnabled = WorldConfig.GetBoolValue(WorldCfg.FeatureSystemBpayStoreEnabled);
|
||||
@@ -2511,7 +2513,7 @@ namespace Game
|
||||
packet.Result = result;
|
||||
packet.Name = renameInfo.NewName;
|
||||
if (result == ResponseCodes.Success)
|
||||
packet.Guid.Set(renameInfo.Guid);
|
||||
packet.Guid = renameInfo.Guid;
|
||||
|
||||
SendPacket(packet);
|
||||
}
|
||||
@@ -2540,11 +2542,11 @@ namespace Game
|
||||
|
||||
if (result == ResponseCodes.Success)
|
||||
{
|
||||
packet.Display.Value = new();
|
||||
packet.Display.Value.Name = factionChangeInfo.Name;
|
||||
packet.Display.Value.SexID = (byte)factionChangeInfo.SexID;
|
||||
packet.Display.Value.Customizations = factionChangeInfo.Customizations;
|
||||
packet.Display.Value.RaceID = (byte)factionChangeInfo.RaceID;
|
||||
packet.Display = new();
|
||||
packet.Display.Name = factionChangeInfo.Name;
|
||||
packet.Display.SexID = (byte)factionChangeInfo.SexID;
|
||||
packet.Display.Customizations = factionChangeInfo.Customizations;
|
||||
packet.Display.RaceID = (byte)factionChangeInfo.RaceID;
|
||||
}
|
||||
|
||||
SendPacket(packet);
|
||||
|
||||
@@ -387,7 +387,7 @@ namespace Game
|
||||
HandleChatAddon(chatAddonMessageTargeted.Params.Type, chatAddonMessageTargeted.Params.Prefix, chatAddonMessageTargeted.Params.Text, chatAddonMessageTargeted.Params.IsLogged, chatAddonMessageTargeted.Target, chatAddonMessageTargeted.ChannelGUID);
|
||||
}
|
||||
|
||||
void HandleChatAddon(ChatMsg type, string prefix, string text, bool isLogged, string target = "", Optional<ObjectGuid> channelGuid = default)
|
||||
void HandleChatAddon(ChatMsg type, string prefix, string text, bool isLogged, string target = "", ObjectGuid? channelGuid = null)
|
||||
{
|
||||
Player sender = GetPlayer();
|
||||
|
||||
|
||||
@@ -332,11 +332,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(depositGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), depositGuildBankItem.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(depositGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), depositGuildBankItem.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), false, depositGuildBankItem.BankTab, depositGuildBankItem.BankSlot,
|
||||
depositGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), depositGuildBankItem.ContainerItemSlot, 0);
|
||||
depositGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), depositGuildBankItem.ContainerItemSlot, 0);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.StoreGuildBankItem)]
|
||||
@@ -349,11 +349,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(storeGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), storeGuildBankItem.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(storeGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), storeGuildBankItem.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), true, storeGuildBankItem.BankTab, storeGuildBankItem.BankSlot,
|
||||
storeGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), storeGuildBankItem.ContainerItemSlot, 0);
|
||||
storeGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), storeGuildBankItem.ContainerItemSlot, 0);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SwapItemWithGuildBankItem)]
|
||||
@@ -366,11 +366,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(swapItemWithGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), swapItemWithGuildBankItem.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(swapItemWithGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), swapItemWithGuildBankItem.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), false, swapItemWithGuildBankItem.BankTab, swapItemWithGuildBankItem.BankSlot,
|
||||
swapItemWithGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), swapItemWithGuildBankItem.ContainerItemSlot, 0);
|
||||
swapItemWithGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), swapItemWithGuildBankItem.ContainerItemSlot, 0);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SwapGuildBankItemWithGuildBankItem)]
|
||||
@@ -410,11 +410,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(mergeItemWithGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), mergeItemWithGuildBankItem.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(mergeItemWithGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), mergeItemWithGuildBankItem.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), false, mergeItemWithGuildBankItem.BankTab, mergeItemWithGuildBankItem.BankSlot,
|
||||
mergeItemWithGuildBankItem.ContainerSlot.ValueOr(InventorySlots.Bag0), mergeItemWithGuildBankItem.ContainerItemSlot, mergeItemWithGuildBankItem.StackCount);
|
||||
mergeItemWithGuildBankItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), mergeItemWithGuildBankItem.ContainerItemSlot, mergeItemWithGuildBankItem.StackCount);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SplitItemToGuildBank)]
|
||||
@@ -427,11 +427,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(splitItemToGuildBank.ContainerSlot.ValueOr(InventorySlots.Bag0), splitItemToGuildBank.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(splitItemToGuildBank.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), splitItemToGuildBank.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), false, splitItemToGuildBank.BankTab, splitItemToGuildBank.BankSlot,
|
||||
splitItemToGuildBank.ContainerSlot.ValueOr(InventorySlots.Bag0), splitItemToGuildBank.ContainerItemSlot, splitItemToGuildBank.StackCount);
|
||||
splitItemToGuildBank.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), splitItemToGuildBank.ContainerItemSlot, splitItemToGuildBank.StackCount);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.MergeGuildBankItemWithItem)]
|
||||
@@ -444,11 +444,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(mergeGuildBankItemWithItem.ContainerSlot.ValueOr(InventorySlots.Bag0), mergeGuildBankItemWithItem.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(mergeGuildBankItemWithItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), mergeGuildBankItemWithItem.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), true, mergeGuildBankItemWithItem.BankTab, mergeGuildBankItemWithItem.BankSlot,
|
||||
mergeGuildBankItemWithItem.ContainerSlot.ValueOr(InventorySlots.Bag0), mergeGuildBankItemWithItem.ContainerItemSlot, mergeGuildBankItemWithItem.StackCount);
|
||||
mergeGuildBankItemWithItem.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), mergeGuildBankItemWithItem.ContainerItemSlot, mergeGuildBankItemWithItem.StackCount);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SplitGuildBankItemToInventory)]
|
||||
@@ -461,11 +461,11 @@ namespace Game
|
||||
if (guild == null)
|
||||
return;
|
||||
|
||||
if (!Player.IsInventoryPos(splitGuildBankItemToInventory.ContainerSlot.ValueOr(InventorySlots.Bag0), splitGuildBankItemToInventory.ContainerItemSlot))
|
||||
if (!Player.IsInventoryPos(splitGuildBankItemToInventory.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), splitGuildBankItemToInventory.ContainerItemSlot))
|
||||
GetPlayer().SendEquipError(InventoryResult.InternalBagError, null);
|
||||
else
|
||||
guild.SwapItemsWithInventory(GetPlayer(), true, splitGuildBankItemToInventory.BankTab, splitGuildBankItemToInventory.BankSlot,
|
||||
splitGuildBankItemToInventory.ContainerSlot.ValueOr(InventorySlots.Bag0), splitGuildBankItemToInventory.ContainerItemSlot, splitGuildBankItemToInventory.StackCount);
|
||||
splitGuildBankItemToInventory.ContainerSlot.GetValueOrDefault(InventorySlots.Bag0), splitGuildBankItemToInventory.ContainerItemSlot, splitGuildBankItemToInventory.StackCount);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.AutoStoreGuildBankItem)]
|
||||
|
||||
@@ -58,13 +58,12 @@ namespace Game
|
||||
Guild guild = Global.GuildMgr.GetGuildById(player.GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
inspectResult.GuildData.Value = new();
|
||||
|
||||
InspectGuildData guildData;
|
||||
guildData.GuildGUID = guild.GetGUID();
|
||||
guildData.NumGuildMembers = guild.GetMembersCount();
|
||||
guildData.AchievementPoints = (int)guild.GetAchievementMgr().GetAchievementPoints();
|
||||
inspectResult.GuildData.Set(guildData);
|
||||
|
||||
inspectResult.GuildData = guildData;
|
||||
}
|
||||
|
||||
Item heartOfAzeroth = player.GetItemByEntry(PlayerConst.ItemIdHeartOfAzeroth, ItemSearchLocation.Everywhere);
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Game
|
||||
continue;
|
||||
|
||||
LFGBlackList lfgBlackList = new();
|
||||
lfgBlackList.PlayerGuid.Set(pguid);
|
||||
lfgBlackList.PlayerGuid = pguid;
|
||||
foreach (var locked in Global.LFGMgr.GetLockedDungeons(pguid))
|
||||
lfgBlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel, 0));
|
||||
|
||||
@@ -355,7 +355,7 @@ namespace Game
|
||||
foreach (var it in joinData.lockmap)
|
||||
{
|
||||
var blackList = new LFGBlackListPkt();
|
||||
blackList.PlayerGuid.Set(it.Key);
|
||||
blackList.PlayerGuid = it.Key;
|
||||
|
||||
foreach (var lockInfo in it.Value)
|
||||
{
|
||||
|
||||
@@ -533,8 +533,8 @@ namespace Game
|
||||
item.Item.ItemID = vendorItem.item;
|
||||
if (!vendorItem.BonusListIDs.Empty())
|
||||
{
|
||||
item.Item.ItemBonus.Value = new();
|
||||
item.Item.ItemBonus.Value.BonusListIDs = vendorItem.BonusListIDs;
|
||||
item.Item.ItemBonus = new();
|
||||
item.Item.ItemBonus.BonusListIDs = vendorItem.BonusListIDs;
|
||||
}
|
||||
|
||||
packet.Items.Add(item);
|
||||
|
||||
@@ -796,9 +796,9 @@ namespace Game
|
||||
|
||||
Global.ScriptMgr.OnPlayerChoiceResponse(GetPlayer(), (uint)choiceResponse.ChoiceID, (uint)choiceResponse.ResponseID);
|
||||
|
||||
if (playerChoiceResponse.Reward.HasValue)
|
||||
if (playerChoiceResponse.Reward != null)
|
||||
{
|
||||
var reward = playerChoiceResponse.Reward.Value;
|
||||
var reward = playerChoiceResponse.Reward;
|
||||
if (reward.TitleId != 0)
|
||||
_player.SetTitle(CliDB.CharTitlesStorage.LookupByKey(reward.TitleId), false);
|
||||
|
||||
|
||||
@@ -353,8 +353,8 @@ namespace Game
|
||||
spellInfo = actualSpellInfo;
|
||||
}
|
||||
|
||||
if (cast.Cast.MoveUpdate.HasValue)
|
||||
HandleMovementOpcode(ClientOpcodes.MoveStop, cast.Cast.MoveUpdate.Value);
|
||||
if (cast.Cast.MoveUpdate != null)
|
||||
HandleMovementOpcode(ClientOpcodes.MoveStop, cast.Cast.MoveUpdate);
|
||||
|
||||
Spell spell = new(caster, spellInfo, triggerFlag);
|
||||
|
||||
@@ -660,9 +660,9 @@ namespace Game
|
||||
spell.m_targets.SetPitch(packet.Pitch);
|
||||
spell.m_targets.SetSpeed(packet.Speed);
|
||||
|
||||
if (packet.Status.HasValue)
|
||||
if (packet.Status != null)
|
||||
{
|
||||
GetPlayer().ValidateMovementInfo(packet.Status.Value);
|
||||
GetPlayer().ValidateMovementInfo(packet.Status);
|
||||
/*public uint opcode;
|
||||
recvPacket >> opcode;
|
||||
recvPacket.SetOpcode(CMSG_MOVE_STOP); // always set to CMSG_MOVE_STOP in client SetOpcode
|
||||
|
||||
@@ -104,9 +104,11 @@ namespace Game
|
||||
GetPlayer().SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
|
||||
|
||||
ShowTaxiNodes data = new();
|
||||
data.WindowInfo.Value = new();
|
||||
data.WindowInfo.Value.UnitGUID = unit.GetGUID();
|
||||
data.WindowInfo.Value.CurrentNode = (int)curloc;
|
||||
ShowTaxiNodesWindowInfo windowInfo = new();
|
||||
windowInfo.UnitGUID = unit.GetGUID();
|
||||
windowInfo.CurrentNode = (int)curloc;
|
||||
|
||||
data.WindowInfo = windowInfo;
|
||||
|
||||
GetPlayer().m_taxi.AppendTaximaskTo(data, lastTaxiCheaterState);
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ namespace Game
|
||||
tradeItem.GiftCreator = item.GetGiftCreator();
|
||||
if (!item.IsWrapped())
|
||||
{
|
||||
tradeItem.Unwrapped.Value = new();
|
||||
TradeUpdated.UnwrappedTradeItem unwrappedItem = tradeItem.Unwrapped.Value;
|
||||
TradeUpdated.UnwrappedTradeItem unwrappedItem = new();
|
||||
unwrappedItem.EnchantID = (int)item.GetEnchantmentId(EnchantmentSlot.Perm);
|
||||
unwrappedItem.OnUseEnchantmentID = (int)item.GetEnchantmentId(EnchantmentSlot.Use);
|
||||
unwrappedItem.Creator = item.GetCreator();
|
||||
@@ -74,6 +73,8 @@ namespace Game
|
||||
unwrappedItem.MaxDurability = item.m_itemData.MaxDurability;
|
||||
unwrappedItem.Durability = item.m_itemData.Durability;
|
||||
|
||||
tradeItem.Unwrapped = unwrappedItem;
|
||||
|
||||
byte g = 0;
|
||||
foreach (SocketedGem gemData in item.m_itemData.Gems)
|
||||
{
|
||||
@@ -82,7 +83,7 @@ namespace Game
|
||||
ItemGemData gem = new();
|
||||
gem.Slot = g;
|
||||
gem.Item = new ItemInstance(gemData);
|
||||
tradeItem.Unwrapped.Value.Gems.Add(gem);
|
||||
tradeItem.Unwrapped.Gems.Add(gem);
|
||||
}
|
||||
++g;
|
||||
}
|
||||
|
||||
@@ -2080,7 +2080,7 @@ namespace Game.Maps
|
||||
{
|
||||
if (wmoData.areaInfo.HasValue)
|
||||
{
|
||||
data.areaInfo.Set(new PositionFullTerrainStatus.AreaInfo(wmoData.areaInfo.Value.AdtId, wmoData.areaInfo.Value.RootId, wmoData.areaInfo.Value.GroupId, wmoData.areaInfo.Value.MogpFlags));
|
||||
data.areaInfo = new(wmoData.areaInfo.Value.AdtId, wmoData.areaInfo.Value.RootId, wmoData.areaInfo.Value.GroupId, wmoData.areaInfo.Value.MogpFlags);
|
||||
// wmo found
|
||||
var wmoEntry = Global.DB2Mgr.GetWMOAreaTable(wmoData.areaInfo.Value.RootId, wmoData.areaInfo.Value.AdtId, wmoData.areaInfo.Value.GroupId);
|
||||
data.outdoors = (wmoData.areaInfo.Value.MogpFlags & 0x8) != 0;
|
||||
@@ -2144,11 +2144,11 @@ namespace Game.Maps
|
||||
}
|
||||
}
|
||||
|
||||
data.LiquidInfo.Value = new();
|
||||
data.LiquidInfo.Value.level = wmoData.liquidInfo.Value.Level;
|
||||
data.LiquidInfo.Value.depth_level = wmoData.floorZ;
|
||||
data.LiquidInfo.Value.entry = liquidType;
|
||||
data.LiquidInfo.Value.type_flags = (LiquidHeaderTypeFlags)(1 << (int)liquidFlagType);
|
||||
data.LiquidInfo = new();
|
||||
data.LiquidInfo.level = wmoData.liquidInfo.Value.Level;
|
||||
data.LiquidInfo.depth_level = wmoData.floorZ;
|
||||
data.LiquidInfo.entry = liquidType;
|
||||
data.LiquidInfo.type_flags = (LiquidHeaderTypeFlags)(1 << (int)liquidFlagType);
|
||||
|
||||
float delta = wmoData.liquidInfo.Value.Level - z;
|
||||
if (delta > collisionHeight)
|
||||
@@ -2169,7 +2169,7 @@ namespace Game.Maps
|
||||
{
|
||||
if (GetId() == 530 && gridMapLiquid.entry == 2)
|
||||
gridMapLiquid.entry = 15;
|
||||
data.LiquidInfo.Set(gridMapLiquid);
|
||||
data.LiquidInfo = gridMapLiquid;
|
||||
data.LiquidStatus = gridMapStatus;
|
||||
}
|
||||
}
|
||||
@@ -5702,8 +5702,8 @@ namespace Game.Maps
|
||||
public float FloorZ;
|
||||
public bool outdoors = true;
|
||||
public ZLiquidStatus LiquidStatus;
|
||||
public Optional<AreaInfo> areaInfo;
|
||||
public Optional<LiquidData> LiquidInfo;
|
||||
public AreaInfo? areaInfo;
|
||||
public LiquidData LiquidInfo;
|
||||
}
|
||||
|
||||
public class RespawnInfo
|
||||
|
||||
@@ -1233,9 +1233,9 @@ namespace Game.Movement
|
||||
|
||||
public float JumpGravity;
|
||||
|
||||
public Optional<uint> SpellVisualId;
|
||||
public Optional<uint> ProgressCurveId;
|
||||
public Optional<uint> ParabolicCurveId;
|
||||
public uint? SpellVisualId;
|
||||
public uint? ProgressCurveId;
|
||||
public uint? ParabolicCurveId;
|
||||
}
|
||||
|
||||
public struct ChaseRange
|
||||
|
||||
@@ -209,8 +209,8 @@ namespace Game.Movement
|
||||
{
|
||||
float t_passedf = MSToSec((uint)(time_point - effect_start_time));
|
||||
float t_durationf = MSToSec((uint)(Duration() - effect_start_time)); //client use not modified duration here
|
||||
if (spell_effect_extra.HasValue && spell_effect_extra.Value.ParabolicCurveId != 0)
|
||||
t_passedf *= Global.DB2Mgr.GetCurveValueAt(spell_effect_extra.Value.ParabolicCurveId, (float)time_point / Duration());
|
||||
if (spell_effect_extra != null && spell_effect_extra.ParabolicCurveId != 0)
|
||||
t_passedf *= Global.DB2Mgr.GetCurveValueAt(spell_effect_extra.ParabolicCurveId, (float)time_point / Duration());
|
||||
|
||||
el += (t_durationf - t_passedf) * 0.5f * vertical_acceleration * t_passedf;
|
||||
}
|
||||
@@ -362,8 +362,8 @@ namespace Game.Movement
|
||||
public int point_Idx;
|
||||
public int point_Idx_offset;
|
||||
public float velocity;
|
||||
public Optional<SpellEffectExtraData> spell_effect_extra;
|
||||
public Optional<AnimTierTransition> anim_tier;
|
||||
public SpellEffectExtraData spell_effect_extra;
|
||||
public AnimTierTransition anim_tier;
|
||||
#endregion
|
||||
|
||||
public class CommonInitializer : IInitializer
|
||||
|
||||
@@ -313,8 +313,8 @@ namespace Game.Movement
|
||||
public void SetAnimation(AnimType anim)
|
||||
{
|
||||
args.time_perc = 0.0f;
|
||||
args.animTier.Value = new();
|
||||
args.animTier.Value.AnimTier = (byte)anim;
|
||||
args.animTier = new();
|
||||
args.animTier.AnimTier = (byte)anim;
|
||||
args.flags.EnableAnimation();
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace Game.Movement
|
||||
|
||||
public void SetSpellEffectExtraData(SpellEffectExtraData spellEffectExtraData)
|
||||
{
|
||||
args.spellEffectExtra.Set(spellEffectExtraData);
|
||||
args.spellEffectExtra = spellEffectExtraData;
|
||||
}
|
||||
|
||||
public List<Vector3> Path() { return args.path; }
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace Game.Movement
|
||||
public float time_perc;
|
||||
public uint splineId;
|
||||
public float initialOrientation;
|
||||
public Optional<SpellEffectExtraData> spellEffectExtra;
|
||||
public Optional<AnimTierTransition> animTier;
|
||||
public SpellEffectExtraData spellEffectExtra;
|
||||
public AnimTierTransition animTier;
|
||||
public bool walk;
|
||||
public bool HasVelocity;
|
||||
public bool TransformForTransport;
|
||||
@@ -77,15 +77,15 @@ namespace Game.Movement
|
||||
return false;
|
||||
if (!CHECK(_checkPathLengths(), false))
|
||||
return false;
|
||||
if (spellEffectExtra.HasValue)
|
||||
if (spellEffectExtra != null)
|
||||
{
|
||||
if (!CHECK(spellEffectExtra.Value.ProgressCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.Value.ProgressCurveId), false))
|
||||
if (!CHECK(spellEffectExtra.ProgressCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.ProgressCurveId), false))
|
||||
return false;
|
||||
if (!CHECK(spellEffectExtra.Value.ParabolicCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.Value.ParabolicCurveId), false))
|
||||
if (!CHECK(spellEffectExtra.ParabolicCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.ParabolicCurveId), false))
|
||||
return false;
|
||||
if (!CHECK(spellEffectExtra.Value.ProgressCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.Value.ProgressCurveId), true))
|
||||
if (!CHECK(spellEffectExtra.ProgressCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.ProgressCurveId), true))
|
||||
return false;
|
||||
if (!CHECK(spellEffectExtra.Value.ParabolicCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.Value.ParabolicCurveId), true))
|
||||
if (!CHECK(spellEffectExtra.ParabolicCurveId == 0 || CliDB.CurveStorage.ContainsKey(spellEffectExtra.ParabolicCurveId), true))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -775,8 +775,8 @@ namespace Game.Networking
|
||||
public void SendAuthResponseError(BattlenetRpcErrorCode code)
|
||||
{
|
||||
AuthResponse response = new();
|
||||
response.SuccessInfo.Clear();
|
||||
response.WaitInfo.Clear();
|
||||
response.SuccessInfo = null;
|
||||
response.WaitInfo = null;
|
||||
response.Result = code;
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Game
|
||||
|
||||
public List<WorldObject> Objects = new();
|
||||
public List<ushort> Grids = new();
|
||||
public Optional<TimeSpan> DurationRemaining;
|
||||
public TimeSpan? DurationRemaining;
|
||||
|
||||
public bool IsEmpty() { return Objects.Empty() && Grids.Empty(); }
|
||||
}
|
||||
@@ -57,21 +57,21 @@ namespace Game
|
||||
// Loop over all our tracked phases. If any don't exist - delete them
|
||||
foreach (var (phaseId, spawns) in _spawns)
|
||||
if (!spawns.DurationRemaining.HasValue && !phaseShift.HasPhase(phaseId))
|
||||
spawns.DurationRemaining.Set(PersonalPhaseSpawns.DELETE_TIME_DEFAULT);
|
||||
spawns.DurationRemaining = PersonalPhaseSpawns.DELETE_TIME_DEFAULT;
|
||||
|
||||
// loop over all owner phases. If any exist and marked for deletion - reset delete
|
||||
foreach (var phaseRef in phaseShift.GetPhases())
|
||||
{
|
||||
PersonalPhaseSpawns spawns = _spawns.LookupByKey(phaseRef.Key);
|
||||
if (spawns != null)
|
||||
spawns.DurationRemaining.Clear();
|
||||
spawns.DurationRemaining = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void MarkAllPhasesForDeletion()
|
||||
{
|
||||
foreach (var spawns in _spawns.Values)
|
||||
spawns.DurationRemaining.Set(PersonalPhaseSpawns.DELETE_TIME_DEFAULT);
|
||||
spawns.DurationRemaining = PersonalPhaseSpawns.DELETE_TIME_DEFAULT;
|
||||
}
|
||||
|
||||
public void Update(Map map, uint diff)
|
||||
@@ -80,7 +80,7 @@ namespace Game
|
||||
{
|
||||
if (itr.Value.DurationRemaining.HasValue)
|
||||
{
|
||||
itr.Value.DurationRemaining.Value = itr.Value.DurationRemaining.Value - TimeSpan.FromMilliseconds(diff);
|
||||
itr.Value.DurationRemaining = itr.Value.DurationRemaining.Value - TimeSpan.FromMilliseconds(diff);
|
||||
if (itr.Value.DurationRemaining.Value <= TimeSpan.Zero)
|
||||
{
|
||||
DespawnPhase(map, itr.Value);
|
||||
|
||||
@@ -237,11 +237,11 @@ namespace Game.Spells
|
||||
if (remove)
|
||||
return;
|
||||
|
||||
auraInfo.AuraData.Value = new();
|
||||
auraInfo.AuraData = new();
|
||||
|
||||
Aura aura = GetBase();
|
||||
|
||||
AuraDataInfo auraData = auraInfo.AuraData.Value;
|
||||
AuraDataInfo auraData = auraInfo.AuraData;
|
||||
auraData.CastID = aura.GetCastId();
|
||||
auraData.SpellID = (int)aura.GetId();
|
||||
auraData.Visual = aura.GetSpellVisual();
|
||||
@@ -261,12 +261,12 @@ namespace Game.Spells
|
||||
if (!aura.GetCasterGUID().IsUnit())
|
||||
auraData.CastUnit = ObjectGuid.Empty; // optional data is filled in, but cast unit contains empty guid in packet
|
||||
else if (!auraData.Flags.HasFlag(AuraFlags.NoCaster))
|
||||
auraData.CastUnit.Set(aura.GetCasterGUID());
|
||||
auraData.CastUnit = aura.GetCasterGUID();
|
||||
|
||||
if (auraData.Flags.HasFlag(AuraFlags.Duration))
|
||||
{
|
||||
auraData.Duration.Set(aura.GetMaxDuration());
|
||||
auraData.Remaining.Set(aura.GetDuration());
|
||||
auraData.Duration = aura.GetMaxDuration();
|
||||
auraData.Remaining = aura.GetDuration();
|
||||
}
|
||||
|
||||
if (auraData.Flags.HasFlag(AuraFlags.Scalable))
|
||||
|
||||
@@ -3666,9 +3666,9 @@ namespace Game.Spells
|
||||
|
||||
if (castFlags.HasAnyFlag(SpellCastFlags.RuneList)) // rune cooldowns list
|
||||
{
|
||||
castData.RemainingRunes.Value = new();
|
||||
castData.RemainingRunes = new();
|
||||
|
||||
RuneData runeData = castData.RemainingRunes.Value;
|
||||
RuneData runeData = castData.RemainingRunes;
|
||||
//TODO: There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature
|
||||
//The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster
|
||||
|
||||
@@ -3781,8 +3781,8 @@ namespace Game.Spells
|
||||
|
||||
if (Convert.ToBoolean(castFlags & SpellCastFlags.RuneList)) // rune cooldowns list
|
||||
{
|
||||
castData.RemainingRunes.Value = new();
|
||||
RuneData runeData = castData.RemainingRunes.Value;
|
||||
castData.RemainingRunes = new();
|
||||
RuneData runeData = castData.RemainingRunes;
|
||||
|
||||
Player player = m_caster.ToPlayer();
|
||||
runeData.Start = m_runesState; // runes state before
|
||||
@@ -4095,9 +4095,11 @@ namespace Game.Spells
|
||||
|
||||
if (schoolImmunityMask != 0 || mechanicImmunityMask != 0)
|
||||
{
|
||||
spellChannelStart.InterruptImmunities.Value = new();
|
||||
spellChannelStart.InterruptImmunities.Value.SchoolImmunities = (int)schoolImmunityMask;
|
||||
spellChannelStart.InterruptImmunities.Value.Immunities = (int)mechanicImmunityMask;
|
||||
SpellChannelStartInterruptImmunities interruptImmunities = new();
|
||||
interruptImmunities.SchoolImmunities = (int)schoolImmunityMask;
|
||||
interruptImmunities.Immunities = (int)mechanicImmunityMask;
|
||||
|
||||
spellChannelStart.InterruptImmunities = interruptImmunities;
|
||||
}
|
||||
unitCaster.SendMessageToSet(spellChannelStart, true);
|
||||
|
||||
@@ -7177,7 +7179,7 @@ namespace Game.Spells
|
||||
m_spellValue.DurationMul = (float)value / 100.0f;
|
||||
break;
|
||||
case SpellValueMod.Duration:
|
||||
m_spellValue.Duration.Set(value);
|
||||
m_spellValue.Duration = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -8439,7 +8441,7 @@ namespace Game.Spells
|
||||
public int AuraStackAmount;
|
||||
public float DurationMul;
|
||||
public float CriticalChance;
|
||||
public Optional<int> Duration;
|
||||
public int? Duration;
|
||||
}
|
||||
|
||||
// Spell modifier (used for modify other spells)
|
||||
|
||||
@@ -88,7 +88,6 @@ namespace Game.Spells
|
||||
|
||||
if (m_targetMask.HasAnyFlag(SpellCastTargetFlags.SourceLocation))
|
||||
{
|
||||
data.SrcLocation.Value = new();
|
||||
TargetLocation target = new();
|
||||
target.Transport = m_src.TransportGUID; // relative position guid here - transport for example
|
||||
if (!m_src.TransportGUID.IsEmpty())
|
||||
@@ -96,12 +95,11 @@ namespace Game.Spells
|
||||
else
|
||||
target.Location = m_src.Position;
|
||||
|
||||
data.SrcLocation.Value = target;
|
||||
data.SrcLocation = target;
|
||||
}
|
||||
|
||||
if (Convert.ToBoolean(m_targetMask & SpellCastTargetFlags.DestLocation))
|
||||
{
|
||||
data.DstLocation.Value = new();
|
||||
TargetLocation target = new();
|
||||
target.Transport = m_dst.TransportGUID; // relative position guid here - transport for example
|
||||
if (!m_dst.TransportGUID.IsEmpty())
|
||||
@@ -109,7 +107,7 @@ namespace Game.Spells
|
||||
else
|
||||
target.Location = m_dst.Position;
|
||||
|
||||
data.DstLocation.Value = target;
|
||||
data.DstLocation = target;
|
||||
}
|
||||
|
||||
if (Convert.ToBoolean(m_targetMask & SpellCastTargetFlags.String))
|
||||
|
||||
@@ -5587,28 +5587,28 @@ namespace Game.Spells
|
||||
if (jumpParams.TreatSpeedAsMoveTimeSeconds)
|
||||
speed = unitCaster.GetExactDist(destTarget) / jumpParams.Speed;
|
||||
|
||||
Optional<JumpArrivalCastArgs> arrivalCast = new();
|
||||
JumpArrivalCastArgs arrivalCast = null;
|
||||
if (effectInfo.TriggerSpell != 0)
|
||||
{
|
||||
arrivalCast.Value = new();
|
||||
arrivalCast.Value.SpellId = effectInfo.TriggerSpell;
|
||||
arrivalCast = new();
|
||||
arrivalCast.SpellId = effectInfo.TriggerSpell;
|
||||
}
|
||||
|
||||
Optional<SpellEffectExtraData> effectExtra = new();
|
||||
SpellEffectExtraData effectExtra = null;
|
||||
if (jumpParams.SpellVisualId.HasValue || jumpParams.ProgressCurveId.HasValue || jumpParams.ParabolicCurveId.HasValue)
|
||||
{
|
||||
effectExtra.Value = new();
|
||||
effectExtra = new();
|
||||
if (jumpParams.SpellVisualId.HasValue)
|
||||
effectExtra.Value.SpellVisualId = jumpParams.SpellVisualId.Value;
|
||||
effectExtra.SpellVisualId = jumpParams.SpellVisualId.Value;
|
||||
|
||||
if (jumpParams.ProgressCurveId.HasValue)
|
||||
effectExtra.Value.ProgressCurveId = jumpParams.ProgressCurveId.Value;
|
||||
effectExtra.ProgressCurveId = jumpParams.ProgressCurveId.Value;
|
||||
|
||||
if (jumpParams.ParabolicCurveId.HasValue)
|
||||
effectExtra.Value.ParabolicCurveId = jumpParams.ParabolicCurveId.Value;
|
||||
effectExtra.ParabolicCurveId = jumpParams.ParabolicCurveId.Value;
|
||||
}
|
||||
|
||||
unitCaster.GetMotionMaster().MoveJumpWithGravity(destTarget, speed, jumpParams.JumpGravity, EventId.Jump, false, arrivalCast.Value, effectExtra.Value);
|
||||
unitCaster.GetMotionMaster().MoveJumpWithGravity(destTarget, speed, jumpParams.JumpGravity, EventId.Jump, false, arrivalCast, effectExtra);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.LearnTransmogSet)]
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace Game.SupportSystem
|
||||
_complaintType = (GMSupportComplaintType)fields.Read<byte>(++idx);
|
||||
int reportLineIndex = fields.Read<int>(++idx);
|
||||
if (reportLineIndex != -1)
|
||||
_chatLog.ReportLineIndex.Set((uint)reportLineIndex);
|
||||
_chatLog.ReportLineIndex = (uint)reportLineIndex;
|
||||
|
||||
long closedBy = fields.Read<long>(++idx);
|
||||
if (closedBy == 0)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Game.Chat
|
||||
|
||||
// caches
|
||||
public ChatPkt UntranslatedPacket;
|
||||
public Optional<ChatPkt> TranslatedPacket;
|
||||
public ChatPkt TranslatedPacket;
|
||||
|
||||
public ChatPacketSender(ChatMsg chatType, Language language, WorldObject sender, WorldObject receiver, string message, uint achievementId = 0, Locale locale = Locale.enUS)
|
||||
{
|
||||
@@ -66,14 +66,14 @@ namespace Game.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TranslatedPacket.HasValue)
|
||||
if (TranslatedPacket == null)
|
||||
{
|
||||
TranslatedPacket.Value = new();
|
||||
TranslatedPacket.Value.Initialize(Type, Language, Sender, Receiver, Global.LanguageMgr.Translate(Text, (uint)Language, player.GetSession().GetSessionDbcLocale()), AchievementId, "", Locale);
|
||||
TranslatedPacket.Value.Write();
|
||||
TranslatedPacket = new();
|
||||
TranslatedPacket.Initialize(Type, Language, Sender, Receiver, Global.LanguageMgr.Translate(Text, (uint)Language, player.GetSession().GetSessionDbcLocale()), AchievementId, "", Locale);
|
||||
TranslatedPacket.Write();
|
||||
}
|
||||
|
||||
player.SendPacket(TranslatedPacket.Value);
|
||||
player.SendPacket(TranslatedPacket);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user