Ejemplo n.º 1
0
        // Token: 0x0600F9FA RID: 63994 RVA: 0x0041C990 File Offset: 0x0041AB90
        private void HandleBoxOpenNetTask(GoodsType type, int id, int count, Action <List <Goods> > successedCallback, Action failedCallback)
        {
            BagItemUseNetTask bagItemUseNetTask = new BagItemUseNetTask(type, id, count);

            bagItemUseNetTask.EventOnStop += delegate(Task task)
            {
                BagItemUseNetTask bagItemUseNetTask2 = task as BagItemUseNetTask;
                if (bagItemUseNetTask2.Result == 0)
                {
                    if (successedCallback != null)
                    {
                        successedCallback(bagItemUseNetTask2.Reward);
                    }
                }
                else
                {
                    CommonUIController.Instance.ShowErrorMessage(bagItemUseNetTask2.Result, 2f, null, true);
                    if (failedCallback != null)
                    {
                        failedCallback();
                    }
                }
            };
            bagItemUseNetTask.Start(null);
        }
Ejemplo n.º 2
0
        // Token: 0x0601322A RID: 78378 RVA: 0x004E12A8 File Offset: 0x004DF4A8
        private void HandleBoxOpenNetTask(GoodsType type, int id, int count)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_HandleBoxOpenNetTaskGoodsTypeInt32Int32_hotfix != null)
            {
                this.m_HandleBoxOpenNetTaskGoodsTypeInt32Int32_hotfix.call(new object[]
                {
                    this,
                    type,
                    id,
                    count
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BagItemUseNetTask bagItemUseNetTask = new BagItemUseNetTask(type, id, count);

            bagItemUseNetTask.EventOnStop += delegate(Task task)
            {
                BagItemUseNetTask bagItemUseNetTask2 = task as BagItemUseNetTask;
                if (bagItemUseNetTask2.Result == 0)
                {
                    if (bagItemUseNetTask2.Reward != null && bagItemUseNetTask2.Reward.Count > 0)
                    {
                        GetRewardGoodsUITask.StartUITask(bagItemUseNetTask2.Reward);
                    }
                }
                else
                {
                    CommonUIController.Instance.ShowErrorMessage(bagItemUseNetTask2.Result, 2f, null, true);
                }
            };
            bagItemUseNetTask.Start(null);
        }
Ejemplo n.º 3
0
        // Token: 0x06014CAD RID: 85165 RVA: 0x00546598 File Offset: 0x00544798
        private void StartUseEnergyMedicineNetTask()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_StartUseEnergyMedicineNetTask_hotfix != null)
            {
                this.m_StartUseEnergyMedicineNetTask_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            BagItemUseNetTask bagItemUseNetTask = new BagItemUseNetTask(GoodsType.GoodsType_Item, this.m_energyMedicineItemID, 1);

            bagItemUseNetTask.EventOnStop += delegate(Task task)
            {
                BagItemUseNetTask bagItemUseNetTask2 = task as BagItemUseNetTask;
                if (bagItemUseNetTask2.Result == 0)
                {
                    this.ShowEnergyRewardGoodsUITask(this.m_getEnergyByUseEnergyMedicine);
                    base.Pause();
                    this.m_buyEnergyUIController.Close();
                }
                else
                {
                    CommonUIController.Instance.ShowErrorMessage(bagItemUseNetTask2.Result, 2f, null, true);
                }
            };
            bagItemUseNetTask.Start(null);
        }