Exemple #1
0
        void Connected(IAsyncResult iar)
        {
            ServerPort sp     = iar.AsyncState as ServerPort;
            TcpClient  client = sp.listener.EndAcceptTcpClient(iar);

            FantasyFighterPlayer player;

            FantasyServer.fighters.AddLast(player = new FantasyFighterPlayer(form.AddEvent, client));
            FantasyServer.lobby_fighters.AddLast(player);
            form.AddEvent("New player connected...");

            listener.BeginAcceptTcpClient(Connected, this);
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     server = new ServerPort(this);
     server.Start();
 }