From: djk Date: Sun, 6 Dec 1998 17:30:15 +0000 (+0000) Subject: 1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators X-Git-Tag: R_1_8~2 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c92a7711c41cc7ba1c60d5a49a94db239032ac1;p=spider.git 1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators 2. Added sh/qra for doing locator distances and bearings 3. Added some stuff to Notes.txt on hints for command writers 4. Changed help system to use just one file per language 5. Started adding more help 6. Fixed 24Mhz band limits --- diff --git a/Changes b/Changes index 7da05fce..34c5ba28 100644 --- a/Changes +++ b/Changes @@ -1,8 +1,10 @@ 06Dec98======================================================================== 1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators -2. Added a QRA locator thing to sh/heading so that if the 'prefix' looks like -a locator it will print the bearing and distance to it (as well as doing the -normal sh/heading on a prefix thing). +2. Added sh/qra for doing locator distances and bearings +3. Added some stuff to Notes.txt on hints for command writers +4. Changed help system to use just one file per language +5. Started adding more help +6. Fixed 24Mhz band limits 05Dec98======================================================================== 1. Added sh/heading and QRA locator calculation stuff 04Dec98======================================================================== diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp new file mode 100644 index 00000000..0b4766ed --- /dev/null +++ b/cmd/Commands_en.hlp @@ -0,0 +1,88 @@ +# +# please put your help in in alphabetical order +# +# a string search is done in the command field (case is ignored) +# and all commands matching the asked for command are printed out +# +# the order of the fields in each header is +# privilege, command, Description +# if the command ends in a - then that line isn't printed, but any +# subsequent lines are +# +# Comment lines are indented before printing +# +=== 0^ANNOUNCE ^Send an announcement to LOCAL users only + +=== 0^ANNOUNCE FULL ^Send an announcement cluster wide +This will send your announcement cluster wide + +=== 5^ANNOUNCE SYSOP ^Send an announcement to Sysops only + +=== 0^ANNOUNCE- + is the text of the announcement you wish to broadcast + +=== 0^BYE^Exit from the cluster +This will disconnect you from the cluster + +=== 0^DX ^Send a DX spot throughout the cluster + is compared against the available bands set up in the cluster. +see show/bands for more information. + +=== 0^HELP^The HELP Command +HELP is available for a number of commands. The syntax is:- + + HELP + +Where is the name of the command you want help on. + +All commands can be abbreviated, so SHOW/DX can be abbreviated +to SH/DX, ANNOUNCE can be shorted to AN and so on. + +=== 0^SHOW/DX^Interrogate the spot database +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 - eg 160m 20m 2m 23cm 6mm +on - eg hf vhf uhf shf (see SHOW/BANDS) + + - the number of spots you want +- - spot no spot no in the selected list + + - for a spotted callsign beginning with +* - for a spotted callsign ending in +** - for a spotted callsign containing + +day - starting days ago +day - - days days ago + +info - any spots containing in the info or remarks + +spotter - any spots spotted by + +e.g. + + SH/DX 9m0 + SH/DX on 20m info iota + SH/DX 9a on vhf day 30 + +=== 0^SHOW/DXCC ^Interrogate the spot database by country +This command takes the (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. + +The options for SHOW/DX also apply to this command. +e.g. + + SH/DXCC G + SH/DXCC W on 20m info iota + +=== 0^SHOW/PREFIX ^Interrogate the spot database by country +This command takes the (which can be a full or partial +callsign or a prefix 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. + +See also SHOW/DXCC diff --git a/cmd/Notes.txt b/cmd/Notes.txt index fb3b303a..c058941b 100644 --- a/cmd/Notes.txt +++ b/cmd/Notes.txt @@ -62,7 +62,9 @@ Programming Notes ($Id$) * The normal privilege levels are:- 0 - user privilege. + 1 - remote user user privilege 5 - sysop privilege. + 8 - maximum recommended remote sysop privilege 9 - console privilege. The sysop privilege is for things that you are prepared for remote @@ -85,23 +87,37 @@ Programming Notes ($Id$) you can have one callsign, you can have several. Interpret your arguments; so for example:- - set/locator jo02lq - sets your own locator to JO02LQ - set/locator g1tlh jo02lq - sets G1TLH's locator (if you are allowed) + set/qra jo02lq - sets your own locator to JO02LQ + set/qra g1tlh jo02lq - sets G1TLH's locator (if you are allowed) or - show/locator - displays your locator (and other info?) - show/locator in92jo - displays the bearing and distance to - IN92JO using your lat/long or locator - show/locator jn56in in92jo - bearing and distance between two - locators - show/locator gb7dxc - bearing and distance to gb7dxc if poss. + show/qra in92jo - displays the bearing and distance to + IN92JO using your lat/long or locator + show/qra jn56in in92jo - bearing and distance between two + locators * It is important that you remember when you have tie hashes using MLDBM et al. If you do a DXUser->get($call) you will get a different (older) thing than the one in $self->$user. This is almost certainly NOT what you want if want to modify a user that is currently connected. +* If you want to debug something, start the cluster.pl up thus:- + + perl -d cluster.pl + dbg> r + + Then you can go into debug mode at anytime by using the command :- + + debug + + or you can put the line:- + + $DB::single = 1; + + in an appropriate place in a command. This will only have an effect + if you are running in perl debug mode. + * Anything you output with a > as the last character is taken to mean that this is a prompt and will not have a \r or \n appended to it. @@ -110,3 +126,6 @@ Programming Notes ($Id$) have a '.hlp' appended to the command name rather than a '.pl'. All in the help file are sent to the user except those starting with a '#' character. + +* PLEASE add your new commands to the Commands_*.hlp file so that + people know about and how to use them! diff --git a/cmd/announce.hlp b/cmd/announce.hlp deleted file mode 100644 index e65b898f..00000000 --- a/cmd/announce.hlp +++ /dev/null @@ -1,9 +0,0 @@ -=== 0^EN^ANNOUNCE^Send an announcement to the local cluster users - ANNOUNCE - - is the text of the announcement you wish to broadcast - -=== 0^EN^ANNOUNCE FULL^Send an announcement to all cluster users - ANNOUNCE FULL -=== 5^EN^ANNOUNCE SYSOP^Send an announcement to sysops - ANNOUNCE SYSOP diff --git a/cmd/apropos.pl b/cmd/apropos.pl new file mode 100644 index 00000000..e69de29b diff --git a/cmd/bye.hlp b/cmd/bye.hlp deleted file mode 100644 index 1fe64326..00000000 --- a/cmd/bye.hlp +++ /dev/null @@ -1,5 +0,0 @@ -=== 0^EN^BYE^Exit from the cluster - BYE - - This will disconnect you from the cluster - diff --git a/cmd/dx.hlp b/cmd/dx.hlp deleted file mode 100644 index 22dbc676..00000000 --- a/cmd/dx.hlp +++ /dev/null @@ -1,7 +0,0 @@ -=== 0^EN^DX^Send a DX spot throughout the cluster - DX - or - DX - - Use the second form only if you wish to credit the spot to someone - else. diff --git a/cmd/help.hlp b/cmd/help.hlp deleted file mode 100644 index 23576f8c..00000000 --- a/cmd/help.hlp +++ /dev/null @@ -1,23 +0,0 @@ -=== 0^EN^HELP^The HELP Command -HELP is available for a number of commands. The syntax is:- - - HELP - -Where 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 diff --git a/cmd/help.pl b/cmd/help.pl index 781edc32..c74fad16 100644 --- a/cmd/help.pl +++ b/cmd/help.pl @@ -2,11 +2,9 @@ # the help subsystem # # It is a very simple system in that you type in 'help ' and it -# looks for a file called .hlp in either the local_cmd directory +# looks for a file called command.hlp in either the local_cmd directory # or the cmd directory (in that order). # -# if you just type in 'help' by itself you get what is in 'help.hlp'. -# # Copyright (c) 1998 - Dirk Koopman G1TLH # # $Id$ @@ -14,18 +12,19 @@ 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; +my $lang = $self->lang; +$lang = 'en' if !$lang; -# each help file starts with a line that looks like:- +# each help file contains lines that looks like:- +# +# === 0^EN^*^Description +# text +# text # -# === 0^EN^HELP^Description +# === 0^EN^help^Description # text # text # text @@ -33,31 +32,38 @@ $fcmd = lc $line; # 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 $h = new FileHandle; + +if (!open($h, "$main::localcmd/Commands_$lang.hlp")) { + if (!open($h, "$main::cmd/Commands_$lang.hlp")) { + return (1, $self->msg('helpe1')); + } } my $in; -my $include = 0; -my @in = ; -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; + +$line =~ s/![\w\/]//og; +$line =~ s/\//\.\*\//og; + +my $include; +foreach $in (<$h>) { + next if $in =~ /^\#/; + chomp $in; + if ($in =~ /^===/) { + $include = 0; + $in =~ s/=== //; + my ($priv, $cmd, $desc) = split /\^/, $in; + next if $priv > $self->priv; # ignore subcommands that are of no concern + next unless $cmd =~ /$line/i; + push @out, "$cmd $desc" unless $cmd =~ /-$/o; + $include = 1; + next; + } + push @out, " $in" if $include; } -push @out, "No help available for $line" if @out == 0; +close($h); + +push @out, $self->msg('helpe2', $line) if @out == 0; return (1, @out); diff --git a/cmd/show/dx.hlp b/cmd/show/dx.hlp deleted file mode 100644 index deb06a71..00000000 --- a/cmd/show/dx.hlp +++ /dev/null @@ -1,32 +0,0 @@ -=== 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 - eg 160m 20m 2m 23cm 6mm - on - eg hf vhf uhf shf - - - the number of spots you want - - - spot no spot no in the selected list - - - for a spotted callsign beginning with - * - for a spotted callsign ending in - ** - for a spotted callsign containing - - day - starting days ago - day - - days days ago - - info - any spots containing in the info or remarks - - spotter - any spots spotted by - - e.g. - - SH/DX 9m0 - SH/DX on 20m info iota - SH/DX 9a on vhf day 30 - See also SHOW/DXCC diff --git a/cmd/show/dxcc.hlp b/cmd/show/dxcc.hlp deleted file mode 100644 index 9cef8716..00000000 --- a/cmd/show/dxcc.hlp +++ /dev/null @@ -1,28 +0,0 @@ -=== 0^EN^SHOW/DXCC^Interrogate the spot database by country - SHOW/DXCC - - This command takes the (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 - eg 160m 20m 2m 23cm 6mm - on - eg hf vhf uhf shf - - - the number of spots you want - - - spot no spot no in the selected list - - day - starting days ago - day - - days days ago - - info - any spots containing in the info or remarks - - spotter - any spots spotted by - - e.g. - - SH/DX G - SH/DX W on 20m info iota - See also SHOW/DXCC diff --git a/cmd/show/prefix.hlp b/cmd/show/prefix.hlp deleted file mode 100644 index 942073a3..00000000 --- a/cmd/show/prefix.hlp +++ /dev/null @@ -1,7 +0,0 @@ -=== 0^EN^SHOW/PREFIX^Interrogate the spot database by country - SHOW/PREFIX or - - This command takes the (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. diff --git a/data/bands.pl b/data/bands.pl index 7ac51e10..9f0daa91 100644 --- a/data/bands.pl +++ b/data/bands.pl @@ -65,10 +65,10 @@ ssb => [ 21151, 21450] }, 'Bands'), - '12m' => bless( { band => [ 21000, 21450 ], - cw => [ 21000, 21150 ], - data => [ 21100, 21120 ], - ssb => [ 21151, 21450] + '12m' => bless( { band => [ 24890, 24990 ], + cw => [ 24890, 24990 ], + ssb => [ 24920, 24930], + rtty => [ 24930, 24990], }, 'Bands'), diff --git a/perl/Messages b/perl/Messages index 8d75053f..60eb3c00 100644 --- a/perl/Messages +++ b/perl/Messages @@ -35,6 +35,8 @@ package DXM; e8 => 'Need a callsign and some text', e9 => 'Need at least some text', email => 'E-mail address set to: $_[0]', + helpe1 => 'Help system unavailable, tell sysop', + helpe2 => 'No help available on $_[0]', heres => 'Here set on $_[0]', heade1 => 'Using $main::mycall Coords, consider doing a set/location or set/qra', hereu => 'Here unset on $_[0]',