Exemplo n.º 1
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                this.OnRetry();
            }
            else
            {
                if (this.mode == FlowNode_ReqCoinShop.Mode.GetShopList)
                {
                    WebAPI.JSON_BodyResponse <JSON_ShopListArray> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ShopListArray> >(www.text);
                    Network.RemoveAPI();
                    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;
                            }
                        }
                        foreach (JSON_ShopListArray.Shops shop in jsonObject.body.shops)
                        {
                            if (shop.gname.Split('-')[0] == "EventSummon2")
                            {
                                MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

                                EventShopInfo eventShopInfo = new EventShopInfo();
                                eventShopInfo.shops = shop;
                                Json_ShopMsgResponse msg = EventShopList.ParseMsg(shop);
                                if (msg != null)
                                {
                                    eventShopInfo.banner_sprite   = msg.banner;
                                    eventShopInfo.shop_cost_iname = msg.costiname;
                                    if (msg.update != null)
                                    {
                                        eventShopInfo.btn_update = msg.update.Equals("on");
                                    }
                                    GlobalVars.EventShopItem = eventShopInfo;
                                    GlobalVars.ShopType      = EShopType.Event;
                                    this.mode = FlowNode_ReqCoinShop.Mode.GetCoinNum;
                                    this.ExecRequest((WebAPI) new ReqGetCoinNum(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                                    return;
                                }
                            }
                        }
                    }
                }
                else if (this.mode == FlowNode_ReqCoinShop.Mode.GetCoinNum)
                {
                    WebAPI.JSON_BodyResponse <FlowNode_ReqCoinShop.JSON_CoinNum> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqCoinShop.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.ActivateOutputLinks(1);
                    return;
                }
                this.ActivateOutputLinks(2);
            }
        }
Exemplo n.º 2
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_PendingGachaResponse> res = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PendingGachaResponse> >(www.text);
         DebugUtility.Assert(res != null, "res == null");
         Network.RemoveAPI();
         if (res.body == null)
         {
             return;
         }
         List <GachaDropData> gachaDropDataList = new List <GachaDropData>();
         foreach (Json_DropInfo json in res.body.add)
         {
             GachaDropData gachaDropData = new GachaDropData();
             if (gachaDropData.Deserialize(json))
             {
                 gachaDropDataList.Add(gachaDropData);
             }
         }
         List <GachaDropData> a_dropMails = new List <GachaDropData>();
         if (res.body.add_mail != null)
         {
             foreach (Json_DropInfo json in res.body.add_mail)
             {
                 GachaDropData gachaDropData = new GachaDropData();
                 if (gachaDropData.Deserialize(json))
                 {
                     a_dropMails.Add(gachaDropData);
                 }
             }
         }
         for (int index = 0; index < gachaDropDataList.Count; ++index)
         {
             if (gachaDropDataList[index].type == GachaDropData.Type.ConceptCard)
             {
                 GlobalVars.IsDirtyConceptCardData.Set(true);
                 break;
             }
         }
         GachaReceiptData a_receipt = new GachaReceiptData();
         a_receipt.iname = res.body.gacha.gname;
         int a_redraw_rest = 0;
         if (res.body.rest > 0)
         {
             a_redraw_rest = res.body.rest;
         }
         GachaResultData.Init(gachaDropDataList, a_dropMails, (List <int>)null, a_receipt, false, a_redraw_rest <= 0 ? 0 : 1, a_redraw_rest);
         bool flag = false;
         if ((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L)
         {
             string empty = string.Empty;
             if (a_redraw_rest > 0)
             {
                 if (res.body.gacha.time_end > Network.GetServerTime())
                 {
                     flag = true;
                 }
                 else
                 {
                     empty = LocalizedText.Get("sys.GACHA_REDRAW_CAUTION_OUTOF_PERIOD");
                 }
             }
             else
             {
                 empty = LocalizedText.Get("sys.GACHA_REDRAW_CAUTION_LIMIT_UPPER");
             }
             if (!flag)
             {
                 UIUtility.SystemMessage(empty, (UIUtility.DialogResultEvent)(go => this.ExecGacha(res.body.gacha.gname)), (GameObject)null, true, -1);
                 return;
             }
         }
         this.StartCoroutine(this.AsyncGachaResultData(gachaDropDataList));
     }
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitation.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitation.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MultiInvitationReceiveWindow instance = MultiInvitationReceiveWindow.instance;
             if (instance != null)
             {
                 instance.DeserializeActiveList(jsonObject.body);
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
        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();
        }
Exemplo n.º 5
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null)
         {
             MultiInvitationReceiveWindow instance = MultiInvitationReceiveWindow.instance;
             if (instance != null)
             {
                 instance.DeserializeLogList(this.m_Page, jsonBodyResponse.body);
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemplo n.º 6
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_BtlComOpen.JSON_BtlComOpenResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_BtlComOpen.JSON_BtlComOpenResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         GameManager instance = MonoSingleton <GameManager> .Instance;
         try
         {
             instance.Deserialize(jsonObject.body.items);
             instance.Deserialize(jsonObject.body.quests);
         }
         catch (Exception ex)
         {
             this.Failure();
             return;
         }
         this.Success();
     }
 }
