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]) {
69 push @out, $self->msg('dx1', $freq) if !$valid;
71 # check we have a callsign :-)
72 if ($spotted le ' ') {
73 push @out, $self->msg('dx2');
78 return (1, @out) if !$valid;
80 # change ^ into : for transmission
84 if (Spot::add($freq, $spotted, $main::systime, $line, $spotter)) {
85 # send orf to the users
86 my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
87 DXProt::broadcast_users($buf, 'dx', $buf);
90 # send it orf to the cluster (hang onto your tin helmets)!
91 DXProt::broadcast_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line));