少年修仙传客户端代码仓库
hch
2023-07-24 73661fcc420eb032b3139058ee567a682b05fc91
9849 【主干】【骨折版2】天星塔全服奖励优化
4个文件已修改
71 ■■■■■ 已修改文件
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB213_tagMCSkyTowerInfo.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SkyTower/SkyTowerModel.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SkyTower/SkyTowerServeChallengeCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SkyTower/SkyTowerServerGift.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB213_tagMCSkyTowerInfo.cs
@@ -1,18 +1,21 @@
using UnityEngine;
using System.Collections;
// B2 13 天星塔通关层数 #tagMCSkyTowerInfo
public class HB213_tagMCSkyTowerInfo : GameNetPackBasic {
    public uint Floor;    // 已通关层
    public uint ServerRewardRecord;    //全服挑战层领奖记录,按奖励记录二进制位存储是否已领取
    public HB213_tagMCSkyTowerInfo () {
        _cmd = (ushort)0xB213;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Floor, vBytes, NetDataType.DWORD);         TransBytes(out ServerRewardRecord, vBytes, NetDataType.DWORD);
    }
}
using UnityEngine;
using System.Collections;
// B2 13 天星塔通关层数 #tagMCSkyTowerInfo
public class HB213_tagMCSkyTowerInfo : GameNetPackBasic {
    public uint Floor;    // 已通关层
    public byte RecordCount;
    public  uint[] ServerRewardRecord;    //全服挑战层领奖记录值列表,按奖励记录二进制位存储是否已领取
    public HB213_tagMCSkyTowerInfo () {
        _cmd = (ushort)0xB213;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Floor, vBytes, NetDataType.DWORD);
        TransBytes (out RecordCount, vBytes, NetDataType.BYTE);
        TransBytes (out ServerRewardRecord, vBytes, NetDataType.DWORD, RecordCount);
    }
}
System/SkyTower/SkyTowerModel.cs
@@ -48,7 +48,7 @@
        List<int> sortedFloors = new List<int>();
        public List<int> ChallengeFloors = new List<int>();
        public Dictionary<int, ChallengeInfo> ChallengeInfoFloors = new Dictionary<int, ChallengeInfo>();
        public int challengeRewardRecord = 0;
        List<int> serverRewardRecord = new List<int>();
        public event Action OnChallengeState;
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
@@ -165,7 +165,10 @@
        public void UpdateHighestPassFloor(HB213_tagMCSkyTowerInfo info)
        {
            highestPassFloor = (int)info.Floor;
            challengeRewardRecord = (int)info.ServerRewardRecord;
            for (int i = 0; i < info.ServerRewardRecord.Length; i++)
            {
                serverRewardRecord.Add((int)info.ServerRewardRecord[i]);
            }
            UpateRedpoint();
            if (OnChallengeState != null)
                OnChallengeState();
@@ -277,7 +280,7 @@
                var config = SkyTowerServerChallengeConfig.Get(floorInfo.Key);
                if (config == null)
                    continue;
                if (((int)Mathf.Pow(2, config.rewardRecordIndex) & challengeRewardRecord) == 0)
                if (CanGetChallengeReward(config.rewardRecordIndex))
                {
                    //可领取
                    redpoint04.state = RedPointState.Simple;
@@ -287,6 +290,25 @@
            }
        }
        public bool CanGetChallengeReward(int index)
        {
            //每个数按位存31个激活索引
            var listIndex = index / 31;
            var bitIndex = index % 31;
            if (listIndex >= serverRewardRecord.Count)
            {
                return false;
            }
            if (((int)Math.Pow(2, bitIndex) & serverRewardRecord[listIndex]) == 0)
            {
                return true;
            }
            return false;
        }
        private void OnGetUniversalGameInfo(HA003_tagUniversalGameRecInfo package)
        {
            if (package.Type == 10)
System/SkyTower/SkyTowerServeChallengeCell.cs
@@ -52,7 +52,7 @@
                    particularModel.ViewRoleEquip(floorInfo.PlayerID);
                });
                if (((int)Mathf.Pow(2, config.rewardRecordIndex) & model.challengeRewardRecord) == 0)
                if (model.CanGetChallengeReward(config.rewardRecordIndex))
                {
                    //可领取
                    m_GetGift.SetColorful(m_GetGiftText, true);
System/SkyTower/SkyTowerServerGift.cs
@@ -71,7 +71,7 @@
            {
                int floorID = floorInfo.Key;
                var config = SkyTowerServerChallengeConfig.Get(floorID);
                if (((int)Mathf.Pow(2, config.rewardRecordIndex) & model.challengeRewardRecord) == 0)
                if (model.CanGetChallengeReward(config.rewardRecordIndex))
                {
                    return index;
                }