my $spotted;
my $freq;
my @out;
+my $valid = 0;
# first lets see if we think we have a callsign as the first argument
if ($f[0] =~ /[A-Za-z]/) {
$freq = $freq * 1000 if $freq < 1800;
# bash down the list of bands until a valid one is reached
-my $valid = 0;
my $bandref;
my @bb;
my $i;
}
push @out, "Frequency $freq not in band [usage: DX freq call comments]" if !$valid;
-return (1, @out) if !$valid;
-# send orf to the users
-my $buf = sprintf "DX de %-7.7s %13.1f %-12.12s %-30.30s %5.5s\a\a", $spotter, $freq, $spotted, $line, ztime(time);
-DXProt::broadcast_users($buf);
+# check we have a callsign :-)
+if ($spotted le ' ') {
+ push @out, "Need a callsign for the spot [usage: DX freq call comments]" ;
+ $valid = 0;
+}
+
+return (1, @out) if !$valid;
# Store it here
-Spot::add($freq, $spotted, time, $line, $spotter);
+if (Spot::add($freq, $spotted, $main::systime, $line, $spotter)) {
+ # send orf to the users
+ my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
+ DXProt::broadcast_users($buf);
-# send it orf to the cluster (hang onto your tin helmets)!
-DXProt::broadcast_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line));
+
+ # send it orf to the cluster (hang onto your tin helmets)!
+ DXProt::broadcast_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line));
+}
return (1, @out);
$main::systime,
'1',
$newsubj,
- $main::mycall, $rr);
+ $main::mycall,
+ '0',
+ $rr);
my @list;
my $from = $oref->from;
my $to = $oref->to;
my @dx;
foreach $ref (@res) {
@dx = @$ref;
- my $t = ztime($dx[2]);
- my $d = cldate($dx[2]);
- push @out, sprintf "%9s %-12s %s %s %-28s <%s>", $dx[0], $dx[1], $d, $t, $dx[3], $dx[4];
+ push @out, Spot::formatl(@dx);
}
} else {
- @out = DXM::msg('e4');
+ @out = $self->msg('e4');
}
return (1, @out);
$self->{subject} = shift;
$self->{origin} = shift;
$self->{read} = shift;
+ $self->{rrreq} = shift;
$self->{gotit} = [];
return $self;
$ref->{count} = 0;
$ref->{linesreq} = 5;
$work{"$f[2]$f[3]"} = $ref; # new ref
- dbg('msg', "incoming subject ack stream $[3]\n");
+ dbg('msg', "incoming subject ack stream $f[3]\n");
$busy{$f[2]} = $ref; # interlock
$ref->{lines} = [];
push @{$ref->{lines}}, ($ref->read_msg_body);
return $valid{$ele};
}
-no strict;
-sub AUTOLOAD
-{
- my $self = shift;
- my $name = $AUTOLOAD;
- return if $name =~ /::DESTROY$/;
- $name =~ s/.*:://o;
-
- confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
- @_ ? $self->{$name} = shift : $self->{$name} ;
-}
-
+#
+# send a message state machine
sub do_send_stuff
{
my $self = shift;
my $loc = $self->{loc};
if ($line eq "\032" || uc $line eq "/EX") {
my $to;
-
+
if (@{$loc->{lines}} > 0) {
foreach $to (@{$loc->{to}}) {
my $ref;
$systime,
$loc->{private},
$loc->{subject},
- $mycall,
+ $mycall,
+ '0',
$loc->{rrreq});
$ref->store($loc->{lines});
$ref->add_dir();
return (1, @out);
}
+no strict;
+sub AUTOLOAD
+{
+ my $self = shift;
+ my $name = $AUTOLOAD;
+ return if $name =~ /::DESTROY$/;
+ $name =~ s/.*:://o;
+
+ confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
+ @_ ? $self->{$name} = shift : $self->{$name} ;
+}
+
1;
__END__
{
my @dx = @_;
my $t = ztime($dx[2]);
- return sprintf "DX de %-9.9s: %9.1f %-12s %-30s<%s>", $dx[4], $dx[0], $dx[1], $dx[3], $t ;
+ return sprintf "DX de %-7.7s: %13.1f %-12.12s %-30s<%s>", $dx[4], $dx[0], $dx[1], $dx[3], $t ;
}
# format a spot for user output in list mode