How does hook handling work?
KingOfWhateverr

So, this is fairly off-topic but still relates to the framework itself. How does umod handle hooking in relation to mods. The framework I'm helping develop(for satisfactory) is currently running into the issue that if multiple mods call the same hook at the same time. As described by one of the devs:

"The way this works is that the original function is called, it doesn't run, it calls the hooked function instead, then that routes the params to the mods that have hooks to that function, then they return a return value and a bool to indicate if the original function will be called. Then after all of those are called it checks if the original function will be called.

Basically some mods need the original function to not be called while others do."

Thanks
-King

misticos

Hey!
Did you try taking a look at our GitHub? I hope you will find something useful for yourself there.
2CHEVSKII

In response to KingOfWhateverr ():
So, this is fairly off-topic but still relates to the framework itself. How does umod handle hooking...
Not exactly like that. 
AFAIK there are currently two types of hooks: pre-action and post-action (thats how i call them, not sure how to name it properly), pre-action hooks are called before performing an action, they pass some parameters to all the plugins subscribed to these hooks, and check if some plugins return non-null value, if the value is null, or, sometimes "true", the function is called as intended, if the value is something, the function will not be executed. (Some hooks might work differently, Im not sure). Post-function calls are made after the function was executed, they pass parameters which you can operate with, but you cannot block the function because the action has already happened.
Look at the docs page, hooks are marked as "No return behaviour" or "Returning non null overrides default behaviour". I also suggest you to take a look at the assemblies and see, how the hooks are called there.