/// <summary> /// Moves client to a room /// </summary> /// <param name="Client">Client object to be moved in a room</param> public Room moveClient(Client client) { if (rooms[rooms.Count - 1].roomSize <= 10) { rooms[rooms.Count - 1].addClient(client); } else { addRoom(); rooms[rooms.Count - 1].addClient(client); } return rooms[rooms.Count - 1]; }
/// <summary> /// Handles incoming clients /// </summary> public void ConnHandler() { //Start listening for connections this.TCPLife.Start(); //Infinite loop while (true) { ///Keeps listening until a client connects TcpClient client = this.TCPLife.AcceptTcpClient(); Client c = new Client(client,rm); clients.Add(c); Thread newclient = new Thread(new ParameterizedThreadStart(Add)); newclient.Start(c); } }
public void removeClient(Client client) { clients.Remove(client); }
public void addClient(Client client) { clients.Add(client); }