guodong 3 vuotta sitten
vanhempi
commit
c8ff5d108c

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -127,6 +127,7 @@ namespace GFGGame
             {
             {
                 GameController.QuitToLoginView(true);
                 GameController.QuitToLoginView(true);
             }
             }
+            EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL);
         }
         }
 
 
         public static void Logout()
         public static void Logout()

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Platform/PlatformTapManager.cs

@@ -35,12 +35,14 @@ namespace GFGGame
             {
             {
                 return false;
                 return false;
             }
             }
+            ViewManager.Show<ModalStatusView>("登录中...");
             TDSUser tdsUser = await TDSUser.GetCurrent();
             TDSUser tdsUser = await TDSUser.GetCurrent();
             if (null != tdsUser)
             if (null != tdsUser)
             {
             {
                 InitAntiAddiction(tdsUser.ObjectId);
                 InitAntiAddiction(tdsUser.ObjectId);
                 return true;
                 return true;
             }
             }
+            ViewManager.Hide<ModalStatusView>();
             return false;
             return false;
         }
         }
 
 
@@ -51,6 +53,7 @@ namespace GFGGame
             {
             {
                 return false;
                 return false;
             }
             }
+            ViewManager.Show<ModalStatusView>("登录中...");
             try
             try
             {
             {
                 var tdsUser = await TDSUser.LoginWithTapTap();
                 var tdsUser = await TDSUser.LoginWithTapTap();
@@ -78,6 +81,7 @@ namespace GFGGame
                     PromptController.Instance.ShowFloatTextPrompt("登录异常");
                     PromptController.Instance.ShowFloatTextPrompt("登录异常");
                 }
                 }
             }
             }
+            ViewManager.Hide<ModalStatusView>();
             return false;
             return false;
         }
         }
 
 

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -66,6 +66,7 @@ namespace GFGGame
              UpdateServer(recentlyServerInfo);
              UpdateServer(recentlyServerInfo);
             _ui.m_btnStart.visible = false;
             _ui.m_btnStart.visible = false;
             _ui.m_btnTapLogin.visible = false;
             _ui.m_btnTapLogin.visible = false;
+            _ui.m_btnLogout.visible = false;
             InitLoginStatus(serverInfosComponent).Coroutine();
             InitLoginStatus(serverInfosComponent).Coroutine();
             EventAgent.AddEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
             EventAgent.AddEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
             EventAgent.AddEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
             EventAgent.AddEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
@@ -114,8 +115,6 @@ namespace GFGGame
 
 
         private void UpdateServer(ServerInfo info)
         private void UpdateServer(ServerInfo info)
         {
         {
-            //登录成功后更新注销按钮显示
-            _ui.m_btnLogout.visible = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>().IsLogin();
             ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             if (serverInfosComponent.ServerInfoList.Count == 0)
             if (serverInfosComponent.ServerInfoList.Count == 0)
             {
             {
@@ -130,6 +129,7 @@ namespace GFGGame
 
 
         private void OnLoginSuccess(EventContext context)
         private void OnLoginSuccess(EventContext context)
         {
         {
+            _ui.m_btnLogout.visible = true;
             _ui.m_btnStart.visible = true;
             _ui.m_btnStart.visible = true;
         }
         }
 
 
@@ -145,7 +145,7 @@ namespace GFGGame
         }
         }
         private void OnClickBtnNotice()
         private void OnClickBtnNotice()
         {
         {
-            if (NoticeDataManager.Instance.LastNoticeInfo.noticeId == 0)
+            if (NoticeDataManager.Instance.LastNoticeInfo == null || NoticeDataManager.Instance.LastNoticeInfo.noticeId == 0)
             {
             {
                 PromptController.Instance.ShowFloatTextPrompt("暂无公告发布");
                 PromptController.Instance.ShowFloatTextPrompt("暂无公告发布");
                 return;
                 return;