Exemplo n.º 7
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.NoGacha:
                    this.OnFailed();
                    break;

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

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

                case Network.EErrCode.GachaPaidLimitOver:
                    this.PaidGachaLimitOver();
                    break;

                default:
                    if (errCode == Network.EErrCode.GachaOutofPeriod)
                    {
                        this.OutofPeriod();
                        break;
                    }
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_GachaResult> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_GachaResult> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                ItemData itemDataByItemId1 = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID("IT_US_SUMMONS_01");

                int num1 = itemDataByItemId1 != null ? itemDataByItemId1.Num : 0;
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    this.Failure();
                    return;
                }
                ItemData itemDataByItemId2 = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID("IT_US_SUMMONS_01");

                int        num2          = itemDataByItemId2 != null ? itemDataByItemId2.Num : 0;
                List <int> a_summonCoins = new List <int>();
                a_summonCoins.Add(num1);
                a_summonCoins.Add(num2);
                List <GachaDropData> gachaDropDataList = new List <GachaDropData>();
                if (jsonObject.body.add != null && jsonObject.body.add.Length > 0)
                {
                    foreach (Json_DropInfo json in jsonObject.body.add)
                    {
                        GachaDropData gachaDropData = new GachaDropData();
                        if (gachaDropData.Deserialize(json))
                        {
                            gachaDropDataList.Add(gachaDropData);
                        }
                    }
                }
                List <GachaDropData> a_dropMails = new List <GachaDropData>();
                if (jsonObject.body.add_mail != null)
                {
                    foreach (Json_DropInfo json in jsonObject.body.add_mail)
                    {
                        GachaDropData gachaDropData = new GachaDropData();
                        if (gachaDropData.Deserialize(json))
                        {
                            a_dropMails.Add(gachaDropData);
                        }
                    }
                }
                for (int index = 0; index < gachaDropDataList.Count; ++index)
                {
                    if (gachaDropDataList[index].type == GachaDropData.Type.ConceptCard)
                    {
                        GlobalVars.IsDirtyConceptCardData.Set(true);
                        break;
                    }
                }
                GachaReceiptData a_receipt = new GachaReceiptData();
                a_receipt.Deserialize(jsonObject.body.receipt);
                GachaResultData.Init(gachaDropDataList, a_dropMails, a_summonCoins, a_receipt, this.mUseOneMore, jsonObject.body.is_pending, jsonObject.body.rest);
                if (!GachaResultData.IsRedrawGacha || GachaResultData.IsRedrawGacha && this.API == FlowNode_ExecGacha2.ExecType.DECISION)
                {
                    MyMetaps.TrackSpend(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(a_receipt.type), a_receipt.iname, a_receipt.val);
                    MonoSingleton <GameManager> .Instance.Player.OnGacha(this.mCurrentGachaType, gachaDropDataList.Count);
                }
                if (this.API == FlowNode_ExecGacha2.ExecType.DECISION)
                {
                    FlowNode_Variable.Set("REDRAW_GACHA_PENDING", string.Empty);
                    GachaResultData.Reset();
                    this.Success();
                }
                else
                {
                    this.StartCoroutine(this.AsyncGachaResultData(gachaDropDataList));
                }
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            DebugUtility.Log(nameof(OnSuccess));
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                case Network.EErrCode.MultiVersionMaintenance:
                case Network.EErrCode.MultiTowerMaintenance:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(6000);
                    break;

                case Network.EErrCode.MultiVersionMismatch:
                case Network.EErrCode.VS_Version:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(5000);
                    break;

                default:
                    this.OnFailed();
                    break;
                }
            }
            else if (this.mReqType == FlowNode_ReqRankMatchReward.ReqType.Status)
            {
                WebAPI.JSON_BodyResponse <ReqRankMatchStatus.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqRankMatchStatus.Response> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnFailed();
                }
                else
                {
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    if (jsonObject.body.RankingStatus == ReqRankMatchStatus.RankingStatus.Rewarding)
                    {
                        this.mReqType = FlowNode_ReqRankMatchReward.ReqType.Reward;
                        this.ExecRequest((WebAPI) new ReqRankMatchReward(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                    }
                    else
                    {
                        this.ActivateOutputLinks(2);
                    }
                }
            }
            else
            {
                if (this.mReqType != FlowNode_ReqRankMatchReward.ReqType.Reward)
                {
                    return;
                }
                WebAPI.JSON_BodyResponse <ReqRankMatchReward.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqRankMatchReward.Response> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnFailed();
                }
                else
                {
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    PlayerPrefsUtility.SetInt(PlayerPrefsUtility.RANKMATCH_SEASON_REWARD_RECEIVE_DATE, this.mToDay, false);
                    if (jsonObject.body.rank == 0)
                    {
                        this.ActivateOutputLinks(2);
                    }
                    else
                    {
                        GameManager instance = MonoSingleton <GameManager> .Instance;
                        instance.Player.mRankMatchSeasonResult.Deserialize(jsonObject.body);
                        GlobalVars.RankMatchSeasonReward.Clear();
                        GlobalVars.RankMatchSeasonReward.Add(instance.GetVersusRankClassRewardList(jsonObject.body.reward.ranking));
                        GlobalVars.RankMatchSeasonReward.Add(instance.GetVersusRankClassRewardList(jsonObject.body.reward.type));
                        this.ActivateOutputLinks(1);
                    }
                }
            }
        }
Exemplo n.º 9
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

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

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

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

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

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

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

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

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

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    if (jsonObject.body.is_rehash != 0)
                    {
                        GlobalVars.BtlID.Set(jsonObject.body.btlid);
                        UIUtility.SystemMessage(string.Empty, LocalizedText.Get("sys.FAILED_RESUMEQUEST"), (UIUtility.DialogResultEvent)(go =>
                        {
                            CriticalSection.Leave(CriticalSections.SceneChange);
                            this.ActivateOutputLinks(800);
                        }), (GameObject)null, false, -1);
                    }
                    else
                    {
                        this.ActivateOutputLinks(5);
                        this.SetVersusAudienceParam(text);
                        this.StartCoroutine(this.StartScene(jsonObject.body));
                    }
                }
            }
        }
