2. speeded up the show/node command by using the DB_File interface and
authorminima <minima>
Sat, 29 Jul 2000 16:18:19 +0000 (16:18 +0000)
committerminima <minima>
Sat, 29 Jul 2000 16:18:19 +0000 (16:18 +0000)
sequentially reading the data directly and only 'get'ting the ones that are
nodes.
3. did the same for show/isolate and show/lockout.

Changes
cmd/forward/latlong.pl
cmd/show/isolate.pl
cmd/show/lockout.pl
cmd/show/node.pl
perl/Messages

diff --git a/Changes b/Changes
index 03561b0c2ca83092e7b399412a09bdeeda7204c0..d35eb5a5ffc1e876840dc584d11a169e1cb59459 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,6 +2,10 @@
 1. added forward/latlong which will forward ALL the users that have a latitude
 and longitude set on them to one or more locally connected nodes - with a hop
 count of 1.
+2. speeded up the show/node command by using the DB_File interface and 
+sequentially reading the data directly and only 'get'ting the ones that are
+nodes.
+3. did the same for show/isolate and show/lockout.
 28Jul00=======================================================================
 1. fixed watchdbg midnight rollover loop and removed the date part of the 
 date/time translation to leave just the time.
index 15712f003e635ade4a637623a582b0f09d7e50f4..7f6472bdf1d158de0eaa27534c3da81b8d7f338b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# merge_qra <node>
+# forward/latlong <node> ...
 #
 # send out PC41s toward a node for every user that has a lat/long 
 #
@@ -46,4 +46,4 @@ for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $a
                }
        }
 }
-return(1, @out, "$count records sent");
+return(1, @out, $self->msg('rec', $count));
index bea994fa7af2e112e16a0fcbeb5e5d1aa50f41ce..c874e8a8f930f46ef16e818da4de018238dea7af 100644 (file)
 my ($self, $line) = @_;
 return (1, $self->msg('e5')) unless $self->priv >= 1;
 
-# search thru the user for nodes
-my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->isolate) ? $_ : () } DXUser::get_all_calls;
-return (1, @out);
+my @out;
+
+use DB_File;
+
+my ($action, $count, $key, $data);
+for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) {
+       if ($data =~ m{isolate =>}) {
+               my $u = DXUser->get_current($key);
+               if ($u && $u->isolate) {
+                       push @out, $key;
+                       ++$count;
+               }
+       }
+} 
+
+return (1, @out, $self->msg('rec', $count));
+
+
index 6b7b7d49d667aa4b921c9d385f2a7d9b3c29831d..8c9c488c7399bc9b31943b99805ecaea6853a39f 100644 (file)
 my ($self, $line) = @_;
 return (1, $self->msg('e5')) unless $self->priv >= 9;
 
-# search thru the user for nodes
-my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->lockout) ? $_ : () } DXUser::get_all_calls;
-return (1, @out);
+my @out;
+
+use DB_File;
+
+my ($action, $count, $key, $data);
+for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) {
+       if ($data =~ m{lockout =>}) {
+               my $u = DXUser->get_current($key);
+               if ($u && $u->lockout) {
+                       push @out, $key;
+                       ++$count;
+               }
+       }
+} 
+
+return (1, @out, $self->msg('rec', $count));
+
 
index c18d8fb9376dc8d71e18c48ac68243dfd5dcd8a0..9bc77e2a031f454c51c3983ce58c000c6cd4f179 100644 (file)
@@ -22,8 +22,6 @@ my @out;
 
 # search thru the user for nodes
 unless (@call) {
-#  the official way
-#      @call = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->sort ne 'U') ? $_ : () } DXUser::get_all_calls;
        use DB_File;
        
        my ($action, $count, $key, $data);
@@ -71,7 +69,7 @@ foreach $call (@call) {
        }
 }
 
-return (1, @out);
+return (1, @out, $self->msg('rec', $count));
 
 
 
index c2dae16c7cbc476a686a6188fa5bdf0c0a90e617..56fcb345f4ddffb0a45c5a8443fae5a12a9f4888 100644 (file)
@@ -159,6 +159,7 @@ package DXM;
                                qrae2 => 'Don\'t recognise \"$_[0]\" as a QRA locator (eg JO02LQ)',
                                qra => 'Your QRA Locator is now \"$_[0]\"',
                                rcmdo => 'RCMD \"$_[0]\" sent to $_[1]',
+                               rec => '$_[0] records',
                                read1 => 'Sorry, no new messages for you',
                                read2 => 'Msg $_[0] not found',
                                read3 => 'Msg $_[0] not available',