X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=9c2130cc55fca075cb853c0904614d322a7fd3e3;hp=aaaed104ea94a2fd73ab316678129b4f66b5bf18;hb=e9516524af69bdf7bf09c4b530abd04f82c7626e;hpb=325527f1f2d4c3e8a1648690da349f30f8e79759 diff --git a/remoteglot.pl b/remoteglot.pl index aaaed10..9c2130c 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -1009,12 +1009,15 @@ sub extract_clock { if (exists($comments->{$white_key}) && exists($comments->{$black_key}) && - $comments->{$white_key} =~ /tl=(\d+:\d+:\d+)/ && - $comments->{$black_key} =~ /tl=(\d+:\d+:\d+)/) { - $comments->{$white_key} =~ /tl=(\d+:\d+:\d+)/; + $comments->{$white_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/ && + $comments->{$black_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/) { + $comments->{$white_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/; $pos->{'white_clock'} = $1; - $comments->{$black_key} =~ /tl=(\d+:\d+:\d+)/; + $comments->{$black_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/; $pos->{'black_clock'} = $1; + + $pos->{'white_clock'} =~ s/\b(\d)\b/0$1/g; + $pos->{'black_clock'} =~ s/\b(\d)\b/0$1/g; return; } @@ -1039,6 +1042,7 @@ sub find_clock_start { } # TODO(sesse): Maybe we can get the number of moves somehow else for FICS games. + # The history is needed for id_for_pos. if (!exists($pos->{'pretty_history'})) { return; }