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

This commit is contained in:
Peter Osterlund
2014-07-07 22:23:18 +00:00
parent c3acf44ac8
commit 2b7011acfe
5 changed files with 17 additions and 3 deletions

View File

@@ -409,6 +409,8 @@ you are not actively using the program.\
<string name="prefs_gtbPathNet_summary">Directory for network engines where Gaviota tablebases are installed.</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_title">Syzygy Directory</string>
<string name="prefs_rtbPath_summary">Directory where Syzygy tablebases are installed. Leave blank to use default directory</string> <string name="prefs_rtbPath_summary">Directory where Syzygy tablebases are installed. Leave blank to use default directory</string>
<string name="prefs_rtbPathNet_title">Syzygy Network Directory</string>
<string name="prefs_rtbPathNet_summary">Directory for network engines where Syzygy tablebases are installed.</string>
<string name="buttonDesc_custom1">@string/prefs_custom_button_1</string> <string name="buttonDesc_custom1">@string/prefs_custom_button_1</string>
<string name="buttonDesc_custom2">@string/prefs_custom_button_2</string> <string name="buttonDesc_custom2">@string/prefs_custom_button_2</string>
<string name="buttonDesc_custom3">@string/prefs_custom_button_3</string> <string name="buttonDesc_custom3">@string/prefs_custom_button_3</string>

View File

@@ -699,6 +699,12 @@
android:summary="@string/prefs_rtbPath_summary" android:summary="@string/prefs_rtbPath_summary"
android:defaultValue=""> android:defaultValue="">
</EditTextPreference> </EditTextPreference>
<EditTextPreference
android:key="rtbPathNet"
android:title="@string/prefs_rtbPathNet_title"
android:summary="@string/prefs_rtbPathNet_summary"
android:defaultValue="">
</EditTextPreference>
</PreferenceScreen> </PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -979,6 +979,8 @@ public class DroidFish extends Activity implements GUIInterface {
rtbPath = extDir.getAbsolutePath() + sep + rtbDefaultDir; rtbPath = extDir.getAbsolutePath() + sep + rtbDefaultDir;
} }
engineOptions.rtbPath = rtbPath; engineOptions.rtbPath = rtbPath;
String rtbPathNet = settings.getString("rtbPathNet", "").trim();
engineOptions.rtbPathNet = rtbPathNet;
setEngineOptions(false); setEngineOptions(false);
setEgtbHints(cb.getSelectedSquare()); setEgtbHints(cb.getSelectedSquare());

View File

@@ -28,6 +28,7 @@ public final class EngineOptions {
public String gtbPath; // GTB directory path public String gtbPath; // GTB directory path
public String gtbPathNet; // GTB directory path for network engines public String gtbPathNet; // GTB directory path for network engines
public String rtbPath; // Syzygy directory path public String rtbPath; // Syzygy directory path
public String rtbPathNet; // Syzygy directory path for network engines
public String networkID; // host+port network settings public String networkID; // host+port network settings
public EngineOptions() { public EngineOptions() {
@@ -39,6 +40,7 @@ public final class EngineOptions {
gtbPath = ""; gtbPath = "";
gtbPathNet = ""; gtbPathNet = "";
rtbPath = ""; rtbPath = "";
rtbPathNet = "";
networkID = ""; networkID = "";
} }
@@ -51,6 +53,7 @@ public final class EngineOptions {
gtbPath = other.gtbPath; gtbPath = other.gtbPath;
gtbPathNet = other.gtbPathNet; gtbPathNet = other.gtbPathNet;
rtbPath = other.rtbPath; rtbPath = other.rtbPath;
rtbPathNet = other.rtbPathNet;
networkID = other.networkID; networkID = other.networkID;
} }
@@ -68,6 +71,7 @@ public final class EngineOptions {
gtbPath.equals(other.gtbPath) && gtbPath.equals(other.gtbPath) &&
gtbPathNet.equals(other.gtbPathNet) && gtbPathNet.equals(other.gtbPathNet) &&
rtbPath.equals(other.rtbPath) && rtbPath.equals(other.rtbPath) &&
rtbPathNet.equals(other.rtbPathNet) &&
networkID.equals(other.networkID)); networkID.equals(other.networkID));
} }

View File

@@ -209,8 +209,8 @@ public class NetworkEngine extends UCIEngineBase {
gaviotaTbPath = engineOptions.gtbPathNet; gaviotaTbPath = engineOptions.gtbPathNet;
setOption("GaviotaTbPath", engineOptions.gtbPathNet); setOption("GaviotaTbPath", engineOptions.gtbPathNet);
setOption("GaviotaTbCache", 8); setOption("GaviotaTbCache", 8);
syzygyPath = engineOptions.rtbPath; syzygyPath = engineOptions.rtbPathNet;
setOption("SyzygyPath", engineOptions.rtbPath); setOption("SyzygyPath", engineOptions.rtbPathNet);
} }
optionsInitialized = true; optionsInitialized = true;
} }
@@ -228,7 +228,7 @@ public class NetworkEngine extends UCIEngineBase {
return false; return false;
if (hasOption("gaviotatbpath") && !gaviotaTbPath.equals(engineOptions.gtbPathNet)) if (hasOption("gaviotatbpath") && !gaviotaTbPath.equals(engineOptions.gtbPathNet))
return false; return false;
if (hasOption("syzygypath") && !syzygyPath.equals(engineOptions.rtbPath)) if (hasOption("syzygypath") && !syzygyPath.equals(engineOptions.rtbPathNet))
return false; return false;
return true; return true;
} }