protected override void Send()
    {
        SmithManager.ResultData result_data = new SmithManager.ResultData();
        GameSection.SetEventData(result_data);
        GameSection.StayEvent();
        MonoBehaviourSingleton <SmithManager> .I.SendCreateEquipItem(GetCreateEquiptableID(), delegate(Error err, EquipItemInfo create_item)
        {
            switch (err)
            {
            case Error.None:
                result_data.itemData = create_item;
                MonoBehaviourSingleton <UIAnnounceBand> .I.isWait = true;
                GameSection.ResumeEvent(true, null);
                break;

            case Error.WRN_SMITH_OVER_EQUIP_ITEM_NUM:
                GameSection.ChangeStayEvent("CREATE_OVER_EQUIP", null);
                GameSection.ResumeEvent(true, null);
                break;

            default:
                GameSection.ResumeEvent(false, null);
                break;
            }
        });
    }
    private void OnQuery_OK()
    {
        GameSection.SetEventData(null);
        string input_text = GetInputValue((Enum)UI.IPT_TEXT);

        GameSection.StayEvent();
        MonoBehaviourSingleton <FriendManager> .I.SendSearchID(input_text, delegate(bool is_success, FriendSearchResult recv_data)
        {
            if (is_success)
            {
                GameSection.ChangeStayEvent("OK", new object[4]
                {
                    true,
                    0,
                    recv_data,
                    input_text
                });
            }
            else
            {
                GameSection.ChangeStayEvent("OK", new object[4]
                {
                    true,
                    0,
                    new FriendSearchResult(),
                    input_text
                });
            }
            GameSection.ResumeEvent(true, null);
        });
    }
    private void OnQuery_NEXT()
    {
        GameSection.StayEvent();
        MonoBehaviourSingleton <ChatManager> .I.SwitchRoomChatConnectionToCoopConnection();

        Action <bool> action = delegate
        {
            if (MonoBehaviourSingleton <InGameManager> .IsValid() && MonoBehaviourSingleton <InGameManager> .I.IsQuestInField())
            {
                MonoBehaviourSingleton <InGameManager> .I.isTransitionQuestToField = true;
                GameSection.ChangeStayEvent("QUEST_TO_FIELD", null);
            }
            GameSection.ResumeEvent(true, null);
        };

        if (MonoBehaviourSingleton <InGameManager> .IsValid() && MonoBehaviourSingleton <InGameManager> .I.isQuestResultFieldLeave)
        {
            bool toHome = !MonoBehaviourSingleton <InGameManager> .I.IsQuestInField() && !MonoBehaviourSingleton <InGameManager> .I.IsQuestInPortal();

            MonoBehaviourSingleton <CoopApp> .I.LeaveWithParty(action, toHome, false);
        }
        else
        {
            action(true);
        }
        if (MonoBehaviourSingleton <UIManager> .IsValid() && MonoBehaviourSingleton <UIManager> .I.mainChat != null)
        {
            MonoBehaviourSingleton <UIManager> .I.mainChat.HideOpenButton();

            MonoBehaviourSingleton <UIManager> .I.mainChat.HideAll();
        }
    }
 private void OnQuery_START()
 {
     if (!MonoBehaviourSingleton <AccountManager> .I.account.IsRegist())
     {
         GameSection.StayEvent();
         MonoBehaviourSingleton <AccountManager> .I.SendRegistCreate(delegate(bool is_success)
         {
             if (MonoBehaviourSingleton <UserInfoManager> .I.userInfo.name == "/colopl_rob")
             {
                 GameSection.ChangeStayEvent("OPENING", null);
             }
             GameSection.ResumeEvent(is_success, null);
         });
     }
     else if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep > 0 && MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep <= 2)
     {
         if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep == 1)
         {
             MonoBehaviourSingleton <GameSceneManager> .I.ChangeScene("Title", "CharaMake", UITransition.TYPE.CLOSE, UITransition.TYPE.OPEN, false);
         }
         else if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep == 2)
         {
             DispatchEvent("MAIN_MENU_HOME", null);
         }
         else
         {
             DispatchEvent("TUTORIAL_" + MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep.ToString(), null);
         }
     }
 }
    private void OnQuery_COMPLETE_GRID()
    {
        GridData gridData = GameSection.GetEventData() as GridData;

        GameSection.StayEvent();
        Delivery deliveryInfo = gridData.deliveryInfo;
        CardData cardData     = GetCurrentCard();

        MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
        MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(deliveryInfo.uId, false, delegate(bool is_success, DeliveryRewardList recv_reward)
        {
            //IL_0028: Unknown result type (might be due to invalid IL or missing references)
            if (is_success)
            {
                this.StartCoroutine(WaitAndDo(delegate
                {
                    PlayGridCompleteAnimation(gridData, true, delegate
                    {
                        GameSection.ChangeStayEvent("GET_REWARD", new object[2]
                        {
                            gridData.deliveryData,
                            cardData.eventData
                        });
                        GameSection.ResumeEvent(true, null);
                        RefreshMissionData(currentCardIndex);
                        RefreshUI();
                    });
                }, 0.2f));
            }
            else
            {
                GameSection.ResumeEvent(false, null);
            }
        });
    }
 private void OnQuery_JOIN()
 {
     GameSection.StayEvent();
     MonoBehaviourSingleton <GuildManager> .I.SendRequestJoin(_clanId, -1, delegate(bool isSuccess, Error error)
     {
         InGameGuildInvitedJoinDialog inGameGuildInvitedJoinDialog = this;
         DoWaitProtocolBusyFinish(delegate
         {
             if (!GuildManager.IsValidInGuild())
             {
                 GameSection.ChangeStayEvent("REQUEST", null);
             }
             GameSection.ResumeEvent(isSuccess, null);
             if (GuildManager.IsValidInGuild())
             {
                 MonoBehaviourSingleton <GuildManager> .I.guildInviteList.Clear();
                 MonoBehaviourSingleton <UserInfoManager> .I.ClearPartyInvite();
                 MonoBehaviourSingleton <UIManager> .I.invitationButton.Close(UITransition.TYPE.CLOSE);
                 MonoBehaviourSingleton <UIManager> .I.invitationInGameButton.Close(UITransition.TYPE.CLOSE);
                 MonoBehaviourSingleton <UserInfoManager> .I.showJoinClanInGame = true;
                 inGameGuildInvitedJoinDialog.BackToHome();
             }
         });
     });
 }
