Support flipped boards (no UI, you have to activate it through JS).
[remoteglot] / Engine.pm
index 4d05750..c46b4a8 100644 (file)
--- a/Engine.pm
+++ b/Engine.pm
@@ -29,6 +29,8 @@ sub open {
                ev => $ev,
                cb => $cb,
                seen_uciok => 0,
+               stopping => 0,
+               chess960 => 0,
        };
 
        print $uciwrite "uci\n";
@@ -46,7 +48,7 @@ sub _anyevent_handle_line {
 
        if (!$engine->{'seen_uciok'}) {
                # Gobble up lines until we see uciok.
-               if ($line =~ /^id (\S+) (.*)$/) {
+               if ($line =~ /^id (\S+) (.*?)\s*$/) {
                        $engine->{'id'}->{$1} = $2;
                } elsif ($line =~ /^uciok$/) {
                        $engine->{'seen_uciok'} = 1;