]> dxcluster.net Git - spider.git/commitdiff
change the placing of adding PC9x headers PC90-2 origin/PC90-2 server/PC90-2
authorminima <minima>
Fri, 6 Jun 2003 13:15:12 +0000 (13:15 +0000)
committerminima <minima>
Fri, 6 Jun 2003 13:15:12 +0000 (13:15 +0000)
fix the routing table a bit better

cmd/show/newconfiguration.pl
perl/DXCommandmode.pm
perl/DXProt.pm
perl/Messages
perl/Route.pm

index 6675619131b4eba8aef767c0d5b253110a533538..f1f226eabef0c0fa4a87135cf79246a34460f56a 100644 (file)
@@ -16,6 +16,13 @@ if (@list && $list[0] =~ /^NOD/) {
        shift @list;
 }
 
-push @out, $main::routeroot->config($nodes_only, 0, [], @list);
+# root node
+push @out, $main::mycall;
+
+# now show the config in terms of each of the root nodes view
+foreach my $n ($main::routeroot->links) {
+       my $r = Route::Node::get($n);
+       push @out, $r->config($nodes_only, 1, [], @list) if $r;
+}
 return (1, @out);
 
index 76bfa9314926046d12ed18a00a3221746f497b82..2d2b5deff1560759dc0b9c13be685e52ab30fdb4 100644 (file)
@@ -552,7 +552,10 @@ sub prompt
        if ($self->{prompt}) {
                $self->send($self->{prompt});
        } else {
-               $self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
+               my $prkey = $self->here ? 'pr' : 'pr2';
+               my $mail = DXMsg::for_me($self->call) ? $self->msg('newmail') : "";
+               
+               $self->send($self->msg($prkey, $self->call, cldate($main::systime), ztime($main::systime), $mail));
        }
 }
 
index 1622728d4749760b59080caf41fc5d5698ed07fc..5f778207a76aca0e1e89ecd3bc05d2c4d6bd5a47 100644 (file)
@@ -317,7 +317,14 @@ sub send
        while (@_) {
                my $line = shift;
                if ($self->user->wantpc90) {
-                       $line = mungepc90($line);
+                       my ($pcno) = $line =~ /^PC(\d\d)/;
+                       if ($pcno < 90) {
+                               if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) {
+                                       $line = mungepc91($main::mycall, $line);
+                               } else {
+                                       $line = mungepc90($line);
+                               }
+                       }
                } else {
                        removepc91($line);
                        removepc90($line);
@@ -434,12 +441,6 @@ sub normal
                                return;
                        }
                }
-       } else {
-               if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) {
-                       $line = mungepc91($origin, $line);
-               } else {
-                       $line = mungepc90($line);
-               }
        }
 
        no strict 'subs';
