Exemplo n.º 1
0
 void OnGetMembersHandler(int id, RtmChannelMember[] members, int userCount, GET_MEMBERS_ERR errorCode)
 {
     if (errorCode == GET_MEMBERS_ERR.GET_MEMBERS_ERR_OK)
     {
         messageDisplay.AddTextToDisplay("Total members = " + userCount, Message.MessageType.Info);
     }
     else
     {
         messageDisplay.AddTextToDisplay("something is wrong with GetMembers:" + errorCode.ToString(), Message.MessageType.Error);
     }
 }
Exemplo n.º 2
0
 private static void OnGetMemberCallback(int id, string membersStr, int userCount, GET_MEMBERS_ERR errorCode)
 {
     if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnGetMembers != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnGetMembers != null)
                 {
                     int j           = 1;
                     string[] sArray = membersStr.Split('\t');
                     RtmChannelMember [] membersList = new RtmChannelMember[userCount];
                     for (int i = 0; i < userCount; i++)
                     {
                         RtmChannelMember member = new RtmChannelMember(sArray[j++], sArray[j++]);
                         membersList[i]          = member;
                     }
                     channelEventHandlerDic[id].OnGetMembers(id, membersList, userCount, errorCode);
                 }
             });
         }
     }
 }