]> scm.dxcluster.org Git - spider.git/commitdiff
staging init
authorDirk Koopman <djk@tobit.co.uk>
Sat, 31 Dec 2022 16:21:27 +0000 (16:21 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 31 Dec 2022 16:21:27 +0000 (16:21 +0000)
Including:

new spot regex positioning
fix DXProtVar.pm to prevent default rehopping of PC61 & PC11

perl/DXCommandmode.pm
perl/DXProtHandle.pm
perl/DXProtVars.pm

index 90812225dfe772c4bd8b2671f6ff3600bc70a521..006d8d9dfb9c70bd43c06e635748c3a5a2a745ac 100644 (file)
@@ -401,12 +401,12 @@ sub normal
                }
                $self->send_ans(@ans);
        } else {
-#              if (@bad = BadWords::check($cmdline)) {
-#                      $self->badcount(($self->badcount||0) + @bad);
-#                      LogDbg('DXCommand', "$self->{call} swore: '$cmdline' with badwords: '" . join(',', @bad) . "'");
-#              } else {
+               if (@bad = BadWords::check($cmdline)) {
+                       $self->badcount(($self->badcount||0) + @bad);
+                       LogDbg('DXCommand', "$self->{call} swore: '$cmdline' with badwords: '" . join(',', @bad) . "'");
+               } else {
                        $self->send_ans(run_cmd($self, $cmdline));
-#              }
+               }
        } 
 
        # check for excessive swearing
index a6668a36db0daeef1752d86b796d4dcaf7d82e18..efc6c159abd5414d5c3aff2b67abe3195a634870 100644 (file)
@@ -89,16 +89,6 @@ sub handle_10
                return;
        }
 
-       # will we allow it at all?
-       if ($censorpc) {
-               my @bad;
-               if (@bad = BadWords::check($pc->[3])) {
-                       my $bw = join ', ', @bad; 
-                       dbg($line) if isdbg('nologchan');
-                       dbg("PCPROT: Badwords: '$bw', dropped");
-                       return;
-               }
-       }
 
        # is it for me or one of mine?
        my ($from, $to, $via, $call, $dxchan);
@@ -133,6 +123,17 @@ sub handle_10
                        return;
                }
        }
+       
+       # will we allow it at all?
+       if ($censorpc) {
+               my @bad;
+               if (@bad = BadWords::check($pc->[3])) {
+                       my $bw = join ', ', @bad; 
+                       dbg($line) if isdbg('nologchan');
+                       dbg("PCPROT: Badwords: '$bw', dropped");
+                       return;
+               }
+       }
 
        # convert this to a PC93, coming from mycall with origin set and process it as such
        $main::me->normal(pc93($to, $from, $via, $pc->[3], $pc->[6]));
@@ -213,10 +214,8 @@ sub handle_11
        }
 
        # is it 'baddx'
-       if ($baddx->in($pc->[2]) || (my @bad = BadWords::check($pc->[2]))) {
-               my $bw = join ', ', @bad;
-               $bw = qq{ '$bw'} if $bw;
-               dbg("PCPROT: Bad DX spot$bw, ignored");
+       if ($baddx->in($pc->[2])) {
+               dbg("PCPROT: Bad DX spot '$pc->[2]', ignored");
                return;
        }
 
@@ -227,15 +226,6 @@ sub handle_11
                dbg("PCPROT: useless 'BUSTED' spot") if isdbg('chanerr');
                return;
        }
-       if ($censorpc) {
-               my @bad;
-               if (@bad = BadWords::check($pc->[5])) {
-                       my $bw = join ', ', @bad;
-                       dbg($line) if isdbg('nologchan');
-                       dbg("PCPROT: Badwords: '$bw', dropped");
-                       return;
-               }
-       }
        
 
        my @spot = Spot::prepare($pc->[1], $pc->[2], $d, $pc->[5], $nossid, $pc->[7], $pc->[8]);
@@ -334,6 +324,18 @@ sub handle_11
                }
        }
 
+# we until here to do any censorship to try and reduce the amount of noise that repeated copies
+# from other connected nodes cause
+       if ($censorpc) {
+               my @bad;
+               if (@bad = BadWords::check($pc->[5])) {
+                       my $bw = join ', ', @bad;
+                       dbg($line) if isdbg('nologchan');
+                       dbg("PCPROT: Badwords: '$bw', dropped");
+                       return;
+               }
+       }
+
        # If is a new PC11, store it, releasing the one that is there (if any),
        # if a PC61 comes along then dump the stored PC11
        # If there is a different PC11 stored, release that one and store this PC11 instead,
@@ -448,16 +450,6 @@ sub handle_12
        # announce duplicate checking
        $pc->[3] =~ s/^\s+//;                   # remove leading blanks
 
-       if ($censorpc) {
-               my @bad;
-               if (@bad = BadWords::check($pc->[3])) {
-                       my $bw = join ', ', @bad;
-                       dbg($line) if isdbg('nologchan');
-                       dbg("PCPROT: Badwords: '$bw', dropped");
-                       return;
-               }
-       }
-
        # if this is a 'nodx' node then ignore it
        if ($badnode->in($pc->[5])) {
                dbg($line) if isdbg('nologchan');
@@ -481,6 +473,17 @@ sub handle_12
                return;
        }
 
+       if ($censorpc) {
+               my @bad;
+               if (@bad = BadWords::check($pc->[3])) {
+                       my $bw = join ', ', @bad;
+                       dbg($line) if isdbg('nologchan');
+                       dbg("PCPROT: Badwords: '$bw', dropped");
+                       return;
+               }
+       }
+
+
        my $dxchan;
 
        if ((($dxchan = DXChannel::get($pc->[2])) && $dxchan->is_user) || $pc->[4] =~ /^[\#\w.]+$/){
@@ -2268,17 +2271,6 @@ sub handle_93
                my $s = "ANNTALK: $from\@$onode$vs -> $to '$text' route: $origin";
                dbg($s);
        }
-       
-       # will we allow it at all?
-       if ($censorpc) {
-               my @bad;
-               if (@bad = BadWords::check($text)) {
-                       my $bw = join ', ', @bad;
-                       dbg($line) if isdbg('nologchan');
-                       dbg("PCPROT: Badwords: '$bw', dropped");
-                       return;
-               }
-       }
 
        # if this is a 'bad spotter' user then ignore it
        my $nossid = $from;
@@ -2295,6 +2287,17 @@ sub handle_93
                return;
        }
 
+       # will we allow it at all?
+       if ($censorpc) {
+               my @bad;
+               if (@bad = BadWords::check($text)) {
+                       my $bw = join ', ', @bad;
+                       dbg($line) if isdbg('nologchan');
+                       dbg("PCPROT: Badwords: '$bw', dropped");
+                       return;
+               }
+       }
+
        # if it is routeable then then treat it like a talk
        my $ref = Route::get($to);
        if ($ref) {
index ae192bcff38d83b6c4dec4c76029dd293507a44c..abb9fba4087a255d487262ee38d474a137659795 100644 (file)
@@ -2,6 +2,8 @@
 #
 # These are various values used by the AK1A protocol stack
 #
+# Copy this file to /spider/local before use!
+#
 # Change these at your peril (or if you know what you are doing)!
 #
 # Copyright (c) 1998 - Dirk Koopman G1TLH
@@ -22,11 +24,10 @@ $def_hopcount = 30;
 
 # some variable hop counts based on message type
 %hopcount = (
-  11 => 25,
-  16 => 25,
-  17 => 25,
-  19 => 25,
-  21 => 25,
+  16 => 15,
+  17 => 15,
+  19 => 15,
+  21 => 15,
 );
 
 # list of nodes we don't accept dx from