make PC29 output correct on empty lines
[spider.git] / perl / DXProtout.pm
index ee761cdc83a99dc12896d841f2bc70025c0ac961..8de0185b10b22fb45c84b3ea3a2d11246fe71dc9 100644 (file)
@@ -15,7 +15,7 @@ package DXProt;
 
 use DXUtil;
 use DXM;
-use Carp;
+use DXDebug;
 
 use strict;
 
@@ -27,10 +27,16 @@ use strict;
 sub pc10
 {
        my ($from, $to, $via, $text) = @_;
-       my $user2 = $via ? $to : ' ';
-       my $user1 = $via ? $via : $to;
+       my ($user1, $user2);
+       if ($via && $via ne $to) {
+               $user1 = $via;
+               $user2 = $to;
+       } else {
+               $user2 = ' ';
+               $user1 = $to;
+       }
        $text = unpad($text);
-       $text = ' ' if !$text;
+       $text = ' ' unless $text && length $text > 0;
        return "PC10^$from^$user1^$text^*^$user2^$main::mycall^~";  
 }
 
@@ -185,8 +191,8 @@ sub pc28
 sub pc29 
 {
        my ($fromnode, $tonode, $stream, $text) = @_;
-       $text =~ s/\^/:/og;                     # remove ^
-#      $text =~ s/\~/S/og;
+       $text = ' ' unless $text && length $text > 0;
+       $text =~ s/\^/%5E/og;                   # remove ^
        return "PC29^$fromnode^$tonode^$stream^$text^~";
 }
 
@@ -316,5 +322,23 @@ sub pc51
        my ($to, $from, $val) = @_;
        return "PC51^$to^$from^$val^";
 }
+
+# clx remote cmd send
+sub pc84
+{
+       my($fromnode, $tonode, $call, $msg) = @_;
+       return "PC84^$tonode^$fromnode^$call^$msg^~";
+}
+
+# clx remote cmd reply
+sub pc85
+{
+       my($fromnode, $tonode, $call, $msg) = @_;
+       return "PC85^$tonode^$fromnode^$call^$msg^~";
+}
+
 1;
 __END__
+
+
+