]> scm.dxcluster.org Git - spider.git/commitdiff
use base call for rbn set/seeme
authorDirk Koopman <djk@tobit.co.uk>
Mon, 31 Jan 2022 16:01:24 +0000 (16:01 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 31 Jan 2022 16:01:24 +0000 (16:01 +0000)
Changes
perl/DXProtHandle.pm
perl/RBN.pm

diff --git a/Changes b/Changes
index f44a0b651440c577d13e5c0066505bc2c0491bd2..39877aa3f8b3c7893f02cd67ee66b5f3817b942c 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+31Jan22=======================================================================
+1. Fix set/seeme to use the basecall (so all of G1TLH, G1TLH-1, G1TLH-2 will
+   get CW RBN spots for G1TLH).
 29Jan22=======================================================================
 1. Implement RBN set/seeme which displays any passing RBN spots for your
    callsign in "raw" format. 
index 2b0a491ba6d983eaffc08d81de5a3f1c949866f1..6ba38a430c4579bde302d0719116cc7e777dec06 100644 (file)
@@ -1578,13 +1578,16 @@ sub _decode_pc92_call
                $version = 0;
        }
        $version =~ s/\D//g;
+       $version = 0 unless $version && $version =~ /^[0-9]+$/;
        $build =~ s/^0\.//;
        $build =~ s/\D//g;
+       $build = 0 unless $build &&  $build =~ /^[0-9]+$/;
        if ($ip) {
         $ip =~ s/,/:/g;
         $ip =~ s/^::ffff://i;
+               $ip = '' unless is_ipaddr($ip);
     }
-       dbg("$icall = '" . join("', '", $call, $is_node, $is_extnode, $here, $version, $build, $ip) . "'") if isdbg('pc92');
+       dbg("'$icall' = '" . join("', '", $call, $is_node, $is_extnode, $here, $version, $build, $ip) . "'") if isdbg('pc92');
        return ($call, $is_node, $is_extnode, $here, $version+0, $build+0, $ip);
 }
 
@@ -1666,9 +1669,9 @@ sub _add_thingy
                                                $user->sort('S');
                                                dbg("PCProt::_add_thingy node $call v: $version b: $build sort ($old) updated to " . $user->sort);
                                        } elsif ($user->is_spider && ($version < 3000 || ($version > 4000 && $version < 5455))) {
-                                               unless ($version == 5000 && $build == 0) {
+                                               unless ($version > 0  && $build == 0) {
                                                        $user->sort('A');
-                                                       $build //= 0;
+                                                       $build ||= 0;
                                                        dbg("PCProt::_add_thingy node $call v: $version b: $build sort ($old) downgraded to " . $user->sort);
                                                }
                                        }
index 7ad9093b7817831732debf8a84fc0ecca42237bd..804813d4bbd1b031e8955687bd4573f177bdfec4 100644 (file)
@@ -75,10 +75,11 @@ our $startup_delay = 5*60;          # don't send anything out until this timer has expir
                                 # this is to allow the feed to "warm up" with duplicates
                                 # so that the "big rush" doesn't happen.
 
-our $minspottime = 30*60;              # the time between respots of a callsign - if a call is
+our $respottime = 30*60;               # the time between respots of a callsign - if a call is
                                 # still being spotted (on the same freq) and it has been
                                 # spotted before, it's spotted again after this time
-                                # until the next minspottime has passed.
+                                # until the next respottime has passed.
+
 
 our $beacontime = 5*60;                        # same as minspottime, but for beacons (and shorter)
 
@@ -90,9 +91,13 @@ our $limbotime = 5*60;                       # if there are fewer than $minqual candidates and $dwe
                                 # simply be that it is not in standard spot coverage. (ask G4PIQ
                                 # about this).
 
+our $cachetime = 60*60;                        # The length of time spot data is cached
+
 our $filterdef = $Spot::filterdef; # we use the same filter as the Spot system. Can't think why :-).
 
 my $spots;                                             # the GLOBAL spot cache
+my $qrg;                                               # the GlOBAL (ephemeral) qrg cache (generated on re-read of cache)
+
 
 my %runtime;                                   # how long each channel has been running
 
@@ -149,7 +154,7 @@ sub new
        $self->{norawhour} = 0;
        $self->{sort} = 'N';
        $self->{lasttime} = $main::systime;
-       $self->{minspottime} = $minspottime;
+       $self->{respottime} = $respottime;
        $self->{beacontime} = $beacontime;
        $self->{showstats} = 0;
        $self->{pingint} = 0;
@@ -389,7 +394,7 @@ sub normal
                my $respot = 0;
                if ($cand && ref $cand) {
                        if (@$cand <= CData) {
-                               if ($self->{minspottime} > 0 && $now - $cand->[CTime] < $self->{minspottime}) {
+                               if ($self->{respottime} > 0 && $now - $cand->[CTime] < $self->{respottime}) {
                                        dbg("RBN: key: '$sp' call: $call qrg: $qrg DUPE \@ ". atime(int $cand->[CTime])) if $dbgrbn && isdbg('rbn');
                                        return;
                                }
@@ -854,7 +859,7 @@ sub per_10_minute
                next if $k =~ /^O\|/;
                next if $k =~ /^SKIM\|/;
                
-               if ($main::systime - $cand->[CTime] > $minspottime*2) {
+               if ($main::systime - $cand->[CTime] > $cachetime) {
                        delete $spots->{$k};
                        ++$removed;
                }
@@ -959,12 +964,12 @@ sub check_cache
 sub add_seeme
 {
        my $call = shift;
-       $seeme{$call} = 1;
+       $seeme{basecall($call)} = 1;
 }
 
 sub del_seeme
 {
        my $call = shift;
-       delete $seeme{$call};
+       delete $seeme{basecall($call)};
 }
 1;