Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Clovershell/ClovershellConnection.cs8
-rw-r--r--ConfigIni.cs10
-rw-r--r--MainForm.cs18
-rw-r--r--NesMenuCollection.cs3
-rw-r--r--Properties/AssemblyInfo.cs4
5 files changed, 34 insertions, 9 deletions
diff --git a/Clovershell/ClovershellConnection.cs b/Clovershell/ClovershellConnection.cs
index 682333f7..1ca67883 100644
--- a/Clovershell/ClovershellConnection.cs
+++ b/Clovershell/ClovershellConnection.cs
@@ -379,16 +379,16 @@ namespace com.clusterrr.clovershell
buff[1] = 0;
buff[2] = 0;
buff[3] = 0;
- epWriter.Write(buff, 0, buff.Length, 1000, out tLen);
+ var r = epWriter.Write(buff, 0, buff.Length, 1000, out tLen);
if (tLen != buff.Length)
- throw new ClovershellException("kill all shell: write error");
+ throw new ClovershellException("kill all shell: write error - " + r.ToString());
buff[0] = (byte)ClovershellCommand.CMD_EXEC_KILL_ALL;
buff[1] = 0;
buff[2] = 0;
buff[3] = 0;
- epWriter.Write(buff, 0, buff.Length, 1000, out tLen);
+ r= epWriter.Write(buff, 0, buff.Length, 1000, out tLen);
if (tLen != buff.Length)
- throw new ClovershellException("kill all exec: write error");
+ throw new ClovershellException("kill all exec: write error - "+r.ToString());
}
internal void writeUsb(ClovershellCommand cmd, byte arg, byte[] data = null, int pos = 0, int l = -1)
diff --git a/ConfigIni.cs b/ConfigIni.cs
index 95780610..132f6d61 100644
--- a/ConfigIni.cs
+++ b/ConfigIni.cs
@@ -26,6 +26,8 @@ namespace com.clusterrr.hakchi_gui
public static bool Compress = true;
public const string ConfigDir = "config";
public const string ConfigFile = "config.ini";
+ public static bool FtpServer = false;
+ public static bool TelnetServer = false;
public static void Load()
{
@@ -108,6 +110,12 @@ namespace com.clusterrr.hakchi_gui
case "compress":
Compress = !value.ToLower().Equals("false");
break;
+ case "ftpserver":
+ FtpServer = !value.ToLower().Equals("false");
+ break;
+ case "telnetserver":
+ TelnetServer = !value.ToLower().Equals("false");
+ break;
}
break;
case "presets":
@@ -139,6 +147,8 @@ namespace com.clusterrr.hakchi_gui
configLines.Add(string.Format("FoldersMode={0}", (byte)FoldersMode));
configLines.Add(string.Format("MaxGamesPerFolder={0}", MaxGamesPerFolder));
configLines.Add(string.Format("Compress={0}", Compress));
+ configLines.Add(string.Format("FtpServer={0}", FtpServer));
+ configLines.Add(string.Format("TelnetServer={0}", TelnetServer));
configLines.Add("");
configLines.Add("[Presets]");
diff --git a/MainForm.cs b/MainForm.cs
index c9c23d30..2b8aa4e1 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -174,6 +174,17 @@ namespace com.clusterrr.hakchi_gui
ftpServer.FileSystemHandler = new mooftpserv.NesMiniFileSystemHandler(Clovershell);
ftpServer.LogHandler = new mooftpserv.DebugLogHandler();
ftpServer.LocalPort = 1021;
+
+ if (ConfigIni.FtpServer)
+ {
+ FTPToolStripMenuItem.Checked = true;
+ FTPToolStripMenuItem_Click(null, null);
+ }
+ if (ConfigIni.TelnetServer)
+ {
+ shellToolStripMenuItem.Checked = true;
+ shellToolStripMenuItem_Click(null, null);
+ }
}
catch (Exception ex)
{
@@ -1339,17 +1350,20 @@ namespace com.clusterrr.hakchi_gui
}
});
ftpThread.Start();
+ ConfigIni.FtpServer = true;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message + ex.StackTrace);
MessageBox.Show(this, ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
FTPToolStripMenuItem.Checked = false;
+ ConfigIni.FtpServer = false;
}
}
else
{
ftpServer.Stop();
+ ConfigIni.FtpServer = false;
}
openFTPInExplorerToolStripMenuItem.Enabled = FTPToolStripMenuItem.Checked;
}
@@ -1358,13 +1372,13 @@ namespace com.clusterrr.hakchi_gui
{
try
{
- openTelnetToolStripMenuItem.Enabled = Clovershell.ShellEnabled = shellToolStripMenuItem.Checked;
+ ConfigIni.TelnetServer = openTelnetToolStripMenuItem.Enabled = Clovershell.ShellEnabled = shellToolStripMenuItem.Checked;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message + ex.StackTrace);
MessageBox.Show(this, ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
- shellToolStripMenuItem.Checked = false;
+ ConfigIni.TelnetServer = openTelnetToolStripMenuItem.Enabled = shellToolStripMenuItem.Checked = false;
}
}
diff --git a/NesMenuCollection.cs b/NesMenuCollection.cs
index 39ff3fe9..a82a9c57 100644
--- a/NesMenuCollection.cs
+++ b/NesMenuCollection.cs
@@ -39,7 +39,8 @@ namespace com.clusterrr.hakchi_gui
case SplitStyle.Original_FoldersEqual:
case SplitStyle.Original_PagesEqual:
style--;
- originalToRoot = true;
+ if (this.Where(o => o is NesDefaultGame).Count() > 0)
+ originalToRoot = true;
break;
}
if (style == SplitStyle.NoSplit && !originalToRoot) return;
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
index 9a52e395..615e0a95 100644
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.16.3")]
-[assembly: AssemblyFileVersion("2.0.16.3")]
+[assembly: AssemblyVersion("2.0.16.10")]
+[assembly: AssemblyFileVersion("2.0.16.10")]