Exemplo n.º 10
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.Player.ResetQuestChallenges();
             instance.ResetJigenQuests(true);
             if (!instance.Deserialize(jsonObject.body.quests))
             {
                 this.OnFailed();
             }
             else
             {
                 if (instance.IsRelogin)
                 {
                     instance.Player.DeleteTrophies(jsonObject.body.trophyprogs);
                     instance.Player.DeleteTrophies(jsonObject.body.bingoprogs);
                 }
                 this.reflectTrophyProgs(jsonObject.body.trophyprogs);
                 this.reflectTrophyProgs(jsonObject.body.bingoprogs);
                 this.reflectLoginTrophyProgs();
                 if (jsonObject.body.channel != 0)
                 {
                     GlobalVars.CurrentChatChannel.Set(jsonObject.body.channel);
                 }
                 if (jsonObject.body.support != 0L)
                 {
                     GlobalVars.SelectedSupportUnitUniqueID.Set(jsonObject.body.support);
                 }
                 FlowNode_Variable.Set("SHOW_CHAPTER", "0");
                 Network.RemoveAPI();
                 instance.Player.OnLogin();
                 instance.IsRelogin = false;
                 this.Success();
             }
         }
     }
 }
Exemplo n.º 11
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.RankingQuestMaintenance:
                case Network.EErrCode.RankingQuest_OutOfPeriod:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(102);
                    break;

                case Network.EErrCode.RankingQuest_NotNewScore:
                case Network.EErrCode.RankingQuest_AlreadyEntry:
                    this.OnFailed();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    GlobalVars.UserSelectionPartyData  selectionPartyData = new GlobalVars.UserSelectionPartyData();
                    FlowNode_ReqQuestRankingParty.Json body = jsonObject.body;
                    if (body.party != null)
                    {
                        UnitData[] unitDataArray = new UnitData[((IEnumerable <Json_Unit>)body.party).Count <Json_Unit>((Func <Json_Unit, bool>)(j => j != null))];
                        for (int index = 0; index < unitDataArray.Length; ++index)
                        {
                            if (string.IsNullOrEmpty(body.party[index].iname))
                            {
                                unitDataArray[index] = (UnitData)null;
                            }
                            else
                            {
                                unitDataArray[index] = new UnitData();
                                unitDataArray[index].Deserialize(body.party[index]);
                            }
                        }
                        selectionPartyData.unitData = unitDataArray;
                    }
                    if (body.items != null)
                    {
                        ItemData[] itemDataArray = new ItemData[body.items.Length];
                        for (int index = 0; index < itemDataArray.Length; ++index)
                        {
                            itemDataArray[index] = new ItemData();
                            itemDataArray[index].Setup(0L, body.items[index].iname, body.items[index].num);
                        }
                        selectionPartyData.usedItems = itemDataArray;
                    }
                    if (body.help != null)
                    {
                        SupportData supportData = new SupportData();
                        supportData.Deserialize(body.help);
                        selectionPartyData.supportData = supportData;
                    }
                    selectionPartyData.achievements       = new int[0];
                    GlobalVars.UserSelectionPartyDataInfo = selectionPartyData;
                    this.Success();
                }
            }
        }
Exemplo n.º 12
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardTrustMaster.Json_ConceptCardTrustMaster> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardTrustMaster.Json_ConceptCardTrustMaster> >(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);
     }
 }
Exemplo n.º 13
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqSupportList.Api_SupportList.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqSupportList.Api_SupportList.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqSupportList.Api_SupportList.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null)
         {
             FlowNode_ReqSupportList.SupportList supportList = new FlowNode_ReqSupportList.SupportList(this.m_Element);
             supportList.Deserialize(jsonBodyResponse.body.supports);
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Node.m_Window, (UnityEngine.Object)null) && this.m_Node.m_Window.rootWindow != null)
             {
                 this.m_Node.m_Window.rootWindow.AddData("data_supportres", (object)supportList);
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemplo n.º 14
0
        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();
                if (jsonObject.body == null)
                {
                    ((Behaviour)this).set_enabled(false);
                    PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV, 0, false);
                    PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV, 0, false);
                    MonoSingleton <GameManager> .Instance.Player.ClearTrophies();

                    this.ActivateOutputLinks(1);
                }
                else
                {
                    GlobalVars.CustomerID = jsonObject.body.cuid;
                    int status = jsonObject.body.status;
                    if (status != 0)
                    {
                        GlobalVars.BanStatus = jsonObject.body.status;
                        if (status == 1)
                        {
                            this.ActivateOutputLinks(5);
                        }
                        else if (jsonObject.body.status > 1)
                        {
                            this.ActivateOutputLinks(6);
                        }
                        ((Behaviour)this).set_enabled(false);
                    }
                    else
                    {
                        GameManager instance           = MonoSingleton <GameManager> .Instance;
                        long        lastConnectionTime = Network.LastConnectionTime;
                        instance.Player.LoginDate     = TimeManager.FromUnixTime(lastConnectionTime);
                        instance.Player.TutorialFlags = jsonObject.body.tut;
                        if (instance.IsRelogin)
                        {
                            try
                            {
                                if (jsonObject.body.player != null)
                                {
                                    instance.Deserialize(jsonObject.body.player);
                                }
                                if (jsonObject.body.items != null)
                                {
                                    instance.Deserialize(jsonObject.body.items);
                                }
                                if (jsonObject.body.units != null)
                                {
                                    instance.Deserialize(jsonObject.body.units);
                                }
                                if (jsonObject.body.parties != null)
                                {
                                    instance.Deserialize(jsonObject.body.parties);
                                }
                                if (jsonObject.body.notify != null)
                                {
                                    instance.Deserialize(jsonObject.body.notify);
                                }
                                if (jsonObject.body.artifacts != null)
                                {
                                    instance.Deserialize(jsonObject.body.artifacts, false);
                                }
                                if (jsonObject.body.skins != null)
                                {
                                    instance.Deserialize(jsonObject.body.skins);
                                }
                                if (jsonObject.body.vs != null)
                                {
                                    instance.Deserialize(jsonObject.body.vs);
                                }
                            }
                            catch (Exception ex)
                            {
                                DebugUtility.LogException(ex);
                                this.Failure();
                                return;
                            }
                        }
                        else
                        {
                            try
                            {
                                instance.Deserialize(jsonObject.body.player);
                                instance.Deserialize(jsonObject.body.items);
                                instance.Deserialize(jsonObject.body.units);
                                instance.Deserialize(jsonObject.body.parties);
                                instance.Deserialize(jsonObject.body.notify);
                                instance.Deserialize(jsonObject.body.artifacts, false);
                                instance.Deserialize(jsonObject.body.skins);
                                instance.Deserialize(jsonObject.body.vs);
                            }
                            catch (Exception ex)
                            {
                                DebugUtility.LogException(ex);
                                this.Failure();
                                return;
                            }
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this, (UnityEngine.Object)null))
                        {
                            ((Behaviour)this).set_enabled(false);
                        }
                        GlobalVars.BtlID.Set(jsonObject.body.player.btlid);
                        if (!string.IsNullOrEmpty(jsonObject.body.player.btltype))
                        {
                            GlobalVars.QuestType = QuestParam.ToQuestType(jsonObject.body.player.btltype);
                        }
                        GameUtility.Config_OkyakusamaCode = instance.Player.OkyakusamaCode;
                        if (!PlayerPrefsUtility.HasKey(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV))
                        {
                            PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV, MonoSingleton <GameManager> .Instance.Player.Lv, false);
                        }
                        if (!PlayerPrefsUtility.HasKey(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV))
                        {
                            PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV, MonoSingleton <GameManager> .Instance.Player.VipRank, false);
                        }
                        instance.PostLogin();
                        if (MonoSingleton <GameManager> .Instance.Player == null)
                        {
                            ;
                        }
                        this.ActivateOutputLinks(!string.IsNullOrEmpty(jsonObject.body.player.name) ? 3 : 2);
                    }
                }
            }
        }
