Example #1
0
 public void Init()
 {
     serverPresenter = ServerPresenter.getInstance();
     listener        = new TcpListener(ipEndPoint);
     listener.Start();
     new Thread(async delegate()
     {
         while (index < playerCount)
         {
             clients[index] = await listener.AcceptSocketAsync();
             Connected(index);
             index++;
         }
     }).Start();
 }
Example #2
0
 static void Main(string[] args)
 {
     try
     {
         int port  = int.Parse(args[0]);
         int count = int.Parse(args[1]);
         Console.WriteLine(args[0] + " " + args[1]);
         ServerPresenter.getInstance().Init(port, count);
         GamePresenter.getInstance().Init(count);
         while (!isEnd)
         {
             Thread.Sleep(100);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }