Esempio n. 1
0
        private static void SelectEnv()
        {
            string[] envs = { "127.0.0.1", "51.91.156.75" };

            Console.WriteLine("Welcom on NS_MMO server, choose an environment : ");
            for (int i = 0; i < envs.Length; i++)
            {
                Console.WriteLine("{0}. {1}", i, envs[i]);
            }

            // wait user select an environment
            int choice;

            do
            {
                string input = Console.ReadLine();
                if (int.TryParse(input, out choice))
                {
                    break;
                }
                if (choice != 0 || choice != 1)
                {
                    Console.WriteLine("You can only type 0 or 1.");
                }
            } while (choice != 0 || choice != 1);

            // set environment
            ServerProperties.setAddress(envs[choice]);
        }