Example #1
0
 public BaseConnection Init(TcpClient client, BaseRoom room)
 {
     this.cerrado = false;
     this.room    = room;
     this.client  = client;
     this.stream  = this.client.GetStream();
     Task.Run(() => Process());
     room.Add(this);
     return(this);
 }
Example #2
0
        static void Main(string[] args)
        {
            BaseMessage.Init();
            BaseRoom lobby      = BaseRoom.New().Init();
            var      sockServer = new TcpListener(System.Net.IPAddress.Parse("0.0.0.0"), 16384);

            sockServer.Start();
            while (true)
            {
                Thread.Sleep(100);
                Server.BaseConnection.New().Init(sockServer.AcceptTcpClient(), lobby);
                lobby.Update();
            }
        }