]> dxcluster.org Git - spider.git/commitdiff
version with the 'final' version of PC90 line in it
authorminima <minima>
Fri, 5 Jul 2002 14:33:29 +0000 (14:33 +0000)
committerminima <minima>
Fri, 5 Jul 2002 14:33:29 +0000 (14:33 +0000)
perl/DXChannel.pm
perl/DXProt.pm
perl/DXProtout.pm
perl/DXUser.pm

index 6ded9e8efa9ab7e7ead5201c88a063822f791509..e126bc4c05e6fd258c584c8028556e4c8ae5ea3c 100644 (file)
@@ -110,6 +110,8 @@ $count = 0;
                  edit => '7,Edit Function',
                  registered => '9,Registered?,yesno',
                  prompt => '0,Required Prompt',
+                 version => '1,Node Version',
+                 build => '1,Node Build',
                 );
 
 use vars qw($VERSION $BRANCH);
index fc55f42d6ef869448373e2272eaadcbce2ef553d..f68edc275bde45c1afe95bb67346136bcda02d76 100644 (file)
@@ -196,7 +196,9 @@ sub init
        $main::me->{priv} = 9;
        $main::me->{metric} = 0;
        $main::me->{pingave} = 0;
-       
+       $main::me->{version} = $main::version;
+       $main::me->{build} = $main::build;
+               
 #      $Route::Node::me->adddxchan($main::me);
 }
 
@@ -739,6 +741,23 @@ sub normal
                if ($pcno == 18) {              # link request
                        $self->state('init');   
 
+                       # record the type and version offered
+                       if ($field[1] =~ /DXSpider Version: (\d+\.\d+) Build: (\d+\.\d+)/) {
+                               $self->version(53 + $1);
+                               $self->user->version(53 + $1);
+                               $self->build(0 + $2);
+                               $self->user->build(0 + $2);
+                               unless ($self->is_spider) {
+                                       $self->user->sort('S');
+                                       $self->user->put;
+                                       $self->sort('S');
+                               }
+                       } else {
+                               $self->version(50.0);
+                               $self->version($field[2] / 100) if $field[2] && $field[2] =~ /^\d+$/;
+                               $self->user->version($self->version);
+                       }
+
                        # first clear out any nodes on this dxchannel
                        my $parent = Route::Node::get($self->{call});
                        my @rout = $parent->del_nodes;
@@ -1168,11 +1187,6 @@ sub normal
                                                                        } else {
                                                                                $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 6);
                                                                        }
-#                                                                      my $st;
-#                                                                      for (@{$tochan->{pingtime}}) {
-#                                                                              $st += $_;
-#                                                                      }
-#                                                                      $tochan->{pingave} = $st / @{$tochan->{pingtime}};
                                                                        $tochan->{nopings} = $nopings; # pump up the timer
                                                                }
                                                        } 
@@ -1585,7 +1599,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 && !$self->user->wantpc90;
+               @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan if @dxchan;
                my @intcalls = map { $_->nodes } @localnodes if @localnodes;
                my $ref = Route::Node::get($self->{call});
                my @rnodes = $ref->nodes;
index cacf60e0c756a67612452ab192bb07c50be157c6..38ace99bf1cb2ac9e379943a31805f58c23582e1 100644 (file)
@@ -367,27 +367,30 @@ sub pc90
        my $sort = shift;
        my @out;
        my $dxchan;
-       my $n = @_;
        
        while (@_) {
-               my $str = sprintf "PC90^%s^%X^%s%d", $node->call, $main::systime, $sort, $n-1 ;
-               for (; @_ && length $str < 200;) {
+               my $str = '';
+               for (; @_ && length $str <= 230;) {
                        my $ref = shift;
-                       next if $ref == $main::me;
                        my $call = $ref->call;
                        my $flag = 0;
+                       
                        $flag += 1 if $ref->here;
                        $flag += 2 if $ref->conf;
                        if ($ref->is_node) {
                                my $ping = int($ref->pingave * 10);
                                $str .= "^N$flag$call,$ping";
+                               my $v = $ref->build || $ref->version;
+                               $str .= ",$v" if defined $v;
                        } else {
                                $str .= "^U$flag$call";
                        }
                }
-               $str .= sprintf "^%s^", get_hops(90);
-               push @out, $str;
+               push @out, $str if $str;
        }
+       my $n = @out;
+       my $h = get_hops(90);
+       @out = map { sprintf "PC90^%s^%X^%s%d%s^%s^", $node->call, $main::systime, $sort, --$n, $_, $h } @out;
        return @out;
 }
 
index 316b7fad2b74505a55c7f7e5a447bfdfee8e555f..277b2a5f4d7ae89354078156d42a9e050f217057 100644 (file)
@@ -77,6 +77,8 @@ $lasttime = 0;
                  nothere => '0,Not Here Text',
                  registered => '9,Registered?,yesno',
                  prompt => '0,Required Prompt',
+                 version => '1,Version',
+                 build => '1,Build',
                 );
 
 no strict;