From c3c15883cf25add24fc49e32eb0d17dce6839a62 Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 20 Feb 2005 23:56:18 +0000 Subject: [PATCH] fix all DXChannel->get to ::get --- cmd/connect.pl | 2 +- cmd/dbshow.pl | 2 +- cmd/delete/user.pl | 2 +- cmd/demonstrate.pl | 2 +- cmd/disconnect.pl | 4 ++-- cmd/forward/latlong.pl | 2 +- cmd/init.pl | 2 +- cmd/links.pl | 2 +- cmd/pc.pl | 2 +- cmd/rinit.pl | 2 +- cmd/set/announce.pl | 2 +- cmd/set/anntalk.pl | 2 +- cmd/set/arcluster.pl | 2 +- cmd/set/bbs.pl | 2 +- cmd/set/clx.pl | 2 +- cmd/set/dx.pl | 2 +- cmd/set/dxnet.pl | 2 +- cmd/set/here.pl | 2 +- cmd/set/isolate.pl | 2 +- cmd/set/node.pl | 2 +- cmd/set/obscount.pl | 2 +- cmd/set/pinginterval.pl | 2 +- cmd/set/privilege.pl | 2 +- cmd/set/register.pl | 2 +- cmd/set/spider.pl | 2 +- cmd/set/talk.pl | 2 +- cmd/set/wcy.pl | 2 +- cmd/set/wwv.pl | 2 +- cmd/set/wx.pl | 2 +- cmd/show/configuration.pl | 2 +- cmd/spoof.pl | 2 +- cmd/stat/channel.pl | 2 +- cmd/unset/announce.pl | 2 +- cmd/unset/anntalk.pl | 2 +- cmd/unset/dx.pl | 2 +- cmd/unset/here.pl | 2 +- cmd/unset/isolate.pl | 2 +- cmd/unset/node.pl | 2 +- cmd/unset/register.pl | 2 +- cmd/unset/talk.pl | 2 +- cmd/unset/wcy.pl | 2 +- cmd/unset/wwv.pl | 2 +- cmd/unset/wx.pl | 2 +- perl/AMsg.pm | 2 +- perl/DXChannel.pm | 5 ++--- perl/DXCommandmode.pm | 8 +++---- perl/DXCron.pm | 4 ++-- perl/DXDb.pm | 2 +- perl/DXMsg.pm | 2 +- perl/DXProt.pm | 44 +++++++++++++++++++-------------------- perl/DXUser.pm | 2 +- perl/Filter.pm | 10 ++++----- perl/Investigate.pm | 2 +- perl/Route.pm | 8 +++---- perl/Thingy.pm | 2 +- perl/Thingy/Rt.pm | 2 +- perl/cluster.pl | 6 +++--- 57 files changed, 92 insertions(+), 95 deletions(-) diff --git a/cmd/connect.pl b/cmd/connect.pl index 1f1ad03f..e76bd01e 100644 --- a/cmd/connect.pl +++ b/cmd/connect.pl @@ -7,7 +7,7 @@ my $lccall = lc $call; return (1, $self->msg('e5')) if $self->priv < 5; return (1, $self->msg('e6')) unless $call gt ' '; -return (1, $self->msg('already', $call)) if DXChannel->get($call); +return (1, $self->msg('already', $call)) if DXChannel::get($call); return (1, $self->msg('outconn', $call)) if grep {$_->{call} eq $call} @main::outstanding_connects; return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall"; diff --git a/cmd/dbshow.pl b/cmd/dbshow.pl index 309ce8a5..6290dd3a 100644 --- a/cmd/dbshow.pl +++ b/cmd/dbshow.pl @@ -24,7 +24,7 @@ foreach $n (@db) { if ($db->remote) { # remote databases - unless (Route::Node::get($db->remote) || DXChannel->get($db->remote)) { + unless (Route::Node::get($db->remote) || DXChannel::get($db->remote)) { push @out, $self->msg('db4', uc $name, $db->remote); last; } diff --git a/cmd/delete/user.pl b/cmd/delete/user.pl index ac5a8034..5ab03a4f 100644 --- a/cmd/delete/user.pl +++ b/cmd/delete/user.pl @@ -18,7 +18,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/demonstrate.pl b/cmd/demonstrate.pl index 7ef0277e..1d2231e8 100644 --- a/cmd/demonstrate.pl +++ b/cmd/demonstrate.pl @@ -11,7 +11,7 @@ my ($self, $line) = @_; my ($call, $newline) = split /\s+/, $line, 2; $call = uc $call; -my $dxchan = DXChannel->get($call); +my $dxchan = DXChannel::get($call); my $mycall = $self->call; return (1, $self->msg('e7', $call)) unless $dxchan; diff --git a/cmd/disconnect.pl b/cmd/disconnect.pl index a023c609..60078704 100644 --- a/cmd/disconnect.pl +++ b/cmd/disconnect.pl @@ -13,7 +13,7 @@ if ($self->priv < 5) { foreach $call (@calls) { $call = uc $call; next if $call eq $main::mycall; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); if ($dxchan) { if ($dxchan->is_node) { # $dxchan->send_pc39($self->msg('disc1', $self->call)); @@ -28,7 +28,7 @@ foreach $call (@calls) { push @out, $self->msg('disc3', $call); # } elsif (my $ref = DXCluster->get_exact($call)) { # my $dxchancall = $ref->dxchancall; -# if ($dxchancall eq $main::mycall || !DXChannel->get($dxchancall)) { +# if ($dxchancall eq $main::mycall || !DXChannel::get($dxchancall)) { # $ref->del; # push @out, $self->msg('disc4', $call); # } diff --git a/cmd/forward/latlong.pl b/cmd/forward/latlong.pl index 7f6472bd..e1023989 100644 --- a/cmd/forward/latlong.pl +++ b/cmd/forward/latlong.pl @@ -16,7 +16,7 @@ my @out; my $dxchan; for ( map {uc $_ } split /\s+/, $line ) { - if (($dxchan = DXChannel->get($_)) && $dxchan->is_node) { + if (($dxchan = DXChannel::get($_)) && $dxchan->is_node) { push @dxchan, $dxchan; } else { push @out, $self->msg('e10', $_); diff --git a/cmd/init.pl b/cmd/init.pl index ab49b6ee..b508a04a 100644 --- a/cmd/init.pl +++ b/cmd/init.pl @@ -15,7 +15,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@calls) { $call = uc $call; next if $call eq $main::mycall; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); if ($dxchan) { if ($dxchan->is_node) { # first clear out any nodes on this dxchannel diff --git a/cmd/links.pl b/cmd/links.pl index 68e2d044..1289211e 100644 --- a/cmd/links.pl +++ b/cmd/links.pl @@ -18,7 +18,7 @@ my $nowt = time; push @out, " Ave Obs Ping Sec Since"; push @out, " Callsign Type Started RTT count Int. Last Ping"; -foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all() ) { +foreach $dxchan ( sort {$a->call cmp $b->call} grep {$_->is_node || $_->is_aranea} DXChannel::get_all() ) { next if $dxchan->is_user; my $call = $dxchan->call(); next if $dxchan == $main::me; diff --git a/cmd/pc.pl b/cmd/pc.pl index dcc2f668..12ab8fdc 100644 --- a/cmd/pc.pl +++ b/cmd/pc.pl @@ -12,7 +12,7 @@ my @f = split /\s+/, $line; return (1, $self->msg('e5')) if $self->priv < 8 || $self->remotecmd || $self->inscript; my $call = uc shift @f; -my $dxchan = DXChannel->get($call); +my $dxchan = DXChannel::get($call); return (1, $self->msg('e10', $call)) if !$dxchan; return (1, $self->msg('e8')) if @f <= 0; diff --git a/cmd/rinit.pl b/cmd/rinit.pl index 953a30a9..3a7e17c0 100644 --- a/cmd/rinit.pl +++ b/cmd/rinit.pl @@ -15,7 +15,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@calls) { $call = uc $call; next if $call eq $main::mycall; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); if ($dxchan) { if ($dxchan->is_node) { my $parent = Route::Node::get($call); diff --git a/cmd/set/announce.pl b/cmd/set/announce.pl index 323ff5e0..533d177a 100644 --- a/cmd/set/announce.pl +++ b/cmd/set/announce.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->ann(1); $chan->user->wantann(1); diff --git a/cmd/set/anntalk.pl b/cmd/set/anntalk.pl index eec65400..2d70f846 100644 --- a/cmd/set/anntalk.pl +++ b/cmd/set/anntalk.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->ann_talk(1); $chan->user->wantann_talk(1); diff --git a/cmd/set/arcluster.pl b/cmd/set/arcluster.pl index 4e1dd452..6ad80c6c 100644 --- a/cmd/set/arcluster.pl +++ b/cmd/set/arcluster.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/bbs.pl b/cmd/set/bbs.pl index 0cb6cf39..f92f85de 100644 --- a/cmd/set/bbs.pl +++ b/cmd/set/bbs.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/clx.pl b/cmd/set/clx.pl index f453e41f..dd0ee2fd 100644 --- a/cmd/set/clx.pl +++ b/cmd/set/clx.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/dx.pl b/cmd/set/dx.pl index 8d599d5e..3eb9bbf0 100644 --- a/cmd/set/dx.pl +++ b/cmd/set/dx.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->dx(1); $chan->user->wantdx(1); diff --git a/cmd/set/dxnet.pl b/cmd/set/dxnet.pl index f8e3686f..e8714c53 100644 --- a/cmd/set/dxnet.pl +++ b/cmd/set/dxnet.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/here.pl b/cmd/set/here.pl index 1c4b167c..646997ea 100644 --- a/cmd/set/here.pl +++ b/cmd/set/here.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); if ($dxchan) { $dxchan->here(1); push @out, $self->msg('heres', $call); diff --git a/cmd/set/isolate.pl b/cmd/set/isolate.pl index 89d8257b..b90f0c2b 100644 --- a/cmd/set/isolate.pl +++ b/cmd/set/isolate.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 9; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/node.pl b/cmd/set/node.pl index 4eeae7f1..95b38bb6 100644 --- a/cmd/set/node.pl +++ b/cmd/set/node.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/obscount.pl b/cmd/set/obscount.pl index e37387fe..8a6dc425 100644 --- a/cmd/set/obscount.pl +++ b/cmd/set/obscount.pl @@ -20,7 +20,7 @@ return (1, $self->msg('e12')) unless @args; foreach $call (@args) { $call = uc $call; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); $user = $dxchan->user if $dxchan; $user = DXUser->get_current($call); if ($user) { diff --git a/cmd/set/pinginterval.pl b/cmd/set/pinginterval.pl index 6511c5b6..1e1da569 100644 --- a/cmd/set/pinginterval.pl +++ b/cmd/set/pinginterval.pl @@ -32,7 +32,7 @@ if ($val =~ /^(\d+)[sS]$/) { foreach $call (@args) { $call = uc $call; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); $user = $dxchan->user if $dxchan; $user = DXUser->get($call) unless $user; if ($user) { diff --git a/cmd/set/privilege.pl b/cmd/set/privilege.pl index 6d5fd4d2..7f6cbd39 100644 --- a/cmd/set/privilege.pl +++ b/cmd/set/privilege.pl @@ -27,7 +27,7 @@ if ($priv < 0 || $priv > 9) { foreach $call (@args) { $call = uc $call; unless ($self->remotecmd || $self->inscript) { - if ($ref = DXChannel->get($call)) { + if ($ref = DXChannel::get($call)) { $ref->priv($priv); $ref->user->priv($priv); $ref->user->put(); diff --git a/cmd/set/register.pl b/cmd/set/register.pl index 3a7c7db5..509eaff6 100644 --- a/cmd/set/register.pl +++ b/cmd/set/register.pl @@ -32,7 +32,7 @@ foreach $call (@args) { $ref->put(); push @out, $self->msg("regc", $call); } - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); $dxchan->registered(1) if $dxchan; Log('DXCommand', $self->call . " registered $call"); } else { diff --git a/cmd/set/spider.pl b/cmd/set/spider.pl index 7bd3e6a6..9c821826 100644 --- a/cmd/set/spider.pl +++ b/cmd/set/spider.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/set/talk.pl b/cmd/set/talk.pl index 70bde6e7..0c1e6be7 100644 --- a/cmd/set/talk.pl +++ b/cmd/set/talk.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->talk(1); $chan->user->wanttalk(1); diff --git a/cmd/set/wcy.pl b/cmd/set/wcy.pl index 1aed404c..8efd6299 100644 --- a/cmd/set/wcy.pl +++ b/cmd/set/wcy.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { DXChannel::wcy($chan, 1); $chan->user->wantwcy(1); diff --git a/cmd/set/wwv.pl b/cmd/set/wwv.pl index da06ebc1..33ac7861 100644 --- a/cmd/set/wwv.pl +++ b/cmd/set/wwv.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { DXChannel::wwv($chan, 1); $chan->user->wantwwv(1); diff --git a/cmd/set/wx.pl b/cmd/set/wx.pl index f609df35..ef6a71cc 100644 --- a/cmd/set/wx.pl +++ b/cmd/set/wx.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->wx(1); $chan->user->wantwx(1); diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index 3386a171..af81ad21 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -16,7 +16,7 @@ my @val; push @out, $self->msg('showconf'); if ($list[0] && $list[0] =~ /^NOD/) { - my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes(); + my @ch = sort {$a->call cmp $b->call} grep {$_->is_node || $_->is_aranea} DXChannel::get_all(); my $dxchan; foreach $dxchan (@ch) { diff --git a/cmd/spoof.pl b/cmd/spoof.pl index 5336a324..ad2f9b8c 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -13,7 +13,7 @@ my $myuser = $self->user; my $mylang = $self->lang; my ($call, $newline) = split /\s+/, $line, 2; -return (1, $self->msg('nodee1', $call)) if DXChannel->get($call); +return (1, $self->msg('nodee1', $call)) if DXChannel::get($call); if ($self->remotecmd || $self->inscript) { Log('DXCommand', "$mycall is trying to spoof $call remotely"); diff --git a/cmd/stat/channel.pl b/cmd/stat/channel.pl index d963eb45..be4e5f93 100644 --- a/cmd/stat/channel.pl +++ b/cmd/stat/channel.pl @@ -13,7 +13,7 @@ my $call; my @out; foreach $call (@list) { $call = uc $call; - my $ref = DXChannel->get($call); + my $ref = DXChannel::get($call); if ($ref) { @out = print_all_fields($self, $ref, "Channel Information $call"); } else { diff --git a/cmd/unset/announce.pl b/cmd/unset/announce.pl index 2c4ebd30..3e7b61dc 100644 --- a/cmd/unset/announce.pl +++ b/cmd/unset/announce.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->ann(0); $chan->user->wantann(0); diff --git a/cmd/unset/anntalk.pl b/cmd/unset/anntalk.pl index 7e8f012f..9b7cc238 100644 --- a/cmd/unset/anntalk.pl +++ b/cmd/unset/anntalk.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->ann_talk(0); $chan->user->wantann_talk(0); diff --git a/cmd/unset/dx.pl b/cmd/unset/dx.pl index dcc177a9..2090b780 100644 --- a/cmd/unset/dx.pl +++ b/cmd/unset/dx.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->dx(0); $chan->user->wantdx(0); diff --git a/cmd/unset/here.pl b/cmd/unset/here.pl index 19db8dbd..d83d59cb 100644 --- a/cmd/unset/here.pl +++ b/cmd/unset/here.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); if ($dxchan) { $dxchan->here(0); push @out, $self->msg('hereu', $call); diff --git a/cmd/unset/isolate.pl b/cmd/unset/isolate.pl index ecf03317..6396caef 100644 --- a/cmd/unset/isolate.pl +++ b/cmd/unset/isolate.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/unset/node.pl b/cmd/unset/node.pl index 671f1b2d..76350a3f 100644 --- a/cmd/unset/node.pl +++ b/cmd/unset/node.pl @@ -19,7 +19,7 @@ return (1, $self->msg('e5')) if $self->priv < 5; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { push @out, $self->msg('nodee1', $call); } else { diff --git a/cmd/unset/register.pl b/cmd/unset/register.pl index 555fe021..f789d1ed 100644 --- a/cmd/unset/register.pl +++ b/cmd/unset/register.pl @@ -25,7 +25,7 @@ foreach $call (@args) { if ($ref = DXUser->get_current($call)) { $ref->registered(0); $ref->put(); - my $dxchan = DXChannel->get($call); + my $dxchan = DXChannel::get($call); $dxchan->registered(0) if $dxchan; push @out, $self->msg("regun", $call); Log('DXCommand', $self->call . " unregistered $call"); diff --git a/cmd/unset/talk.pl b/cmd/unset/talk.pl index 77deccbc..c693cca5 100644 --- a/cmd/unset/talk.pl +++ b/cmd/unset/talk.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->talk(0); $chan->user->wanttalk(0); diff --git a/cmd/unset/wcy.pl b/cmd/unset/wcy.pl index 42b098a3..8d1cdbeb 100644 --- a/cmd/unset/wcy.pl +++ b/cmd/unset/wcy.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { DXChannel::wcy($chan, 0); $chan->user->wantwcy(0); diff --git a/cmd/unset/wwv.pl b/cmd/unset/wwv.pl index eebf16d7..57b04119 100644 --- a/cmd/unset/wwv.pl +++ b/cmd/unset/wwv.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { DXChannel::wwv($chan, 0); $chan->user->wantwwv(0); diff --git a/cmd/unset/wx.pl b/cmd/unset/wx.pl index 755ed026..21ed1a1c 100644 --- a/cmd/unset/wx.pl +++ b/cmd/unset/wx.pl @@ -15,7 +15,7 @@ my @out; foreach $call (@args) { $call = uc $call; - my $chan = DXChannel->get($call); + my $chan = DXChannel::get($call); if ($chan) { $chan->wx(0); $chan->user->wantwx(0); diff --git a/perl/AMsg.pm b/perl/AMsg.pm index 15596a98..4ca43cb4 100644 --- a/perl/AMsg.pm +++ b/perl/AMsg.pm @@ -170,7 +170,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 && $call ne $main::mycall) { my $ip = $conn->{peerhost} || 'unknown'; diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 90e19ef9..ad6e46b7 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -185,11 +185,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) = @_; - return $channels{$call}; + return $channels{$_[0]}; } # obtain all the channel objects diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 02164669..937bbfea 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -498,7 +498,7 @@ sub run_cmd sub process { my $t = time; - my @dxchan = DXChannel->get_all(); + my @dxchan = DXChannel::get_all(); my $dxchan; foreach $dxchan (@dxchan) { @@ -589,7 +589,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 @@ -599,7 +599,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 @@ -895,7 +895,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); } diff --git a/perl/DXCron.pm b/perl/DXCron.pm index 86842058..2a9913f1 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -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; } diff --git a/perl/DXDb.pm b/perl/DXDb.pm index a088866c..833640f5 100644 --- a/perl/DXDb.pm +++ b/perl/DXDb.pm @@ -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; } } diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 67165ef4..b25b70a5 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -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) { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 2bf621e1..35f91fef 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -441,8 +441,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]); @@ -640,7 +640,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) { @@ -756,7 +756,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 @@ -827,7 +827,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; @@ -993,7 +993,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 $origin trying to alter wrong locally connected $call, ignored!") if isdbg('chanerr'); next; @@ -1075,7 +1075,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; } @@ -1144,7 +1144,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 $origin trying to alter locally connected $call, ignored!") if isdbg('chanerr'); return; @@ -1526,10 +1526,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) { @@ -1677,7 +1677,7 @@ sub handle_default sub process { my $t = time; - my @dxchan = DXChannel->get_all(); + my @dxchan = DXChannel::get_all(); my $dxchan; my $pc50s; @@ -1759,7 +1759,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]); @@ -1793,7 +1793,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]); @@ -1826,7 +1826,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 '; @@ -1891,7 +1891,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]); @@ -1987,7 +1987,7 @@ sub send_local_config # don't appear outside of this node # send locally connected nodes - my @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} } DXChannel::get_all_nodes(); + my @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} && ($_->is_node || $_->is_aranea) } DXChannel::get_all(); @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan if @dxchan; $self->send_route($main::mycall, \&pc19, scalar(@localnodes)+1, $main::routeroot, @localnodes); @@ -2032,7 +2032,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 { @@ -2055,7 +2055,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; } } @@ -2136,7 +2136,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)); @@ -2188,13 +2188,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 { diff --git a/perl/DXUser.pm b/perl/DXUser.pm index a349f6ab..056fe9ff 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -262,7 +262,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}; diff --git a/perl/Filter.pm b/perl/Filter.pm index 4b32ab50..74f74d44 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -35,10 +35,8 @@ use Prefix; use strict; 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)); -$main::build += $VERSION; -$main::branch += $BRANCH; + +main::mkver($VERSION = q$Revision$); use vars qw ($filterbasefn $in); @@ -304,11 +302,11 @@ sub install my $dxchan; my @dxchan; if ($name eq 'NODE_DEFAULT') { - @dxchan = DXChannel::get_all_nodes(); + @dxchan = grep{$_->is_node || $_->is_aranea} DXChannel::get_all(); } 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) { diff --git a/perl/Investigate.pm b/perl/Investigate.pm index e1cb9b28..426e23eb 100644 --- a/perl/Investigate.pm +++ b/perl/Investigate.pm @@ -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}}) { diff --git a/perl/Route.pm b/perl/Route.pm index e0cfe3e5..5f9de7d7 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -211,7 +211,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; @@ -289,7 +289,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 @@ -298,7 +298,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 { @@ -318,7 +318,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; diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 8b3f3cce..a420206d 100644 --- a/perl/Thingy.pm +++ b/perl/Thingy.pm @@ -115,7 +115,7 @@ sub process } while (@queue) { $thing = shift @queue; - my $dxchan = DXChannel->get($thing->{dxchan}); + my $dxchan = DXChannel::get($thing->{dxchan}); if ($dxchan) { if ($thing->can('in_filter')) { next unless $thing->in_filter($dxchan); diff --git a/perl/Thingy/Rt.pm b/perl/Thingy/Rt.pm index d7d73f48..798f0a82 100644 --- a/perl/Thingy/Rt.pm +++ b/perl/Thingy/Rt.pm @@ -86,7 +86,7 @@ sub upd_user_rec $user = DXUser->new($call) if !$user; $user->homenode($parentcall) if !$user->homenode; $user->node($parentcall); - $user->lastin($main::systime) unless DXChannel->get($call); + $user->lastin($main::systime) unless DXChannel::get($call); return $user; } diff --git a/perl/cluster.pl b/perl/cluster.pl index 6ad2a0ad..d7b3228f 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -377,7 +377,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)); @@ -459,13 +459,13 @@ sub cease dbg("Local::finish error $@") if $@; # disconnect nodes - foreach $dxchan (DXChannel->get_all_nodes) { + foreach $dxchan (grep {$_->is_node || $_->is_aranea} DXChannel::get_all()) { $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; } -- 2.43.0