Exemplo n.º 15
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         if (Network.ErrCode == Network.EErrCode.NotGpsQuest)
         {
             Network.RemoveAPI();
             Network.ResetError();
             this.SuccessNotQuest();
         }
         else
         {
             this.OnRetry();
         }
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqBtlComGps.JSON_ReqBtlComGpsResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqBtlComGps.JSON_ReqBtlComGpsResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         GameManager instance = MonoSingleton <GameManager> .Instance;
         instance.ResetGpsQuests();
         if (jsonObject.body.quests == null || jsonObject.body.quests.Length == 0)
         {
             this.SuccessNotQuest();
         }
         else if (!instance.DeserializeGps(jsonObject.body.quests))
         {
             this.Failure();
         }
         else
         {
             this.Success();
         }
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardSell.Json_ConceptCardSell> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardSell.Json_ConceptCardSell> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                    MonoSingleton <GameManager> .Instance.Player.RemoveConceptCardData(jsonObject.body.sell_ids);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                MonoSingleton <GameManager> .Instance.Player.OnGoldChange(this.totalSellZeny);

                this.ActivateOutputLinks(100);
                ((Behaviour)this).set_enabled(false);
            }
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_TrophyResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_TrophyResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else if (jsonObject.body.trophyprogs == null)
         {
             Network.RemoveAPI();
             this.Success();
         }
         else
         {
             GameManager instance = MonoSingleton <GameManager> .Instance;
             for (int index1 = 0; index1 < jsonObject.body.trophyprogs.Length; ++index1)
             {
                 JSON_TrophyProgress trophyprog = jsonObject.body.trophyprogs[index1];
                 if (trophyprog != null)
                 {
                     if (instance.MasterParam.GetTrophy(trophyprog.iname) == null)
                     {
                         DebugUtility.LogError("存在しないミッション:" + trophyprog.iname);
                     }
                     else
                     {
                         TrophyState trophyCounter = instance.Player.GetTrophyCounter(instance.MasterParam.GetTrophy(trophyprog.iname));
                         for (int index2 = 0; index2 < trophyprog.pts.Length && index2 < trophyCounter.Count.Length; ++index2)
                         {
                             trophyCounter.Count[index2] = trophyprog.pts[index2];
                         }
                         trophyCounter.StartYMD = trophyprog.ymd;
                         trophyCounter.IsEnded  = trophyprog.rewarded_at != 0;
                         if (trophyprog.rewarded_at != 0)
                         {
                             try
                             {
                                 trophyCounter.RewardedAt = trophyprog.rewarded_at.FromYMD();
                             }
                             catch
                             {
                                 trophyCounter.RewardedAt = DateTime.MinValue;
                             }
                         }
                         else
                         {
                             trophyCounter.RewardedAt = DateTime.MinValue;
                         }
                     }
                 }
             }
             Network.RemoveAPI();
             this.Success();
         }
     }
 }
Exemplo n.º 18
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                GlobalVars.UnitGetReward = (UnitGetParam)null;
                switch (Network.ErrCode)
                {
                case Network.EErrCode.NoMail:
                    this.OnBack();
                    break;

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

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

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReadMail2.Json_MailRead> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReadMail2.Json_MailRead> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

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

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

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

                    if (jsonObject.body.artifacts != null)
                    {
                        MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.artifacts, true);
                    }
                    if (jsonObject.body.mails != null)
                    {
                        GlobalVars.ConceptCardNum.Set(jsonObject.body.mails.concept_count);
                    }
                    if (jsonObject.body.processed != null)
                    {
                        if (jsonObject.body.processed.Length > 0)
                        {
                            MailData[] mail_datas = new MailData[jsonObject.body.processed.Length];
                            for (int index1 = 0; index1 < mail_datas.Length; ++index1)
                            {
                                mail_datas[index1] = new MailData();
                                mail_datas[index1].Deserialize(jsonObject.body.processed[index1]);
                                if (mail_datas[index1].Contains(GiftTypes.ConceptCard))
                                {
                                    GlobalVars.IsDirtyConceptCardData.Set(true);
                                    for (int index2 = 0; index2 < mail_datas[index1].gifts.Length; ++index2)
                                    {
                                        string conceptCardIname = mail_datas[index1].gifts[index2].ConceptCardIname;
                                        if (mail_datas[index1].gifts[index2].IsGetConceptCardUnit)
                                        {
                                            FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(conceptCardIname));
                                        }
                                    }
                                }
                            }
                            this.SetRewordData(mail_datas);
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobalVars.UnitGetReward = (UnitGetParam)null;
                    DebugUtility.LogException(ex);
                    return;
                }
                if (GlobalVars.LastReward != null && GlobalVars.LastReward.Get() != null)
                {
                    MonoSingleton <GameManager> .Instance.Player.OnGoldChange(GlobalVars.LastReward.Get().Gold);
                }
                ((Behaviour)this).set_enabled(false);
                this.Success();
            }
        }
