X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=536e7bb363dc3cea6e7e1cb3c9f7dc9a83f74119;hb=048adf1eb39f866e0968e1443fb7307ec5fdc4a6;hp=e126bc4c05e6fd258c584c8028556e4c8ae5ea3c;hpb=70908cf7f69eb4fc0caf5d735382bc2c1c1466a3;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index e126bc4c..536e7bb3 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -112,11 +112,12 @@ $count = 0; prompt => '0,Required Prompt', version => '1,Node Version', build => '1,Node Build', + verified => '9,Verified?,yesno', ); use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); $main::build += $VERSION; $main::branch += $BRANCH; @@ -219,6 +220,17 @@ sub get_all_user_calls return @out; } +# return a list of all node callsigns +sub get_all_node_calls +{ + my $ref; + my @out; + foreach $ref (values %channels) { + push @out, $ref->{call} if $ref->is_node; + } + return @out; +} + # obtain a channel object by searching for its connection reference sub get_by_cnum { @@ -425,6 +437,7 @@ sub disconnect my $self = shift; my $user = $self->{user}; + main::clean_inqueue($self); # clear out any remaining incoming frames $user->close() if defined $user; $self->{conn}->disconnect; $self->del(); @@ -622,20 +635,20 @@ sub broadcast_list } -no strict; +#no strict; sub AUTOLOAD { - my $self = shift; + no strict; my $name = $AUTOLOAD; return if $name =~ /::DESTROY$/; - $name =~ s/.*:://o; + $name =~ s/^.*:://o; confess "Non-existant field '$AUTOLOAD'" if !$valid{$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} ; + *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; + goto &$AUTOLOAD; }