for my $pos ($pos_waiting, $pos_calculating) {
next if (!defined($pos));
if ($pos->fen() eq $pos_for_movelist->fen()) {
- $pos->{'history'} = \@uci_movelist;
$pos->{'pretty_history'} = \@pretty_movelist;
}
}
($pos, $uci_move) = $pos->make_pretty_move($move);
push @uci_moves, $uci_move;
}
- $pos->{'history'} = \@uci_moves;
$pos->{'pretty_history'} = $moves;
# Sometimes, PGNs lose a move or two for a short while,
$json->{'seldepth'} = $info->{'seldepth'};
$json->{'tablebase'} = $info->{'tablebase'};
- # single-PV only for now
- $json->{'pv_uci'} = $info->{'pv'};
+ $json->{'pv_uci'} = $info->{'pv'}; # Still needs to be there for the JS to calculate arrows; only for the primary PV, though!
$json->{'pv_pretty'} = [ prettyprint_pv($pos_calculating, @{$info->{'pv'}}) ];
my %refutation_lines = ();
pretty_move => $pretty_move,
pv_pretty => \@pretty_pv,
};
- $refutation_lines{$pv->[0]}->{'pv_uci'} = $pv;
};
}
}
my $encoded = JSON::XS::encode_json($json);
atomic_set_contents($remoteglotconf::json_output, $encoded);
- if (exists($pos_calculating->{'history'}) &&
+ if (exists($pos_calculating->{'pretty_history'}) &&
defined($remoteglotconf::json_history_dir)) {
- my $halfmove_num = scalar @{$pos_calculating->{'history'}};
+ my $halfmove_num = scalar @{$pos_calculating->{'pretty_history'}};
(my $fen = $pos_calculating->fen()) =~ tr,/ ,-_,;
my $filename = $remoteglotconf::json_history_dir . "/move$halfmove_num-$fen.json";