Exemplo n.º 19
0
        public override void OnSuccess(WWWResult www)
        {
            DebugUtility.Log(nameof(OnSuccess));
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                case Network.EErrCode.MultiVersionMaintenance:
                case Network.EErrCode.MultiTowerMaintenance:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(6000);
                    break;

                case Network.EErrCode.OutOfDateQuest:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(4802);
                    break;

                case Network.EErrCode.MultiVersionMismatch:
                case Network.EErrCode.VS_Version:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(5000);
                    break;

                case Network.EErrCode.RoomFailedMakeRoom:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(4800);
                    break;

                case Network.EErrCode.RoomIllegalComment:
                case Network.EErrCode.VS_IllComment:
                    if (this.API == FlowNode_MultiPlayAPI.EAPI.MAKE)
                    {
                        string str = LocalizedText.Get("sys.DEFAULT_ROOM_COMMENT");
                        PlayerPrefsUtility.SetString(PlayerPrefsUtility.ROOM_COMMENT_KEY, str, false);
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(4801);
                    break;

                case Network.EErrCode.RoomNoRoom:
                case Network.EErrCode.VS_NoRoom:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(4900);
                    break;

                case Network.EErrCode.VS_NotLINERoomInfo:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(7000);
                    break;

                case Network.EErrCode.VS_FailRoomID:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(8000);
                    break;

                case Network.EErrCode.VS_NotPhotonAppID:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(9000);
                    break;

                case Network.EErrCode.VS_FaildSeasonGift:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(10000);
                    break;

                default:
                    this.OnFailed();
                    break;
                }
            }
            else
            {
                if (this.API == FlowNode_MultiPlayAPI.EAPI.MAKE)
                {
                    WebAPI.JSON_BodyResponse <ReqMPRoomMake.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMPRoomMake.Response> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnFailed();
                        return;
                    }
                    GlobalVars.SelectedMultiPlayRoomID      = jsonObject.body.roomid;
                    GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                    GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                    DebugUtility.Log("MakeRoom RoomID:" + (object)GlobalVars.SelectedMultiPlayRoomID + " AppID:" + GlobalVars.SelectedMultiPlayPhotonAppID + " Name:" + GlobalVars.SelectedMultiPlayRoomName);
                }
                else if (this.API == FlowNode_MultiPlayAPI.EAPI.ROOM)
                {
                    WebAPI.JSON_BodyResponse <ReqMPRoom.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMPRoom.Response> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnFailed();
                        return;
                    }
                    FlowNode_MultiPlayAPI.RoomList = jsonObject.body;
                    if (FlowNode_MultiPlayAPI.RoomList == null)
                    {
                        DebugUtility.Log("ListRoom null");
                    }
                    else if (FlowNode_MultiPlayAPI.RoomList.rooms == null)
                    {
                        DebugUtility.Log("ListRoom rooms null");
                    }
                    else
                    {
                        DebugUtility.Log("ListRoom num:" + (object)FlowNode_MultiPlayAPI.RoomList.rooms.Length);
                    }
                }
                else if (this.API == FlowNode_MultiPlayAPI.EAPI.JOIN)
                {
                    WebAPI.JSON_BodyResponse <ReqMPRoomJoin.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMPRoomJoin.Response> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnFailed();
                        return;
                    }
                    if (jsonObject.body.quest == null || string.IsNullOrEmpty(jsonObject.body.quest.iname))
                    {
                        this.OnFailed();
                        return;
                    }
                    GlobalVars.SelectedQuestID = jsonObject.body.quest.iname;
                    GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                    GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                    DebugUtility.Log("JoinRoom  AppID:" + GlobalVars.SelectedMultiPlayPhotonAppID + " Name:" + GlobalVars.SelectedMultiPlayRoomName);
                }
                else if (this.API != FlowNode_MultiPlayAPI.EAPI.UPDATE && this.API != FlowNode_MultiPlayAPI.EAPI.VERSION)
                {
                    if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_START)
                    {
                        WebAPI.JSON_BodyResponse <ReqVersusStart.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusStart.Response> >(www.text);
                        DebugUtility.Assert(jsonObject != null, "res == null");
                        if (jsonObject.body == null)
                        {
                            this.OnFailed();
                            return;
                        }
                        GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                        switch (GlobalVars.SelectedMultiPlayVersusType)
                        {
                        case VERSUS_TYPE.Free:
                            GlobalVars.SelectedQuestID = jsonObject.body.maps.free;
                            break;

                        case VERSUS_TYPE.Friend:
                            GlobalVars.SelectedQuestID = jsonObject.body.maps.friend;
                            break;
                        }
                        DebugUtility.Log("MakeRoom RoomID: AppID:" + GlobalVars.SelectedMultiPlayPhotonAppID + "/ QuestID:" + GlobalVars.SelectedQuestID);
                    }
                    else if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_MAKE)
                    {
                        WebAPI.JSON_BodyResponse <ReqVersusMake.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusMake.Response> >(www.text);
                        DebugUtility.Assert(jsonObject != null, "res == null");
                        if (jsonObject.body == null)
                        {
                            this.OnFailed();
                            return;
                        }
                        GlobalVars.SelectedMultiPlayRoomID   = jsonObject.body.roomid;
                        GlobalVars.SelectedMultiPlayRoomName = jsonObject.body.token;
                        if (GlobalVars.SelectedMultiPlayVersusType == VERSUS_TYPE.Friend)
                        {
                            GlobalVars.EditMultiPlayRoomPassCode = "1";
                        }
                    }
                    else if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_JOIN)
                    {
                        WebAPI.JSON_BodyResponse <ReqVersusRoomJoin.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusRoomJoin.Response> >(www.text);
                        DebugUtility.Assert(jsonObject != null, "res == null");
                        if (jsonObject.body == null)
                        {
                            this.OnFailed();
                            return;
                        }
                        if (jsonObject.body.quest == null || string.IsNullOrEmpty(jsonObject.body.quest.iname))
                        {
                            this.OnFailed();
                            return;
                        }
                        GlobalVars.SelectedQuestID = jsonObject.body.quest.iname;
                        GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                        GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                        DebugUtility.Log("JoinRoom  AppID:" + GlobalVars.SelectedMultiPlayPhotonAppID + " Name:" + GlobalVars.SelectedMultiPlayRoomName);
                    }
                    else if (this.API != FlowNode_MultiPlayAPI.EAPI.VERSUS_LINE_REQ && this.API != FlowNode_MultiPlayAPI.EAPI.VERSUS_LINE_MAKE)
                    {
                        if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_STATUS)
                        {
                            WebAPI.JSON_BodyResponse <ReqVersusStatus.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusStatus.Response> >(www.text);
                            if (jsonObject == null)
                            {
                                this.OnFailed();
                                return;
                            }
                            GameManager instance = MonoSingleton <GameManager> .Instance;
                            instance.Player.SetTowerMatchInfo(jsonObject.body.floor, jsonObject.body.key, jsonObject.body.wincnt, jsonObject.body.is_give_season_gift != 0);
                            instance.VersusTowerMatchBegin   = !string.IsNullOrEmpty(jsonObject.body.vstower_id);
                            instance.VersusTowerMatchReceipt = jsonObject.body.is_season_gift != 0;
                            instance.VersusTowerMatchName    = jsonObject.body.tower_iname;
                            instance.VersusTowerMatchEndAt   = jsonObject.body.end_at;
                            instance.VersusCoinRemainCnt     = jsonObject.body.daycnt;
                            instance.VersusLastUid           = jsonObject.body.last_enemyuid;
                            GlobalVars.SelectedQuestID       = jsonObject.body.vstower_id;
                            instance.Player.UpdateVersusTowerTrophyStates(jsonObject.body.tower_iname, jsonObject.body.floor);
                        }
                        else if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_SEASON)
                        {
                            WebAPI.JSON_BodyResponse <ReqVersusSeason.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusSeason.Response> >(www.text);
                            if (jsonObject == null)
                            {
                                this.OnFailed();
                                return;
                            }
                            PlayerData player = MonoSingleton <GameManager> .Instance.Player;
                            player.VersusSeazonGiftReceipt = false;
                            player.UnreadMailPeriod       |= jsonObject.body.unreadmail == 1;
                        }
                        else if (this.API == FlowNode_MultiPlayAPI.EAPI.VERSUS_FRIEND)
                        {
                            WebAPI.JSON_BodyResponse <ReqVersusFriendScore.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusFriendScore.Response> >(www.text);
                            if (jsonObject == null)
                            {
                                this.OnFailed();
                                return;
                            }
                            MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.friends);
                        }
                        else if (this.API == FlowNode_MultiPlayAPI.EAPI.MT_STATUS)
                        {
                            WebAPI.JSON_BodyResponse <ReqMultiTwStatus.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMultiTwStatus.Response> >(www.text);
                            Debug.Log((object)www.text);
                            if (jsonObject == null)
                            {
                                this.OnFailed();
                                return;
                            }
                            GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.appid;
                            MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.floors);
                        }
                        else if (this.API == FlowNode_MultiPlayAPI.EAPI.MT_JOIN)
                        {
                            WebAPI.JSON_BodyResponse <ReqMultiTwRoomJoin.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMultiTwRoomJoin.Response> >(www.text);
                            DebugUtility.Assert(jsonObject != null, "res == null");
                            if (jsonObject.body == null)
                            {
                                this.OnFailed();
                                return;
                            }
                            if (jsonObject.body.quest == null || string.IsNullOrEmpty(jsonObject.body.quest.iname))
                            {
                                this.OnFailed();
                                return;
                            }
                            GameManager instance = MonoSingleton <GameManager> .Instance;
                            if (instance.GetMTChallengeFloor() < jsonObject.body.quest.floor)
                            {
                                Network.RemoveAPI();
                                ((Behaviour)this).set_enabled(false);
                                this.ActivateOutputLinks(11000);
                                return;
                            }
                            GlobalVars.SelectedMultiTowerID         = jsonObject.body.quest.iname;
                            GlobalVars.SelectedMultiTowerFloor      = jsonObject.body.quest.floor;
                            GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                            GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                            MultiTowerFloorParam mtFloorParam = instance.GetMTFloorParam(GlobalVars.SelectedMultiTowerID, GlobalVars.SelectedMultiTowerFloor);
                            if (mtFloorParam != null)
                            {
                                QuestParam questParam = mtFloorParam.GetQuestParam();
                                if (questParam != null)
                                {
                                    GlobalVars.SelectedQuestID = questParam.iname;
                                }
                            }
                            DebugUtility.Log("JoinRoom  AppID:" + GlobalVars.SelectedMultiPlayPhotonAppID + " Name:" + GlobalVars.SelectedMultiPlayRoomName);
                        }
                    }
                }
                Network.RemoveAPI();
                this.Success();
            }
        }
