Skip to content

Commit

Permalink
lamest solution to #57
Browse files Browse the repository at this point in the history
  • Loading branch information
fohristiwhirl committed Aug 10, 2019
1 parent 1220b8d commit d6a0b07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions 80_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,13 @@ function NewInfoHandler() {
this.last_drawn_version = null;
};

ih.draw_statusbox = function(leela_maybe_running, searchmoves) {
ih.draw_statusbox = function(leela_maybe_running, searchmoves, readyok_required) {

if (typeof config.search_nodes === "number" && (searchmoves.length === 1)) {
if (typeof readyok_required === "number" && readyok_required > 2) {

statusbox.innerHTML = `<span class="yellow">Out of sync: ${readyok_required}</span>`;

} else if (typeof config.search_nodes === "number" && (searchmoves.length === 1)) {

statusbox.innerHTML = `<span class="yellow">Node limit with only 1 focus won't run.</span>`;

Expand All @@ -322,9 +326,9 @@ function NewInfoHandler() {
}
};

ih.draw_infobox = function(mouse_point, active_square, leela_maybe_running, active_colour, searchmoves, hoverdraw_div) {
ih.draw_infobox = function(mouse_point, active_square, leela_maybe_running, active_colour, searchmoves, hoverdraw_div, readyok_required) {

ih.draw_statusbox(leela_maybe_running, searchmoves);
ih.draw_statusbox(leela_maybe_running, searchmoves, readyok_required);

// Display stderr and return if we've never seen any info...

Expand Down
5 changes: 3 additions & 2 deletions 95_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ function NewRenderer() {
}

// Leela seems to time "readyok" correctly after "position" commands.
// After sending "isready" We'll ignore Leela output until "readyok" comes.
// After sending "isready" we'll ignore Leela output until "readyok" comes.

this.engine.send(`position ${setup} moves ${this.node.history().join(" ")}`);
this.engine.send("isready");
Expand Down Expand Up @@ -1397,7 +1397,8 @@ function NewRenderer() {
this.leela_maybe_running,
this.node.get_board().active,
this.searchmoves,
this.hoverdraw_div);
this.hoverdraw_div,
this.engine.readyok_required);

debug.draw -= 1;
};
Expand Down

0 comments on commit d6a0b07

Please sign in to comment.