Exemple #7
0
 private void OnQuery_LOUNGE()
 {
     GameSection.StayEvent();
     MonoBehaviourSingleton <LoungeMatchingManager> .I.SendApply(string.Join(string.Empty, passCode), delegate(bool is_apply, Error ret_code)
     {
         if (is_apply && !MonoBehaviourSingleton <GameSceneManager> .I.CheckQuestAndOpenUpdateAppDialog(MonoBehaviourSingleton <PartyManager> .I.GetQuestId(), true))
         {
             Protocol.Force(delegate
             {
                 MonoBehaviourSingleton <PartyManager> .I.SendLeave(delegate
                 {
                 });
             });
         }
         else if (ret_code == Error.WRN_PARTY_SEARCH_NOT_FOUND_PARTY || ret_code == Error.WRN_PARTY_OWNER_REJOIN)
         {
             GameSection.ChangeStayEvent("NOT_FOUND_PARTY", null);
             GameSection.ResumeEvent(true, null);
         }
         else
         {
             GameSection.ResumeEvent(is_apply, null);
         }
     });
 }
 protected void SendApply(int questId = 0)
 {
     GameSection.SetEventData(new object[1]
     {
         true
     });
     GameSection.StayEvent();
     MonoBehaviourSingleton <PartyManager> .I.SendApply(string.Join(string.Empty, passCode), delegate(bool is_apply, Error ret_code)
     {
         if (is_apply && !MonoBehaviourSingleton <GameSceneManager> .I.CheckQuestAndOpenUpdateAppDialog(MonoBehaviourSingleton <PartyManager> .I.GetQuestId(), true))
         {
             Protocol.Force(delegate
             {
                 MonoBehaviourSingleton <PartyManager> .I.SendLeave(delegate
                 {
                 });
             });
         }
         else if (ret_code == Error.WRN_PARTY_SEARCH_NOT_FOUND_PARTY || ret_code == Error.WRN_PARTY_OWNER_REJOIN)
         {
             GameSection.ChangeStayEvent("NOT_FOUND_PARTY", null);
             GameSection.ResumeEvent(true, null);
         }
         else
         {
             GameSection.ResumeEvent(is_apply, null);
         }
     }, questId);
 }
