#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 {
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 {
}
-// UCI::init() initializes the UCI options to their hard-coded default values
-
+// Initializes the UCI options to their hard-coded default values
void init(OptionsMap& o) {
constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048;
o["MultiPV"] << Option(1, 1, 500);
o["Skill Level"] << Option(20, 0, 20);
o["Move Overhead"] << Option(10, 0, 5000);
- o["Slow Mover"] << Option(100, 10, 1000);
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);
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);
}
-// operator<<() is used to print all the options default values in chronological
+// Used to print all the options default values in chronological
// insertion order (the idx field) and in the format defined by the UCI protocol.
-
std::ostream& operator<<(std::ostream& os, const OptionsMap& om) {
for (size_t idx = 0; idx < om.size(); ++idx)
}
-// operator<<() inits options and assigns idx in the correct printing order
+// Inits options and assigns idx in the correct printing order
void Option::operator<<(const Option& o) {
}
-// operator=() updates currentValue and triggers on_change() action. It's up to
+// Updates currentValue and triggers on_change() action. It's up to
// the GUI to check for option's limits, but we could receive the new value
// from the user by console window, so let's check the bounds anyway.
-
Option& Option::operator=(const string& v) {
assert(!type.empty());