Exemplo n.º 20
0
        public override void OnSuccess(WWWResult www)
        {
            if (this.Error())
            {
                return;
            }
            FlowNode_TowerStartQuest.Json_TowerStartQuest jsonTowerStartQuest = (FlowNode_TowerStartQuest.Json_TowerStartQuest)null;
            WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume>)null;
            if (this.mResume)
            {
                jsonBodyResponse = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> >(www.text);
                if (jsonBodyResponse.body.pdeck != null)
                {
                    MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.pdeck);
                }
                if (jsonBodyResponse.body.edeck != null)
                {
                    MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.edeck);
                }
                jsonTowerStartQuest         = new FlowNode_TowerStartQuest.Json_TowerStartQuest();
                jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
                jsonTowerStartQuest.btlid   = jsonBodyResponse.body.btlid;
                MonoSingleton <GameManager> .Instance.TowerResuponse.round = jsonBodyResponse.body.round;
            }
            WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> >(www.text);
            if (jsonObject.body == null)
            {
                this.OnRetry();
            }
            else
            {
                if (jsonTowerStartQuest == null)
                {
                    jsonTowerStartQuest = jsonObject.body;
                }
                if (this.mResume && jsonBodyResponse == null)
                {
                    jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
                }
                Network.RemoveAPI();
                BattleCore.Json_Battle json = new BattleCore.Json_Battle();
                json.btlid   = jsonTowerStartQuest.btlid;
                json.btlinfo = (BattleCore.Json_BtlInfo)jsonTowerStartQuest.btlinfo;
                if (json.btlinfo != null)
                {
                    json.btlinfo.qid = jsonTowerStartQuest.btlinfo.floor_iname;
                }
                QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(json.btlinfo.qid);

                if (quest != null)
                {
                    if (jsonObject.body.missions != null)
                    {
                        for (int index = 0; index < jsonObject.body.missions.Length; ++index)
                        {
                            bool isClear = jsonObject.body.missions[index] == 1;
                            quest.SetMissionFlag(index, isClear);
                        }
                    }
                    if (jsonObject.body.missions_val != null)
                    {
                        for (int index = 0; index < jsonObject.body.missions_val.Length; ++index)
                        {
                            int num = jsonObject.body.missions_val[index];
                            quest.SetMissionValue(index, num);
                        }
                    }
                }
                this.StartCoroutine(this.StartScene(json));
            }
        }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnBack();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.unit != null)
         {
             UnitData[] unitDataArray = new UnitData[Enum.GetValues(typeof(EElement)).Length];
             if (jsonBodyResponse.body.units != null)
             {
                 for (int index = 0; index < jsonBodyResponse.body.units.Length; ++index)
                 {
                     Json_Unit unit = jsonBodyResponse.body.units[index];
                     int       elem = unit.elem;
                     if (elem >= unitDataArray.Length || elem < 0)
                     {
                         DebugUtility.LogError(string.Format("不正なインデックスが属性値として指定されています。 elem = {0}", (object)elem));
                     }
                     else
                     {
                         unitDataArray[elem] = new UnitData();
                         unitDataArray[elem].Deserialize(unit);
                     }
                 }
             }
             if (jsonBodyResponse.body.unit != null)
             {
                 UnitData unitData = new UnitData();
                 unitData.Deserialize(jsonBodyResponse.body.unit);
                 unitDataArray[0] = unitData;
             }
             this.m_ValueList.SetObject("data_units", (object)unitDataArray);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemplo n.º 22
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.ShopSoldOut:
                case Network.EErrCode.ShopBuyCostShort:
                case Network.EErrCode.ShopBuyLvShort:
                case Network.EErrCode.ShopBuyNotFound:
                case Network.EErrCode.ShopBuyItemNotFound:
                    this.OnBack();
                    break;

                case Network.EErrCode.ShopRefreshItemList:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(121)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                case Network.EErrCode.ShopBuyOutofItemPeriod:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(120)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                case Network.EErrCode.ShopBuyOutofPeriod:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(122)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_EventShopBuyResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_EventShopBuyResponse> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    EventShopData shop = MonoSingleton <GameManager> .Instance.Player.GetEventShopData() ?? new EventShopData();

                    if (!shop.Deserialize(jsonObject.body))
                    {
                        this.OnFailed();
                    }
                    else
                    {
                        MonoSingleton <GameManager> .Instance.Player.SetEventShopData(shop);

                        EventShopItem eventShopItem = shop.items.FirstOrDefault <EventShopItem>((Func <EventShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                        if (jsonObject.body.cards != null && jsonObject.body.cards.Length > 0)
                        {
                            GlobalVars.IsDirtyConceptCardData.Set(true);
                            Json_ShopBuyConceptCard[] cards = jsonObject.body.cards;
                            for (int index = 0; index < cards.Length; ++index)
                            {
                                if (cards[index] != null && cards[index].IsGetConceptCardUnit)
                                {
                                    FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(cards[index].iname));
                                }
                            }
                        }
                        if (eventShopItem.saleValue > 0)
                        {
                            MyMetaps.TrackSpendShop(eventShopItem.saleType, this.mShopType, eventShopItem.saleValue);
                        }
                        this.Success();
                    }
                }
            }
        }
