SallyWhitemane / Mograine

4 stars 34 forks source link

QueryAuctionItems("", nil, nil, 0, 0, 0, 0, 0, 0, true) returns only 47 auctions #338

Open andrew6180 opened 3 years ago

andrew6180 commented 3 years ago

Description: QueryAuctionItems("", nil, nil, 0, 0, 0, 0, 0, 0, true) is how addons like TSM and Auctionator do a 'full scan'. Currently it is only returning 47 auctions when it should be returning every item on the AH. I believe its probably only returning a single page of auctions, since there is 50 auctions per page.

How to reproduce: Use either TSM or Auctionator (or maybe Auctioneer, never used it) and attempt a GetAll / Full scan

How it should work: https://wowwiki.fandom.com/wiki/API_QueryAuctionItems see the GetAll section, the true flag at the end should force it to return a snapshot of all items on the auction house.

Download the ENTIRE auction house as one single page.

alexspew commented 3 years ago

What does /dump CanSendAuctionQuery() return?

andrew6180 commented 3 years ago

1, 1

alexspew commented 3 years ago

Could you try Auctioneer 5.9 version? They might use an sort of outdated CanSendAuctionQuery similar to Cata verison. (Remember to load outdated addons)

andrew6180 commented 3 years ago

I actually worked on the backport of TSM, this is the actual code that runs to run a GetAll scan

function Scan:GetAllScanQuery()
    local canScan, canGetAll = CanSendAuctionQuery()
    if not canGetAll then return TSM:Print(L["Can't run a GetAll scan right now."]) end
    if not canScan then 
        TSM:Print(L["Can't run a GetAll scan right now."])
        return TSMAPI:CreateTimeDelay(0.5, Scan.GetAllScanQuery) 
    end
    Scan:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
    QueryAuctionItems("", nil, nil, 0, 0, 0, 0, 0, 0, true)
    TSMAPI.Threading:Start(Scan.ProcessGetAllScan, 1, function() Scan:DoneScanning() end)
end

It's successfully reaching the QueryAuctionItems, it's just only querying a single page of items.

You can check this by going to the ah, opening the browse tab and doing

/run QueryAuctionItems("", nil, nil, 0, 0, 0, 0, 0, 0, true)

which will load a single page of random items.

alexspew commented 3 years ago

Try this /run QueryAuctionItems("", nil, nil, 0, false, 0, true, false, nil) < Cata version of QueryAuctionItems.

https://i.imgur.com/0ca24ex.png

andrew6180 commented 3 years ago

That also returns only 45-50 items. image

function Scan:GetAllScanQuery()
    local canScan, canGetAll = CanSendAuctionQuery()
    if not canGetAll then return TSM:Print(L["Can't run a GetAll scan right now."]) end
    if not canScan then 
        TSM:Print(L["Can't run a GetAll scan right now."])
        return TSMAPI:CreateTimeDelay(0.5, Scan.GetAllScanQuery) 
    end
    Scan:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
    --QueryAuctionItems("", nil, nil, 0, 0, 0, 0, 0, 0, true)
    QueryAuctionItems("", nil, nil, 0, false, 0, true, false, nil)
    TSMAPI.Threading:Start(Scan.ProcessGetAllScan, 1, function() Scan:DoneScanning() end)
end
alexspew commented 3 years ago

getAll seems to be disabled, I guess you gotta search page after page. I checked wowprogramming and the "QueryAuctionItems" is the same from WoTLK to Cataclysm.

I guess we gotta wait on a dev to comment