Exemplo n.º 1
0
 private void SetError(Network.EErrCode code, string textID)
 {
     Network.ErrCode = code;
     Network.ErrMsg  = LocalizedText.Get(textID);
     Network.ResetError();
     GlobalEvent.Invoke(PredefinedGlobalEvents.ERROR_NETWORK.ToString(), (object)null);
     if (AssetDownloader.mCoroutine != null)
     {
         this.StopCoroutine(AssetDownloader.mCoroutine);
         AssetDownloader.mCoroutine = (Coroutine)null;
     }
     AssetDownloader.mHasError = true;
     if (this.mUnzipThread == null)
     {
         return;
     }
     if (!this.mMutexAcquired)
     {
         this.mMutex.WaitOne();
         this.mMutexAcquired = true;
     }
     if (this.mUnzipThreadArg != null)
     {
         this.mUnzipThreadArg.abort = true;
     }
     this.mMutex.ReleaseMutex();
     this.mMutexAcquired = false;
     this.mUnzipSignal.Set();
     this.mUnzipThread.Join();
     this.mUnzipThread = (Thread)null;
 }
        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);
            }
        }
Exemplo n.º 3
0
 public override void OnSuccess(WWWResult www)
 {
     WebAPI.JSON_BodyResponse <FlowNode_CheckVersion2.Json_VersionInfo> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_CheckVersion2.Json_VersionInfo> >(www.text);
     DebugUtility.Assert(jsonObject != null, "res == null");
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else if (jsonObject.body == null)
     {
         this.OnRetry();
     }
     else
     {
         Network.RemoveAPI();
         if (jsonObject.body.environments == null || jsonObject.body.environments.alchemist == null)
         {
             return;
         }
         if (FlowNode_GsccInit.SettingAssets(jsonObject.body.environments.alchemist.assets, jsonObject.body.environments.alchemist.assets_ex) && MonoSingleton <GameManager> .Instance.IsRelogin)
         {
             MonoSingleton <GameManager> .Instance.IsRelogin = false;
             this.ActivateOutputLinks(1001);
         }
         else
         {
             this.ActivateOutputLinks(10);
         }
         ((Behaviour)this).set_enabled(false);
     }
 }
Exemplo n.º 4
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ChatChannel> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ChatChannel> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         ChatChannel chatChannel = new ChatChannel();
         chatChannel.Deserialize(jsonObject.body);
         if (chatChannel == null)
         {
             return;
         }
         ChatChannelWindow component = (ChatChannelWindow)((Component)this).get_gameObject().GetComponent <ChatChannelWindow>();
         if (Object.op_Inequality((Object)component, (Object)null))
         {
             component.Channel = chatChannel;
         }
         this.Success();
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <JSON_ShopListArray> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ShopListArray> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                this.event_shop_list.DestroyItems();
                if (jsonObject.body.shops != null && jsonObject.body.shops.Length > 0)
                {
                    for (int index = 0; index < jsonObject.body.shops.Length; ++index)
                    {
                        if (jsonObject.body.shops[index] == null)
                        {
                            this.OnRetry();
                            return;
                        }
                    }
                    MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

                    if (this.inputPin != 2)
                    {
                        this.event_shop_list.AddEventShopList(jsonObject.body.shops);
                    }
                }
                this.event_shop_list.AddArenaShopList();
                this.event_shop_list.AddMultiShopList();
                this.Success();
            }
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <BattleCore.Json_BattleCont> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_BattleCont> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnFailed();
         }
         else
         {
             GlobalVars.MultiPlayBattleCont = jsonObject.body;
             PlayerData.EDeserializeFlags flag = (PlayerData.EDeserializeFlags)(0 | 2);
             if (!MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player, flag))
             {
                 this.OnFailed();
             }
             else
             {
                 Network.RemoveAPI();
                 AnalyticsManager.TrackSpendCoin("ContinueMultiQuest", (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ContinueCoinCostMulti);
                 this.Success();
             }
         }
     }
 }
Exemplo n.º 7
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_QuestList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_QuestList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         try
         {
             MonoSingleton <GameManager> .Instance.Deserialize(GameUtility.Config_Language, jsonObject.body);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             this.Failure();
             return;
         }
         this.Success();
     }
 }
Exemplo n.º 8
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardFavorite.Json_ConceptCardFavorite> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCardFavorite.Json_ConceptCardFavorite> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         try
         {
             MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.concept_card);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             return;
         }
         this.ActivateOutputLinks(this.mOutPutPinId);
         ((Behaviour)this).set_enabled(false);
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_PassCode> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_PassCode> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (Object.op_Inequality((Object)this.HikkoshiCodeText, (Object)null))
             {
                 this.HikkoshiCodeText.set_text(jsonObject.body.passcode);
             }
             if (Object.op_Inequality((Object)this.ExpireTimeText, (Object)null))
             {
                 DateTime dateTime = DateTime.Now.AddSeconds((double)jsonObject.body.expires_in);
                 this.ExpireTimeText.set_text(string.Format(LocalizedText.Get("sys.HIKKOSHICODE_EXPIRETIME"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute, (object)dateTime.Second));
             }
             this.Success();
         }
     }
 }
