Exemplo n.º 1
0
        public void ReadLocalData()
        {
            string text = FileMgr.loadString(FileMgr.TYPE_AUTO, "setting");
            bool   flag = string.IsNullOrEmpty(text);

            if (flag)
            {
                this.SetDefault();
            }
            else
            {
                try
                {
                    string[] array = text.Split(new char[]
                    {
                        '|'
                    });
                    int  num   = 0;
                    int  num2  = int.Parse(array[num++]);
                    bool flag2 = num2 != this.version;
                    if (flag2)
                    {
                        throw new Exception("Autoplay local data version is not match!");
                    }
                    this.NHpLower = int.Parse(array[num++]);
                    this.NMpLower = int.Parse(array[num++]);
                    num++;
                    this.BuyDrug            = int.Parse(array[num++]);
                    this.PickEqp            = int.Parse(array[num++]);
                    this.PickMat            = int.Parse(array[num++]);
                    this.EqpProc            = int.Parse(array[num++]);
                    this.PickEqp_cailiao    = int.Parse(array[num++]);
                    this.PickPet_cailiao    = int.Parse(array[num++]);
                    this.PickWing_cailiao   = int.Parse(array[num++]);
                    this.PickSummon_cailiao = int.Parse(array[num++]);
                    this.PickDrugs          = int.Parse(array[num++]);
                    this.PickGold           = int.Parse(array[num++]);
                    this.PickOther          = int.Parse(array[num++]);
                    this.EqpType            = int.Parse(array[num++]);
                    this.Skills[0]          = int.Parse(array[num++]);
                    this.Skills[1]          = int.Parse(array[num++]);
                    this.Skills[2]          = int.Parse(array[num++]);
                    this.Skills[3]          = int.Parse(array[num++]);
                    num++;
                    this.Avoid          = int.Parse(array[num++]);
                    this.AutoPK         = int.Parse(array[num++]);
                    this.StoneRespawn   = int.Parse(array[num++]);
                    this.GoldRespawn    = int.Parse(array[num++]);
                    this.RespawnLimit   = int.Parse(array[num++]);
                    this.RespawnUpBound = int.Parse(array[num++]);
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                    FileMgr.removeFile(FileMgr.TYPE_AUTO, "setting");
                    this.SetDefault();
                }
            }
        }
Exemplo n.º 2
0
        public void ReadLocalData()
        {
            string localInfo = FileMgr.loadString(FileMgr.TYPE_AUTO, "setting");

            if (string.IsNullOrEmpty(localInfo))
            {
                SetDefault();
            }
            else
            {
                try
                {
                    string[] sstr         = localInfo.Split('|');
                    int      i            = 0;
                    int      localversion = int.Parse(sstr[i++]);
                    if (localversion != version)
                    {
                        throw new Exception("Autoplay local data version is not match!");
                    }
                    NHpLower = int.Parse(sstr[i++]);
                    NMpLower = int.Parse(sstr[i++]);
                    i++;
                    //MHpLower = int.Parse(sstr[i++]);
                    BuyDrug = int.Parse(sstr[i++]);
                    PickEqp = int.Parse(sstr[i++]);
                    PickMat = int.Parse(sstr[i++]);
                    EqpProc = int.Parse(sstr[i++]);

                    PickEqp_cailiao    = int.Parse(sstr[i++]);
                    PickPet_cailiao    = int.Parse(sstr[i++]);
                    PickWing_cailiao   = int.Parse(sstr[i++]);
                    PickSummon_cailiao = int.Parse(sstr[i++]);
                    PickDrugs          = int.Parse(sstr[i++]);
                    PickGold           = int.Parse(sstr[i++]);
                    PickOther          = int.Parse(sstr[i++]);

                    EqpType   = int.Parse(sstr[i++]);
                    Skills[0] = int.Parse(sstr[i++]);
                    Skills[1] = int.Parse(sstr[i++]);
                    Skills[2] = int.Parse(sstr[i++]);
                    Skills[3] = int.Parse(sstr[i++]);
                    for (int j = 0; j < 4; j++) // validate skills
                    {
                        skill_a3Data skdata = null;
                        Skill_a3Model.getInstance().skilldic.TryGetValue(Skills[j], out skdata);
                        if (skdata != null && skdata.now_lv == 0)
                        {
                            Skills[j] = 0;
                        }
                    }
                    i++;
                    //Scope =  int.Parse(sstr[i++]);
                    Avoid          = int.Parse(sstr[i++]);
                    AutoPK         = int.Parse(sstr[i++]);
                    StoneRespawn   = int.Parse(sstr[i++]);
                    GoldRespawn    = int.Parse(sstr[i++]);
                    RespawnLimit   = int.Parse(sstr[i++]);
                    RespawnUpBound = int.Parse(sstr[i++]);
                }
                catch (System.Exception ex)
                {
                    Debug.Log(ex.Message);
                    FileMgr.removeFile(FileMgr.TYPE_AUTO, "setting");
                    SetDefault();
                }
            }
        }