From: minima Date: Thu, 27 Mar 2003 11:51:02 +0000 (+0000) Subject: fix some issues with new format X-Git-Tag: PRE-1-52~5 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=4888cab7f56fbed40bf28477fe3f9c0ee9977a7c;p=spider.git fix some issues with new format --- diff --git a/Changes b/Changes index dc8b7366..8099f150 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +27Mar03======================================================================= +1. play around with sh/reg, sh/iso, sh/node and sh/lock to make them work +slightly better with the new user format. 26Mar03======================================================================= 1. add some ak1a compatibility changes to chat 2. added help text for chat, join, leave and sh/chat. diff --git a/cmd/show/lockout.pl b/cmd/show/lockout.pl index 178686c3..02acee09 100644 --- a/cmd/show/lockout.pl +++ b/cmd/show/lockout.pl @@ -23,17 +23,19 @@ if ($line) { return (1, $self->msg('lockoutuse')) unless $line; my ($action, $count, $key, $data) = (0,0,0,0); -for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { - if ($data =~ m{lockout}) { - if ($line eq 'ALL' || $key =~ /$line/) { - my $ur = DXUser->get_current($key); - if ($ur && $ur->lockout) { - push @out, $key; - ++$count; +eval qq{for (\$action = DXUser::R_FIRST, \$count = 0; !\$DXUser::dbm->seq(\$key, \$data, \$action); \$action = DXUser::R_NEXT) { + if (\$data =~ m{lockout}) { + if (\$line eq 'ALL' || \$key =~ /^$line/) { + my \$ur = DXUser->get_current(\$key); + if (\$ur && \$ur->lockout) { + push \@out, \$key; + ++\$count; } } } -} +} }; + +push @out, $@ if $@; return (1, @out, $self->msg('rec', $count)); diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 46e0b32d..063e2e42 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -16,6 +16,7 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 1; +return (1, $self->msg('storable')) unless $DXUser::v3; my @call = map {uc $_} split /\s+/, $line; my @out; @@ -26,7 +27,7 @@ if ($call[0] eq 'ALL') { shift @call; my ($action, $key, $data) = (0,0,0); for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { - if ($data =~ m{sort => '[ACRSX]'}) { + if ($data =~ m{\01[ACRSX]\0\0\0\04sort}) { push @call, $key; ++$count; } @@ -39,7 +40,7 @@ my $call; foreach $call (@call) { my $clref = Route::Node::get($call); my $uref = DXUser->get_current($call); - my ($sort, $ver); + my ($sort, $ver, $build); my $pcall = sprintf "%-11s", $call; push @out, $self->msg('snode1') unless @out > 0; @@ -56,16 +57,20 @@ foreach $call (@call) { push @out, $self->msg('snode3', $call); next; } + $ver = ""; + $build = ""; if ($call eq $main::mycall) { $sort = "Spider"; $ver = $main::version; } else { $ver = $clref->version if $clref && $clref->version; + $ver = $uref->version if $ver && $uref->version; } my ($major, $minor, $subs) = unpack("AAA*", $ver) if $ver; if ($uref->is_spider) { - push @out, $self->msg('snode2', $pcall, $sort, "$ver "); + $build = "build: " . $uref->build if $uref->build; + push @out, $self->msg('snode2', $pcall, $sort, "$ver $build"); } else { push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : " "); } diff --git a/cmd/show/registered.pl b/cmd/show/registered.pl index 340b2434..e4b6bce9 100644 --- a/cmd/show/registered.pl +++ b/cmd/show/registered.pl @@ -21,17 +21,19 @@ if ($line) { } my ($action, $count, $key, $data) = (0,0,0,0); -for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { - if ($data =~ m{registered}) { - if (!$line || ($line && $key =~ /$line/)) { - my $u = DXUser->get_current($key); - if ($u && $u->registered) { - push @out, $key; - ++$count; +eval qq{for (\$action = DXUser::R_FIRST, \$count = 0; !\$DXUser::dbm->seq(\$key, \$data, \$action); \$action = DXUser::R_NEXT) { + if (\$data =~ m{registered}) { + if (!\$line || (\$line && \$key =~ /^$line/)) { + my \$u = DXUser->get_current(\$key); + if (\$u && \$u->registered) { + push \@out, \$key; + ++\$count; } } } -} +} }; + +push @out, $@ if $@; return (1, @out, $self->msg('rec', $count)); diff --git a/perl/Messages b/perl/Messages index 34d92901..27147c08 100644 --- a/perl/Messages +++ b/perl/Messages @@ -271,6 +271,7 @@ package DXM; statvhf => 'VHF+ DX Spot Stats, last $_[1] days from $_[0]', statvhft => 'VHF+ DX Spot Stats, last $_[2] days from $_[1] for DXCC $_[0]', statdx => 'Total DX Spots for $_[1] days from $_[0]', + storable => 'Please load the Storable module from CPAN', sun => 'Location dd/mm/yyyy Rise Set', sun_with_azel => 'Location dd/mm/yyyy Rise Set Azim Elev', susdb1 => 'usage: callsign state city',