Exemplo n.º 10
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

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

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                ((Behaviour)this).set_enabled(false);
                MonoSingleton <GameManager> .Instance.Player.OnOpenTobiraTrophy((long)GlobalVars.SelectedUnitUniqueID);
            }
        }
Exemplo n.º 11
0
 public override void OnSuccess(WWWResult www)
 {
     if (Object.op_Equality((Object)this, (Object)null))
     {
         Network.RemoveAPI();
         this.isConnecting = false;
     }
     else if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <JSON_ProductParamResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ProductParamResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         ProductParamResponse productParamResponse = new ProductParamResponse();
         if (!productParamResponse.Deserialize(jsonObject.body))
         {
             this.Failure();
         }
         else
         {
             this.StartCoroutine(this.CheckPaymentInit(productParamResponse));
         }
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqMailSelectConceptCard.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMailSelectConceptCard.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (jsonObject.body.select == null || jsonObject.body.select.Length <= 0)
             {
                 return;
             }
             ConceptCardData[] data = new ConceptCardData[jsonObject.body.select.Length];
             for (int index = 0; index < jsonObject.body.select.Length; ++index)
             {
                 FlowNode_ReqMailSelectConceptCard.Json_SelectConceptCard selectConceptCard = jsonObject.body.select[index];
                 data[index] = ConceptCardData.CreateConceptCardDataForDisplay(selectConceptCard.iname);
                 MonoSingleton <GameManager> .Instance.Player.SetConceptCardNum(selectConceptCard.iname, selectConceptCard.has_count);
             }
             this.m_GetConceptCardListWindow.Setup(data);
         }
     }
 }
Exemplo n.º 13
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

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

                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)UnitEnhanceV3.Instance, (UnityEngine.Object)null))
                    {
                        UnitEnhanceV3.Instance.OnEquipConceptCardSelect();
                    }
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                ((Behaviour)this).set_enabled(false);
            }
        }
Exemplo n.º 14
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         Debug.Log((object)www.text);
         WebAPI.JSON_BodyResponse <Json_VersusCpu> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_VersusCpu> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             ((Behaviour)this).set_enabled(false);
             if (!MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body))
             {
                 this.OnFailed();
             }
             else
             {
                 Network.RemoveAPI();
                 this.Success();
             }
         }
     }
 }
Exemplo n.º 15
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnFailed();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnFailed();
         }
         else
         {
             try
             {
                 MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player);
             }
             catch (Exception ex)
             {
                 DebugUtility.LogException(ex);
                 this.OnFailed();
                 return;
             }
             Network.RemoveAPI();
             AnalyticsManager.TrackSpendCoin(this.ResetType.ToString(), this.getRequiredCoin());
             this.Success();
         }
     }
 }
Exemplo n.º 16
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.º 17
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_ShopResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopResponse> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    ShopData shop = MonoSingleton <GameManager> .Instance.Player.GetShopData(this.mShopType) ?? new ShopData();

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

                        this.Success();
                    }
                }
            }
        }
Exemplo n.º 18
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ResAwardList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ResAwardList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         if (jsonObject.body == null)
         {
             this.Failure();
         }
         else
         {
             if (this.mMode == FlowNode_ReqAwardList.MODE.SetAwardList)
             {
                 if (Object.op_Equality((Object)this.Target, (Object)null) || Object.op_Equality((Object)this.Target.GetComponent <AwardList>(), (Object)null))
                 {
                     this.Failure();
                     return;
                 }
                 ((AwardList)this.Target.GetComponent <AwardList>()).SetOpenAwards(jsonObject.body.awards);
             }
             else if (this.mMode == FlowNode_ReqAwardList.MODE.SetPlayerAward)
             {
                 MonoSingleton <GameManager> .Instance.Player.SetHaveAward(jsonObject.body.awards);
             }
             this.Success();
         }
     }
 }
Exemplo n.º 19
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

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

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_GOLD);
                ((Behaviour)this).set_enabled(false);
            }
        }
Exemplo n.º 20
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ArenaPlayers> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ArenaPlayers> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             ((Behaviour)this).set_enabled(false);
             GameManager instance = MonoSingleton <GameManager> .Instance;
             if (!instance.Deserialize(jsonObject.body))
             {
                 this.OnFailed();
             }
             else
             {
                 Network.RemoveAPI();
                 instance.Player.UpdateArenaRankTrophyStates(-1, -1);
                 this.Success();
             }
         }
     }
 }
Exemplo n.º 21
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCard.Json_ConceptCardList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqConceptCard.Json_ConceptCardList> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.cards, this.mIsDataOverride);

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

                    GlobalVars.IsDirtyConceptCardData.Set(false);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                this.StartCoroutine(this.DownloadAssetsAndOutputPin());
            }
        }
