Closed MaPePeR closed 11 years ago
Yeah there is definitely some improvement possible in that aspect. I am currently on holidays, so you will not see improvements very soon, but I have that on my to-do list. Feel free to fork and fix that yourself, if you don't wanna wait some weeks, I will close and comment this issue, when solved. Also thanks for the wiki pages, I appreciate your contributions and interest in this project.
Greetings
my first try in implementing the Interceptor without calling GetHooks
everytime: https://github.com/MaPePeR/ScrollsModLoader/commit/10f5a7a64efb855240832c8474737e8cda93731a?w=1
could not yet test it, maybe because i try to install it into an already patched scrolls - will do that tomorrow. (When starting it says Scrolls is already running, but it isn't)
I'm not sure if anyone already uses dynamic Hooks and i'm also very unsure about if they actually work, because you need to patch the assembly before the hook actually works.
So it would be much better to just call
GetHooks
once and then have a HashMap-Lookup instead of some code, that callsGetHooks
three times (*) on every Mod for every hooked (and hook-injected) method.(*) Line 59, Line 89, Line 143 in
ScrollsModLoader.ModInterceptor.Intercept