Exemple #9
0
 private void _SendRegistLinkFacebook()
 {
     MonoBehaviourSingleton <AccountManager> .I.SendRegistLinkFacebook(MonoBehaviourSingleton <FBManager> .I.accessToken, delegate(bool success, RegistLinkFacebookModel ret)
     {
         if (success)
         {
             MonoBehaviourSingleton <PresentManager> .I.SendGetPresent(0, delegate
             {
                 if (success)
                 {
                     MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(NOTIFY_FLAG.FACEBOOK_LOGIN);
                     GameSection.ChangeStayEvent("ACCOUNT_LOGIN", null);
                 }
                 GameSection.ResumeEvent(success, null);
             });
         }
         else
         {
             if (ret.Error == Error.WRN_REGISTER_FACEBOOK_ACCOUNT_LINKED)
             {
                 GameSection.ChangeStayEvent("ACCOUNT_CONFLICT", ret.existInfo);
                 success = true;
             }
             GameSection.ResumeEvent(success, null);
         }
     });
 }
 public void OnQuery_YES()
 {
     if (num >= item.GetNum())
     {
         GameSection.ChangeEvent("CLOSE_DETAIL", null);
     }
     if (item is ItemSortData)
     {
         GameSection.StayEvent();
         SendItem(delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is EquipItemSortData)
     {
         GameSection.StayEvent();
         sellConfirm(delegate(bool b)
         {
             if (!b)
             {
                 Debug.LogWarning((object)"sellConfirm = false");
                 GameSection.ResumeEvent(false, null);
             }
             else
             {
                 GameSection.ChangeStayEvent("NON_STACK_SELL", null);
                 SendEquip(new List <string>
                 {
                     item.GetUniqID().ToString()
                 }, delegate(bool is_success)
                 {
                     GameSection.ResumeEvent(is_success, null);
                 });
             }
         });
     }
     else if (item is SkillItemSortData)
     {
         GameSection.ChangeEvent("NON_STACK_SELL", null);
         List <string> list = new List <string>();
         list.Add(item.GetUniqID().ToString());
         GameSection.StayEvent();
         SendSkill(list, delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is AbilityItemSortData)
     {
         GameSection.StayEvent();
         List <string> list2 = new List <string>();
         list2.Add(item.GetUniqID().ToString());
         SendAbilityItem(list2, delegate(bool is_success)
         {
             GameSection.ResumeEvent(is_success, null);
         });
     }
 }
Exemple #11
0
 private Action GetFinishActionMaterial(ShopReceiver.PaymentPurchaseData purchaseData)
 {
     return(delegate
     {
         GameSection.ChangeStayEvent("BUNDLE_NOTICE", purchaseData);
         GameSection.ResumeEvent(true, null);
     });
 }
    private void SendDeliveryComplete(int index, int delivery_id, bool is_enough_material, bool is_happen_quest)
    {
        DeliveryTable.DeliveryData table = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)deliveryInfo[index].dId);

        changeToDeliveryClearEvent = true;
        bool is_tutorial        = !TutorialStep.HasFirstDeliveryCompleted();
        bool enable_clear_event = table.clearEventID != 0;

        MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(deliveryInfo[index].uId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
        {
            if (is_success)
            {
                List <FieldMapTable.PortalTableData> deliveryRelationPortalData = Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData((uint)delivery_id);
                for (int i = 0; i < deliveryRelationPortalData.Count; i++)
                {
                    GameSaveData.instance.newReleasePortals.Add(deliveryRelationPortalData[i].portalID);
                }
                if (is_tutorial)
                {
                    TutorialStep.isSendFirstRewardComplete = true;
                }
                if (!enable_clear_event)
                {
                    MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
                    if (is_happen_quest)
                    {
                        GameSection.ChangeStayEvent("DELIVERY_REWARD_HAPPEN", new object[2]
                        {
                            delivery_id,
                            recv_reward
                        });
                    }
                    else
                    {
                        GameSection.ChangeStayEvent("DELIVERY_REWARD", new object[2]
                        {
                            delivery_id,
                            recv_reward
                        });
                    }
                }
                else
                {
                    GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
                    {
                        (int)table.clearEventID,
                        delivery_id,
                        recv_reward
                    });
                }
            }
            else
            {
                changeToDeliveryClearEvent = false;
            }
            GameSection.ResumeEvent(is_success, null);
        });
    }
	private void OnQuery_SELECT_RUSH()
	{
		int num = (int)GameSection.GetEventData();
		bool flag = MonoBehaviourSingleton<DeliveryManager>.I.IsCompletableDelivery(deliveryInfo[num].dId);
		int delivery_id = deliveryInfo[num].dId;
		if (flag)
		{
			DeliveryTable.DeliveryData table = Singleton<DeliveryTable>.I.GetDeliveryTableData((uint)deliveryInfo[num].dId);
			changeToDeliveryClearEvent = true;
			bool is_tutorial = !TutorialStep.HasFirstDeliveryCompleted();
			bool enable_clear_event = table.clearEventID != 0;
			GameSection.StayEvent();
			MonoBehaviourSingleton<DeliveryManager>.I.isStoryEventEnd = false;
			MonoBehaviourSingleton<DeliveryManager>.I.SendDeliveryComplete(deliveryInfo[num].uId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
			{
				if (is_success)
				{
					if (is_tutorial)
					{
						TutorialStep.isSendFirstRewardComplete = true;
					}
					if (!enable_clear_event)
					{
						MonoBehaviourSingleton<DeliveryManager>.I.isStoryEventEnd = false;
						GameSection.ChangeStayEvent("RUSH_REWARD", new object[2]
						{
							delivery_id,
							recv_reward
						});
					}
					else
					{
						GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
						{
							(int)table.clearEventID,
							delivery_id,
							recv_reward
						});
					}
				}
				else
				{
					changeToDeliveryClearEvent = false;
				}
				GameSection.ResumeEvent(is_success, null);
			});
		}
		else
		{
			GameSection.SetEventData(new object[2]
			{
				delivery_id,
				null
			});
		}
	}
 private void OnSuccessSend(CardData cardData, DeliveryTable.DeliveryData deliveryData)
 {
     GameSection.ChangeStayEvent("GET_REWARD", new object[2]
     {
         deliveryData,
         cardData.eventData
     });
     GameSection.ResumeEvent(true, null);
     RefreshMissionData(currentCardIndex);
     RefreshUI();
 }
