version with the 'final' version of PC90 line in it

This commit is contained in:
minima 2002-07-05 14:33:29 +00:00
parent 47d4f39bfd
commit 70908cf7f6
4 changed files with 34 additions and 13 deletions

View 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);

View File

@ -196,6 +196,8 @@ 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;

View 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;
}

View 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;