make sure that sentences are less than the maximum
authorminima <minima>
Wed, 16 Oct 2002 17:18:21 +0000 (17:18 +0000)
committerminima <minima>
Wed, 16 Oct 2002 17:18:21 +0000 (17:18 +0000)
cmd/dx.pl
perl/DXProtout.pm
perl/DXUser.pm
perl/Messages

index eefbb8603380ad7e7c8978e64290598d6d290f02..46d427e0fb57333c5fe78a2425394429df65ac7c 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -103,7 +103,7 @@ return (1, @out) unless $valid;
 
 # Store it here (but only if it isn't baddx)
 my $t = (int ($main::systime/60)) * 60;
-return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line, $spotter);
+return (1, $self->msg('dupspot')) if Spot::dup($freq, $spotted, $t, $line, $spotter);
 my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall);
 
 if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) {
index 80b1a5d6eeb916b94fd45bfc1f215bedd627746c..1ef9c022a24d996c865ab162200f280cf4dc01f8 100644 (file)
@@ -25,6 +25,10 @@ $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0))
 $main::build += $VERSION;
 $main::branch += $BRANCH;
 
+use vars qw($sentencelth);
+
+$sentencelth = 200;
 #
 # All the PCxx generation routines
 #
@@ -85,15 +89,18 @@ sub pc16
        my $ncall = $node->call;
        my @out;
 
-       while (@_) {
-               my $str = "PC16^$ncall";
-               for ( ; @_ && length $str < 200; ) {
-                       my $ref = shift;
-                       $str .= sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;
+       my $s = "";
+       for (@_) {
+               next unless $_;
+               my $ref = $_;
+               my $str = sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;
+               if (length($s) + length($str) >= $sentencelth) {
+                       push @out, "PC16^$ncall" . $s . sprintf "^%s^", get_hops(16);
+                       $s = "";
                }
-               $str .= sprintf "^%s^", get_hops(16);
-               push @out, $str;
+               $s .= $str;
        }
+       push @out, "PC16^$ncall" . $s . sprintf "^%s^", get_hops(16) if length $s;
        return @out;
 }
 
@@ -124,20 +131,24 @@ sub pc18
 sub pc19
 {
        my @out;
-
-       while(@_) {
-               my $str = "PC19";
-               for (; @_ && length $str < 200;) {
-                       my $ref = shift;
-                       my $call = $ref->call;
-                       my $here = $ref->here;
-                       my $conf = $ref->conf;
-                       my $version = $ref->version;
-                       $str .= "^$here^$call^$conf^$version";
+       my @in;
+
+       my $s = "";
+       for (@_) {
+               next unless $_;
+               my $ref = $_;
+               my $call = $ref->call;
+               my $here = $ref->here;
+               my $conf = $ref->conf;
+               my $version = $ref->version;
+           my $str = "^$here^$call^$conf^$version";
+               if (length($s) + length($str) >= $sentencelth) {
+                       push @out, "PC19" . $s . sprintf "^%s^", get_hops(19);
+                       $s = "";
                }
-               $str .= sprintf "^%s^", get_hops(19);
-               push @out, $str;
+               $s .= $str;
        }
+       push @out, "PC19" . $s . sprintf "^%s^", get_hops(19) if length $s;
        return @out;
 }
 
index afc70cb0e08516f0331b19264782528950e8d823..f31b79e6da0ee167b0bd83e9de92d73ccbad73ea 100644 (file)
@@ -78,6 +78,8 @@ $lrusize = 2000;
                  wantann_talk => '0,Talklike Anns,yesno',
                  wantpc90 => '1,Req PC90,yesno',
                  wantnp => '1,Req New Protocol,yesno',
+                 wantusers => '9,Want Users from node,yesno',
+                 wantsendusers => '9,Send users to node,yesno',
                  lastoper => '9,Last for/oper,cldatetime',
                  nothere => '0,Not Here Text',
                  registered => '9,Registered?,yesno',
@@ -583,6 +585,16 @@ sub wantann_talk
        return _want('ann_talk', @_);
 }
 
+sub wantusers
+{
+       return _want('users', @_);
+}
+
+sub wantsendusers
+{
+       return _want('annsendusers', @_);
+}
+
 sub wantlogininfo
 {
        my $self = shift;
index cd9e572be8302264817d2961eb448831bb77b605..bfe83a2648c9e23ac8c68805505295e794b01a2e 100644 (file)
@@ -49,6 +49,7 @@ package DXM;
                                disc4 => 'No Channel or connection but orphan $_[0] disconnected',
                                done => 'Done',
                                dup => 'Sorry, this is a duplicate',
+                               dupspot => 'Sorry, this is a duplicate (wait a minute and try again)',
                                dx1 => 'Frequency $_[0] not in band (see show/band); usage: DX [BY call] freq call comments',
                                dx2 => 'Need a callsign; usage: DX [BY call] freq call comments',
                                dx3 => 'The callsign or frequency is invalid',