protected void JumpMap()
    {
        if (FieldManager.HasWorldMap(targetMapID))
        {
            FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(targetMapID);

            if (Array.IndexOf(MonoBehaviourSingleton <WorldMapManager> .I.GetOpenRegionIdList(), fieldMapData.regionId) < 0)
            {
                RegionTable.Data data = Singleton <RegionTable> .I.GetData(fieldMapData.regionId);

                GameSection.ChangeEvent("NOT_OPEN", new object[1]
                {
                    data.regionName
                });
                return;
            }
        }
        MonoBehaviourSingleton <WorldMapManager> .I.PushDisplayQuestTarget((int)targetMapID, targetPortalID);

        MonoBehaviourSingleton <WorldMapManager> .I.ignoreTutorial = true;
        bool flag = true;

        if (Singleton <TutorialMessageTable> .IsValid())
        {
            TutorialReadData readData = Singleton <TutorialMessageTable> .I.ReadData;
            flag = readData.HasRead(10003);
        }
        bool flag2 = false;

        DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)deliveryID);

        if (deliveryTableData != null && deliveryTableData.type == DELIVERY_TYPE.STORY && 10100011 >= deliveryID && !flag)
        {
            flag2 = true;
            if (Singleton <TutorialMessageTable> .IsValid())
            {
                TutorialReadData readData2 = Singleton <TutorialMessageTable> .I.ReadData;
                readData2.SetReadId(10003, true);
                readData2.Save();
            }
        }
        if (flag2)
        {
            RequestEvent("DIRECT_REGION_TUTORIAL", null);
        }
        else
        {
            RequestEvent("DIRECT_REGION_QUEST", null);
        }
    }
示例#2
0
    public static void ResetAccount()
    {
        GameSaveData.Delete();
        if (MonoBehaviourSingleton <AccountManager> .IsValid())
        {
            MonoBehaviourSingleton <AccountManager> .I.ClearAccount();
        }
        FieldRewardPool.DeleteSave();
        PlayerPrefs.SetInt("LastNewsID", -1);
        new DataTableCache(null).RemoveAll();
        TutorialReadData.DeleteSave();
        if (Singleton <TutorialMessageTable> .IsValid() && Singleton <TutorialMessageTable> .I.ReadData != null)
        {
            Singleton <TutorialMessageTable> .I.ReadData.LoadSaveData();

            Singleton <TutorialMessageTable> .I.ReadData.Save();
        }
        Native.ResetPackagePreferences();
    }
    public static TutorialReadData CreateAndLoad()
    {
        SaveData saveData = null;

        if (HasSave())
        {
            string @string = PlayerPrefs.GetString("TutorialProgress");
            saveData = JSONSerializer.Deserialize <SaveData>(@string);
            if (saveData == null)
            {
                Log.Error("JSONSerializer.Deserialize<TutorialReadData.SaveData> {0}", @string);
                return(null);
            }
        }
        else
        {
            saveData = new SaveData();
        }
        TutorialReadData tutorialReadData = new TutorialReadData();

        tutorialReadData.LoadSaveData();
        tutorialReadData.UpdateReadAllFlag();
        return(tutorialReadData);
    }
示例#4
0
    public void SendCheckRegister(string ntc_data, Action <bool> call_back)
    {
        CheckRegisterModel.RequestSendForm requestSendForm = new CheckRegisterModel.RequestSendForm();
        requestSendForm.data = ntc_data;
        Protocol.Send(CheckRegisterModel.URL, requestSendForm, delegate(CheckRegisterModel ret)
        {
            switch (ret.Error)
            {
            case Error.None:
                MonoBehaviourSingleton <UserInfoManager> .I.SetRecvUserInfo(ret.result.userInfo, ret.result.tutorialStep);
                MonoBehaviourSingleton <UserInfoManager> .I.SetNewsID(ret.result.newsId);
                MonoBehaviourSingleton <UserInfoManager> .I.userIdHash = ret.result.userIdHash;
                sendAsset = ret.result.sendAsset;
                if (ret.result.recommendUpdate)
                {
                    RecommendUpdateCheck(delegate
                    {
                        call_back(true);
                    });
                }
                else if (call_back != null)
                {
                    call_back(true);
                }
                break;

            case Error.ERR_AUTH_FAILED:
                if (string.IsNullOrEmpty(account.token))
                {
                    if (ret.result.recommendUpdate)
                    {
                        RecommendUpdateCheck(delegate
                        {
                            call_back(false);
                        });
                    }
                    else if (call_back != null)
                    {
                        call_back(false);
                    }
                }
                else
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.YES_NO, StringTable.GetErrorMessage((uint)ret.Error), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 101u), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 102u), null, null), delegate(string btn)
                    {
                        if (btn == "YES")
                        {
                            GameSceneEvent.PopStay();
                            ResetAccount();
                            TutorialReadData.SaveAsEmptyData();
                            SaveAsEmptyData();
                            MonoBehaviourSingleton <AppMain> .I.Reset();
                        }
                        else
                        {
                            SendCheckRegister(ntc_data, call_back);
                        }
                    }, true, (int)ret.Error);
                }
                break;

            case Error.WRN_MAINTENANCE:
                OpenMessageDialog(ret.Error, delegate
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.OpenInfoDialog(delegate
                    {
                        SendCheckRegister(ntc_data, call_back);
                    }, true);
                });
                break;

            case Error.WRN_UPDATE_FORCE:
                OpenMessageDialog(ret.Error, delegate
                {
                    Native.launchMyselfMarket();
                    SendCheckRegister(ntc_data, call_back);
                });
                break;

            case Error.WRN_BAN_USER:
                OpenMessageDialog(ret.Error, delegate
                {
                    SendCheckRegister(ntc_data, call_back);
                });
                break;

            case Error.WRN_RESIGNED_USER:
                OpenMessageDialog(ret.Error, delegate
                {
                    SendCheckRegister(ntc_data, call_back);
                });
                break;

            default:
                OpenYesNoDialog(ret.Error, delegate(string sel)
                {
                    if ("YES" == sel)
                    {
                        SendCheckRegister(ntc_data, call_back);
                    }
                    else
                    {
                        Application.Quit();
                    }
                });
                break;
            }
        }, string.Empty);
    }
