private void JoinRoomAckEvent(string reqData, Hashtable roomList) { //Send(s, validUid + ":" + roomName + ":JoinRoomReq", 1000); roomData = reqData.Split(':'); try { /*roomClassList: key = room number, value = room class *roomList: key = host id, value = room number */ room = (RoomHandler)roomClassList[roomData[1]]; //only if there is no guest in a room, a player can join if (!room.isFull) { room.guestStartRoom(tcpClient); room.guestName = roomData[0]; Console.WriteLine(room.guestName); //indicates the room is already full room.isFull = true; //look for host id, and send it to a client foreach (DictionaryEntry entry in roomList) { if (entry.Value.ToString() == roomData[1]) { string result = entry.Key.ToString(); room.SendToClient(result + ":" + roomData[0] + ":JoinRoomAck"); room.isReady = false; } } } else { //if a room is full, a player cannot join a room Send("FullRoomNoti"); } } catch (Exception ex) { throw ex; } }