Thread Tools Display Modes
08-08-17, 12:39 PM   #1
guema
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 17
Hook system

(Sorry, i posted it in the wrong category first)

So, if i understand well, Hook system is like a function/method wrapping, to chain them. Secure hooking is the same except this is official (so, secure) code. Allowing to chain independent-from-main-handler hooked function, that wouldn't be tainted if your main handler is tainted... am i right ?

I see the interest of it.

What i don't understand is why the api seems to be incomplete or just minimal. Typically, Hooking a function is like Wrapping the main handler or function to add code parts.
Blizzard could decide to make hook and scripts separated, like making a pre-hooks (that are, in facts, just methods/functions overwriting/overloading atm), script and hooks phases, but this is just a wrapping/replacing process.

But, what is really bad, is when you want to hook a default behavior for an advanced/enhanced frame for exemple, but still want to allow user to add its own behavior (without overwriting the default one). (What i want to do is to provide advanced frames in a Lib, allowing any coder to add their own complexity)

The only way i see is to Hook the script as default (it will be registered as the script handler) and hook the function SetScript to make it hook your default behavior when changing script. But it is so laborious... I was wondering if there was a cleaner way..?

I hope i made it understandable, as it is a really technical feature, and english is not my primary language.
  Reply With Quote
08-09-17, 11:18 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
The limitations on secure hooking is actually part of its design. This and the entire taint system was built to stop addons from setting up or executing various automated tasks.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Hook system


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