X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cmd%2Fset%2Fsys_qra.pl;fp=cmd%2Fset%2Fsys_qra.pl;h=c19f6f71d3569f538220b9c6a15decbf46bd61f1;hb=1f9712e804601df2e26f70ef88410c94546f44af;hp=0000000000000000000000000000000000000000;hpb=324bd80ed4aef7e2636f5a03288788ce11ab2663;p=spider.git diff --git a/cmd/set/sys_qra.pl b/cmd/set/sys_qra.pl new file mode 100644 index 00000000..c19f6f71 --- /dev/null +++ b/cmd/set/sys_qra.pl @@ -0,0 +1,38 @@ +# +# set the cluster qra locator field +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +return (1, $self->msg('e5')) if $self->priv < 9; + +my $call = $main::mycall; +my $user; + +# remove leading and trailing spaces +$line =~ s/^\s+//; +$line =~ s/\s+$//; + +return (1, $self->msg('qrae1')) if !$line; +return (1, $self->msg('qrae2', $line)) unless DXBearing::is_qra($line); + +$user = DXUser->get_current($call); +if ($user) { + $line = uc $line; + $user->qra($line); + if (!$user->lat && !$user->long) { + my ($lat, $long) = DXBearing::qratoll($line); + $user->lat($lat); + $user->long($long); + my $s = DXBearing::lltos($lat, $long); + DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); + } + + $user->put(); + return (1, $self->msg('sqra', $line)); +} else { + return (1, $self->msg('namee2', $call)); +}