From: minima Date: Thu, 20 Jul 2000 14:16:00 +0000 (+0000) Subject: can use Sourceforge now! X-Git-Tag: R_1_43~41 X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=e83b70ecab022dbbeac0b56f67ed2e4bed609e86;p=spider.git can use Sourceforge now! added user->qra cleaning added 4 digit qra to user broadcast dxspots if available --- diff --git a/Changes b/Changes index de0cdb9b..4a880f0a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ -20Jun00======================================================================= -1. fixed decode_input so it accepts callsigns with 0 in them (!) +20Jul00======================================================================= +1. Finally managed to update my source with the sourceforge one +2. added user->qra cleaning in various places +3. added four digit locator strings to broadcast DX spots (for users). +25Jun00======================================================================= +1. added 0 to the regex that checks for valid data on the cluster.pl->client +channel - this will allow G0VGS and G0RDI to connect.... +2. removed technically unnecessary /= 60 from the dup routines to see if +Arnold's Sparcs don't then crash. 19Jun00======================================================================= 1. move ann_dup, spot_dup etc to dup_ann, dup_spots etc 2. made mode 3 the default line ending convention for all out going connects diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index ca6a1c4e..d88d879e 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -80,7 +80,15 @@ sub start $self->{dx} = $user->wantdx; $self->{logininfo} = $user->wantlogininfo; $self->{here} = 1; - + + # clean up qra locators + my $qra = $user->qra; + $qra = undef if ($qra && !DXBearing::is_qra($qra)); + unless ($qra) { + my $lat = $user->lat; + my $long = $user->long; + $user->qra(DXBearing::lltoqra($lat, $long)) if (defined $lat && defined $long); + } # add yourself to the database my $node = DXNode->get($main::mycall) or die "$main::mycall not allocated in DXNode database"; diff --git a/perl/DXProt.pm b/perl/DXProt.pm index a7cf9e6f..0a1c83dd 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -222,8 +222,8 @@ sub normal } # are any of the crucial fields invalid? - if ($field[2] =~ /[a-z]/ || $field[6] =~ /[a-z]/ || $field[7] =~ /[a-z]/) { - dbg('chan', "Spot contains lower case callsigns, rejected"); + if ($field[2] =~ /(?:^\s*$|[a-z])/ || $field[6] =~ /(?:^\s*$|[a-z])/ || $field[7] =~ /(?:^\s*$|[a-z])/) { + dbg('chan', "Spot contains lower case callsigns or blanks, rejected"); return; } @@ -243,6 +243,20 @@ sub normal # you should be able to route on any of these # + # fix up qra locators of known users + my $user = DXUser->get_current($spot[4]); + if ($user) { + my $qra = $user->qra; + if (!DXBearing::is_qra) { + my $lat = $user->lat; + my $long = $user->long; + if (defined $lat && defined $long) { + $user->qra(DXBearing::lltoqra($lat, $long)); + $user->put; + } + } + } + # local processing my $r; eval { @@ -654,6 +668,8 @@ sub normal my ($lat, $long) = DXBearing::stoll($field[3]); $user->lat($lat); $user->long($long); + my $qra = $user->qra || DXBearing::lltoqra($lat, $long); + $qra = DXBearing::lltoqra($lat, $long) unless DXBearing::is_qra($qra); } elsif ($field[2] == 4) { $user->homenode($field[3]); } diff --git a/perl/Geomag.pm b/perl/Geomag.pm index 1d3462dc..d169565a 100644 --- a/perl/Geomag.pm +++ b/perl/Geomag.pm @@ -252,7 +252,6 @@ sub dup # dump if too old return 2 if $d < $main::systime - $dupage; - $d /= 60; # to the nearest minute # chomp $text; # $text = substr($text, 0, $duplth) if length $text > $duplth; my $dupkey = "$d|$sfi|$k|$a"; diff --git a/perl/Spot.pm b/perl/Spot.pm index afc3410f..fcf2d261 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -170,7 +170,11 @@ sub formatb { my @dx = @_; my $t = ztime($dx[2]); - return sprintf "DX de %-7.7s%11.1f %-12.12s %-30s %s", "$dx[4]:", $dx[0], $dx[1], $dx[3], $t ; + my $ref = DXUser->get_current($dx[4]); + my $loc = $ref->qra if $ref && $ref->qra; + $loc = substr($ref->qra, 0, 4) if $loc; + $loc = "" unless $loc; + return sprintf "DX de %-7.7s%11.1f %-12.12s %-30s %s $loc", "$dx[4]:", $dx[0], $dx[1], $dx[3], $t ; } # format a spot for user output in list mode @@ -209,9 +213,9 @@ sub dup return 2 if $d < $main::systime - $dupage; $freq = sprintf "%.1f", $freq; # normalise frequency - $d /= 60; # to the nearest minute chomp $text; $text = substr($text, 0, $duplth) if length $text > $duplth; + unpad($text); my $dupkey = "$freq|$call|$d|$text"; return 1 if exists $dup{$dupkey}; $dup{$dupkey} = $d * 60; # in seconds (to the nearest minute) diff --git a/perl/WCY.pm b/perl/WCY.pm index acc522bd..ef1a9b21 100644 --- a/perl/WCY.pm +++ b/perl/WCY.pm @@ -227,7 +227,6 @@ sub dup # dump if too old return 2 if $d < $main::systime - $dupage; - $d /= 60; # to the nearest minute # chomp $text; # $text = substr($text, 0, $duplth) if length $text > $duplth; my $dupkey = "$d|$sfi|$k|$a|$r"; diff --git a/src/chain.c b/src/chain.c index 89110a95..cc66773a 100755 --- a/src/chain.c +++ b/src/chain.c @@ -185,7 +185,12 @@ reft *chain_new() /* * $Log$ - * Revision 1.3 2000-03-30 22:51:14 djk + * Revision 1.4 2000-07-20 14:16:00 minima + * can use Sourceforge now! + * added user->qra cleaning + * added 4 digit qra to user broadcast dxspots if available + * + * Revision 1.3 2000/03/30 22:51:14 djk * fixed connect code in client.pl so it doesn't falsely recognise /spider * /src/client as a 'client' directive. * Tidied up the C client a bit diff --git a/src/cmsg.c b/src/cmsg.c index 1b325b58..8732f19b 100755 --- a/src/cmsg.c +++ b/src/cmsg.c @@ -177,7 +177,12 @@ void cmsg_flush(reft *base, int reply) /* * * $Log$ - * Revision 1.1 2000-03-26 00:03:30 djk + * Revision 1.2 2000-07-20 14:16:00 minima + * can use Sourceforge now! + * added user->qra cleaning + * added 4 digit qra to user broadcast dxspots if available + * + * Revision 1.1 2000/03/26 00:03:30 djk * first cut of client * * Revision 1.12 1998/05/05 14:01:27 djk diff --git a/src/cmsg.h b/src/cmsg.h index 384b90f7..99f6d4ad 100755 --- a/src/cmsg.h +++ b/src/cmsg.h @@ -8,7 +8,12 @@ * $Header$ * * $Log$ - * Revision 1.1 2000-03-26 00:03:30 djk + * Revision 1.2 2000-07-20 14:16:00 minima + * can use Sourceforge now! + * added user->qra cleaning + * added 4 digit qra to user broadcast dxspots if available + * + * Revision 1.1 2000/03/26 00:03:30 djk * first cut of client * * Revision 1.7 1998/01/02 19:39:57 djk diff --git a/src/sel.c b/src/sel.c index a15ed0ec..4856dda3 100755 --- a/src/sel.c +++ b/src/sel.c @@ -188,7 +188,12 @@ int sel_error(sel_t *sp, int err) /* * $Log$ - * Revision 1.3 2000-03-30 22:51:14 djk + * Revision 1.4 2000-07-20 14:16:00 minima + * can use Sourceforge now! + * added user->qra cleaning + * added 4 digit qra to user broadcast dxspots if available + * + * Revision 1.3 2000/03/30 22:51:14 djk * fixed connect code in client.pl so it doesn't falsely recognise /spider * /src/client as a 'client' directive. * Tidied up the C client a bit diff --git a/src/sel.h b/src/sel.h index 5fd3f3ee..dde95a42 100755 --- a/src/sel.h +++ b/src/sel.h @@ -8,7 +8,12 @@ * $Header$ * * $Log$ - * Revision 1.2 2000-03-26 14:22:59 djk + * Revision 1.3 2000-07-20 14:16:00 minima + * can use Sourceforge now! + * added user->qra cleaning + * added 4 digit qra to user broadcast dxspots if available + * + * Revision 1.2 2000/03/26 14:22:59 djk * removed some irrelevant log info * * Revision 1.1 2000/03/26 00:03:30 djk