Exemplo n.º 1
0
        public async Task Start()
        {
            if (_config.GenerateRawFiles)
            {
                GenerateCfgFile();
                GenerateVdmFile();
                GameLauncherConfiguration config = new GameLauncherConfiguration(_config.Demo)
                {
                    EnableHlae             = true,
                    OnGameStarted          = HandleGameStarted,
                    OnGameRunning          = HandleGameRunning,
                    OnGameClosed           = HandleGameClosed,
                    OnHLAEStarted          = HandleHLAEStarted,
                    OnHLAEClosed           = HandleHLAEClosed,
                    DeleteVdmFileAtStratup = false,
                    CsgoExePath            = AppSettings.GetCsgoExePath(),          // TODO move it?
                    EnableHlaeConfigParent = _config.EnableHlaeConfigParent,
                    Fullscreen             = false,
                    Height = _config.Height,
                    Width  = _config.Width,
                    HlaeConfigParentFolderPath = _config.HlaeConfigParentFolderPath,
                    HlaeExePath      = HlaeService.GetHlaeExePath(),
                    LaunchParameters = _config.LaunchParameters,
                    SteamExePath     = AppSettings.SteamExePath(),                 // TODO move it?
                };

                GameLauncher launcher = new GameLauncher(config);
                await launcher.StartGame();
            }
            else
            {
                // just simulate that the game has been closed to start encoding
                await HandleGameClosed();
            }
        }
Exemplo n.º 2
0
 public GameLauncher(GameLauncherConfiguration config)
 {
     _config = config;
     _arguments.Add("+playdemo");
     _arguments.Add(_config.Demo.Path);
 }