Taint
Evening folks :)
I've said a few times before on these forums that I want to be absolutely certain that I'm not degrading the performance of the game because of a lack of knowledge on my part. I'm hooking the func 'UseContainerItem' so that I can add the optional ability for the user to right-click an item in their inventory (while the Auction House is open, regardless of which tab is being used) and that item will be put up for sale. As it stands, if you're in the 'Bid' or 'Browse' tab, an unmodified right click will attempt to use or equip the item in question. Here's the code which I have written to perform this: Lua Code:
Although it works fine, my primary concern is that my hooking UseContainerItem will cause Blizz code to treat it as unsecure. After the user has sold whatever they're selling, they head out into combat and the problems start. Although UseContainerItem works fine for me during combat, it appears that it may be tainting ArkInventory. I've not yet tested using ArkInventory, while in combat, without the function loaded though, to be honest. I've played around with the idea of hooksecurefunc, but I'm not sure that that func can produce the desired result; by the time my post-hook is called, it's already going to be trying to equip the item. If anyone could offer some advice on this, it would be very much appreciated. Thanks in advance, Aanson. |
Overriding API like this will result in taint that will break any secure environment it is used in, and you won't be able to use items in combat eventually, not if UseContainerItem is involved.
hooksecurefunc it if you want but you gotta think an alternative way to achieve what you wanna achieve. securecall only works from Blizzards own code, as a mean to try execute stuff that might be tainted, so when you use it it has no effect, hehe. :P |
Quote:
- Before using securecall (ie just returning the function), I'd get an error when trying to remove something from an inventory slot. - After adding the securecall function, the error was gone and the hooked UseContainerItem worked without any problem. Quote:
I was doing a bit of thinking after writing this post, and I'm playing with the idea of hooking the OnShow handler of StaticPopup frame instead to achieve the same result (without compromising the confirmation popups for buying something or cancelling an auction etc). Thanks again :) |
Also if you run your function the hook will hook your last hook, i.e. cause a recursive effect. Just saying in case it might be triggered more than once each session. ;)
|
Quote:
Lua Code:
Cheers. |
Just an idea, why not hook the onclick script on the buttons in the auction UI instead the API itself?
local onClick = obj:GetScript("OnClick") to store the real "OnClick" function then obj:SetScript(...) with your own code. |
Quote:
Lua Code:
I'll need to check the XML to ensure that the hooksecurefunc line is accurate. I thought about hooking to a AuctionUI button, but as far as I can work out, there isn't one that would do the job. The user puts an item up for auction by right clicking the item in their bag. They wouldn't be using the AuctionUI at all to put the item up for sale unless they picked the item up and dragged / dropped it in the sell item box (or whatever it's called!), by which point it's already up for sale and there's no point of the hook! Sorry if I've misunderstood btw... kinda a common thing with me lol. |
Quote:
|
Quote:
|
Quote:
AuctionLite seems to be doing the same thing. |
All times are GMT -6. The time now is 02:11 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI