]> dxcluster.net Git - spider.git/commitdiff
fix DXChannel->get to DXChannel::get
authorminima <minima>
Sun, 13 Mar 2005 11:14:31 +0000 (11:14 +0000)
committerminima <minima>
Sun, 13 Mar 2005 11:14:31 +0000 (11:14 +0000)
13 files changed:
Changes
perl/AMsg.pm
perl/DXChannel.pm
perl/DXCommandmode.pm
perl/DXCron.pm
perl/DXDb.pm
perl/DXMsg.pm
perl/DXProt.pm
perl/DXUser.pm
perl/Filter.pm
perl/Investigate.pm
perl/Route.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index eb912b1cc821133225021a1240366d48d7c815a4..6f7d92df1e07648d73e264251d51d890df246a40 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+13Mar05=======================================================================
+1. There has been a mix up in the Aranea1 branch. I have managed to merge a
+change that I have been meaning to do for ages. I have now made that change
+here.
 27Feb05=======================================================================
 1. fix duping on bad spot suckers that copy the prefix that is put at the end
 of the comment section by AR-C nodes becoming the whole comment. 
index 19fe9208818f28a075e6264fcb9353059c11566a..656726479eb262b2f8e2197b2f403c738f41b3dc 100644 (file)
@@ -186,7 +186,7 @@ sub new_channel
        # set up the basic channel info
        # is there one already connected to me - locally? 
        my $user = DXUser->get_current($call);
-       my $dxchan = DXChannel->get($call);
+       my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                if ($main::bumpexisting) {
                        my $ip = $conn->{peerhost} || 'unknown';
index acd4245c6cddebd8edcfd2aa6ccffd6a5c2beaab..09290121b88114169eb10045ffd1ab13a4c0cea5 100644 (file)
@@ -187,10 +187,10 @@ sub rec
        }
 }
 
-# obtain a channel object by callsign [$obj = DXChannel->get($call)]
+# obtain a channel object by callsign [$obj = DXChannel::get($call)]
 sub get
 {
-       my ($pkg, $call) = @_;
+       my $call = shift;
        return $channels{$call};
 }
 