Exemplo n.º 23
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.ColoCantSelect:
                    this.OnBack();
                    break;

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

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

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

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

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

                case Network.EErrCode.ColoRankLower:
label_21:
                    this.OnColoRankModify();
                    break;

                default:
                    switch (errCode - 10000)
                    {
                    case Network.EErrCode.Success:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case (Network.EErrCode) 6:
                        this.OnFailed();
                        return;

                    default:
                        switch (errCode - 10011)
                        {
                        case Network.EErrCode.Success:
                            this.OnFailed();
                            return;

                        case Network.EErrCode.Version:
                            this.OnFailed();
                            return;

                        case (Network.EErrCode) 4:
                            this.OnFailed();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                if (errCode != Network.EErrCode.MultiMaintenance)
                                {
                                    if (errCode != Network.EErrCode.QuestEnd)
                                    {
                                        if (errCode != Network.EErrCode.NoBtlInfo)
                                        {
                                            if (errCode != Network.EErrCode.MultiVersionMismatch)
                                            {
                                                if (errCode != Network.EErrCode.ColoRankModify)
                                                {
                                                    this.OnRetry();
                                                    return;
                                                }
                                                goto label_21;
                                            }
                                            else
                                            {
                                                this.OnMismatchVersion();
                                                return;
                                            }
                                        }
                                        else
                                        {
                                            this.OnFailed();
                                            return;
                                        }
                                    }
                                    else
                                    {
                                        this.OnFailed();
                                        return;
                                    }
                                }
                                else
                                {
                                    this.OnMultiMaintenance();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    this.ActivateOutputLinks(5);
                    if (this.mResume && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L && jsonObject.body.btlinfo.qid == "QE_OP_0002")
                    {
                        MonoSingleton <GameManager> .Instance.CompleteTutorialStep();
                    }
                    this.StartCoroutine(this.StartScene(jsonObject.body));
                }
            }
        }
