Thread Tools Display Modes
04-10-20, 06:11 AM   #1
GreenCoyote
A Murloc Raider
 
GreenCoyote's Avatar
Join Date: Apr 2020
Posts: 5
Unhappy Tainted code and Purchase in C_AuctionHouse (patch 8.3)

Hello! Im very new in wow addons, so may be my problem would look silly. Sorry about that.
Im trying to make purchase by addon. But I have a problem. My code is:
Code:
	itemKey = {};
	itemKey.itemID = 14047; -- Runecloth

	sorts = {};
	sorts.sortOrder = 0;
	sorts.reverseSort = false;
	
	C_AuctionHouse.SendSearchQuery(itemKey, sorts, false);
	C_AuctionHouse.StartCommoditiesPurchase(14047, 1);
But wow said this is bad, to call StartCommoditiesPurchase from tainted code.
Well. I read some articles about taint and started to call StartCommoditiesPurchase from secure button. But whole SearchQuersResult was tainted. So I moved all this code to /script of secure button. But according to taint.log, then Im creating table in macro – its taint too: “Global variable itemKey tainted by MACRO_TAINT - itemKey = {}”.

Im sure there is a way to make purchasing by lua code – TSM is doing this. But its code is to sophisticated for my LUA level to understand how it made.
So can someone share simple snippet, or give hint? I tried to google, but there is no good answers.
Sorry for my poor English, and thanks for reading.
  Reply With Quote
04-10-20, 11:58 PM   #2
GreenCoyote
A Murloc Raider
 
GreenCoyote's Avatar
Join Date: Apr 2020
Posts: 5
Smile It is that simple

After day of experiments, I realized that there is no need for secure functions. I just did it the wrong way. Code to buy something is:
Code:
C_AuctionHouse.StartCommoditiesPurchase(itemId, qty, unitPrice);
C_AuctionHouse.ConfirmCommoditiesPurchase(itemId, qty);
And, that’s it. You do not need anything else. Thanks for reading.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Tainted code and Purchase in C_AuctionHouse (patch 8.3)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off