Exemple #15
0
    private Action GetFinishActionBundle(ShopReceiver.PaymentPurchaseData purchaseData)
    {
        return(delegate
        {
            _disableChest();
            GlobalSettingsManager.PackParam.PackInfo pack = MonoBehaviourSingleton <GlobalSettingsManager> .I.packParam.GetPack(purchaseData.productId);

            GameSection.ChangeStayEvent(string.IsNullOrEmpty(pack.eventName) ? "BUNDLE_NOTICE" : pack.eventName, purchaseData);
            GameSection.ResumeEvent(true, null);
        });
    }
	private void OnQuery_SELECT_ARENA()
	{
		Network.EventData ev = GameSection.GetEventData() as Network.EventData;
		if (ev != null)
		{
			if (ev.HasEndDate() && ev.GetRest() < 0)
			{
				GameSection.ChangeEvent("SELECT_ENDED", null);
			}
			else
			{
				Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
				if (!ev.IsPlayableWith(nativeVersionFromName))
				{
					string event_data = string.Format(base.sectionData.GetText("REQUIRE_HIGHER_VERSION"), ev.minVersion);
					GameSection.ChangeEvent("SELECT_VERSION", event_data);
				}
				else if (!ev.readPrologueStory)
				{
					GameSection.StayEvent();
					MonoBehaviourSingleton<QuestManager>.I.SendQuestReadEventStory(ev.eventId, delegate(bool success, Error error)
					{
						if (success)
						{
							if (ev.prologueStoryId > 0)
							{
								GameSceneTables.EventData eventData = base.sectionData.GetEventData("STORY");
								if (eventData != null)
								{
									string name = (!MonoBehaviourSingleton<LoungeMatchingManager>.I.IsInLounge()) ? "MAIN_MENU_HOME" : "MAIN_MENU_LOUNGE";
									EventData[] array = new EventData[3]
									{
										new EventData(name, null),
										new EventData("TO_EVENT", null),
										new EventData("SELECT_ARENA", ev)
									};
									GameSection.ChangeStayEvent("STORY", new object[4]
									{
										ev.prologueStoryId,
										string.Empty,
										string.Empty,
										array
									});
								}
							}
							ev.readPrologueStory = true;
						}
						GameSection.ResumeEvent(true, null);
					});
				}
			}
		}
	}
 private void RequestRandomMatching()
 {
     GameSection.StayEvent();
     MonoBehaviourSingleton <LoungeMatchingManager> .I.SendSearchRandomMatching(delegate(bool is_success, Error err)
     {
         if (!is_success)
         {
             GameSection.ChangeStayEvent("NOT_FOUND_MATCHING_LOUNGE", null);
         }
         GameSection.ResumeEvent(true, null);
     });
 }
    private void SendReceivePresent(List <string> ids)
    {
        GameSection.StayEvent();
        MonoBehaviourSingleton <PresentManager> .I.SendReceivePresent(ids, delegate(bool is_success, Error network_err, int num)
        {
            bool is_resume = is_success;
            if (is_success)
            {
                selectEventData[2] = num;
                SoundManager.PlaySystemSE(SoundID.UISE.GET_PRIZE, 1f);
            }
            else
            {
                is_resume = true;
                switch (network_err)
                {
                default:
                    is_resume = false;
                    break;

                case Error.WRN_PRESENT_OVER_MONEY:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_MONEY", null);
                    break;

                case Error.WRN_PRESENT_OVER_ITEM:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_ITEM", null);
                    break;

                case Error.WRN_PRESENT_OVER_EQUIP_ITEM:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_EQUIP_ITEM", null);
                    break;

                case Error.WRN_PRESENT_OVER_SKILL_ITEM:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_SKILL_ITEM", null);
                    break;

                case Error.WRN_PRESENT_OVER_QUEST_ITEM:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_QUEST_ITEM", null);
                    break;

                case Error.WRN_PRESENT_OVER_EQUIP_AND_SKILL:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_EQUIP_AND_SKILL", null);
                    break;

                case Error.WRN_PRESENT_OVER_ETC:
                    GameSection.ChangeStayEvent("WRN_PRESENT_OVER_ETC", null);
                    break;
                }
            }
            GameSection.ResumeEvent(is_resume, null);
        });
    }
    private void OnQuery_CREATE()
    {
        MonoBehaviourSingleton <LoungeMatchingManager> .I.SetLoungeCreateRequest(createRequest);

        GameSection.StayEvent();
        MonoBehaviourSingleton <LoungeMatchingManager> .I.SendCreate(delegate(bool is_success, Error err)
        {
            if (!is_success && err == Error.WRN_PARTY_SEARCH_NOT_FOUND_QUEST)
            {
                GameSection.ChangeStayEvent("NOT_FOUND_QUEST", null);
            }
            GameSection.ResumeEvent(true, null);
        });
    }
