private bool OnPlayerLoginRsp(PlayerLoginRsp rsp) { if (rsp.get_retcode() == null) { MonoTestUI sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoTestUI; if (sceneCanvas.avatar3dModelContext != null) { return(false); } sceneCanvas.MainCamera.SetActive(true); sceneCanvas.MainMenu_SpaceShip.SetActive(true); sceneCanvas.avatar3dModelContext = new Avatar3dModelContext(null); Singleton <MainUIManager> .Instance.ShowWidget(sceneCanvas.avatar3dModelContext, UIType.Root); GameObject view = GameObject.Find("MainMenu_SpaceShip"); GameObject uiMainCamera = GameObject.Find("MainCamera"); SpaceShipModelContext widget = new SpaceShipModelContext(view, uiMainCamera); Singleton <MainUIManager> .Instance.ShowWidget(widget, UIType.Any); GraphicsSettingData.ApplySettingConfig(); AudioSettingData.ApplySettingConfig(); this.TestCode(sceneCanvas); } else { GeneralDialogContext dialogContext = new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]), desc = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]), notDestroyAfterTouchBG = true }; Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any); } return(false); }
private bool OnPlayerLoginRsp(PlayerLoginRsp rsp) { if (rsp.get_retcode() == null) { foreach (KeyValuePair <int, List <ChatMsgDataItem> > pair in Singleton <MiHoYoGameData> .Instance.LocalData.FriendChatMsgMap) { if (!this._friendChatMsgMap.ContainsKey(pair.Key)) { this._friendChatMsgMap.Add(pair.Key, new List <ChatMsgDataItem>()); } this._friendChatMsgMap[pair.Key].AddRange(pair.Value); } } foreach (int num in this._friendChatMsgMap.Keys) { if (!this.friendHistoryMsgIndexDic.ContainsKey(num)) { this.friendHistoryMsgIndexDic.Add(num, this._friendChatMsgMap[num].Count); } } return(false); }
private bool OnPlayerLoginRsp(PlayerLoginRsp rsp) { if (rsp.get_retcode() == null) { uint serverProcessedPacketId = !rsp.get_last_client_packet_idSpecified() ? 0 : rsp.get_last_client_packet_id(); Singleton <NetworkManager> .Instance.SendPacketsOnLoginSuccess(false, serverProcessedPacketId); Singleton <NetworkManager> .Instance.alreadyLogin = true; } else if (rsp.get_retcode() == 4) { Singleton <NetworkManager> .Instance.ProcessWaitStopAnotherLogin(); } else { Singleton <NetworkManager> .Instance.DisConnect(); if ((MiscData.Config.BasicConfig.IsBlockUserWhenRepeatLogin && (rsp.get_retcode() == 2)) && Singleton <NetworkManager> .Instance.alreadyLogin) { Singleton <NetworkManager> .Instance.SetRepeatLogin(); } } return(false); }