- $spotted = uc $f[2];
- $line =~ s/^$f[0]\s+$f[1]\s+$f[2]\s*//;
-} elsif (defined @f && @f >= 2) {
- $freq = $f[0];
- $spotted = uc $f[1];
- $line =~ s/^$f[0]\s+$f[1]\s*//;
-} elsif (!defined @f || @f < 2) {
- return (1, $self->msg('dx2'));
+} elsif (is_freq($f[0]) && $f[1] =~ m{^[\w\d]+(?:/[\w\d]+){0,2}$}) {
+ $freq = $f[0];
+ $spotted = uc $f[1];
+} else {
+ return (1, $self->msg('dx3'));
+}
+$line =~ s/^\s*$f[0]//;
+$line =~ s/^\s*$f[1]//;
+$line = unpad($line);
+$line =~ s/\t+/ /g; # do this here because it needs to be stopped ASAP!
+$line ||= ' ';
+
+if ($self->conn && $self->conn->peerhost) {
+ $ipaddr ||= $addr; # force a PC61
+} elsif ($self->inscript) {
+ $ipaddr = "script";
+}
+
+# check some other things
+# remove ssid from calls
+my $spotternoid = basecall($spotter);
+my $callnoid = basecall($self->{call});
+
+#$DB::single = 1;
+
+if ($DXProt::baddx->in($spotted)) {
+ $localonly++;
+}
+if ($DXProt::badspotter->in($spotternoid) || $self->badip) {
+ LogDbg('DXCommand', "badspotter $spotternoid as $spotter ($oline) from $addr");
+ $localonly++;
+}
+
+dbg "spotter $spotternoid/$callnoid\n";
+
+if (($spotted =~ /$spotternoid/ || $spotted =~ /$callnoid/) && $freq < $Spot::minselfspotqrg) {
+ LogDbg('DXCommand', "$spotternoid/$callnoid trying to self spot below ${Spot::minselfspotqrg}KHz ($oline) from $addr, not passed on to cluster");
+ $localonly++;