Exemple #1
0
        public Game(NetworkPlayer player1, NetworkPlayer player2, MatchmakingServer server)
        {
            this.server = server;
            gameThread  = new Thread(new ThreadStart(Play));

            this.player1 = player1;
            this.player2 = player2;
        }
Exemple #2
0
        static void Main(string[] args)
        {
            MatchmakingServer matchmakingServer = new MatchmakingServer();

            matchmakingServer.SetOutputStream(Console.OpenStandardOutput());
            Console.SetOut(matchmakingServer.GetWriter());
            matchmakingServer.Bind(IPAddress.Any, 25000);
            matchmakingServer.SetBacklog(4);
            matchmakingServer.Initialize();
            matchmakingServer.Start();
            while (Console.ReadKey(true).KeyChar != 'q')
            {
            }
            Console.WriteLine("Stoping Server");
        }