X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fobscount.pl;fp=cmd%2Fset%2Fobscount.pl;h=457903778f403a521d012b497776838198360915;hb=bca5cd40374f12da5e0d46980e54bffc61fdc9c9;hp=0000000000000000000000000000000000000000;hpb=1ead732b2d2cfc4d04d88c83c1c8f00805badebc;p=spider.git diff --git a/cmd/set/obscount.pl b/cmd/set/obscount.pl new file mode 100644 index 00000000..45790377 --- /dev/null +++ b/cmd/set/obscount.pl @@ -0,0 +1,44 @@ +# +# set ping interval for this node +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; +my $user; +my $val = int shift @args if @args; + + +return (1, $self->msg('e5')) if $self->priv < 9; +return (1, $self->msg('e14')) unless defined $val; +return (1, $self->msg('e12')) unless @args; + +$val *= 60 if $val < 120; + +foreach $call (@args) { + $call = uc $call; + my $dxchan = DXChannel->get($call); + $user = $dxchan->user if $dxchan; + $user = DXUser->get($call) unless $user; + if ($user) { + unless ($user->sort eq 'A' || $user->sort eq 'S') { + push @out, $self->msg('e13', $call); + next; + } + $user->pingint($val); + if ($dxchan) { + $dxchan->pingint($val); + } else { + $user->close(); + } + push @out, $self->msg('pingint', $call, $val); + } else { + push @out, $self->msg('e3', "Set/Pinginterval", $call); + } +} +return (1, @out);