X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=b1e37aacb43d8398caa7ccb27e9120e66770076c;hp=5c22aff4b9cbbb605d851717e3f70358ebb9f18b;hb=e29e4043c66b7b187d48e73e73895a2ce62949d4;hpb=2ef4eb46d19d0b41f0be2f60ad78618c197cd487 diff --git a/remoteglot.pl b/remoteglot.pl index 5c22aff..b1e37aa 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -844,9 +844,7 @@ sub output_json { $json->{'tbhits'} = $info->{'tbhits'}; $json->{'seldepth'} = $info->{'seldepth'}; $json->{'tablebase'} = $info->{'tablebase'}; - - $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'}}) ]; + $json->{'pv'} = [ prettyprint_pv($pos_calculating, @{$info->{'pv'}}) ]; my %refutation_lines = (); my @refutation_lines = (); @@ -862,12 +860,11 @@ sub output_json { my $pv = $info->{'pv' . $mpv}; my $pretty_move = join('', prettyprint_pv($pos_calculating, $pv->[0])); my @pretty_pv = prettyprint_pv($pos_calculating, @$pv); - $refutation_lines{$pv->[0]} = { - sort_key => $pretty_move, + $refutation_lines{$pretty_move} = { depth => $info->{'depth' . $mpv}, score => score_digest($info, $pos_calculating, $mpv), pretty_move => $pretty_move, - pv_pretty => \@pretty_pv, + pv => \@pretty_pv, }; }; } @@ -918,6 +915,7 @@ sub output_json { } # Give out a list of other games going on. (Empty is fine.) + # TODO: Don't bother reading our own file, the data will be stale anyway. if (!$historic_json_only) { my @games = ();