Raised This Month: $ Target: $400
 0% 

Hook Native


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 07-30-2015 , 20:04   Hook Native
Reply With Quote #1

I've never actually experimented with this. Is there a way to hook when a native-function is fired, such as CreateConVar or AddNormalSoundHook? I'm looking to do some debugging.
ReFlexPoison is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 07-30-2015 , 22:25   Re: Hook Native
Reply With Quote #2

Quote:
Originally Posted by ReFlexPoison View Post
I've never actually experimented with this. Is there a way to hook when a native-function is fired, such as CreateConVar or AddNormalSoundHook? I'm looking to do some debugging.
Depending on what you need to do, why not just add a PrintToChat line or make a forward?
__________________
databomb is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-30-2015 , 23:50   Re: Hook Native
Reply With Quote #3

Quote:
Originally Posted by databomb View Post
Depending on what you need to do, why not just add a PrintToChat line or make a forward?
That would require editing every plugin that makes these calls.

From what I read, I think he wants to perform an action if ANY plugin makes a given call to a Sourcemod native.

I do not think this is possible short of editing every single plugin, or Sourcemod itself.
__________________
ddhoward is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 07-31-2015 , 01:12   Re: Hook Native
Reply With Quote #4

Quote:
Originally Posted by ddhoward View Post
That would require editing every plugin that makes these calls.

From what I read, I think he wants to perform an action if ANY plugin makes a given call to a Sourcemod native.

I do not think this is possible short of editing every single plugin, or Sourcemod itself.
Do you think it would it be a viable feature if requested?
ReFlexPoison is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 07-31-2015 , 05:36   Re: Hook Native
Reply With Quote #6

Reasoning? (And I'm just asking out of curiosity)
ReFlexPoison is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-31-2015 , 07:03   Re: Hook Native
Reply With Quote #7

It's not something we want to support, and it's an unknown performance variable.
For debugging, you'll get much, much better results attaching a real debugger and breakpointing the C++ implementation (or native dispatch in the VM).
__________________
asherkin is offline
Reply



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 17:20.


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