+13Mar05=======================================================================
+1. There has been a mix up in the Aranea1 branch. I have managed to merge a
+change that I have been meaning to do for ages. I have now made that change
+here.
27Feb05=======================================================================
1. fix duping on bad spot suckers that copy the prefix that is put at the end
of the comment section by AR-C nodes becoming the whole comment.
# set up the basic channel info
# is there one already connected to me - locally?
my $user = DXUser->get_current($call);
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
if ($dxchan) {
if ($main::bumpexisting) {
my $ip = $conn->{peerhost} || 'unknown';
}
}
-# obtain a channel object by callsign [$obj = DXChannel->get($call)]
+# obtain a channel object by callsign [$obj = DXChannel::get($call)]
sub get
{
- my ($pkg, $call) = @_;
+ my $call = shift;
return $channels{$call};
}
sub process
{
my $t = time;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
foreach $dxchan (@dxchan) {
my $pkg = shift; # ignored
my $s = shift; # the line to be rebroadcast
- foreach my $dxchan (DXChannel->get_all()) {
+ foreach my $dxchan (DXChannel::get_all()) {
next unless $dxchan->{sort} eq 'U'; # only interested in user channels
next if grep $dxchan == $_, @_;
$dxchan->send($s); # send it
# gimme all the users
sub get_all
{
- return grep {$_->{sort} eq 'U'} DXChannel->get_all();
+ return grep {$_->{sort} eq 'U'} DXChannel::get_all();
}
# run a script for this user
{
my $s = shift; # the line to be rebroadcast
- foreach my $dxchan (DXChannel->get_all) {
+ foreach my $dxchan (DXChannel::get_all) {
next unless $dxchan->{enhanced} && $dxchan->{senddbg};
$dxchan->send_later('L', $s);
}
sub connected
{
my $call = uc shift;
- return DXChannel->get($call);
+ return DXChannel::get($call);
}
# is it remotely connected anywhere (with exact callsign)?
sub last_connect
{
my $call = uc shift;
- return $main::systime if DXChannel->get($call);
+ return $main::systime if DXChannel::get($call);
my $user = DXUser->get($call);
return $user ? $user->lastin : 0;
}
# incoming DB Information
my $n = getstream($_[3]);
if ($n) {
- my $mchan = DXChannel->get($n->{call});
+ my $mchan = DXChannel::get($n->{call});
$mchan->send($_[2] . ":$_[4]") if $mchan;
}
}
my $ref = shift;
my $to = $ref->{to};
my $uref = DXUser->get_current($to);
- my $dxchan = DXChannel->get($to);
+ my $dxchan = DXChannel::get($to);
if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) {
my $email = $uref->email;
if ($email) {
# RouteDB::update($to, $_[6]);
# it is here and logged on
- $dxchan = DXChannel->get($main::myalias) if $to eq $main::mycall;
- $dxchan = DXChannel->get($to) unless $dxchan;
+ $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
+ $dxchan = DXChannel::get($to) unless $dxchan;
if ($dxchan && $dxchan->is_user) {
$_[3] =~ s/\%5E/^/g;
$dxchan->talk($from, $to, $via, $_[3]);
my $dxchan;
- if ((($dxchan = DXChannel->get($_[2])) && $dxchan->is_user) || $_[4] =~ /^[\#\w.]+$/){
+ if ((($dxchan = DXChannel::get($_[2])) && $dxchan->is_user) || $_[4] =~ /^[\#\w.]+$/){
$self->send_chat($line, @_[1..6]);
} elsif ($_[2] eq '*' || $_[2] eq $main::mycall) {
}
}
$user->wantroutepc19(1) unless defined $wantpc19; # for now we work on the basis that pc16 = real route
- $user->lastin($main::systime) unless DXChannel->get($ncall);
+ $user->lastin($main::systime) unless DXChannel::get($ncall);
$user->put;
# route the pc19 - this will cause 'stuttering PC19s' for a while
$user = DXUser->new($call) if !$user;
$user->homenode($parent->call) if !$user->homenode;
$user->node($parent->call);
- $user->lastin($main::systime) unless DXChannel->get($call);
+ $user->lastin($main::systime) unless DXChannel::get($call);
$user->put;
}
$self->route_pc16($origin, $line, $parent, @rout) if @rout;
next if $call eq $main::mycall;
# check that this PC19 isn't trying to alter the wrong dxchan
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
if ($dxchan && $dxchan != $self) {
dbg("PCPROT: PC19 from $self->{call} trying to alter wrong locally connected $call, ignored!") if isdbg('chanerr');
next;
my $mref = DXMsg::get_busy($call);
$mref->stop_msg($call) if $mref;
- $user->lastin($main::systime) unless DXChannel->get($call);
+ $user->lastin($main::systime) unless DXChannel::get($call);
$user->put;
}
my $node = Route::Node::get($call);
if ($node) {
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
if ($dxchan && $dxchan != $self) {
dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chanerr');
return;
# it's a reply, look in the ping list for this one
my $ref = $pings{$from};
if ($ref) {
- my $tochan = DXChannel->get($from);
+ my $tochan = DXChannel::get($from);
while (@$ref) {
my $r = shift @$ref;
- my $dxchan = DXChannel->get($r->{call});
+ my $dxchan = DXChannel::get($r->{call});
next unless $dxchan;
my $t = tv_interval($r->{t}, [ gettimeofday ]);
if ($dxchan->is_user) {
sub process
{
my $t = time;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
my $pc50s;
{
my $self = shift;
my $line = shift;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
# send it if it isn't the except list and isn't isolated and still has a hop count
{
my $self = shift;
my $line = shift;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
my @dxcc = ((Prefix::cty_data($_[6]))[0..2], (Prefix::cty_data($_[7]))[0..2]);
{
my $self = shift;
my $line = shift;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
my @dxcc = ((Prefix::cty_data($_[10]))[0..2], (Prefix::cty_data($_[11]))[0..2]);
{
my $self = shift;
my $line = shift;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
my $target;
my $to = 'To ';
{
my $self = shift;
my $line = shift;
- my @dxchan = DXChannel->get_all();
+ my @dxchan = DXChannel::get_all();
my $dxchan;
my $target = $_[3];
my $text = unpad($_[2]);
}
# always send it down the local interface if available
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
if ($dxchan) {
dbg("route: $call -> $dxchan->{call} direct" ) if isdbg('route');
} else {
dbg("PCPROT: Trying to route back to source, dropped") if isdbg('chanerr');
return;
}
- $dxchan = DXChannel->get($rcall);
+ $dxchan = DXChannel::get($rcall);
dbg("route: $call -> $rcall using RouteDB" ) if isdbg('route') && $dxchan;
}
}
my $r = {};
$r->{call} = $from;
$r->{t} = [ gettimeofday ];
- if ($via && (my $dxchan = DXChannel->get($via))) {
+ if ($via && (my $dxchan = DXChannel::get($via))) {
$dxchan->send(pc51($to, $main::mycall, 1));
} else {
route(undef, $to, pc51($to, $main::mycall, 1));
if ($tonode eq $main::mycall) {
my $s = $rcmds{$fromnode};
if ($s) {
- my $dxchan = DXChannel->get($s->{call});
- my $ref = $user eq $tonode ? $dxchan : (DXChannel->get($user) || $dxchan);
+ my $dxchan = DXChannel::get($s->{call});
+ my $ref = $user eq $tonode ? $dxchan : (DXChannel::get($user) || $dxchan);
$ref->send($line) if $ref;
delete $rcmds{$fromnode} if !$dxchan;
} else {
# send unsolicited ones to the sysop
- my $dxchan = DXChannel->get($main::myalias);
+ my $dxchan = DXChannel::get($main::myalias);
$dxchan->send($line) if $dxchan;
}
} else {
my $pkg = shift;
my $call = uc shift;
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
return $dxchan->user if $dxchan;
my $rref = Route::get($call);
return $rref->user if $rref && exists $rref->{user};
} elsif ($name eq 'USER_DEFAULT') {
@dxchan = DXChannel::get_all_users();
} else {
- $dxchan = DXChannel->get($name);
+ $dxchan = DXChannel::get($name);
push @dxchan, $dxchan if $dxchan;
}
foreach $dxchan (@dxchan) {
$user->set_believe($self->{call});
$user->put;
}
- my $dxchan = DXChannel->get($self->{via});
+ my $dxchan = DXChannel::get($self->{via});
if ($dxchan) {
dbg("Investigate: sending PC19 for $self->{call}") if isdbg('investigate');
foreach my $pc (@{$self->{pcxx}}) {
$call = ' ' x length $call;
# recursion detector
- if ((DXChannel->get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
+ if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
$line .= ' ...';
push @out, $line;
return @out;
my @dxchan;
# dbg("Trying node $self->{call}") if isdbg('routech');
- my $dxchan = DXChannel->get($self->{call});
+ my $dxchan = DXChannel::get($self->{call});
push @dxchan, $dxchan if $dxchan;
# it isn't, build up a list of dxchannels and possible ping times
foreach my $p (@{$self->{parent}}) {
# dbg("Trying parent $p") if isdbg('routech');
next if $p eq $main::mycall; # the root
- my $dxchan = DXChannel->get($p);
+ my $dxchan = DXChannel::get($p);
if ($dxchan) {
push @dxchan, $dxchan unless grep $dxchan == $_, @dxchan;
} else {
my $self = shift;
# ALWAYS return the locally connected channel if present;
- my $dxchan = DXChannel->get($self->call);
+ my $dxchan = DXChannel::get($self->call);
return $dxchan if $dxchan;
my @dxchan = $self->alldxchan;
# set up the basic channel info
# is there one already connected to me - locally?
my $user = DXUser->get_current($call);
- my $dxchan = DXChannel->get($call);
+ my $dxchan = DXChannel::get($call);
if ($dxchan) {
if ($user && $user->is_node) {
already_conn($conn, $call, DXM::msg($lang, 'concluster', $call, $main::mycall));
dbg("Local::finish error $@") if $@;
# disconnect nodes
- foreach $dxchan (DXChannel->get_all_nodes) {
+ foreach $dxchan (DXChannel::get_all_nodes) {
$dxchan->disconnect(2) unless $dxchan == $main::me;
}
Msg->event_loop(100, 0.01);
# disconnect users
- foreach $dxchan (DXChannel->get_all_users) {
+ foreach $dxchan (DXChannel::get_all_users) {
$dxchan->disconnect;
}