X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=d39af559e625f135b6c5e1a032a3f0883b4ccb74;hp=9f7b3885712d7366a1daa66d4f272985502d528f;hb=7432cb12ce865030c8b0315a30764e0088a59102;hpb=e5b0e3dee551a224de284a5ba550098256fcb268 diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 9f7b3885..d39af559 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -59,7 +59,16 @@ sub start # set some necessary flags on the user if they are connecting $self->{wwv} = $self->{talk} = $self->{ann} = $self->{here} = $self->{dx} = 1; $self->prompt() if $self->{state} =~ /^prompt/o; - + + # add yourself to the database + my $node = DXNode->get($main::mycall) or die "$main::mycall not allocated in DXNode database"; + my $cuser = DXNodeuser->new($self, $node, $call, 0, 1); + $node->dxchan($self) if $call eq $main::myalias; # send all output for mycall to myalias + + # issue a pc16 to everybody interested + my $nchan = DXChannel->get($main::mycall); + my $pc16 = $nchan->pc16($cuser); + DXProt::broadcast_ak1a($pc16); } # @@ -133,7 +142,21 @@ sub process # sub finish { + my $self = shift; + my $call = $self->call; + if ($call eq $main::myalias) { # unset the channel if it is us really + my $node = DXNode->get($main::mycall); + $node->{dxchan} = 0; + } + my $ref = DXNodeuser->get($call); + + # issue a pc17 to everybody interested + my $nchan = DXChannel->get($main::mycall); + my $pc17 = $nchan->pc17($ref); + DXProt::broadcast_ak1a($pc17); + + $ref->del() if $ref; } #