public void LoadAllModsInDirectory() { var directories = Directory.GetDirectories(Path.GetDirectoryName(ConfigHolder.GetProcessPath())); foreach (string s in directories) { if (ConfigHolder.IsModFolder(ConfigHolder.ShortenModPath(s))) { if (AddMod(s)) { window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s)); } } } }
public void LoadGUI() { window.ProcessTextBox.Text = ConfigHolder.GetProcessPath(); window.KillNonRespProcessBox.IsChecked = ConfigHolder.killNonRespProcess; window.StartServerWithToolBox.IsChecked = ConfigHolder.startServerOnStartup; foreach (string s in ConfigHolder.GetParameters()) { window.AddItemToList(window.ParameterList, s); } foreach (string s in ConfigHolder.GetMods()) { window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s)); } WriteToConsole("Config files loaded"); }
public static string GetProcessName() { string name = Path.GetFileName(ConfigHolder.GetProcessPath()); string newName = ""; for (int i = 0; i < name.Length; i++) { if (name[i] == char.Parse(".")) { break; } else { newName += name[i]; } } return(newName); }
public static string StartServer() { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = ConfigHolder.GetProcessPath(); startInfo.Arguments = ReadParameters() + " " + ReadMods(); Process process = new Process(); process.StartInfo = startInfo; process.Start(); if (!process.Responding) { process.Kill(); } Logger.WriteToLogFile("Starting server with parameters: " + ReadParameters() + " " + ReadMods()); return(ReadParameters() + " " + ReadMods()); }
public void PrintProcessDirectory() { WriteToConsole(Path.GetFullPath(ConfigHolder.GetProcessPath())); }
private string GetProcessDirectory() { return(Path.GetDirectoryName(ConfigHolder.GetProcessPath()) + @"\"); }