fixed set/obscount
authorminima <minima>
Sat, 6 Jan 2001 22:24:12 +0000 (22:24 +0000)
committerminima <minima>
Sat, 6 Jan 2001 22:24:12 +0000 (22:24 +0000)
add new interval types for set/pingint

Changes
cmd/Commands_en.hlp
cmd/set/obscount.pl
cmd/set/pinginterval.pl
perl/DXProt.pm
perl/Messages

diff --git a/Changes b/Changes
index bc179e72b1ca18acf5eda56d57f0794f6ef40db4..c2039fb69624868000712a145edff4e67ffd0e0a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+06Jan01=======================================================================
+1. Fix set/obscount so it actually works.
+2. Allow different number formats for set/pingint eg: 5m for 5 minutes and
+120s for 120 seconds (and 1h for 1 hour).
 03Jan01=======================================================================
 1. Added a txt directory for txt versions of manuals (g0vgs)
 2. Various documentation changes
index 8ab9b000c661172dbcdc01954a0351229b257413..1cd2b30f664ff0087f2b66b97b19cecd01400ee3 100644 (file)
@@ -1053,6 +1053,10 @@ If a ping is heard then the obscount is reset to the full value. Using
 default values, if a node has not responded to a ping within 15 minutes,
 it is disconnected.
 
+You can set this parameter between 1 and 9.
+
+It is STRONGLY recommended that you don't change the default.
+
 === 0^SET/PAGE <lines per page>^Set the lines per page
 Tell the system how many lines you wish on a page when the number of line
 of output from a command is more than this. The default is 20. Setting it
@@ -1069,13 +1073,29 @@ affect routing decisions. The default interval is 300 secs or 5 minutes.
 
 You can use this command to set a different interval. Please don't. 
 
