少年修仙传客户端代码仓库
Client_PangDeRong
2018-10-24 65171bcb4e556e5ff19d3ae3349ea1159126d3ca
4232 许愿池功能开发
4个文件已添加
9个文件已修改
209 ■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagMCActWishingWellPlayerInfo.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1B_tagMCActWishingDragResult.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1B_tagMCActWishingDragResult.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1A_tagMCActWishingWellPlayerInfo.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1B_tagMCActWishingDragResult.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1B_tagMCActWishingDragResult.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/MainInterfaceWin.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/OpenServerActivityWin.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/PoolItemCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishItemCell.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingPoolModel.cs 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingPoolWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -389,6 +389,7 @@
        Register(typeof(HAA19_tagMCActWishingWellInfo), typeof(DTCAA19_tagMCActWishingWellInfo));
        Register(typeof(HAA1A_tagMCActWishingWellPlayerInfo), typeof(DTCAA1A_tagMCActWishingWellPlayerInfo));
        Register(typeof(HAA1B_tagMCActWishingDragResult), typeof(DTCAA1B_tagMCActWishingDragResult));
    }
    private static void Register(Type _pack, Type _business)
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagMCActWishingWellPlayerInfo.cs
@@ -6,11 +6,18 @@
public class DTCAA1A_tagMCActWishingWellPlayerInfo : DtcBasic {
public class DTCAA1A_tagMCActWishingWellPlayerInfo : DtcBasic
{
    WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HAA1A_tagMCActWishingWellPlayerInfo vNetData = vNetPack as HAA1A_tagMCActWishingWellPlayerInfo;         wishModel.SetWishingWellPlayerInfo(vNetData);
    }
}
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        HAA1A_tagMCActWishingWellPlayerInfo vNetData = vNetPack as HAA1A_tagMCActWishingWellPlayerInfo;
        wishModel.SetWishingWellPlayerInfo(vNetData);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1B_tagMCActWishingDragResult.cs
New file
@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
using Snxxz.UI;
// AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
public class DTCAA1B_tagMCActWishingDragResult : DtcBasic {
    WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HAA1B_tagMCActWishingDragResult vNetData = vNetPack as HAA1B_tagMCActWishingDragResult;
        wishModel.SetWishingResultInfo(vNetData);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1B_tagMCActWishingDragResult.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e02a54b17dc643541b69454edefab46d
timeCreated: 1540300760
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1A_tagMCActWishingWellPlayerInfo.cs
@@ -53,6 +53,8 @@
            TransBytes (out WellItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
            TransBytes (out WellItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
        }
        TransBytes (out CurAwardCnt, vBytes, NetDataType.BYTE);
@@ -68,6 +70,8 @@
            TransBytes (out CurAwardItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
            TransBytes (out CurAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
            TransBytes (out CurAwardItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
        }
@@ -85,6 +89,8 @@
            TransBytes (out LastAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
            TransBytes (out LastAwardItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
        }
    }
@@ -99,6 +105,8 @@
        public byte IsBind;        // 是否绑定
        public byte IsSpecial;        // 是否极品
    }
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1B_tagMCActWishingDragResult.cs
New file
@@ -0,0 +1,37 @@
using UnityEngine;
using System.Collections;
// AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
public class HAA1B_tagMCActWishingDragResult : GameNetPackBasic {
    public byte Cnt;
    public  tagMCPlayerWishingDragInfo[] InfoList;
    public HAA1B_tagMCActWishingDragResult () {
        _cmd = (ushort)0xAA1B;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Cnt, vBytes, NetDataType.BYTE);
        InfoList = new tagMCPlayerWishingDragInfo[Cnt];
        for (int i = 0; i < Cnt; i ++) {
            InfoList[i] = new tagMCPlayerWishingDragInfo();
            TransBytes (out InfoList[i].WellType, vBytes, NetDataType.BYTE);
            TransBytes (out InfoList[i].Index, vBytes, NetDataType.BYTE);
            TransBytes (out InfoList[i].ItemID, vBytes, NetDataType.DWORD);
            TransBytes (out InfoList[i].ItemCnt, vBytes, NetDataType.WORD);
            TransBytes (out InfoList[i].IsBind, vBytes, NetDataType.BYTE);
            TransBytes (out InfoList[i].IsSpecial, vBytes, NetDataType.BYTE);
        }
    }
    public struct tagMCPlayerWishingDragInfo {
        public byte WellType;        // 库 0-可选库 1-结果库
        public byte Index;        // 索引
        public uint ItemID;        // 物品ID
        public ushort ItemCnt;        // 物品数量
        public byte IsBind;        // 是否绑定
        public byte IsSpecial;        // 是否极品
    }
}
Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA1B_tagMCActWishingDragResult.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4f77d8a999175554496515a4bc25d664
timeCreated: 1540300760
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/MainInterfacePanel/MainInterfaceWin.cs
@@ -83,6 +83,7 @@
        [SerializeField] Button m_RedBag;//红包入口按钮
        [SerializeField] UIEffect m_RedpackGetSfx;
        [SerializeField] Button m_SendRedbagBtn;
        [SerializeField] Button WishingAwardImg;
        [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
        private int m_CollectNPCID;
@@ -137,7 +138,7 @@
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
        #region Built-in
        protected override void BindController()
        {
@@ -172,6 +173,7 @@
            fairyRequestBtn.onClick.AddListener(OnFairyRequestClick);
            m_RedBag.AddListener(RedPacketButton);
            m_SendRedbagBtn.AddListener(SendRedpacketBtn);
            WishingAwardImg.AddListener(ClickWishAward);
        }
        protected override void OnPreOpen()
@@ -198,7 +200,7 @@
            m_TeamInvitationEntrance.Init();
            m_FairyCallBehaviour.Init();
            m_BossBriefInfos.gameObject.SetActive(false);
            ClickWishAward();
            ArticleExperience();//关于经验条
            FriendQuestBtn();
            UpdateFairyRequest();
@@ -223,6 +225,7 @@
            RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent;
            NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent;
            fairyGrabBossModel.bossGrabHintEvent += bossGrabHintEvent;
            wishModel.UpdateWishAwardEvent += ClickWishAward;
        }
        private void CompletionOfTaskEvent(int obj)
@@ -392,6 +395,7 @@
            GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
            GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
            fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
            wishModel.UpdateWishAwardEvent -= ClickWishAward;
            m_CollectBtn.gameObject.SetActive(false);
        }
@@ -649,6 +653,11 @@
            }
        }
        private void ClickWishAward()
        {
            WishingAwardImg.gameObject.SetActive(wishModel.wishingAwardDict.Count > 0 ? true : false);
        }
        private void UpdateFairyRequest()
        {
            fairyRequestBtn.gameObject.SetActive(fairyModel.FairyRequestRedPoint.count > 0);
System/OpenServerActivity/OpenServerActivityWin.cs
@@ -584,6 +584,16 @@
                        WindowCenter.Instance.Open<FlashRushToBuyWin>(true);
                    }
                    break;
                case 15:
                    if (windowState == WindowState.Opened)
                    {
                        WindowCenter.Instance.OpenWithoutAnimation<WishingPoolWin>();
                    }
                    else
                    {
                        WindowCenter.Instance.Open<WishingPoolWin>(true);
                    }
                    break;
            }
        }
