X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=1994846b20894092ffd6f81a56c25057fe5f6169;hb=080b937d5e6d083879e9df1dd70def745efd8839;hp=e126bc4c05e6fd258c584c8028556e4c8ae5ea3c;hpb=70908cf7f69eb4fc0caf5d735382bc2c1c1466a3;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index e126bc4c..1994846b 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -112,11 +112,14 @@ $count = 0; prompt => '0,Required Prompt', version => '1,Node Version', build => '1,Node Build', + verified => '9,Verified?,yesno', + newroute => '1,New Style Routing,yesno', + ve7cc => '0,VE7CC program special,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; @@ -301,6 +304,15 @@ sub sort return @_ ? $self->{'sort'} = shift : $self->{'sort'} ; } +# find out whether we are prepared to believe this callsign on this interface +sub is_believed +{ + my $self = shift; + my $call = shift; + + return grep $call eq $_, $self->user->believe; +} + # handle out going messages, immediately without waiting for the select to drop # this could, in theory, block sub send_now @@ -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; }