X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fwho.pl;h=4371b08d3ed3e28afbf162129eaabc11e2afb65b;hb=4b207544da78b182bd12e94eab01451694749012;hp=34e2d0a4369b354a2f80865373d49978c84615ba;hpb=5acd1be649672f6e5bd2b4a6772b51cd935ebda9;p=spider.git diff --git a/cmd/who.pl b/cmd/who.pl index 34e2d0a4..4371b08d 100644 --- a/cmd/who.pl +++ b/cmd/who.pl @@ -1,24 +1,44 @@ -# -# who : is online -# a complete list of stations connected -# -# Copyright (c) 1999 Dirk Koopman G1TLH -# -# $Id$ - - -my $self = shift; -my $dxchan; -my @out; - -push @out, " Callsign Type Started Name"; - -foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { - my $call = $dxchan->call(); - my $t = cldatetime($dxchan->user->lastin); - my $sort = $dxchan->is_ak1a() ? "NODE" : "USER"; - my $name = $dxchan->user->name; - push @out, sprintf "%10s $sort $t $name", $call; -} - -return (1, @out) +# +# who : is online +# a complete list of stations connected +# +# Copyright (c) 1999 Dirk Koopman G1TLH +# +# + + +my $self = shift; +my $dxchan; +my @out; + +push @out, " Callsign Type Started Name Ave RTT Link"; + +foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { + my $call = $dxchan->call(); + my $t = cldatetime($dxchan->startt); + my $type = $dxchan->is_node ? "NODE" : "USER"; + my $sort = " "; + if ($dxchan->is_node) { + $sort = "DXSP" if $dxchan->is_spider; + $sort = "CLX " if $dxchan->is_clx; + $sort = "DXNT" if $dxchan->is_dxnet; + $sort = "AR-C" if $dxchan->is_arcluster; + $sort = "AK1A" if $dxchan->is_ak1a; + } else { + $sort = "LOCL" if $dxchan->conn->isa('IntMsg'); + $sort = "WEB " if $dxchan->is_web; + $sort = "EXT " if $dxchan->conn->isa('ExtMsg'); + $type = "RBN " if $dxchan->is_rbn; # Yes, this is NOT a typo + } + my $name = $dxchan->user->name || " "; + my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%5.2f", $dxchan->pingave) : " "; + my $conn = $dxchan->conn; + my $ip = ''; + if ($conn) { + $ip = $dxchan->hostname; + $ip = "AGW Port ($conn->{agwport})" if exists $conn->{agwport}; + } + push @out, sprintf "%10s $type $sort $t %-10.10s $ping $ip", $call, $name; +} + +return (1, @out)