Пример #1
0
 private static void OnGetChannelMemberCountResultCallback(int id, Int64 requestId, string channelMemberCounts, int channelCount, GET_CHANNEL_MEMBER_COUNT_ERR_CODE errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetChannelMemberCountResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetChannelMemberCountResult != null)
                 {
                     int j           = 1;
                     string[] sArray = channelMemberCounts.Split('\t');
                     ChannelMemberCount [] channelAttributes = new ChannelMemberCount[channelCount];
                     for (int i = 0; i < channelCount; i++)
                     {
                         ChannelMemberCount channelMemeber = new ChannelMemberCount();
                         channelMemeber.channelId          = sArray[j++];
                         channelMemeber.count = int.Parse(sArray[j++]);
                         channelAttributes[i] = channelMemeber;
                     }
                     clientEventHandlerHandlerDic[id].OnGetChannelMemberCountResult(id, requestId, channelAttributes, channelCount, errorCode);
                 }
             });
         }
     }
 }
Пример #2
0
 private static void OnQueryPeersOnlineStatusResultCallback(int id, Int64 requestId, string peersStatus, int peerCount, QUERY_PEERS_ONLINE_STATUS_ERR errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnQueryPeersOnlineStatusResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnQueryPeersOnlineStatusResult != null)
                 {
                     int j           = 1;
                     string[] sArray = peersStatus.Split('\t');
                     PeerOnlineStatus [] channelAttributes = new PeerOnlineStatus[peerCount];
                     for (int i = 0; i < peerCount; i++)
                     {
                         PeerOnlineStatus peerOnlineStatus = new PeerOnlineStatus();
                         peerOnlineStatus.peerId           = sArray[j++];
                         peerOnlineStatus.isOnline         = bool.Parse(sArray[j++]);
                         peerOnlineStatus.onlineState      = (PEER_ONLINE_STATE)int.Parse(sArray[j++]);
                         channelAttributes[i] = peerOnlineStatus;
                     }
                     clientEventHandlerHandlerDic[id].OnQueryPeersOnlineStatusResult(id, requestId, channelAttributes, peerCount, errorCode);
                 }
             });
         }
     }
 }
Пример #3
0
 private static void OnGetChannelAttributesResultCallback(int id, Int64 requestId, string attributes, int numberOfAttributes, ATTRIBUTE_OPERATION_ERR errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetChannelAttributesResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetChannelAttributesResult != null)
                 {
                     int j           = 1;
                     string[] sArray = attributes.Split('\t');
                     RtmChannelAttribute [] channelAttributes = new RtmChannelAttribute[numberOfAttributes];
                     for (int i = 0; i < numberOfAttributes; i++)
                     {
                         RtmChannelAttribute _attribute = new RtmChannelAttribute(MESSAGE_FLAG.RECEIVE);
                         _attribute.SetKey(sArray[j++]);
                         _attribute.SetValue(sArray[j++]);
                         _attribute.SetLastUpdateTs(Int64.Parse(sArray[j++]));
                         _attribute.SetLastUpdateUserId(sArray[j++]);
                         channelAttributes[i] = _attribute;
                     }
                     clientEventHandlerHandlerDic[id].OnGetChannelAttributesResult(id, requestId, channelAttributes, numberOfAttributes, errorCode);
                 }
             });
         }
     }
 }
Пример #4
0
 private static void OnPeersOnlineStatusChangedCallback(int id, string peersStatusStr, int peerCount)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnPeersOnlineStatusChanged != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnPeersOnlineStatusChanged != null)
                 {
                     int j           = 1;
                     string[] sArray = peersStatusStr.Split('\t');
                     PeerOnlineStatus [] channelAttributes = new PeerOnlineStatus[peerCount];
                     for (int i = 0; i < peerCount; i++)
                     {
                         PeerOnlineStatus peerOnlineStatus = new PeerOnlineStatus();
                         peerOnlineStatus.peerId           = sArray[j++];
                         peerOnlineStatus.isOnline         = bool.Parse(sArray[j++]);
                         peerOnlineStatus.onlineState      = (PEER_ONLINE_STATE)int.Parse(sArray[j++]);
                         channelAttributes[i] = peerOnlineStatus;
                     }
                     clientEventHandlerHandlerDic[id].OnPeersOnlineStatusChanged(id, channelAttributes, peerCount);
                 }
             });
         }
     }
 }
