DroidFish: Use different GTB path for network engines and local engines.

This commit is contained in:
Peter Osterlund 2014-06-06 13:07:32 +00:00
parent 4fbb4b721c
commit 0f9f9f6e01
5 changed files with 17 additions and 3 deletions

View File

@ -405,6 +405,8 @@ you are not actively using the program.\
<string name="prefs_tbEngineProbe_summary">Enable tablebase probing in engine, when supported. Takes effect next time engine is started</string>
<string name="prefs_gtbPath_title">GTB Directory</string>
<string name="prefs_gtbPath_summary">Directory where Gaviota tablebases are installed. Leave blank to use default directory</string>
<string name="prefs_gtbPathNet_title">GTB Network Directory</string>
<string name="prefs_gtbPathNet_summary">Directory for network engines where Gaviota tablebases are installed.</string>
<string name="prefs_rtbPath_title">Syzygy Directory</string>
<string name="prefs_rtbPath_summary">Directory where Syzygy tablebases are installed. Leave blank to use default directory</string>
<string name="buttonDesc_custom1">@string/prefs_custom_button_1</string>

View File

@ -687,6 +687,12 @@
android:summary="@string/prefs_gtbPath_summary"
android:defaultValue="">
</EditTextPreference>
<EditTextPreference
android:key="gtbPathNet"
android:title="@string/prefs_gtbPathNet_title"
android:summary="@string/prefs_gtbPathNet_summary"
android:defaultValue="">
</EditTextPreference>
<EditTextPreference
android:key="rtbPath"
android:title="@string/prefs_rtbPath_title"

View File

@ -970,6 +970,8 @@ public class DroidFish extends Activity implements GUIInterface {
gtbPath = extDir.getAbsolutePath() + sep + gtbDefaultDir;
}
engineOptions.gtbPath = gtbPath;
String gtbPathNet = settings.getString("gtbPathNet", "").trim();
engineOptions.gtbPathNet = gtbPathNet;
String rtbPath = settings.getString("rtbPath", "").trim();
if (rtbPath.length() == 0) {
File extDir = Environment.getExternalStorageDirectory();

View File

@ -26,6 +26,7 @@ public final class EngineOptions {
public boolean rootProbe; // Only search optimal moves at root
public boolean engineProbe; // Let engine use EGTB
public String gtbPath; // GTB directory path
public String gtbPathNet; // GTB directory path for network engines
public String rtbPath; // Syzygy directory path
public String networkID; // host+port network settings
@ -36,6 +37,7 @@ public final class EngineOptions {
rootProbe = false;
engineProbe = false;
gtbPath = "";
gtbPathNet = "";
rtbPath = "";
networkID = "";
}
@ -47,6 +49,7 @@ public final class EngineOptions {
rootProbe = other.rootProbe;
engineProbe = other.engineProbe;
gtbPath = other.gtbPath;
gtbPathNet = other.gtbPathNet;
rtbPath = other.rtbPath;
networkID = other.networkID;
}
@ -63,6 +66,7 @@ public final class EngineOptions {
(rootProbe == other.rootProbe) &&
(engineProbe == other.engineProbe) &&
gtbPath.equals(other.gtbPath) &&
gtbPathNet.equals(other.gtbPathNet) &&
rtbPath.equals(other.rtbPath) &&
networkID.equals(other.networkID));
}

View File

@ -206,8 +206,8 @@ public class NetworkEngine extends UCIEngineBase {
hashMB = engineOptions.hashMB;
setOption("Hash", engineOptions.hashMB);
if (engineOptions.engineProbe) {
gaviotaTbPath = engineOptions.gtbPath;
setOption("GaviotaTbPath", engineOptions.gtbPath);
gaviotaTbPath = engineOptions.gtbPathNet;
setOption("GaviotaTbPath", engineOptions.gtbPathNet);
setOption("GaviotaTbCache", 8);
syzygyPath = engineOptions.rtbPath;
setOption("SyzygyPath", engineOptions.rtbPath);
@ -226,7 +226,7 @@ public class NetworkEngine extends UCIEngineBase {
return false;
if (hashMB != engineOptions.hashMB)
return false;
if (hasOption("gaviotatbpath") && !gaviotaTbPath.equals(engineOptions.gtbPath))
if (hasOption("gaviotatbpath") && !gaviotaTbPath.equals(engineOptions.gtbPathNet))
return false;
if (hasOption("syzygypath") && !syzygyPath.equals(engineOptions.rtbPath))
return false;