From: H.G.Muller Date: Mon, 23 Mar 2015 10:35:29 +0000 (+0100) Subject: Implement UCI_PlayByNodes option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=1ed8a494299caa117ca69cbf560fc64eb8dd5098;p=polyglot.git Implement UCI_PlayByNodes option Polyglot now suppresses passing any option called UCI_PlayByNodes as CECP option feature. It remembers the option, and uses its presence to determine whether to handle a received CECP "nps" command by using "go nodes" calculated from an improvised TC, or to just pass it as value for UCI_PlayByNodes. Any "new" command would reset UCI_PlaByNodes to 0. --- diff --git a/xboard2uci.c b/xboard2uci.c index 31312e4..4ddb72e 100644 --- a/xboard2uci.c +++ b/xboard2uci.c @@ -391,6 +391,9 @@ void xboard2uci_gui_step(char string[]) { XB->depth_limit = FALSE; XB->node_rate=-1; + if (option_find(Uci->option,"UCI_PlayByNodes")) { + uci_send_option(Uci,"UCI_PlayByNodes","%d",0); + } XB->computer = FALSE; my_string_set(&XB->name,""); @@ -428,7 +431,12 @@ void xboard2uci_gui_step(char string[]) { gui_send(GUI,"pong %s",Star[0]); } } else if (match(string,"nps *")) { - + + if (Star[0] > 0 && option_find(Uci->option,"UCI_PlayByNodes")) { + + uci_send_option(Uci,"UCI_PlayByNodes","%d",Star[0]); + + } else // fake WB play-by-nodes mode XB->node_rate = atoi(Star[0]); } else if (match(string,"playother")) { @@ -1022,6 +1030,7 @@ void xboard2uci_send_options(){ if(my_string_case_equal(opt->name,"UCI_ShredderbasesPath")) continue; if(my_string_case_equal(opt->name,"UCI_SetPositionValue")) continue; if(my_string_case_equal(opt->name,"UCI_DrawOffers")) continue; + if(my_string_case_equal(opt->name,"UCI_PlayByNodes")) continue; if(my_string_case_equal(opt->name,"Ponder")) continue; if(my_string_case_equal(opt->name,"Hash")) continue; if(my_string_case_equal(opt->name,"NalimovPath")) continue;