- ++$pc61_rx;
-
- if ($pc11_saved) {
- if ($key eq $pc11_saved->[0]) {
- ++$pc11_to_61;
- my $percent = int($pc11_to_61 * 100 / $pc11_rx);
- dbg("recurse: $recurse saved PC11 spot $key dumped, better pc61 received ($percent\%) pc61: $pc61_rx pc11: $pc11_rx -> pc61: $pc11_to_61 ") if isdbg("pc11");
- undef $pc11_saved;
+ if (Spot::dup_find(@spot[0..4,7])) {
+ dbg("DUPE $pc->[0] $self->{call}: key: $key dumped") if isdbg('pc11');
+ return;
+ } else {
+ ++$pc61_rx;
+ }
+
+ # as we have a route to a user, if it does not exist, create and link if (and only if) the node exists as well
+ if ($pc->[8]) {
+ my $new = $pc->[8];
+ # $new =~ s/,/:/g;
+ my $r = Route::User::get($pc->[6]);
+ unless ($r) {
+ my $rn = Route::Node::get($pc->[7]) || Route::Node->new($pc->[7]);
+ $rn->add_user($pc->[6], 0, $pc->[8]);
+ $r = Route::User::get($pc->[6]);
+ }
+ if ($r) {
+ if ($r->ip ne $pc->[8]) {
+ my $old = $r->ip;
+ $r->ip($new);
+ dbg("ROUTE ALTER IP node: $pc->[7] user: $pc->[6] old IP: '$old'-> new IP: '$new'") if isdbg('pc11');
+ } else {
+ dbg("ROUTE NEW IP node: $pc->[7] user: $pc->[6] IP: '$new'") if isdbg('pc11');
+ }
+ } else {
+ dbg("ROUTE ADD Failed for node $pc->[7] user $pc->[6]") if isdbg('pc11');