From b051574851d84df8da1e17965cb50bb1a05a173e Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 11 Mar 2005 16:00:59 +0000 Subject: [PATCH] fix main:mkver() improve Ping::from_DXProt --- perl/DXProt.pm | 5 ++--- perl/Thingy/Ping.pm | 20 +++++++++++++------- perl/create_sysop.pl | 1 + perl/grepdbg | 1 + perl/update_sysop.pl | 1 + perl/watchdbg | 1 + 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/perl/DXProt.pm b/perl/DXProt.pm index ac755b09..3001d6eb 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1547,9 +1547,8 @@ sub handle_51 } my $thing = Thingy::Ping->new(origin=>$main::mycall); - $thing->from_DXProt($_[2] eq $self->{call} ? (user=>$_[2]) : (user=>$self->{call}, o=>$_[2]), group=>$_[1], out=>$_[3], DXProt=>$line); - $thing->process($self); - + $thing->from_DXProt($self, $line, @_); + $thing->handle($self); } # dunno but route it diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm index 02fc5cef..60c68078 100644 --- a/perl/Thingy/Ping.pm +++ b/perl/Thingy/Ping.pm @@ -22,10 +22,12 @@ use Spot; use Time::HiRes qw(gettimeofday tv_interval); -use vars qw(@ISA %ping); +use vars qw(@ISA %ping $ping_ttl); @ISA = qw(Thingy); my $id; +$ping_ttl = 300; # default ping ttl + sub gen_Aranea { @@ -74,14 +76,18 @@ sub gen_DXCommandmode return $buf; } +# called with the dxchan, line and the split out arguments sub from_DXProt { - my $thing = ref $_[0] ? shift : $_[0]->SUPER::new(); - - while (@_) { - my $k = shift; - $thing->{$k} = shift; - } + my $thing = ref $_[0] ? shift : $_[0]->SUPER::new(origin=>$main::mycall); + my $dxchan = shift; + $thing->{DXProt} = shift; + $thing->{group} = shift; # to call + my $from = shift; + $thing->{out} = shift; # 1 = ping, 0 = pong; + $thing->{user} = $dxchan->{call}; + $thing->{o} = $from unless $from eq $dxchan->{call}; + $thing->remember if $thing->{out}; return $thing; } diff --git a/perl/create_sysop.pl b/perl/create_sysop.pl index 11673e31..f14cf6d2 100755 --- a/perl/create_sysop.pl +++ b/perl/create_sysop.pl @@ -16,6 +16,7 @@ BEGIN { $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'}; unshift @INC, "$root/local"; + sub main::mkver {} } use DXVars; diff --git a/perl/grepdbg b/perl/grepdbg index 3d1526f8..e3db1205 100755 --- a/perl/grepdbg +++ b/perl/grepdbg @@ -27,6 +27,7 @@ BEGIN { unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; + sub main::mkver {} } use DXVars; diff --git a/perl/update_sysop.pl b/perl/update_sysop.pl index d93e096b..6c9ef77a 100755 --- a/perl/update_sysop.pl +++ b/perl/update_sysop.pl @@ -20,6 +20,7 @@ BEGIN { $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'}; unshift @INC, "$root/local"; + sub main::mkver {} } use DXVars; diff --git a/perl/watchdbg b/perl/watchdbg index 348ac8fe..0d0a3494 100755 --- a/perl/watchdbg +++ b/perl/watchdbg @@ -20,6 +20,7 @@ BEGIN { unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; + sub main::mkver {} } use IO::File; -- 2.43.0