+ } elsif ($sort eq 'K') {
+ $pc92Kin += length $line;
+
+ # remember the last channel we arrived on
+ $parent->PC92C_dxchan($self->{call}, $hops) unless $self->{call} eq $parent->call;
+
+ my @ent = _decode_pc92_call($pc->[4]);
+
+ if (@ent) {
+ my $add;
+
+ ($parent, $add) = $self->pc92_handle_first_slot(\@ent, $parent, $t, $hops);
+ return unless $parent; # dupe
+
+ push @radd, $add if $add;
+ $parent->reset_obs;
+ my $call = $parent->call;
+ my $version = $ent[4] || 0;
+ my $build = $ent[5] || 0;
+ $build =~ s/^0\.//;
+ my $oldbuild = $parent->build || 0;
+ my $oldversion = $parent->version || 0;
+ my $user = check_add_user($parent->call, 'S');
+ my $oldsort = $user->sort // '';
+
+ dbg("PCProt PC92 K v: $version ov: $oldversion b: $build ob: $oldbuild pk: " . ($parent->K || '0') . " uk: " . ($user->K || 0)) if isdbg('pc92k');
+
+ if (is_numeric($version) || is_numeric($build)) {
+ my $changed = 0;
+ if (($oldversion ne $version || $build ne $oldbuild)) {
+ dbg("PCProt PC92 K node $call updated version: $version (was $oldversion) build: $build (was $oldbuild)");
+ $user->version($parent->version($version));
+ $user->build($parent->build($build));
+ ++$changed;
+ }
+ if ($oldsort ne 'S') {
+ dbg("PCProt PC92 K node $call updated sort: $sort (was $oldsort)");
+ $user->sort('S');
+ ++$changed;
+ }
+ unless ($user->K) {
+ dbg("PCProt PC92 K node $call updated - marked as PC92 K user");
+ $user->K(1);
+ ++$changed;
+ }
+ $user->put if $changed;
+ $parent->K(1); # mark this as come in on a K
+ } else {
+ dbg("DXProt PC92 K version call $call: invalid version: '$version' or build: '$version', ignored");
+ }
+ dbg("ROUTE: reset obscount on $call now " . $parent->obscount) if isdbg('obscount');
+ }
+ } elsif ($sort eq 'A' || $sort eq 'D' || $sort eq 'C') {
+
+ $pc92Ain += length $line if $sort eq 'A';
+ $pc92Cin += length $line if $sort eq 'C';
+ $pc92Din += length $line if $sort eq 'D';
+
+ # remember the last channel we arrived on
+ $parent->PC92C_dxchan($self->{call}, $hops) unless $self->{call} eq $parent->call;
+
+ # this is the main route section
+ # here is where all the routes are created and destroyed
+
+ # cope with missing duplicate node calls in the first slot
+ my $me = $pc->[4] || '';
+ $me ||= _encode_pc92_call($parent) unless $me ;
+
+ my @ent = map {my @a = _decode_pc92_call($_); @a ? \@a : ()} grep {$_ && /^[0-7]/} $me, @$pc[5 .. $#$pc];
+
+ if (@ent) {
+
+ # look at the first one which will always be a node of some sort
+ # except in the case of 'A' or 'D' in which the $pcall is used
+ # otherwise use the node call and update any information
+ # that needs to be done.
+ my $add;
+
+ ($parent, $add) = $self->pc92_handle_first_slot($ent[0], $parent, $t, $hops);
+ return unless $parent; # dupe
+
+ shift @ent;
+ push @radd, $add if $add;