少年修仙传客户端代码仓库
client_Zxw
2018-09-20 f9b7ed53aaa63110091884813bce310f0dbf0bdd
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
1个文件已修改
26 ■■■■ 已修改文件
System/KnapSack/Logic/ItemOverdueModel.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemOverdueModel.cs
@@ -35,7 +35,7 @@
        public event Action showItemRefreshEvent;
        public OverdueItem currentShowItem { get; private set; }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        bool isdelay = true;
        public readonly int VipExperirnceID = 985;
        public readonly int VipCardID = 978;
        Dictionary<int, Dictionary<int, List<ItemModel>>>  allGuardDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>(); //守护类型,守护ID
@@ -63,6 +63,8 @@
        public void OnBeforePlayerDataInitialize()
        {
            isdelay = true;
            GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
            guardOverdueIndex = -1;
            itemStack.Clear();
            itemGuids.Clear();
@@ -73,10 +75,25 @@
        {
          
        }
        void IPlayerLoginOk.OnPlayerLoginOk()
        public void OnPlayerLoginOk()
        {
            GetOverdueGuard();
            GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
            time = 0;
        }
        float time = 0;
        private void UpdateSecond()
        {
           if(isdelay)
            {
                time += 1;
                if(time >= 5)
                {
                    GetOverdueGuard();
                    isdelay = false;
                    time = 0;
                }
            }
        }
        public bool TryGetItem(string _guid, out OverdueItem _itemModel)
@@ -194,6 +211,7 @@
                case "Guardian_Timeout":
                    if (list.Count > 1)
                    {
                        SetAllGuardIdlist();
                        guardOverdueIndex = int.Parse(list[1].ToString());
                        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, guardOverdueIndex);
                        if (itemModel != null)