1. tidy up AUTOLOAD
[spider.git] / perl / DXProt.pm
index f0fe0c6e71b8a82e0813637969d70020997fec00..53bd418ba6fc63e7dc7d627f788a8a74c750a94f 100644 (file)
@@ -44,6 +44,7 @@ $main::branch += $BRANCH;
 
 use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restime $eph_pc34_restime
                        $last_hour $last10 %eph  %pings %rcmds $ann_to_talk
+                       $pingint $obscount
                        %nodehops $baddx $badspotter $badnode $censorpc $rspfcheck
                        $allowzero $decode_dk0wcy $send_opernam @checklist);
 
@@ -65,6 +66,8 @@ $rspfcheck = 1;
 $eph_restime = 180;
 $eph_info_restime = 60*60;
 $eph_pc34_restime = 30;
+$pingint = 5*60;
+$obscount = 2;
 
 @checklist = 
 (
@@ -255,9 +258,9 @@ sub start
        
        # ping neighbour node stuff
        my $ping = $user->pingint;
-       $ping = 5*60 unless defined $ping;
+       $ping = $pingint unless defined $ping;
        $self->{pingint} = $ping;
-       $self->{nopings} = $user->nopings || 2;
+       $self->{nopings} = $user->nopings || $obscount;
        $self->{pingtime} = [ ];
        $self->{pingave} = 999;
        $self->{metric} ||= 100;
@@ -1604,9 +1607,8 @@ sub send_local_config
        # get all the users connected on the above nodes and send them out
        foreach $node (@localnodes, @remotenodes) {
                if ($node) {
-                       $self->send_route(\&pc16, 1, $node, 
-                                                         map {my $r = Route::User::get($_); $r ? ($r) : ()} $node->users)
-                               if $self->user->wantsendpc16;
+                       my @rout = map {my $r = Route::User::get($_); $r ? ($r) : ()} $node->users;
+                       $self->send_route(\&pc16, 1, $node, @rout) if @rout && $self->user->wantsendpc16;
                } else {
                        dbg("sent a null value") if isdbg('chanerr');
                }
@@ -1703,7 +1705,7 @@ sub load_hops
        return $self->msg('lh1') unless -e "$main::data/hop_table.pl";
        do "$main::data/hop_table.pl";
        return $@ if $@;
-       return 0;
+       return ();
 }