]> dxcluster.net Git - spider.git/blob - cmd/set/obscount.pl
allow pings if connected, but with no protocol visible yet
[spider.git] / cmd / set / obscount.pl
1 #
2 # set ping interval for this node
3 #
4 # Copyright (c) 1998 - Dirk Koopman
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @args = split /\s+/, $line;
11 my $call;
12 my @out;
13 my $user;
14 my $val = int shift @args if @args;
15
16
17 return (1, $self->msg('e5')) if $self->priv < 9;
18 return (1, $self->msg('e14')) unless defined $val;
19 return (1, $self->msg('e12')) unless @args;
20
21 $val *= 60 if $val < 120;
22
23 foreach $call (@args) {
24         $call = uc $call;
25         $user = DXUser->get_current($call);
26         if ($user) {
27                 unless ($user->sort eq 'A' || $user->sort eq 'S') {
28                         push @out, $self->msg('e13', $call);
29                         next;
30                 }
31                 $user->pingint($val);
32                 if ($dxchan) {
33                         $dxchan->pingint($val);
34                 } else {
35                         $user->close();
36                 }
37                 push @out, $self->msg('pingint', $call, $val);
38         } else {
39                 push @out, $self->msg('e3', "Set/Pinginterval", $call);
40         }
41 }
42 return (1, @out);