X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=d48de1c87a17d3edac8e27f358e3a21e46c2dd86;hb=20b0104deaeab77fa7ab1444dbcedfcdbf5865f8;hp=6a3603abd306f75b1260d243ae80340732026143;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 6a3603ab..d48de1c8 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -32,16 +32,17 @@ sub start my ($self, $line) = @_; my $user = $self->{user}; my $call = $self->{call}; - my $name = $self->{name}; - $name = $call if !defined $name; + my $name = $user->{name}; - $self->msg('l2',$name); + $self->{name} = $name ? $name : $call; + $self->msg('l2',$self->{name}); $self->send_file($main::motd) if (-e $main::motd); $self->msg('pr', $call); $self->state('prompt'); # a bit of room for further expansion, passwords etc $self->{priv} = $user->priv; $self->{priv} = 0 if $line =~ /^(ax|te)/; # set the connection priv to 0 - can be upgraded later $self->{consort} = $line; # save the connection type + $self->sort('U'); # set the channel type } # @@ -92,7 +93,19 @@ sub normal # sub process { + my $t = time; + my @chan = DXChannel->get_all(); + my $chan; + + foreach $chan (@chan) { + next if $chan->sort ne 'U'; + # send a prompt if no activity out on this channel + if ($t >= $chan->t + $main::user_interval) { + $chan->prompt() if $chan->{state} =~ /^prompt/o; + $chan->t($t); + } + } } #