Пример #5
0
 private static void OnAttributesUpdatedCallback(int id, string attributesListPtr, int numberOfAttributes)
 {
     if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnAttributesUpdated != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnAttributesUpdated != null)
                 {
                     int j           = 1;
                     string[] sArray = attributesListPtr.Split('\t');
                     RtmChannelAttribute [] channelAttributes = new RtmChannelAttribute[numberOfAttributes];
                     for (int i = 0; i < numberOfAttributes; i++)
                     {
                         RtmChannelAttribute _attribute = new RtmChannelAttribute(MESSAGE_FLAG.RECEIVE);
                         _attribute.SetKey(sArray[j++]);
                         _attribute.SetValue(sArray[j++]);
                         _attribute.SetLastUpdateTs(Int64.Parse(sArray[j++]));
                         _attribute.SetLastUpdateUserId(sArray[j++]);
                         channelAttributes[i] = _attribute;
                     }
                     channelEventHandlerDic[id].OnAttributesUpdated(id, channelAttributes, numberOfAttributes);
                 }
             });
         }
     }
 }
Пример #6
0
 public static AgoraCallbackObject GetInstance()
 {
     if (_AgoraCallbackObject == null)
     {
         _AgoraCallbackObject = new AgoraCallbackObject(_GameObjectName);
     }
     return(_AgoraCallbackObject);
 }
Пример #7
0
 private static void OnJoinFailureCallback(int id, JOIN_CHANNEL_ERR errorCode)
 {
     if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnJoinFailure != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnJoinFailure != null)
                 {
                     channelEventHandlerDic[id].OnJoinFailure(id, errorCode);
                 }
             });
         }
     }
 }
Пример #8
0
 private static void OnMediaCancelResultCallback(int id, Int64 requestId, CANCEL_MEDIA_ERR_CODE code)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaCancelResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaCancelResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnMediaCancelResult(id, requestId, code);
                 }
             });
         }
     }
 }
Пример #9
0
 private static void OnSendMessageResultCallback(int id, Int64 messageId, PEER_MESSAGE_ERR_CODE errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnSendMessageResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnSendMessageResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnSendMessageResult(id, messageId, errorCode);
                 }
             });
         }
     }
 }
Пример #10
0
 private static void OnConnectionStateChangedCallback(int id, CONNECTION_STATE state, CONNECTION_CHANGE_REASON reason)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnConnectionStateChanged != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnConnectionStateChanged != null)
                 {
                     clientEventHandlerHandlerDic[id].OnConnectionStateChanged(id, state, reason);
                 }
             });
         }
     }
 }
Пример #11
0
 private static void OnLogoutCallback(int id, LOGOUT_ERR_CODE errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnLogout != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnLogout != null)
                 {
                     clientEventHandlerHandlerDic[id].OnLogout(id, errorCode);
                 }
             });
         }
     }
 }
Пример #12
0
 private static void OnTokenExpiredCallback(int id)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnTokenExpired != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnTokenExpired != null)
                 {
                     clientEventHandlerHandlerDic[id].OnTokenExpired(id);
                 }
             });
         }
     }
 }
Пример #13
0
 private static void OnRenewTokenResultCallback(int id, string token, RENEW_TOKEN_ERR_CODE errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnRenewTokenResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnRenewTokenResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnRenewTokenResult(id, token, errorCode);
                 }
             });
         }
     }
 }
Пример #14
0
 private static void OnMemberCountUpdatedCallback(int id, int memberCount)
 {
     if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnMemberCountUpdated != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnMemberCountUpdated != null)
                 {
                     channelEventHandlerDic[id].OnMemberCountUpdated(id, memberCount);
                 }
             });
         }
     }
 }
