Show the engine ID in the footer.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 9 Nov 2014 16:33:08 +0000 (17:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 9 Nov 2014 16:33:08 +0000 (17:33 +0100)
Engine.pm
www/index.html
www/js/remoteglot.js

index 59b1fe3..4d05750 100644 (file)
--- a/Engine.pm
+++ b/Engine.pm
@@ -46,7 +46,9 @@ sub _anyevent_handle_line {
 
        if (!$engine->{'seen_uciok'}) {
                # Gobble up lines until we see uciok.
-               if ($line =~ /^uciok$/) {
+               if ($line =~ /^id (\S+) (.*)$/) {
+                       $engine->{'id'}->{$1} = $2;
+               } elsif ($line =~ /^uciok$/) {
                        $engine->{'seen_uciok'} = 1;
                }
        } else {
index cafa2e1..44a22fd 100644 (file)
@@ -48,7 +48,7 @@
 </ul>
 <p id="credits"><a href="http://git.sesse.net/?p=remoteglot;a=summary">remoteglot</a>
   &copy; 2007&ndash;2014 <a href="http://www.sesse.net/">Steinar H. Gunderson</a>.
-  Chess analysis by <a href="http://stockfishchess.org/">Stockfish</a> (main analysis: 20x2.27GHz Haswell-EP,
+  Chess analysis by <a href="http://stockfishchess.org/" id="engineid">Stockfish</a> (main analysis: 20x2.27GHz Haswell-EP,
   multi-PV search: 12x2.3GHz Sandy Bridge).
   Moves provided by <a href="http://live.fide.com/sochi/">FIDE</a>.
   Hosting and multi-PV analysis hardware by <a href="http://www.samfundet.no/">Studentersamfundet i Trondhjem</a>.
index fe5d266..5ce7426 100644 (file)
@@ -518,6 +518,11 @@ var update_board = function(data, num_viewers) {
                $("#numviewers").text(num_viewers + " current viewers");
        }
 
+       // The engine id.
+       if (data['id'] && data['id']['name'] !== null) {
+               $("#engineid").text(data['id']['name']);
+       }
+
        // The score.
        if (data['score'] !== null) {
                $("#score").text(data['score']);