X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=8e5d789bdd5e36ae7e43a62dd52daa452db1c94a;hb=5cfb9a8a63b34dd2b40c11e05cf5322649c96832;hp=76bfa9314926046d12ed18a00a3221746f497b82;hpb=25140d3e8633cbf9e25b6528248405ec8ed125e3;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 76bfa931..8e5d789b 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -64,11 +64,13 @@ sub new # routing, this must go out here to prevent race condx my $pkg = shift; my $call = shift; - my @rout = $main::routeroot->add_user($call, Route::here(1)); + my $uref = Route::User::get($call) || Route::User->new($call); + $uref->here(1); + $uref->conf(0); + $main::routeroot->add_user($uref); # ALWAYS output the user - my $ref = Route::User::get($call); - $main::me->route_pc16($main::mycall, undef, $main::routeroot, $ref) if $ref; + $main::me->route_pc16($main::mycall, undef, $main::routeroot, $uref); return $self; } @@ -346,7 +348,7 @@ sub send_talks $to = $ent unless $to; my $call = $via ? $via : $to; my $clref = Route::get($call); - my $dxchan = $clref->dxchan if $clref; + my $dxchan = $clref->bestdxchan if $clref; if ($dxchan) { $dxchan->talk($self->{call}, $to, $via, $line); } else { @@ -763,7 +765,7 @@ sub talk my $key = "$to$from"; unless (exists $nothereslug{$key}) { my ($ref, $dxchan); - if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) { + if (($ref = Route::get($from)) && ($dxchan = $ref->bestdxchan)) { my $name = $self->user->name || $to; my $s = $self->user->nothere || $dxchan->msg('nothere', $name); $nothereslug{$key} = $main::systime; @@ -824,24 +826,10 @@ sub chat $self->local_send('C', $buf); } -# send a dx spot -sub dx_spot +sub format_dx_spot { my $self = shift; - my $line = shift; - my $isolate = shift; - my ($filter, $hops); - return unless $self->{dx}; - - if ($self->{spotsfilter}) { - ($filter, $hops) = $self->{spotsfilter}->it(@_ ); - return unless $filter; - } - - - dbg('spot: "' . join('","', @_) . '"') if isdbg('dxspot'); - my $t = ztime($_[2]); my $loc; my $clth = $self->{consort} eq 'local' ? 29 : 30; @@ -865,8 +853,27 @@ sub dx_spot $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . $_[12] if $_[12]; } - my $buf = sprintf "DX de %-7.7s%11.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment; + return sprintf "DX de %-7.7s%11.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment; +} + +# send a dx spot +sub dx_spot +{ + my $self = shift; + my $line = shift; + my $isolate = shift; + my ($filter, $hops); + + return unless $self->{dx}; + + if ($self->{spotsfilter}) { + ($filter, $hops) = $self->{spotsfilter}->it(@_ ); + return unless $filter; + } + + dbg('spot: "' . join('","', @_) . '"') if isdbg('dxspot'); + my $buf = $self->format_dx_spot(@_); $buf .= "\a\a" if $self->{beep}; $buf =~ s/\%5E/^/g; $self->local_send('X', $buf);