瀏覽代碼

雅集改成3个时间段开启。

hexiaojie 2 年之前
父節點
當前提交
98b5f91a28

+ 1 - 1
GameClient/Assets/Game/HotUpdate/GameConfig.cs

@@ -21,7 +21,7 @@ namespace GFGGame
             var result = JsonMapper.ToObject<Result>(json);
             var result = JsonMapper.ToObject<Result>(json);
             LoginAddress = result.loginApiUrl;
             LoginAddress = result.loginApiUrl;
             // LoginAddress = "http://login.gfg.com:10005";
             // LoginAddress = "http://login.gfg.com:10005";
-            //LoginAddress = "127.0.0.1:10005";//测试地址
+            LoginAddress = "127.0.0.1:10005";//测试地址
             PlatformName = result.platformName;
             PlatformName = result.platformName;
             showGM = int.Parse(result.showGM);
             showGM = int.Parse(result.showGM);
             if(!string.IsNullOrEmpty(result.openTime))
             if(!string.IsNullOrEmpty(result.openTime))

+ 23 - 9
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerView.cs

@@ -1,6 +1,7 @@
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
 using ET;
 using ET;
 using FairyGUI;
 using FairyGUI;
+using Hutool;
 using UI.League;
 using UI.League;
 using UnityEngine;
 using UnityEngine;
 
 
@@ -18,6 +19,7 @@ namespace GFGGame
                 _ui.Dispose();
                 _ui.Dispose();
                 _ui = null;
                 _ui = null;
             }
             }
+
             base.Dispose();
             base.Dispose();
         }
         }
 
 
@@ -36,10 +38,12 @@ namespace GFGGame
             _ui.m_btnRank.onClick.Add(OnBtnRankClick);
             _ui.m_btnRank.onClick.Add(OnBtnRankClick);
             _ui.m_btnAnswer.onClick.Add(OnBtnAnswerClick);
             _ui.m_btnAnswer.onClick.Add(OnBtnAnswerClick);
         }
         }
+
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
             base.AddEventListener();
             base.AddEventListener();
         }
         }
+
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
@@ -56,12 +60,13 @@ namespace GFGGame
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
-
         }
         }
+
         private void OnBtnRankClick()
         private void OnBtnRankClick()
         {
         {
             ViewManager.Show<LeagueAnswerRankView>();
             ViewManager.Show<LeagueAnswerRankView>();
         }
         }
+
         private void OnBtnAnswerClick()
         private void OnBtnAnswerClick()
         {
         {
             Hide();
             Hide();
@@ -70,18 +75,21 @@ namespace GFGGame
 
 
         private void UpdateView()
         private void UpdateView()
         {
         {
-
-            OtherRoleInfoData lastNO1 = LeagueDataManager.Instance.GetMemberRoleInfo(LeagueDataManager.Instance.LeagueData.LastWeekAnswerNO1Id);
+            OtherRoleInfoData lastNO1 =
+                LeagueDataManager.Instance.GetMemberRoleInfo(LeagueDataManager.Instance.LeagueData.LastWeekAnswerNO1Id);
             _ui.m_comHead.target.visible = false;
             _ui.m_comHead.target.visible = false;
             if (lastNO1 != null)
             if (lastNO1 != null)
             {
             {
-                ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(lastNO1.headId == 0 ? ConstItemID.HEADID : lastNO1.headId);
+                ItemCfg headCfg =
+                    ItemCfgArray.Instance.GetCfg(lastNO1.headId == 0 ? ConstItemID.HEADID : lastNO1.headId);
                 _ui.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
                 _ui.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
                 _ui.m_comHead.target.visible = true;
                 _ui.m_comHead.target.visible = true;
             }
             }
+
             _ui.m_txtName.text = lastNO1 == null ? "虚位以待" : lastNO1.roleName;
             _ui.m_txtName.text = lastNO1 == null ? "虚位以待" : lastNO1.roleName;
             _ui.m_txtRule.text = TextDescCfgArray.Instance.GetCfg(300008).text;
             _ui.m_txtRule.text = TextDescCfgArray.Instance.GetCfg(300008).text;
-            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
+                LeagueQuestionStatus.End)
             {
             {
                 _ui.m_btnAnswer.visible = false;
                 _ui.m_btnAnswer.visible = false;
                 _ui.m_txtTime.visible = true;
                 _ui.m_txtTime.visible = true;
@@ -93,18 +101,24 @@ namespace GFGGame
                 _ui.m_txtTime.visible = false;
                 _ui.m_txtTime.visible = false;
             }
             }
         }
         }
+
         private void UpdateTime(object param)
         private void UpdateTime(object param)
         {
         {
+            int curIndex = DateUtil.GetNearestStartTimeIndex(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr);
             long curTime = TimeHelper.ServerNow();
             long curTime = TimeHelper.ServerNow();
-            long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[0]);//暂时
-            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) > LeagueQuestionStatus.End
-            || endTime - curTime < 0)
+            var questionStartTimeStr = GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[curIndex];
+            long endTime =TimeHelper.ServerNow() > TimeUtil.GetCurDayTime(questionStartTimeStr)
+                ? TimeUtil.GetNextTime(questionStartTimeStr)
+                : TimeUtil.GetCurDayTime(questionStartTimeStr);
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) >
+                LeagueQuestionStatus.End
+                || endTime - curTime < 0)
             {
             {
                 Timers.inst.Remove(UpdateTime);
                 Timers.inst.Remove(UpdateTime);
                 return;
                 return;
             }
             }
