just a simple command from ircd

Talk about pretty much anything here, but DO NOT USE FOR SUPPORT.

Moderator: Supporters

Locked
monkey
Posts: 4
Joined: Tue Mar 16, 2004 5:28 pm

just a simple command from ircd

Post by monkey »

hey guys.. im sorry to bug all of u again..
i just need the ircd todo a simple command when a user connects

isnt there something like
exec("/usr/bin/lynx http://www.mywebsite.com/online.asp?nick=bob");
that i can add into my ircd so it just executes that command so my asp script recognizes online/offline

all i need is an example of how to execute a WWW URL from the ircd source code and i can figure the rest out :)

the activeusers script isnt working out for me..
i just wanna make it simple
can someone please help :)
thx
AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf »

Well, since noone answered, I thought I just do. I don't want to only tell you to see the Modifying UnrealIRCd topic, I'll give you some hints.

First of all, my activeusers module was designed for very an other purpose, it's useless for your problem.

Second, before doing such things like using lynx in UnrealIRCd, ask the question to yourself whether you do them in the right way. As you probably know, lynx is a user-interactive web browser program, while UnrealIRCd is a daemon. If you know and understand the differences between them, you can immediately see the reason why it would be a bad idea to do that exec() thing in UnrealIRCd. (By the way, I've yet to see an exec() function in the C language.)

Maybe it's a better way to handle the HTTP connection directly by the IRC server software. Because starting a HTTP connection can result in a timeout, you'd better handle the connection asynchronously, so the IRC clients will not experience a huge lag while they are on your server.

Obviously, this also requires more knowledge of course, I just want to point you out how much the problem is difficult. And what I said here are only my ideas, there can be other solutions too. For instance, your job would be much simpler if you could find a statistics server program or something else that could do this for you. Previously I used the Thales IRC to SQL gateway software and worked well. It's available at http://www.gnu.org/software/thales/.

I hope I could somewhat help you.
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr »

By the way, I've yet to see an exec() function in the C language
I think when he said exec() he meant the "exec*() family" that exists on linux (execlp, execl, execle, etc.)
Maybe it's a better way to handle the HTTP connection directly by the IRC server software. Because starting a HTTP connection can result in a timeout, you'd better handle the connection asynchronously, so the IRC clients will not experience a huge lag while they are on your server.
You might be right about that. It's much better than invoking a new process each time someone connects. Imagine a drone/proxy/etc. attack where 400+ people connect at the same time, you'd have 400 copies of lynx running! I'm sure your shell provider wouldn't be too happy about that (probably would have your account prompty terminated).

It sounds to me like this could be done in a module (assuming remote includes are enabled) since the module could use the libcurl interface. Granted, Unreal does not really have an interface to libcurl to do this (you'd probably want to do an HTTP POST), but someone could interface with libcurl directly and do it asynchronously. It wouldn't be pretty, but it would be possible.
-- codemastr
Locked