From 8f58735f5c9c090f2e5e00e05c7ad0834eccb741 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 14 Sep 2001 17:50:19 +0000 Subject: [PATCH] 1. added the start of script files on login/startup. You can now add commands (for example to set variables) to a file called /spider/scripts/startup. You can also put in scripts for a callsign which will be executed when that callsign logs on. A sample script is in the directory (you did remember to do cvs update -d?). User settable versions of this will happen when the general mechanism for doing that is available. 2. Added set/unset/anntalk commands. If you unset/anntalk then you will no longer see many of the of talk like announces. Unfortunately you may miss the odd useful one as well (but since everything is repeated many times you probably won't :-) --- Changes | 11 ++++++++++ cmd/Commands_en.hlp | 50 +++++++++++++++++++++++++++++++++++++------ cmd/set/anntalk.pl | 27 +++++++++++++++++++++++ cmd/unset/anntalk.pl | 27 +++++++++++++++++++++++ perl/DXChannel.pm | 1 + perl/DXCommandmode.pm | 15 ++++++++----- perl/DXProt.pm | 7 +++++- perl/DXUser.pm | 6 ++++++ perl/Messages | 2 ++ perl/cluster.pl | 3 +++ scripts/startup.issue | 5 +++++ 11 files changed, 141 insertions(+), 13 deletions(-) create mode 100644 cmd/set/anntalk.pl create mode 100644 cmd/unset/anntalk.pl create mode 100644 scripts/startup.issue diff --git a/Changes b/Changes index cc0bae52..4e77eca5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,14 @@ +14Sep01======================================================================= +1. added the start of script files on login/startup. You can now add +commands (for example to set variables) to a file called +/spider/scripts/startup. You can also put in scripts for a callsign which +will be executed when that callsign logs on. A sample script is in the +directory (you did remember to do cvs update -d?). User settable versions +of this will happen when the general mechanism for doing that is available. +2. Added set/unset/anntalk commands. If you unset/anntalk then you will +no longer see many of the of talk like announces. Unfortunately you may +miss the odd useful one as well (but since everything is repeated many times +you probably won't :-) 13Sep01======================================================================= 1. did some work on making talk more intelligent and fixed a>b problem. 2. fixed a nasty problem on input when being hit with full buffers of diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index bf86e535..dd7602ac 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -1037,16 +1037,31 @@ SP is an alias for SEND PRIVATE === 0^SET/ANNOUNCE^Allow announce messages to come out on your terminal === 0^UNSET/ANNOUNCE^Stop announce messages coming out on your terminal +=== 0^SET/ANNTALK^Allow talk like announce messages on your terminal +=== 0^UNSET/ANNTALK^Stop talk like announce messages on your terminal +The announce system on legacy cluster nodes is used as a talk +substitute because the network is so poorly connected. If you: + + unset/anntalk + +you will suppress several of these announces, you may miss the odd +useful one as well, but you would probably miss them anyway in the +welter of useless ones. + + set/anntalk + +allows you to see them again. This is the default. + === 5^SET/ARCLUSTER [..]^Make the callsign an AR-Cluster node -=== 8^SET/BADDX ..^Stop words we do not wish to see in the callsign field -of a dx spot being propagated -=== 8^UNSET/BADDX ..^Allow a word to be seen again in a DX spot -Setting a word as 'baddx' will prevent spots with that word in the -callsign field of a DX spot from going any further. They will not be -displayed and they will not be sent onto other nodes. +=== 8^SET/BADDX ..^Stop callsigns in a dx spot being propagated +=== 8^UNSET/BADDX ..^Propagate a dx spot with this callsign again +Setting a word as 'baddx' will prevent spots with that word in the +'spotted' field (as in: DX 14001.1 FR0G)of a DX spot from going any +further. They will not be displayed and they will not be sent onto +other nodes. -The word must be wriiten in full, no wild cards are allowed eg:- +The word must be written in full, no wild cards are allowed eg:- set/baddx FORSALE VIDEO FR0G @@ -1092,6 +1107,23 @@ will allow spots from him again. Use with extreme care. This command may well be superceded by FILTERing. +=== 8^SET/BADWORD ..^Stop things with this word being propagated +=== 8^UNSET/BADWORD ..^Propagate things with this word again +Setting a word as a 'badword' will prevent things like spots, +announces or talks with this word in the the text part from going any +further. They will not be displayed and they will not be sent onto +other nodes. + +The word must be written in full, no wild cards are allowed eg:- + + set/badword annihilate annihilated annihilation + +will stop anything with these words in the text. + + unset/badspotter annihilated + +will allow text with this word again. + === 0^SET/BEEP^Add a beep to DX and other messages on your terminal === 0^UNSET/BEEP^Stop beeps for DX and other messages on your terminal @@ -1314,6 +1346,10 @@ for more information. Display all the bad spotter's callsigns in the system, see SET/BADSPOTTER for more information. +=== 1^SHOW/BADWORD^Show all the bad words in the system +Display all the bad words in the system, see SET/BADWORD +for more information. + === 0^SHOW/CONFIGURATION []^Show all the nodes and users visible This command allows you to see all the users that can be seen and the nodes to which they are connected. diff --git a/cmd/set/anntalk.pl b/cmd/set/anntalk.pl new file mode 100644 index 00000000..eec65400 --- /dev/null +++ b/cmd/set/anntalk.pl @@ -0,0 +1,27 @@ +# +# set the allow talklike announce flag +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; + +@args = $self->call if (!@args || $self->priv < 9); + +foreach $call (@args) { + $call = uc $call; + my $chan = DXChannel->get($call); + if ($chan) { + $chan->ann_talk(1); + $chan->user->wantann_talk(1); + push @out, $self->msg('annts', $call); + } else { + push @out, $self->msg('e3', "Set Ann_Talk", $call); + } +} +return (1, @out); diff --git a/cmd/unset/anntalk.pl b/cmd/unset/anntalk.pl new file mode 100644 index 00000000..7e8f012f --- /dev/null +++ b/cmd/unset/anntalk.pl @@ -0,0 +1,27 @@ +# +# unset the allow talklike announce flag +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; + +@args = $self->call if (!@args || $self->priv < 9); + +foreach $call (@args) { + $call = uc $call; + my $chan = DXChannel->get($call); + if ($chan) { + $chan->ann_talk(0); + $chan->user->wantann_talk(0); + push @out, $self->msg('anntu', $call); + } else { + push @out, $self->msg('e3', "Unset Ann_Talk", $call); + } +} +return (1, @out); diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index ba2e0edc..a0b09548 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -103,6 +103,7 @@ $count = 0; senddbg => '8,Sending Debug,yesno', width => '0,Column Width', disconnecting => '9,Disconnecting,yesno', + ann_talk => '0,Suppress Talk Anns,yesno', ); use vars qw($VERSION $BRANCH); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index a5aaa5cf..96c13537 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -30,9 +30,11 @@ use AnnTalk; use WCY; use Sun; use Internet; +use Script; + use strict; -use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $suppress_ann_to_talk); +use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug); %Cache = (); # cache of dynamically loaded routine's mod times %cmd_cache = (); # cache of short names @@ -40,8 +42,6 @@ $errstr = (); # error string from eval %aliases = (); # aliases for (parts of) commands $scriptbase = "$main::root/scripts"; # the place where all users start scripts go $maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection -$suppress_ann_to_talk = 1; # don't announce 'to ' or ' ' type announcements - use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); @@ -102,6 +102,7 @@ sub start $self->{wx} = $user->wantwx; $self->{dx} = $user->wantdx; $self->{logininfo} = $user->wantlogininfo; + $self->{ann_talk} = $user->wantann_talk; $self->{here} = 1; # get the filters @@ -144,6 +145,10 @@ sub start run_cmd($DXProt::me, "forward/opernam $call"); $user->lastoper($main::systime); } + + # run a script send the output to the punter + my $script = new Script(lc $call); + $script->run($self) if $script; } # @@ -705,9 +710,9 @@ sub announce my $text = shift; my ($filter, $hops); - if ($suppress_ann_to_talk && $to ne $self->{call}) { + if (!$self->{ann_talk} && $to ne $self->{call}) { my $call = AnnTalk::is_talk_candidate($_[0], $text); - return if $call && Route::get($call); + return if $call; } if ($self->{annfilter}) { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index c1583c21..990aa45d 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -32,6 +32,7 @@ use BadWords; use DXHash; use Route; use Route::Node; +use Script; use strict; @@ -60,7 +61,7 @@ $baddx = new DXHash "baddx"; $badspotter = new DXHash "badspotter"; $badnode = new DXHash "badnode"; $last10 = $last_pc50 = time; -$ann_to_talk = 1; +$ann_to_talk = 0; @checklist = ( @@ -272,6 +273,10 @@ sub start # send info to all logged in thingies $self->tell_login('loginn'); + + # run a script send the output to the debug file + my $script = new Script(lc $call); + $script->run($self) if $script; } # diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 419156d3..cbedad41 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -71,6 +71,7 @@ $lasttime = 0; nopings => '9,Ping Obs Count', wantlogininfo => '9,Login info req,yesno', wantgrid => '0,DX Grid Info,yesno', + wantann_talk => '0,Talklike Anns,yesno', lastoper => '9,Last for/oper,cldatetime', nothere => '0,Not Here Text', ); @@ -519,6 +520,11 @@ sub wantgrid return _want('grid', @_); } +sub wantann_talk +{ + return _want('ann_talk', @_); +} + sub wantlogininfo { my $self = shift; diff --git a/perl/Messages b/perl/Messages index d762e7e9..720a6e1f 100644 --- a/perl/Messages +++ b/perl/Messages @@ -14,6 +14,8 @@ package DXM; already => '$_[0] already connnected', anns => 'Announce flag set on $_[0]', annu => 'Announce flag unset on $_[0]', + annts => 'Ann_Talk flag set on $_[0]', + anntu => 'Ann_Talk flag unset on $_[0]', badnode1 => '$_[0] is now a bad node', badnode2 => '$_[0] is now a good node', badnode3 => 'List of Bad Nodes:-', diff --git a/perl/cluster.pl b/perl/cluster.pl index 516e7cb1..98eabf63 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -67,6 +67,7 @@ use DXBearing; use DXDb; use DXHash; use DXDupe; +use Script; use Prefix; use Spot; use Bands; @@ -452,6 +453,8 @@ DXDebug::dbgclean(); # this, such as it is, is the main loop! dbg("orft we jolly well go ..."); +my $script = new Script "startup"; +$script->run($DXProt::me) if $script; #open(DB::OUT, "|tee /tmp/aa"); diff --git a/scripts/startup.issue b/scripts/startup.issue new file mode 100644 index 00000000..4ad02858 --- /dev/null +++ b/scripts/startup.issue @@ -0,0 +1,5 @@ +# +# startup script example +# +# set maximum no of spots allowed to 100 +set/var $Spot::maxspots = 1 -- 2.43.0