コード例 #1
0
 static void Main()
 {
     Console.WriteLine("CardGameServer started on port " + Settings.Port);
     server = new Server();
     server.ClientConnected += endPoint =>
         Console.WriteLine("Client connected: " + endPoint);
     server.ClientDisconnected += endPoint =>
         Console.WriteLine("Client disconnected: " + endPoint);
     server.ClientMessageReceived += MessageReceived;
     Console.WriteLine("Press any key to exit ...");
     Console.ReadKey();
 }
コード例 #2
0
 static void Main()
 {
     Console.WriteLine("PongServer started on port " + Settings.Port);
     server = new Server();
     server.ClientConnected += endPoint =>
     {
         if (server.clients.Count == 2)
             StartGame();
     };
     server.ClientMessageReceived += PaddlePositionMessageReceived;
     Console.WriteLine("Press any key to exit ...");
     Console.ReadKey();
 }
コード例 #3
0
 private static void Main()
 {
     Console.WriteLine("PongServer started on port " + Settings.Port);
     database = new Database();
     server = new Server();
     server.ClientConnected += endPoint =>
     {
         lock (database)
             database.LoginPlayer(endPoint.ToString());
         if (server.clients.Count == 2)
             StartGame();
     };
     server.ClientMessageReceived += PaddlePositionMessageReceived;
     Console.WriteLine("Press any key to exit ...");
     Console.ReadKey();
 }