private List <xUserInfo> InsertUserInfo(uint parser, byte cmdId = 1) { List <xUserInfo> userInfoList = new List <xUserInfo>(); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, cmdId, i)) { break; } uint parserUerInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, cmdId, parserUerInfo, i); xUserInfo userInfo = new xUserInfo(); userInfo.nickName = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 1, 0)); userInfo.userId = YunVaImInterface.parser_get_integer(parserUerInfo, 2, 0); userInfo.iconUrl = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 3, 0)); userInfo.onLine = YunVaImInterface.parser_get_integer(parserUerInfo, 4, 0); userInfo.userLevel = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 5, 0)); userInfo.vipLevel = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 6, 0)); userInfo.ext = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 7, 0)); userInfo.shieldmsg = YunVaImInterface.parser_get_integer(parserUerInfo, 8, 0); userInfo.sex = YunVaImInterface.parser_get_integer(parserUerInfo, 9, 0); userInfo.group = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 10, 0)); userInfo.remark = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parserUerInfo, 11, 0)); YunvaLogPrint.YvInfoLog("ImFriendBlackListNotify", string.Format("nickName:{0},userId:{1},iconUrl:{2},onLine:{3},userLevel:{4},vipLevel:{5},ext:{6},shieldmsg:{7},sex:{8},group:{9},remark:{10}", userInfo.nickName, userInfo.userId, userInfo.iconUrl, userInfo.onLine, userInfo.userLevel, userInfo.vipLevel, userInfo.ext, userInfo.shieldmsg, userInfo.sex, userInfo.group, userInfo.remark)); userInfoList.Add(userInfo); } return(userInfoList); }
public ImCloudmsgLimitNotify(object Parser) { uint parser = (uint)Parser; pacektList = new List <P2PChatMsg>(); source = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 1, 0)); p2pId = YunVaImInterface.parser_get_uint32(parser, 2, 0); count = YunVaImInterface.parser_get_uint32(parser, 3, 0); indexId = YunVaImInterface.parser_get_uint32(parser, 4, 0); ptime = YunVaImInterface.parser_get_uint32(parser, 5, 0); YunvaLogPrint.YvDebugLog("ImCloudmsgLimitNotify", string.Format("source:{0},p2pId:{1},count:{2},indexId:{3},ptime:{4}", source, p2pId, count, indexId, ptime)); if (source == "P2P") { uint p2pParser = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 6, p2pParser, 0); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, 6, i)) { break; } uint parserInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 6, parserInfo, i); pacektList.Add(chatMessageNotify(parserInfo)); } // packet = chatMessageNotify(p2pParser); // packet.cloudMsgID = YunVaImInterface.parser_get_integer(parser, 110, 0); // packet.cloudResource = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 111, 0)); YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_CLOUDMSG_LIMIT_NOTIFY, this)); } }
public ImSearchAroundResp(object Parser) { uint parser = (uint)Parser; aroundUserList = new List <xAroundUser>(); result = YunVaImInterface.parser_get_integer(parser, 1, 0); msg = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 2, 0)); YunvaLogPrint.YvDebugLog("ImSearchAroundResp", string.Format("result:{0},msg:{1}", result, msg)); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, 3, i)) { break; } uint locationInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 3, locationInfo, i); xAroundUser info = new xAroundUser(); info.yunvaId = YunVaImInterface.parser_get_integer(locationInfo, 1, 0); info.nickName = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 2, 0)); info.sex = YunVaImInterface.parser_get_integer(locationInfo, 3, 0); info.city = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 4, 0)); info.headicon = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 5, 0)); info.distance = YunVaImInterface.parser_get_integer(locationInfo, 6, 0); info.lately = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 7, 0)); info.longitude = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 8, 0)); info.latitude = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 9, 0)); info.ext = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 10, 0)); YunvaLogPrint.YvDebugLog("ImSearchAroundResp", string.Format("yunvaId:{0},nickName:{1},sex:{2},city:{3},headicon:{4},distance:{5},lately:{6},longitude:{7},latitude:{8},ext:{9}", info.yunvaId, info.nickName, info.sex, info.city, info.headicon, info.distance, info.lately, info.longitude, info.latitude, info.ext)); aroundUserList.Add(info); } YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_SEARCH_AROUND_RESP, this)); }
private ImFriendSearchResp SearchFriendInfo(uint parser) { ImFriendSearchResp friendSearchResp = new ImFriendSearchResp(); List <xSearchInfo> searchInfoList = new List <xSearchInfo>(); friendSearchResp.result = YunVaImInterface.parser_get_integer(parser, 1, 0); friendSearchResp.msg = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 2, 0)); YunvaLogPrint.YvDebugLog("ImFriendSearchResp", string.Format("result:{0},msg:{1}", friendSearchResp.result, friendSearchResp.msg)); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, 3, i)) { break; } uint searchInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 3, searchInfo, i); xSearchInfo userInfo = new xSearchInfo(); userInfo.yunvaId = YunVaImInterface.parser_get_integer(searchInfo, 1, 0); userInfo.userId = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 2, 0)); userInfo.nickName = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 3, 0)); userInfo.iconUrl = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 4, 0)); userInfo.level = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 5, 0)); userInfo.vip = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 6, 0)); userInfo.ext = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(searchInfo, 7, 0)); YunvaLogPrint.YvDebugLog("ImFriendSearchResp", string.Format("yunvaId:{0},userId:{1},nickName:{2},iconUrl:{3},level:{4},vip:{5},ext:{6}", userInfo.yunvaId, userInfo.userId, userInfo.nickName, userInfo.iconUrl, userInfo.level, userInfo.vip, userInfo.ext)); searchInfoList.Add(userInfo); } friendSearchResp.searchUserInfo = searchInfoList; return(friendSearchResp); }
public ImChannelGetInfoResp(object Parser) { uint parser = (uint)Parser; for (int i = 0;; i++) { if (YunVaImInterface.parser_is_empty(parser, 1, i)) { break; } uint GetInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 1, GetInfo, i); Game_channel.Add(YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(GetInfo, 1, 0))); YunvaLogPrint.YvDebugLog("ImChannelGetInfoResp", string.Format("Game_channel:{0}", Game_channel[i])); } YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_CHANNEL_GETINFO_RESP, this)); }
public ImChannelHistoryMsgResp(object Parser) { uint parser = (uint)Parser; channelHisList = new List <HistoryMsgInfo>(); int index = 0; while (!YunVaImInterface.parser_is_empty(parser, 1, index)) { uint hisParser = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 1, hisParser, index); HistoryMsgInfo hisChannel = GetChannelMessageNotify(hisParser); channelHisList.Add(hisChannel); index++; } YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_CHANNEL_HISTORY_MSG_RESP, this)); }
private List <RecentConact> GetRecentConactList(object Parser, byte cmdId = 1) { uint parser = (uint)Parser; List <RecentConact> recentList = new List <RecentConact>(); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, cmdId, i)) { break; } uint parserUerInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 1, parserUerInfo, i); RecentConact context = new RecentConact(); context.endId = YunVaImInterface.parser_get_integer(parserUerInfo, 1, 0); context.unread = YunVaImInterface.parser_get_integer(parserUerInfo, 2, 0); YunvaLogPrint.YvInfoLog("ImFriendNearListNotify", string.Format("endId:{0},unread:{1}", context.endId, context.unread)); uint chatParser = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parserUerInfo, 3, chatParser, 0); context.lastMsg = chatMessageNotify(chatParser); uint nearChatParser = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parserUerInfo, 4, nearChatParser, 0); NearChatInfo nearChatInfo = new NearChatInfo(); nearChatInfo.nickName = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 1, 0)); nearChatInfo.userId = YunVaImInterface.parser_get_integer(nearChatParser, 2, 0); nearChatInfo.iconUrl = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 3, 0)); nearChatInfo.online = YunVaImInterface.parser_get_integer(nearChatParser, 4, 0); nearChatInfo.userLevel = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 5, 0)); nearChatInfo.vipLevel = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 6, 0)); nearChatInfo.ext = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 7, 0)); nearChatInfo.shieldMsg = YunVaImInterface.parser_get_integer(nearChatParser, 8, 0); nearChatInfo.sex = YunVaImInterface.parser_get_integer(nearChatParser, 9, 0); nearChatInfo.group = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 10, 0)); nearChatInfo.remark = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 11, 0)); nearChatInfo.times = YunVaImInterface.parser_get_integer(nearChatParser, 12, 0); YunvaLogPrint.YvInfoLog("ImFriendNearListNotify", string.Format("nickName:{0},userId:{1},iconUrl:{2},onLine:{3},userLevel:{4},vipLevel:{5},ext:{6},shieldmsg:{7},sex:{8},group:{9},remark:{10},times:{11}", nearChatInfo.nickName, nearChatInfo.userId, nearChatInfo.iconUrl, nearChatInfo.online, nearChatInfo.userLevel, nearChatInfo.vipLevel, nearChatInfo.ext, nearChatInfo.shieldMsg, nearChatInfo.sex, nearChatInfo.group, nearChatInfo.remark, nearChatInfo.times)); context.userInfo = nearChatInfo; recentList.Add(context); } return(recentList); }
public ImCloudMsgNotify(object Parser) { uint parser = (uint)Parser; if (YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 1, 0)) == "P2P") { source = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 1, 0)); id = YunVaImInterface.parser_get_integer(parser, 2, 0); beginid = YunVaImInterface.parser_get_integer(parser, 3, 0); endid = YunVaImInterface.parser_get_integer(parser, 4, 0); time = YunVaImInterface.parser_get_integer(parser, 5, 0); uint p2pParser = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 6, p2pParser, 0); packet.Add(chatMessageNotify(p2pParser)); unread = YunVaImInterface.parser_get_integer(parser, 7, 0); cloudId = YunVaImInterface.parser_get_integer(parser, 110, 0); cloudResource = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 111, 0)); YunvaLogPrint.YvInfoLog("ImCloudMsgNotify", string.Format("source:{0},id:{1},beginid:{2},endid:{3},time:{4},unread:{5},cloudId:{6},cloudResource:{7}", source, id, beginid, endid, time, unread, cloudId, cloudResource)); YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_CLOUDMSG_NOTIFY, this)); } }
public ImLBSGetSpportLangResp(object Parser) { uint parser = (uint)Parser; LanguageList = new List <xLanguage>(); result = YunVaImInterface.parser_get_integer(parser, 1, 0); msg = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(parser, 2, 0)); YunvaLogPrint.YvDebugLog("ImLBSGetSpportLangResp", string.Format("result:{0},msg:{1}", result, msg)); for (int i = 0; ; i++) { if (YunVaImInterface.parser_is_empty(parser, 3, i)) { break; } uint locationInfo = YunVaImInterface.yvpacket_get_nested_parser(parser); YunVaImInterface.parser_get_object(parser, 3, locationInfo, i); xLanguage Language = new xLanguage(); Language.lang_code = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 1, 0)); Language.lang_name = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(locationInfo, 2, 0)); LanguageList.Add(Language); YunvaLogPrint.YvDebugLog("ImLBSGetSpportLangResp", string.Format("lang_code:{0},lang_name:{1}", Language.lang_code, Language.lang_name)); } YunVaImInterface.eventQueue.Enqueue(new InvokeEventClass(ProtocolEnum.IM_LBS_GET_SUPPORT_LANG_RESP, this)); }