예제 #1
0
 public ServerWorker(string input)
 {
     while (true)
     {
         try
         {
             if (input == "exit")
             {
                 Environment.Exit(0);
             }
             else if (input == "ban")
             {
                 string name = Console.ReadLine();
                 Server.Ban(name);
                 Server.SendMessage(name + " ban");
             }
             else if (input == "stop")
             {
                 Server.Stop();
             }
             else
             {
                 Server.SendMessage(input);
             }
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.Message);
         }
     }
 }