projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
force pings (and other PC frames) to go down a local connection if
[spider.git]
/
perl
/
DXChannel.pm
diff --git
a/perl/DXChannel.pm
b/perl/DXChannel.pm
index b7d32c44ad4f22e6a98693f7e531d373b61835fb..d975ca0d93d052bb0ba6c8cc4f07d26eb91f55f6 100644
(file)
--- a/
perl/DXChannel.pm
+++ b/
perl/DXChannel.pm
@@
-17,9
+17,9
@@
#
# PLEASE NOTE - I am a C programmer using this as a method of learning perl
# firstly and OO about ninthly (if you don't like the design and you can't
#
# PLEASE NOTE - I am a C programmer using this as a method of learning perl
# firstly and OO about ninthly (if you don't like the design and you can't
-# improve it with better OO
by
make it smaller and more efficient, then tough).
+# improve it with better OO
and thus
make it smaller and more efficient, then tough).
#
#
-# Copyright (c) 1998 - Dirk Koopman G1TLH
+# Copyright (c) 1998
-2000
- Dirk Koopman G1TLH
#
# $Id$
#
#
# $Id$
#
@@
-87,6
+87,7
@@
use vars qw(%channels %valid);
pingave => '0,Ping ave time',
logininfo => '9,Login info req,yesno',
talklist => '0,Talk List,parray',
pingave => '0,Ping ave time',
logininfo => '9,Login info req,yesno',
talklist => '0,Talk List,parray',
+ cluster => '5,Cluster data',
);
# object destruction
);
# object destruction
@@
-106,6
+107,7
@@
sub DESTROY
undef $self->{inwwvfilter};
undef $self->{inspotfilter};
undef $self->{passwd};
undef $self->{inwwvfilter};
undef $self->{inspotfilter};
undef $self->{passwd};
+ undef $self->{node};
}
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
}
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
@@
-158,12
+160,11
@@
sub get_all
#
# gimme all the ak1a nodes
#
#
# gimme all the ak1a nodes
#
-sub get_all_
ak1a
+sub get_all_
nodes
{
{
- my @list = DXChannel->get_all();
my $ref;
my @out;
my $ref;
my @out;
- foreach $ref (
@list
) {
+ foreach $ref (
values %channels
) {
push @out, $ref if $ref->is_node;
}
return @out;
push @out, $ref if $ref->is_node;
}
return @out;
@@
-172,10
+173,9
@@
sub get_all_ak1a
# return a list of all users
sub get_all_users
{
# return a list of all users
sub get_all_users
{
- my @list = DXChannel->get_all();
my $ref;
my @out;
my $ref;
my @out;
- foreach $ref (
@list
) {
+ foreach $ref (
values %channels
) {
push @out, $ref if $ref->is_user;
}
return @out;
push @out, $ref if $ref->is_user;
}
return @out;
@@
-184,11
+184,10
@@
sub get_all_users
# return a list of all user callsigns
sub get_all_user_calls
{
# return a list of all user callsigns
sub get_all_user_calls
{
- my @list = DXChannel->get_all();
my $ref;
my @out;
my $ref;
my @out;
- foreach $ref (
@list
) {
- push @out, $ref->
call
if $ref->is_user;
+ foreach $ref (
values %channels
) {
+ push @out, $ref->
{call}
if $ref->is_user;
}
return @out;
}
}
return @out;
}
@@
-466,8
+465,13
@@
sub AUTOLOAD
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
- @_ ? $self->{$name} = shift : $self->{$name} ;
+
+ # this clever line of code creates a subroutine which takes over from autoload
+ # from OO Perl - Conway
+ *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
+ @_ ? $self->{$name} = shift : $self->{$name} ;
}
}
+
1;
__END__;
1;
__END__;