Пример #1
0
        public void removeFromRoom(int memberID, int roomid)
        {
            // just remove member from signalr hub and update flag InRoom to false
            try
            {
                Clients.Group(roomid.ToString()).removeMember(memberID, roomid);
                Groups.Remove(Context.ConnectionId, roomid.ToString());

                RoomMember roomMember = new RoomMember();
                if (roomMember.LoadByPrimaryKey(memberID, roomid))
                {

                    roomMember.InRoom = false;
                    roomMember.HasCam = false;
                    roomMember.HasMic = false;
                    roomMember.SetColumnNull(RoomMember.ColumnNames.QueueOrder);
                    roomMember.Save();

                    RoomMember onlineroomMember = new RoomMember();
                    onlineroomMember.GetAllOnlineMembersByRoomID(roomid);
                    Clients.All.updateExistingCount(roomid, onlineroomMember.RowCount);

                    if (roomMember.RoomMemberLevelID > (int)Helper.Enums.RoomMemberLevel.Visitor)
                        Groups.Remove(Context.ConnectionId, GetRoomAdminGroupName(roomid));
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        public void banMemberFromRoom(int memberid, int roomid, int banType, string adminName)
        {
            try
            {
                RoomMember member = new RoomMember();
                member.LoadByPrimaryKey(memberid, roomid);
                member.InRoom = false;
                member.HasCam = false;
                member.HasMic = false;
                member.SetColumnNull(BLL.RoomMember.ColumnNames.QueueOrder);
                member.Save();

                string banTypeName = Helper.StringEnum.GetStringValue(Helper.EnumUtil.ParseEnum<Helper.Enums.BanningType>(banType));
                Clients.Group(roomid.ToString()).banMemberFromRoom(memberid, roomid, banTypeName, adminName);
            }
            catch (Exception ex)
            {
            }
        }
Пример #3
0
        public int GetQueueOrder(int memberID, int roomID)
        {
            int value = 0;
            RoomMember member = new RoomMember();
            member.LoadByPrimaryKey(memberID, roomID);
            RoomMember order = new RoomMember();
            order.GetMaxQueueOrderByRoomID(roomID);
            if (member.IsColumnNull("QueueOrder"))
            {
                member.QueueOrder = Convert.ToInt32(order.GetColumn("MaxQueueOrder")) + 1;
                value = member.QueueOrder;
            }
            else
                member.SetColumnNull("QueueOrder");

            member.Save();

            return value;
        }