public int LaunchGame(bool pbe, string gid, string server, string key, string platform) { try { LeagueProfile lg = InstalledGameProfile; if (pbe) { lg = InstalledPbeProfile; } Process p = new System.Diagnostics.Process(); p.StartInfo.WorkingDirectory = lg.ReleaseDeploy; p.StartInfo.FileName = lg.LeagueExecutable; p.StartInfo.Arguments = "\"8394\" \"LoLLauncher.exe\" \"\" \"spectator " + server + " " + key + " " + gid + " " + platform + "\""; p.Start(); GhostOverlay.ShowOverlay(lg.ReleaseDeploy); return(p.Id); } catch (Exception ex) { Log.Log.Error("Failed to launch the game", ex); return(-1); } }
void LoadInstalledLol() { try { InstalledGameProfile = new LeagueProfile(SettingsManager.Settings.GameDirectory); SettingsManager.Settings.GameVersion = InstalledGameProfile.GameVersion.ToString(); SettingsManager.Save(); SetDirectory(SettingsManager.Settings.GameDirectory); } catch (Exception ex) { if (Log != null) { Log.Log.Warn(ex.Message); } // CALL LOL FINDER if (FindLol()) { LoadInstalledLol(); } else { System.Windows.Forms.MessageBox.Show("Failed to find league of legends install directory, the recorder will now exit to prevent possible failures.", "Lol Finder", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); Process.GetCurrentProcess().Kill(); } } // PBE PROFILE if (SettingsManager.Settings.HasPBE) { // PBE try { InstalledPbeProfile = new LeagueProfile(SettingsManager.Settings.PbeDirectory); if (!InstalledPbeProfile.IsPbe) { // NO PBE SettingsManager.Settings.HasPBE = false; SettingsManager.Settings.PbeVersion = ""; SettingsManager.Settings.PbeDirectory = ""; SettingsManager.Save(); } else { SettingsManager.Settings.PbeVersion = InstalledPbeProfile.GameVersion.ToString(); SettingsManager.Save(); } } catch (Exception ex) { if (Log != null) { Log.Log.Warn(ex.Message); } } } }