public override void OnSuccess(WWWResult www) { if (Network.IsError) { switch (Network.ErrCode) { case Network.EErrCode.NoDevice: case Network.EErrCode.Authorize: this.OnFailed(); return; } } WebAPI.JSON_BodyResponse <FlowNode_GetAccessToken.JSON_AccessToken> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_GetAccessToken.JSON_AccessToken> >(www.text); if (jsonObject.body == null) { this.OnFailed(); } else { Network.SessionID = jsonObject.body.access_token; MyMetaps.TrackEvent("device_id", MonoSingleton <GameManager> .Instance.DeviceId); Network.RemoveAPI(); this.ActivateOutputLinks(1); ((Behaviour)this).set_enabled(false); } }
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(); MyMetaps.TrackSpendCoin(this.ResetType.ToString(), this.getRequiredCoin()); this.Success(); } } }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { switch (Network.ErrCode) { case Network.EErrCode.GoldBuyCostShort: if (this.ShowResult) { this.OutOfCoin(); } this.OnBack(); break; case Network.EErrCode.GoldBuyLimit: if (this.ShowResult) { this.OutOfBuyCount(); } this.OnBack(); break; default: this.OnRetry(); break; } } 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.OnRetry(); } else { PlayerData.EDeserializeFlags flag = (PlayerData.EDeserializeFlags)(0 | 2 | 1); if (!MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player, flag)) { this.OnRetry(); } else { Network.RemoveAPI(); MyMetaps.TrackSpendCoin("BuyGold", this.getRequiredCoin()); if (this.ShowResult) { FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam; UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.GOLDBOUGHT", (object)fixParam.BuyGoldCost, (object)fixParam.BuyGoldAmount), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1); MonoSingleton <GameManager> .Instance.Player.OnGoldChange((int)fixParam.BuyGoldAmount); } this.Success(); } } } }
private void Success() { if (Network.Mode == Network.EConnectMode.Online) { MyMetaps.TrackTutorialPoint("SetName"); MyGrowthPush.registCustomerId(MonoSingleton <GameManager> .Instance.Player.OkyakusamaCode); } ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(1); }
public override void OnActivate(int pinID) { if (pinID != 0) { return; } MyMetaps.TrackEvent("device_id", MonoSingleton <GameManager> .Instance.DeviceId); Network.SessionID = Session.DefaultSession.AccessToken; ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(1); }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { if (Network.ErrCode == Network.EErrCode.StaminaCoinShort) { if (this.ShowResult) { this.OutOfCoin(); } this.OnBack(); } else { this.OnRetry(); } } 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.OnRetry(); } else { int staminaRecoveryCost = MonoSingleton <GameManager> .Instance.Player.GetStaminaRecoveryCost(true); PlayerData.EDeserializeFlags flag = (PlayerData.EDeserializeFlags)(0 | 2 | 4); if (!MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player, flag)) { this.OnRetry(); } else { Network.RemoveAPI(); MyMetaps.TrackSpendCoin("BuyStamina", staminaRecoveryCost); if (this.ShowResult) { UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.STAMINARECOVERED", new object[1] { (object)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.StaminaAdd }), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1); } this.Success(); } } } }
public override void OnActivate() { if (!string.IsNullOrEmpty(this.Point)) { try { MyMetaps.TrackTutorialPoint(this.Point); } catch { } } this.ActivateNext(); }
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(); SceneBattle instance = SceneBattle.Instance; int num = (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ContinueCoinCostMulti; if (Object.op_Inequality((Object)instance, (Object)null) && instance.Battle != null && instance.Battle.IsMultiTower) { num = (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ContinueCoinCostMultiTower; } MyMetaps.TrackSpendCoin("ContinueMultiQuest", num); this.Success(); } } } }
private void OnRequestResult(WWWResult www) { if (Network.IsError) { if (Network.ErrCode == Network.EErrCode.AbilityCoinShort) { FlowNode_Network.Back(); } else { FlowNode_Network.Retry(); } } else { WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text); try { MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player); Network.RemoveAPI(); } catch (Exception ex) { DebugUtility.LogException(ex); FlowNode_Network.Retry(); return; } if (this.UseCoin > 0) { MyMetaps.TrackSpendCoin("AbilityPoint", this.UseCoin); } this.UseCoin = 0; this.UpdateValue(); this.Success(); } }
public static bool TrackTutorialEnd() { return(MyMetaps.TrackEvent("tutorial", "end")); }
public static bool TrackDebugInstall() { return(MyMetaps.TrackEvent("debug_install", "installed")); }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { switch (Network.ErrCode) { case Network.EErrCode.ShopRefreshCostShort: case Network.EErrCode.ShopRefreshLvSort: this.OnBack(); break; default: this.OnRetry(); break; } } else { switch (GlobalVars.ShopType) { case EShopType.Event: WebAPI.JSON_BodyResponse <Json_EventShopUpdateResponse> jsonObject1 = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_EventShopUpdateResponse> >(www.text); DebugUtility.Assert(jsonObject1 != null, "res == null"); if (jsonObject1.body == null) { this.OnRetry(); return; } List <JSON_EventShopItemListSet> eventShopItemListSetList = new List <JSON_EventShopItemListSet>((IEnumerable <JSON_EventShopItemListSet>)jsonObject1.body.shopitems); jsonObject1.body.shopitems = eventShopItemListSetList.ToArray(); Network.RemoveAPI(); EventShopData shop1 = MonoSingleton <GameManager> .Instance.Player.GetEventShopData() ?? new EventShopData(); if (!shop1.Deserialize(jsonObject1.body)) { this.OnFailed(); return; } MonoSingleton <GameManager> .Instance.Player.SetEventShopData(shop1); break; case EShopType.Limited: WebAPI.JSON_BodyResponse <Json_LimitedShopUpdateResponse> jsonObject2 = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_LimitedShopUpdateResponse> >(www.text); DebugUtility.Assert(jsonObject2 != null, "res == null"); if (jsonObject2.body == null) { this.OnRetry(); return; } List <JSON_LimitedShopItemListSet> limitedShopItemListSetList = new List <JSON_LimitedShopItemListSet>((IEnumerable <JSON_LimitedShopItemListSet>)jsonObject2.body.shopitems); jsonObject2.body.shopitems = limitedShopItemListSetList.ToArray(); Network.RemoveAPI(); LimitedShopData shop2 = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData() ?? new LimitedShopData(); if (!shop2.Deserialize(jsonObject2.body)) { this.OnFailed(); return; } MonoSingleton <GameManager> .Instance.Player.SetLimitedShopData(shop2); break; default: WebAPI.JSON_BodyResponse <Json_ShopUpdateResponse> jsonObject3 = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopUpdateResponse> >(www.text); DebugUtility.Assert(jsonObject3 != null, "res == null"); if (jsonObject3.body == null) { this.OnRetry(); return; } Network.RemoveAPI(); ShopData shop3 = MonoSingleton <GameManager> .Instance.Player.GetShopData(this.mShopType) ?? new ShopData(); if (!shop3.Deserialize(jsonObject3.body)) { this.OnFailed(); return; } MonoSingleton <GameManager> .Instance.Player.SetShopData(this.mShopType, shop3); break; } ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType); if (shopParam != null) { PlayerData player = MonoSingleton <GameManager> .Instance.Player; MyMetaps.TrackSpendShopUpdate(shopParam.UpdateCostType, this.mShopType, player.GetShopUpdateCost(this.mShopType, true)); } this.Success(); } }
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; default: this.OnRetry(); break; } } else { WebAPI.JSON_BodyResponse <Json_ShopBuyResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopBuyResponse> >(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); ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType); if (shopParam != null) { PlayerData player = MonoSingleton <GameManager> .Instance.Player; ShopItem shopItem = shop.items[GlobalVars.ShopBuyIndex]; string iname = shopItem.iname; if (shopItem.isSetSaleValue) { MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, shopItem.saleValue); } else { int num = !shopItem.IsArtifact ? MonoSingleton <GameManager> .Instance.GetItemParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num : MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num; if (num > 0) { MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, num); } } player.OnBuyAtShop(shopParam.iname, iname, shopItem.num); } this.Success(); } } } }
public static bool TrackTutorialPoint(string point) { return(MyMetaps.TrackEvent("tutorial", point)); }
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_ShopBuyResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopBuyResponse> >(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); 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)); } } } ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType); if (shopParam != null) { PlayerData player = MonoSingleton <GameManager> .Instance.Player; ShopItem shopItem = shop.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex)); string iname = shopItem.iname; if (shopItem.isSetSaleValue) { MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, shopItem.saleValue); } else { int num = !shopItem.IsArtifact ? (!shopItem.IsConceptCard ? MonoSingleton <GameManager> .Instance.GetItemParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num : shopItem.saleValue) : MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num; if (num > 0) { MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, num); } } player.OnBuyAtShop(shopParam.iname, iname, shopItem.num); } this.Success(); } } } }
public static bool TrackSpendCoin(string name, int value) { return(MyMetaps.TrackSpend(ESaleType.Coin.ToString(), name, value)); }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { if (Network.ErrCode == Network.EErrCode.NoGacha) { this.OnFailed(); } else { this.OnRetry(); } } else { WebAPI.JSON_BodyResponse <Json_GachaResult> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_GachaResult> >(www.text); DebugUtility.Assert(jsonObject != null, "res == null"); Network.RemoveAPI(); try { MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body); } catch (Exception ex) { DebugUtility.LogException(ex); this.Failure(); return; } List <GachaDropData> a_drops = 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)) { a_drops.Add(gachaDropData); } } } GachaReceiptData a_receipt = new GachaReceiptData(); a_receipt.Deserialize(jsonObject.body.receipt); GachaResultData.Init(a_drops, (List <GachaDropData>)null, (List <int>)null, a_receipt, false, jsonObject.body.is_pending, jsonObject.body.rest); MyMetaps.TrackSpend(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(a_receipt.type), a_receipt.iname, a_receipt.val); if (this.API == FlowNode_ExecTutorialGacha.ExecType.DECISION) { this.Success(); } else { GachaDropData drop = GachaResultData.drops[0]; if (drop == null) { DebugUtility.LogError("召喚結果が存在しません"); this.Failure(); } else { this.StartCoroutine(this.AsyncDownload(drop.unit)); } } } }
public static bool TrackSpendShopUpdate(ESaleType sale_type, EShopType shop_type, int value) { string name = "ShopUpdate." + shop_type.ToString(); return(MyMetaps.TrackSpend(sale_type.ToString(), name, value)); }
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 static bool TrackTutorialBegin() { return(MyMetaps.TrackEvent("tutorial", "start")); }