X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProtout.pm;h=bd210d880be9ed06a12813a5805b9c3a51bf82ad;hb=b32570d9978c9e99a8652e52491cf92540bf876b;hp=a9478812d13cb513f4541ceeffaaa15de3de074c;hpb=ea7e97b115dd46656a5aa7fabd19990e98a50df5;p=spider.git diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index a9478812..bd210d88 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -165,7 +165,7 @@ sub pc24 my $self = shift; my $call = $self->call; my $flag = $self->here ? '1' : '0'; - my $hops = get_hops(24); + my $hops = shift || get_hops(24); return "PC24^$call^$flag^$hops^"; } @@ -275,9 +275,13 @@ sub pc40 # user info sub pc41 { - my ($call, $sort, $info) = @_; - my $hops = get_hops(41); - $sort = $sort ? "$sort" : '0'; + my $call = shift; + $call = shift if ref $call; + + my ($sort, $info) = @_; + $sort ||= '0'; + $info ||= ' '; + my $hops = shift || get_hops(41); return "PC41^$call^$sort^$info^$hops^~"; } @@ -321,9 +325,11 @@ sub pc49 # periodic update of users, plus keep link alive device (always H99) sub pc50 { - my $n = shift; - $n = 0 unless $n >= 0; - return "PC50^$main::mycall^$n^H99^"; + my $self = shift; + my $call = $self->call; + my $n = shift || '0'; + my $hops = shift || 'H99'; + return "PC50^$call^$n^$hops^"; } # generate pings