@@ -1017,7 +1018,9 @@ sub handle_19
        # if the origin isn't the same as the INTERFACE, then reparent, creating nodes as necessary
        if ($origin ne $self->call) {
                my $op = Route::Node::get($origin);
-               unless ($op) {
+               if ($op) {
+                       $parent->add($op) unless $parent->haslink($op);
+               } else {
                        $op = $parent->add($origin, 5000, Route::here(1));
                        my $user = DXUser->get_current($origin);
                        if (!$user) {
@@ -1160,10 +1163,13 @@ sub handle_21
                                
                my $parent = Route::Node::get($self->{call});
                unless ($parent) {
-                       dbg("DXPROT: my parent $self->{call} has disappeared");
+                       dbg("DXPROT: my parent $origin has disappeared");
                        $self->disconnect;
                        return;
                }
+               my $or = Route::Node::get($origin) if $origin ne $self->{call};
+               $parent = $or if $or;
+               
                if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
                        my $node = Route::Node::get($call);
                        if ($node) {
index d92efe398956d2bba284857466c429540b3d9d7e..ac355b6768653c01bb8fc780731daf4864b51a93 100644 (file)
@@ -192,6 +192,7 @@ package DXM;
                                namee1 => 'Please enter your name, set/name <your name>',
                                namee2 => 'Can\'t find user $_[0]!',
                                name => 'Your name is now \"$_[0]\"',
+                               newmail => ' (New Mail)',
                                nodea => '$_[0] set as AK1A style Node',
                                nodeac => '$_[0] created as AK1A style Node',
                                nodeb => '$_[0] set as BBS',
@@ -225,8 +226,8 @@ package DXM;
                                pinge1 => 'Cannot ping yourself!',
                                pingint => 'Ping interval on $_[0] set to $_[1] secs',
                                'pos' => 'From Callsign: $_[0] Lat: $_[1] Long: $_[2]',
-                               pr => '$_[0] de $main::mycall $_[1] $_[2] >',
-                               pr2 => '($_[0]) de $main::mycall $_[1] $_[2] >',
+                               pr => '$_[0] de $main::mycall $_[1] $_[2]$_[3] >',
+                               pr2 => '($_[0]) de $main::mycall $_[1] $_[2]$_[3] >',
                                prs => 'Prompt now set to \"$_[0]\"',
                                pru => 'Prompt now set back to default',
                                priv => 'Privilege level changed on $_[0]',
index 79208af4789b5c5d610ad001895286ee089219fa..4e58b02b3894ac32bd435cf125c3b7e98e0b7964 100644 (file)
@@ -189,12 +189,20 @@ sub config
 {
        my $self = shift;
        my $nodes_only = shift;
-       my $level = shift;
+       my $level = shift || 0;
        my $seen = shift;
        my @out;
        my $line;
-       my $call = $self->user_call;
+       my $ucall = $self->user_call;
+       my $call = $self->{call};
        my $printit = 1;
+       
+       return if $level > 1 && DXChannel->get($call);
+
+#      my @seen = @$seen || ();
+#      return if $level > 1 && grep $call eq $_, @seen;
+#      push @seen, @{$self->{links}};
+       
 
        # allow ranges
        if (@_) {
@@ -202,55 +210,32 @@ sub config
        }
 
        if ($printit) {
-               $line = ' ' x ($level*2) . "$call";
-               $call = ' ' x length $call; 
+               $line = ' ' x ($level*3) . "$ucall";
+               push @out, $line;
+#              push @$seen, $call;
                
-               # recursion detector
-               if ((DXChannel->get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
-                       $line .= ' ...';
-                       push @out, $line;
-                       return @out;
-               }
-               push @$seen, $self->{call};
-
-               # print users
-               unless ($nodes_only) {
-                       if (@{$self->{users}}) {
-                               $line .= '->';
-                               foreach my $ucall (sort @{$self->{users}}) {
-                                       my $uref = Route::User::get($ucall);
-                                       my $c;
-                                       if ($uref) {
-                                               $c = $uref->user_call;
-                                       } else {
-                                               $c = "$ucall?";
-                                       }
-                                       if ((length $line) + (length $c) + 1 < 79) {
-                                               $line .= $c . ' ';
-                                       } else {
-                                               $line =~ s/\s+$//;
-                                               push @out, $line;
-                                               $line = ' ' x ($level*2) . "$call->$c ";
-                                       }
+               foreach my $ncall (sort @{$self->{links}}) {
+                       my $nref = Route::Node::get($ncall);
+                       
+                       if ($nref) {
+                               my $c = $nref->user_call;
+                               dbg("recursing from $call -> $c (" . (join ',', @$seen) . ")") if isdbg('routec');
+                               
+                               unless (grep $ncall eq $_, @$seen) {
+#                                      push @seen, $call;
+                                       push @$seen, $ncall;
+                                       push @out, $nref->config($nodes_only, $level+1, $seen, @_);
+#                                      pop @$seen;
+#                                      pop @seen;
+                               } else {
+#                                      $line .= "->$ncall" if $line !~ $ncall;
+#                                      push @out, $line;
                                }
+                       } else {
+                               push @out, ' ' x (($level+1)*2)  . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_); 
                        }
                }
-               $line =~ s/->$//g;
-               $line =~ s/\s+$//;
-               push @out, $line if length $line;
-       }
-       
-       # deal with more nodes
-       foreach my $ncall (sort @{$self->{links}}) {
-               my $nref = Route::Node::get($ncall);
-
-               if ($nref) {
-                       my $c = $nref->user_call;
-#                      dbg("recursing from $call -> $c") if isdbg('routec');
-                       push @out, $nref->config($nodes_only, $level+1, $seen, @_);
-               } else {
-                       push @out, ' ' x (($level+1)*2)  . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_); 
-               }
+#              pop @$seen;
        }
 
        return @out;
@@ -373,6 +358,13 @@ sub _dellink
     return $self->_dellist('links', @_);
 }
 
+sub haslink
+{
+       my $self = shift;
+       my $other = shift->{call};
+       return grep $other eq $_, @{$self->{links}};
+}
+
 #
 # track destruction
 #