use Verify;
use DXDupe;
use Thingy;
+use RouteDB;
use vars qw($VERSION $BRANCH);
-$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;
+
+main::mkver($VERSION = q$Revision$);
use vars qw(@ISA $ntpflag $dupeage);
my $date = ((($dayno << 1) | $ntpflag) << 18) | ($main::systime % 86400);
my $r = "$mycall," . sprintf('%6X%04X,0', $date, $seqno);
$r .= ",$to" if $to;
+ $r .= "," if $from && !$to;
$r .= ",$from" if $from;
$seqno++;
$seqno = 0 if $seqno > 0x0ffff;
# validate it further
$err .= "missing cmd or data," unless $cmd && $data;
$err .= "invalid command ($cmd)," unless $cmd =~ /^[A-Z][A-Z0-9]*$/;
- my ($gp, $tus) = split /:/, $group, 2;
+ my ($gp, $tus) = split /:/, $group, 2 if $group;
- $err .= "invalid group ($gp)," unless $gp =~ /^[A-Z0-9]{2,}$/;
+ $err .= "invalid group ($gp)," if $gp && $gp !~ /^[A-Z0-9]{2,}$/;
$err .= "invalid tocall ($tus)," if $tus && !is_callsign($tus);
$err .= "invalid fromcall ($user)," if $user && !is_callsign($user);
$thing->{touser} = $tus if $tus;
$thing->{user} = $user if $user;
$thing->{hopsaway} = $hop;
-
- for (split(/,/, $rdata)) {
- if (/=/) {
- my ($k,$v) = split /=/, $_, 2;
- $thing->{$k} = tdecode($v);
- } else {
- $thing->{$_} = 1;
+
+ if ($rdata) {
+ for (split(/,/, $rdata)) {
+ if (/=/) {
+ my ($k,$v) = split /=/, $_, 2;
+ $thing->{$k} = tdecode($v);
+ } else {
+ $thing->{$_} = 1;
+ }
}
}
-
+
# post process the thing, this generally adds on semantic meaning
# does parameter checking etc. It also adds / prepares the thingy so
# this is compatible with older protocol and arranges data so