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

func vs func_POST


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-25-2018 , 14:34   func vs func_POST
Reply With Quote #1

What is the difference between these for example.

Quote:
void FN_ClientCommand(edict_t *pEntity);
and

Quote:
void FN_ClientCommand_Post(edict_t *pEntity);
If I'm not mistaken. By logic, the second one gets called and lets me handle the client's command? If not then which one of these is used to handle commands and to send commands?
redivcram is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2018 , 14:46   Re: func vs func_POST
Reply With Quote #2

Generally, "post" means that your code will get executed after the event occurs. This means that you cannot modify the event itself because it already happened. If a hook is "pre" then your code gets executed before the event occurs which allows you to modify the event (depending on the event and type of hook it is).
__________________
fysiks is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-25-2018 , 15:52   Re: func vs func_POST
Reply With Quote #3

Oh, I see. Makes a lot of sense. Thanks.
redivcram is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-25-2018 , 22:09   Re: func vs func_POST
Reply With Quote #4

Take a look at HLSDK code, you'll find all that references there. You might know you're hooking something as POST, but what happened inside? There's the answer.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-26-2018 , 10:50   Re: func vs func_POST
Reply With Quote #5

Normally on the engine or game dll there're calls (ClientCommand for example).

Metamod hooks the call and replace with this:

Code:
ClientCommand_Hook() {
  call Metamod_Module_Client_Command()
  call Original_ClientCommand()
  call Metamod_Module_Client_Command_Post()
}
So not all _Post() calls can be useful, sometimes only works to know there was a call. The thing is you can't modify too much stuff after the original was called.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 07-26-2018 at 10:50.
joropito is offline
Send a message via MSN to joropito
Reply


Thread Tools
Display Modes

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 08:48.


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