Exemple #20
0
    private void JoinField(int fieldMapId)
    {
        if (fieldMapId == MonoBehaviourSingleton <FieldManager> .I.currentMapID)
        {
            GameSection.StopEvent();
        }
        else
        {
            FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData((uint)fieldMapId);

            if (fieldMapData == null || fieldMapData.jumpPortalID == 0)
            {
                Log.Error("RegionMap.OnQuery_SELECT() jumpPortalID is not found.");
            }
            else if (!MonoBehaviourSingleton <GameSceneManager> .I.CheckPortalAndOpenUpdateAppDialog(fieldMapData.jumpPortalID, false, true))
            {
                GameSection.StopEvent();
            }
            else if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(fieldMapData))
            {
                DispatchEvent("CANT_JUMP", null);
            }
            else
            {
                GameSection.StayEvent();
                CoopApp.EnterField(fieldMapData.jumpPortalID, 0u, delegate(bool is_matching, bool is_connect, bool is_regist)
                {
                    if (!is_connect)
                    {
                        GameSection.ChangeStayEvent("COOP_SERVER_INVALID", null);
                        GameSection.ResumeEvent(true, null);
                        AppMain i     = MonoBehaviourSingleton <AppMain> .I;
                        i.onDelayCall = (Action)Delegate.Combine(i.onDelayCall, (Action) delegate
                        {
                            DispatchEvent("CLOSE", null);
                        });
                    }
                    else
                    {
                        GameSection.ResumeEvent(is_regist, null);
                        if (is_regist)
                        {
                            MonoBehaviourSingleton <GameSceneManager> .I.ChangeScene("InGame", null, UITransition.TYPE.CLOSE, UITransition.TYPE.OPEN, false);
                        }
                    }
                });
            }
        }
    }
