From b0a35cef0cbc3515748f83081884866caec9389e Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 14 Jan 2016 14:36:47 +0100 Subject: [PATCH] Send ping in EditGameEvent An EditGameEvent can interrupt tinking of an engine, and the engine might or might not send back a move as a result of that thinking. To solve this, a "force" command sent to an engine playing white or black will now be followed by a "ping". (If supported, of course.) --- backend.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index a3a81ef..233fb8d 100644 --- a/backend.c +++ b/backend.c @@ -14974,6 +14974,11 @@ EditGameEvent () case MachinePlaysBlack: case BeginningOfGame: SendToProgram("force\n", &first); + if (first.usePing) { // [HGM] always send ping when we might interrupt machine thinking + char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, "ping %d\n", initPing = ++first.lastPing); + SendToProgram(buf, &first); + } SetUserThinkingEnables(); break; case PlayFromGameFile: -- 1.7.0.4