fixup git indent problem
[spider.git] / cmd / links.pl
1 #
2 # links : which are active
3 # a complete list of currently connected linked nodes
4 #
5 # Created by Iain Philipps G0RDI, based entirely on
6 # who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH
7 # and subsequently plagerized by K1XX.
8 #
9 # 16-Jun-2000
10 # $Id$
11 #
12
13 my $self = shift;
14 my $dxchan;
15 my @out;
16 my $nowt = time;
17
18 push @out, "                                      Ave   Obs   Ping   Sec Since";
19 push @out, "  Callsign Type Started               RTT  count  Int.   Last Ping";
20
21 foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
22         my $call = $dxchan->call();
23         next if $dxchan == $main::me;
24         my $t = cldatetime($dxchan->startt);
25         my $sort;
26         my $name = $dxchan->user->name || " ";
27         my $obscount = $dxchan->nopings;
28         my $lastt = $nowt - ($dxchan->lastping);
29         my $pingint = $dxchan->pingint;
30         my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%8.2f",$dxchan->pingave) : "";
31         $sort = 'ANEA' if $dxchan->is_aranea;
32         $sort = "DXSP" if $dxchan->is_spider;
33         $sort = "CLX " if $dxchan->is_clx;
34         $sort = "DXNT" if $dxchan->is_dxnet;
35         $sort = "AR-C" if $dxchan->is_arcluster;
36         $sort = "AK1A" if $dxchan->is_ak1a;
37         push @out, sprintf "%10s $sort $t$ping    $obscount   %5d       %5d", $call, $pingint, $lastt;
38 }
39
40 return (1, @out)
41
42
43
44