-But if you do the value you enter is treated as minutes up 60 and seconds
+But if you do the value you enter is treated as minutes up 30 and seconds
 for numbers greater than that.
 
 This is used also to help determine when a link is down at the far end
 (as certain cluster software doesn't always notice), see SET/OBSCOUNT
 for more information.
 
+If you must change it (and it may be useful for internet connected nodes
+on dynamic IP addresses that go away after a set time of usage) the time
+can be specified as:-
+
+  5      which if less than 30 is converted to minutes otherwise is 
+         taken as the no of seconds between pings. 
+  120s   120 seconds
+  5m     5 minutes
+  1h     1 hour
+
+Please be aware that this causes traffic to occur on the link, setting 
+this value too low may annoy your neighbours beyond the point of 
+endurance!
+
+You can switch this off by setting it to 0.
+
 === 9^SET/PRIVILEGE <n> <call> [<call..]^Set privilege level on a call
 Set the privilege level on a callsign. The privilege levels that pertain
 to commands are as default:-
index ed5f6c4574c5cf27ec5db53a3a632f8b79651c6a..e37387fe12f4258bd58eed6de543659880a34bdd 100644 (file)
@@ -11,32 +11,32 @@ my @args = split /\s+/, $line;
 my $call;
 my @out;
 my $user;
-my $val = int shift @args if @args;
+my $val = shift @args if @args;
 
 
 return (1, $self->msg('e5')) if $self->priv < 8;
-return (1, $self->msg('e14')) unless defined $val;
+return (1, $self->msg('e25', 1, 9)) unless defined $val && $val =~ /^\d+$/ && $val >= 1 && $val <= 9;
 return (1, $self->msg('e12')) unless @args;
 
-$val *= 60 if $val < 120;
-
 foreach $call (@args) {
        $call = uc $call;
+       my $dxchan = DXChannel->get($call);
+       $user = $dxchan->user if $dxchan;
        $user = DXUser->get_current($call);
        if ($user) {
-               unless ($user->sort eq 'A' || $user->sort eq 'S') {
+               unless ($user->is_node) {
                        push @out, $self->msg('e13', $call);
                        next;
                }
-               $user->pingint($val);
+               $user->nopings($val);
                if ($dxchan) {
-                       $dxchan->pingint($val);
+                       $dxchan->nopings($val);
                } else {
                        $user->close();
                }
-               push @out, $self->msg('pingint', $call, $val);
+               push @out, $self->msg('obscount', $call, $val);
        } else {
-               push @out, $self->msg('e3', "Set/Pinginterval", $call);
+               push @out, $self->msg('e3', "set/obscount", $call);
        }
 }
 return (1, @out);
index 457903778f403a521d012b497776838198360915..6511c5b65065b471bfe35b678b836b833f443c27 100644 (file)
@@ -11,14 +11,24 @@ my @args = split /\s+/, $line;
 my $call;
 my @out;
 my $user;
-my $val = int shift @args if @args;
+my $val = shift @args if @args;
 
 
-return (1, $self->msg('e5')) if $self->priv < 9;
+return (1, $self->msg('e5')) if $self->priv < 8;
 return (1, $self->msg('e14')) unless defined $val;
 return (1, $self->msg('e12')) unless @args;
 
-$val *= 60 if $val < 120;
+if ($val =~ /^(\d+)[sS]$/) {
+       $val = $1;
+} elsif ($val =~ /^(\d+)[mM]$/) {
+       $val = $1 * 60;
+} elsif ($val =~ /^(\d+)[hH]$/) {
+       $val = $1 * 60 * 60;
+} elsif ($val =~ /^\d+$/) {
+       $val *= 60 if $val < 30;
+} else {
+       return (1, $self->msg('e14'));
+}
 
 foreach $call (@args) {
        $call = uc $call;
@@ -26,7 +36,7 @@ foreach $call (@args) {
        $user = $dxchan->user if $dxchan;
        $user = DXUser->get($call) unless $user;
        if ($user) {
-               unless ($user->sort eq 'A' || $user->sort eq 'S') {
+               unless ($user->is_node) {
                        push @out, $self->msg('e13', $call);
                        next;
                }
index e7bda8bc5f5fe9ce82c1b9660813da17d3fea980..af94ecac44a4e0e143e155d0c0987da0d5c20ffd 100644 (file)
@@ -956,7 +956,7 @@ sub normal
                                                                $dxchan->send($dxchan->msg('pingi', $field[2], $s, $ave))
                                                        } elsif ($dxchan->is_node) {
                                                                if ($tochan) {
-                                                                       $tochan->{nopings} = 2; # pump up the timer
+                                                                       $tochan->{nopings} = $tochan->user->nopings || 2; # pump up the timer
                                                                        push @{$tochan->{pingtime}}, $t;
                                                                        shift @{$tochan->{pingtime}} if @{$tochan->{pingtime}} > 6;
                                                                        my $st;
index 5ed24fc1bc5fe7389f143cb7eb1ad52fa9e8ecd9..59f9627964d8d74166b4629dbd8d68ba1a6cbd72 100644 (file)
@@ -70,6 +70,7 @@ package DXM;
                                e22 => '$_[0] not a callsign',
                                e23 => '$_[0] not a range (eg 0/30000)', 
                                e24 => 'Sorry, Internet access is not enabled',
+                               e25 => 'Sorry the value must be between $_[0] and $_[1]',
 
                                echoon => 'Echoing enabled',
                                echooff => 'Echoing disabled',
@@ -156,6 +157,7 @@ package DXM;
                                nodexc => '$_[0] created as DXNET style Node',
                                nodeu => '$_[0] set back as a User',
                                nodee1 => 'You cannot use this command whilst your target ($_[0]) is on-line',
+                               obscount => 'Ping obsolescence count on $_[0] set to $_[1]',
                                ok => 'Operation successful',
                                outconn => 'Outstanding connect to $_[0]',
                                page => 'Press Enter to continue, A to abort ($_[0] lines) >',