Exemple #21
0
 private void OnQuery_OK()
 {
     GameSection.StayEvent();
     MonoBehaviourSingleton <UserInfoManager> .I.SendParentalPassword(GetInputValue((Enum)UI.IPT_PW), GetInputValue((Enum)UI.IPT_PW_CONFIRM), delegate(Error ret)
     {
         if (ret != 0)
         {
             GameSection.ChangeStayEvent("ERROR", new object[1]
             {
                 (int)ret
             });
         }
         GameSection.ResumeEvent(true, null);
     });
 }
Exemple #22
0
 private void OnBuyMaterial(ShopReceiver.PaymentPurchaseData purchaseData)
 {
     if (purchaseData != null)
     {
         isPurchase = false;
         SendRequestCurrentPresentAndShopList(delegate
         {
             //IL_0011: Unknown result type (might be due to invalid IL or missing references)
             GameSection.ChangeStayEvent("BUY_SUCCESS", null);
             this.StartCoroutine("DoReloadMarketData");
         });
     }
     if (isPurchase)
     {
         GameSection.ResumeEvent(false, null);
     }
 }
 private void OnQuery_JOIN()
 {
     GameSection.SetEventData($"Welcome to {_info.clanName}!");
     GameSection.StayEvent();
     MonoBehaviourSingleton <GuildManager> .I.SendRequestJoin(_clanId, -1, delegate(bool isSuccess, Error error)
     {
         GuildInfoDialog guildInfoDialog = this;
         DoWaitProtocolBusyFinish(delegate
         {
             if (!GuildManager.IsValidInGuild())
             {
                 GameSection.ChangeStayEvent("REQUEST", null);
             }
             GameSection.ResumeEvent(isSuccess, null);
         });
     });
 }
Exemple #24
0
 private void OnBuyItem(string productId)
 {
     if (!string.IsNullOrEmpty(productId))
     {
         isPurchase = false;
         SendRequestCurrentPresentAndShopList(delegate
         {
             //IL_0011: Unknown result type (might be due to invalid IL or missing references)
             GameSection.ChangeStayEvent("BUY_SUCCESS", null);
             this.StartCoroutine("DoReloadMarketData");
         });
     }
     if (isPurchase)
     {
         GameSection.ResumeEvent(false, null);
     }
 }
    private void OnQuery_FOLLOW()
    {
        int playerIndex = (int)GameSection.GetEventData();

        InGameRecorder.PlayerRecord record = playerRecords[playerIndex];
        if (record == null)
        {
            GameSection.StopEvent();
        }
        else if (MonoBehaviourSingleton <FriendManager> .I.followNum >= MonoBehaviourSingleton <UserInfoManager> .I.userStatus.maxFollow)
        {
            GameSection.ChangeEvent("FOLLOW_MAX", null);
        }
        else
        {
            GameSection.StayEvent();
            List <int> list = new List <int>();
            list.Add(record.charaInfo.userId);
            MonoBehaviourSingleton <FriendManager> .I.SendFollowUser(list, delegate(Error err, List <int> follow_list)
            {
                if (err == Error.None)
                {
                    GameSection.ChangeStayEvent("FOLLOW_DIALOG", new object[1]
                    {
                        record.charaInfo.name
                    });
                    Transform root = itemsL[playerIndex];
                    SetButtonSprite(root, UI.BTN_FOLLOW, "ResultfollowBtnOff", true);
                    SetButtonEnabled(root, UI.BTN_FOLLOW, false);
                    if (MonoBehaviourSingleton <CoopApp> .IsValid())
                    {
                        CoopApp.UpdateField(null);
                    }
                }
                else if (follow_list.Count == 0)
                {
                    GameSection.ChangeStayEvent("FAILED_FOLLOW", new object[1]
                    {
                        record.charaInfo.name
                    });
                }
                GameSection.ResumeEvent(err == Error.None, null);
            });
        }
    }
Exemple #26
0
 private Action GetFinishAction(int index, ProductData product_data)
 {
     return(delegate
     {
         _disableChest();
         GameSection.ChangeStayEvent("BUY", new object[7]
         {
             index,
             product_data,
             product_data.name,
             product_data.discount,
             product_data.price,
             10,
             5
         });
         GameSection.ResumeEvent(true, null);
     });
 }
