stop self spotting bwlow 23cms (configurable)
authorDirk Koopman <djk@tobit.co.uk>
Wed, 17 Nov 2021 22:18:10 +0000 (22:18 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Wed, 17 Nov 2021 22:18:10 +0000 (22:18 +0000)
Changes
cmd/dx.pl
perl/DXUtil.pm
perl/RBN.pm
perl/Spot.pm

diff --git a/Changes b/Changes
index ae7533ce59117de28e687a1da87f002eb8741909..7772728efba58a99547349661f619d01c6bc4337 100644 (file)
--- a/Changes
+++ b/Changes
@@ -11,6 +11,9 @@
    rather than a scary exception message about multiplication thrown by one 
    of the libraries that I use. 
 4. Added CTY-3126 prefixes.
+5. Silently ignore self spotting below 1240000Khz (change 
+   $Spot::minselfspot to 0 to disable or some other freq in Khz). NOTE this 
+   will appear as a spot to the spotter's feed, but will not be passed on.
 15Jul21=======================================================================
 1. Fix long standing bug in crontabs that commands with " rather than ' around
    strings could cause those commands not to work. 
index 3fd00e6bb1bce1a4e56169f231d3a378095f2331..0a790a93e4512db4a10f53aa60328c031a00b45b 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -16,6 +16,8 @@ my $freq;
 my @out;
 my $valid = 0;
 my $localonly;
+my $oline = $line;
+
 return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
 return (1, $self->msg('e28')) unless $self->registered;
 
@@ -55,20 +57,24 @@ if (is_freq($f[1]) && $f[0] =~ m{^[\w\d]+(?:/[\w\d]+){0,2}$}) {
 
 # check some other things
 # remove ssid from calls
-my $callnoid = $self->call;
-$callnoid =~ s/-\d+$//;
-my $spotternoid = $spotter;
-$spotternoid =~ s/-\d+$//;
+my $spotternoid = basecall($spotter);
+my $callnoid = basecall($self->{call});
+
+#$DB::single = 1;
+
 if ($DXProt::baddx->in($spotted)) {
        $localonly++; 
 }
-if ($DXProt::badspotter->in($callnoid)) { 
-       LogDbg('DXCommand', "$self->{call} badspotter with $callnoid ($line)");
+if ($DXProt::badspotter->in($spotternoid)) { 
+       LogDbg('DXCommand', "badspotter $spotternoid as $spotter ($oline)");
        $localonly++; 
 }
-if ($callnoid ne $spotternoid && $DXProt::badspotter->in($spotternoid)) { 
-       LogDbg('DXCommand', "$self->{call} badspotter with $spotternoid ($line)");
-       $localonly++; 
+
+dbg "spotter $spotternoid/$callnoid\n";
+
+if (($spotted =~ /$spotternoid/ || $spotted =~ /$callnoid/) && $freq < $Spot::minselfspotqrg) {
+       LogDbg('DXCommand', "$spotternoid/$callnoid trying to self spot below ${Spot::minselfspotqrg}KHz ($oline), not passed on to cluster");
+       $localonly++;
 }
 
 # make line the rest of the line
index 73cda964733d53ea257a006ac8395af7ffe1b11c..182cde345ca8b0417b52e14619f41b460c657d4f 100644 (file)
@@ -27,7 +27,7 @@ require Exporter;
              print_all_fields cltounix unpad is_callsign is_latlong
                         is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
                         is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
-                        diffms _diffms _diffus difft parraydifft is_ztime
+                        diffms _diffms _diffus difft parraydifft is_ztime basecall
             );
 
 
@@ -589,3 +589,9 @@ sub parraydifft
        $out =~ s/,\s*$//;
        return $out;
 }
+
+sub basecall
+{
+       $_[0] =~ m|^(?:[\w\d]+/)?([\w\d]+).*$|;
+       return $1;
+}
index 0cf5c4149c4940c979280ca28eea537a89be7477..51c299c4abae389558667413e6ac8c54149682a6 100644 (file)
@@ -252,7 +252,7 @@ sub normal
        }
 
        # remove all extraneous crap from the origin - just leave the base callsign
-       $origin =~ s|^(?:[\w\d]+/)?([\w\d]+).*$|$1|;
+       $origin =~ basecall($origin);
 
        # is this callsign in badspotter list?
        if ($DXProt::badspotter->in($origin) || $DXProt::badnode->in($origin)) {
index bd5f06011fc650f65883703ba0ea52dedb84d529..e9dd27901364080c84d982a0b29f1c5e1cb01eca 100644 (file)
@@ -70,8 +70,8 @@ $totalspots = $hfspots = $vhfspots = 0;
 $use_db_for_search = 0;
 
 our %spotcache;                                        # the cache of data within the last $spotcachedays 0 or 2+ days
-our $spotcachedays = 2;
-
+our $spotcachedays = 2;                        # default 2 days worth
+our $minselfspotqrg = 1240000; # minimum freq above which self spotting is allowed
 
 our $readback = 1;