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

Trigger functions on log-entries?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[Godmin] Gonzo
SourceMod Donor
Join Date: Jul 2004
Location: Godmins World
Old 07-17-2005 , 05:13   Trigger functions on log-entries?
Reply With Quote #1

Is it possible to trigger a function if a log-entry occures?

I have several metamod plugins which log to the console and std. logfiles. In some cases I would like to react with my amxmodx plugin.

If it is possible: How?

Thanks in advance,
Gonzo
[Godmin] Gonzo is offline
Send a message via ICQ to [Godmin] Gonzo
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2005 , 05:32  
Reply With Quote #2

If they are logging through the engine (for example through the AlertMessage function), you could intercept that with register_logmessage or the FakeMeta module.

If they have their own logging system or if they are logging through metamod's functions, I'm afraid that it will be impossible without a module, and probably a bit hacky from there as well.
__________________
hello, i am pm
PM is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-17-2005 , 07:43  
Reply With Quote #3

I always thought it's impossible for Metamod to intercept calls made through itself?
Johnny got his gun is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2005 , 08:46  
Reply With Quote #4

Quote:
Originally Posted by Johnny got his gun
I always thought it's impossible for Metamod to intercept calls made through itself?
Well you see, you could redirect the standard output or monitor the logfiles or just offsethack into metamod or whatever. It'd be hacky...
__________________
hello, i am pm
PM is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-17-2005 , 09:26  
Reply With Quote #5

Well, maybe it could be a really nice new feature of Metamod. I guess the devs already thought about this, but I don't know why the haven't implemented a proper way to catch its own calls to engine yet?

Actually it doesn't have to be in MM if we're only using AMXx. Fakemeta could just be updated to allow this feature if necessary. Maybe just a way to tell mod calls from fakemeta calls...

Maybe it's a bad idea? Some plugins could try to block calls from other plugins, it'd be madness. :-)
Johnny got his gun is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2005 , 09:37  
Reply With Quote #6

It'd indeed be madness and could easily cause some infinite recursion
__________________
hello, i am pm
PM is offline
[Godmin] Gonzo
SourceMod Donor
Join Date: Jul 2004
Location: Godmins World
Old 07-20-2005 , 15:49  
Reply With Quote #7

Quote:
Originally Posted by PM
If they are logging through the engine (for example through the AlertMessage function), you could intercept that with register_logmessage or the FakeMeta module.

If they have their own logging system or if they are logging through metamod's functions, I'm afraid that it will be impossible without a module, and probably a bit hacky from there as well.
Could you give me a short source to intercept logging with FakeMeta?

Thanks a lot
__________________
[Godmin] Gonzo is offline
Send a message via ICQ to [Godmin] Gonzo
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-20-2005 , 17:10  
Reply With Quote #8

Quote:
Originally Posted by [MUPPETS
Gonzo]
Quote:
Originally Posted by PM
If they are logging through the engine (for example through the AlertMessage function), you could intercept that with register_logmessage or the FakeMeta module.

If they have their own logging system or if they are logging through metamod's functions, I'm afraid that it will be impossible without a module, and probably a bit hacky from there as well.
Could you give me a short source to intercept logging with FakeMeta?

Thanks a lot
Well that'd of course assume the plugin calls the engine function directly, which would be pretty unusual (and dangerous to some extent)...

Knowing which plugins you mean and having source code to them would a lot here
__________________
hello, i am pm
PM 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 20:02.


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