Core/AuctionHouse: After taking a break at the start of patch 8.3 auction house is now back in business.
Port From (https://github.com/TrinityCore/TrinityCore/commit/aced88b09bd918b0ed17b6c5e8a6048788600d9d)
This commit is contained in:
@@ -2210,8 +2210,8 @@ namespace Game.Achievements
|
||||
return false;
|
||||
case CriteriaAdditionalCondition.ItemModifiedAppearance: // 200
|
||||
{
|
||||
Tuple<bool, bool> hasAppearance = referencePlayer.GetSession().GetCollectionMgr().HasItemAppearance(reqValue);
|
||||
if (!hasAppearance.Item1 || hasAppearance.Item2)
|
||||
var hasAppearance = referencePlayer.GetSession().GetCollectionMgr().HasItemAppearance(reqValue);
|
||||
if (!hasAppearance.PermAppearance || hasAppearance.TempAppearance)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -86,8 +86,7 @@ namespace Game.Chat
|
||||
{
|
||||
// Reload dynamic data tables from the database
|
||||
Log.outInfo(LogFilter.Server, "Re-Loading Auctions...");
|
||||
Global.AuctionMgr.LoadAuctionItems();
|
||||
Global.AuctionMgr.LoadAuctions();
|
||||
Global.AuctionHouseMgr.LoadAuctions();
|
||||
handler.SendGlobalGMSysMessage("Auctions reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -760,15 +760,15 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public Tuple<bool, bool> HasItemAppearance(uint itemModifiedAppearanceId)
|
||||
public (bool PermAppearance, bool TempAppearance) HasItemAppearance(uint itemModifiedAppearanceId)
|
||||
{
|
||||
if (itemModifiedAppearanceId < _appearances.Count && _appearances.Get((int)itemModifiedAppearanceId))
|
||||
return Tuple.Create(true, false);
|
||||
return (true, false);
|
||||
|
||||
if (_temporaryAppearances.ContainsKey(itemModifiedAppearanceId))
|
||||
return Tuple.Create(true, true);
|
||||
return (true, true);
|
||||
|
||||
return Tuple.Create(false, false);
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
public List<ObjectGuid> GetItemsProvidingTemporaryAppearance(uint itemModifiedAppearanceId)
|
||||
@@ -776,6 +776,15 @@ namespace Game.Entities
|
||||
return _temporaryAppearances.LookupByKey(itemModifiedAppearanceId);
|
||||
}
|
||||
|
||||
public List<uint> GetAppearanceIds()
|
||||
{
|
||||
List<uint> appearances = new List<uint>();
|
||||
foreach (int id in _appearances)
|
||||
appearances.Add(CliDB.ItemModifiedAppearanceStorage.LookupByKey(id).ItemAppearanceID);
|
||||
|
||||
return appearances;
|
||||
}
|
||||
|
||||
public void SetAppearanceIsFavorite(uint itemModifiedAppearanceId, bool apply)
|
||||
{
|
||||
var apperanceState = _favoriteAppearances.LookupByKey(itemModifiedAppearanceId);
|
||||
|
||||
@@ -4013,6 +4013,10 @@ namespace Game.Entities
|
||||
stmt.AddValue(0, guid);
|
||||
trans.Append(stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_FAVORITE_AUCTIONS_BY_CHAR);
|
||||
stmt.AddValue(0, guid);
|
||||
trans.Append(stmt);
|
||||
|
||||
Corpse.DeleteFromDB(playerGuid, trans);
|
||||
|
||||
Garrison.DeleteFromDB(guid, trans);
|
||||
|
||||
@@ -105,7 +105,7 @@ public static class Global
|
||||
|
||||
public static GameEventManager GameEventMgr { get { return GameEventManager.Instance; } }
|
||||
public static CreatureTextManager CreatureTextMgr { get { return CreatureTextManager.Instance; } }
|
||||
public static AuctionManager AuctionMgr { get { return AuctionManager.Instance; } }
|
||||
public static AuctionManager AuctionHouseMgr { get { return AuctionManager.Instance; } }
|
||||
|
||||
public static SpellManager SpellMgr { get { return SpellManager.Instance; } }
|
||||
public static SupportManager SupportMgr { get { return SupportManager.Instance; } }
|
||||
|
||||
@@ -9275,7 +9275,8 @@ namespace Game
|
||||
// Cleanup other tables from not existed guids ( >= hiItemGuid)
|
||||
DB.Characters.Execute("DELETE FROM character_inventory WHERE item >= {0}", GetGuidSequenceGenerator(HighGuid.Item).GetNextAfterMaxUsed()); // One-time query
|
||||
DB.Characters.Execute("DELETE FROM mail_items WHERE item_guid >= {0}", GetGuidSequenceGenerator(HighGuid.Item).GetNextAfterMaxUsed()); // One-time query
|
||||
DB.Characters.Execute("DELETE FROM auctionhouse WHERE itemguid >= {0}", GetGuidSequenceGenerator(HighGuid.Item).GetNextAfterMaxUsed()); // One-time query
|
||||
DB.Characters.Execute("DELETE a, ab, ai FROM auctionhouse a LEFT JOIN auction_bidders ab ON ab.auctionId = a.id LEFT JOIN auction_items ai ON ai.auctionId = a.id WHERE ai.itemGuid >= '{0}'",
|
||||
GetGuidSequenceGenerator(HighGuid.Item).GetNextAfterMaxUsed()); // One-time query
|
||||
DB.Characters.Execute("DELETE FROM guild_bank_item WHERE item_guid >= {0}", GetGuidSequenceGenerator(HighGuid.Item).GetNextAfterMaxUsed()); // One-time query
|
||||
|
||||
result = DB.World.Query("SELECT MAX(guid) FROM transports");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -788,6 +788,29 @@ namespace Game
|
||||
// Place character in world (and load zone) before some object loading
|
||||
pCurrChar.LoadCorpse(holder.GetResult(PlayerLoginQueryLoad.CorpseLocation));
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_FAVORITE_AUCTIONS);
|
||||
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
|
||||
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt)).WithCallback(favoriteAuctionResult =>
|
||||
{
|
||||
AuctionFavoriteItems favoriteItems = new AuctionFavoriteItems();
|
||||
if (!favoriteAuctionResult.IsEmpty())
|
||||
{
|
||||
do
|
||||
{
|
||||
AuctionFavoriteInfo item = new AuctionFavoriteInfo();
|
||||
item.Order = favoriteAuctionResult.Read<uint>(0);
|
||||
item.ItemID = favoriteAuctionResult.Read<uint>(1);
|
||||
item.ItemLevel = favoriteAuctionResult.Read<uint>(2);
|
||||
item.BattlePetSpeciesID = favoriteAuctionResult.Read<uint>(3);
|
||||
item.SuffixItemNameDescriptionID = favoriteAuctionResult.Read<uint>(4);
|
||||
favoriteItems.Items.Add(item);
|
||||
|
||||
} while (favoriteAuctionResult.NextRow());
|
||||
|
||||
}
|
||||
SendPacket(favoriteItems);
|
||||
});
|
||||
|
||||
// setting Ghost+speed if dead
|
||||
if (pCurrChar.GetDeathState() != DeathState.Alive)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,15 @@ namespace Game.Mails
|
||||
m_receiver = receiver;
|
||||
m_receiver_lowguid = receiver_lowguid;
|
||||
|
||||
// ASSERT(!receiver || receiver.GetGUID().GetCounter() == receiver_lowguid);
|
||||
Cypher.Assert(!receiver || receiver.GetGUID().GetCounter() == receiver_lowguid);
|
||||
}
|
||||
|
||||
public MailReceiver(Player receiver, ObjectGuid receiverGuid)
|
||||
{
|
||||
m_receiver = receiver;
|
||||
m_receiver_lowguid = receiverGuid.GetCounter();
|
||||
|
||||
Cypher.Assert(!receiver || receiver.GetGUID() == receiverGuid);
|
||||
}
|
||||
|
||||
public Player GetPlayer() { return m_receiver; }
|
||||
@@ -140,10 +148,11 @@ namespace Game.Mails
|
||||
m_senderId = (uint)sender.EventId;
|
||||
m_stationery = MailStationery.Default;
|
||||
}
|
||||
public MailSender(AuctionEntry sender)
|
||||
|
||||
public MailSender(AuctionHouseObject sender)
|
||||
{
|
||||
m_messageType = MailMessageType.Auction;
|
||||
m_senderId = sender.GetHouseId();
|
||||
m_senderId = sender.GetAuctionHouseId();
|
||||
m_stationery = MailStationery.Auction;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Game.Mails
|
||||
public void SendMailTo(SQLTransaction trans, MailReceiver receiver, MailSender sender, MailCheckMask checkMask = MailCheckMask.None, uint deliver_delay = 0)
|
||||
{
|
||||
Player pReceiver = receiver.GetPlayer(); // can be NULL
|
||||
Player pSender = Global.ObjAccessor.FindPlayer(ObjectGuid.Create(HighGuid.Player, sender.GetSenderId()));
|
||||
Player pSender = sender.GetMailMessageType() == MailMessageType.Normal ? Global.ObjAccessor.FindPlayer(ObjectGuid.Create(HighGuid.Player, sender.GetSenderId())) : null;
|
||||
|
||||
if (pReceiver != null)
|
||||
PrepareItems(pReceiver, trans); // generate mail template items
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Game.Network.Packets
|
||||
public override void Read()
|
||||
{
|
||||
Auctioneer = _worldPacket.ReadPackedGuid();
|
||||
Offset = _worldPacket.ReadUInt8();
|
||||
Offset = _worldPacket.ReadUInt32();
|
||||
MinLevel = _worldPacket.ReadUInt8();
|
||||
MaxLevel = _worldPacket.ReadUInt8();
|
||||
Filters = (AuctionHouseFilterMask)_worldPacket.ReadUInt32();
|
||||
@@ -88,10 +88,10 @@ namespace Game.Network.Packets
|
||||
|
||||
class AuctionConfirmCommoditiesPurchase : ClientPacket
|
||||
{
|
||||
ObjectGuid Auctioneer;
|
||||
int ItemID;
|
||||
uint Quantity;
|
||||
Optional<AddOnInfo> TaintedBy;
|
||||
public ObjectGuid Auctioneer;
|
||||
public int ItemID;
|
||||
public uint Quantity;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
|
||||
public AuctionConfirmCommoditiesPurchase(WorldPacket packet) : base(packet) { }
|
||||
|
||||
@@ -149,6 +149,34 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionListBucketsByBucketKeys : ClientPacket
|
||||
{
|
||||
public ObjectGuid Auctioneer;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
public Array<AuctionBucketKey> BucketKeys = new Array<AuctionBucketKey>(100);
|
||||
public Array<AuctionSortDef> Sorts = new Array<AuctionSortDef>(2);
|
||||
|
||||
public AuctionListBucketsByBucketKeys(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
Auctioneer = _worldPacket.ReadPackedGuid();
|
||||
TaintedBy.HasValue = _worldPacket.HasBit();
|
||||
|
||||
uint bucketKeysCount = _worldPacket.ReadBits<uint>(7);
|
||||
uint sortCount = _worldPacket.ReadBits<uint>(2);
|
||||
|
||||
for (var i = 0; i < sortCount; ++i)
|
||||
Sorts[i] = new AuctionSortDef(_worldPacket);
|
||||
|
||||
if (TaintedBy.HasValue)
|
||||
TaintedBy.Value.Read(_worldPacket);
|
||||
|
||||
for (var i = 0; i < bucketKeysCount; ++i)
|
||||
BucketKeys[i] = new AuctionBucketKey(_worldPacket);
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionListItemsByBucketKey : ClientPacket
|
||||
{
|
||||
public ObjectGuid Auctioneer;
|
||||
@@ -168,12 +196,10 @@ namespace Game.Network.Packets
|
||||
TaintedBy.HasValue = _worldPacket.HasBit();
|
||||
|
||||
uint sortCount = _worldPacket.ReadBits<uint>(2);
|
||||
|
||||
for (var i = 0; i < sortCount; ++i)
|
||||
Sorts[i] = new AuctionSortDef(_worldPacket);
|
||||
|
||||
BucketKey = new AuctionBucketKey();
|
||||
BucketKey.Read(_worldPacket);
|
||||
BucketKey = new AuctionBucketKey(_worldPacket);
|
||||
|
||||
if (TaintedBy.HasValue)
|
||||
TaintedBy.Value.Read(_worldPacket);
|
||||
@@ -183,7 +209,7 @@ namespace Game.Network.Packets
|
||||
class AuctionListItemsByItemID : ClientPacket
|
||||
{
|
||||
public ObjectGuid Auctioneer;
|
||||
public int ItemID;
|
||||
public uint ItemID;
|
||||
public int SuffixItemNameDescriptionID;
|
||||
public uint Offset;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
@@ -194,37 +220,13 @@ namespace Game.Network.Packets
|
||||
public override void Read()
|
||||
{
|
||||
Auctioneer = _worldPacket.ReadPackedGuid();
|
||||
ItemID = _worldPacket.ReadInt32();
|
||||
ItemID = _worldPacket.ReadUInt32();
|
||||
SuffixItemNameDescriptionID = _worldPacket.ReadInt32();
|
||||
Offset = _worldPacket.ReadUInt32();
|
||||
TaintedBy.HasValue = _worldPacket.HasBit();
|
||||
|
||||
uint sortCount = _worldPacket.ReadBits<uint>(2);
|
||||
for (var i = 0; i < sortCount; ++i)
|
||||
Sorts[i] = new AuctionSortDef(_worldPacket);
|
||||
|
||||
if (TaintedBy.HasValue)
|
||||
TaintedBy.Value.Read(_worldPacket);
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionListItemsByItemKeys : ClientPacket
|
||||
{
|
||||
public ObjectGuid Auctioneer;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
public Array<AuctionBucketKey> BucketKeys = new Array<AuctionBucketKey>(100);
|
||||
public Array<AuctionSortDef> Sorts = new Array<AuctionSortDef>(2);
|
||||
|
||||
public AuctionListItemsByItemKeys(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
Auctioneer = _worldPacket.ReadPackedGuid();
|
||||
|
||||
if (_worldPacket.HasBit())
|
||||
TaintedBy.HasValue = true;
|
||||
|
||||
uint bucketKeyCount = _worldPacket.ReadBits<uint>(7);
|
||||
uint sortCount = _worldPacket.ReadBits<uint>(2);
|
||||
|
||||
for (var i = 0; i < sortCount; ++i)
|
||||
@@ -232,12 +234,6 @@ namespace Game.Network.Packets
|
||||
|
||||
if (TaintedBy.HasValue)
|
||||
TaintedBy.Value.Read(_worldPacket);
|
||||
|
||||
for (var i = 0; i < bucketKeyCount; ++i)
|
||||
{
|
||||
BucketKeys[i] = new AuctionBucketKey();
|
||||
BucketKeys[i].Read(_worldPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +286,7 @@ namespace Game.Network.Packets
|
||||
class AuctionRemoveItem : ClientPacket
|
||||
{
|
||||
public ObjectGuid Auctioneer;
|
||||
public int AuctionID = 0;
|
||||
public uint AuctionID;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
|
||||
public AuctionRemoveItem(WorldPacket packet) : base(packet) { }
|
||||
@@ -298,7 +294,7 @@ namespace Game.Network.Packets
|
||||
public override void Read()
|
||||
{
|
||||
Auctioneer = _worldPacket.ReadPackedGuid();
|
||||
AuctionID = _worldPacket.ReadInt32();
|
||||
AuctionID = _worldPacket.ReadUInt32();
|
||||
TaintedBy.HasValue = _worldPacket.HasBit();
|
||||
|
||||
if (TaintedBy.HasValue)
|
||||
@@ -364,7 +360,7 @@ namespace Game.Network.Packets
|
||||
public ulong MinBid;
|
||||
public uint RunTime;
|
||||
public Optional<AddOnInfo> TaintedBy;
|
||||
public Array<AuctionItemForSale> Items = new Array<AuctionItemForSale>(64);
|
||||
public Array<AuctionItemForSale> Items = new Array<AuctionItemForSale>(1);
|
||||
|
||||
public AuctionSellItem(WorldPacket packet) : base(packet) { }
|
||||
|
||||
@@ -451,24 +447,6 @@ namespace Game.Network.Packets
|
||||
|
||||
public AuctionCommandResult() : base(ServerOpcodes.AuctionCommandResult) { }
|
||||
|
||||
/**
|
||||
* @fn void WorldPackets::AuctionHousePackets::AuctionCommandResult::InitializeAuction(AuctionEntry* auction);
|
||||
*
|
||||
* @brief Initialize the following fields: AuctionId, Bid, AuctionOutBid, Bidder
|
||||
*
|
||||
* @param auction The relevant auction object
|
||||
*/
|
||||
public void InitializeAuction(AuctionEntry auction)
|
||||
{
|
||||
if (auction != null)
|
||||
{
|
||||
AuctionID = auction.Id;
|
||||
Money = auction.bid == auction.buyout ? 0 : auction.bid;
|
||||
MinIncrement = auction.bid == auction.buyout ? 0 : auction.GetAuctionOutBid();
|
||||
Guid = ObjectGuid.Create(HighGuid.Player, auction.bidder);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(AuctionID);
|
||||
@@ -482,7 +460,7 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionCommodityPriceUpdate : ServerPacket
|
||||
class AuctionCommodityQuote : ServerPacket
|
||||
{
|
||||
public Optional<ulong> TotalPrice;
|
||||
public Optional<uint> Quantity;
|
||||
@@ -490,7 +468,7 @@ namespace Game.Network.Packets
|
||||
public int Unknown830;
|
||||
public uint DesiredDelay;
|
||||
|
||||
public AuctionCommodityPriceUpdate() : base(ServerOpcodes.AuctionCommodityPriceUpdate) { }
|
||||
public AuctionCommodityQuote() : base(ServerOpcodes.AuctionCommodityQuote) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
@@ -546,16 +524,16 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionListBucketItemsResult : ServerPacket
|
||||
public class AuctionListBucketsResult : ServerPacket
|
||||
{
|
||||
public List<BucketInfo> Buckets = new List<BucketInfo>();
|
||||
public uint DesiredDelay;
|
||||
public int Unknown830_0;
|
||||
public int Unknown830_1;
|
||||
public int BrowseMode;
|
||||
public AuctionHouseBrowseMode BrowseMode;
|
||||
public bool HasMoreResults;
|
||||
|
||||
public AuctionListBucketItemsResult() : base(ServerOpcodes.AuctionListBucketItemsResult) { }
|
||||
public AuctionListBucketsResult() : base(ServerOpcodes.AuctionListBucketsResult) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
@@ -563,7 +541,7 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(DesiredDelay);
|
||||
_worldPacket.WriteInt32(Unknown830_0);
|
||||
_worldPacket.WriteInt32(Unknown830_1);
|
||||
_worldPacket.WriteBits(BrowseMode, 1);
|
||||
_worldPacket.WriteBits((int)BrowseMode, 1);
|
||||
_worldPacket.WriteBit(HasMoreResults);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
@@ -572,12 +550,12 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionListFavoriteItemsResult : ServerPacket
|
||||
class AuctionFavoriteItems : ServerPacket
|
||||
{
|
||||
public uint DesiredDelay;
|
||||
public List<AuctionFavoriteInfo> Items = new List<AuctionFavoriteInfo>();
|
||||
|
||||
public AuctionListFavoriteItemsResult() : base(ServerOpcodes.AuctionListFavoriteItemsResult) { }
|
||||
public AuctionFavoriteItems() : base(ServerOpcodes.AuctionFavoriteItems) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
@@ -596,9 +574,9 @@ namespace Game.Network.Packets
|
||||
public uint Unknown830;
|
||||
public uint TotalCount;
|
||||
public uint DesiredDelay;
|
||||
public uint ListType;
|
||||
public AuctionHouseListType ListType;
|
||||
public bool HasMoreResults;
|
||||
public AuctionBucketKey BucketKey;
|
||||
public AuctionBucketKey BucketKey = new AuctionBucketKey();
|
||||
|
||||
public AuctionListItemsResult() : base(ServerOpcodes.AuctionListItemsResult) { }
|
||||
|
||||
@@ -608,7 +586,7 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(Unknown830);
|
||||
_worldPacket.WriteUInt32(TotalCount);
|
||||
_worldPacket.WriteUInt32(DesiredDelay);
|
||||
_worldPacket.WriteBits(ListType, 2);
|
||||
_worldPacket.WriteBits((int)ListType, 2);
|
||||
_worldPacket.WriteBit(HasMoreResults);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
@@ -673,7 +651,7 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
class AuctionReplicateResponse : ServerPacket
|
||||
public class AuctionReplicateResponse : ServerPacket
|
||||
{
|
||||
public uint ChangeNumberCursor;
|
||||
public uint ChangeNumberGlobal;
|
||||
@@ -718,7 +696,21 @@ namespace Game.Network.Packets
|
||||
public Optional<ushort> BattlePetSpeciesID = new Optional<ushort>();
|
||||
public Optional<ushort> SuffixItemNameDescriptionID = new Optional<ushort>();
|
||||
|
||||
public void Read(WorldPacket data)
|
||||
public AuctionBucketKey() { }
|
||||
|
||||
public AuctionBucketKey(AuctionsBucketKey key)
|
||||
{
|
||||
ItemID = key.ItemId;
|
||||
ItemLevel = key.ItemLevel;
|
||||
|
||||
if (key.BattlePetSpeciesId != 0)
|
||||
BattlePetSpeciesID.Set(key.BattlePetSpeciesId);
|
||||
|
||||
if (key.SuffixItemNameDescriptionId != 0)
|
||||
SuffixItemNameDescriptionID.Set(key.SuffixItemNameDescriptionId);
|
||||
}
|
||||
|
||||
public AuctionBucketKey(WorldPacket data)
|
||||
{
|
||||
data.ResetBitPos();
|
||||
ItemID = data.ReadBits<uint>(20);
|
||||
@@ -735,7 +727,7 @@ namespace Game.Network.Packets
|
||||
BattlePetSpeciesID.Set(data.ReadUInt16());
|
||||
|
||||
if (SuffixItemNameDescriptionID.HasValue)
|
||||
SuffixItemNameDescriptionID = data.ReadUInt16();
|
||||
SuffixItemNameDescriptionID.Set(data.ReadUInt16());
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
@@ -786,6 +778,12 @@ namespace Game.Network.Packets
|
||||
public AuctionHouseSortOrder SortOrder;
|
||||
public bool ReverseSort;
|
||||
|
||||
public AuctionSortDef(AuctionHouseSortOrder sortOrder, bool reverseSort)
|
||||
{
|
||||
SortOrder = sortOrder;
|
||||
ReverseSort = reverseSort;
|
||||
}
|
||||
|
||||
public AuctionSortDef(WorldPacket data)
|
||||
{
|
||||
data.ResetBitPos();
|
||||
@@ -812,7 +810,7 @@ namespace Game.Network.Packets
|
||||
public uint ItemID;
|
||||
public uint ItemLevel;
|
||||
public uint BattlePetSpeciesID;
|
||||
public uint ItemSuffix;
|
||||
public uint SuffixItemNameDescriptionID;
|
||||
|
||||
public AuctionFavoriteInfo(WorldPacket data)
|
||||
{
|
||||
@@ -820,7 +818,7 @@ namespace Game.Network.Packets
|
||||
ItemID = data.ReadUInt32();
|
||||
ItemLevel = data.ReadUInt32();
|
||||
BattlePetSpeciesID = data.ReadUInt32();
|
||||
ItemSuffix = data.ReadUInt32();
|
||||
SuffixItemNameDescriptionID = data.ReadUInt32();
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
@@ -829,7 +827,7 @@ namespace Game.Network.Packets
|
||||
data.WriteUInt32(ItemID);
|
||||
data.WriteUInt32(ItemLevel);
|
||||
data.WriteUInt32(BattlePetSpeciesID);
|
||||
data.WriteUInt32(ItemSuffix);
|
||||
data.WriteUInt32(SuffixItemNameDescriptionID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,11 +837,11 @@ namespace Game.Network.Packets
|
||||
public ulong BidAmount;
|
||||
public ItemInstance Item;
|
||||
|
||||
public void Initialize(AuctionEntry auction, Item item)
|
||||
public void Initialize(AuctionPosting auction)
|
||||
{
|
||||
AuctionID = auction.Id;
|
||||
Item = new ItemInstance(item);
|
||||
BidAmount = auction.bid;
|
||||
Item = new ItemInstance(auction.Items[0]);
|
||||
BidAmount = auction.BidAmount;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
@@ -859,7 +857,7 @@ namespace Game.Network.Packets
|
||||
public AuctionBucketKey Key;
|
||||
public int TotalQuantity;
|
||||
public ulong MinPrice;
|
||||
public List<int> ItemModifiedAppearanceIDs = new List<int>();
|
||||
public List<uint> ItemModifiedAppearanceIDs = new List<uint>();
|
||||
public Optional<byte> MaxBattlePetQuality;
|
||||
public Optional<byte> MaxBattlePetLevel;
|
||||
public Optional<byte> BattlePetBreedID;
|
||||
@@ -903,7 +901,7 @@ namespace Game.Network.Packets
|
||||
public int Charges;
|
||||
public List<ItemEnchantData> Enchantments = new List<ItemEnchantData>();
|
||||
public int Flags;
|
||||
public int AuctionID;
|
||||
public uint AuctionID;
|
||||
public ObjectGuid Owner;
|
||||
public Optional<ulong> MinBid;
|
||||
public Optional<ulong> MinIncrement;
|
||||
@@ -947,7 +945,7 @@ namespace Game.Network.Packets
|
||||
data.WriteInt32(Count);
|
||||
data.WriteInt32(Charges);
|
||||
data.WriteInt32(Flags);
|
||||
data.WriteInt32(AuctionID);
|
||||
data.WriteUInt32(AuctionID);
|
||||
data.WritePackedGuid(Owner);
|
||||
data.WriteInt32(DurationLeft);
|
||||
data.WriteUInt8(DeleteReason);
|
||||
@@ -993,20 +991,20 @@ namespace Game.Network.Packets
|
||||
|
||||
struct AuctionBidderNotification
|
||||
{
|
||||
public int AuctionID;
|
||||
public uint AuctionID;
|
||||
public ObjectGuid Bidder;
|
||||
public ItemInstance Item;
|
||||
|
||||
public void Initialize(AuctionEntry auction, Item item)
|
||||
public void Initialize(AuctionPosting auction, Item item)
|
||||
{
|
||||
AuctionID = (int)auction.Id;
|
||||
AuctionID = auction.Id;
|
||||
Item = new ItemInstance(item);
|
||||
Bidder = ObjectGuid.Create(HighGuid.Player, auction.bidder);
|
||||
Bidder = auction.Bidder;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(AuctionID);
|
||||
data.WriteUInt32(AuctionID);
|
||||
data.WritePackedGuid(Bidder);
|
||||
Item.Write(data);
|
||||
}
|
||||
|
||||
@@ -883,7 +883,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public class ItemEnchantData
|
||||
{
|
||||
public ItemEnchantData(int id, uint expiration, int charges, byte slot)
|
||||
public ItemEnchantData(uint id, uint expiration, int charges, byte slot)
|
||||
{
|
||||
ID = id;
|
||||
Expiration = expiration;
|
||||
@@ -893,13 +893,13 @@ namespace Game.Network.Packets
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(ID);
|
||||
data.WriteUInt32(ID);
|
||||
data.WriteUInt32(Expiration);
|
||||
data.WriteInt32(Charges);
|
||||
data.WriteUInt8(Slot);
|
||||
}
|
||||
|
||||
public int ID;
|
||||
public uint ID;
|
||||
public uint Expiration;
|
||||
public int Charges;
|
||||
public byte Slot;
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace Game.Network.Packets
|
||||
if (item.GetEnchantmentId(slot) == 0)
|
||||
continue;
|
||||
|
||||
Enchants.Add(new ItemEnchantData((int)item.GetEnchantmentId(slot), item.GetEnchantmentDuration(slot), (int)item.GetEnchantmentCharges(slot), (byte)slot));
|
||||
Enchants.Add(new ItemEnchantData(item.GetEnchantmentId(slot), item.GetEnchantmentDuration(slot), (int)item.GetEnchantmentCharges(slot), (byte)slot));
|
||||
}
|
||||
|
||||
byte i = 0;
|
||||
|
||||
@@ -482,16 +482,16 @@ namespace Game.Scripting
|
||||
}
|
||||
|
||||
// Called when an auction is added to an auction house.
|
||||
public virtual void OnAuctionAdd(AuctionHouseObject ah, AuctionEntry entry) { }
|
||||
public virtual void OnAuctionAdd(AuctionHouseObject ah, AuctionPosting auction) { }
|
||||
|
||||
// Called when an auction is removed from an auction house.
|
||||
public virtual void OnAuctionRemove(AuctionHouseObject ah, AuctionEntry entry) { }
|
||||
public virtual void OnAuctionRemove(AuctionHouseObject ah, AuctionPosting auction) { }
|
||||
|
||||
// Called when an auction was succesfully completed.
|
||||
public virtual void OnAuctionSuccessful(AuctionHouseObject ah, AuctionEntry entry) { }
|
||||
public virtual void OnAuctionSuccessful(AuctionHouseObject ah, AuctionPosting auction) { }
|
||||
|
||||
// Called when an auction expires.
|
||||
public virtual void OnAuctionExpire(AuctionHouseObject ah, AuctionEntry entry) { }
|
||||
public virtual void OnAuctionExpire(AuctionHouseObject ah, AuctionPosting auction) { }
|
||||
}
|
||||
|
||||
public class ConditionScript : ScriptObject
|
||||
|
||||
@@ -975,29 +975,29 @@ namespace Game.Scripting
|
||||
}
|
||||
|
||||
// AuctionHouseScript
|
||||
public void OnAuctionAdd(AuctionHouseObject ah, AuctionEntry entry)
|
||||
public void OnAuctionAdd(AuctionHouseObject ah, AuctionPosting auction)
|
||||
{
|
||||
Cypher.Assert(ah != null);
|
||||
Cypher.Assert(entry != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionAdd(ah, entry));
|
||||
Cypher.Assert(auction != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionAdd(ah, auction));
|
||||
}
|
||||
public void OnAuctionRemove(AuctionHouseObject ah, AuctionEntry entry)
|
||||
public void OnAuctionRemove(AuctionHouseObject ah, AuctionPosting auction)
|
||||
{
|
||||
Cypher.Assert(ah != null);
|
||||
Cypher.Assert(entry != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionRemove(ah, entry));
|
||||
Cypher.Assert(auction != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionRemove(ah, auction));
|
||||
}
|
||||
public void OnAuctionSuccessful(AuctionHouseObject ah, AuctionEntry entry)
|
||||
public void OnAuctionSuccessful(AuctionHouseObject ah, AuctionPosting auction)
|
||||
{
|
||||
Cypher.Assert(ah != null);
|
||||
Cypher.Assert(entry != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionSuccessful(ah, entry));
|
||||
Cypher.Assert(auction != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionSuccessful(ah, auction));
|
||||
}
|
||||
public void OnAuctionExpire(AuctionHouseObject ah, AuctionEntry entry)
|
||||
public void OnAuctionExpire(AuctionHouseObject ah, AuctionPosting auction)
|
||||
{
|
||||
Cypher.Assert(ah != null);
|
||||
Cypher.Assert(entry != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionExpire(ah, entry));
|
||||
Cypher.Assert(auction != null);
|
||||
ForEach<AuctionHouseScript>(p => p.OnAuctionExpire(ah, auction));
|
||||
}
|
||||
|
||||
// ConditionScript
|
||||
|
||||
@@ -691,12 +691,13 @@ namespace Game
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Completed Achievements...");
|
||||
Global.AchievementMgr.LoadCompletedAchievements();
|
||||
|
||||
// Load dynamic data tables from the database
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Item Auctions...");
|
||||
Global.AuctionMgr.LoadAuctionItems();
|
||||
// Load before guilds and arena teams
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading character cache store...");
|
||||
Global.CharacterCacheStorage.LoadCharacterCacheStorage();
|
||||
|
||||
// Load dynamic data tables from the database
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Auctions...");
|
||||
Global.AuctionMgr.LoadAuctions();
|
||||
Global.AuctionHouseMgr.LoadAuctions();
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.BlackmarketEnabled))
|
||||
{
|
||||
@@ -707,10 +708,6 @@ namespace Game
|
||||
Global.BlackMarketMgr.LoadAuctions();
|
||||
}
|
||||
|
||||
// Load before guilds and arena teams
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading character cache store...");
|
||||
Global.CharacterCacheStorage.LoadCharacterCacheStorage();
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading Guild rewards...");
|
||||
Global.GuildMgr.LoadGuildRewards();
|
||||
|
||||
@@ -1184,7 +1181,7 @@ namespace Game
|
||||
}
|
||||
|
||||
// Handle expired auctions
|
||||
Global.AuctionMgr.Update();
|
||||
Global.AuctionHouseMgr.Update();
|
||||
}
|
||||
|
||||
if (m_timers[WorldTimers.AuctionsPending].Passed())
|
||||
|
||||
Reference in New Issue
Block a user