Quellcode durchsuchen

断线重连重新请求茶话会和雅集答题

huangxiaoyue vor 1 Jahr
Ursprung
Commit
ab4cd11140

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -124,6 +124,7 @@ namespace GFGGame
         public const string OPEN_CHAT_MESSAGE = "OPEN_CHAT_MESSAGE"; //打开查看聊天信息
         public const string ACTIVE_SKILL = "ACTIVE_SKILL";//技能激活
         public const string GET_LEAGUE_INFO = "GET_LEAGUE_INFO";//获得联盟信息
+        public const string LEAGUE_ANSWER_INFO = "LEAGUE_ANSWER_INFO";//联盟答题信息请求
 
         public const string CONTINUOUS_REBATE_GIFT = "CONTINUOUS_REBATE_GIFT"; //领取连续返利礼包
         public const string CONTINUOUS_REBATE_GIFT_SHOP_BUY = "CONTINUOUS_REBATE_GIFT_SHOP_BUY";

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -356,6 +356,9 @@ namespace GFGGame
             PoemGallerySProxy.ReqGalleryTheme().Coroutine();
             TaskSProxy.GetTaskInfos();
             ArenaDataManager.Instance.ReqArenaInfo();
+            LeagueSproxy.GetTeapartyInfos().Coroutine();
+            LeagueSproxy.GetTeapartyMatchingInfos(RoleDataManager.roleId).Coroutine();
+            LeagueSproxy.ReqJoinAnswer().Coroutine();
         }
 
         public static void GoBackToMainView()

+ 1 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -745,6 +745,7 @@ namespace GFGGame
                     LeagueDataManager.Instance.LastAnswerRoleData.RightRoleId = response.LastRightRoleId;
                     LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId = response.QuestionId;
                     LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer = response.Ans;
+                    EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_INFO);
                     return true;
                 }
             }

+ 14 - 14
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnsweringView.cs

@@ -64,6 +64,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
             EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
             EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
         }
 
         protected override void RemoveEventListener()
@@ -74,23 +75,14 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
             EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
             EventAgent.RemoveEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
+            EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
             base.RemoveEventListener();
         }
-        
-        protected override async void OnShown()
+
+        protected override void OnShown()
         {
             base.OnShown();
-
-            bool result = await LeagueSproxy.ReqJoinAnswer();
-            if (!isShowing)
-                return;
-            if (result)
-            {
-                UpdateJoinList();
-            }
-            UpdateQuestionState();
-            UpdateChatList();
-            Timers.inst.Add(1, 0, UpdateActiveTime);
+            LeagueSproxy.ReqJoinAnswer().Coroutine();
         }
 
         protected override void OnHide()
@@ -101,7 +93,15 @@ namespace GFGGame
             Timers.inst.Remove(UpdateActiveTime);
             _ui.m_holderHead.visible = false;
         }
-        
+
+        private void ReferInfo()
+        {
+            UpdateJoinList();
+            UpdateQuestionState();
+            UpdateChatList();
+            Timers.inst.Add(1, 0, UpdateActiveTime);
+        }
+
         private void OnBtnBackClick()
         {
             if (LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.Ending)