From: Dirk Koopman Date: Tue, 9 Oct 2007 16:21:59 +0000 (+0100) Subject: remove pc92 A/D first slot if == $mycall X-Git-Tag: 1.55~49 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=b72f2581870f11b7e78ca7add1e9fea856145f02;p=spider.git remove pc92 A/D first slot if == $mycall also increase the C periodic update time to 4 hours --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 9903ceb4..e3a9c52f 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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 diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 7db433e5..cd4cdd44 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -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; diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index 75903f02..5347ce21 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -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); } diff --git a/perl/Version.pm b/perl/Version.pm index 23503da1..f371423c 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '165'; +$build = '166'; 1;