@@ -620,6 +630,7 @@
            WindowCenter.Instance.CloseImmediately<FairyLeagueNoticeWin>();
            WindowCenter.Instance.CloseImmediately<FairyGrabBossNoticeWin>();
            WindowCenter.Instance.CloseImmediately<FlashRushToBuyWin>();
            WindowCenter.Instance.CloseImmediately<WishingPoolWin>();
        }
        private int Compare(int order_x, int order_y)
System/OpenServerActivity/PoolItemCell.cs
@@ -28,7 +28,7 @@
            ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
            nameText.text = itemConfig.ItemName;
            nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
            bestIconObj.SetActive(false);
            bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
            ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
            itemBaisc.Init(cellModel);
            itemBaisc.cellBtn.RemoveAllListeners();
System/OpenServerActivity/WishItemCell.cs
@@ -9,6 +9,7 @@
        [SerializeField] GameObject noneItemObj;
        [SerializeField] Button noneItemBtn;
        [SerializeField] Text nameText;
        [SerializeField] GameObject bestIconObj;
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
@@ -21,6 +22,7 @@
                nameText.gameObject.SetActive(true);
                itemBaisc.gameObject.SetActive(true);
                noneItemObj.gameObject.SetActive(false);
                bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
                ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
                nameText.text = itemConfig.ItemName;
                nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
@@ -38,6 +40,7 @@
                itemBaisc.gameObject.SetActive(false);
                noneItemObj.gameObject.SetActive(true);
                nameText.gameObject.SetActive(false);
                bestIconObj.SetActive(false);
            }
        }
    }
System/OpenServerActivity/WishingPoolModel.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
namespace Snxxz.UI
{
@@ -9,6 +10,7 @@
    {
        public event Action<int> UpdateWishingDataEvent;
        public event Action<int> UpdatePoolDataEvent;
        public event Action UpdateWishAwardEvent;
        public event Action<int> onStateUpate;
        public const int WishRedKey = 20915;
        public override void Init()
@@ -16,7 +18,7 @@
            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
            OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
            OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
            OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy, this);
            OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.WishingPool, this);
        }
        public void OnBeforePlayerDataInitialize()
