X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=13943472ca462ec70c2f7f23448ae560a5295730;hb=1a9286080b21d5b65f97cab08d8a493abafad8f1;hp=bcf1bf075b9beda9f40279bb70b59fbcf4f5e008;hpb=c83b1ca22765fc07e5adcdc8dac24cbd066c9b95;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index bcf1bf07..13943472 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -147,13 +147,16 @@ sub start $user->wantusstate(0) unless defined $user->{wantusstate}; # sort out registration - if ($main::reqreg == 1) { - $self->{registered} = $user->registered; - } elsif ($main::reqreg == 2) { + if ($main::reqreg == 2) { $self->{registered} = !$user->registered; } else { - $self->{registered} = 1; - } + $self->{registered} = $user->registered; + } + + # 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 +612,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} = []; } } @@ -996,10 +1005,12 @@ sub format_dx_spot my $t = ztime($_[2]); my $loc = ''; - my $clth = 30; + my $clth = 30 + $self->{width} - 80; # allow comment to grow according the screen width # --$clth if $self->{consort} eq 'local'; my $comment = substr (($_[3] || ''), 0, $clth); + $comment =~ s/\t/ /g; + $comment .= ' ' x ($clth - (length($comment))); if ($self->{user}->wantgrid) { @@ -1026,9 +1037,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 %-8.8s%10.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment; } + # send a dx spot sub dx_spot { @@ -1273,7 +1285,7 @@ sub send_motd my $self = shift; my $motd; - unless ($self->{registered}) { + unless ($self->isregistered) { $motd = "${main::motd}_nor_$self->{lang}"; $motd = "${main::motd}_nor" unless -e $motd; } @@ -1384,5 +1396,20 @@ sub user_count { return ($users, $maxusers); } + +sub isregistered +{ + my $self = shift; + + # the sysop is registered! + return 1 if $self->call eq $main::myalias || $self->call eq $main::mycall; + + if ($main::reqreg) { + return $self->{registered}; + } else { + return 1; + } +} + 1; __END__