From 35ffc8b7ee8e505a23a9ce60a5734a72560d93a5 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 14 Jan 2012 12:14:57 +0100 Subject: [PATCH] Implement ping Use readyok / isready to really ping the engine before acknowledging the GUI. --- UCI2WB.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index e709384..764f921 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -292,7 +292,7 @@ printf("# start search\n"); } else fprintf(toE, "setoption name %s\n", line+7), printf("# setoption name %s\n", line+7); } else if(!strcmp(command, "protover")) { - printf("feature variants=\"%s\" setboard=1 usermove=1 debug=1 reuse=0 done=0\n", sc=='s' ? "shogi,5x5+5_shogi" : VARIANTS); + printf("feature variants=\"%s\" setboard=1 usermove=1 debug=1 ping=1 reuse=0 done=0\n", sc=='s' ? "shogi,5x5+5_shogi" : VARIANTS); fprintf(toE, "u%ci\n", sc); // this prompts UCI engine for options } else if(!strcmp(command, "setboard")) { @@ -327,6 +327,7 @@ printf("# start search\n"); else if(!strcmp(command, "nopost")) post = 0; else if(!strcmp(command, "easy")) ponder = 0; else if(!strcmp(command, "hard")) ponder = 1; + else if(!strcmp(command, "ping")) pause = 1, fprintf(toE, "isready\n"), fflush(toE), Sync(PAUSE), printf("pong %s", line+5); else if(!strcmp(command, "memory")) sscanf(line, "memory %d", &memory); else if(!strcmp(command, "cores")) sscanf(line, "cores %d", &cores); else if(!strcmp(command, "sd")) sscanf(line, "sd %d", &depth); -- 1.7.0.4