X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProtout.pm;h=1ebb29bc8ceb7d356c7ac2d7309c2d4ad16d6a7b;hb=b67b50de92dbf61ce939b42f7c74e30dc58eba41;hp=da2d5fffb2e28b63b138e0ad1f8e4a3d2b5cbeb7;hpb=0bd9d2811cc42417676a1b11b121681c2377d70a;p=spider.git diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index da2d5fff..1ebb29bc 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -27,10 +27,17 @@ 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; + $text =~ s/\^/%5E/g; return "PC10^$from^$user1^$text^*^$user2^$main::mycall^~"; } @@ -41,6 +48,7 @@ sub pc11 my $hops = get_hops(11); my $t = time; $text = ' ' if !$text; + $text =~ s/\^/%5E/g; return sprintf "PC11^%.1f^$dxcall^%s^%s^$text^$mycall^$main::mycall^$hops^~", $freq, cldate($t), ztime($t); } @@ -53,6 +61,7 @@ sub pc12 $text = ' ' if !$text; $wx = '0' if !$wx; $tonode = '*' if !$tonode; + $text =~ s/\^/%5E/g; return "PC12^$call^$tonode^$text^$sysop^$main::mycall^$wx^$hops^~"; } @@ -67,17 +76,17 @@ sub pc16 { my $self = shift; my @out; + my $i; - foreach (@_) { + for ($i = 0; @_; ) { my $str = "PC16^$self->{call}"; - my $i; - - for ($i = 0; @_ > 0 && $i < $DXProt::pc16_max_users; $i++) { + for ( ; @_ && length $str < 200; $i++) { my $ref = shift; $str .= sprintf "^%s %s %d", $ref->call, $ref->confmode ? '*' : '-', $ref->here; } $str .= sprintf "^%s^", get_hops(16); push @out, $str; + $i = 0; } return (@out); } @@ -93,8 +102,7 @@ sub pc17 # Request init string sub pc18 { - my $info = DXCluster::cluster; - return "PC18^$info^$DXProt::myprot_version^"; + return "PC18^DXSpider Version: $main::version Build: $main::build^$DXProt::myprot_version^"; } # @@ -104,12 +112,12 @@ sub pc19 { my $self = shift; my @out; + my $i; + - while (@_) { + for ($i = 0; @_; ) { my $str = "PC19"; - my $i; - - for ($i = 0; @_ && $i < $DXProt::pc19_max_nodes; $i++) { + for (; @_ && length $str < 200; $i++) { my $ref = shift; my $here = $ref->{here} ? '1' : '0'; my $confmode = $ref->{confmode} ? '1' : '0'; @@ -117,6 +125,7 @@ sub pc19 } $str .= sprintf "^%s^", get_hops(19); push @out, $str; + $i = 0; } return @out; } @@ -185,8 +194,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 +325,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__ + + +