fix $BRANCH auto revisioning code
[spider.git] / perl / DXChannel.pm
index aae692efb52e4f31230c0b04b118765ee3236775..4bc5810957ddc36d6ceac0f0079336b5be8de94d 100644 (file)
@@ -117,7 +117,7 @@ $count = 0;
 
 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));
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/,(0,0));
 $main::build += $VERSION;
 $main::branch += $BRANCH;
 
@@ -220,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
 {
@@ -426,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();
@@ -626,7 +638,6 @@ sub broadcast_list
 #no strict;
 sub AUTOLOAD
 {
-       my $self = shift;
        no strict;
        my $name = $AUTOLOAD;
        return if $name =~ /::DESTROY$/;
@@ -637,9 +648,7 @@ sub AUTOLOAD
        # 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}};
-       &$AUTOLOAD($self, @_);
-#      *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-#    @_ ? $self->{$name} = shift : $self->{$name} ;
+        goto &$AUTOLOAD;
 }