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

[CSS] Hooking LogMessage fonction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-07-2013 , 12:45   [CSS] Hooking LogMessage fonction
Reply With Quote #1

Hello;

all is in the title, can I hook the LogMessage function ?

thanks in advance.
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 05-07-2013 at 12:47.
Razmo51 is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-11-2013 , 09:07   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #2

nobody ? ;(
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-11-2013 , 11:58   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #3

aaa, could you clarify more ?
__________________
Do not Private Message @me
Bacardi is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-11-2013 , 15:13   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #4

I want to hook a event (if exist) when the LogMessage function is called from a plugin (every plugins)

EX:

Plugin A

LogMessage("test plugin a");

Plugin B

// Event -> LogMessage function called by plugin a Text: "test plugin a"

Is it possible ?
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Bimbo1
Senior Member
Join Date: Jan 2010
Location: brazil
Old 05-11-2013 , 15:37   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #5

edit the plugins that are making the logs and make them call a forward when they logmessage.
Bimbo1 is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-11-2013 , 19:04   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #6

mmm; no other way ?

anyway, thanks for answer.
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Bimbo1
Senior Member
Join Date: Jan 2010
Location: brazil
Old 05-11-2013 , 19:47   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #7

yes. there's always another way: read the sourcemod log every single frame and throw a forward when it reads something different.
still, it's better implementing another function like anotherlogmessage() that do the log message throwing a forward before it.
__________________
sie sind das essen und wir sind die jäger!
Bimbo1 is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 05-11-2013 , 21:40   Re: [CSS] Hooking LogMessage fonction
Reply With Quote #8

PHP Code:
/**
** Called when a game log message is received.
**
** Any Log*() functions called within this callback will not recursively 
** pass through.  That is, they will log directly, bypassing this callback.
**
** Note that this does not capture log messages from the engine.  It only 
** captures log messages being sent from the game/mod itself.
**
** @param message        Message contents.
** @return                Plugin_Handled or Plugin_Stop will prevent the message 
**                         from being written to the log file.
**/
functag public Action:GameLogHook(const String:message[]);

/**
** Adds a game log hook.
**
** @param hook            Hook function.
** @noreturn
**/
native AddGameLogHook(GameLogHook:hook); 
Not sure if this will do, it from logging.inc file. It apparently hook log message from game and mod (can't test right now). Give it a try but the only inconvenient is it does not tell you from where it come from. The global forward seem to give more informations but doesn't say that it support logs from mods. To be sincere I have no idea if it going to help out but it worth a try.

Otherwise Messages Hooks could work but once again you wont be able to know from which plugin it from (if the message doesn't have a suffix).

Sorry again for lack of information and testing, iOS (getting habit but doesn't support orange box, srcds or notepad++ yet!).

Last edited by Mathias.; 05-11-2013 at 21:45.
Mathias. 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 07:13.


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