protected override void onSuccess(SnsSyncRequest request, SnsSyncResponse response) { int ret = response.BaseResponse.Ret; if (ret != 0) { Log.e("NetSceneSnsSync", "doScene: snsSync failed!" + ret); this.mSyncStatus = 2; } else { Log.i("NetSceneSnsSync", string.Concat(new object[] { "doScene: snsSync success, continueFlag = ", response.ContinueFlag, " response.CmdList.Count = ", response.CmdList.Count })); List <object> cmdObjectList = NetSceneNewSync.getCmdObjectList(response.CmdList.ListList); this.ProcessCmdItem(request, response, cmdObjectList); } }
private void ProcessCmdItemByGroup(List <object> cmdObjectList) { List <object> list = new List <object>(); List <object> list2 = new List <object>(); List <object> list3 = new List <object>(); List <object> list4 = new List <object>(); Log.i("NetSceneNewInit", "newInit doscene ,ProcessCmdItemByGroup"); foreach (object obj2 in cmdObjectList) { if (obj2.GetType() == typeof(ModContact)) { list.Add(obj2); } else if (obj2.GetType() == typeof(AddMsg)) { list2.Add(obj2); } else if (obj2.GetType() == typeof(ModChatRoomMember)) { list3.Add(obj2); } else { list4.Add(obj2); } } if (list.Count > 0) { NetSceneNewSync.RespHandler(list); } if (list2.Count > 0) { NetSceneNewSync.RespHandler(list2); } if (list3.Count > 0) { NetSceneNewSync.RespHandler(list3); } if (list4.Count > 0) { NetSceneNewSync.RespHandler(list4); } }
private void onCompleted(object sender, PackEventArgs e) { SessionPack pack = sender as SessionPack; byte[] mResponseBuffer = pack.mResponseBuffer; if (e.isSuccess() && (mResponseBuffer != null)) { byte[] response = Util.ReadProtoRawData(mResponseBuffer, 1); uint Ret = Util.ReadProtoInt(response, 1); RetConst ret = (RetConst)Ret; int offset = 0; if (ret == RetConst.MM_OK) { uint continueFlag = Util.ReadProtoInt(mResponseBuffer, 2); List <object> list = new List <object>(); List <object> msgList = new List <object>(); Util.ReadProtoRawDataS(list, mResponseBuffer, 3); foreach (var item in list) { AddMsg msg = AddMsg.ParseFrom((byte[])item); msgList.Add(msg); } NetSceneNewSync.processAddMsgList(msgList); Log.e("NetSceneGetChatRoomMsg", "continueFlag=" + continueFlag + " list Count=" + msgList.Count); if (continueFlag != 0) { Log.e("NetSceneGetChatRoomMsg", "continueFlag=" + continueFlag + " list Count=" + msgList.Count + "buffre=" + Util.byteToHexStr(mResponseBuffer)); } list.Clear(); msgList.Clear(); } } else { Log.e("NetSceneGetChatRoomMsg", "NetSceneGetChatRoomMsg failed. "); } }
protected override void onSuccess(NewInitRequest request, NewInitResponse response) { Log.i("NetSceneNewInit", string.Concat(new object[] { "newInit doscene onSuccess!initresp.selectBitmap:", response.SelectBitmap, " response.ContinueFlag=", response.ContinueFlag, " response.CmdListList.Count =", response.CmdListList.Count })); RetConst ret = (RetConst)response.BaseResponse.Ret; if (ret != RetConst.MM_OK) { Log.e("NetSceneNewInit", "deal With NewSyncResponse: NewInit failed! ret = " + ret); mInitStatus = 0; this.resetFlag(); //EventCenter.postEvent(EventConst.ON_NETSCENE_PROCESS_NEWINIT_ERR, null, null); } else { mCmdList.AddRange(response.CmdListList); this.ProcessCmdItem(request, response); //List<object> cmdObjectList = NetSceneNewSync.getCmdObjectList(mCmdList); this.ProcessCmdItemByGroup(NetSceneNewSync.getCmdObjectList(mCmdList)); mCmdList.Clear(); } }
protected override void onSuccess(GetContactRequest request, GetContactResponse response) { Log.i("NetSceneBatchGetContact", "onSuccess in"); RetConst ret = (RetConst)response.BaseResponse.Ret; if (ret != RetConst.MM_OK) { Log.e("NetSceneBatchGetContact", "send BatchGetContactRequest failed ret =" + ret); EventCenter.postEvent(EventConst.ON_NETSCENE_BATCH_GET_CONTACT_ERR, ret, null); } else { List <object> cmdList = new List <object>(); List <string> list2 = new List <string>(); foreach (ModContact contact in response.ContactListList) { string username = contact.UserName.String; //Log.i("NetSceneBatchGetContact", string.Concat(new object[] { "BatchGetContactRequest update contact, userName = "******" contact.City=", contact.City, " contact.Province = ", contact.Province, " Sex=", contact.Sex, " Signature=", contact.Signature })); if (ContactHelper.isBottleContact(username)) { NetSceneNewSync.processModBottleContact(ModContactToModBottleContact(contact)); } else { cmdList.Add(contact); list2.Add(username); } } if (cmdList.Count > 0) { NetSceneNewSync.processModContactCmdList(cmdList); } //╦бл┬ //EventCenter.postEvent(EventConst.ON_NETSCENE_BATCH_GET_CONTACT_SUCCESS, list2, null); } }
public static void loginStartup() { if (hasValidAccount()) { //CrashLogMgr.onLogin(curAccount.strUsrName); //StorageMgr.onLogin(curAccount.strUsrName); isLogin = true; //hasHeadImg = HeadImageMgr.exists(curAccount.strUsrName, true); SessionPackMgr.getAccount().setAuthInfo(curAccount.strUsrName, curAccount.strPwd, curAccount.strPwd2); if (isSessionkeyValid(curAccount.bytesSessionkey)) { SessionPackMgr.setSessionKey(curAccount.bytesSessionkey); checkSessionKeyTimeout(); } SessionPackMgr.getAccount().setUin((int)curAccount.nUin); mConstAccountInfo = string.Concat(new object[] { "User = "******", UIN =", curAccount.nUin, " ,Nick=", curAccount.strNickName }); //FlowControl.initialize(); NetSceneNewInit.onLoginHandler(); NetSceneNewSync.onLoginHandler(); //Deployment.get_Current().get_Dispatcher().BeginInvoke(() => EventCenter.postEvent(EventConst.ON_ACCOUNT_LOGIN, curAccount.strUsrName, null); Log.d("AccountMgr", "#### loginStartup " + curAccount.strUsrName); } }
public static void init() { ExtentCenter.initialize(); //Profiler.setPoint("ServiceCenterStart"); //CrashLogMgr.SendCrashInfo(); //Profiler.setPoint("CrashReport"); //GConfigMgr.init(); //ConfigMgr.init(); //ContactMgr.init(); //Profiler.setPoint("ConfigMgr"); //ÔÝʱ²»Óà asyncExecInit(); //StorageMgr.init(); AccountMgr.init(); //Profiler.setPoint("AccountMgrInit"); //HeadImageMgr.init(); //FMsgMgr.init(); //MobileContactMgr.init(); //SnsMsgMgr.init(); SnsAsyncMgr.init(); //GetPackageListMgr.checkInit(); //Profiler.setPoint("MgrInit"); //qconversationMgr = new QConversationMgr(); //bconversationMgr = new BConversationMgr(); //conversationMgr = new ConversationMgr(); //bannerManager = new BannerManager(); //occonversationMgr = new OfficialAccountConversationMgr(); //webMMMgr = new WebMMMgr(); //Profiler.setPoint("NewMgr"); NetSceneSyncCheck.initSyncCheck(); sceneAuth = new NetSceneAuth(); sceneNewInit = new NetSceneNewInit(); sceneNewSync = new NetSceneNewSync(); sceneReg = new NetSceneReg(); sceneNewReg = new NetSceneNewReg(); sceneGetUserName = new NetSceneGetUserName(); sceneBindOpMobileForReg = new NetSceneBindOpMobileForReg(); //sceneResetPwd = new NetSceneResetPwd(); sceneSearchContact = new NetSceneSearchContact(); sceneVerifyUser = new NetSceneVerifyUser(); //sceneBatchGetHeadImg = new NetSceneBatchGetHeadImg(); //sceneBindQQ = new NetSceneBindQQ(); //sceneBindMobile = new NetSceneBindOpMobile(); sceneUploadVoice = new UploadVoiceService(); //sceneDownloadVoiceService = new DownloadVoiceService(); //sceneSendInviteEmail = new NetSceneSendInviteEmail(); sceneSendMsg = new NetSceneSendMsg(); sceneSendMsgOld = new NetSceneSendMsgOld(); //sceneCreateChatRoomService = new CreateChatRoomService(); sceneAddChatRoomMemberService = new AddChatRoomMemberService(); //sceneDelChatRoomMemberService = new DelChatRoomMemberService(); //sceneGroupCardService = new GroupCardService(); //sceneSendFeedback = new NetSceneSendFeedback(); //sceneSendVerifyEmail = new NetSceneSendVerifyEmail(); //sceneGetVerifyImage = new NetSceneGetVerifyImage(); //sceneChatTyping = new NetSceneChatTyping(); sceneDownloadVideo = new DownloadVideoService(); sceneUploadVideo = new UploadVideoService(); //scenePushChannelReg = new NetScenePushChannelReg(); //scenePushChannelUnReg = new NetScenePushChannelUnReg(); //pushNotifyMgr = new PushNotifyMgr(); //sceneNetUploadMContact = new NetSceneUploadMContact(); //sceneNetGetMFriend = new NetSceneGetMFriend(); //sceneLogout = new NetSceneLogout(); //sceneGetUpdateInfo = new NetSceneGetUpdateInfo(); //sceneUploadHDHeadImg = new NetSceneUploadHDHeadImg(); //sceneDownloadHDHeadImg = new NetSceneDownloadHDHeadImg(); //sceneGeneralSet = new NetSceneGeneralSet(); //sceneBatchGetContactProfile = new NetSceneBatchGetContactProfile(); sceneBatchGetContact = new NetSceneBatchGetContact(); //sceneExpose = new NetSceneExpose(); //sceneGetPSMImg = new NetSceneGetPSMImg(); //sceneGetQRCode = new NetSceneGetQRCode(); sceneSendCard = new NetSceneSendCard(); //sceneClientPerfReport = new NetSceneClientPerfReport(); sendAppMsg = new NetSceneSendAppMsg(); //Profiler.setPoint("NewScene"); //sessionMgr = new SessionMgr(); //statReportMgr = new StatReportMgr(); //vuserInfoMgr = new VUserInfoMgr(); //mobileContactMgr = new MobileContactMgr(); //perfReportMgr = new ClientPerfReportMgr(); //reportService = new ReportService(); AccountMgr.loginStartupNotify(); //Profiler.setPoint("ServiceCenterEnd"); }