X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=fc55f42d6ef869448373e2272eaadcbce2ef553d;hb=47d4f39bfd5d0f331c7693c88c1d7842cf9f6548;hp=ba79e43e0419ffab6a528e62123ba5ae41886929;hpb=89643eba546b3cda9ba83a527919fad79651b858;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index ba79e43e..fc55f42d 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -356,7 +356,9 @@ sub normal } # if this is a 'bad spotter' user then ignore it - if ($badspotter->in($from)) { + my $nossid = $from; + $nossid =~ s/-\d+$//; + if ($badspotter->in($nossid)) { dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr'); return; } @@ -420,7 +422,9 @@ sub normal } # if this is a 'bad spotter' user then ignore it - if ($badspotter->in($field[6])) { + my $nossid = $field[6]; + $nossid =~ s/-\d+$//; + if ($badspotter->in($nossid)) { dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr'); return; } @@ -568,7 +572,9 @@ sub normal } # if this is a 'bad spotter' user then ignore it - if ($badspotter->in($field[1])) { + my $nossid = $field[1]; + $nossid =~ s/-\d+$//; + if ($badspotter->in($nossid)) { dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr'); return; } @@ -1229,6 +1235,27 @@ sub normal if ($pcno == 85) { # remote command replies $self->process_rcmd_reply($field[1], $field[2], $field[3], $field[4]); + return; + } + if ($pcno == 90) { # new style PC16,17,19,21 + my $node = $field[1]; + + # mark this node as wanting PC90s + my $parent = Route::Node::get($node); + if ($parent) { + my $t = hex $field[2]; + my $last = $parent->lastpc90 || 0; + if ($last < $t) { + $parent->pc90(1); + $parent->lastpc90($t); + my ($updsort, $n) = unpack "AA*", $field[3]; + for (my $i = 4; $i < $#field; $i++) { + my ($sort, $flag, $node, $ping) = $field[$i] =~ m{(\w)(\d)([-\w+])(,\d+)?}; + $ping /= 10 if (defined $ping); + } + } + } + return; } } @@ -1272,8 +1299,12 @@ sub process next unless $dxchan->is_node(); next if $dxchan == $main::me; - # send the pc50 - $dxchan->send($pc50s) if $pc50s; + # send the pc50 or PC90 + if ($pc50s && $dxchan->user->wantpc90) { + $dxchan->send_route(\&pc90, 1, $main::me, 'T', @dxchan); + } else { + $dxchan->send($pc50s) if $pc50s; + } # send a ping out on this channel if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) { @@ -1309,6 +1340,7 @@ sub process # some active measures # + sub send_dx_spot { my $self = shift; @@ -1553,7 +1585,7 @@ sub send_local_config # and are not themselves isolated, this to make sure that isolated nodes # don't appear outside of this node my @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} } DXChannel::get_all_nodes(); - @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan if @dxchan; + @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan if @dxchan && !$self->user->wantpc90; my @intcalls = map { $_->nodes } @localnodes if @localnodes; my $ref = Route::Node::get($self->{call}); my @rnodes = $ref->nodes; @@ -1563,6 +1595,7 @@ sub send_local_config unshift @localnodes, $main::routeroot; } + send_route($self, \&pc19, scalar(@localnodes)+scalar(@remotenodes), @localnodes, @remotenodes); # get all the users connected on the above nodes and send them out @@ -1573,6 +1606,7 @@ sub send_local_config dbg("sent a null value") if isdbg('chanerr'); } } + $self->send_route(\&pc90, 1, $main::me, 'T', DXChannel::get_all()) if $self->user->wantpc90; } # @@ -1939,6 +1973,12 @@ sub route_pc50 broadcast_route($self, \&pc50, 1, @_); } +sub route_pc90 +{ + my $self = shift; + broadcast_route($self, \&pc90, 1, @_); +} + sub in_filter_route { my $self = shift;