projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
alter return arrangements to allow outgoing dxprots
[spider.git]
/
perl
/
DXUser.pm
diff --git
a/perl/DXUser.pm
b/perl/DXUser.pm
index f371161ba2a13feee8c4b96d07a3b948d4012060..cd30264e1d16e54cfaea2d45e57680b2de51e277 100644
(file)
--- a/
perl/DXUser.pm
+++ b/
perl/DXUser.pm
@@
-20,10
+20,8
@@
use LRU;
use strict;
use vars qw($VERSION $BRANCH);
use strict;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use vars qw(%u $dbm $filename %valid $lastoperinterval $lasttime $lru $lrusize $tooold $v3);
use vars qw(%u $dbm $filename %valid $lastoperinterval $lasttime $lru $lrusize $tooold $v3);
@@
-75,7
+73,7
@@
$v3 = 0;
pagelth => '0,Current Pagelth',
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
pagelth => '0,Current Pagelth',
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
- wantlogininfo => '
9,Login info r
eq,yesno',
+ wantlogininfo => '
0,Login Info R
eq,yesno',
wantgrid => '0,Show DX Grid,yesno',
wantann_talk => '0,Talklike Anns,yesno',
wantpc90 => '1,Req PC90,yesno',
wantgrid => '0,Show DX Grid,yesno',
wantann_talk => '0,Talklike Anns,yesno',
wantpc90 => '1,Req PC90,yesno',
@@
-93,6
+91,7
@@
$v3 = 0;
version => '1,Version',
build => '1,Build',
believe => '1,Believable nodes,parray',
version => '1,Version',
build => '1,Build',
believe => '1,Believable nodes,parray',
+ lastping => '1,Last Ping at,ptimelist',
);
#no strict;
);
#no strict;
@@
-263,7
+262,7
@@
sub get_current
my $pkg = shift;
my $call = uc shift;
my $pkg = shift;
my $call = uc shift;
- my $dxchan = DXChannel
->
get($call);
+ my $dxchan = DXChannel
::
get($call);
return $dxchan->user if $dxchan;
my $rref = Route::get($call);
return $rref->user if $rref && exists $rref->{user};
return $dxchan->user if $dxchan;
my $rref = Route::get($call);
return $rref->user if $rref && exists $rref->{user};
@@
-298,6
+297,7
@@
sub put
$lru->put($call, $self);
my $ref = $self->encode;
$dbm->put($call, $ref);
$lru->put($call, $self);
my $ref = $self->encode;
$dbm->put($call, $ref);
+ return $self;
}
# freeze the user
}
# freeze the user
@@
-725,6
+725,12
@@
sub is_node
return $self->{sort} =~ /[ACRSX]/;
}
return $self->{sort} =~ /[ACRSX]/;
}
+sub is_aranea
+{
+ my $self = shift;
+ return $self->{sort} eq 'W';
+}
+
sub is_user
{
my $self = shift;
sub is_user
{
my $self = shift;
@@
-784,7
+790,7
@@
sub set_believe
my $self = shift;
my $call = uc shift;
$self->{believe} ||= [];
my $self = shift;
my $call = uc shift;
$self->{believe} ||= [];
- push @{$self->{believe}}, $call;
+ push @{$self->{believe}}, $call
unless grep $_ eq $call, @{$self->{believe}}
;
}
sub unset_believe
}
sub unset_believe
@@
-796,6
+802,23
@@
sub unset_believe
delete $self->{believe} unless @{$self->{believe}};
}
}
delete $self->{believe} unless @{$self->{believe}};
}
}
+
+sub believe
+{
+ my $self = shift;
+ return exists $self->{believe} ? @{$self->{believe}} : ();
+}
+
+sub lastping
+{
+ my $self = shift;
+ my $call = shift;
+ $self->{lastping} ||= {};
+ $self->{lastping} = {} unless ref $self->{lastping};
+ my $b = $self->{lastping};
+ $b->{$call} = shift if @_;
+ return $b->{$call};
+}
1;
__END__
1;
__END__