From 5fc468a5ca08ec51a9b6994605db183b273b9184 Mon Sep 17 00:00:00 2001
From: minima <minima>
Date: Mon, 7 Mar 2005 23:12:07 +0000
Subject: [PATCH] now output more information

---
 perl/DXUtil.pm      |  6 ++----
 perl/Thingy/Ping.pm | 15 ++++++++++++++-
 perl/console.pl     |  8 ++++++++
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm
index 468f225f..8a5cffe4 100644
--- a/perl/DXUtil.pm
+++ b/perl/DXUtil.pm
@@ -16,10 +16,8 @@ use Data::Dumper;
 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(@month %patmap @ISA @EXPORT);
 
diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm
index edcd8fe7..ce641812 100644
--- a/perl/Thingy/Ping.pm
+++ b/perl/Thingy/Ping.pm
@@ -31,7 +31,7 @@ sub gen_Aranea
 {
 	my $thing = shift;
 	unless ($thing->{Aranea}) {
-	 	$thing->{Aranea} = Aranea::genmsg($thing, qw(id));
+	 	$thing->{Aranea} = Aranea::genmsg($thing, qw(id out));
 	}
  	return $thing->{Aranea};
 }
@@ -47,6 +47,19 @@ sub gen_DXProt
 {
 	my $thing = shift;
 	my $dxchan = shift;
+	unless ($thing->{DXProt}) {
+		# we need to tease out the nodes out of all of this.
+		# bear in mind that a proxied PC prot node could be in
+		# {user} as well as a true user and also it may not
+		# have originated here.
+
+		my $from = $thing->{user} if Route::Node::get($thing->{user});
+		$from ||= $thing->{origin};
+		my $to = $thing->{touser} if Route::Node::get($thing->{touser});
+		$to ||= $thing->{group};
+		
+		$thing->{DXProt} = DXProt::pc51($to, $from, $thing->{out});
+	}
 	return $thing->{DXProt};
 }
 
diff --git a/perl/console.pl b/perl/console.pl
index bc3ca0d6..597c5eff 100755
--- a/perl/console.pl
+++ b/perl/console.pl
@@ -23,6 +23,14 @@ BEGIN {
 	
 	unshift @INC, "$root/perl";	# this IS the right way round!
 	unshift @INC, "$root/local";
+
+	sub main::mkver
+	{
+		my $s = shift;
+		my ($v, $b) = $s =~ /(\d+\.\d+)(?:\.(\d+\.\d+))?/;
+		$main::build += sprintf "%.3f", $v;
+		$main::branch += sprintf("%.3f", $b) if $b;
+	}
 }
 
 use Msg;
-- 
2.43.0