X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fobscount.pl;h=1bf73e2d915d41adb051c71b30c29592d1326f63;hb=ab811a0c902225075a9bd69749f65594079433a9;hp=fcbf81eec7c8a0d9068d5cb5d9b7c1e979e42ba4;hpb=a453254d687774f352822492d500330a09fd7ebe;p=spider.git diff --git a/cmd/set/obscount.pl b/cmd/set/obscount.pl index fcbf81ee..1bf73e2d 100644 --- a/cmd/set/obscount.pl +++ b/cmd/set/obscount.pl @@ -3,7 +3,7 @@ # # Copyright (c) 1998 - Dirk Koopman # -# $Id$ +# # my ($self, $line) = @_; @@ -11,32 +11,32 @@ my @args = split /\s+/, $line; my $call; my @out; my $user; -my $val = int shift @args if @args; +my $val = 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('e5')) if $self->priv < 8; +return (1, $self->msg('e25', 1, 9)) unless defined $val && $val =~ /^\d+$/ && $val >= 1 && $val <= 9; return (1, $self->msg('e12')) unless @args; -$val *= 60 if $val < 120; - foreach $call (@args) { $call = uc $call; - $user = DXUser->get_current($call); + my $dxchan = DXChannel::get($call); + $user = $dxchan->user if $dxchan; + $user = DXUser::get_current($call); if ($user) { - unless ($user->sort eq 'A' || $user->sort eq 'S') { + unless ($user->is_node) { push @out, $self->msg('e13', $call); next; } - $user->pingint($val); + $user->nopings($val); if ($dxchan) { - $dxchan->pingint($val); + $dxchan->nopings($val); } else { $user->close(); } - push @out, $self->msg('pingint', $call, $val); + push @out, $self->msg('obscount', $call, $val); } else { - push @out, $self->msg('e3', "Set/Pinginterval", $call); + push @out, $self->msg('e3', "set/obscount", $call); } } return (1, @out);