public override void OnSuccess(WWWResult www)
 {
     if (Object.op_Equality((Object)this, (Object)null))
     {
         Network.RemoveAPI();
         this.isConnecting = false;
     }
     else if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ProductParamResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ProductParamResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         ProductParamResponse productParamResponse = new ProductParamResponse();
         if (!productParamResponse.Deserialize(jsonObject.body))
         {
             this.Failure();
         }
         else
         {
             this.StartCoroutine(this.CheckPaymentInit(productParamResponse));
         }
     }
 }
示例#2
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ArenaRanking> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ArenaRanking> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnFailed();
         }
         else if (!MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body, this.RankingType))
         {
             this.OnFailed();
         }
         else
         {
             Network.RemoveAPI();
             this.Success();
         }
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            WebAPI.JSON_BodyResponse <Json_ArtifactFavorite> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ArtifactFavorite> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            if (Network.IsError)
            {
                this.OnRetry();
            }
            else if (jsonObject.body == null)
            {
                this.OnRetry();
            }
            else
            {
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.artifacts, true);
                }
                catch (Exception ex)
                {
                    this.OnRetry(ex);
                    return;
                }
                Network.RemoveAPI();
                this.Success();
            }
        }
示例#4
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ResAwardList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ResAwardList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         if (jsonObject.body == null)
         {
             this.Failure();
         }
         else
         {
             if (this.mMode == FlowNode_ReqAwardList.MODE.SetAwardList)
             {
                 if (Object.op_Equality((Object)this.Target, (Object)null) || Object.op_Equality((Object)this.Target.GetComponent <AwardList>(), (Object)null))
                 {
                     this.Failure();
                     return;
                 }
                 ((AwardList)this.Target.GetComponent <AwardList>()).SetOpenAwards(jsonObject.body.awards);
             }
             else if (this.mMode == FlowNode_ReqAwardList.MODE.SetPlayerAward)
             {
                 MonoSingleton <GameManager> .Instance.Player.SetHaveAward(jsonObject.body.awards);
             }
             this.Success();
         }
     }
 }
示例#5
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ArtifactSelectResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ArtifactSelectResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             for (int index = 0; index < jsonObject.body.select.Length; ++index)
             {
                 Json_ArtifactSelectItem artifactSelectItem = jsonObject.body.select[index];
                 if ((int)artifactSelectItem.num > 1)
                 {
                     DebugUtility.LogError("武具は一つしか付与できません " + artifactSelectItem.iname);
                 }
             }
             this.Deserialize(jsonObject.body);
             this.Success();
         }
     }
 }
示例#6
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.NoMail:
                    this.OnBack();
                    break;

                case Network.EErrCode.MailReadable:
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                MonoSingleton <GameManager> .Instance.Player.Deserialize(JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_MailPage> >(www.text).body.mails);

                this.ActivateOutputLinks(10);
                Network.RemoveAPI();
            }
        }
