From a8f8fe60a63b000f22897696fb127fc856c41cb7 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 8 Jun 2001 17:49:50 +0000 Subject: [PATCH] fix a load of missing things remove the rest of the significant DXCluster references in the commands --- cmd/set/here.pl | 30 +++++++++++++++++++----------- cmd/show/cluster.pl | 2 +- cmd/show/node.pl | 10 ++++++---- cmd/show/route.pl | 6 ++++-- cmd/show/station.pl | 5 ++--- cmd/unset/here.pl | 31 ++++++++++++++++++++----------- perl/DXMsg.pm | 15 +++++++++++---- perl/DXProt.pm | 12 +++++++----- 8 files changed, 70 insertions(+), 41 deletions(-) diff --git a/cmd/set/here.pl b/cmd/set/here.pl index 114533ef..e3d56f3e 100644 --- a/cmd/set/here.pl +++ b/cmd/set/here.pl @@ -14,17 +14,25 @@ my @out; @args = $self->call if (!@args || $self->priv < 9); foreach $call (@args) { - $call = uc $call; - my $dxchan = DXChannel->get($call); - my $ref = DXCluster->get_exact($call); - if ($dxchan && $ref) { - $dxchan->here(1); - $ref->here(1); - DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me); - push @out, $self->msg('heres', $call); - } else { - push @out, $self->msg('e3', "Set Here", $call); - } + $call = uc $call; + my $dxchan = DXChannel->get($call); + my $ref = Route::User::get($call); + if ($dxchan) { + $dxchan->here(1); + push @out, $self->msg('heres', $call); + if ($ref) { + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ; + $ref->here(1); + } elsif ($ref = Route::Node::get($call)) { + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ; + $ref->here(1); + } else { + $ref = Route::Node::get($call); + $ref->here(1) if $ref; + } + } else { + push @out, $self->msg('e3', "Set Here", $call); + } } return (1, @out); diff --git a/cmd/show/cluster.pl b/cmd/show/cluster.pl index 6fe9b356..066ef7bf 100644 --- a/cmd/show/cluster.pl +++ b/cmd/show/cluster.pl @@ -1,4 +1,4 @@ # # show some statistics # -return (1, DXCluster::cluster() ); +return (1, Route::cluster() ); diff --git a/cmd/show/node.pl b/cmd/show/node.pl index d45cad36..53a974ca 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -24,8 +24,8 @@ my @out; my $count; # search thru the user for nodes -unless (@call) { - +if ($call[0] eq 'ALL') { + shift @call; my ($action, $key, $data) = (0,0,0); for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { if ($data =~ m{sort => '[ACRSX]'}) { @@ -33,11 +33,13 @@ unless (@call) { ++$count; } } +} elsif (@call == 0) { + @call = map {$_->call} DXChannel::get_all_nodes(); } my $call; foreach $call (@call) { - my $clref = DXCluster->get_exact($call); + my $clref = Route::Node::get($call); my $uref = DXUser->get_current($call); my ($sort, $ver); @@ -60,7 +62,7 @@ foreach $call (@call) { $sort = "Spider"; $ver = $main::version; } else { - $ver = $clref->pcversion if $clref && $clref->pcversion; + $ver = $clref->version if $clref && $clref->version; } my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver; diff --git a/cmd/show/route.pl b/cmd/show/route.pl index 95497d2d..45214003 100644 --- a/cmd/show/route.pl +++ b/cmd/show/route.pl @@ -14,9 +14,11 @@ return (1, $self->msg('e6')) unless @list; my $l; foreach $l (@list) { - my $ref = DXCluster->get_exact($l); + my $ref = Route::get($l); if ($ref) { - push @out, $self->msg('route', $l, $ref->mynode->call, $ref->dxchan->call); + my $parents = join ',', $ref->parents; + my $dxchan = $ref->dxchan; + push @out, $self->msg('route', $l, $parents, $dxchan->call); } else { push @out, $self->msg('e7', $l); } diff --git a/cmd/show/station.pl b/cmd/show/station.pl index 4aadd222..b5b0f6c5 100644 --- a/cmd/show/station.pl +++ b/cmd/show/station.pl @@ -59,9 +59,8 @@ if (@f == 0) { $miles = $dx * 0.62133785; } - my $cref = DXCluster->get_exact($call); - $cref = DXCluster->get($call) unless $cref; - my $seek = $cref->mynode->call if $cref; + my $cref = Route::get($call); + my $seek = join(',', $cref->parents) if $cref; if ($seek) { push @out, "User : $call (at $seek)"; diff --git a/cmd/unset/here.pl b/cmd/unset/here.pl index 6666d4e7..63a32162 100644 --- a/cmd/unset/here.pl +++ b/cmd/unset/here.pl @@ -14,16 +14,25 @@ my @out; @args = $self->call if (!@args || $self->priv < 9); foreach $call (@args) { - $call = uc $call; - my $dxchan = DXChannel->get($call); - my $ref = DXCluster->get_exact($call); - if ($dxchan && $ref) { - $dxchan->here(0); - $ref->here(0); - DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me); - push @out, $self->msg('hereu', $call); - } else { - push @out, $self->msg('e3', "Unset Here", $call); - } + $call = uc $call; + my $dxchan = DXChannel->get($call); + my $ref = Route::User::get($call); + if ($dxchan) { + $dxchan->here(0); + push @out, $self->msg('hereu', $call); + if ($ref) { + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ; + $ref->here(0); + } elsif ($ref = Route::Node::get($call)) { + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ; + $ref->here(0); + } else { + $ref = Route::Node::get($call); + $ref->here(0) if $ref; + } + } else { + push @out, $self->msg('e3', "Unset Here", $call); + } } + return (1, @out); diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 3063948a..e27bf802 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -612,10 +612,17 @@ sub queue_msg # my $hnode = $uref->homenode if $uref; # $clref = Route::Node::get($hnode) if $hnode; # } - if ($clref && !grep { $clref->dxchan == $_ } DXCommandmode::get_all()) { - next if $clref->call eq $main::mycall; # i.e. it lives here - $dxchan = $clref->dxchan; - $ref->start_msg($dxchan) if $dxchan && !get_busy($dxchan->call) && $dxchan->state eq 'normal'; + if ($clref) { + my $dxc = $clref->dxchan; + if ($dxc) { + if (grep {my $dxc=$clref->dxchan; $dxc && $dxc == $_ } DXCommandmode::get_all()) { + next if $clref->call eq $main::mycall; # i.e. it lives here + $dxchan = $clref->dxchan; + $ref->start_msg($dxchan) if $dxchan && !get_busy($dxchan->call) && $dxchan->state eq 'normal'; + } + } else { + dbg('route', "Route: No dxchan for $ref->{to} " . ref($clref) ); + } } } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 06cf1007..813b89ce 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -431,11 +431,13 @@ sub normal if ($to ne $field[7]) { $to = $field[7]; $node = Route::Node::get($to); - $dxchan = $node->dxchan; - if ($node->dxchan && $dxchan->is_clx) { - route(undef, $to, pc84($main::mycall, $to, $main::mycall, $cmd)); - } else { - route(undef, $to, pc34($main::mycall, $to, $cmd)); + if ($node) { + $dxchan = $node->dxchan; + if ($dxchan && $dxchan->is_clx) { + route(undef, $to, pc84($main::mycall, $to, $main::mycall, $cmd)); + } else { + route(undef, $to, pc34($main::mycall, $to, $cmd)); + } } } $user->lastoper($main::systime); -- 2.43.0