Browse Source

通用限制

guodong 2 years ago
parent
commit
46f328074a

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

@@ -102,6 +102,7 @@ namespace GFGGame
             GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("Main"));
             GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("Main"));
 
 
             await ItemProxy.GetItemInfos();
             await ItemProxy.GetItemInfos();
+            await RoleLimitSProxy.ReqUnitLimitInfos();
             await InstanceZonesSProxy.GetInstanceZonesInfos();
             await InstanceZonesSProxy.GetInstanceZonesInfos();
             await StorageSProxy.ReqGetClientValues();
             await StorageSProxy.ReqGetClientValues();
             await SuitFosterProxy.SendGetSuitInfos();
             await SuitFosterProxy.SendGetSuitInfos();

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/InstanceZonesDataManager.cs

@@ -362,7 +362,7 @@ namespace GFGGame
             {
             {
                 var studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
                 var studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
                 var limitData = RoleLimitDataManager.GetLimitData(studioCfg.limit);
                 var limitData = RoleLimitDataManager.GetLimitData(studioCfg.limit);
-                times = Math.Min(times, limitData.TotalPlayTimes - limitData.PlayTimes);
+                times = Math.Min(times, limitData.TotalPlayMax - limitData.PlayTimes);
             }
             }
             title = string.Format("挑战{0}次", NumberUtil.GetChiniseNumberText(times));
             title = string.Format("挑战{0}次", NumberUtil.GetChiniseNumberText(times));
         }
         }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/RoleLimitDataManager.cs

@@ -24,9 +24,9 @@ namespace GFGGame
             if(data == null)
             if(data == null)
             {
             {
                 data = new RoleLimitData();
                 data = new RoleLimitData();
-                data.FromMessage(proto);
                 _roleLimitDatas.Add(proto.LimitId, data);
                 _roleLimitDatas.Add(proto.LimitId, data);
             }
             }
+            data.FromMessage(proto);
             EventAgent.DispatchEvent(ConstMessage.NOTICE_LIMIT_CHANGED, proto.LimitId);
             EventAgent.DispatchEvent(ConstMessage.NOTICE_LIMIT_CHANGED, proto.LimitId);
         }
         }
 
 
@@ -43,7 +43,7 @@ namespace GFGGame
             {
             {
                 return true;
                 return true;
             }
             }
-            return data.TotalPlayTimes >= data.PlayTimes + times;
+            return data.TotalPlayMax >= data.PlayTimes + times;
         }
         }
     }
     }
 }
 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/VO/RoleLimitData.cs

@@ -18,13 +18,13 @@ namespace GFGGame
         /// <summary>
         /// <summary>
         /// 最大可挑战次数
         /// 最大可挑战次数
         /// </summary>
         /// </summary>
-        public int TotalPlayTimes;
+        public int TotalPlayMax;
 
 
         public void FromMessage(UnitLimitInfoProto proto)
         public void FromMessage(UnitLimitInfoProto proto)
         {
         {
             BuyTimes = proto.BuyTimes;
             BuyTimes = proto.BuyTimes;
             PlayTimes = proto.PlayTimes;
             PlayTimes = proto.PlayTimes;
-            TotalPlayTimes = proto.PlayTimesMax;
+            TotalPlayMax = proto.PlayTimesMax;
         }
         }
 
 
     }
     }

+ 13 - 10
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs

@@ -58,7 +58,7 @@ namespace GFGGame
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
             base.AddEventListener();
             base.AddEventListener();
-            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
         }
         }
         public void AddChildCom(GComponent com)
         public void AddChildCom(GComponent com)
         {
         {
@@ -97,21 +97,24 @@ namespace GFGGame
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
         }
         }
-        protected void UpdateView(EventContext context = null)
+
+        private void OnLimitChanged(EventContext context)
         {
         {
-            if(context != null)
+            int limitId = (int)context.data;
+            if (this._studioCfg.limit != limitId)
             {
             {
-                int limitId = (int)context.data;
-                if (this._studioCfg.limit != limitId)
-                {
-                    return;
-                }
+                return;
             }
             }
+            UpdateView();
+        }
+
+        protected void UpdateView()
+        {
             var limitData = RoleLimitDataManager.GetLimitData(this._studioCfg.limit);
             var limitData = RoleLimitDataManager.GetLimitData(this._studioCfg.limit);
             var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
             var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
-            _txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayTimes - limitData.PlayTimes, limitCfg.num);
+            _txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayMax - limitData.PlayTimes, limitCfg.num);
         }
         }
 
 
         private void UpdateView(int limitId)
         private void UpdateView(int limitId)

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBuyNumView.cs