Exemplo n.º 22
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else if (this.mode == FlowNode_SetEventShopList.Mode.GetShopList)
            {
                WebAPI.JSON_BodyResponse <JSON_ShopListArray> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ShopListArray> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                this.event_shop_list.DestroyItems();
                if (jsonObject.body.shops != null && jsonObject.body.shops.Length > 0)
                {
                    for (int index = 0; index < jsonObject.body.shops.Length; ++index)
                    {
                        if (jsonObject.body.shops[index] == null)
                        {
                            this.OnRetry();
                            return;
                        }
                    }
                    MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

                    if (this.inputPin != 2)
                    {
                        this.event_shop_list.AddEventShopList(jsonObject.body.shops);
                    }
                }
                this.event_shop_list.AddArenaShopList();
                this.event_shop_list.AddMultiShopList();
                this.EraseTimeOutPopupHistory(jsonObject.body.shops);
                this.mode = FlowNode_SetEventShopList.Mode.GetCoinNum;
                this.ExecRequest((WebAPI) new ReqGetCoinNum(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            }
            else
            {
                if (this.mode != FlowNode_SetEventShopList.Mode.GetCoinNum)
                {
                    return;
                }
                WebAPI.JSON_BodyResponse <FlowNode_SetEventShopList.JSON_CoinNum> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_SetEventShopList.JSON_CoinNum> >(www.text);
                Network.RemoveAPI();
                if (jsonObject.body != null && jsonObject.body.item != null && jsonObject.body.item.Length > 0)
                {
                    MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.item);
                }
                if (jsonObject.body != null && jsonObject.body.newcoin != null)
                {
                    GlobalVars.NewSummonCoinInfo = new GlobalVars.SummonCoinInfo()
                    {
                        Period = jsonObject.body.newcoin.period
                    }
                }
                ;
                this.Success();
            }
        }
Exemplo n.º 23
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
     }
     Network.RemoveAPI();
     PlayerPrefsUtility.SetString(PlayerPrefsUtility.ALTER_PREV_CHECK_HASH, MonoSingleton <GameManager> .Instance.AlterCheckHash, false);
     this.Success();
 }
Exemplo n.º 24
0
        public bool Error()
        {
            if (!Network.IsError)
            {
                return(false);
            }
            if (Network.ErrCode == Network.EErrCode.NotExist_tower)
            {
                if (this.mResume)
                {
                    GlobalVars.BtlID.Set(this.btlID);
                    CriticalSection.Leave(CriticalSections.SceneChange);
                    Network.RequestResult = Network.RequestResults.Back;
                    if (Network.IsImmediateMode)
                    {
                        return(true);
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(7);
                    return(true);
                }
                this.OnFailed();
                return(true);
            }
            Network.EErrCode errCode = Network.ErrCode;
            switch (errCode)
            {
            case Network.EErrCode.UnSelectable:
                this.OnBack();
                return(true);

            case Network.EErrCode.OutOfDateQuest:
                this.OnBack();
                return(true);

            case Network.EErrCode.ChallengeLimit:
                this.OnBack();
                return(true);

            default:
                if (errCode != Network.EErrCode.QuestEnd)
                {
                    if (errCode != Network.EErrCode.NoBtlInfo)
                    {
                        return(TowerErrorHandle.Error((FlowNode_Network)this));
                    }
                    this.OnFailed();
                    return(true);
                }
                this.OnFailed();
                return(true);
            }
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         this.Success();
     }
 }
Exemplo n.º 26
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_AttachFacebookToDeviceResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_AttachFacebookToDeviceResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (jsonObject.body.linked == 1)
             {
                 if (jsonObject.body.device_id == MonoSingleton <GameManager> .Instance.DeviceId && jsonObject.body.secret_key == MonoSingleton <GameManager> .Instance.SecretKey)
                 {
                     PlayerPrefs.SetInt("AccountLinked", 1);
                     this.ActivateOutputLinks(16);
                 }
                 else
                 {
                     Facebook_Migrate.old_device_id  = jsonObject.body.device_id;
                     Facebook_Migrate.old_secret_key = jsonObject.body.secret_key;
                     GlobalVars.NewPlayerName        = jsonObject.body.name;
                     GlobalVars.NewPlayerLevel       = jsonObject.body.lv.ToString();
                     this.ActivateOutputLinks(12);
                 }
             }
             else
             {
                 if (PlayerPrefs.HasKey("AccountLinked") && PlayerPrefs.GetInt("AccountLinked") == 1)
                 {
                     this.ActivateOutputLinks(17);
                     return;
                 }
                 if (!string.IsNullOrEmpty(GlobalVars.FacebookID))
                 {
                     this.ActivateOutputLinks(17);
                     return;
                 }
                 this.ActivateOutputLinks(14);
             }
             ((Behaviour)this).set_enabled(false);
         }
     }
 }