Esempio n. 1
0
        public static void listeninput()
        {
            while (true)
            {
                string line = Console.ReadLine(); // Get string from user
                if (line == "exit")               // Check string
                {
                    break;
                }

                Console.WriteLine(">" + line);
                console.SendMessage(line);
            }

            Console.WriteLine("Shutting down, killing server...");
            gameprocess.Kill();
        }
Esempio n. 2
0
        public static void listeninput(Process gameprocess)
        {
            while (true)
            {
                string line = Console.ReadLine();     // Get string from user
                if (line == "exit" || line == "stop") // Check string
                {
                    Console.WriteLine("Shutting down, killing server...");
                    Console.WriteLine("stop");
                    Thread.Sleep(1000);
                    gameprocess.Kill();
                    gameprocess.WaitForExit();
                    Environment.Exit(0);
                }

                Console.WriteLine(">" + line);
                console.SendMessage(line);
            }
        }