Esempio n. 1
0
File: Menu.cs Progetto: 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();
            }
        }
Esempio n. 2
0
        public static void updateServer(ref RustServer server)
        {
            // If steamcmd isn't installed, install it.
            if (!isInstalled())
            {
                Console.WriteLine("steamcmd.exe not found, installing...");
                install();
            }

            // run steamcmd.exe and quit when done updating server
            Process.Start(fullPath(), server.steamCMDArgs());
            // While it's still running, display a message, wait for it to finish
            Console.Write("Updating server \"" + server.hostName + "\"");
            while (Process.GetProcessesByName("steamcmd").Length != 0)
            {
                Thread.Sleep(1000);
                Console.Write(".");
            }
            Console.WriteLine("\nServer \"" + server.hostName + "\" has been updated.");
        }
        public static void updateServer(ref RustServer server)
        {
            // If steamcmd isn't installed, install it.
            if (!isInstalled())
            {
                Console.WriteLine("steamcmd.exe not found, installing...");
                install();
            }

            // run steamcmd.exe and quit when done updating server
            Process.Start(fullPath(),server.steamCMDArgs());
            // While it's still running, display a message, wait for it to finish
            Console.Write("Updating server \"" + server.hostName + "\"");
            while (Process.GetProcessesByName("steamcmd").Length != 0)
            {
                Thread.Sleep(1000);
                Console.Write(".");
            }
            Console.WriteLine("\nServer \"" + server.hostName + "\" has been updated.");
        }
Esempio n. 4
0
File: Menu.cs Progetto: 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();
            }
        }