示例#5
0
    public TutorialMessageData GetEnableExecTutorial(string section_name, bool is_force, bool is_new_section, string event_name = null)
    {
        TutorialReadData           save_data = Singleton <TutorialMessageTable> .I.ReadData;
        List <TutorialMessageData> list      = new List <TutorialMessageData>();

        tutorialSectionMessages.ForEach(delegate(TutorialMessageData o)
        {
            if (!(o.sectionName != section_name))
            {
                if (!TutorialStep.HasAllTutorialCompleted() && o.completedTutorialStep != -1)
                {
                    if (o.completedTutorialStep == 0 || (MonoBehaviourSingleton <UserInfoManager> .IsValid() && MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep >= o.completedTutorialStep) || (o.sceneName == "StatusScene" && o.sectionName == "StatusTop" && o.messageId == 1 && TutorialStep.isChangeLocalEquip))
                    {
                        return;
                    }
                }
                else if ((o.completedTutorialStep != 0 && o.completedTutorialStep != -1) || (!is_force && !o.GetFinishTutorialBit().HasValue&& o.completedTutorialStep >= 0 && save_data.HasRead(o.tutorialId)) || (o.appearId > 0 && !save_data.HasRead(o.appearId)) || (o.appearId < 0 && save_data.LastRead() != -o.appearId))
                {
                    return;
                }
                if (o.GetFinishTutorialBit().HasValue)
                {
                    TUTORIAL_MENU_BIT value = o.GetFinishTutorialBit().Value;
                    if (MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(value))
                    {
                        return;
                    }
                }
                if (o.GetAppearTutorialBit().HasValue)
                {
                    TUTORIAL_MENU_BIT value2 = o.GetAppearTutorialBit().Value;
                    if (!MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(value2))
                    {
                        return;
                    }
                }
                if ((o.appearDeliveryId == 0 || (MonoBehaviourSingleton <DeliveryManager> .IsValid() && MonoBehaviourSingleton <DeliveryManager> .I.IsClearDelivery((uint)o.appearDeliveryId))) && (!o.isNewSectionOnly || is_new_section))
                {
                    if (!string.IsNullOrEmpty(event_name))
                    {
                        if (o.triggerEventName != event_name)
                        {
                            return;
                        }
                    }
                    else if (!string.IsNullOrEmpty(o.triggerEventName))
                    {
                        return;
                    }
                    if ((!(o.sectionName == "WorldMap") && !(o.sectionName == "RegionMap")) || !string.IsNullOrEmpty(event_name) || !MonoBehaviourSingleton <WorldMapManager> .IsValid() || (!MonoBehaviourSingleton <WorldMapManager> .I.isDisplayQuestTargetMode() && !MonoBehaviourSingleton <WorldMapManager> .I.ignoreTutorial))
                    {
                        if (o.sectionName == "EquipSetDetailAttachSkillDialog" && !string.IsNullOrEmpty(o.checkKeyword))
                        {
                            uint target_id = uint.Parse(o.checkKeyword);
                            bool find_non_equip_attack_skill = false;
                            MonoBehaviourSingleton <InventoryManager> .I.ForAllSkillItemInventory(delegate(SkillItemInfo data)
                            {
                                if (!find_non_equip_attack_skill && data != null && data.tableData.type == SKILL_SLOT_TYPE.ATTACK && !data.isAttached && target_id != data.tableID)
                                {
                                    find_non_equip_attack_skill = true;
                                }
                            });
                            if (!find_non_equip_attack_skill)
                            {
                                return;
                            }
                            bool is_equip_first_slot = false;
                            if (MonoBehaviourSingleton <StatusManager> .I.GetLocalEquipSet() == null)
                            {
                                MonoBehaviourSingleton <StatusManager> .I.CreateLocalEquipSetData();
                            }
                            int eSetNo = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.eSetNo;
                            EquipItemInfo main_weapon = MonoBehaviourSingleton <StatusManager> .I.GetLocalEquipSet()[eSetNo].item[0];
                            if (main_weapon != null)
                            {
                                MonoBehaviourSingleton <InventoryManager> .I.ForAllSkillItemInventory(delegate(SkillItemInfo data)
                                {
                                    if (!is_equip_first_slot && data != null)
                                    {
                                        EquipSetSkillData equipSetSkillData = data.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo());
                                        if (equipSetSkillData != null && equipSetSkillData.equipItemUniqId == main_weapon.uniqueID && equipSetSkillData.equipSlotNo == 0)
                                        {
                                            is_equip_first_slot = true;
                                        }
                                    }
                                });
                            }
                            if (!is_equip_first_slot)
                            {
                                int index = o.messageData.Count - 1;
                                o.messageData[index].waitEventName = o.messageData[index].waitEventName.Replace("_DETAIL", string.Empty);
                                Debug.LogWarning((object)("replace : " + o.messageData[index].waitEventName));
                            }
                        }
                        list.Add(o);
                    }
                }
            }
        });
        if (list.Count == 0)
        {
            return(null);
        }
        list.Sort((TutorialMessageData l, TutorialMessageData r) => l.messageId - r.messageId);
        return(list[0]);
    }