Beispiel #1
0
        public string CreateRoom(string roomName, string userName)
        {
            var roomId = Guid.NewGuid().ToString();
            var room   = new ChatRoom {
                RoomId = roomId, RoomName = roomName
            };
            var newMember = new ChatMember(this.Context.Peer)
            {
                MemberNo = 1, Name = userName
            };

            if (!currentRooms.CreateRoom(roomId, room, newMember.Peer.ConnectionId, newMember))
            {
                throw new ChatHubException("room not found");
            }

            return(roomId);
        }