void OnSetChannelAttributesResultHandler2(int id, Int64 requestId, ATTRIBUTE_OPERATION_ERR errorCode) { Debug.Log("OnSetChannelAttributesResultHandler error: " + errorCode); int m = rtmClient.GetChannelAttributesByKeys("444", new string[] { "2323", "234" }, 2333); Debug.Log("GetChannelAttributesByKeys m = " + m); }
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); } }); } } }
private static void OnGetUserAttributesResultCallback(int id, Int64 requestId, string userId, string attributes, int numberOfAttributes, ATTRIBUTE_OPERATION_ERR errorCode) { if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetUserAttributesResult != null) { if (AgoraCallbackObject.GetInstance()._CallbackQueue != null) { AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => { if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnGetUserAttributesResult != null) { int j = 1; string[] sArray = attributes.Split('\t'); RtmAttribute [] attribute = new RtmAttribute[numberOfAttributes]; for (int i = 0; i < numberOfAttributes; i++) { attribute[i].key = sArray[j++]; attribute[i].value = sArray[j++]; } clientEventHandlerHandlerDic[id].OnGetUserAttributesResult(id, requestId, userId, attribute, numberOfAttributes, errorCode); } }); } } }
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); } }); } } }
void OnGetChannelAttributesResultHandler2(int id, Int64 requestId, RtmChannelAttribute[] attributes, int numberOfAttributes, ATTRIBUTE_OPERATION_ERR errorCode) { for (int i = 0; i < numberOfAttributes; i++) { Debug.Log("OnGetChannelAttributesResultHandler " + attributes[i].GetValue()); } }