From 841b61045ab2b8fa959eed04909c17e092b7a16c Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Thu, 25 Jun 2020 15:00:34 +0100 Subject: [PATCH] various RBN fixes, fix links spacing Add incoming RBN filtering from the RBN servers. Use spot filtering if there is no RBN specific filtering. Fix formatting issues in the 'links' command for isolated and skimmer nodes. --- cmd/links.pl | 7 ++++--- perl/DXCommandmode.pm | 5 +---- perl/RBN.pm | 32 ++++++++++++++++---------------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/cmd/links.pl b/cmd/links.pl index ab3f27a2..ed4082ff 100644 --- a/cmd/links.pl +++ b/cmd/links.pl @@ -28,7 +28,7 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { my $obscount = $dxchan->nopings; my $pingint = $dxchan->pingint; my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint; - my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%7.2f",$dxchan->pingave) : ""; + my $ping = sprintf("%7.2f", $dxchan->pingave || 0); my $iso = $dxchan->isolate ? 'Y' : ' '; my $uptime = difft($dxchan->startt, 1); my ($fin, $fout, $pc92) = (' ', ' ', ' '); @@ -43,9 +43,10 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { $fout = $dxchan->routefilter =~ /node_default/ ? 'D' : 'Y'; } } - unless ($pingint) { + unless ($pingint && $ping) { $lastt = 0; - $ping = " "; + $ping = ' '; + $obscount = ' '; } $sort = "DXSP" if $dxchan->is_spider; diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 0515a91c..729675be 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -179,10 +179,7 @@ sub start || Filter::read_in('ann', 'user_default', 0) ; $self->{rbnfilter} = Filter::read_in('rbn', $call, 0) || Filter::read_in('rbn', $nossid, 0) - || Filter::read_in('spots', $call, 0) - || Filter::read_in('spots', $nossid, 0) - || Filter::read_in('rbn', 'user_default', 0) - || Filter::read_in('spots', 'user_default', 0); + || Filter::read_in('rbn', 'user_default', 0); # clean up qra locators my $qra = $user->qra; diff --git a/perl/RBN.pm b/perl/RBN.pm index b78e9d4b..91d1a9fd 100644 --- a/perl/RBN.pm +++ b/perl/RBN.pm @@ -47,8 +47,7 @@ sub new my $pkg = shift; my $call = shift; - DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->hostname], ); - $self->{d} = {}; +# DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->hostname], ); $self->{spot} = {}; $self->{last} = 0; $self->{noraw} = 0; @@ -69,8 +68,6 @@ sub start my $user = $self->{user}; my $call = $self->{call}; my $name = $user->{name}; - my $dref = $self->{d}; - my $spotref = $self->{spot}; # log it my $host = $self->{conn}->peerhost; @@ -102,11 +99,10 @@ sub start # get the filters my $nossid = $call; $nossid =~ s/-\d+$//; - - $self->{spotsfilter} = Filter::read_in('spots', $call, 0) - || Filter::read_in('spots', $nossid, 0) - || Filter::read_in('spots', 'user_default', 0); + $self->{inrbnfilter} = Filter::read_in('rbn', $call, 1) + || Filter::read_in('rbn', 'node_default', 1); + # clean up qra locators my $qra = $user->qra; $qra = undef if ($qra && !DXBearing::is_qra($qra)); @@ -260,6 +256,10 @@ sub normal my $r = [$origin, nearest(.1, $qrg), $call, $mode, $s, $t, $utz, $respot, $u]; dbg("RBN: key: '$sp' ADD RECORD call: $call qrg: $qrg origin: $origin") if isdbg('rbn'); my @s = Spot::prepare($r->[1], $r->[2], $r->[6], '', $r->[0]); + if ($self->{inrbnfilter}) { + my ($want, undef) = $self->{inrbnfilter}->it($s); + next unless $want; + } $r->[9] = \@s; push @$spot, $r; @@ -400,11 +400,11 @@ sub dx_spot ++$qrg{$s->[0]}; # and the qrg - my $filter = 0; - - if ($dxchan->{rbnfilter}) { - ($filter, undef) = $dxchan->{rbnfilter}->it($s); - next unless $filter; + my $want = 0; + my $rf = $dxchan->{rbnfilter} || $dxchan->{spotsfilter}; + if ($rf) { + ($want, undef) = $rf->it($s); + next unless $want; $saver = $s; dbg("RBN: FILTERED call: $s->[1] qrg: $s->[0] origin: $s->[4] dB: $r->[4]") if isdbg 'rbn'; last; @@ -439,10 +439,10 @@ sub dx_spot dbg("RBN: SENDING call: $saver->[1] qrg: $saver->[0] origin: $saver->[4] $saver->[3]") if isdbg 'rbn'; if ($dxchan->{ve7cc}) { - my $call = $saver->[1]; - $saver->[1] .= '-#'; + my $call = $saver->[4]; + $saver->[4] .= '-#'; $buf = VE7CC::dx_spot($dxchan, @$saver); - $saver->[1] = $call; + $saver->[4] = $call; } else { $buf = $dxchan->format_dx_spot(@$saver); } -- 2.34.1