@@ -45,7 +45,7 @@ namespace GFGGame
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
             base.AddEventListener();
             base.AddEventListener();
-            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnListenerBuyTimeComplete);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
         }
         }
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -53,6 +53,7 @@ namespace GFGGame
             UpdateView();
             UpdateView();
         }
         }
 
 
+
         private void UpdateView()
         private void UpdateView()
         {
         {
             _limitId = (int)this.viewData;
             _limitId = (int)this.viewData;
@@ -78,7 +79,7 @@ namespace GFGGame
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
         {
         {
             base.RemoveEventListener();
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnListenerBuyTimeComplete);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
         }
         }
         private void OnClickBtnBuy(int type)
         private void OnClickBtnBuy(int type)
         {
         {
@@ -97,7 +98,7 @@ namespace GFGGame
             RoleLimitSProxy.ReqBuyLimitPlayTimes(_limitId, type, 1).Coroutine();
             RoleLimitSProxy.ReqBuyLimitPlayTimes(_limitId, type, 1).Coroutine();
 
 
         }
         }
-        private void OnListenerBuyTimeComplete(EventContext context = null)
+        private void OnLimitChanged(EventContext context = null)
         {
         {
             if((int)context.data != _limitId)
             if((int)context.data != _limitId)
             {
             {

+ 14 - 12
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs

@@ -52,7 +52,7 @@ namespace GFGGame
             base.AddEventListener();
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.AddEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
             EventAgent.AddEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
-            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
             EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
 
         }
         }
@@ -82,28 +82,30 @@ namespace GFGGame
             base.RemoveEventListener();
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
-            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
             EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
 
         }
         }
 
 
-        private void UpdateView(EventContext context = null)
+        private void OnLimitChanged(EventContext context)
         {
         {
-            if (context != null)
+            int limitId = (int)context.data;
+            if (this._studioCfg.limit != limitId)
             {
             {
-                int limitId = (int)context.data;
-                if (this._studioCfg.limit != limitId)
-                {
-                    return;
-                }
+                return;
             }
             }
-            var limitData = RoleLimitDataManager.GetLimitData(this._studioCfg.limit);
-            var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
+            UpdateView();
+        }
 
 
+        private void UpdateView()
+        {
             _studioCfg = StudioCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
             _studioCfg = StudioCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
+            RoleLimitData limitData = RoleLimitDataManager.GetLimitData(this._studioCfg.limit);
+            var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
+
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(_studioCfg.res);
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(_studioCfg.res);
             _ui.m_btnChange.title = _studioCfg.name;
             _ui.m_btnChange.title = _studioCfg.name;
-            _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayTimes - limitData.PlayTimes, limitCfg.num);
+            _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayMax - limitData.PlayTimes, limitCfg.num);
 
 
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_studioCfg.suitId);
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_studioCfg.suitId);
             _ui.m_txtSuitName.text = suitCfg.name;
             _ui.m_txtSuitName.text = suitCfg.name;

+ 2 - 2
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -84,8 +84,8 @@ namespace GFGGame
         public static void InitPlatform(string json)
         public static void InitPlatform(string json)
         {
         {
             var result = JsonMapper.ToObject<Result>(json);
             var result = JsonMapper.ToObject<Result>(json);
-            // LauncherConfig.CDN_ROOT = result.cdnRoot;
-            CDN_ROOT = "http://10.108.64.105/";
+             LauncherConfig.CDN_ROOT = result.cdnRoot;
+            //CDN_ROOT = "http://10.108.64.105/";
             LauncherConfig.logApiRootUrl = result.logApiUrl;
             LauncherConfig.logApiRootUrl = result.logApiUrl;
             //LauncherConfig.logApiRootUrl = "http://10.108.64.106:8080/api/Log/";
             //LauncherConfig.logApiRootUrl = "http://10.108.64.106:8080/api/Log/";
             LauncherConfig.logApiReportLauncherUrl = LauncherConfig.logApiRootUrl + "ReportNode";
             LauncherConfig.logApiReportLauncherUrl = LauncherConfig.logApiRootUrl + "ReportNode";

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes