Beispiel #1
0
        /// <summary>
        ///     Backend input
        /// </summary>
        /// <param name="inputargs">Input</param>
        ///
        public static void doCommand(string[] inputargs)
        {
            for (int repeat = 1; repeat < inputargs.Length; repeat++)
            {
                Console.WriteLine("doing {0} {1}", inputargs[0], inputargs[repeat]);
                switch (inputargs[0])
                {
                case "dl":
                    Downloader.DownloadModDirector(inputargs[repeat]);
                    break;

                //deletion
                case "rm":
                    Console.WriteLine($"Deleting {inputargs[repeat]}");
                    Uninstaller.DeleteMod(inputargs[repeat]);
                    break;

                case "disable":
                    Disabler.EnableDisableMod(inputargs[repeat]);
                    break;

                default:
                    Console.WriteLine("Invalid command!");
                    break;
                }
            }

            switch (inputargs[0])
            {
            case "wipe":
                File.Delete(Utilities.ModCache);
                Console.WriteLine("Wiped!");
                break;
            }
        }
Beispiel #2
0
        /// <summary>
        ///     Backend input
        /// </summary>
        /// <param name="inputargs">Input</param>
        ///
        public static void doCommand(string[] inputargs)
        {
            switch (inputargs[0])
            {
            case "wipe":
                File.Delete(Utilities.ModCache);
                Console.WriteLine("Wiped!");
                break;

            case "check":

                var ml = JsonModList.GetModLists();

                for (var i = 0; i < ml.Length; i++)
                {
                    for (var x = 0; x < ml[i].Modlist.Length; x++)
                    {
                        if (ml[i].Modlist[x].ModId == inputargs[1])
                        {
                            var link = ml[i].Modlist[x].Website;
                            var psi  = new ProcessStartInfo
                            {
                                FileName        = link,
                                UseShellExecute = true
                            };
                            Process.Start(psi);
                        }
                    }
                }

                break;

            case "dl":
                Downloader.DownloadModDirector(inputargs[1]);
                break;

            case "toggledebugging":
                ModInstallerCommon.enableDebugging = !ModInstallerCommon.enableDebugging;
                Console.WriteLine("Debugging is now " + ModInstallerCommon.enableDebugging);
                break;

            //deletion
            case "rm":
                Console.WriteLine($"Deleting {inputargs[1]}");
                Uninstaller.DeleteMod(inputargs[1]);
                break;

            default:
                Console.WriteLine("Invalid command!");
                break;
            }
        }
        /// <summary>
        ///     Backend input
        /// </summary>
        /// <param name="inputargs">Input</param>
        public static void doCommand(string[] inputargs)
        {
            switch (inputargs[0])
            {
            case "reload":
                JsonModList.GetModLists(true);
                break;

            case "wipe":
                File.Delete(Directory.GetCurrentDirectory() + @"\installedmods.json");
                Console.WriteLine("Wiped!");
                break;

            case "modlists":
                listmodlists();
                break;

            case "check":

                var ml = JsonModList.GetModLists();

                for (var i = 0; i < ml.Length; i++)
                {
                    for (var x = 0; x < ml[i].Modlist.Length; x++)
                    {
                        if (ml[i].Modlist[x].ModId == inputargs[1])
                        {
                            var link = ml[i].Modlist[x].Website;
                            var psi  = new ProcessStartInfo
                            {
                                FileName        = link,
                                UseShellExecute = true
                            };
                            Process.Start(psi);
                        }
                    }
                }

                break;

            case "dl":
                Downloader.DownloadModDirector(inputargs[1]);
                break;

            case "install":
                Downloader.DownloadModDirector(inputargs[1], true);
                break;

            case "list":
                if (inputargs[1] == "installedmods")
                {
                    var mf = InstalledMods.GetInstalledMods();
                    for (var i = 0; i < mf.Length; i++)
                    {
                        Console.WriteLine(mf[i].Name);
                    }
                }
                else
                {
                    list(inputargs[1]);
                }

                break;

            case "exit":
                return;

            case "help":
                Console.WriteLine("wipe - Wipes the installed registry (DOES NOT DELETE MODS)");
                Console.WriteLine("modlists - Lists all modlists, which are lists of mods.");
                Console.WriteLine("dl [modname] - Downloads mod listed.");
                Console.WriteLine("check [modname] - Opens browser to modpage.");
                Console.WriteLine("list [modlist] - Lists all mods contained in a modlist.");
                Console.WriteLine("list installedmods - Lists all mods registered as installed.");
                Console.WriteLine("exit - Close H3VRModInstaller.");
                break;

            case "toggledebugging":
                ModInstallerCommon.enableDebugging = !ModInstallerCommon.enableDebugging;
                Console.WriteLine("Debugging is now " + ModInstallerCommon.enableDebugging);
                break;

            //deletion
            case "rm":
                Console.WriteLine($"Deleting {inputargs[1]}");
                Uninstaller.DeleteMod(inputargs[1]);
                break;

            default:
                Console.WriteLine("Invalid command!");
                break;
            }
        }