fix console.pl max scroll depth
[spider.git] / cmd / init.pl
index bfcb9bd290a2bca678bc7694cd34e260f8951367..5329780370e7302a2ff15f492fc38c5407a6f30c 100644 (file)
@@ -1,5 +1,9 @@
 #
-# reinit a cluster connection
+# init a cluster connection
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+#
 #
 my ($self, $line) = @_;
 my @calls = split /\s+/, $line;
@@ -11,19 +15,15 @@ return (1, $self->msg('e5')) if $self->priv < 5;
 foreach $call (@calls) {
        $call = uc $call;
        next if $call eq $main::mycall;
-       my $dxchan = DXChannel->get($call);
+       my $dxchan = DXChannel::get($call);
        if ($dxchan) {
-               if ($dxchan->is_ak1a) {
-                       
+               if ($dxchan->is_node) {
                        # first clear out any nodes on this dxchannel
-                       my @gonenodes = map { $_->dxchan == $dxchan ? $_ : () } DXNode::get_all();
-                       foreach my $node (@gonenodes) {
-                               next if $dxchan == $DXProt::me;
-                               DXProt::broadcast_ak1a(DXProt::pc21($node->call, 'Gone, re-init') , $dxchan) unless $dxchan->{isolate}; 
-                               $node->del();
-                       }
-                       $dxchan->send(DXProt::pc38());
+                       my $parent = Route::Node::get($call);
+                       my @rout = $parent->del_nodes;
+                       $dxchan->route_pc21(undef, $self, @rout) if @rout;
                        $dxchan->send(DXProt::pc18());
+                       $dxchan->state('init');
                        push @out, $self->msg('init1', $call);
                } 
        } else {