From 70908cf7f69eb4fc0caf5d735382bc2c1c1466a3 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 5 Jul 2002 14:33:29 +0000 Subject: [PATCH] version with the 'final' version of PC90 line in it --- perl/DXChannel.pm | 2 ++ perl/DXProt.pm | 28 +++++++++++++++++++++------- perl/DXProtout.pm | 15 +++++++++------ perl/DXUser.pm | 2 ++ 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 6ded9e8e..e126bc4c 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -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); diff --git a/perl/DXProt.pm b/perl/DXProt.pm index fc55f42d..f68edc27 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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; diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index cacf60e0..38ace99b 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -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; } diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 316b7fad..277b2a5f 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -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; -- 2.43.0