+29Jun07=======================================================================
+1. If a node is set/isolated then make sure that a) pc9x is not advertised
+and b) pc9x is ignored.
+2. Add (un)set/wantpc9x command (but please don't use them without talking
+to me first), here be dragons!!
25Jun07=======================================================================
1. make sure that a C record is sent for node call every update period.
2. make announces work again (probably).
--- /dev/null
+#
+# set the wantPC9x flag
+#
+# Copyright (c) 2007 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, uc $line;
+my $call;
+my @out;
+
+return (1, $self->msg('e5')) if $self->priv < 9;
+
+foreach $call (@args) {
+ return (1, $self->msg('e12')) unless is_callsign($call);
+
+ my $user = DXUser->get_current($call);
+ if ($user) {
+ $user->wantpc9x(1);
+ $user->put;
+ push @out, $self->msg('wpc9xs', $call);
+ } else {
+ push @out, $self->msg('e3', "set/wantpc9x", $call);
+ }
+}
+return (1, @out);
--- /dev/null
+#
+# unset the wantpc9x flag
+#
+# Copyright (c) 2007 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, uc $line;
+my $call;
+my @out;
+
+return (1, $self->msg('e5')) if $self->priv < 9;
+
+foreach $call (@args) {
+ return (1, $self->msg('e12')) unless is_callsign($call);
+
+ my $user = DXUser->get_current($call);
+ if ($user) {
+ $user->wantpc9x(0);
+ $user->put;
+ push @out, $self->msg('wpc9xu', $call);
+ } else {
+ push @out, $self->msg('e3', "unset/wantpc9x", $call);
+ }
+}
+return (1, @out);
sub sendinit
{
my $self = shift;
- $self->send(pc18());
+ $self->send(pc18(($self->{isolate} || !$self->user->wantpc9x) ? "" : " pc9x"));
}
#
# $self->{handle_xml}++ if DXXml::available() && $_[1] =~ /\bxml/;
if ($_[1] =~ /\bpc9x/) {
if ($self->{isolate}) {
- dbg("pc9x recognised, but is isolated, using old protocol");
+ dbg("pc9x recognised, but $self->{call} is isolated, using old protocol");
+ } elsif (!$self->user->wantpc9x) {
+ dbg("pc9x explicitly switched off on $self->{call}, using old protocol");
} else {
$self->{do_pc9x} = 1;
dbg("Do px9x set on $self->{call}");
}
if ($pcall eq $self->{call} && $self->{state} eq 'init') {
- $self->state('init92');
- $self->{do_pc9x} = 1;
- dbg("Do pc9x set on $pcall");
+ if ($self->{isolate}) {
+ dbg("PC9x received, but $pcall is isolated, ignored");
+ return;
+ } elsif (!$self->user->wantpc9x) {
+ dbg("PC9x explicitly switched off on $pcall, ignored");
+ return;
+ } else {
+ $self->state('init92');
+ $self->{do_pc9x} = 1;
+ dbg("Do pc9x set on $pcall");
+ }
}
unless ($self->{do_pc9x}) {
dbg("PCPROT: PC9x come in from non-PC9x node, ignored") if isdbg('chanerr');
dbg("PCPROT: invalid callsign string '$_[1]', ignored") if isdbg('chanerr');
return;
}
+
+ unless ($self->{do_pc9x}) {
+ dbg("PCPROT: PC9x come in from non-PC9x node, ignored") if isdbg('chanerr');
+ return;
+ }
+
my $t = $_[2];
my $parent = check_pc9x_t($pcall, $t, 93, 1) || return;
# Request init string
sub pc18
{
- my $flags = " pc9x";
- $flags .= " xml" if DXXml::available();
+ my $flags = shift;
return "PC18^DXSpider Version: $main::version Build: $main::subversion.$main::build$flags^$DXProt::myprot_version^";
}
wantdxcq => '0,Show CQ Zone,yesno',
wantdxitu => '0,Show ITU Zone,yesno',
wantgtk => '0,Want GTK interface,yesno',
+ wantpc9x => '0,Want PC9X interface,yesno',
lastoper => '9,Last for/oper,cldatetime',
nothere => '0,Not Here Text',
registered => '9,Registered?,yesno',
return _want('gtk', @_);
}
+sub wantpc9x
+{
+ return _want('pc9x', @_);
+}
+
sub wantlogininfo
{
my $self = shift;
wpc16u => 'Allow PC16 from $_[0] disabled',
wpc19s => 'Route PC19 for $_[0] enabled',
wpc19u => 'Route PC19 for $_[0] disabled',
- wpc90s => 'PC90 for $_[0] enabled',
- wpc90u => 'PC90 for $_[0] disabled',
+ wpc9xs => 'PC9X for $_[0] enabled',
+ wpc9xu => 'PC9X for $_[0] disabled',
wwv1 => '$_[0] is missing or out of range',
wwv2 => 'Duplicate WWV',
wwv3 => 'Date Hour SFI A K Forecast Logger',
$version = '1.54';
$subversion = '0';
-$build = '95';
+$build = '96';
1;