spider/cmd/announce.pl
djk 324bd80ed4 1. Do some range checking for spots and WWV in the future (got a WWV for Oct
2034 whhich caused a bit of confusion!)
2. Make WWV spots broadcast them to the users! (as opposed to merely storing
them)(thank you G0RDI).
3. Allow users to do show/announce (thank you JE1SGH).
4. Delay broadcasts to users if they are not in a 'prompt' state (means you can
add messages and see what you are doing on a busy system)
5. Made set/unset dx,ann,wx,talk,wwv do what is expected
6. added set/sys_location and set/set_qra to set the cluster lat/long and qra
7. New messages will now be announced on logon (if there are any)
1999-01-07 00:57:39 +00:00

58 lines
1.2 KiB
Perl

#
# do an announce message
#
# handles announce
# announce full
# announce sysop
#
# at the moment these keywords are fixed, but I dare say a file containing valid ones
# will appear
#
# Copyright (c) 1998 Dirk Koopman G1TLH
#
# $Id$
#
# Modified 13Dec98 Iain Phillips G0RDI
#
my ($self, $line) = @_;
my @f = split /\s+/, $line;
return (1, $self->msg('e9')) if !@f;
my $sort = uc $f[0];
my @locals = DXCommandmode->get_all();
my $to;
my $from = $self->call;
my $t = ztime(time);
my $tonode;
my $sysopflag;
if ($sort eq "FULL") {
$line =~ s/^$f[0]\s+//; # remove it
$to = "ALL";
} elsif ($sort eq "SYSOP") {
$line =~ s/^$f[0]\s+//; # remove it
@locals = map { $_->priv >= 5 ? $_ : () } @locals;
$to = "SYSOP";
$sysopflag = '*';
} elsif ($sort eq "LOCAL") {
$line =~ s/^$f[0]\s+//; # remove it
$to = "LOCAL";
} else {
$to = "LOCAL";
}
# change ^ into : for transmission
$line =~ s/\^/:/og;
Log('ann', $to, $from, $line);
DXProt::broadcast_list("To $to de $from <$t>: $line", 'ann', undef, @locals);
if ($to ne "LOCAL") {
$line =~ s/\^//og; # remove ^ characters!
my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
DXProt::broadcast_ak1a($pc);
}
return (1, ());