X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;h=1cb0a1656b06c9d06064fd3377e2047176a8d966;hp=1632b818e5f20be6680d7b15f6e47626b22571fe;hb=8d90214e278c27dbf72b24383ac9e3ad24d54a27;hpb=df071f0901dc34959be92976afde6dd7054dd8ad diff --git a/UCI2WB.c b/UCI2WB.c index 1632b81..1cb0a16 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -453,7 +453,6 @@ GUI2Engine() fflush(toE); fflush(stdout); if(!ReadLine(stdin, line)) printf("# EOF\n"), sprintf(line, "quit -1\n"); sscanf(line, "%s", command); - DPRINT("# %s searching=%d\n", command, searching); if(!strcmp(command, "usermove")) { difficult--; break; } // for efficiency during game play, moves, time & otim are tried first else if(!strcmp(command, "time")) sscanf(line+4, "%d", &myTime), myTime = (10*myTime)/unit; else if(!strcmp(command, "otim")) sscanf(line+4, "%d", &hisTime), hisTime = (10*hisTime)/unit; @@ -468,6 +467,10 @@ GUI2Engine() suspended = 1 + (searching == 1); // remember if we were pondering, and stop search ignoring bestmove StopSearch(1); } + else if(!strcmp(command, "xboard")) ; + else if(!strcmp(command, "accepted")) ; + else if(!strcmp(command, "rejected")) ; + else if(!strcmp(command, "computer")) comp = 1; else { //convert easy & hard to "option" after treating their effect on the adapter if(!strcmp(command, "easy")) { if(*canPonder) ponder = 0, sprintf(command, "option"), sprintf(line, "option %s=0\n", canPonder); else continue; @@ -509,6 +512,7 @@ GUI2Engine() suspended = 0; *qEnd++ = '\n'; Sync(WAKEUP); // causes search to start in normal way if on move or analyzing } else { + DPRINT("# queue '%s', searching=%d\n", command, searching); if(searching == 3) { // command arrived during thinking; order abort for 'instant commands' if(!strcmp(command, "?") || !strcmp(command, "quit") || !strcmp(command, "force") || !strcmp(command, "result")) StopSearch(0); @@ -538,10 +542,10 @@ DoCommand () if(memory != oldMem && hasHash) EPRINT((f, "# setoption %s%s %s%d\n", nameWord, hashOpt, valueWord, memory)) oldMem = memory; // we can set other options here - if(sc == 'x') { if(newGame) EPRINT((f, "# setoption newgame\n")) } else // optional in UCCI if(varOpt) EPRINT((f, "# setoption name UCI_Variant value chess\n")) EPRINT((f, "# isready\n")) fflush(toE); HandleEngineOutput(); // wait for readyok + if(sc == 'x') { if(newGame) EPRINT((f, "# setoption newgame\n")) } else // optional in UCCI EPRINT((f, "# u%cinewgame\n", sc)) fflush(toE); } else if(!strcmp(command, "option")) { @@ -596,7 +600,6 @@ DoCommand () inex = 1; line[strlen(line)-1] = sm = 0; // strip LF and clear sm flag for(i=1; i