Exemple #1
0
        /// <summary>
        /// Use steam validator to validate the game
        /// </summary>
        /// <param name="gameType"></param>
        public static void ValidateGame(GameType gameType)
        {
            var utils = new SteamUtils();

            utils.StartValidator(gameType);



            //utils.OnGameFinishedValidating(args);
        }
Exemple #2
0
        /// <summary>
        /// Initialize the Steam validator for the specified game
        /// </summary>
        /// <param name="gameType">THe game to start validating</param>
        private void StartValidator(GameType gameType)
        {
            var utils = new SteamUtils();
            var args  = new SteamUtilsEventArgs();

            args.Game = gameType;

            if (!IsGameInstalled(gameType))
            {
                Log.Output("Failed to validate " + gameType + ". Failed to find game directory through steam.");
                utils.OnFailedToValidateGame(args);
                return;
            }

            if (IsGameRunning(gameType))
            {
                Utility.KillProcess(GameInfo.GetGame(gameType).ProcName);
            }

            var appID = steamGames_appID_fromGame[gameType];

            Process.Start("steam://validate/" + appID);
        }
Exemple #3
0
        /// <summary>
        /// Initialize game info for each game in GameType.
        /// </summary>
        private void InitializeGameInfo()
        {
            var btd5 = new GameInfo
            {
                Type        = GameType.BTD5,
                EXEName     = "BTD5-Win.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.BTD5),
                SaveDir     = "",
                ProcName    = "BTD5-Win",
                JetName     = "BTD5.jet",
                JetPassword = "******",
                JetPath     = GameDir + "\\Assets\\" + JetName,
                SteamID     = SteamUtils.GetGameID(GameType.BTD5)
            };

            var btdb = new GameInfo
            {
                Type        = GameType.BTDB,
                EXEName     = "Battles-Win.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.BTDB),
                SaveDir     = "",
                ProcName    = "Battles-Win",
                JetName     = "data.jet",
                JetPassword = "",
                JetPath     = GameDir + "\\Assets\\" + JetName,
                SteamID     = SteamUtils.GetGameID(GameType.BTDB)
            };

            var bmc = new GameInfo
            {
                Type        = GameType.BMC,
                EXEName     = "MonkeyCity-Win.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.BMC),
                SaveDir     = "",
                ProcName    = "MonkeyCity-Win",
                JetName     = "data.jet",
                JetPassword = "******",
                JetPath     = GameDir + "\\Assets\\" + JetName,
                SteamID     = SteamUtils.GetGameID(GameType.BMC)
            };

            var btd6 = new GameInfo
            {
                Type        = GameType.BTD6,
                EXEName     = "BloonsTD6.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.BTD6),
                SaveDir     = "",
                ProcName    = "BloonsTD6",
                JetName     = "BTD6.jet",
                JetPassword = "",
                SteamID     = SteamUtils.GetGameID(GameType.BTD6)
            };

            var btdat = new GameInfo
            {
                Type        = GameType.BTDAT,
                EXEName     = "btdadventuretime.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.BTDAT),
                SaveDir     = "",
                ProcName    = "btdadventuretime",
                JetName     = "",
                JetPassword = "",
                SteamID     = SteamUtils.GetGameID(GameType.BTDAT)
            };

            var nkArchive = new GameInfo
            {
                Type        = GameType.NKArchive,
                EXEName     = "Ninja Kiwi Archive.exe",
                GameDir     = SteamUtils.GetGameDir(GameType.NKArchive),
                SaveDir     = "",
                ProcName    = "Ninja Kiwi Archive",
                JetName     = "",
                JetPassword = "",
                SteamID     = SteamUtils.GetGameID(GameType.NKArchive)
            };

            games = new List <GameInfo>()
            {
                btd5, btdb, bmc, btd6, btdat, nkArchive
            };

            foreach (var item in games)
            {
                item.JetPath = item.GameDir;

                if (item.Type == GameType.BTD6 || item.Type == GameType.BTDAT)
                {
                    item.JetPath += "\\" + item.JetName;
                }
                else if (item.Type == GameType.BTD5 || item.Type == GameType.BTDB || item.Type == GameType.BMC)
                {
                    item.JetPath += "\\Assets\\" + item.JetName;
                }
                else
                {
                    continue;
                }
            }
        }