Raised This Month: $51 Target: $400
 12% 

DHooks (Dynamic Hooks - Dev Preview)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 06-28-2021 , 14:38   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #11

Quote:
Originally Posted by Peace-Maker View Post
The probem here is that both Functions sections are named the same, the arguments aren't important. All "Functions" sections in all loaded gamedata files are cached together due to a limitation in SourceMod's gamedata parser extension api. So the first plugin creates an entry in that cache with the name "CTerrorPlayer::StartReviving" and the given argument setup. When the second plugin loads its gamedata file, the "CTerrorPlayer::StartReviving" function is already present in the cache, so dhooks thinks you want to update the entry. It adds the "new" argument to the setup, since it's named differently, making the function look like it takes two arguments.

This behavior is described in the release post in the "Game specific settings" section. It allows you to change details of a hook per game, if the rest is mostly the same.
Ohhh, that makes sense! I wasn't aware that the behavior described in that section applied across multiple gamedata files. This statement at the end of that section makes it seem like updating entries only works within the same file: "Later sections in the file add to the already parsed setup."

Quote:
Originally Posted by Peace-Maker View Post
The idea was to avoid duplicate function hook info in the gamedata file, which appears to have been a stupid one. Sorry, but I think it's too late now to change the behavior - I'm not even sure what the right thing would be :D
I'm not sure either. It seems fine to leave it this way now that I understand the behavior.

Quote:
Originally Posted by Peace-Maker View Post
I could add a server command which dumps all active detours and the plugins which are listening for them. It might be useless for detours and hooks created using the API instead of the "Functions" section though, since there is no name associated with the hook. But maybe we could print other relevant info which helps to identify which function is being hooked.
Sounds good. I haven't tried to create detours/hooks using the API yet, so I wouldn't know what other relevant info could even be made available with that potential command.
__________________
Psyk0tik is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode