4 # this is where the fun starts!
6 # Copyright (c) 1998 Dirk Koopman G1TLH
11 my ($self, $line) = @_;
12 my @f = split /\s+/, $line;
13 my $spotter = $self->call;
19 # first lets see if we think we have a callsign as the first argument
20 if (defined @f && @f >= 3 && $f[0] =~ /[A-Za-z]/) {
24 $line =~ s/^$f[0]\s+$f[1]\s+$f[2]\s*//;
25 } elsif (defined @f && @f >= 2) {
28 $line =~ s/^$f[0]\s+$f[1]\s*//;
29 } elsif (!defined @f || @f < 2) {
30 return (1, $self->msg('dx2'));
33 # bash down the list of bands until a valid one is reached
40 foreach $bandref (Bands::get_all()) {
41 @bb = @{$bandref->band};
42 for ($i = 0; $i < @bb; $i += 2) {
43 if ($freq >= $bb[$i] && $freq <= $bb[$i+1]) {
53 $freq = $freq * 1000 if $freq;
56 foreach $bandref (Bands::get_all()) {
57 @bb = @{$bandref->band};
58 for ($i = 0; $i < @bb; $i += 2) {
59 if ($freq >= $bb[$i] && $freq <= $bb[$i+1]) {
68 push @out, $self->msg('dx1', $freq) if !$valid;
70 # check we have a callsign :-)
71 if ($spotted le ' ') {
72 push @out, $self->msg('dx2');
77 return (1, @out) if !$valid;
79 # change ^ into : for transmission
82 # Store it here (but only if it isn't baddx)
83 if (grep $_ eq $spotted, @DXProt::baddx) {
84 my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
87 my @spot = Spot::add($freq, $spotted, $main::systime, $line, $spotter, $main::mycall);
89 # send orf to the users
90 my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
91 DXProt::broadcast_users($buf, 'dx', \@spot);
93 # send it orf to the cluster (hang onto your tin helmets)
94 DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me);