-            _ui.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
 
 
+            _ui.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
         }
         }
     }
     }
 }
 }

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

@@ -1,6 +1,7 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using ET;
 using ET;
 using FairyGUI;
 using FairyGUI;
+using Hutool;
 using UI.League;
 using UI.League;
 using UnityEngine;
 using UnityEngine;
 
 
@@ -135,15 +136,17 @@ namespace GFGGame
             long curTime = TimeHelper.ServerNow();
             long curTime = TimeHelper.ServerNow();
             long endTime = 0;
             long endTime = 0;
             string str = "";
             string str = "";
+            //leagueQuestionStartTimeArr与leagueQuestionCloseTimeArr与leagueQuestionEndTimeArr数组长度相同,且索引对应。跟曾威定的
+            int curIndex = DateUtil.GetNearestStartTimeIndex(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr);
             if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End
             if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End
             || LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.AnswerEnd)
             || LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.AnswerEnd)
             {
             {
-                endTime = TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr[0]);//暂时
+                endTime = TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr[curIndex]);
                 str = "房间剩余时间 ";
                 str = "房间剩余时间 ";
             }
             }
             else
             else
             {
             {
-                endTime = TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.leagueQuestionEndTimeArr[0]);//暂时
+                endTime = TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.leagueQuestionEndTimeArr[curIndex]);
                 str = "活动剩余时间 ";
                 str = "活动剩余时间 ";
             }
             }
             if (endTime - curTime < 0 && LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
             if (endTime - curTime < 0 && LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
@@ -290,7 +293,14 @@ namespace GFGGame
             LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId); ;
             LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId); ;
             UI_Button123 item = UI_Button123.Proxy(obj);
             UI_Button123 item = UI_Button123.Proxy(obj);
             int data = index + 1;
             int data = index + 1;
+
             item.target.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
             item.target.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
+            //测试 正确答案
+           // if (data == int.Parse(cfg.answerCorrect))
+           // {
+            //    item.target.title = string.Format("{0}.{1} 正确", data, cfg.answerArr[index]);
+            //}
+            
             string myAnswer = _dataManager.LastAnswerRoleData.MyAnswer;
             string myAnswer = _dataManager.LastAnswerRoleData.MyAnswer;
             bool isAnswer = !string.IsNullOrEmpty(_dataManager.LastAnswerRoleData.MyAnswer) && _dataManager.LastAnswerRoleData.LastQuestionId == _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
             bool isAnswer = !string.IsNullOrEmpty(_dataManager.LastAnswerRoleData.MyAnswer) && _dataManager.LastAnswerRoleData.LastQuestionId == _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
             item.target.touchable = !isAnswer;
             item.target.touchable = !isAnswer;

+ 9 - 3
GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs

@@ -1,5 +1,6 @@
 using ET;
 using ET;
 using FairyGUI;
 using FairyGUI;
+using Hutool;
 using UI.League;
 using UI.League;
 using UnityEngine;
 using UnityEngine;
 
 
@@ -172,11 +173,16 @@ namespace GFGGame
         }
         }
         private void UpdateTime(object param)
         private void UpdateTime(object param)
         {
         {
-            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
+                LeagueQuestionStatus.End)
             {
             {
+                int curIndex = DateUtil.GetNearestStartTimeIndex(GlobalCfgArray.globalCfg.leagueQuestionCloseTimeArr);
+                var questionStartTimeStr = GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[curIndex];
+                var endTime = TimeUtil.GetNextTime(questionStartTimeStr);
+
                 long curTime = TimeHelper.ServerNow();
                 long curTime = TimeHelper.ServerNow();
-                long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTimeArr[0]);//暂时
-                _ui.m_btnAnswer.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
+                _ui.m_btnAnswer.m_txtTime.text =
+                    string.Format("{0}后开启", TimeUtil.FormattingTimeTo_HHmmss((endTime - curTime)));
             }
             }
             else
             else
             {
             {