change do_pc92 to do_pc9x
authorminima <minima>
Mon, 22 Jan 2007 13:59:59 +0000 (13:59 +0000)
committerminima <minima>
Mon, 22 Jan 2007 13:59:59 +0000 (13:59 +0000)
perl/DXChannel.pm
perl/DXProt.pm
perl/DXProtHandle.pm
perl/DXProtout.pm
perl/Route/Node.pm
perl/RouteDB.pm
perl/cluster.pl

index 98617515981c8821f8590031aa41984ef277c253..2337d959a84f6820c1c0e03370f1fe7856019f96 100644 (file)
@@ -119,8 +119,7 @@ $count = 0;
                  lastmsgpoll => '0,Last Msg Poll,atime',
                  inscript => '9,In a script,yesno',
                  handle_xml => '9,Handles XML,yesno',
-                 do_pc92 => '9,Handles PC92,yesno',
-                 do_pc93 => '9,Handles PC93,yesno',
+                 do_pc9x => '9,Handles PC9x,yesno',
                  inqueue => '9,Input Queue,parray',
                 );
 
index 4e32c22e77940e1eea3db025e85a55b08c0039ca..220c689c2ed2333f9ad7f155b01fe7358f441841 100644 (file)
@@ -221,8 +221,7 @@ sub init
        $main::me->{registered} = 1;
        $main::me->{version} = $main::version;
        $main::me->{build} = $main::build;
-       $main::me->{do_pc92} = 1;
-       $main::me->{via_pc92} = 1;
+       $main::me->{do_pc9x} = 1;
 }
 
 #
@@ -735,7 +734,7 @@ sub send_local_config
        dbg('DXProt::send_local_config') if isdbg('trace');
 
        # send our nodes
-       if ($self->{do_pc92}) { 
+       if ($self->{do_pc9x}) { 
                $self->send_pc92_config;
        } else {
                my $node;
@@ -815,7 +814,7 @@ sub gen_pc92_update
        if ($with_pc92_nodes) {
                # send out the configuration of all the directly connected PC92 nodes with current configuration
                # but with the dates that the last config came in with.
-               @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} && $_->{do_pc92} } DXChannel::get_all_nodes();
+               @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} && $_->{do_pc9x} } DXChannel::get_all_nodes();
                dbg("ROUTE: pc92 dxchan: " . join(',', map{$_->{call}} @dxchan)) if isdbg('routelow');
                @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan;
                dbg("ROUTE: pc92 localnodes: " . join(',', map{$_->{call}} @localnodes)) if isdbg('routelow');
@@ -829,7 +828,7 @@ sub gen_pc92_update
        
        # send the configuration of all the directly connected 'external' nodes that don't handle PC92
        # out with the 'external' marker on the first node.
-       @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} && !$_->{do_pc92} } DXChannel::get_all_nodes();
+       @dxchan = grep { $_->call ne $main::mycall && $_ != $self && !$_->{isolate} && !$_->{do_pc9x} } DXChannel::get_all_nodes();
        dbg("ROUTE: non pc92 dxchan: " . join(',', map{$_->{call}} @dxchan)) if isdbg('routelow');
        @localnodes = map { my $r = Route::Node::get($_->{call}); $r ? $r : () } @dxchan;
        dbg("ROUTE: non pc92 localnodes: " . join(',', map{$_->{call}} @localnodes)) if isdbg('routelow');