Exemplo n.º 24
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this._Failed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqFirstChargeState.JSON_FirstChargeState> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqFirstChargeState.JSON_FirstChargeState> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus = jsonObject.body == null ? 0 : jsonObject.body.charge_bonus;
         this._Success();
     }
 }
Exemplo n.º 25
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqUnitFavorite.Api_SetUnitFavorite.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqUnitFavorite.Api_SetUnitFavorite.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null && jsonObject.body.units != null)
         {
             PlayerData player = MonoSingleton <GameManager> .Instance.Player;
             if (player != null)
             {
                 for (int index = 0; index < jsonObject.body.units.Length; ++index)
                 {
                     UnitData unitData = player.GetUnitData(jsonObject.body.units[index].iid);
                     if (unitData != null)
                     {
                         unitData.IsFavorite = jsonObject.body.units[index].fav == 1;
                     }
                 }
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemplo n.º 26
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         bool flag = false;
         if (jsonObject.body != null)
         {
             if (jsonObject.body.player != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);
             }
             if (jsonObject.body.items != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
             }
             if (jsonObject.body.presents != null)
             {
                 RewardData rewardData = new RewardData();
                 for (int index = 0; index < jsonObject.body.presents.Length; ++index)
                 {
                     FlowNode_ReqPresentList.Api_PresentListExec.JsonItem present = jsonObject.body.presents[index];
                     if (present != null)
                     {
                         RewardData dataToRewardData = this.ReceiveDataToRewardData(present);
                         if (dataToRewardData != null)
                         {
                             rewardData.Exp        += dataToRewardData.Exp;
                             rewardData.Stamina    += dataToRewardData.Stamina;
                             rewardData.Coin       += dataToRewardData.Coin;
                             rewardData.Gold       += dataToRewardData.Gold;
                             rewardData.ArenaMedal += dataToRewardData.ArenaMedal;
                             rewardData.MultiCoin  += dataToRewardData.MultiCoin;
                             rewardData.KakeraCoin += dataToRewardData.KakeraCoin;
                             using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataToRewardData.GiftRecieveItemDataDic.Values.GetEnumerator())
                             {
                                 while (enumerator.MoveNext())
                                 {
                                     GiftRecieveItemData current = enumerator.Current;
                                     rewardData.AddReward(current);
                                 }
                             }
                             flag = true;
                         }
                     }
                 }
                 GlobalVars.LastReward.Set(rewardData);
                 if (rewardData != null)
                 {
                     MonoSingleton <GameManager> .Instance.Player.OnGoldChange(rewardData.Gold);
                 }
                 MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             }
         }
         Network.RemoveAPI();
         if (flag)
         {
             this.Success();
         }
         else
         {
             this.Failed();
         }
     }
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         MultiInvitationBadge.isValid = false;
         this.Failed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_NotifyInvitation.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_NotifyInvitation.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MultiInvitationReceiveWindow.SetBadge(jsonObject.body.player != null && jsonObject.body.player.multi_inv != 0);
         }
         else
         {
             MultiInvitationReceiveWindow.SetBadge(false);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemplo n.º 28
0
            public override void Complete(WWWResult www)
            {
                if (Network.IsError)
                {
                    this.m_Node.OnFailed();
                }
                else
                {
                    DebugMenu.Log("API", this.url + ":" + www.text);
                    WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json> >(www.text);
                    DebugUtility.Assert(jsonBodyResponse != null, "res == null");
                    if (jsonBodyResponse.body != null && jsonBodyResponse.body.result && FriendPresentRootWindow.instance != null)
                    {
                        FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDING);
                    }
                    Network.RemoveAPI();
                    MonoSingleton <GameManager> .Instance.ServerSyncTrophyExecEnd(www);

                    this.Success();
                }
            }
Exemplo n.º 29
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

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

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

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

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

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

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

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

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

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    this.ActivateOutputLinks(5);
                    this.SetVersusAudienceParam(text);
                    if (this.mResume && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L && jsonObject.body.btlinfo.qid == "QE_OP_0002")
                    {
                        MonoSingleton <GameManager> .Instance.CompleteTutorialStep();
                    }
                    this.StartCoroutine(this.StartScene(jsonObject.body));
                }
            }
        }
Exemplo n.º 30
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqWishList.Api_WishListSet.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqWishList.Api_WishListSet.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqWishList.Api_WishListSet.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.result)
         {
             MonoSingleton <GameManager> .Instance.Player.SetWishList(this.m_Id, this.m_Priority);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }