+10Jun01=======================================================================
+1. fix set/here and unset/here
09Jun01=======================================================================
1. more fixes
2. add set/debug filter so that you can see why your filters aren't working
foreach $call (@args) {
$call = uc $call;
my $dxchan = DXChannel->get($call);
- my $ref = Route::User::get($call);
if ($dxchan) {
$dxchan->here(1);
push @out, $self->msg('heres', $call);
+ my $ref = Route::User::get($call);
+ $ref = Route::Node::get($call) unless $ref;
if ($ref) {
- my $s = DXProt::pc24($ref);
- DXProt::eph_dup($s);
- DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(1);
- } elsif ($ref = Route::Node::get($call)) {
my $s = DXProt::pc24($ref);
DXProt::eph_dup($s);
DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
- $ref->here(1);
- } else {
- $ref = Route::Node::get($call);
- $ref->here(1) if $ref;
}
} else {
push @out, $self->msg('e3', "Set Here", $call);
foreach $call (@args) {
$call = uc $call;
my $dxchan = DXChannel->get($call);
- my $ref = Route::User::get($call);
if ($dxchan) {
$dxchan->here(0);
push @out, $self->msg('hereu', $call);
+ my $ref = Route::User::get($call);
+ $ref = Route::Node::get($call) unless $ref;
if ($ref) {
- my $s = DXProt::pc24($ref);
- DXProt::eph_dup($s);
- DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(0);
- } elsif ($ref = Route::Node::get($call)) {
my $s = DXProt::pc24($ref);
DXProt::eph_dup($s);
DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
- $ref->here(0);
- } else {
- $ref = Route::Node::get($call);
- $ref->here(0) if $ref;
}
} else {
push @out, $self->msg('e3', "Unset Here", $call);
#
# flag field constructors/enquirers
#
+# These can be called in various ways:-
+#
+# Route::here or $ref->here returns 1 or 0 depending on value of the here flag
+# Route::here(1) returns 2 (the bit value of the here flag)
+# $ref->here(1) or $ref->here(0) sets the here flag
+#
sub here
{
my $self = shift;
my $r = shift;
return $self ? 2 : 0 unless ref $self;
- return ($self->{flags} & 2) ? 1 : 0 unless $r;
- $self->{flags} = (($self->{flags} & ~2) | ($r ? 1 : 0));
+ return ($self->{flags} & 2) ? 1 : 0 unless defined $r;
+ $self->{flags} = (($self->{flags} & ~2) | ($r ? 2 : 0));
return $r ? 1 : 0;
}
my $self = shift;
my $r = shift;
return $self ? 1 : 0 unless ref $self;
- return ($self->{flags} & 1) ? 1 : 0 unless $r;
+ return ($self->{flags} & 1) ? 1 : 0 unless defined $r;
$self->{flags} = (($self->{flags} & ~1) | ($r ? 1 : 0));
return $r ? 1 : 0;
}