From: H.G.Muller <hgm@hgm-xboard.(none)>
Date: Mon, 27 Oct 2014 23:12:50 +0000 (+0100)
Subject: Implement the UCCI usemillisec option
X-Git-Tag: v2.0~15
X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7f8c3e5bd0c3d70daf5b1f4c0b623d38f3301ff6;p=uci2wb.git

Implement the UCCI usemillisec option

This option is set (and msec are used) when the engine announced it
with default value 'false'.
---

diff --git a/UCI2WB.c b/UCI2WB.c
index 15b35de..8b8b460 100644
--- a/UCI2WB.c
+++ b/UCI2WB.c
@@ -303,6 +303,7 @@ Engine2GUI()
 		continue;
 	    }
 	    if(!strcmp(name, "newgame") && !strcmp(type, "button")) { newGame++; continue; }
+	    if(!strcmp(name, "usemillisec")) { unit = (!strcmp(val, "false") ? 2 : 1); continue; }
 	    // pass on engine-defined option as WB option feature
 	    if(!strcmp(type, "filename")) type[4] = 0;
 	    sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf);
@@ -330,6 +331,7 @@ Engine2GUI()
 	else if(!strcmp(command, "readyok")) { pause = 0; Sync(WAKEUP); } // resume processing of GUI commands
 	else if(sc == 'x'&& !strcmp(command, "ucciok") || sscanf(command, "u%ciok", &c)==1 && c==sc) {
 	    printf("feature smp=1 memory=%d done=1\n", hasHash);
+	    if(unit == 2) unit = 1, fprintf(toE, "setoption usemillisec true\n");
 	    Sync(WAKEUP); // done with options
 	}
     }