コード例 #1
0
        /// <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);
        }
コード例 #2
0
        protected void OnLeaveRoom(object sender, EventArgs args)
        {
            CRoom room = (CRoom)sender;

            this.rooms.Remove(room.id);
        }