How to hook C_AuctionHouse.PostItem?
I have tried several methods to hook into C_AuctionHouse.PostItem. I want to fire off an event and function when this function is used. However, I don't want to indirectly taint the above function.
Code:
oldFunction = C_AuctionHouse.PostItem I've used the following code but it does not track whether an item is posted or failed from being posted. It just triggers C_AuctionHouse.PostItem. Code:
AuctionHouseFrame.CommoditiesSellFrame.PostButton:HookScript("OnClick", function () print('test') end) Code:
hooksecurefunc(C_AuctionHouse, "PostItem", function() print('test') end) Code:
hooksecurefunc(AuctionHouseFrame.CommoditiesSellFrame, "PostItem", function(self) Here is the global Blizzard code dump I use. (https://github.com/Gethe/wow-ui-sour...mSellFrame.lua) There seems to be several mixins that use C_AuctionHouse.PostItem. That is why I just want to hook the parent C_AuctionHouse.PostItem function. NOTE: I want to point out that the event "OWNED_AUCTIONS_UPDATED" does not fire when using the Sell Frame or Sell Tab on the Auction House. When an item is posted that event is never triggered for some reason. The only other event that seems to fire is "COMMODITY_SEARCH_RESULTS_UPDATED" but it's very unreliable. So what would be the appropriate way to hook into C_AuctionHouse.PostItem so I can track when items are posted? Is there a better way with the new Auction House code? |
I don't know the difference yet, but some items use C_AuctionHouse.PostItem() and others use C_AuctionHouse.PostCommodity(). The frame template changes when you select an item to post.
|
Quote:
Oh I would like to point out that requesting a query update using C_AuctionHouse.QueryOwnedAuctions() while a user is on the Sell screen causes a bug. This bug prevents the user from properly selling Stacked items. It's one big mess with this new Auction House. |
Original Post: https://us.forums.blizzard.com/en/wo...pdating/424237
Small update it appears this issue has been fixed. I've been updating my code and have been noticing the servers returns are now properly being updated. It appears both C_AuctionHouse.GetNumOwnedAuctions() and C_AuctionHouse.GetOwnedAuctionInfo() now are updated properly when a user posts an item on the Sell panel of the Auction House. The bug used to not update C_AuctionHouse.GetNumOwnedAuctions() and C_AuctionHouse.GetOwnedAuctionInfo() accordingly when a user placed an item up for sale. This doesn't seem to be the case anymore. Which was useless as the user had just recently put an item up for sale. Which meant the data you got back from C_AuctionHouse.GetOwnedAuctionInfo() was outdated and incorrect. In addition use the following to check for any updates. C_AuctionHouse.IsThrottledMessageSystemReady() to make sure the server is ready Use AUCTION_HOUSE_AUCTION_CREATED to check when a user posts an item. |
All times are GMT -6. The time now is 08:46 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI