From 1f3fee3cb63e6c43788d2300b6e8d7795162b59d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 10 Jun 2014 00:45:41 +0200 Subject: [PATCH] Print the name of the players. --- remoteglot.pl | 4 ++++ www/js/remoteglot.js | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/remoteglot.pl b/remoteglot.pl index 5ccfa20..9301ac7 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -349,6 +349,10 @@ sub style12_to_pos { $pos{'black_castle_k'} = $x[13]; $pos{'black_castle_q'} = $x[14]; $pos{'time_to_100move_rule'} = $x[15]; + $pos{'player_w'} = $x[17]; + $pos{'player_b'} = $x[18]; + $pos{'player_w'} =~ s/^[IG]M//; + $pos{'player_b'} =~ s/^[IG]M//; $pos{'move_num'} = $x[26]; if ($x[27] =~ /([a-h][1-8])-([a-h][1-8])/) { $pos{'last_move_uci'} = $1 . $2; diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index e741873..936c336 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -491,7 +491,13 @@ var update_board = function(data, num_viewers) { display_lines = []; // The headline. - var headline = 'Analysis'; + var headline; + if (data['position']['player_w'] && data['position']['player_b']) { + headline = data['position']['player_w'] + '–' + + data['position']['player_b'] + ', analysis'; + } else { + headline = 'Analysis'; + } if (data['position']['last_move'] !== 'none') { headline += ' after ' if (data['position']['toplay'] == 'W') { -- 2.39.2