示例#7
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.NotLocation:
                    this.OnBack();
                    break;

                case Network.EErrCode.NotGpsMail:
                    this.m_RecieveStatus = FlowNode_GpsGift.RecieveStatus.FAILED_NOTRECEIVE;
                    this._Failed();
                    break;

                case Network.EErrCode.ReceivedGpsMail:
                    this.m_RecieveStatus = FlowNode_GpsGift.RecieveStatus.FAILED_RECEIVED;
                    this._Failed();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                Network.RemoveAPI();
                MonoSingleton <GameManager> .Instance.Player.UnreadMailPeriod = true;
                MonoSingleton <GameManager> .Instance.RequestUpdateBadges(GameManager.BadgeTypes.GiftBox);

                this.m_RecieveStatus = FlowNode_GpsGift.RecieveStatus.SUCCESS_RECEIVE;
                this._Success();
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.units);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                ((Behaviour)this).set_enabled(false);
                MonoSingleton <GameManager> .Instance.Player.OnOpenTobiraTrophy((long)GlobalVars.SelectedUnitUniqueID);
            }
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         return;
     }
     WebAPI.JSON_BodyResponse <TrophyQuests> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <TrophyQuests> >(www.text);
     if (Object.op_Inequality((Object)this.Quests, (Object)null))
     {
         string[] histories = jsonObject.body.histories;
         if (histories == null || histories.Length <= 0)
         {
             this.Quests.set_text(LocalizedText.Get("sys.TROPHY_NOT_ACHIEVEDQUEST"));
             Network.RemoveAPI();
             this.ActivateOutputLinks(1);
             return;
         }
         GameManager instance = MonoSingleton <GameManager> .Instance;
         for (int index = 0; index < histories.Length; ++index)
         {
             QuestParam quest = instance.FindQuest(histories[index]);
             if (quest != null)
             {
                 Text quests = this.Quests;
                 quests.set_text(quests.get_text() + quest.name + "\n");
             }
         }
     }
     Network.RemoveAPI();
     this.ActivateOutputLinks(1);
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_PassCode> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_PassCode> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (Object.op_Inequality((Object)this.HikkoshiCodeText, (Object)null))
             {
                 this.HikkoshiCodeText.set_text(jsonObject.body.passcode);
             }
             if (Object.op_Inequality((Object)this.ExpireTimeText, (Object)null))
             {
                 DateTime dateTime = DateTime.Now.AddSeconds((double)jsonObject.body.expires_in);
                 this.ExpireTimeText.set_text(string.Format(LocalizedText.Get("sys.HIKKOSHICODE_EXPIRETIME"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute, (object)dateTime.Second));
             }
             this.Success();
         }
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         GameManager instance = MonoSingleton <GameManager> .Instance;
         try
         {
             instance.Deserialize(jsonObject.body.friends, FriendStates.Follwer);
             this.Success();
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             return;
         }
         if (!Object.op_Inequality((Object)this, (Object)null))
         {
             return;
         }
         ((Behaviour)this).set_enabled(false);
     }
 }
示例#12
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqLoginPack.JSON_ReqLoginPackResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqLoginPack.JSON_ReqLoginPackResponse> >(www.text);
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             GameManager instance = MonoSingleton <GameManager> .Instance;
             instance.ResetJigenQuests();
             if (!instance.Deserialize(jsonObject.body.quests))
             {
                 this.OnFailed();
             }
             else
             {
                 this.reflectTrophyProgs(jsonObject.body.trophyprogs);
                 this.reflectTrophyProgs(jsonObject.body.bingoprogs);
                 this.reflectLoginTrophyProgs();
                 GlobalVars.CurrentChatChannel.Set(jsonObject.body.channel);
                 GlobalVars.SelectedSupportUnitUniqueID.Set(jsonObject.body.support);
                 Network.RemoveAPI();
                 this.Success();
             }
         }
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCard.Json_ConceptCardList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCard.Json_ConceptCardList> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.cards, this.mIsDataOverride);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.materials, this.mIsDataOverride);

                    GlobalVars.IsDirtyConceptCardData.Set(false);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                this.StartCoroutine(this.DownloadAssetsAndOutputPin());
            }
        }
示例#14
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this._Failed();
     }
     else
     {
         DebugMenu.Log("API", "homeapi:{" + www.text + "}");
         WebAPI.JSON_BodyResponse <FlowNode_HomeApi.JSON_HomeApiResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_HomeApi.JSON_HomeApiResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         if (jsonObject.body != null && jsonObject.body.player != null)
         {
             MonoSingleton <GameManager> .Instance.Player.ValidGpsGift       = jsonObject.body.player.areamail_enabled != 0;
             MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = jsonObject.body.player.present_granted != 0;
             MultiInvitationReceiveWindow.SetBadge(jsonObject.body.player.multi_inv != 0);
             MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus = jsonObject.body.player.charge_bonus;
         }
         else
         {
             MonoSingleton <GameManager> .Instance.Player.ValidGpsGift       = false;
             MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             MultiInvitationReceiveWindow.SetBadge(false);
             MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus = 0;
         }
         if (jsonObject.body != null && jsonObject.body.pubinfo != null)
         {
             LoginNewsInfo.SetPubInfo(jsonObject.body.pubinfo);
         }
         this._Success();
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <BattleCore.Json_BattleCont> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_BattleCont> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnFailed();
         }
         else
         {
             GlobalVars.MultiPlayBattleCont = jsonObject.body;
             PlayerData.EDeserializeFlags flag = (PlayerData.EDeserializeFlags)(0 | 2);
             if (!MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player, flag))
             {
                 this.OnFailed();
             }
             else
             {
                 Network.RemoveAPI();
                 AnalyticsManager.TrackSpendCoin("ContinueMultiQuest", (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ContinueCoinCostMulti);
                 this.Success();
             }
         }
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.QR_OutOfPeriod:
                case Network.EErrCode.QR_InvalidQRSerial:
                case Network.EErrCode.QR_CanNotReward:
                case Network.EErrCode.QR_LockSerialCampaign:
                case Network.EErrCode.QR_AlreadyRewardSkin:
                    Network.RemoveAPI();
                    Network.ResetError();
                    this.Finished(Network.ErrMsg);
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqQRCodeAccess.JSON_QRCodeAccess> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqQRCodeAccess.JSON_QRCodeAccess> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body.items != null)
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
                }
                this.Finished(jsonObject.body.message);
            }
        }
