示例#1
0
 public static void Main(string[] args)
 {
     var menu = new Menu();
     menu.mainMenu();
     Console.Write("End of program. Press any key.");
     Console.ReadKey(true);
 }
示例#2
0
文件: Menu.cs 项目: balu92/RSM
        public void setup()
        {
            var server = new RustServer();
            //request initial server information for buildArgs
            Console.WriteLine("Lets setup your server startup variables");
            Console.WriteLine("----------------\n");
            //Set initial values
            Console.Write("Hostname (" + server.hostName + ") : ");
            server.hostName = Convert.ToString(Console.ReadLine());

            Console.Write("Identity aka save folder (" + server.identity + ") : ");
            server.identity = Convert.ToString(Console.ReadLine());

            Console.Write("Seed (" + server.m_seed + ") : ");
            server.m_seed = Convert.ToString(Console.ReadLine());

            Console.Write("World Size (" + server.m_worldSize + ") : ");
            server.m_worldSize = Convert.ToInt32(Console.ReadLine());

            Console.Write("Port number (" + server.m_portNumber + ") : ");
            server.m_portNumber = Convert.ToString(Console.ReadLine());

            Console.Write("Max players (" + server.m_maxPlayers + ") : ");
            server.m_maxPlayers = Convert.ToInt32(Console.ReadLine());

            Console.Write("Did you want to setup RCON (no)? ");
            var rcon = Convert.ToString(Console.ReadLine());
            if (rcon.ToLower() == "yes")
            {
                Console.Write("Rcon Port (" + server.m_rconPort + ") : ");
                server.m_rconPort = Convert.ToString(Console.ReadLine());
                Console.Write("Rcon Password (" + server.m_rconPassword + ") : ");
                server.m_rconPassword = Convert.ToString(Console.ReadLine());
            }
            Console.Write("Let's review your server start settings:\n");
            Console.Write(server.summarize());
            Console.Write("\n Are these settings correct? (yes)");
            var confirm = Convert.ToString(Console.ReadLine());
            if (confirm.ToLower() == "no")
            {
                setup();
            }
            else
            {
                Console.Write("Did you want to start the server? (yes)");
                var startsvr = Convert.ToString(Console.ReadLine());
                if (startsvr.ToLower() == "no")
                {
                    var menu = new Menu();
                    //return to main menu
                    menu.mainMenu();
                    //saving settings to a flat file for reading latter would be a good idea here.
                }
                //start server
                Start();
            }
        }