Exemple #27
0
    private void SendDeliveryComplete(DeliveryTable.DeliveryData deliveryData, string deliveryUniqueId, bool is_enough_material)
    {
        bool is_tutorial        = !TutorialStep.HasFirstDeliveryCompleted();
        int  delivery_id        = (int)deliveryData.id;
        bool enable_clear_event = deliveryData.clearEventID != 0;

        MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(deliveryUniqueId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
        {
            if (is_success)
            {
                List <FieldMapTable.PortalTableData> deliveryRelationPortalData = Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData((uint)delivery_id);
                for (int i = 0; i < deliveryRelationPortalData.Count; i++)
                {
                    GameSaveData.instance.newReleasePortals.Add(deliveryRelationPortalData[i].portalID);
                }
                if (is_tutorial)
                {
                    TutorialStep.isSendFirstRewardComplete = true;
                }
                if (!enable_clear_event)
                {
                    MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
                    GameSection.ChangeStayEvent("DELIVERY_REWARD", new object[4]
                    {
                        delivery_id,
                        recv_reward,
                        false,
                        mapData
                    });
                }
                else
                {
                    GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
                    {
                        (int)deliveryData.clearEventID,
                        delivery_id,
                        recv_reward
                    });
                }
                deliveryDataAndUIdList = CreateDeliveryList(mapData.mapId);
            }
            GameSection.ResumeEvent(is_success, null);
        });
    }
    protected void OnQuery_SWITCH_FAVORITE()
    {
        SkillItemInfo skillItemInfo = itemData as SkillItemInfo;

        if (skillItemInfo != null)
        {
            GameSection.StayEvent();
            MonoBehaviourSingleton <StatusManager> .I.SendInventorySkillLock(skillItemInfo.uniqueID, delegate(bool is_success, SkillItemInfo recv_item)
            {
                ItemDetailSkill itemDetailSkill = this;
                if (is_success)
                {
                    if (recv_item.isFavorite)
                    {
                        SetActive(detailBase, UI.TWN_UNFAVORITE, false);
                        SetActive(detailBase, UI.TWN_FAVORITE, true);
                        ResetTween(detailBase, UI.TWN_FAVORITE, 0);
                        PlayTween(detailBase, UI.TWN_FAVORITE, true, delegate
                        {
                            GameSection.ChangeStayEvent("FAVORITE", null);
                            GameSection.ResumeEvent(is_success, null);
                        }, true, 0);
                    }
                    else
                    {
                        SetActive(detailBase, UI.TWN_FAVORITE, false);
                        SetActive(detailBase, UI.TWN_UNFAVORITE, true);
                        ResetTween(detailBase, UI.TWN_UNFAVORITE, 0);
                        PlayTween(detailBase, UI.TWN_UNFAVORITE, true, delegate
                        {
                            GameSection.ChangeStayEvent("RELEASE_FAVORITE", null);
                            GameSection.ResumeEvent(is_success, null);
                        }, true, 0);
                    }
                    itemData = recv_item;
                }
                else
                {
                    GameSection.ResumeEvent(is_success, null);
                }
            });
        }
    }
    private void OnQuery_OK()
    {
        List <string> list  = new List <string>();
        List <int>    list2 = new List <int>();

        list.Add(itemData.GetUniqID().ToString());
        list2.Add(sellNum);
        GameSection.StayEvent();
        MonoBehaviourSingleton <ItemExchangeManager> .I.SendSellQuest(list, list2, delegate(bool is_success, SellQuestItemReward reward, List <uint> empty_quest_item_list)
        {
            empty_quest_item_list.ForEach(delegate(uint empty_data)
            {
                if (itemData.GetTableID() == empty_data)
                {
                    GameSection.ChangeStayEvent("CLOSE_DETAIL", null);
                }
            });
            GameSection.ResumeEvent(is_success, null);
        });
    }
Exemple #30
0
 public void OnQuery_OK()
 {
     if (isDelivery)
     {
         GameSection.StayEvent();
         MonoBehaviourSingleton <QuestManager> .I.SendGetDeliveryList(delegate(bool b)
         {
             GameSection.ChangeStayEvent("FROM_DELIVERY", null);
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (isStoryComplete)
     {
         GameSection.ChangeEvent("TO_SELECT", null);
     }
     else
     {
         GameSection.BackSection();
     }
 }