From: Dirk Koopman Date: Tue, 13 May 2008 11:53:47 +0000 (+0100) Subject: add disc users|nodes|all to disconnect cmd X-Git-Tag: 1.56~88 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b21846900b9f840da86fef72e6ee86ac56cfb53;p=spider.git add disc users|nodes|all to disconnect cmd --- diff --git a/Changes b/Changes index f7335648..8bc70051 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +13May08======================================================================= +1. add disc users|nodes|all so that each of these classes can be disconnected +in one command. From a request by Mauro IV3SCP. 12May08======================================================================= 1. add 'exact' keyword on sh/dx to allow for an exact match to a callsign. From a request by Robert HB9DZA. diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index a1ab2305..d0cce0da 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -583,8 +583,20 @@ You can abbreviate all the commands to one letter and use ak1a syntax:- === 5^DIRECTORY-^ Sysops can see all users' messages. -=== 8^DISCONNECT [ ...]^Disconnect a user or cluster -Disconnect any connected locally +=== 8^DISCONNECT [ ...]^Disconnect user(s) or node(s) +Disconnect any connected locally. + +In addition you can disconnect all users (except yourself) with + + DISC users + +or all nodes with: + + DISC nodes + +or everything (except yourself) with + + DISC all === 0^DX [BY ] ^Send a DX spot This is how you send a DX Spot to other users. You can, in fact, now diff --git a/cmd/disconnect.pl b/cmd/disconnect.pl index 60078704..7dad27bb 100644 --- a/cmd/disconnect.pl +++ b/cmd/disconnect.pl @@ -10,6 +10,13 @@ if ($self->priv < 5) { return (1, $self->msg('e5')); } +if ($calls[0] =~ /^user/i ) { + @calls = grep {$_ ne $self->call} DXChannel::get_all_user_calls(); +} elsif ($calls[0] =~ /^node/i) { + @calls = grep {$_ ne $main::mycall} DXChannel::get_all_node_calls(); +} elsif (lc $calls[0] eq 'all') { + @calls = grep {$_ ne $main::mycall && $_ ne $self->call} DXChannel::get_all_node_calls(), DXChannel::get_all_user_calls(); +} foreach $call (@calls) { $call = uc $call; next if $call eq $main::mycall; diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index fcc230aa..69a72abe 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -239,6 +239,17 @@ sub get_all_nodes return @out; } +# return a list of node calls +sub get_all_node_calls +{ + my $ref; + my @out; + foreach $ref (values %channels) { + push @out, $ref->{call} if $ref->is_node; + } + return @out; +} + # return a list of all users sub get_all_users { diff --git a/perl/Version.pm b/perl/Version.pm index 219b2486..62a39ba8 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.55'; $subversion = '0'; -$build = '7'; +$build = '8'; 1;