xboard: add engine version to 'myname' feature
authorYann Dirson <ydirson@free.fr>
Sat, 4 Jul 2020 12:36:12 +0000 (14:36 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 4 Jul 2020 15:26:12 +0000 (17:26 +0200)
src/misc.cpp
src/misc.h
src/xboard.cpp

index cf92933..00adf9b 100644 (file)
@@ -133,7 +133,7 @@ public:
 /// the program was compiled) or "Stockfish <Version>", depending on whether
 /// Version is empty.
 
-const string engine_info(bool to_uci) {
+const string engine_info(bool to_uci, bool to_xboard) {
 
   const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec");
   string month, day, year;
@@ -152,9 +152,11 @@ const string engine_info(bool to_uci) {
 #endif
 
   ss << (Is64Bit ? " 64" : "")
-     << (HasPext ? " BMI2" : (HasPopCnt ? " POPCNT" : ""))
-     << (to_uci  ? "\nid author ": " by ")
-     << "Fabian Fichter";
+     << (HasPext ? " BMI2" : (HasPopCnt ? " POPCNT" : ""));
+
+  if (!to_xboard)
+    ss << (to_uci  ? "\nid author ": " by ")
+       << "Fabian Fichter";
 
   return ss.str();
 }
index a3780ba..0d1816c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "types.h"
 
-const std::string engine_info(bool to_uci = false);
+const std::string engine_info(bool to_uci = false, bool to_xboard = false);
 const std::string compiler_info();
 void prefetch(void* addr);
 void start_logger(const std::string& fname);
index e199d56..7a6f025 100644 (file)
@@ -20,6 +20,7 @@
 #include <string>
 
 #include "evaluate.h"
+#include "misc.h"
 #include "partner.h"
 #include "search.h"
 #include "thread.h"
@@ -109,8 +110,8 @@ void StateMachine::process_command(Position& pos, std::string token, std::istrin
           if (v != "chess")
               vars += "," + v;
       sync_cout << "feature setboard=1 usermove=1 time=1 memory=1 smp=1 colors=0 draw=0 "
-                << "highlight=1 name=0 sigint=0 ping=1 myname=Fairy-Stockfish variants=\""
-                << vars << "\""
+                << "highlight=1 name=0 sigint=0 ping=1 myname=\""
+                << engine_info(false, true) << "\" " << "variants=\"" << vars << "\""
                 << Options << sync_endl;
       sync_cout << "feature done=1" << sync_endl;
   }