Thread: Update 5.2
View Single Post
10/20/19, 03:47 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,964
SecurePostHook -> Call code after original function

On PTS Dragonhold 100029:
The following function was added by ZOs to call your code securely AFTER the original function was executed.
Lua Code:
  1. SecurePostHook(control/variable,, "FunctionName", callbackFunction)

Example:
Lua Code:
  1. SecurePostHook(ZO_Smithing, "SetMode", smithingSetModeHook)

I've also tested this with some of the inventories ChangeFilter functions but I'll get an error then.
-> Reported them to Chip in order to see if we can get this solved or if this happens because of other addons maybe using other hooks on the same functions (see below).

What I found out as well:
If addons which work in the same "regions" (inventory e.g.) do not use the same methods, but on uses the new SecurePostHook and another one uses ZO_PreHook on the same function, they will have problems at drag&drop of the inventory items -> Insecure errors will appear.
Tested with FCOItemSaver and AdvancedFilters e.g.
FCOIS used ZO_PreHook and AF SecurePostHook already.
After changing FCOIS to the same SecurePostHook the errors were gone.

I recommand to change your addons, which have created manual PostHook at ZO_Smithing, ZO_Enchanting etc. SetMode/OnModeUpdate functions to be changed to use SecurePostHook now so all addons will work properly together!

Or at least build a test version and see if it fixes stuff. Most errors I found were raised as one dragged an item from the inventory, or crafting inventories.

Last edited by Baertram : 10/20/19 at 04:46 PM.
  Reply With Quote