in reply to CGI chat room problem
Hi,
I've done the same thing (build a chat, that is)...
You could do a couple of things, run a chat daemon (A
process that just runs, and gets information from your
chat script, and processes this), good thing here is that you
can have a loop in this program which just compares the
current time (as from "time()" (Seconds sinds the Epoch))
with the last time a user typed something (The way I did it
was have a hash, based on username, and that would store
amongst other things the last time a user typed something)
if the difference is bigger than, say, 5 minutes, it is
safe to delete this user from the hash as being an active user.
Another option is to have the script keep it`s state in
either a plain text file, or a database, whatever, whenever
an event occurs which calls your script (user
loging in, someone talking, whatever) it processes the file,
or database, and takes out idle users doing the same
compare I explained before.
Does this help ?
GreetZ!,
print "profeth still\n" if /bird|devil/;
I've done the same thing (build a chat, that is)...
You could do a couple of things, run a chat daemon (A
process that just runs, and gets information from your
chat script, and processes this), good thing here is that you
can have a loop in this program which just compares the
current time (as from "time()" (Seconds sinds the Epoch))
with the last time a user typed something (The way I did it
was have a hash, based on username, and that would store
amongst other things the last time a user typed something)
if the difference is bigger than, say, 5 minutes, it is
safe to delete this user from the hash as being an active user.
Another option is to have the script keep it`s state in
either a plain text file, or a database, whatever, whenever
an event occurs which calls your script (user
loging in, someone talking, whatever) it processes the file,
or database, and takes out idle users doing the same
compare I explained before.
Does this help ?
GreetZ!,
- ChOas
print "profeth still\n" if /bird|devil/;
In Section
Seekers of Perl Wisdom