ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/schmorp-irc.ext
(Generate patch)

Comparing deliantra/maps/perl/schmorp-irc.ext (file contents):
Revision 1.17 by root, Sun Oct 1 18:18:34 2006 UTC vs.
Revision 1.18 by root, Sun Oct 1 23:57:54 2006 UTC

3use Time::HiRes; 3use Time::HiRes;
4use Net::IRC3::Client::Connection; 4use Net::IRC3::Client::Connection;
5 5
6# requires: commands.ext 6# requires: commands.ext
7 7
8return unless $cf::CFG{irc_server}; 8return unless exists $cf::CFG{irc_server};
9 9
10my $BOTSERVER = $cf::CFG{irc_server}; 10my $BOTSERVER = $cf::CFG{irc_server};
11my $BOTPORT = $cf::CFG{irc_port}; 11my $BOTPORT = $cf::CFG{irc_port};
12my $BOTNAME = $cf::CFG{irc_nick}; 12my $BOTNAME = $cf::CFG{irc_nick};
13my $BOTCHAN = $cf::CFG{irc_chan}; 13my $BOTCHAN = $cf::CFG{irc_chan};
91 0; 91 0;
92 } 92 }
93 ); 93 );
94} 94}
95 95
96my $timer; 96Event->timer (after => 1, interval => 30, cb => \&check_connection);
97 97
98sub new_timer {
99 $timer = AnyEvent->timer (after => 10, cb => sub {
100 check_connection ();
101 &new_timer; # and restart the time
102 });
103}
104
105new_timer; # create first timer
106check_connection ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines