remove pc92 A/D first slot if == $mycall
authorDirk Koopman <djk@tobit.co.uk>
Tue, 9 Oct 2007 16:21:59 +0000 (17:21 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 9 Oct 2007 16:21:59 +0000 (17:21 +0100)
also increase the C periodic update time to 4 hours

perl/DXProt.pm
perl/DXProtHandle.pm
perl/DXProtout.pm
perl/Version.pm

index 9903ceb421c744d9b5642d843b7f1e9b99a0af1b..e3a9c52ffeae8a8a60f04e41bc36d7a9e13278e8 100644 (file)
@@ -74,7 +74,7 @@ $obscount = 2;
 $chatdupeage = 20 * 60;
 $chatimportfn = "$main::root/chat_import";
 $pc19_version = 5454;                  # the visible version no for outgoing PC19s generated from pc59
-$pc92_update_period = 2*60*60; # the period between outgoing PC92 C updates
+$pc92_update_period = 4*60*60; # the period between outgoing PC92 C updates
 $pc92_short_update_period = 15*60; # shorten the update period after a connection or start up
 $pc92_extnode_update_period = 1*60*60; # the update period for external nodes
 $pc92_keepalive_period = 1*60*60;      # frequency of PC92 K (keepalive) records
index 7db433e5205f8273c6a00bc5d7f9fbc624a0147f..cd4cdd44cba2f915374fe220b6ba400803b48ccd 100644 (file)
@@ -1677,7 +1677,7 @@ sub handle_92
                # cope with missing duplicate node calls in the first slot for A or D
                my $me = $_[4] || '';
                if (($sort eq 'A' || $sort eq 'D')) {
-                       $me ||= _encode_pc92_call($parent) if !$me ;
+                       $me ||= _encode_pc92_call($parent) unless $me ;
                } else {
                        unless ($me) {
                                dbg("PCPROT: this type of PC92 *must* have a node call in the first slot, ignored") if is_dbg('chanerr');
@@ -1685,7 +1685,7 @@ sub handle_92
                        }
                }
 
-               my @ent = map {[ _decode_pc92_call($_) ]} grep {$_ && /^[0-7]/} $me, @_[5 .. $#_];
+               my @ent = map {my @a = _decode_pc92_call($_); @a ? \@a : ()} grep {$_ && /^[0-7]/} $me, @_[5 .. $#_];
 
                if (@ent) {
 
@@ -1705,7 +1705,7 @@ sub handle_92
                # do a pass through removing any references to either locally connected nodes or mycall
                my @nent;
                for (@ent) {
-                       next unless $_;
+                       next unless $_ && @$_;
                        if ($_->[0] eq $main::mycall || DXChannel::get($_->[0])) {
                                dbg("PCPROT: $_->[0] refers to locally connected node, ignored") if isdbg('chanerr');
                                next;
index 75903f02912e25b2d0c29b808635a8779f799415..5347ce21f5e55768b7daf30001ee97ff626357b2 100644 (file)
@@ -19,9 +19,10 @@ use DXDebug;
 
 use strict;
 
-use vars qw($sentencelth $pc19_version);
+use vars qw($sentencelth $pc19_version $pc9x_nodupe_first_slot);
 
 $sentencelth = 180;
+$pc9x_nodupe_first_slot = 1;
 
 #
 # All the PCxx generation routines
@@ -378,8 +379,12 @@ sub _gen_pc92
        my $sort = shift;
        my $ext = shift;
        my $s = "PC92^$main::mycall^" . gen_pc9x_t() . "^$sort";
+       if ($pc9x_nodupe_first_slot && ($sort eq 'A' || $sort eq 'D') && $_[0]->call eq $main::mycall) {
+               shift;
+               $s .= '^';
+       }
        for (@_) {
-               $s .= "^" . _encode_pc92_call($_, $ext);
+               $s .= '^' . _encode_pc92_call($_, $ext);
                $ext = 0;                               # only the first slot has an ext.
        }
        return $s . '^H99^';
@@ -392,6 +397,10 @@ sub gen_pc92_with_time
        my $t = shift;
        my $ext = 1;
        my $s = "PC92^$call^$t^$sort";
+       if ($pc9x_nodupe_first_slot && ($sort eq 'A' || $sort eq 'D') && $_[0]->call eq $main::mycall) {
+               shift;
+               $s .= '^';
+       }
        for (@_) {
                $s .= "^" . _encode_pc92_call($_, $ext);
        }
index 23503da1f787af246530e8d2198db92a27c55ae1..f371423c1e37c1f5c695f40956eaf5c0068c7e4e 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '165';
+$build = '166';
 
 1;