ve7cc => '0,VE7CC program special,yesno',
lastmsgpoll => '0,Last Msg Poll,atime',
inscript => '9,In a script,yesno',
+ handle_xml => '9,Handles XML,yesno',
inqueue => '9,Input Queue,parray',
);
$pingint $obscount %pc19list $chatdupeage $chatimportfn
$investigation_int $pc19_version $myprot_version
%nodehops $baddx $badspotter $badnode $censorpc $rspfcheck
- $allowzero $decode_dk0wcy $send_opernam @checklist);
+ $allowzero $decode_dk0wcy $send_opernam @checklist
+ $handle_xml);
$pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11
$pc23_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc23
$chatimportfn = "$main::root/chat_import";
$investigation_int = 12*60*60; # time between checks to see if we can see this node
$pc19_version = 5466; # the visible version no for outgoing PC19s generated from pc59
+$handle_xml = 0; # handle XML sentences
@checklist =
(
$self->send(pc18());
}
-sub removepc90
-{
- $_[0] =~ s/^PC90\^[-A-Z0-9]+\^\d+\^//;
- $_[0] =~ s/^PC91\^[-A-Z0-9]+\^\d+\^[-A-Z0-9]+\^//;
-}
-
-#sub send
-#{
-# my $self = shift;
-# while (@_) {
-# my $line = shift;
-# $self->SUPER::send($line);
-# }
-#}
-
#
# This is the normal pcxx despatcher
#
{
my ($self, $line) = @_;
- # remove any incoming PC90 frames
- removepc90($line);
-
my @field = split /\^/, $line;
return unless @field;
$self->user->put;
$self->sort('S');
}
+ $self->handle_xml++ if $_[1] =~ /\bxml\b/;
} else {
$self->version(50.0);
$self->version($_[2] / 100) if $_[2] && $_[2] =~ /^\d+$/;
$main::build += $VERSION;
$main::branch += $BRANCH;
-use vars qw($sentencelth);
+use vars qw($sentencelth $handle_xml);
$sentencelth = 180;
-
+
#
# All the PCxx generation routines
#
# Request init string
sub pc18
{
- return "PC18^DXSpider Version: $main::version Build: $main::build^$DXProt::myprot_version^";
+ my $flags = " xml" if $handle_xml;
+ return "PC18^DXSpider Version: $main::version Build: $main::build$flags^$DXProt::myprot_version^";
}
#
import DBI;
$active++;
}
+ undef $@;
return $active;
}
wantlogininfo => '0,Login Info Req,yesno',
wantgrid => '0,Show DX Grid,yesno',
wantann_talk => '0,Talklike Anns,yesno',
- wantpc90 => '1,Req PC90,yesno',
- wantnp => '1,Req New Proto,yesno',
wantpc16 => '9,Want Users from node,yesno',
wantsendpc16 => '9,Send PC16,yesno',
wantroutepc19 => '9,Route PC19,yesno',
return _want('pc16', @_);
}
-sub wantpc90
-{
- return _wantnot('pc90', @_);
-}
-
sub wantsendpc16
{
return _want('sendpc16', @_);
return _want('dxitu', @_);
}
-sub wantnp
-{
- return _wantnot('np', @_);
-}
-
sub wantlogininfo
{
my $self = shift;
--- /dev/null
+#
+# XML handler
+#
+# $Id$
+#
+# Copyright (c) Dirk Koopman, G1TLH
+#
+
+use strict;
+
+package DXXml;
+
+use DXChannel;
+use DXProt;
+
+use vars qw($VERSION $BRANCH $xs);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
+
+$xs = undef; # the XML::Simple parser instance
+
+sub init
+{
+ eval { require XML::Simple; };
+ unless ($@) {
+ import XML::Simple;
+ $DXProt::handle_xml = 1;
+ $xs = new XML::Simple();
+ }
+ undef $@;
+}
+
+sub normal
+{
+
+}
+
+sub process
+{
+
+}
+1;
}
# tie the main prefix database
- $db = tie(%pre, "DB_File", undef, O_RDWR|O_CREAT, 0664, $DB_BTREE) or confess "can't tie \%pre ($!)";
- my $out = $@ if $@;
- do "$main::data/prefix_data.pl" if !$out;
- $out = $@ if $@;
+ eval {$db = tie(%pre, "DB_File", undef, O_RDWR|O_CREAT, 0664, $DB_BTREE);};
+ my $out = "$@($!)" if !$db || $@ ;
+ eval {do "$main::data/prefix_data.pl" if !$out; };
+ $out .= $@ if $@;
$lru = LRU->newbase('Prefix', $lrusize);
return $out;
use Thingy;
use RouteDB;
use AMsg;
+use DXXml;
use Data::Dumper;
use IO::File;
$build += $main::version;
$build = "$build.$branch" if $branch;
-LogDbg('cluster', "DXSpider V$version, build $build started");
-
-# banner
-my ($year) = (gmtime)[5];
-$year += 1900;
-dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
-
# try to load the database
if ($dsn && -e "$root/perl/DXSql.pm") {
require DXSql;
}
}
+# try to load XML::Simple
+DXXml::init();
+
+# banner
+my ($year) = (gmtime)[5];
+$year += 1900;
+LogDbg('cluster', "DXSpider V$version, build $build started");
+dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
+
# load Prefixes
dbg("loading prefixes ...");
dbg(USDB::init());