Пример #1
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else if (this.mode == FlowNode_SetEventShopList.Mode.GetShopList)
            {
                WebAPI.JSON_BodyResponse <JSON_ShopListArray> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ShopListArray> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                this.event_shop_list.DestroyItems();
                if (jsonObject.body.shops != null && jsonObject.body.shops.Length > 0)
                {
                    for (int index = 0; index < jsonObject.body.shops.Length; ++index)
                    {
                        if (jsonObject.body.shops[index] == null)
                        {
                            this.OnRetry();
                            return;
                        }
                    }
                    MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

                    if (this.inputPin != 2)
                    {
                        this.event_shop_list.AddEventShopList(jsonObject.body.shops);
                    }
                }
                this.event_shop_list.AddArenaShopList();
                this.event_shop_list.AddMultiShopList();
                this.EraseTimeOutPopupHistory(jsonObject.body.shops);
                this.mode = FlowNode_SetEventShopList.Mode.GetCoinNum;
                this.ExecRequest((WebAPI) new ReqGetCoinNum(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            }
            else
            {
                if (this.mode != FlowNode_SetEventShopList.Mode.GetCoinNum)
                {
                    return;
                }
                WebAPI.JSON_BodyResponse <FlowNode_SetEventShopList.JSON_CoinNum> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_SetEventShopList.JSON_CoinNum> >(www.text);
                Network.RemoveAPI();
                if (jsonObject.body != null && jsonObject.body.item != null && jsonObject.body.item.Length > 0)
                {
                    MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.item);
                }
                if (jsonObject.body != null && jsonObject.body.newcoin != null)
                {
                    GlobalVars.NewSummonCoinInfo = new GlobalVars.SummonCoinInfo()
                    {
                        Period = jsonObject.body.newcoin.period
                    }
                }
                ;
                this.Success();
            }
        }
Пример #2
0
 public override void OnActivate(int pinID)
 {
     if (pinID != 1 && pinID != 2 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     this.inputPin = pinID;
     if (Network.Mode == Network.EConnectMode.Online)
     {
         this.mode = FlowNode_SetEventShopList.Mode.GetShopList;
         this.ExecRequest((WebAPI) new ReqEventShopList(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
         ((Behaviour)this).set_enabled(true);
     }
     else
     {
         this.Success();
     }
 }