Exemple #1
0
        private static void OpenMenuIfnocmdArguments()
        {
            bool choice = CheckifClientOrServer();

            if (choice)
            {
                BothWays.ClientNohook();
            }
            else
            {
                Console.WriteLine(@"Please provide the oc server install path subdirectory");
                string input = Console.ReadLine();
                input = Checkforrootpath(input);
                Server(input);
            }
        }
Exemple #2
0
        private static void SelectArgOptions(string[] args)
        {
            if (args.Length == 0)
            {
                OpenMenuIfnocmdArguments();
            }
            else if (args[0].ToLower().Contains(@"-help"))
            {
                Console.WriteLine(@"Usage!");
                Console.WriteLine(@"-server ""<serverdirectory\obsidian>""");
                Console.WriteLine(@"-server ""<serverdirectory\obsidian>"" <username> <password>");
                Console.WriteLine(@"-server ""<serverdirectory\obsidian>"" <username> <password> -steamauth");
                Console.WriteLine(
                    @"-server ""<serverdirectory\obsidian>"" <username> <password> ""hl2,ep1,lostcoast,ep2,hl1,css,dod""");
                Console.WriteLine(@"-server ""<serverdirectory\obsidian>"" <username> <password> ""0,0,0,0,0,0,0,0""");
                Console.WriteLine(
                    @"-server ""<serverdirectory\obsidian>"" <username> <password> -steamauth ""hl2,ep1,lostcoast,ep2,hl1,css,dod""");
                Console.WriteLine(
                    @"-server ""<serverdirectory\obsidian>"" <username> <password> -steamauth ""0,0,0,0,0,0,0,0""");
                Console.WriteLine(@"-client");
                Console.WriteLine(@"-client -y");
                Console.WriteLine(@"-client -n ""hl2,ep1,lostcoast,ep2,hl1,css,dod""");
            }
            else if (args[0].ToLower().Contains(@"-client"))
            {
                if ((args.Length == 2) && (args[1] == "-y"))
                {
                    BothWays.ClientNohook("-y");
                }
                else if (args.Length == 3)
                {
                    BothWays.ClientNohook("-n", args[2]);
                }
                else
                {
                    BothWays.ClientNohook();
                }
            }
            else if (args[0].ToLower().Contains(@"-server"))
            {
                string fun = null;
                if (args.Length > 1)
                {
                    fun = args[1];
                    fun = Checkforrootpath(fun);
                }
                else
                {
                    MessageBox.Show(@"Please create the server directory then rerun the mountfix");
                    Environment.Exit(1);
                }
                switch (args.Length)
                {
                case 2:
                    fun = fun.Trim('"');
                    fun = NativeMethods.Otherstuff.GetShortPathName(fun);
                    Server(fun);
                    break;

                case 4:
                {
                    fun = fun.Trim('"');
                    fun = NativeMethods.Otherstuff.GetShortPathName(fun);
                    Server(fun, args[2], args[3]);
                }
                break;

                case 5:
                {
                    fun = fun.Trim('"');
                    fun = NativeMethods.Otherstuff.GetShortPathName(fun);
                    if (args[4].Contains(@"-steamauth"))
                    {
                        Server(fun, args[2], args[3], true);
                    }
                    else
                    {
                        Server(fun, args[2], args[3], false, args[4]);
                    }
                }
                break;

                case 6:
                {
                    fun = fun.Trim('"');
                    fun = NativeMethods.Otherstuff.GetShortPathName(fun);
                    Server(fun, args[2], args[3], true, args[5]);
                }
                break;
                }
            }
        }