Getting total of users in chatroom

Last post 07-19-2011, 8:54 PM by Jeff. 2 replies.
Sort Posts: Previous Next
  •  07-18-2011, 1:48 PM 68593

    Getting total of users in chatroom

    Greetings,
     
    Currently I'm trying to make a Stored Procedure that will get a list of chatrooms that a user has permissions to.  I have that much thus far, but I also need to get the number of users within each chatroom.  I'm not using the API due that what I need to do would take about 3-4 calls and thought it might be easier to just compress it into one straight shot.  My question is, what table and fields determines a user is online in a chatroom?  I'm guessing it's possibly the Users table, but not sure.  Anyways, I'm just trying to figure out how to detect those numbers.  Any help would be appreciated.  Thanks.
     
    ~Chad Johnson
  •  07-19-2011, 7:49 AM 68610 in reply to 68593

    Re: Getting total of users in chatroom

    Hi Greetings,
     
    Please try the code below, it shows you how to get all online users of the  chat room.
     
      protected override void OnLoad(EventArgs e)
            {
                CuteChat.ChatPortal portal = CuteChat.ChatSystem.Instance.GetCurrentPortal();
                lock (portal)
                {
                    //Lobby_2 is the querystring find at the end of the chat room url
                    foreach (CuteChat.ChatPlaceUser user in portal.GetPlace("Lobby-2").GetAllUsers())
                    {
                        //label1.Text += user.DisplayName;
                    }

                }
                base.OnLoad(e);
            }
     
    Regards,
     
    ken
  •  07-19-2011, 8:54 PM 68622 in reply to 68593

    Re: Getting total of users in chatroom

    Hi Chad Johnson,
     
    The database does not save the online user information.
    I think you can create a new table, use Kenneth's method to save online users into the table,
    then you can get this data in Stored Procedure.
     
    Regards,
    Jeff 
View as RSS news feed in XML