protected override void LaunchProgram() { Game game; String mapName; if (JoiningServer) { game = GameManager.Find((ServerSourceEngine ? Game.Engines.Source : Game.Engines.HalfLife), ServerGameFolderName); mapName = ServerMapName; } else { game = GameManager.Find(Demo); mapName = Demo.MapName; } // calculate launch parameters launchParameters = (UseHlae ? "" : "-applaunch " + game.AppId + " "); if ((JoiningServer && Config.Settings.ServerBrowserStartListenServer && !ServerSourceEngine) || (!JoiningServer && (Config.Settings.PlaybackStartListenServer || Demo.GameFolderName == "tfc") && Demo.Engine != Demo.Engines.Source)) { launchParameters += "-nomaster +maxplayers 10 +sv_lan 1 +map " + mapName + " "; } if (!JoiningServer && Demo.Engine == Demo.Engines.Source && Demo.GameFolderName == "tf") { // skip the valve logo intro video, and show the console when loading the demo launchParameters += "-novid +toggleconsole "; } launchParameters += "+exec " + Config.LaunchConfigFileName + " " + Config.Settings.SteamAdditionalLaunchParameters; // launch the program process if (UseHlae) { Hlae hlae = new Hlae(); hlae.ReadConfig(); hlae.WriteConfig(gameFullPath.Remove(gameFullPath.LastIndexOf('\\')) + "\\hl.exe", Demo.GameFolderName); ProcessStartInfo startInfo = new ProcessStartInfo(Config.Settings.HlaeExeFullPath); startInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(Config.Settings.HlaeExeFullPath); startInfo.Arguments = "-ipcremote"; Process.Start(startInfo); } else { Process.Start(Config.Settings.SteamExeFullPath, launchParameters); } }
protected override void LaunchProgram() { Game game = GameManager.Find(Demo); // calculate launch parameters launchParameters = (UseHlae ? "" : "-applaunch " + game.AppId + " "); if ((Config.Settings.PlaybackStartListenServer || Demo.GameFolderName == "tfc") && Demo.Engine != Demo.Engines.Source) { launchParameters += "-nomaster +maxplayers 10 +sv_lan 1 +map " + Demo.MapName + " "; } if (Demo.Engine == Demo.Engines.Source) { // skip intro videos // CS:GO quits unexpectedly if this is omitted launchParameters += "-novid "; if (Demo.GameFolderName == "tf") { // show the console when loading the demo launchParameters += "+toggleconsole "; } } launchParameters += "+exec " + Config.LaunchConfigFileName + " " + Config.Settings.SteamAdditionalLaunchParameters; // launch the program process if (UseHlae) { Hlae hlae = new Hlae(); hlae.ReadConfig(); hlae.WriteConfig(gameFullPath.Remove(gameFullPath.LastIndexOf('\\')) + "\\hl.exe", Demo.GameFolderName); ProcessStartInfo startInfo = new ProcessStartInfo(Config.Settings.HlaeExeFullPath); startInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(Config.Settings.HlaeExeFullPath); startInfo.Arguments = "-ipcremote"; Process.Start(startInfo); } else { Process.Start(Config.Settings.SteamExeFullPath, launchParameters); } }