/// <summary> /// Request <see cref="Client"/> to join in a <see cref="Room"/>. /// </summary> /// <param name="roomName">The name of the Room to join.</param> /// <param name="options">Custom join request options</param> public CRoom Join(string roomName, Dictionary <string, object> options = null) { if (options == null) { options = new Dictionary <string, object> (); } int requestId = ++this.joinRequestId; options.Add("requestId", requestId); var room = new CRoom(roomName); this.connectingRooms.Add(requestId, room); this.connection.Send(new object[] { Protocol.JOIN_ROOM, roomName, options }); return(room); }
protected void OnLeaveRoom(object sender, EventArgs args) { CRoom room = (CRoom)sender; this.rooms.Remove(room.id); }