فهرست منبع

调整代码,修复每日签到bug

hexiaojie 2 سال پیش
والد
کامیت
0d6c972fbf

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Data/ActivityDay7DataManager.cs

@@ -1,5 +1,6 @@
 using System;
 using ET;
+using Hutool;
 
 namespace GFGGame
 {
@@ -27,7 +28,7 @@ namespace GFGGame
         public bool GetActivityDay7RewardState(int id)
         {
             var day7ActivityReward = GameGlobal.myNumericComponent.GetAsInt(NumericType.Day7ActivityReward);
-            return MathHelper.isBitSet(day7ActivityReward, id);
+            return MathUtil.isBitSet(day7ActivityReward, id);
         }
 
         //检测7日活动活跃奖励是否可领

+ 7 - 6
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -1,6 +1,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using ET;
+using Hutool;
 
 namespace GFGGame
 {
@@ -528,7 +529,7 @@ namespace GFGGame
 
             for (int i = 1; i < vipCfgs.Length; i++)
             {
-                bool isGet = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus),
+                bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus),
                     vipCfgs[i].id);
                 if (!isGet && RoleDataManager.vipLv >= vipCfgs[i].id) return true;
             }
@@ -576,7 +577,7 @@ namespace GFGGame
             int _month = TimeUtil.GetCurMonth();
             MonthlyCardClothesCfg clothesCfg = MonthlyCardClothesCfgArray.Instance.GetCfgByyearAndmonth(_year, _month);
 
-            return RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold) && !MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), _month);
+            return RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold) && !MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), _month);
         }
         /// <summary>
         /// 联盟
@@ -770,14 +771,14 @@ namespace GFGGame
         /// <returns></returns>
         public bool DailySignRed()
         {
-            int _signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
+            int _signCount = MathUtil.CountOnes2(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay));
             List<DailySignCfg> signCfgs = DailySignCfgArray.Instance.GetCfgsBymonth(TimeUtil.GetCurMonth());
             for (int i = 0; i < signCfgs.Count; i++)
             {
-                bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
+                bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignReward), signCfgs[i].day);
                 if (_signCount >= signCfgs[i].day && !isGot) return true;
             }
-            return !MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay), TimeUtil.GetCurDay());
+            return !MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), TimeUtil.GetCurDay());
         }
         /// <summary>
         /// 福利大厅-每日补给
@@ -801,7 +802,7 @@ namespace GFGGame
             long openTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.openTime).ToString("HH:mm:ss"));
             long endTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.endTime).ToString("HH:mm:ss"));
 
-            bool isGet = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.DailySupplyReward), supplyCfg.id);
+            bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.DailySupplyReward), supplyCfg.id);
 
             long curTime = TimeHelper.ServerNow();
             if (!isGet && curTime > openTime && curTime < endTime)

+ 3 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/BattlePassTaskSProxy.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using ET;
 using GFGGame;
+using Hutool;
 
 namespace ET
 {
@@ -90,12 +91,12 @@ namespace GFGGame
             var passCfgBonusNormalArr = passCfg.bonusNormalArr;
             var passCfgBonusSuperArr = passCfg.bonusSpecialArr;
             var bonusList = new List<ItemData>();
-            if (MathHelper.isBitSet(responseGetType, 1))
+            if (MathUtil.isBitSet(responseGetType, 1))
             {
                 bonusList.AddRange(ItemUtil.CreateItemDataList(passCfgBonusNormalArr));
                 BattlePassTaskDataManager.Instance.AddNormalReward(level);
             }
-            if (MathHelper.isBitSet(responseGetType, 2))
+            if (MathUtil.isBitSet(responseGetType, 2))
             {
                 bonusList.AddRange(ItemUtil.CreateItemDataList(passCfgBonusSuperArr));
                 BattlePassTaskDataManager.Instance.AddSuperReward(level);

+ 10 - 9
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySignView.cs

@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using ET;
 using FairyGUI;
+using Hutool;
 using UI.DailyWelfare;
 using UnityEngine;
 
@@ -109,7 +110,7 @@ namespace GFGGame
 
         private void UpdateSignView()
         {
-            _signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
+            _signCount = MathUtil.CountOnes2(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay));
             _ui.m_proSign.m_txtSignCount.text = _signCount.ToString();
             List<DailySignBonusCfg> signBonusCfgs = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month);
             _ui.m_proSign.target.max = signBonusCfgs.Count;
@@ -130,7 +131,7 @@ namespace GFGGame
                     item.target.onClick.Add(OnBtnGetProBonus);
                 }
                 item.target.data = signCfgs[i];
