X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=08b28acd3298b81d3ec7e644dd387aa70977698e;hb=6d0ecd3545795aecacff640efc5ccc4e01be892b;hp=051332b03b75c8f85ff9e32d75dbe23755a25f0d;hpb=942a06f9a573659489eb4a9185b73c4296cd31fd;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 051332b0..08b28acd 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -155,6 +155,11 @@ sub start $self->{registered} = 1; } + # establish slug queue, if required + $self->{sluggedpcs} = []; + $self->{isslugged} = $DXProt::pc92_slug_changes + $DXProt::last_pc92_slug + 5 if $DXProt::pc92_slug_changes; + $self->{isslugged} = 0 if $self->{priv} > 0 || $user->registered || $user->homenode eq $main::mycall; + # send the relevant MOTD $self->send_motd; @@ -609,11 +614,17 @@ sub process } ++$users; $maxusers = $users if $users > $maxusers; - } - while (my ($k, $v) = each %nothereslug) { - if ($main::systime >= $v + 300) { - delete $nothereslug{$k}; + if ($dxchan->{isslugged} && $main::systime > $dxchan->{isslugged}) { + foreach my $ref (@{$dxchan->{sluggedpcs}}) { + if ($ref->[0] == 61) { + Spot::add(@{$ref->[2]}); + DXProt::send_dx_spot($dxchan, $ref->[1], @{$ref->[2]}); + } + } + + $dxchan->{isslugged} = 0; + $dxchan->{sluggedpcs} = []; } } @@ -1001,6 +1012,7 @@ sub format_dx_spot my $comment = substr (($_[3] || ''), 0, $clth); $comment =~ s/\t/ /g; + $comment .= ' ' x ($clth - (length($comment))); if ($self->{user}->wantgrid) { @@ -1027,9 +1039,10 @@ sub format_dx_spot $comment = substr($comment, 0, $clth-3) . ' ' . $_[12] if $_[12]; } - return sprintf "DX de %-9.9s%10.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment; + return sprintf "DX de %-9.9s%9.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment; } + # send a dx spot sub dx_spot {