Beispiel #1
0
        private void StartSteam()
        {
            var sl = new SteamLauncher(_steamPath);

            if (!sl.SteamExePath.Exists)
            {
                throw new SteamNotFoundException("Steam does not appear to be running and could not find Steam");
            }
            sl.StartSteamIfRequired();
        }
            public int LaunchGame(GameLaunchSpec spec)
            {
                if (spec == null)
                {
                    throw new ArgumentNullException(nameof(spec));
                }
                if (!(!string.IsNullOrWhiteSpace(spec.GamePath)))
                {
                    throw new ArgumentNullException("!string.IsNullOrWhiteSpace(spec.GamePath)");
                }
                if (!(!string.IsNullOrWhiteSpace(spec.WorkingDirectory)))
                {
                    throw new 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);
                }
            }
Beispiel #3
0
 /// <summary>
 /// Launch a new UOSteam instance.
 /// </summary>
 /// <param name="options">UOMachine.OptionsData to use for launching Razor.</param>
 /// <param name="clientIndex">Client index of launched client.</param>
 /// <returns>True on success.</returns>
 public static bool LaunchSteam(OptionsData options, out int clientIndex)
 {
     return(SteamLauncher.Launch(options, out clientIndex));
 }
Beispiel #4
0
 /// <summary>
 /// Launch a new UOSteam instance.
 /// </summary>
 /// <param name="clientIndex">Client index of launched client.</param>
 /// <returns>True on success.</returns>
 public static bool LaunchSteam(out int clientIndex)
 {
     return(SteamLauncher.Launch(MainWindow.CurrentOptions, out clientIndex));
 }