Пример #15
0
 private static void OnJoinSuccessCallback(int id)
 {
     if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnJoinSuccess != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (channelEventHandlerDic.ContainsKey(id) && channelEventHandlerDic[id].OnJoinSuccess != null)
                 {
                     channelEventHandlerDic[id].OnJoinSuccess(id);
                 }
             });
         }
     }
 }
Пример #16
0
 private static void OnClearChannelAttributesResultCallback(int id, Int64 requestId, ATTRIBUTE_OPERATION_ERR errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnClearChannelAttributesResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnClearChannelAttributesResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnClearChannelAttributesResult(id, requestId, errorCode);
                 }
             });
         }
     }
 }
Пример #17
0
 private static void OnSubscriptionRequestResultCallback(int id, Int64 requestId, PEER_SUBSCRIPTION_STATUS_ERR errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnSubscriptionRequestResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnSubscriptionRequestResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnSubscriptionRequestResult(id, requestId, errorCode);
                 }
             });
         }
     }
 }
Пример #18
0
 private static void OnQueryPeersBySubscriptionOptionResultCallback(int id, Int64 requestId, string[] peerIds, int peerCount, QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR errorCode)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnQueryPeersBySubscriptionOptionResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnQueryPeersBySubscriptionOptionResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnQueryPeersBySubscriptionOptionResult(id, requestId, peerIds, peerCount, errorCode);
                 }
             });
         }
     }
 }
 private static void OnLocalInvitationReceivedByPeerCallback(IntPtr localInvitationPtr)
 {
     if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationReceivedByPeer != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationReceivedByPeer != null)
                 {
                     LocalInvitation _localInvitation = new LocalInvitation(localInvitationPtr);
                     rtmCallEventHandlerDic[id].OnLocalInvitationReceivedByPeer(_localInvitation);
                 }
             });
         }
     }
 }
 private static void OnRemoteInvitationCanceledCallback(IntPtr localInvitationPtr)
 {
     if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnRemoteInvitationCanceled != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnRemoteInvitationCanceled != null)
                 {
                     RemoteInvitation _localInvitation = new RemoteInvitation(localInvitationPtr);
                     rtmCallEventHandlerDic[id].OnRemoteInvitationCanceled(_localInvitation);
                 }
             });
         }
     }
 }
 private static void OnRemoteInvitationFailureCallback(IntPtr localInvitationPtr, REMOTE_INVITATION_ERR_CODE errorCode)
 {
     if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnRemoteInvitationFailure != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnRemoteInvitationFailure != null)
                 {
                     RemoteInvitation _localInvitation = new RemoteInvitation(localInvitationPtr);
                     rtmCallEventHandlerDic[id].OnRemoteInvitationFailure(_localInvitation, errorCode);
                 }
             });
         }
     }
 }
 private static void OnLocalInvitationRefusedCallback(IntPtr localInvitationPtr, string response)
 {
     if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationRefused != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationRefused != null)
                 {
                     LocalInvitation _localInvitation = new LocalInvitation(localInvitationPtr);
                     rtmCallEventHandlerDic[id].OnLocalInvitationRefused(_localInvitation, response);
                 }
             });
         }
     }
 }
 private static void OnLocalInvitationFailureCallback(IntPtr localInvitationPtr, LOCAL_INVITATION_ERR_CODE errorCode)
 {
     if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationCanceled != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(id) && rtmCallEventHandlerDic[id].OnLocalInvitationCanceled != null)
                 {
                     LocalInvitation _localInvitation = new LocalInvitation(localInvitationPtr);
                     rtmCallEventHandlerDic[id].OnLocalInvitationCanceled(_localInvitation);
                 }
             });
         }
     }
 }
 private static void OnLocalInvitationCanceledCallback(int _id, IntPtr localInvitationPtr)
 {
     if (rtmCallEventHandlerDic.ContainsKey(_id) && rtmCallEventHandlerDic[_id].OnLocalInvitationCanceled != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (rtmCallEventHandlerDic.ContainsKey(_id) && rtmCallEventHandlerDic[_id].OnLocalInvitationCanceled != null)
                 {
                     LocalInvitation _localInvitation = new LocalInvitation(localInvitationPtr, false);
                     rtmCallEventHandlerDic[_id].OnLocalInvitationCanceled(_localInvitation);
                 }
             });
         }
     }
 }