@@ -108,11 +110,9 @@
        public bool TryGetFreeWishCoolTime(out int second)
        {
            second = 0;
            if (freeStartTime == 25) return false;
            int endhour = freeStartTime + 2;
            int nowHour = TimeUtility.ServerNow.Hour;
            second = (endhour - nowHour) * 3600;
            int endSeconds = freeStartTime + freeRefreshCoolTime;
            DateTime endTime = TimeUtility.GetTime((uint)endSeconds);
            second = Mathf.CeilToInt((float)(endTime - TimeUtility.ServerNow).TotalSeconds);
            if(second > 0)
            {
                return true;
@@ -130,28 +130,37 @@
            isDraging = false;
            dragIndex = -1;
        }
        public int freeRefreshCoolTime { get; private set;}
        public string wishingPriceFormula { get; private set;}
        public void ParseConfig()
        {
            FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WishingWellCfg");
            freeRefreshCoolTime = int.Parse(funcConfig.Numerical1);
            wishingPriceFormula = funcConfig.Numerical2;
        }
        #endregion
        #region 协议
        Dictionary<int, WishingWellItem> poolDataDict = new Dictionary<int, WishingWellItem>();
        public int freeStartTime { get; private set; }// 免费开始倒计时时间
        public int alreadyWishNum { get; private set; } // 许愿付费刷新次数
        public int wishingPrice { get; private set;}
        public void SetWishingWellPlayerInfo(HAA1A_tagMCActWishingWellPlayerInfo wishInfo)
        {
            freeStartTime = (int)wishInfo.FreeStartTime;
            alreadyWishNum = (int)wishInfo.WishCnt;
            wishingPrice = GetWishingPrice((int)wishInfo.WishCnt);
            for(int i = 0; i < wishInfo.WellItemCnt; i++)
            {
                var itemInfo = wishInfo.WellItemInfo[i];
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind);
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind,itemInfo.IsSpecial);
                SetWishingPoolData(i,wellItem);
            }
            for(int i = 0; i < wishInfo.CurAwardCnt; i++)
            {
                var itemInfo = wishInfo.CurAwardItemInfo[i];
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
                SetWishingData(i, wellItem);
            }
@@ -159,8 +168,38 @@
            for (int i = 0; i < wishInfo.LastAwardCnt; i++)
            {
                var itemInfo = wishInfo.LastAwardItemInfo[i];
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
                SetWishingAwardData(i, wellItem);
            }
            UpdateRedpoint();
            if(UpdateWishAwardEvent != null)
            {
                UpdateWishAwardEvent();
            }
        }
        public int GetWishingPrice(int wishNum)
        {
            Equation.Instance.Clear();
            Equation.Instance.AddKeyValue("refreshCnt",wishNum);
            return Equation.Instance.Eval<int>(wishingPriceFormula);
        }
        public void SetWishingResultInfo(HAA1B_tagMCActWishingDragResult result)
        {
            for(int i = 0; i < result.Cnt;i++)
            {
                var resultInfo = result.InfoList[i];
                WishingWellItem wellItem = new WishingWellItem((int)resultInfo.ItemID, resultInfo.ItemCnt, resultInfo.IsBind, resultInfo.IsSpecial);
                switch (resultInfo.WellType)
                {
                    case 0:
                        SetWishingPoolData(resultInfo.Index, wellItem);
                        break;
                    case 1:
                        SetWishingData(resultInfo.Index, wellItem);
                        break;
                }
            }
            UpdateRedpoint();
        }
@@ -211,7 +250,7 @@
            }
        }
        Dictionary<int, WishingWellItem> wishingAwardDict = new Dictionary<int, WishingWellItem>();
        public Dictionary<int, WishingWellItem> wishingAwardDict = new Dictionary<int, WishingWellItem>();
        public void SetWishingAwardData(int index, WishingWellItem wellItem)
        {
            if (!wishingAwardDict.ContainsKey(index))
@@ -322,7 +361,7 @@
        public void ResetPoolData()
        {
            freeStartTime = 25;
            freeStartTime = 0;
            poolDataDict.Clear();
            wishingDataDict.Clear();
            wishingAwardDict.Clear();
@@ -333,11 +372,13 @@
            public int itemId;
            public int itemCount;
            public int isBind;
            public WishingWellItem(int id,int count,int isBind)
            public int isBest;
            public WishingWellItem(int id,int count,int isBind,int isBest)
            {
                this.itemId = id;
                this.itemCount = count;
                this.isBind = isBind;
                this.isBest = isBest;
            }
        }
    }
System/OpenServerActivity/WishingPoolWin.cs
@@ -77,7 +77,7 @@
            UpdateFreeWishCool();
            UpdateActivityState();
            UpdateDayRemainTime();
            activityDayText.text = Language.Get("WishingPool103", Language.Get(StringUtility.Contact("Num_CHS_", operation.GetActivityDay())));
            activityDayText.text = Language.Get("WishingPool103", operation.GetActivityDay());
            totalDayText.text = Language.Get("WishingPool101", Language.Get(StringUtility.Contact("Num_CHS_", operation.totalDays + 1)));
        }
@@ -222,7 +222,7 @@
                freeRefreshWishBtn.gameObject.SetActive(false);
                freeWishCoolText.gameObject.SetActive(true);
                moneyRefreshWishBtn.gameObject.SetActive(true);
                moneyValueText.text = "100";
                moneyValueText.text = wishingModel.wishingPrice.ToString();
                freeWishCoolText.text = Language.Get("WishingPool102", TimeUtility.SecondsToHMS(second));
            }
            else