-                bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
+                bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
                 item.m_imgGot.visible = isGot;
                 bool canGet = _signCount >= signCfgs[i].day && !isGot;
                 if (canGet)
@@ -152,7 +153,7 @@ namespace GFGGame
         {
             GObject obj = context.sender as GObject;
             DailySignCfg signCfg = obj.data as DailySignCfg;
-            if (_signCount < signCfg.day || MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfg.day))
+            if (_signCount < signCfg.day || MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfg.day))
             {
                 GoodsItemTipsController.ShowItemTips(signCfg.bonusArr[0][0]);
             }
@@ -179,7 +180,7 @@ namespace GFGGame
             int _index = index >= 29 ? index - 1 : index;
             DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(bonusCfg.bonusArr[0][0]);
-            bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay), bonusCfg.day);
+            bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), bonusCfg.day);
             if (bonusCfg.day == _day && !isGot && _gameObject3 == null)
             {
                 string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "everyday_kuang");
@@ -215,7 +216,7 @@ namespace GFGGame
             int day = (int)obj.data;
             bool result = false;
             if (day > _day) return;
-            bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay), day);
+            bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), day);
             if (isGot)
             {
                 PromptController.Instance.ShowFloatTextPrompt("已领取");
@@ -241,10 +242,10 @@ namespace GFGGame
             {
                 result = await DailyWelfareSProxy.ReqSign(day);
             }
-            if (result)
-            {
-                _ui.m_list.numItems = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month).Count;
-            }
+            // if (result)
+            // {
+            //     _ui.m_list.numItems = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month).Count;
+            // }
         }
     }
 }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySupplyView.cs

@@ -4,6 +4,7 @@ using System.Collections.Generic;
 using System.Threading.Tasks;
 using ET;
 using FairyGUI;
+using Hutool;
 using UI.DailyWelfare;
 using UnityEngine;
 
@@ -130,7 +131,7 @@ namespace GFGGame
             ItemUtil.UpdateItemNeedNum(item.m_comCost, GlobalCfgArray.globalCfg.dailySupplyConsumeArr[0], false, "#FFF6ED");
             item.m_comCost.visible = false;
 
-            if (MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.DailySupplyReward), supplyCfg.id))
+            if (MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.DailySupplyReward), supplyCfg.id))
             {
                 item.m_btnGet.title = "已领取";
                 item.m_btnGet.enabled = false;

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/Store/StoreBlackCardRewardView.cs

@@ -1,6 +1,7 @@
 using System;
 using ET;
 using FairyGUI;
+using Hutool;
 using UI.Store;
 using UI.CommonGame;
 namespace GFGGame
@@ -73,7 +74,7 @@ namespace GFGGame
             item.m_imgMask.visible = !isCurMonth;
             item.m_grpMonth.visible = isCurMonth;
             item.m_grpName.visible = isCurMonth;
-            item.m_imggot.visible = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), clothesCfg.month);
+            item.m_imggot.visible = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), clothesCfg.month);
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnBtnGetClick);
@@ -94,7 +95,7 @@ namespace GFGGame
                 return;
             }
 
-            if (MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), month))
+            if (MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), month))
             {
                 PromptController.Instance.ShowFloatTextPrompt("奖励已领取");
                 return;

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeAddUpView.cs

@@ -4,6 +4,7 @@ using FairyGUI;
 using System.Collections.Generic;
 using ET;
 using System;
+using Hutool;
 
 namespace GFGGame
 {
@@ -152,7 +153,7 @@ namespace GFGGame
                 item.m_btnGetGiftBag.onClick.Add(OnBtnGetGiftBagClick);
             }
             item.m_btnGetGiftBag.data = vipCfg.id;
-            bool isGet = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
+            bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
             item.m_btnGetGiftBag.grayed = isGet || vipCfg.id > RoleDataManager.vipLv;
             RedDotController.Instance.SetComRedDot(item.m_btnGetGiftBag, !isGet && RoleDataManager.vipLv >= vipCfg.id);
             if (item.m_btnGetWeekGiftBag.data == null)
@@ -199,7 +200,7 @@ namespace GFGGame
         {
             GObject obj = context.sender as GObject;
             int vipLv = (int)obj.data;
-            bool isGet = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipLv);
+            bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipLv);
             if (isGet)
             {
                 PromptController.Instance.ShowFloatTextPrompt("会员等级礼包已领取");
@@ -264,7 +265,7 @@ namespace GFGGame
             VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
             for (int i = 1; i < vipCfgs.Length; i++)
             {
-                bool isGet = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfgs[i].id);
+                bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfgs[i].id);
                 bool red = !isGet && RoleDataManager.vipLv >= vipCfgs[i].id;
 
                 if (red && _curSelectIndex > i - 1)