internal static void UpdateMooegeIni(Repository repository) { var repoIniPath = new IniConfigSource(Paths.GetMooegeIniPath(repository)); //For each selection we set the correct MPQ storage path & PacketLog|ServerLog settings on the config INI, this is the best way I could think to have the paths updated at everytime //We CANNOT call variable Compile.mooegeINI because that variable only saves latest compiled ini path for INSTANT writting after compiling a repository. //WE do not need to write different IPS / PORTS for this since its LOCAL function, We do that over RepositorySelectionSERVER. #region SetSettings repoIniPath.Configs["Storage"].Set("MPQRoot", MadCow.MpqServer); repoIniPath.Configs["ServerLog"].Set("Enabled", Mooege.FileLogging); repoIniPath.Configs["PacketLog"].Set("Enabled", Mooege.PacketLogging); repoIniPath.Configs["Storage"].Set("EnableTasks", Mooege.Tasks); repoIniPath.Configs["Storage"].Set("LazyLoading", Mooege.LazyLoading); repoIniPath.Configs["Authentication"].Set("DisablePasswordChecks", Mooege.PasswordCheck); //We set the server variables: //MooNet-Server IP repoIniPath.Configs["MooNet-Server"].Set("BindIP", MadCow.CurrentProfile.MooNetServerIp); //Game-Server IP repoIniPath.Configs["Game-Server"].Set("BindIP", MadCow.CurrentProfile.GameServerIp); //Public IP repoIniPath.Configs["NAT"].Set("PublicIP", MadCow.CurrentProfile.NatIp); //MooNet-Server Port repoIniPath.Configs["MooNet-Server"].Set("Port", MadCow.CurrentProfile.MooNetServerPort); //Game-Server Port repoIniPath.Configs["Game-Server"].Set("Port", MadCow.CurrentProfile.GameServerPort); //MOTD repoIniPath.Configs["MooNet-Server"].Set("MOTD", MadCow.CurrentProfile.MooNetServerMotd); //NAT repoIniPath.Configs["NAT"].Set("Enabled", MadCow.CurrentProfile.NatEnabled); repoIniPath.Save(); #endregion Console.WriteLine("Current Profile: " + MadCow.CurrentProfile); Console.WriteLine("Set Mooege config.ini according to your profile " + MadCow.CurrentProfile); Console.WriteLine(repository + " is ready to go."); }
internal static string GetMooegeIniPath(Repository repository) { return Path.Combine(GetMooegeFolderPath(repository), "config.ini"); }
internal static string GetMooegeFolderPath(Repository repository) { return Path.Combine(RepositoriesPath, repository.Name, "Compiled"); }
internal static string GetMooegeExePath(Repository repository) { return Path.Combine(GetMooegeFolderPath(repository), "Mooege.exe"); }
private void okButton_Click(object sender, EventArgs e) { SelectedRepository = new Repository(new Uri(repositoryTextBox.Text), branchComboBox.SelectedItem.ToString()); Close(); }
internal EditRepository(Repository repository = null) { _suppliedRepository = repository; InitializeComponent(); ApplyRepository(); }
public static void Play(Repository repository) { try { var src = Configuration.MadCow.DiabloPath; Configuration.UpdateMooegeIni(repository); if (ProcessFinder.FindProcess("Mooege") == false) { if (File.Exists(Paths.GetMooegeExePath(repository))) { Console.WriteLine("Starting Mooege.."); var mooege = new Process(); mooege.StartInfo = new ProcessStartInfo(Paths.GetMooegeExePath(repository)); mooege.Start(); Thread.Sleep(3000); //We sleep so our ErrorFinder has time to parse Mooege logs. if (ErrorFinder.SearchLogs("Fatal")) { Console.WriteLine("Closing Mooege due Fatal Exception"); ProcessFinder.KillProcess("Mooege"); } else { Console.WriteLine("Starting Diablo.."); var Diablo3 = new Process(); Diablo3.StartInfo = new ProcessStartInfo(src); Diablo3.StartInfo.Arguments = " -launch -auroraaddress localhost:1345"; Diablo3.Start(); //We save this repository for LastPlayed function. Configuration.MadCow.LastRepository = Paths.GetMooegeExePath(repository); } } else { Console.WriteLine("[Error] Couldn't find selected repository binaries." + "\nTry updating the repository again."); } } else //If Mooege is running we kill it and start it again. { Console.WriteLine("Killing Mooege Process.."); ProcessFinder.KillProcess("Mooege"); Console.WriteLine("Starting Mooege.."); var mooege = new Process(); mooege.StartInfo = new ProcessStartInfo(Paths.GetMooegeExePath(repository)); mooege.Start(); Thread.Sleep(3000); if (ErrorFinder.SearchLogs("Fatal")) { Console.WriteLine("Closing Mooege due Fatal Exception"); ProcessFinder.KillProcess("Mooege"); } else { Console.WriteLine("Starting Diablo.."); var Diablo3 = new Process(); Diablo3.StartInfo = new ProcessStartInfo(src); Diablo3.StartInfo.Arguments = " -launch -auroraaddress localhost:1345"; Diablo3.Start(); } } } catch { Console.WriteLine("[ERROR] Could not launch Diablo. (Diablo.cs)" + "\nPlease report this error in the forum."); } }
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { SelectRepoChngLogComboBox.Enabled = false; _selectedRepo = (Repository)SelectRepoChngLogComboBox.SelectedItem; var bgWorker = new BackgroundWorker(); bgWorker.DoWork += ChangeLogDownloader_DoWork; //bgWorker.RunWorkerCompleted += (s, ea) => Invoke(new Action(() => SelectRepoChngLogComboBox.Enabled = true)); //Proceed to download the commit file and parse. bgWorker.RunWorkerAsync(); }