index debc23d2af1dddc01fc1b5f4ed1aafd4c05896fe..6eee5d457cc00aca7b0ea6143a96dca280df4d0b 100644 (file)
@@ -494,7 +494,7 @@ sub run_cmd
 sub process
 {
        my $t = time;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        
        foreach $dxchan (@dxchan) {
@@ -582,7 +582,7 @@ sub broadcast
        my $pkg = shift;                        # ignored
        my $s = shift;                          # the line to be rebroadcast
        
-    foreach my $dxchan (DXChannel->get_all()) {
+    foreach my $dxchan (DXChannel::get_all()) {
                next unless $dxchan->{sort} eq 'U'; # only interested in user channels  
                next if grep $dxchan == $_, @_;
                $dxchan->send($s);                      # send it
@@ -592,7 +592,7 @@ sub broadcast
 # gimme all the users
 sub get_all
 {
-       return grep {$_->{sort} eq 'U'} DXChannel->get_all();
+       return grep {$_->{sort} eq 'U'} DXChannel::get_all();
 }
 
 # run a script for this user
@@ -947,7 +947,7 @@ sub broadcast_debug
 {
        my $s = shift;                          # the line to be rebroadcast
        
-       foreach my $dxchan (DXChannel->get_all) {
+       foreach my $dxchan (DXChannel::get_all) {
                next unless $dxchan->{enhanced} && $dxchan->{senddbg};
                $dxchan->send_later('L', $s);
        }
index 868420585b70e416e48e9af0ed56e27a09a524ff..2a9913f1f9682a4a20bb62b84850c7dbbacadf96 100644 (file)
@@ -174,7 +174,7 @@ sub process
 sub connected
 {
        my $call = uc shift;
-       return DXChannel->get($call);
+       return DXChannel::get($call);
 }
 
 # is it remotely connected anywhere (with exact callsign)?
@@ -224,7 +224,7 @@ sub presentish_on
 sub last_connect
 {
        my $call = uc shift;
-       return $main::systime if DXChannel->get($call);
+       return $main::systime if DXChannel::get($call);
        my $user = DXUser->get($call);
        return $user ? $user->lastin : 0;
 }
index a088866c5873e675586b4a72c8c93c6565170e70..833640f5862b2d5dfa75a7b1666a35e53336ab6e 100644 (file)
@@ -277,7 +277,7 @@ sub handle_45
        # incoming DB Information
        my $n = getstream($_[3]);
        if ($n) {
-               my $mchan = DXChannel->get($n->{call});
+               my $mchan = DXChannel::get($n->{call});
                $mchan->send($_[2] . ":$_[4]") if $mchan;
        }
 }
index 67165ef455a03df1fcae0368bd1ba21504f5c325..b25b70a5b704c57f02ba863d88ca406a6bbdf651 100644 (file)
@@ -479,7 +479,7 @@ sub notify
        my $ref = shift;
        my $to = $ref->{to};
        my $uref = DXUser->get_current($to);
-       my $dxchan = DXChannel->get($to);
+       my $dxchan = DXChannel::get($to);
        if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) {
                my $email = $uref->email;
                if ($email) {
index 9dc9d5e48506d90961d15ef5e6295a43f58ef9c5..46fda5706fe5bdbadfa8c73058ed8d0c56c1f369 100644 (file)
@@ -438,8 +438,8 @@ sub handle_10
 #      RouteDB::update($to, $_[6]);
 
        # it is here and logged on
-       $dxchan = DXChannel->get($main::myalias) if $to eq $main::mycall;
-       $dxchan = DXChannel->get($to) unless $dxchan;
+       $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
+       $dxchan = DXChannel::get($to) unless $dxchan;
        if ($dxchan && $dxchan->is_user) {
                $_[3] =~ s/\%5E/^/g;
                $dxchan->talk($from, $to, $via, $_[3]);
@@ -663,7 +663,7 @@ sub handle_12
 
        my $dxchan;
        
-       if ((($dxchan = DXChannel->get($_[2])) && $dxchan->is_user) || $_[4] =~ /^[\#\w.]+$/){
+       if ((($dxchan = DXChannel::get($_[2])) && $dxchan->is_user) || $_[4] =~ /^[\#\w.]+$/){
                $self->send_chat($line, @_[1..6]);
        } elsif ($_[2] eq '*' || $_[2] eq $main::mycall) {
 
@@ -779,7 +779,7 @@ sub handle_16
                                                }
                                        }
                                        $user->wantroutepc19(1) unless defined $wantpc19; # for now we work on the basis that pc16 = real route 
-                                       $user->lastin($main::systime) unless DXChannel->get($ncall);
+                                       $user->lastin($main::systime) unless DXChannel::get($ncall);
                                        $user->put;
                                                
                                        # route the pc19 - this will cause 'stuttering PC19s' for a while
@@ -850,7 +850,7 @@ sub handle_16
                $user = DXUser->new($call) if !$user;
                $user->homenode($parent->call) if !$user->homenode;
                $user->node($parent->call);
-               $user->lastin($main::systime) unless DXChannel->get($call);
+               $user->lastin($main::systime) unless DXChannel::get($call);
                $user->put;
        }
        $self->route_pc16($origin, $line, $parent, @rout) if @rout;
@@ -1016,7 +1016,7 @@ sub handle_19
                next if $call eq $main::mycall;
 
                # check that this PC19 isn't trying to alter the wrong dxchan
-               my $dxchan = DXChannel->get($call);
+               my $dxchan = DXChannel::get($call);
                if ($dxchan && $dxchan != $self) {
                        dbg("PCPROT: PC19 from $self->{call} trying to alter wrong locally connected $call, ignored!") if isdbg('chanerr');
                        next;
@@ -1098,7 +1098,7 @@ sub handle_19
                my $mref = DXMsg::get_busy($call);
                $mref->stop_msg($call) if $mref;
                                
-               $user->lastin($main::systime) unless DXChannel->get($call);
+               $user->lastin($main::systime) unless DXChannel::get($call);
                $user->put;
        }
 
@@ -1167,7 +1167,7 @@ sub handle_21
                        my $node = Route::Node::get($call);
                        if ($node) {
                                                
-                               my $dxchan = DXChannel->get($call);
+                               my $dxchan = DXChannel::get($call);
                                if ($dxchan && $dxchan != $self) {
                                        dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chanerr');
                                        return;
@@ -1549,10 +1549,10 @@ sub handle_51
                        # it's a reply, look in the ping list for this one
                        my $ref = $pings{$from};
                        if ($ref) {
-                               my $tochan =  DXChannel->get($from);
+                               my $tochan =  DXChannel::get($from);
                                while (@$ref) {
                                        my $r = shift @$ref;
-                                       my $dxchan = DXChannel->get($r->{call});
+                                       my $dxchan = DXChannel::get($r->{call});
                                        next unless $dxchan;
                                        my $t = tv_interval($r->{t}, [ gettimeofday ]);
                                        if ($dxchan->is_user) {
@@ -1700,7 +1700,7 @@ sub handle_default
 sub process
 {
        my $t = time;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        my $pc50s;
        
@@ -1761,7 +1761,7 @@ sub send_dx_spot
 {
        my $self = shift;
        my $line = shift;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        
        # send it if it isn't the except list and isn't isolated and still has a hop count
@@ -1812,7 +1812,7 @@ sub send_wwv_spot
 {
        my $self = shift;
        my $line = shift;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        my @dxcc = ((Prefix::cty_data($_[6]))[0..2], (Prefix::cty_data($_[7]))[0..2]);
 
@@ -1846,7 +1846,7 @@ sub send_wcy_spot
 {
        my $self = shift;
        my $line = shift;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        my @dxcc = ((Prefix::cty_data($_[10]))[0..2], (Prefix::cty_data($_[11]))[0..2]);
        
@@ -1879,7 +1879,7 @@ sub send_announce
 {
        my $self = shift;
        my $line = shift;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        my $target;
        my $to = 'To ';
@@ -1944,7 +1944,7 @@ sub send_chat
 {
        my $self = shift;
        my $line = shift;
-       my @dxchan = DXChannel->get_all();
+       my @dxchan = DXChannel::get_all();
        my $dxchan;
        my $target = $_[3];
        my $text = unpad($_[2]);
@@ -2085,7 +2085,7 @@ sub route
        }
 
        # always send it down the local interface if available
-       my $dxchan = DXChannel->get($call);
+       my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                dbg("route: $call -> $dxchan->{call} direct" ) if isdbg('route');
        } else {
@@ -2108,7 +2108,7 @@ sub route
                                dbg("PCPROT: Trying to route back to source, dropped") if isdbg('chanerr');
                                return;
                        }
-                       $dxchan = DXChannel->get($rcall);
+                       $dxchan = DXChannel::get($rcall);
                        dbg("route: $call -> $rcall using RouteDB" ) if isdbg('route') && $dxchan;
                }
        }
@@ -2189,7 +2189,7 @@ sub addping
        my $r = {};
        $r->{call} = $from;
        $r->{t} = [ gettimeofday ];
-       if ($via && (my $dxchan = DXChannel->get($via))) {
+       if ($via && (my $dxchan = DXChannel::get($via))) {
                $dxchan->send(pc51($to, $main::mycall, 1));
        } else {
                route(undef, $to, pc51($to, $main::mycall, 1));
@@ -2241,13 +2241,13 @@ sub process_rcmd_reply
        if ($tonode eq $main::mycall) {
                my $s = $rcmds{$fromnode};
                if ($s) {
-                       my $dxchan = DXChannel->get($s->{call});
-                       my $ref = $user eq $tonode ? $dxchan : (DXChannel->get($user) || $dxchan);
+                       my $dxchan = DXChannel::get($s->{call});
+                       my $ref = $user eq $tonode ? $dxchan : (DXChannel::get($user) || $dxchan);
                        $ref->send($line) if $ref;
                        delete $rcmds{$fromnode} if !$dxchan;
                } else {
                        # send unsolicited ones to the sysop
-                       my $dxchan = DXChannel->get($main::myalias);
+                       my $dxchan = DXChannel::get($main::myalias);
                        $dxchan->send($line) if $dxchan;
                }
        } else {
index 62f262907fc6fa0ba6a48750766d95632e555b8f..8b856b13736834dad51505141621417dc7fcc7f0 100644 (file)
@@ -264,7 +264,7 @@ sub get_current
        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};
index 4443fc5570ac2360d40af67587c5d10f028aeec4..a2f5ce46a7bac5f070e8531eaef59389e0f28b07 100644 (file)
@@ -307,7 +307,7 @@ sub install
        } elsif ($name eq 'USER_DEFAULT') {
                @dxchan = DXChannel::get_all_users();
        } else {
-               $dxchan = DXChannel->get($name);
+               $dxchan = DXChannel::get($name);
                push @dxchan, $dxchan if $dxchan;
        }
        foreach $dxchan (@dxchan) {
index e1cb9b2801c46e72d41b4527563689b0b98b2e1a..426e23ebfe11ab5650be7ecd79320da6662161f0 100644 (file)
@@ -95,7 +95,7 @@ sub handle_ping
                        $user->set_believe($self->{call});
                        $user->put;
                }
-               my $dxchan = DXChannel->get($self->{via});
+               my $dxchan = DXChannel::get($self->{via});
                if ($dxchan) {
                        dbg("Investigate: sending PC19 for $self->{call}") if isdbg('investigate');
                        foreach my $pc (@{$self->{pcxx}}) {
index 0f52e39b4023285ad994ad533feb18d66ad11f19..abd3dcbb74ff5741da45efa13b60ce42b6204d5c 100644 (file)
@@ -203,7 +203,7 @@ sub config
                $call = ' ' x length $call; 
                
                # recursion detector
-               if ((DXChannel->get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
+               if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
                        $line .= ' ...';
                        push @out, $line;
                        return @out;
@@ -281,7 +281,7 @@ sub alldxchan
        my @dxchan;
 #      dbg("Trying node $self->{call}") if isdbg('routech');
 
-       my $dxchan = DXChannel->get($self->{call});
+       my $dxchan = DXChannel::get($self->{call});
        push @dxchan, $dxchan if $dxchan;
        
        # it isn't, build up a list of dxchannels and possible ping times 
@@ -290,7 +290,7 @@ sub alldxchan
                foreach my $p (@{$self->{parent}}) {
 #                      dbg("Trying parent $p") if isdbg('routech');
                        next if $p eq $main::mycall; # the root
-                       my $dxchan = DXChannel->get($p);
+                       my $dxchan = DXChannel::get($p);
                        if ($dxchan) {
                                push @dxchan, $dxchan unless grep $dxchan == $_, @dxchan;
                        } else {
@@ -310,7 +310,7 @@ sub dxchan
        my $self = shift;
        
        # ALWAYS return the locally connected channel if present;
-       my $dxchan = DXChannel->get($self->call);
+       my $dxchan = DXChannel::get($self->call);
        return $dxchan if $dxchan;
        
        my @dxchan = $self->alldxchan;
index 1448ba9180a73748bf3faaa48cd131e47e884182..5fc41ef724751b169e86b89e2feb3f85f725bff4 100755 (executable)
@@ -172,7 +172,7 @@ sub new_channel
        # set up the basic channel info
        # is there one already connected to me - locally? 
        my $user = DXUser->get_current($call);
-       my $dxchan = DXChannel->get($call);
+       my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                if ($user && $user->is_node) {
                        already_conn($conn, $call, DXM::msg($lang, 'concluster', $call, $main::mycall));
@@ -254,13 +254,13 @@ sub cease
        dbg("Local::finish error $@") if $@;
 
        # disconnect nodes
-       foreach $dxchan (DXChannel->get_all_nodes) {
+       foreach $dxchan (DXChannel::get_all_nodes) {
            $dxchan->disconnect(2) unless $dxchan == $main::me;
        }
        Msg->event_loop(100, 0.01);
 
        # disconnect users
-       foreach $dxchan (DXChannel->get_all_users) {
+       foreach $dxchan (DXChannel::get_all_users) {
                $dxchan->disconnect;
        }