public int LaunchGame(GameLaunchSpec spec) {
                Contract.Requires<ArgumentNullException>(spec != null);
                Contract.Requires<ArgumentNullException>(!string.IsNullOrWhiteSpace(spec.GamePath));
                Contract.Requires<ArgumentNullException>(!string.IsNullOrWhiteSpace(spec.WorkingDirectory));

                _spec = spec;
                _steamLauncher = new SteamLauncher(_spec.SteamPath);
                _steamAppLauncher = new SteamAppLauncher(_steamLauncher);

                PrepareSteamState();
                if (_spec.LegacyLaunch && _isSteamGameAndAvailable)
                    LegacySteamLaunch();
                else
                    ModernLaunch();

                using (_launchedGame) {
                    if (_launchedGame == null)
                        return -1;
                    PostProcessLaunch();
                    return _launchedGame.Id;
                }
            }
 public SteamAppLauncher(SteamLauncher steamLauncher) {
     _steamLauncher = steamLauncher;
 }
Example #3
0
 public SteamAppLauncher(SteamLauncher steamLauncher)
 {
     _steamLauncher = steamLauncher;
 }