示例#17
0
        public override void OnSuccess(WWWResult www)
        {
            if (TowerErrorHandle.Error((FlowNode_Network)this))
            {
                return;
            }
            WebAPI.JSON_BodyResponse <FlowNode_ReqTowerRecover.JSON_ReqTowerRecoverResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqTowerRecover.JSON_ReqTowerRecoverResponse> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            Network.RemoveAPI();
            GameManager instance = MonoSingleton <GameManager> .Instance;

            try
            {
                instance.Deserialize(jsonObject.body.player);
                instance.TowerResuponse.Deserialize(jsonObject.body.pdeck);
                instance.TowerResuponse.rtime       = (long)jsonObject.body.rtime;
                instance.TowerResuponse.recover_num = jsonObject.body.rcv_num;
            }
            catch (Exception ex)
            {
                DebugUtility.LogException(ex);
                return;
            }
            this.Success();
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.NoUnitParty:
                case Network.EErrCode.IllegalParty:
                    this.OnFailed();
                    break;

                default:
                    FlowNode_Network.Retry();
                    break;
                }
            }
            WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
            GameManager instance = MonoSingleton <GameManager> .Instance;

            try
            {
                if (jsonObject.body == null)
                {
                    throw new InvalidJSONException();
                }
                instance.Deserialize(jsonObject.body.player);
                instance.Deserialize(jsonObject.body.parties);
            }
            catch (Exception ex)
            {
                FlowNode_Network.Retry();
                return;
            }
            Json_Party[] parties = jsonObject.body.parties;
            if (parties != null && parties.Length > 0)
            {
                Json_Party json = parties[0];
                for (int index1 = 0; index1 < 11; ++index1)
                {
                    int num = index1;
                    if (index1 != 9)
                    {
                        PartyData party = new PartyData((PlayerPartyTypes)num);
                        party.Deserialize(json);
                        PartyWindow2.EditPartyTypes editPartyType = ((PlayerPartyTypes)num).ToEditPartyType();
                        List <PartyEditData>        teams         = new List <PartyEditData>();
                        int maxTeamCount = editPartyType.GetMaxTeamCount();
                        for (int index2 = 0; index2 < maxTeamCount; ++index2)
                        {
                            PartyEditData partyEditData = new PartyEditData(PartyUtility.CreateDefaultPartyNameFromIndex(index2), party);
                            teams.Add(partyEditData);
                        }
                        PartyUtility.SaveTeamPresets(editPartyType, 0, teams, false);
                    }
                }
            }
            Network.RemoveAPI();
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(10);
        }
示例#19
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ArenaPlayers> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ArenaPlayers> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             ((Behaviour)this).set_enabled(false);
             GameManager instance = MonoSingleton <GameManager> .Instance;
             if (!instance.Deserialize(jsonObject.body))
             {
                 this.OnFailed();
             }
             else
             {
                 Network.RemoveAPI();
                 instance.Player.UpdateArenaRankTrophyStates(-1, -1);
                 this.Success();
             }
         }
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_QuestList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_QuestList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         try
         {
             MonoSingleton <GameManager> .Instance.Deserialize(GameUtility.Config_Language, jsonObject.body);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             this.Failure();
             return;
         }
         this.Success();
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         if (Network.ErrCode == Network.EErrCode.CountLimitForPlayer)
         {
             Network.RemoveAPI();
             Network.ResetError();
             this.Success();
         }
         else
         {
             this.OnBack();
         }
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_GoogleReview> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_GoogleReview> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         try
         {
             MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             this.Failure();
             return;
         }
         this.Success();
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (TowerErrorHandle.Error((FlowNode_Network)this))
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            Network.RemoveAPI();
            this.rtime = jsonObject.body.rtime;
            Json_PlayerData json = new Json_PlayerData();

            json.coin      = new Json_Coin();
            json.coin.free = jsonObject.body.coin.free;
            json.coin.paid = jsonObject.body.coin.paid;
            json.coin.com  = jsonObject.body.coin.com;
            this.round     = jsonObject.body.round;
            if (jsonObject.body.rank != null)
            {
                towerResuponse.speedRank = jsonObject.body.rank.spd_rank;
                towerResuponse.techRank  = jsonObject.body.rank.tec_rank;
                towerResuponse.spd_score = jsonObject.body.rank.spd_score;
                towerResuponse.tec_score = jsonObject.body.rank.tec_score;
                towerResuponse.ret_score = jsonObject.body.rank.ret_score;
                towerResuponse.rcv_score = jsonObject.body.rank.rcv_score;
            }
            MonoSingleton <GameManager> .Instance.Player.Deserialize(json, PlayerData.EDeserializeFlags.Coin);

            GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_COIN);
            GlobalVars.SelectedQuestID = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(MonoSingleton <GameManager> .Instance.TowerResuponse.TowerID).iname;

            this.Success();
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                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.Success();
            }
        }
