Navigation menu

WoW:API GetAuctionItemInfo: Difference between revisions

Jump to navigation Jump to search
→‎Notes: Explain that resolution is cached
m ({{wowapi}}, formatting.)
(→‎Notes: Explain that resolution is cached)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Retrieves info about one item in the current retrieved list of items from the Auction House.
Retrieves info about one item in the current retrieved list of items from the Auction House.
  name, texture, count, quality, canUse, level, minBid, minIncrement, buyoutPrice, bidAmount, highBidder, owner  = GetAuctionItemInfo("type", index);
  name, texture, count, quality, canUse, level,  
minBid, minIncrement, buyoutPrice, bidAmount,  
highBidder, owner  = GetAuctionItemInfo("type", index);


==Parameters==
==Parameters==
Line 31: Line 33:
===Result===
===Result===
Retrieves info about the first item in the list of your currently auctioned items.
Retrieves info about the first item in the list of your currently auctioned items.
== Notes ==
Note that the "owner" field can be ''nil''. This happens because the auction listing internally contains player GUIDs rather than names, and the WoW client does not query the server for names until GetAuctionItemInfo() is actually called for the item, and the result takes one [[RTT]] to arrive. The GUID->name mapping is then stored in a name resolution cache, which gets cleared upon logout (not UI reload).
Blizzard's standard auction house view overcomes this problem by reacting to AUCTION_ITEM_LIST_UPDATE and re-querying the items.
However, this event-driven approach does not really work for e.g. scanner engines. There, the correct solution is to re-query items with nil owners for a short time (a low number of seconds). There IS a possibility that it NEVER returns something - this happens when someone puts something up for auction and then deletes his character.
Also note that these GUID-to-name queries cause client-to-server bandwidth; 14 bytes each (WoW 2.3.2). For a normal 50-item page this is of course negligeable, but for a full-AH scan on a medium-size server, you easily generate enough traffic to disconnect yourself if you do not throttle the rate at which you send queries. See [[ChatThrottleLib]] for information on client-to-server bandwidth.
Anonymous user