@@ -870,7 +869,7 @@ sub send_pc92_update
 
 sub time_out_pc92_routes
 {
-       my @nodes = grep {$_->call ne $main::mycall && ($_->do_pc92 || $_->via_pc92)} Route::Node::get_all();
+       my @nodes = grep {$_->call ne $main::mycall && ($_->do_pc9x || $_->via_pc92)} Route::Node::get_all();
        my @rdel;
        foreach my $n (@nodes) {
                my $o = $n->dec_obs;
@@ -1159,7 +1158,7 @@ sub talk
 {
        my ($self, $from, $to, $via, $line, $origin) = @_;
        
-       if ($self->{do_pc93}) {
+       if ($self->{do_pc9x}) {
                $self->send(pc93($to, $from, $via, $line));
        } else {
                $self->send(pc10($from, $to, $via, $line, $origin));
@@ -1232,7 +1231,7 @@ sub broadcast_route
                        next if $dxchan == $self;
                        next if $dxchan == $main::me;
                        next unless $dxchan->isa('DXProt');
-                       next if $dxchan->{do_pc92};
+                       next if $dxchan->{do_pc9x};
                        next if ($generate == \&pc16 || $generate==\&pc17) && !$dxchan->user->wantsendpc16;
  
                        $dxchan->send_route($origin, $generate, @_);
@@ -1245,7 +1244,7 @@ sub send_route_pc92
 {
        my $self = shift;
 
-       return unless $self->{do_pc92};
+       return unless $self->{do_pc9x};
        
        my $origin = shift;
        my $generate = shift;
@@ -1275,7 +1274,7 @@ sub broadcast_route_pc9x
                foreach $dxchan (@dxchan) {
                        next if $dxchan == $self || $dxchan == $main::me;
                        next if $origin eq $dxchan->{call};     # don't route some from this call back again.
-                       next unless $dxchan->{do_pc92};
+                       next unless $dxchan->{do_pc9x};
                        next unless $dxchan->isa('DXProt');
 
                        $dxchan->send($line);
index 938d0fbca136cb84aedd245e03c3ebc011ffc54f..44a1ecc25d01ced0e4e555fa70ee75d47e8e14f0 100644 (file)
@@ -610,10 +610,8 @@ sub handle_18
                        $self->sort('S');
                }
                $self->{handle_xml}++ if DXXml::available() && $_[1] =~ /\bxml/;
-               my ($pc9x) = $_[1] =~ /\bpc9\[(\d+)\]/;
-               if (defined $pc9x) {
-                       $self->{do_pc92}++ if $pc9x =~ /2/;
-                       $self->{do_pc93}++ if $pc9x =~ /3/;
+               if ($_[1] =~ /\bpc9x/) {
+                       $self->{do_pc9x}++;
                }
        } else {
                $self->version(50.0);
@@ -788,7 +786,7 @@ sub send_delayed_pc92
        $self->broadcast_route_pc9x($main::mycall, undef, $line, 0);
 
        # if this is an external node then send out the external config
-       unless ($self->{do_pc92}) {
+       unless ($self->{do_pc9x}) {
                $line = gen_my_pc92_config(Route::Node::get($self->{call}));
                $self->broadcast_route_pc9x($main::mycall, undef, $line, 0);
        }
@@ -802,7 +800,7 @@ sub handle_20
        my $line = shift;
        my $origin = shift;
 
-       if ($self->{do_pc92} && $self->{state} ne 'init92') {
+       if ($self->{do_pc9x} && $self->{state} ne 'init92') {
                dbg("PCPROT: disconnecting because login call not sent in any pc92") if isdbg('chanerr');
                $self->send("**** You logged in with $self->{call} but that is NOT your \$mycall");
                $self->disconnect;
@@ -887,7 +885,7 @@ sub handle_22
        my $line = shift;
        my $origin = shift;
 
-       if ($self->{do_pc92}) {
+       if ($self->{do_pc9x}) {
                if ($self->{state} ne 'init92') {
                        dbg("PCPROT: disconnecting because login call not sent in any pc92") if isdbg('chanerr');
                        $self->send("**** You logged in with $self->{call} but that is NOT your \$mycall");
@@ -1366,7 +1364,7 @@ sub _encode_pc92_call
        if ($ref->isa('Route::Node') || $ref->isa('DXProt')) {
                $flag |= 4;
                my $dxchan = DXChannel::get($call);
-               $flag |= 2 if $call ne $main::mycall && $dxchan && !$dxchan->{do_pc92};
+               $flag |= 2 if $call ne $main::mycall && $dxchan && !$dxchan->{do_pc9x};
                if ($ext) {
                        if ($ref->version) {
                                my $version = $ref->version || 1.0;
@@ -1464,7 +1462,7 @@ sub handle_92
 
        my (@radd, @rdel);
        
-       $self->{do_pc92} ||= 1;
+       $self->{do_pc9x} ||= 1;
 
        my $pcall = $_[1];
        unless ($pcall) {
@@ -1488,7 +1486,7 @@ sub handle_92
        my $oparent = $parent;
        
        $parent->lastid->{92} = $t;
-       $parent->do_pc92(1);
+       $parent->do_pc9x(1);
        $parent->via_pc92(1);
 
        if (@ent) {
@@ -1612,7 +1610,7 @@ sub handle_93
        my $line = shift;
        my $origin = shift;
 
-       $self->{do_pc93} ||= 1;
+       $self->{do_pc9x} ||= 1;
 
        my $pcall = $_[1];
        unless (is_callsign($pcall)) {
@@ -1646,7 +1644,8 @@ sub handle_93
 
        if (is_callsign($to)) {
                # local talks 
-               my $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
+               my $dxchan;
+               $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
                $dxchan = DXChannel::get($to) unless $dxchan;
                if ($dxchan && $dxchan->is_user) {
                        $dxchan->talk($from, $to, $via, $text);
@@ -1658,7 +1657,7 @@ sub handle_93
                if ($ref) {
                        my @dxchan = $ref->alldxchan;
                        for $dxchan (@dxchan) {
-                               if ($dxchan->{do_pc93}) {
+                               if ($dxchan->{do_pc9x}) {
                                        $dxchan->send($line);
                                } else {
                                        $dxchan->talk($from, $to, $via, $text);
index 118261ef30450aaf96e5c2c3d729687049f7b5d5..4fbb581c08e7ec70cc69bb569b8727a9929630f2 100644 (file)
@@ -120,7 +120,7 @@ sub pc17
 # Request init string
 sub pc18
 {
-       my $flags = " pc9[23]";
+       my $flags = " pc9x";
        $flags .= " xml" if DXXml::available(); 
        return "PC18^DXSpider Version: $main::version Build: $main::build$flags^$DXProt::myprot_version^";
 }
index e50302cd1b494e65a16fa04f3befb37e1b1c4337..d27efbf8a1d62e52ded6081669ea05d035dced01 100644 (file)
@@ -30,7 +30,7 @@ use vars qw(%list %valid @ISA $max $filterdef $obscount);
                  handle_xml => '0,Using XML,yesno',
                  lastmsg => '0,Last Route Msg,atime',
                  lastid => '0,Last Route MsgID',
-                 do_pc92 => '0,Uses pc92,yesno',
+                 do_pc9x => '0,Uses pc9x,yesno',
                  via_pc92 => '0,Came in via pc92,yesno',
                  obscount => '0,Obscount',
 );
index 96d0b0b4691a690c6d13d647040c67b108e759f1..bff21fb4ac96e86c442a9745eaaa925be1d84e6f 100644 (file)
@@ -20,18 +20,16 @@ package RouteDB;
 
 use DXDebug;
 use DXChannel;
+use DXUtil;
 use Prefix;
 
 use strict;
 
 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;
-
 use vars qw(%list %valid $default);
 
+($VERSION, $BRANCH) = dxver(q$Revision$);
+
 %list = ();
 $default = 99;                                 # the number of hops to use if we don't know
 %valid = (
index fe881f1eaa78a4dde7b525a227f98af3816930ab..2c8b5f65128fa53c4c17599d5f0aa29488fff14e 100755 (executable)
@@ -462,7 +462,7 @@ DXProt->init();
 
 # put in a DXCluster node for us here so we can add users and take them away
 $routeroot = Route::Node->new($mycall, $version*100+5300, Route::here($main::me->here)|Route::conf($main::me->conf));
-$routeroot->do_pc92(1);
+$routeroot->do_pc9x(1);
 $routeroot->via_pc92(1);
 
 # make sure that there is a routing OUTPUT node default file