X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fnode.pl;h=2cdf84a380a84749def463fef204bff08544ca2b;hb=699e2b8f9d924df78f55f69dfeded213f158b121;hp=37db1dc8d1e21f77a4773af97f575c1fbd58a484;hpb=bff9ecf00b14e7d71d9504088a2fd7b9e5115fe1;p=spider.git diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 37db1dc8..2cdf84a3 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -17,12 +17,22 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 1; +use DB_File; + my @call = map {uc $_} split /\s+/, $line; my @out; +my $count; # search thru the user for nodes unless (@call) { - @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls; + + my ($action, $key, $data); + for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { + if ($data =~ m{sort => '[ACRSX]'}) { + push @call, $key; + ++$count; + } + } } my $call; @@ -34,6 +44,7 @@ foreach $call (@call) { my $pcall = sprintf "%-11s", $call; push @out, $self->msg('snode1') unless @out > 0; if ($uref) { + $sort = "Unknwn"; $sort = "Spider" if $uref->is_spider; $sort = "AK1A " if $uref->is_ak1a; $sort = "Clx " if $uref->is_clx; @@ -53,14 +64,15 @@ foreach $call (@call) { } my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver; - if ($sort eq 'Spider') { + if ($uref->is_spider) { push @out, $self->msg('snode2', $pcall, $sort, "$ver "); } else { push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : " "); } + ++$count; } -return (1, @out); +return (1, @out, $self->msg('rec', $count));