Пример #25
0
 private static void OnFileMediaUploadResultCallback(int id, Int64 requestId, IntPtr fileMessagePtr, UPLOAD_MEDIA_ERR_CODE code)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMediaUploadResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             FileMessage fileMessage = new FileMessage(fileMessagePtr, FileMessage.MESSAGE_FLAG.SEND);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMediaUploadResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnFileMediaUploadResult(id, requestId, fileMessage, code);
                 }
             });
         }
     }
 }
Пример #26
0
        /// <summary>
        /// create an Rtm Client instance
        /// The Agora RTM SDK supports creating multiple RtmClient instances.
        /// All methods in the RtmClient class are executed asynchronously.
        /// </summary>
        /// <param name="appId">
        /// The App ID issued to you from the Agora Console. Apply for a new App ID from Agora if it is missing from your kit.
        /// </param>
        /// <param name="eventHandler">
        /// An RtmClientListener object that reports to the app on RTM SDK runtime events.
        /// </param>
        public RtmClient(string appId, RtmClientEventHandler eventHandler)
        {
            if (appId == null || eventHandler == null)
            {
                Debug.LogError("appId or eventHandler is null");
                return;
            }
            AgoraCallbackObject.GetInstance();
            _rtmServicePtr = createRtmService_();
            _eventHandler  = eventHandler;
            int ret = initialize(_rtmServicePtr, appId, eventHandler.GetRtmClientEventHandlerPtr());

            if (ret != 0)
            {
                Debug.LogError("RtmClient create fail, error:  " + ret);
            }
        }
Пример #27
0
 private static void OnMediaDownloadToMemoryResultCallback(int id, Int64 requestId, IntPtr memory, Int64 length, DOWNLOAD_MEDIA_ERR_CODE code)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaDownloadToMemoryResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             byte[] memoryData = new byte[length];
             Marshal.Copy(memory, memoryData, 0, (int)length);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaDownloadToMemoryResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnMediaDownloadToMemoryResult(id, requestId, memoryData, length, code);
                 }
             });
         }
     }
 }
Пример #28
0
 private static void OnImageMediaUploadResultCallback(int id, Int64 requestId, IntPtr imageMessagePtr, UPLOAD_MEDIA_ERR_CODE code)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnImageMediaUploadResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             Debug.Log("OnImageUploadResutl  result = " + code);
             ImageMessage imageMessage = new ImageMessage(imageMessagePtr, ImageMessage.MESSAGE_FLAG.SEND);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnImageMediaUploadResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnImageMediaUploadResult(id, requestId, imageMessage, code);
                 }
             });
         }
     }
 }
Пример #29
0
 private static void OnFileMessageReceivedFromPeerCallback(int id, string peerId, IntPtr message)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             FileMessage fileMessage  = new FileMessage(message, FileMessage.MESSAGE_FLAG.SEND);
             FileMessage _fileMessage = new FileMessage(fileMessage, FileMessage.MESSAGE_FLAG.RECEIVE);
             fileMessage.SetMessagePtr(IntPtr.Zero);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer != null)
                 {
                     clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer(id, peerId, _fileMessage);
                 }
             });
         }
     }
 }
Пример #30
0
 private static void OnMediaDownloadingProgressCallback(int id, Int64 requestId, Int64 totalSize, Int64 currentSize)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaDownloadingProgress != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 MediaOperationProgress mediaOperationProgress = new MediaOperationProgress();
                 mediaOperationProgress.totalSize   = totalSize;
                 mediaOperationProgress.currentSize = currentSize;
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnMediaDownloadingProgress != null)
                 {
                     clientEventHandlerHandlerDic[id].OnMediaDownloadingProgress(id, requestId, mediaOperationProgress);
                 }
             });
         }
     }
 }