X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=7123915933b90f59d48627cd95d42dc809b07a38;hp=233602ca153edc27f5b38ccb7348d48e758fafbe;hb=HEAD;hpb=536d692a3082cc86afcf1a48b0cf25ac73fa7074 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 233602ca..2c840848 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -35,12 +35,14 @@ #include "tt.h" #include "types.h" #include "uci.h" +#include "hashprobe.h" using std::string; namespace Stockfish { UCI::OptionsMap Options; // Global object +std::unique_ptr hash_probe_thread; namespace UCI { @@ -50,7 +52,15 @@ static void on_hash_size(const Option& o) { TT.resize(size_t(o)); } static void on_logger(const Option& o) { start_logger(o); } static void on_threads(const Option& o) { Threads.set(size_t(o)); } static void on_tb_path(const Option& o) { Tablebases::init(o); } -static void on_eval_file(const Option&) { Eval::NNUE::init(); } +static void on_use_NNUE(const Option& ) { Eval::NNUE::init(); } +static void on_eval_file(const Option& ) { Eval::NNUE::init(); } +static void on_rpc_server_address(const Option& o) { + if (hash_probe_thread) { + hash_probe_thread->Shutdown(); + } + std::string addr = o; + hash_probe_thread.reset(new HashProbeThread(addr)); +} // Our case insensitive less() function as required by UCI protocol bool CaseInsensitiveLess::operator()(const string& s1, const string& s2) const { @@ -75,7 +85,6 @@ void init(OptionsMap& o) { o["Move Overhead"] << Option(10, 0, 5000); o["nodestime"] << Option(0, 0, 10000); o["UCI_Chess960"] << Option(false); - o["UCI_AnalyseMode"] << Option(false); o["UCI_LimitStrength"] << Option(false); o["UCI_Elo"] << Option(1320, 1320, 3190); o["UCI_ShowWDL"] << Option(false); @@ -84,6 +93,7 @@ void init(OptionsMap& o) { o["Syzygy50MoveRule"] << Option(true); o["SyzygyProbeLimit"] << Option(7, 0, 7); o["EvalFile"] << Option(EvalFileDefaultName, on_eval_file); + o["RPCServerAddress"] << Option("", on_rpc_server_address); }