--- /dev/null
+=== 0^EN^ANNOUNCE^Send an announcement to the local cluster users
+ ANNOUNCE <text>
+
+ <text> is the text of the announcement you wish to broadcast
+
+=== 0^EN^ANNOUNCE FULL^Send an announcement to all cluster users
+ ANNOUNCE FULL <text>
+=== 5^EN^ANNOUNCE SYSOP^Send an announcement to sysops
+ ANNOUNCE SYSOP <text>
DXProt::broadcast_list("To $to de $from <$t>: $line", @locals);
if ($to ne "LOCAL") {
$line =~ s/\^//og; # remove ^ characters!
- my $pc = DXProt::pc12($self, $line, $tonode, $sysopflag, 0);
+ my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
DXProt::broadcast_ak1a($pc);
}
--- /dev/null
+=== 0^EN^BYE^Exit from the cluster
+ BYE
+
+ This will disconnect you from the cluster
+
--- /dev/null
+=== 0^EN^DX^Send a DX spot throughout the cluster
+ DX <freq> <callsign> <remarks>
+ or
+ DX <spotter> <freq> <callsign> <remarks>
+
+ Use the second form only if you wish to credit the spot to someone
+ else.
if ($f[0] =~ /[A-Za-z]/) {
$spotter = uc $f[0];
$freq = $f[1];
- $spotted = $f[2];
- $line =~ s/^$f[0]\s+$freq\s+$spotted\s*//;
+ $spotted = uc $f[2];
+ $line =~ s/^$f[0]\s+$f[1]\s+$f[2]\s*//;
} else {
$freq = $f[0];
- $spotted = $f[1];
+ $spotted = uc $f[1];
$line =~ s/^$f[0]\s+$f[1]\s*//;
}
+=== 0^EN^HELP^The HELP Command
+HELP is available for a number of commands. The syntax is:-
+
+ HELP <cmd>
+
+Where <cmd> is the name of the command you want help on.
+
+Commands for which help is available:-
+
+=== 0^EN^ANNOUNCE^make an announcement to the cluster
+=== 0^EN^BYE^exit from the cluster
+=== 9^EN^CREATE^Create various things
+=== 9^EN^DELETE^Delete various things
+=== 9^EN^DISCONNECT^Disconnect a user or node from the cluster
+=== 0^EN^DX^send a DX spot to the cluster
+=== 0^EN^SET^set various parameters
+=== 0^EN^SHOW^show various parameters
+=== 5^EN^SHUTDOWN^shutdown this node completely
+=== 5^EN^STAT^show the status of various system related things
+=== 0^EN^TALK^talk to another user of the cluster
+=== 0^EN^UNSET^unset or reset various parameters
+=== 0^EN^WWV^send a WWV spot
+=== 0^EN^WX^send a weather announcement to the cluster
my ($self, $line) = @_;
my @out;
+my ($path, $fcmd) = ($main::cmd, "help");;
+my @out;
+my @inpaths = ($main::localcmd, $main::cmd);
+my @helpfiles;
+
+# this is naff but it will work for now
+$line = "help" if !$line;
+$fcmd = lc $line;
+
+# each help file starts with a line that looks like:-
+#
+# === 0^EN^HELP^Description
+# text
+# text
+# text
+#
+# The fields are:- privilege level, Language, full command name, short description
+#
+
+if (!open(H, "$path/$fcmd.hlp")) {
+ return (1, "no help on $line available");
+}
+my $in;
+my $include = 0;
+my @in = <H>;
+close(H);
+
+foreach $in (@in) {
+ next if $in =~ /^\s*\#/;
+ chomp $in;
+ if ($in =~ /^===/) {
+ $include = 0;
+ $in =~ s/=== //;
+ my ($priv, $lang, $cmd, $desc) = split /\^/, $in;
+ next if $priv > $self->priv; # ignore subcommands that are of no concern
+ next if $self->lang && $self->lang ne $lang;
+ push @out, "$cmd - $desc";
+ $include = 1;
+ next;
+ }
+ push @out, $in if $include;
+}
+push @out, "No help available for $line" if @out == 0;
+return (1, @out);
--- /dev/null
+=== 0^EN^SHOW/DX^Interrogate the spot database
+ SHOW/DX
+
+ If you just type SHOW/DX you will get the last so many spots
+ (sysop configurable, but usually 10).
+
+ In addition you can add any number of these commands in very nearly
+ any order to the basic SHOW/DX command, they are:-
+
+ on <band> - eg 160m 20m 2m 23cm 6mm
+ on <region> - eg hf vhf uhf shf
+
+ <number> - the number of spots you want
+ <from>-<to> - <from> spot no <to> spot no in the selected list
+
+ <prefix> - for a spotted callsign beginning with <prefix>
+ *<suffix> - for a spotted callsign ending in <suffix>
+ *<string>* - for a spotted callsign containing <string>
+
+ day <number> - starting <number> days ago
+ day <from>-<to> - <from> days <to> days ago
+
+ info <text> - any spots containing <text> in the info or remarks
+
+ spotter <call> - any spots spotted by <call>
+
+ e.g.
+
+ SH/DX 9m0
+ SH/DX on 20m info iota
+ SH/DX 9a on vhf day 30
+ See also SHOW/DXCC
my $expr;
while ($f = shift @list) { # next field
- print "f: $f list: ", join(',', @list), "\n";
+# print "f: $f list: ", join(',', @list), "\n";
if (!$from && !$to) {
($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count?
next if $from && $to > $from;
next if $to;
}
if (lc $f eq 'on' && $list[0]) { # is it freq range?
- print "yup freq\n";
+# print "yup freq\n";
my @r = split '/', $list[0];
- print "r0: $r[0] r1: $r[1]\n";
+# print "r0: $r[0] r1: $r[1]\n";
@freq = Bands::get_freq($r[0], $r[1]);
if (@freq) { # yup, get rid of extranous param
- print "freq: ", join(',', @freq), "\n";
+# print "freq: ", join(',', @freq), "\n";
shift @list;
next;
}
}
if (lc $f eq 'day' && $list[0]) {
- print "got day\n";
+# print "got day\n";
($fromday, $today) = split '-', shift(@list);
next;
}
if (lc $f eq 'info' && $list[0]) {
- print "got info\n";
+# print "got info\n";
$info = shift @list;
next;
}
if (lc $f eq 'spotter' && $list[0]) {
- print "got spotter\n";
+# print "got spotter\n";
$spotter = uc shift @list;
next;
}
$expr .= "\$f4 =~ /$spotter/o";
}
-print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
+#print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
# now do the search
my @res = Spot::search($expr, $fromday, $today, $from, $to);
--- /dev/null
+=== 0^EN^SHOW/DXCC^Interrogate the spot database by country
+ SHOW/DXCC <prefix>
+
+ This command takes the <prefix> (which can be a full or partial
+ callsign if desired), looks up which internal country number it is
+ and then displays all the spots as per SH/DX for that country.
+
+ In addition you can add any number of these commands in very nearly
+ any order to the basic SHOW/DXCC command, they are:-
+
+ on <band> - eg 160m 20m 2m 23cm 6mm
+ on <region> - eg hf vhf uhf shf
+
+ <number> - the number of spots you want
+ <from>-<to> - <from> spot no <to> spot no in the selected list
+
+ day <number> - starting <number> days ago
+ day <from>-<to> - <from> days <to> days ago
+
+ info <text> - any spots containing <text> in the info or remarks
+
+ spotter <call> - any spots spotted by <call>
+
+ e.g.
+
+ SH/DX G
+ SH/DX W on 20m info iota
+ See also SHOW/DXCC
--- /dev/null
+=== 0^EN^SHOW/PREFIX^Interrogate the spot database by country
+ SHOW/PREFIX <prefix> or <callsign>
+
+ This command takes the <prefix> (which can be a full or partial
+ callsign if desired), looks up which internal country number it is
+ and then displays all the relevant prefixes for that country
+ together with the internal country no, the CQ and ITU regions.
$dxchan->send("$to de $from $line");
} else {
$line =~ s/\^//og; # remove any ^ characters
- my $prot = DXProt::pc10($self, $to, $via, $line);
+ my $prot = DXProt::pc10($from, $to, $via, $line);
DXProt::route($via?$via:$to, $prot);
}
DXProt::broadcast_list("WX de $from <$t>: $line", @locals);
if ($to ne "LOCAL") {
$line =~ s/\^//og; # remove ^ characters!
- my $pc = DXProt::pc12($self, $line, $tonode, $sysopflag, 1);
+ my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1);
DXProt::broadcast_ak1a($pc);
}
confmode => '0,In Conference?,yesno',
dx => '0,DX Spots,yesno',
redirect => '0,Redirect messages to',
+ lang => '0,Language',
);
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
sub update_users
{
my $self = shift;
- if (%{$self->{list}}) {
- $self->{users} = scalar %{$self->{list}};
+ my $count = shift;
+ if ((keys %{$self->{list}})) {
+ $self->{users} = (keys %{$self->{list}});
} else {
- $self->{users} = shift;
+ $self->{users} = $count;
}
}
$self->msg('pr', $call);
$self->state('prompt'); # a bit of room for further expansion, passwords etc
$self->{priv} = $user->priv;
+ $self->{lang} = $user->lang;
$self->{priv} = 0 if $line =~ /^(ax|te)/; # set the connection priv to 0 - can be upgraded later
$self->{consort} = $line; # save the connection type
my ($apath, $acmd) = split ',', $cmd_cache{$short_cmd};
if ($apath && $acmd) {
dbg('command', "cached $short_cmd = ($apath, $acmd)\n");
- return ($apath, $acmd) if $apath;
+ return ($apath, $acmd);
}
# if not guess
my $curdir = $path;
my $p;
my $i;
+ my @lparts;
for ($i = 0; $i < @parts; $i++) {
my $p = $parts[$i];
$curdir .= "/$l";
last;
}
- } else { # we are dealing with commands
- next if !$l =~ /\.$suffix$/; # only look for .$suffix files
+ } else { # we are dealing with commands
+ @lparts = split /\./, $l;
+ next if $lparts[$#lparts] ne $suffix; # only look for .$suffix files
if ($p eq substr($l, 0, length $p)) {
- $l =~ s/\.$suffix$//; # remove the suffix
- chop $dirfn; # remove trailing /
- $cmd_cache{"$short_cmd"} = join(',', ($path, "$dirfn/$l")); # cache it
- dbg('command', "got path: $path cmd: $dirfn/$l\n");
- return ($path, "$dirfn/$l");
+ pop @lparts; # remove the suffix
+ $l = join '.', @lparts;
+# chop $dirfn; # remove trailing /
+ $cmd_cache{"$short_cmd"} = join(',', ($path, "$dirfn$l")); # cache it
+ dbg('command', "got path: $path cmd: $dirfn$l\n");
+ return ($path, "$dirfn$l");
}
}
}
# some variable hop counts based on message type
%hopcount = (
- 11 => 1,
+ 11 => 10,
16 => 10,
17 => 10,
19 => 10,
# All the PCxx generation routines
#
-# create a talk string (called $self->pc10(...)
+# create a talk string ($from, $to, $via, $text)
sub pc10
{
- my ($self, $to, $via, $text) = @_;
+ my ($from, $to, $via, $text) = @_;
my $user2 = $via ? $to : ' ';
my $user1 = $via ? $via : $to;
- my $from = $self->call();
$text = unpad($text);
$text = ' ' if !$text;
return "PC10^$from^$user1^$text^*^$user2^$main::mycall^~";
# create an announce message
sub pc12
{
- my ($self, $text, $tonode, $sysop, $wx) = @_;
+ my ($call, $text, $tonode, $sysop, $wx) = @_;
my $hops = get_hops(12);
$sysop = ' ' if !$sysop;
$text = ' ' if !$text;
$wx = '0' if !$wx;
$tonode = '*' if !$tonode;
- return "PC12^$self->{call}^$tonode^$text^$sysop^$main::mycall^$wx^$hops^~";
+ return "PC12^$call^$tonode^$text^$sysop^$main::mycall^$wx^$hops^~";
}
#
lockout => '9,Locked out?,yesno', # won't let them in at all
dxok => '9,DX Spots?,yesno', # accept his dx spots?
annok => '9,Announces?,yesno', # accept his announces?
- reg => '0,Registered?,yesno', # is this user registered?
+ reg => '0,Registered?,yesno', # is this user registered?
+ lang => '0,Language',
);
no strict;