X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fusers.pl;h=d197727ba90f88b5a0ced94e9e217aa8974a501c;hb=a63885de419cf7ae4c10fa10e0107121e237e214;hp=2e69786b4376f2c4fa46dd0db350071ce8787269;hpb=20b0104deaeab77fa7ab1444dbcedfcdbf5865f8;p=spider.git diff --git a/cmd/show/users.pl b/cmd/show/users.pl index 2e69786b..d197727b 100644 --- a/cmd/show/users.pl +++ b/cmd/show/users.pl @@ -1,15 +1,56 @@ # -# show either the current user or a nominated set +# show the users on this cluster from the routing tables +# +# Copyright (c) 1998 Dirk Koopman G1TLH # # $Id$ # my ($self, $line) = @_; -my @list = DXChannel->get_all(); -my $chan; +my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes my @out; -foreach $chan (@list) { - push @out, "Callsign: $chan->{call}"; + +if (@list) { + foreach my $call (sort @list) { + my $uref = DXUser->get_current($call); + if ($uref) { + my $name = $uref->name || '?'; + my $qth = $uref->qth || '?'; + my $qra = $uref->qra || ''; + my $route = ''; + if (my $rref = Route::get($call)) { + $route = '(at ' . join(',', $rref->parents) . ')'; + } + push @out, "$call $route $name $qth $qra", + } else { + push @out, $self->msg('usernf', $call); + } + } +} else { + my $node = $main::routeroot; + push @out, "Callsigns connected to $main::mycall"; + my $call; + my $i = 0; + my @l; + my @val = sort $node->users; + foreach $call (@val) { + if ($i >= 5) { + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; + @l = (); + $i = 0; + } + my $uref = Route::User::get($call); + my $s = $call; + if ($uref) { + $s = sprintf "(%s)", $call unless $uref->here; + } else { + $s = "$call?"; + } + push @l, $s; + $i++; + } + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } return (1, @out); +