]> git.sesse.net Git - stockfish/blobdiff - src/ucioption.cpp
Fix compilation after recent merge.
[stockfish] / src / ucioption.cpp
index 1dc9b89baed4e3298db8e79b6c6cafb32ec8c62a..2c84084813f1d8ae369054c5b9c9fa535b75d532 100644 (file)
 #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<HashProbeThread> 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 {
@@ -83,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("<empty>", on_rpc_server_address);
 }