]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Support pulling PGNs from HTTPS.
[remoteglot] / remoteglot.pl
index 55464e6e2716abafc287d427ad85d8d3daab58a9..5e1e94aa99cdf28cfbe1909b5f84a5d2817ef689 100755 (executable)
@@ -121,7 +121,7 @@ my $ev1 = AnyEvent->io(
        }
 );
 if (defined($remoteglotconf::target)) {
-       if ($remoteglotconf::target =~ /^http:/) {
+       if ($remoteglotconf::target =~ /^https?:/) {
                fetch_pgn($remoteglotconf::target);
        } else {
                $t->cmd("observe $remoteglotconf::target");
@@ -526,7 +526,7 @@ sub prettyprint_pv_no_cache {
 sub prettyprint_pv {
        my ($pos, @pvs) = @_;
 
-       my $cachekey = join('', @pvs);
+       my $cachekey = $pos->{'fen'} . join('', @pvs);
        if (exists($pos->{'prettyprint_cache'}{$cachekey})) {
                return @{$pos->{'prettyprint_cache'}{$cachekey}};
        } else {
@@ -1090,7 +1090,7 @@ sub score_digest {
                        if ($score == 0 && $info->{'tablebase'}) {
                                return ['d', undef];
                        } else {
-                               return ['cp', $score];
+                               return ['cp', int($score)];
                        }
                }
        }