예제 #1
0
        private async Task <ProcessEx> StartSubnauticaAsync()
        {
            string        subnauticaPath            = Config.SubnauticaPath;
            string        subnauticaLaunchArguments = Config.SubnauticaLaunchArguments;
            string        subnauticaExe             = Path.Combine(subnauticaPath, GameInfo.Subnautica.ExeName);
            IGamePlatform platform = GamePlatforms.GetPlatformByGameDir(subnauticaPath);

            // Start game & gaming platform if needed.
            using ProcessEx game = platform switch
                  {
                      Steam s => await s.StartGameAsync(subnauticaExe, GameInfo.Subnautica.SteamAppId, subnauticaLaunchArguments),
                      EpicGames e => await e.StartGameAsync(subnauticaExe, subnauticaLaunchArguments),
                      MSStore m => await m.StartGameAsync(subnauticaExe),
                      DiscordStore d => await d.StartGameAsync(subnauticaExe, subnauticaLaunchArguments),
                      _ => throw new Exception($"Directory '{subnauticaPath}' is not a valid {GameInfo.Subnautica.Name} game installation or the game's platform is unsupported by Nitrox.")
                  };

            return(game ?? throw new Exception($"Unable to start game through {platform.Name}"));
        }
예제 #2
0
 public static McpConfigData FromStagingInfo(EpicGames.MCP.Automation.BuildPatchToolStagingInfo StagingInfo)
 {
     string McpConfigNameToLookup = null;
     if (StagingInfo.OwnerCommand != null)
     {
         McpConfigNameToLookup = StagingInfo.OwnerCommand.ParseParamValue("MCPConfig");
     }
     if (String.IsNullOrEmpty(McpConfigNameToLookup))
     {
         return FromMcpConfigKey(StagingInfo.McpConfigKey);
     }
     return McpConfigHelper.Find(McpConfigNameToLookup);
 }