fix main:mkver()
authorminima <minima>
Fri, 11 Mar 2005 16:00:59 +0000 (16:00 +0000)
committerminima <minima>
Fri, 11 Mar 2005 16:00:59 +0000 (16:00 +0000)
improve Ping::from_DXProt

perl/DXProt.pm
perl/Thingy/Ping.pm
perl/create_sysop.pl
perl/grepdbg
perl/update_sysop.pl
perl/watchdbg

index ac755b099d98c64450eb2a108aa59db057a0de4c..3001d6eb1b3cb8a9c4f7fe894ff3cf2ec5ae8115 100644 (file)
@@ -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
index 02fc5cef51bea6caf1176bce93e4a98d4729d08a..60c68078452abdec6529be9c6d3094ce3f490f72 100644 (file)
@@ -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;
 }
 
index 11673e3146f55694f654bd1b7771811e779d1fcf..f14cf6d2b284337699a8bd5537e3c571bc20e61c 100755 (executable)
@@ -16,6 +16,7 @@ BEGIN {
        $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
 
        unshift @INC, "$root/local";
+       sub main::mkver {}
 }
 
 use DXVars;
index 3d1526f8d70b93446548ee9257ce7b0c87349484..e3db1205256b9ab636f72157e817c4ffef80d511 100755 (executable)
@@ -27,6 +27,7 @@ BEGIN {
        
        unshift @INC, "$root/perl";     # this IS the right way round!
        unshift @INC, "$root/local";
+       sub main::mkver {}
 }
 
 use DXVars;
index d93e096b8610f1341dfc7b8aeb97aa07ac6a4bb1..6c9ef77a9d634dce7f01a51b94b3e99d3e004914 100755 (executable)
@@ -20,6 +20,7 @@ BEGIN {
        $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
 
        unshift @INC, "$root/local";
+       sub main::mkver {}
 }
 
 use DXVars;
index 348ac8fe7bbbe5ab49101d635c429b9a66113ed3..0d0a349438571e89332c089137e1748cd4c733ea 100755 (executable)
@@ -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;