示例#24
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardFavorite.Json_ConceptCardFavorite> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardFavorite.Json_ConceptCardFavorite> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         try
         {
             MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.concept_card);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             return;
         }
         this.ActivateOutputLinks(this.mOutPutPinId);
         ((Behaviour)this).set_enabled(false);
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         if (Network.ErrCode != Network.EErrCode.ChatMaintenance)
         {
             return;
         }
         this.ChatMaintenance();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ChatBlackList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ChatBlackList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         ChatBlackList chatBlackList = new ChatBlackList();
         chatBlackList.Deserialize(jsonObject.body);
         if (chatBlackList == null)
         {
             return;
         }
         BlackList componentInChildren = (BlackList)((Component)this).GetComponentInChildren <BlackList>();
         if (Object.op_Inequality((Object)componentInChildren, (Object)null))
         {
             componentInChildren.BList = chatBlackList;
         }
         this.Success();
     }
 }
示例#26
0
        private void ResponseCallback(WWWResult www)
        {
            if (FlowNode_Network.HasCommonError(www))
            {
                return;
            }
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.BattleRecordMaintenance:
                case Network.EErrCode.RecordLimitUpload:
                    Network.RemoveAPI();
                    Network.ResetError();
                    this.EnableErrorText(LocalizedText.Get("sys.PARTYEDITOR_RECENT_CLEARED_PARTY_ERROR_UPLOAD_LIMIT_2"));
                    this.DisableUnnecessaryUIOnError();
                    break;

                default:
                    FlowNode_Network.Retry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <RecentPartyList.JSON_Body> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <RecentPartyList.JSON_Body> >(www.text);
                this.mLastRecords = jsonObject.body.list;
                this.mMaxPage     = jsonObject.body.option.totalPage;
                Network.RemoveAPI();
                this.Refresh();
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.ContinueCostShort:
                    this.OnBack();
                    break;

                case Network.EErrCode.CantContinue:
                    this.OnFailed();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    this.mOnSuccessDelegate(jsonObject.body);
                }
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.BattleRecordMaintenance:
                    Network.RemoveAPI();
                    Network.ResetError();
                    this.ActivateOutputLinks(102);
                    break;

                case Network.EErrCode.RecordLimitUpload:
                    Network.RemoveAPI();
                    Network.ResetError();
                    this.ActivateOutputLinks(103);
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                GlobalVars.PartyUploadFinished = true;
                Network.RemoveAPI();
                this.Success();
            }
        }
示例#29
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ShopLineup> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopLineup> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (Object.op_Equality((Object)this.Target, (Object)null))
             {
                 return;
             }
             ShopLineupWindow component = (ShopLineupWindow)this.Target.GetComponent <ShopLineupWindow>();
             if (Object.op_Equality((Object)component, (Object)null))
             {
                 return;
             }
             component.SetItemInames(jsonObject.body.shopitems);
             this.Success();
         }
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ChatChannel> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ChatChannel> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         ChatChannel chatChannel = new ChatChannel();
         chatChannel.Deserialize(jsonObject.body);
         if (chatChannel == null)
         {
             return;
         }
         ChatChannelWindow component = (ChatChannelWindow)((Component)this).get_gameObject().GetComponent <ChatChannelWindow>();
         if (Object.op_Inequality((Object)component, (Object)null))
         {
             component.Channel = chatChannel;
         }
         this.Success();
     }
 }