# 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 = DXProt::pc16($nchan, $cuser);
+ DXProt::broadcast_ak1a(@pc16);
}
#
#
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($self);
+ DXProt::broadcast_ak1a($pc17);
+
+ $ref->del() if $ref;
}
#
my @r;
my $c = qq{ \@r = \$self->$package(\@_); };
dbg('eval', "cluster cmd = $c\n");
- eval $c; ;
+ eval $c;
if ($@) {
delete_package($package);
- return (0, "Syserr: Eval err $@ on cached $package");
+ return (1, "Syserr: Eval err $@ on cached $package");
}
#take a look if you want