Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                help();
                Environment.Exit(0);
            }

            if (!File.Exists(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory) + Path.DirectorySeparatorChar + "libWiiSharp.dll"))
            {
                Console.WriteLine("ERROR: libWiiSharp.dll not found");
                Console.WriteLine("This should not appear on the .Net Core port.");
                Console.WriteLine("If you see this, report how you got here on https://github.com/TheShadowEevee/Sharpii-NetCore/issues.");
                Console.WriteLine("Error: SHARPII_NET_CORE_MAIN_MISSING_DLL_LIBWIISHARP_01");
                Environment.Exit(0x00003E8F);
            }

            for (int i = 1; i < args.Length; i++)
            {
                switch (args[i].ToUpper())
                {
                case "-QUIET":
                    BeQuiet.quiet = 1;
                    break;

                case "-Q":
                    BeQuiet.quiet = 1;
                    break;

                case "-LOTS":
                    BeQuiet.quiet = 3;
                    break;

                case "-NOLOG":
                    Logging.log = 0;
                    break;
                }
            }

            string Function     = args[0].ToUpper();
            bool   gotSomewhere = false;

            if (Function == "-H" || Function == "-HELP" || Function == "H" || Function == "HELP")
            {
                help();
                gotSomewhere = true;
            }

            if (Function == "BNS")
            {
                BNS_Stuff.BNS(args);
                gotSomewhere = true;
            }

            if (Function == "WAD")
            {
                WAD_Stuff.WAD(args);
                gotSomewhere = true;
            }

            if (Function == "TPL")
            {
                TPL_Stuff.TPL(args);
                gotSomewhere = true;
            }

            if (Function == "U8")
            {
                U8_Stuff.U8(args);
                gotSomewhere = true;
            }

            if (Function == "IOS")
            {
                IOS_Stuff.IOS(args);
                gotSomewhere = true;
            }

            if (Function == "NUS" || Function == "NUSD")
            {
                NUS_Stuff.NUS(args);
                gotSomewhere = true;
            }

            if (Function == "SENDDOL" || Function == "SENDOL")
            {
                HBC_Stuff.SendDol(args);
                gotSomewhere = true;
            }

            if (Function == "SENDWAD")
            {
                bool cont = HBC_Stuff.SendWad_Check(args);
                if (cont == true)
                {
                    HBC_Stuff.SendWad(args);
                }
                gotSomewhere = true;
            }

            if (Function == "INSTALL")
            {
                Install();
                gotSomewhere = true;
            }

            if (Function == "UNINSTALL")
            {
                Uninstall();
                gotSomewhere = true;
            }

            if (Function == "ERRORS")
            {
                ERROR_Stuff.ERROR(args);
                gotSomewhere = true;
            }

            if (Function == "EXITCODES")
            {
                ERRORCODE_Stuff.ERRORCODE(args);
                gotSomewhere = true;
            }

            if (Function == "WHICH CAME FIRST" || Function == "WHICH CAME FIRST?" ||
                (Function == "WHICH" && args[1].ToUpper() == "CAME" && args[2].Substring(0, 5).ToUpper() == "FIRST"))
            {
                InconspicuousNotEasterEggThingamajig();
                gotSomewhere = true;
            }



            if (gotSomewhere == false)
            {
                //If tuser gets here, they entered something wrong
                Console.WriteLine("ERROR: The argument {0} is invalid", args[0]);
                Console.WriteLine("Error: SHARPII_NET_CORE_MAIN_INVALID_ARG_01");
                Environment.Exit(0x00003E90);
            }

            string temp = Path.GetTempPath() + "Sharpii.tmp";

            if (Directory.Exists(temp) == true)
            {
                DeleteADir.DeleteDirectory(temp);
            }

            Environment.Exit(0);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Help();
                Environment.Exit(0);
            }

            for (int i = 1; i < args.Length; i++)
            {
                switch (args[i].ToUpper())
                {
                case "-QUIET":
                    BeQuiet.quiet = 1;
                    break;

                case "-Q":
                    BeQuiet.quiet = 1;
                    break;

                case "-LOTS":
                    BeQuiet.quiet = 3;
                    break;
                }
            }

            string Function     = args[0].ToUpper();
            bool   gotSomewhere = false;

            if (Function == "-H" || Function == "-HELP" || Function == "H" || Function == "HELP")
            {
                Help();
                gotSomewhere = true;
            }

            if (Function == "BNS")
            {
                BNS_Stuff.BNS(args);
                gotSomewhere = true;
            }

            if (Function == "WAD")
            {
                WAD_Stuff.WAD(args);
                gotSomewhere = true;
            }

            if (Function == "TPL")
            {
                TPL_Stuff.TPL(args);
                gotSomewhere = true;
            }

            if (Function == "U8")
            {
                U8_Stuff.U8(args);
                gotSomewhere = true;
            }

            if (Function == "IOS")
            {
                IOS_Stuff.IOS(args);
                gotSomewhere = true;
            }

            if (Function == "NUS" || Function == "NUSD")
            {
                NUS_Stuff.NUS(args, false);
                gotSomewhere = true;
            }

            if (Function == "SENDDOL" || Function == "SENDOL")
            {
                HBC_Stuff.SendDol(args);
                gotSomewhere = true;
            }

            if (Function == "SENDWAD")
            {
                bool cont = HBC_Stuff.SendWad_Check(args);
                if (cont == true)
                {
                    HBC_Stuff.SendWad(args);
                }
                gotSomewhere = true;
            }

            if (Function == "ERRORS")
            {
                ERROR_Stuff.ERROR(args);
                gotSomewhere = true;
            }

            if (Function == "EXITCODES")
            {
                ERRORCODE_Stuff.ERRORCODE(args);
                gotSomewhere = true;
            }

            if (gotSomewhere == false)
            {
                //If the user gets here, they entered something wrong
                Console.WriteLine("ERROR: The argument {0} is invalid", args[0]);
                Console.WriteLine("Error: SHARPII_NET_CORE_MAIN_INVALID_ARG");
                if (OperatingSystem.Windows())
                {
                    Environment.Exit(0x00003E90);
                }
                else
                {
                    Environment.Exit(0x00000012);
                }
                return;
            }

            string temp = Path.GetTempPath() + "Sharpii.tmp";

            if (Directory.Exists(temp) == true)
            {
                DeleteADir.DeleteDirectory(temp);
            }

            Environment.Exit(0);
        }