spider/cmd/ping.pl
Dirk Koopman c1540ccd79 New improved route finding algorithm
This is what Changes says:

Change the route finding algorithm completely. No more recursion. No more
tree searching. It now gives you answers even on a partial cluster map. Oh
and the answers are correct, instead on completely random.

Also completely remove RouteDB from the equation.
Also change sh/newc to default to node map rather than node+user map.
2008-06-24 19:36:57 +01:00

33 lines
585 B
Perl

#
# ping command
#
# Copyright (c) 1998 Dirk Koopman G1TLH
#
#
#
my $self = shift;
my $line = uc shift; # only one callsign allowed
my ($call) = $line =~ /^\s*(\S+)/;
# are we permitted?
return (1, $self->msg('e5')) if $self->priv < 1;
# is there a call?
return (1, $self->msg('e6')) if !$call;
# is it me?
return (1, $self->msg('pinge1')) if $call eq $main::mycall;
# can we see it? Is it a node?
my $noderef = Route::Node::get($call);
return (1, $self->msg('e7', $call)) unless $noderef;
# ping it
DXXml::Ping::add($self, $call);
return (1, $self->msg('pingo', $call));