From: H.G.Muller Date: Thu, 14 Jan 2016 13:36:47 +0000 (+0100) Subject: Send ping in EditGameEvent X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=b0a35cef0cbc3515748f83081884866caec9389e 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.) --- 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: