Obsolete methods

Last post 07-27-2012, 7:29 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  09-15-2008, 2:39 AM 43922

    Obsolete methods

    Good morining!
     
    I found that many methods in chat API are obsolete. For example:
     
    ChatApi.CreateLobby
    ChatApi.GetLobbyInfoArray()
    etc.

    When I tried to use them, I got warning message: "Obsolete. This method is not compatible with NLB mode." Which methods I have to use instead? Is NLB = Network Load Balancing?
  •  09-17-2008, 6:37 PM 44031 in reply to 43922

    Re: Obsolete methods

    Please use the following method:
     
    ArrayList lobbies=new ArrayList();
        foreach(LobbyInfo lobby in ChatApi.GetLobbyInfoArray())
        {
         if(lobby.Lobby.Integration==""||lobby.Lobby.Integration==null)
          lobbies.Add(lobby);
        }
     
    >>Is NLB = Network Load Balancing?
     
    Yes.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-26-2012, 11:23 AM 74277 in reply to 44031

    Re: Obsolete methods

    Hello,
     
    I am having the same issue in several locations, this code does not look like it will replace the code for the createLobby or updateLobby codes.
     

    private

     

     

    void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)

    {

     

    string userid=(string)DataGrid1.DataKeys[e.Item.ItemIndex];

     

    StringBuilder sb=new StringBuilder();

     

    foreach(string eachuserid in Lobby.ManagerList.Split(','))

    {

     

    if(eachuserid.Length==0)continue;

     

    if(string.Compare(userid,eachuserid,true)!=0)

    {

     

    if(sb.Length!=0)sb.Append(",");

    sb.Append(eachuserid);

    }

    }

    Lobby.ManagerList=sb.ToString();

     

    ChatApi.UpdateLobby(Lobby);

    BindDataGrid();

    }

  •  07-27-2012, 7:29 AM 74286 in reply to 74277

    Re: Obsolete methods

    Hi rtbike,
     
    Please try the example code below to update the chat room
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    4.   
    5. <script runat="server">  
    6.     protected void btnUpdate_Click(object sender, EventArgs e)  
    7.     {  
    8.         foreach (CuteChat.LobbyInfo lobby in CuteChat.ChatApi.GetLobbyInfoArray())  
    9.         {  
    10.             if (lobby.Lobby.Integration == "" || lobby.Lobby.Integration == null)  
    11.             {  
    12.                 if (lobby.Lobby.Title == "MyRoomName")  
    13.                 {  
    14.                     CuteChat.IChatLobby lobby2 = CuteChat.ChatApi.GetLobby(lobby.LobbyId);  
    15.                     lobby2.Title = "New Chat room";  
    16.                     CuteChat.ChatApi.UpdateLobby(lobby2);  
    17.                 }  
    18.   
    19.   
    20.             }  
    21.         }  
    22.     }  
    23. </script>  
    24.   
    25. <html xmlns="http://www.w3.org/1999/xhtml">  
    26. <head runat="server">  
    27.     <title>Untitled Page</title>  
    28. </head>  
    29. <body>  
    30.     <form id="form1" runat="server">  
    31.         <div>  
    32.             <asp:Button ID="btnUpdate" runat="server" Text="Update Chat room" OnClick="btnUpdate_Click" />  
    33.         </div>  
    34.     </form>  
    35. </body>  
    36. </html>  
    Regards,
     
    Ken 
View as RSS news feed in XML