29Oct00=======================================================================
1. put in echo cancelling measures into the clients. This doesn't mean you
shouldn't take steps to prevent echoing on node links, but it may help where
-(whatever you do) it still bloody echos! This is experimental.
+(whatever you do) it still bloody echos! This is experimental.
+2. store dxchan and mynode as callsigns (and not references) in the routing
+tables and do some checking in accessors to see if we can capture some errors.
28Oct00=======================================================================
1. updated show/sun and show/moon from stuff sent by Steve Franke K9AN
2. added show/call which queries jeifer.pineknot.com for any call in the
%cluster = (); # this is where we store the dxcluster database
%valid = (
- mynode => '0,Parent Node,DXCluster::showcall',
+ mynode => '0,Parent Node',
call => '0,Callsign',
confmode => '0,Conference Mode,yesno',
here => '0,Here?,yesno',
- dxchan => '5,Channel ref,DXCluster::showcall',
+ dxchan => '5,Channel Call',
pcversion => '5,Node Version',
list => '5,User List,DXCluster::dolist',
users => '0,No of Users',
$self->{call} = $call;
$self->{confmode} = $confmode;
$self->{here} = $here;
- $self->{dxchan} = $dxchan;
+ $self->{dxchan} = $dxchan->call;
$cluster{$call} = bless $self, $pkg;
return $self;
return " $DXNode::nodes nodes, $users local / $tot total users Max users $DXNode::maxusers Uptime $uptime";
}
+sub mynode
+{
+ my $self = shift;
+ my $noderef = shift;
+
+ if ($noderef) {
+ $self->{mynode} = $noderef->call;
+ } else {
+ $noderef = DXCluster->get_exact($self->{mynode});
+ unless ($noderef) {
+ my $mynode = $self->{mynode};
+ my $call = $self->{call};
+ dbg('err', "parent node $mynode has disappeared from $call" );
+ }
+ }
+ return $noderef;
+}
+
+sub dxchan
+{
+ my $self = shift;
+ my $dxchan = shift;
+
+ if ($dxchan) {
+ $self->{dxchan} = $dxchan->call;
+ } else {
+ $dxchan = DXChannel->get($self->{dxchan});
+ unless ($dxchan) {
+ my $dxcall = $self->{dxchan};
+ my $call = $self->{call};
+ dbg('err', "parent dxchan $dxcall has disappeared from $call" );
+ }
+ }
+ return $dxchan;
+}
+
no strict;
sub AUTOLOAD
{
die "tried to add $call when it already exists" if DXCluster->get_exact($call);
my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
- $self->{mynode} = $node;
+ $self->{mynode} = $node->call;
$node->add_user($call, $self);
dbg('cluster', "allocating user $call to $node->{call} in cluster\n");
return $self;
{
my $self = shift;
my $call = $self->{call};
- my $node = $self->{mynode};
+ my $node = $self->mynode;
$node->del_user($call);
dbg('cluster', "deleting user $call from $node->{call} in cluster\n");
my $self = $pkg->alloc($dxchan, $call, $confmode, $here);
$self->{pcversion} = $pcversion;
$self->{list} = { } ;
- $self->{mynode} = $self; # for sh/station
+ $self->{mynode} = $self->call; # for sh/station
$self->{users} = 0;
$nodes++;
dbg('cluster', "allocating node $call to cluster\n");
sleep(1);
}
- if ($call eq $main::myalias) { # unset the channel if it is us really
- my $node = DXNode->get($main::mycall);
- $node->{dxchan} = 0;
- }
+# if ($call eq $main::myalias) { # unset the channel if it is us really
+# my $node = DXNode->get($main::mycall);
+# $node->{dxchan} = 0;
+# }
# issue a pc17 to everybody interested
my $nchan = DXChannel->get($main::mycall);
}
# deal with routed private messages
- my $noderef;
+ my $dxchan;
if ($ref->{private}) {
next if $ref->{'read'}; # if it is read, it is stuck here
$clref = DXCluster->get_exact($ref->{to});
my $hnode = $uref->homenode if $uref;
$clref = DXCluster->get_exact($hnode) if $hnode;
}
- if ($clref && !grep { $clref->{dxchan} == $_ } DXCommandmode::get_all()) {
+ if ($clref && !grep { $clref->dxchan == $_ } DXCommandmode::get_all()) {
next if $clref->call eq $main::mycall; # i.e. it lives here
- $noderef = $clref->{dxchan};
- $ref->start_msg($noderef) if !get_busy($noderef->call) && $noderef->state eq 'normal';
+ $dxchan = $clref->dxchan;
+ $ref->start_msg($dxchan) if $dxchan && !get_busy($dxchan->call) && $dxchan->state eq 'normal';
}
}
# the nodelist up above, if there are sites that haven't got it yet
# then start sending it - what happens when we get loops is anyone's
# guess, use (to, from, time, subject) tuple?
- foreach $noderef (@nodelist) {
- next if $noderef->call eq $main::mycall;
- next if grep { $_ eq $noderef->call } @{$ref->{gotit}};
- next unless $ref->forward_it($noderef->call); # check the forwarding file
+ foreach $dxchan (@nodelist) {
+ next if $dxchan->call eq $main::mycall;
+ next if grep { $_ eq $dxchan->call } @{$ref->{gotit}};
+ next unless $ref->forward_it($dxchan->call); # check the forwarding file
# if we are here we have a node that doesn't have this message
- $ref->start_msg($noderef) if !get_busy($noderef->call) && $noderef->state eq 'normal';
+ $ref->start_msg($dxchan) if !get_busy($dxchan->call) && $dxchan->state eq 'normal';
last;
}
# put in a DXCluster node for us here so we can add users and take them away
-DXNode->new(0, $mycall, 0, 1, $DXProt::myprot_version);
+DXNode->new($DXProt::me, $mycall, 0, 1, $DXProt::myprot_version);
# read in any existing message headers and clean out old crap
dbg('err', "reading existing message headers ...");