コード例 #1
0
        /// <summary>
        /// 角色加点取系数
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static Dictionary <uint, float> GetAddProperty(string key)
        {
            List <string> data_attr_conv = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_attr_conv", "csv_id", key, "client_attrs");

            if (data_attr_conv.Count == 0)
            {
                return(null);
            }
            string raw = data_attr_conv[0];

            raw = raw.Replace(" ", "");
            var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");
            Dictionary <uint, float> list = new Dictionary <uint, float>();

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint id    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    var  value = (DBTextResource.ParseF(_match.Groups[2].Value) / 100.0f);
                    list.Add(id, value);
                }
            }
            return(list);
        }
コード例 #2
0
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            m_AnimationInfos.Clear();
            AnimationInfo info;

            while (reader.Read())
            {
                info        = new AnimationInfo();
                info.Anchor = GetReaderString(reader, "anchor");

                uint ani_count = DBTextResource.ParseUI(GetReaderString(reader, "ani_count"));
                info.AnimationName = new string[ani_count];

                for (int i = 0; i < ani_count; ++i)
                {
                    info.AnimationName[i] = GetReaderString(reader, "ani_" + i);
                }

                m_AnimationInfos[info.Anchor] = info;
            }
        }
コード例 #3
0
        public static List <Dictionary <uint, float> > GetRecommendAttrByVocation(uint vocation)
        {
            List <Dictionary <uint, float> > finalList = new List <Dictionary <uint, float> >();
            List <string> lvpoint_recommend            = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "lvpoint_recommend", "vocation", vocation.ToString(), "recommend_attr");

            if (lvpoint_recommend.Count == 0)
            {
                return(finalList);
            }
            string raw = lvpoint_recommend[0];

            raw = raw.Replace(" ", "");
            var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    Dictionary <uint, float> list = new Dictionary <uint, float>();
                    uint id    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    var  value = (DBTextResource.ParseF(_match.Groups[2].Value) / 100.0f);
                    list.Add(id, value);
                    finalList.Add(list);
                }
            }
            return(finalList);
        }
コード例 #4
0
        private DBAndroidMajiaItem GetItemInfo(uint app_id)
        {
            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "app_id", app_id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                data[app_id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                data[app_id] = null;
                reader.Close();
                reader.Dispose();
                return(null);
            }

            DBAndroidMajiaItem ad = new DBAndroidMajiaItem();

            ad.AppID          = app_id;
            ad.ShowUserCenter = DBTextResource.ParseUI(GetReaderString(reader, "show_user_center")) == 1;
            ad.ShowLogo       = DBTextResource.ParseUI(GetReaderString(reader, "show_logo")) == 1;
            ad.ShowKv         = DBTextResource.ParseUI(GetReaderString(reader, "show_kv")) == 1;
            ad.ShowEffect     = DBTextResource.ParseUI(GetReaderString(reader, "show_effect")) == 1;
            data.Add(ad.AppID, ad);

            reader.Close();
            reader.Dispose();
            return(ad);
        }
コード例 #5
0
ファイル: DBGuide.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            while (reader.Read())
            {
                var guide = new GuideData();

                guide.Id              = DBTextResource.ParseUI(GetReaderString(reader, "guide_id"));
                guide.Priority        = DBTextResource.ParseUS(GetReaderString(reader, "priority"));
                guide.PreSys          = DBTextResource.ParseUI(GetReaderString(reader, "sys"));
                guide.MinLevel        = DBTextResource.ParseUI(GetReaderString(reader, "min_level"));
                guide.MaxLevel        = DBTextResource.ParseUI(GetReaderString(reader, "max_level"));
                guide.InstanceType    = DBTextResource.ParseI_s(GetReaderString(reader, "inst_type"), -1);
                guide.InstanceSubType = DBTextResource.ParseI_s(GetReaderString(reader, "inst_sub_type"), -1);
                guide.TriggerType     = (GuideData.GuideTrigger)Enum.Parse(typeof(GuideData.GuideTrigger), GetReaderString(reader, "trigger_type"));
                guide.TriggerParams   = new List <uint>();
                string[] param = TextHelper.GetListFromString(GetReaderString(reader, "trigger_params"));
                if (param != null)
                {
                    foreach (string s in param)
                    {
                        guide.TriggerParams.Add(DBTextResource.ParseUI_s(s, 0));
                    }
                }

                string rawStr = GetReaderString(reader, "auto_fight_when_finish");
                if (string.IsNullOrEmpty(rawStr) == true || rawStr.Equals("0") == true)
                {
                    guide.AutoFightWhenFinish = false;
                }
                else
                {
                    guide.AutoFightWhenFinish = true;
                }

                guide.TimelineWhenFinish = DBTextResource.ParseUI_s(GetReaderString(reader, "timeline_when_finish"), 0);

                rawStr = GetReaderString(reader, "guide_main_task_when_finish_and_return_main_wnd");
                if (string.IsNullOrEmpty(rawStr) == true || rawStr.Equals("0") == true)
                {
                    guide.GuideMainTaskWhenFinishAndReturnMainWnd = false;
                }
                else
                {
                    guide.GuideMainTaskWhenFinishAndReturnMainWnd = true;
                }

                guide.IsFinished = false;

                Guides.Add(guide.Id, guide);
                GuideList.Add(guide);
            }

            GuideList.Sort();
        }
コード例 #6
0
        List <DBSuitAttrInfo> GetItemInfo(uint id, uint lv)
        {
            uint   uid    = MakeUID(id, lv);
            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\" AND {0}.{3}=\"{4}\"", mTableName, "id", id, "lv", lv);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInfos[uid] = null;
                return(null);
            }

            if (!reader.HasRows)
            {
                mInfos[uid] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            List <DBSuitAttrInfo> attrInfos = null;

            while (reader.Read())
            {
                DBSuitAttrInfo info = new DBSuitAttrInfo();
                info.Id       = id;
                info.Lv       = lv;
                info.Num      = DBTextResource.ParseBT_s(GetReaderString(reader, "num"), 0);
                info.EffectId = DBTextResource.ParseUI_s(GetReaderString(reader, "effect_id"), 0);

                string raw = GetReaderString(reader, "base_attr");
                raw = raw.Replace(" ", "");
                var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");
                info.BasicAttrs = new ActorAttribute();
                foreach (Match _match in matchs)
                {
                    if (_match.Success)
                    {
                        uint attrId  = (DBTextResource.ParseUI(_match.Groups[1].Value));
                        var  attrVal = DBTextResource.ParseUI(_match.Groups[2].Value);
                        info.BasicAttrs.Add(attrId, attrVal);
                    }
                }

                if (attrInfos == null)
                {
                    attrInfos = new List <DBSuitAttrInfo>();
                }

                attrInfos.Add(info);
            }

            mInfos[uid] = attrInfos;
            reader.Close();
            reader.Dispose();
            return(attrInfos);
        }
コード例 #7
0
        /// <summary>
        /// 获取一个洗练属性标准值配置信息
        /// </summary>
        /// <param name="posId"></param>
        /// <returns></returns>
        public DBBaptizeCostInfo GetOneInfo(uint id)
        {
            DBBaptizeCostInfo info;

            if (mInfos.TryGetValue(id, out info))
            {
                return(info);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "num", id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInfos[id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mInfos[id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            info = new DBBaptizeCostInfo();

            info.Num         = DBTextResource.ParseUI_s(GetReaderString(reader, "num"), 0);
            info.CostDiamond = DBTextResource.ParseUI_s(GetReaderString(reader, "cost_diamond"), 0);

            string raw = GetReaderString(reader, "cost_goods");

            info.CostGoods = new List <KeyValuePair <uint, uint> >();
            info.CostGoods.Clear();
            raw = raw.Replace(" ", "");
            var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint goodsId = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    uint num     = DBTextResource.ParseUI(_match.Groups[2].Value);
                    KeyValuePair <uint, uint> goods = new KeyValuePair <uint, uint>(goodsId, num);

                    info.CostGoods.Add(goods);
                }
            }

            mInfos[info.Num] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #8
0
        public ActorAttribute GetGoodsShowAttr(uint gid)
        {
            ActorAttribute attr = null;

            if (mGoodsShowAttrsInfos.TryGetValue(gid, out attr))
            {
                return(attr);
            }

            string query_str    = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "gid", gid.ToString());
            var    table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query_str);

            if (table_reader == null)
            {
                mGoodsShowAttrsInfos[gid] = null;
                return(null);
            }

            if (!table_reader.HasRows)
            {
                mGoodsShowAttrsInfos[gid] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            if (!table_reader.Read())
            {
                mGoodsShowAttrsInfos[gid] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            attr = new ActorAttribute();
            string attrsStr = GetReaderString(table_reader, "attrs");

            attrsStr = attrsStr.Replace(" ", "");
            var matchs = Regex.Matches(attrsStr, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint attrId    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    uint attrValue = DBTextResource.ParseUI(_match.Groups[2].Value);
                    attr.Add(attrId, attrValue);
                }
            }

            mGoodsShowAttrsInfos[gid] = attr;

            table_reader.Close();
            table_reader.Dispose();

            return(attr);
        }
コード例 #9
0
        public DBWeddingRingGoodsItem GetData(uint id_info)
        {
            DBWeddingRingGoodsItem ad = null;

            if (data.TryGetValue(id_info, out ad))
            {
                return(ad);
            }



            string query_str    = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", "data_ring", "id", id_info.ToString());
            var    table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, "data_ring", query_str);

            if (table_reader == null)
            {
                data[id_info] = null;
                return(null);
            }

            if (!table_reader.HasRows)
            {
                data[id_info] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            if (!table_reader.Read())
            {
                data[id_info] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            ad          = new DBWeddingRingGoodsItem();
            ad.id_info  = DBTextResource.ParseUI(GetReaderString(table_reader, "id"));
            ad.step     = DBTextResource.ParseUI(GetReaderString(table_reader, "step"));
            ad.lv       = DBTextResource.ParseUI(GetReaderString(table_reader, "lv"));
            ad.need_exp = DBTextResource.ParseUI(GetReaderString(table_reader, "need_exp"));

            ad.normal_attrs = DBTextResource.ParseDBAttrItems(GetReaderString(table_reader, "normal_attrs"));
            ad.couple_attrs = DBTextResource.ParseDBAttrItems(GetReaderString(table_reader, "couple_attrs"));

            ad.skill = DBTextResource.ParseUI(GetReaderString(table_reader, "skill"));
            ad.gid   = DBTextResource.ParseUI(GetReaderString(table_reader, "gid"));

            data.Add(ad.id_info, ad);

            table_reader.Close();
            table_reader.Dispose();

            return(ad);
        }
コード例 #10
0
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }
            mInfos.Clear();
            mSortInfos.Clear();
            while (reader.Read())
            {
                var tmp_info = new TrialBossItem();
                tmp_info.DgnId             = DBTextResource.ParseUI(GetReaderString(reader, "dgn_id")); //副本ID
                tmp_info.TrialType         = DBTextResource.ParseUI(GetReaderString(reader, "type"));
                tmp_info.Rank              = DBTextResource.ParseUI(GetReaderString(reader, "rank"));
                tmp_info.ActorId           = DBTextResource.ParseUI(GetReaderString(reader, "actor_id"));
                tmp_info.ShowAward         = DBTextResource.ParseDBGoodsItem(GetReaderString(reader, "show_award"));
                tmp_info.ShowAssistAward   = DBTextResource.ParseDBGoodsItem(GetReaderString(reader, "show_assist_award"));
                tmp_info.ModelCameraOffset = DBTextResource.ParseVector3(GetReaderString(reader, "model_camera_offset"));
                tmp_info.DefaultAngles     = DBTextResource.ParseVector3(GetReaderString(reader, "default_angles"));
                tmp_info.CameraViewField   = DBTextResource.ParseF(GetReaderString(reader, "camera_view_field"));
                tmp_info.CameraRotate      = DBTextResource.ParseVector3(GetReaderString(reader, "camera_rotate"));
                tmp_info.DefaultActionName = GetReaderString(reader, "default_action_name");
                tmp_info.Icon              = GetReaderString(reader, "icon");

                if (mInfos.ContainsKey(tmp_info.DgnId) == false)
                {
                    mInfos.Add(tmp_info.DgnId, tmp_info);
                    if (mSortInfos.ContainsKey(tmp_info.TrialType) == false)
                    {
                        mSortInfos.Add(tmp_info.TrialType, new List <TrialBossItem>());
                    }
                    mSortInfos[tmp_info.TrialType].Add(tmp_info);
                }
                else
                {
                    GameDebug.LogError("DBTrialBoss contain the same info; Dgn_id = " + tmp_info.DgnId);
                }
            }

            foreach (var item in mSortInfos)
            {
                mSortInfos[item.Key].Sort((a, b) => {
                    if (a.Rank < b.Rank)
                    {
                        return(-1);
                    }
                    else if (a.Rank > b.Rank)
                    {
                        return(1);
                    }
                    return(0);
                });
            }
        }
コード例 #11
0
ファイル: DBMagicEquip.cs プロジェクト: wuhuolong/MaxBooks
        private DBMagicEquipItem GetItemInfo(uint gid)
        {
            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "gid", gid);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                data[gid] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                data[gid] = null;
                reader.Close();
                reader.Dispose();
                return(null);
            }

            DBMagicEquipItem ad = new DBMagicEquipItem();

            ad.Gid               = gid;
            ad.PosId             = DBTextResource.ParseUI(GetReaderString(reader, "pos_id"));
            ad.StrengthMax       = DBTextResource.ParseUI(GetReaderString(reader, "max_lv"));
            ad.Star              = DBTextResource.ParseUI(GetReaderString(reader, "star"));
            ad.SwallowExpValue   = DBTextResource.ParseUI(GetReaderString(reader, "exp"));
            ad.DefaultAppendDesc = GetReaderString(reader, "default_append_desc");

            ad.BaseAttrs = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "base_attrs"));

            uint num = 0;

            string appendAttrStr = GetReaderString(reader, "spec_attrs");

            appendAttrStr = appendAttrStr.Replace(" ", "");
            var matchs = Regex.Matches(appendAttrStr, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    num = num + DBTextResource.ParseUI(_match.Groups[2].Value);
                }
            }

            ad.AppendAttrNum = num;

            data.Add(ad.Gid, ad);

            reader.Close();
            reader.Dispose();
            return(ad);
        }
コード例 #12
0
ファイル: DBEquipSubAttr.cs プロジェクト: wuhuolong/MaxBooks
        public EquipSubAttrData GetSubAttrData(uint sub_attr_id)
        {
            EquipSubAttrData data = null;

            if (EquipSubAttrDescs.TryGetValue(sub_attr_id, out data))
            {
                return(data);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", sub_attr_id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                EquipSubAttrDescs[sub_attr_id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                EquipSubAttrDescs[sub_attr_id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            var id      = DBTextResource.ParseUI(GetReaderString(reader, "id"));
            var des     = GetReaderString(reader, "desc");
            var tmp_str = GetReaderString(reader, "attr_type");

            tmp_str = tmp_str.Substring(1, tmp_str.Length - 2);
            var         _tmp_split = tmp_str.Split(',');
            List <uint> at_type    = new List <uint>();
            uint        c          = 0;

            for (int i = 0; i < _tmp_split.Length; i++)
            {
                if (uint.TryParse(_tmp_split[i], out c))
                {
                    if (c != 9)
                    {
                        at_type.Add(c);
                    }
                }
            }
            data = new EquipSubAttrData(id, des, at_type);
            EquipSubAttrDescs.Add(id, data);

            reader.Close();
            reader.Dispose();
            return(data);
        }
コード例 #13
0
ファイル: DBSoulLv.cs プロジェクト: wuhuolong/MaxBooks
        public SoulLvInfo GetData(string csvId)
        {
            SoulLvInfo info = null;

            if (mInfos.TryGetValue(csvId, out info))
            {
                return(info);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "csv_id", csvId);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInfos[csvId] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mInfos[csvId] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            info       = new SoulLvInfo();
            info.cream = DBTextResource.ParseUI(GetReaderString(reader, "cream"));
            var attr = GetReaderString(reader, "attr");

            attr = attr.Replace(" ", "");
            var matchs = Regex.Matches(attr, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint attrId    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    uint attrValue = DBTextResource.ParseUI(_match.Groups[2].Value);
                    info.attr[attrId] = attrValue;
                }
            }

            mInfos[csvId] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #14
0
ファイル: DBSuitRefine.cs プロジェクト: wuhuolong/MaxBooks
        /// <summary>
        /// 通过csv_id来获取指定的套装精炼数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DBSuitRefineItem GetData(string id)
        {
            DBSuitRefineItem ad = null;

            if (data.TryGetValue(id, out ad))
            {
                return(ad);
            }

            string query_str    = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "csv_id", id);
            var    table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query_str);

            if (table_reader == null)
            {
                data[id] = null;
                return(null);
            }

            if (!table_reader.HasRows)
            {
                data[id] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            if (!table_reader.Read())
            {
                data[id] = null;
                table_reader.Close();
                table_reader.Dispose();
                return(null);
            }

            ad          = new DBSuitRefineItem();
            ad.Id       = GetReaderString(table_reader, "csv_id");
            ad.Pos      = DBTextResource.ParseUI(GetReaderString(table_reader, "pos"));
            ad.Step     = DBTextResource.ParseUI(GetReaderString(table_reader, "step"));
            ad.Level    = DBTextResource.ParseUI(GetReaderString(table_reader, "lv"));
            ad.Cost     = DBTextResource.ParseDBGoodsItem(GetReaderString(table_reader, "costs"));
            ad.Addition = GetReaderUint(table_reader, "addition");

            data[ad.Id] = ad;

            table_reader.Close();
            table_reader.Dispose();

            return(ad);
        }
コード例 #15
0
ファイル: GoodsDecorate.cs プロジェクト: wuhuolong/MaxBooks
        public void UpdateAttr(uint gid, Net.PkgGoodsInfo decorate)
        {
            NetDecorate = decorate;

            if (BasicAttrs == null)
            {
                BasicAttrs = new ActorAttribute();
            }
            else
            {
                BasicAttrs.Clear();
            }

            if (LegendAttrs == null)
            {
                LegendAttrs = new EquipAttributes();
            }
            else
            {
                LegendAttrs.Clear();
            }

            var rec = DBDecorate.Instance.GetData(gid);

            if (rec != null)
            {
                string raw = rec.Attrs;
                raw = raw.Replace(" ", "");

                var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");
                foreach (Match _match in matchs)
                {
                    if (_match.Success)
                    {
                        uint attrId    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                        uint attrValue = DBTextResource.ParseUI(_match.Groups[2].Value);
                        BasicAttrs.Add(attrId, attrValue);
                    }
                }
            }

            if (decorate != null && decorate.decorate != null && decorate.decorate.legend_attrs != null)
            {
                foreach (var attr in decorate.decorate.legend_attrs)
                {
                    LegendAttrs.Add(attr.id, attr.vals);
                }
            }
        }
コード例 #16
0
ファイル: DBSuitEffect.cs プロジェクト: wuhuolong/MaxBooks
        SuitEffectInfo GetItemInfo(uint id)
        {
            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mSuitEffectInfos[id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mSuitEffectInfos[id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }


            SuitEffectInfo info = new SuitEffectInfo();

            info.id          = id;
            info.effect_type = DBTextResource.ParseUI(GetReaderString(reader, "effect_type"));
            int effect_count = DBTextResource.ParseI(GetReaderString(reader, "effect_count"));

            info.bind_infos = new List <BindInfo>(effect_count);

            for (int i = 0; i < effect_count; ++i)
            {
                var bind_info = new BindInfo();
                bind_info.model_id     = DBTextResource.ParseUI(GetReaderString(reader, "model_id_" + (i + 1)));
                bind_info.low_model_id = DBTextResource.ParseUI(GetReaderString(reader, "low_model_id_" + (i + 1)));
                bind_info.ui_model_id  = DBTextResource.ParseUI(GetReaderString(reader, "ui_model_id_" + (i + 1)));
                if (bind_info.ui_model_id == 0)
                {
                    bind_info.ui_model_id = bind_info.model_id;
                }
                bind_info.bind_node = GetReaderString(reader, "bind_node_" + (i + 1));
                info.bind_infos.Add(bind_info);
            }

            mSuitEffectInfos[info.id] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #17
0
ファイル: DBSkillTotal.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            base.ParseData(reader);

            mSkillInfos.Clear();

            int fieldCount = reader.FieldCount;

            while (reader.Read())
            {
                SkillBasicInfo info = new SkillBasicInfo();

                for (int i = 0; i < fieldCount; i++)
                {
                    string rawName = reader.GetName(i);

                    if (rawName == "id")
                    {
                        info.Id = DBTextResource.ParseUI(reader.GetString(i));
                    }
                    else if (rawName == "show_in_ui")
                    {
                        info.ShowInUI = DBTextResource.ParseUI(reader.GetString(i));
                    }
                    else if (rawName == "name")
                    {
                        info.Name = reader.GetString(i);
                    }
                    else if (rawName == "type")
                    {
                        info.Type = DBTextResource.ParseUS_s(reader.GetString(i), 1);
                    }
                    else if (rawName == "sub_type")
                    {
                        info.SubType = DBTextResource.ParseUS_s(reader.GetString(i), 1);
                    }
                    else if (rawName == "icon")
                    {
                        info.Icon = reader.GetString(i);
                    }
                    else if (rawName == "skill_type_descript")
                    {
                        info.SkillTypeDescript = reader.GetString(i);
                    }
                }

                mSkillInfos.Add(info.Id, info);
            }
        }
コード例 #18
0
ファイル: DBEquipBase.cs プロジェクト: wuhuolong/MaxBooks
        public Dictionary <uint, uint> GetAttrInfo(uint gid)
        {
            Dictionary <uint, uint> info = null;

            if (mBaseAttrInfos.TryGetValue(gid, out info))
            {
                return(info);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "gid", gid);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mBaseAttrInfos[gid] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mBaseAttrInfos[gid] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            info = new Dictionary <uint, uint>();
            var attr = GetReaderString(reader, "base_attr");

            attr = attr.Replace(" ", "");
            var matchs = Regex.Matches(attr, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint attrId    = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    uint attrValue = DBTextResource.ParseUI(_match.Groups[2].Value);
                    info[attrId] = attrValue;
                }
            }

            mBaseAttrInfos[gid] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #19
0
        public static List <uint> ParseArrayUintAndUint(string arrayString, string del)
        {
            List <uint> list = null;

            if (arrayString.Contains("["))
            {
                list = DBTextResource.ParseArrayUint(arrayString, del);
            }
            else
            {
                list = new List <uint>();
                uint value = DBTextResource.ParseUI(arrayString);
                list.Add(value);
            }
            return(list);
        }
コード例 #20
0
        public GoodsSoul(uint typeId, Net.PkgGoodsInfo info)
        {
            CreateGoodsByTypeId(typeId);
            var data_soul = DBManager.Instance.QuerySqliteLikeKeyRow <string>(GlobalConfig.DBFile, "data_soul", "gid", type_idx.ToString());

            if (data_soul.Count > 0)
            {
                var table = data_soul[0];
                ResolveGetVal = DBTextResource.ParseUI(table["resolve"]);
            }

            if (info != null)
            {
                UpdateSoul(info.soul);
            }
        }
コード例 #21
0
        public DBTrialBossDifficultyItem GetItem(uint diff_id)
        {
            DBTrialBossDifficultyItem item;

            if (mInfos.TryGetValue(diff_id, out item))
            {
                return(item);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", diff_id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInfos[diff_id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mInfos[diff_id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            var tmp_info = new DBTrialBossDifficultyItem();

            tmp_info.DifficultyId = DBTextResource.ParseUI(GetReaderString(reader, "id"));
            tmp_info.Name         = GetReaderString(reader, "name");
            tmp_info.Color        = DBTextResource.ParseUI(GetReaderString(reader, "color"));

            if (mInfos.ContainsKey(tmp_info.DifficultyId) == false)
            {
                mInfos.Add(tmp_info.DifficultyId, tmp_info);
            }
            else
            {
                GameDebug.LogError("DBTrialBossDifficulty contain the same info; DifficultyId = " + tmp_info.DifficultyId);
            }

            reader.Close();
            reader.Dispose();

            return(tmp_info);
        }
コード例 #22
0
        DBBaptizeAttrStandardInfo GetItemInfo(uint id)
        {
            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "lv_step", id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInfos[id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mInfos[id] = null;
                reader.Close();
                reader.Dispose();
                return(null);
            }

            DBBaptizeAttrStandardInfo info = new DBBaptizeAttrStandardInfo();

            info.LvStep = id;

            info.BaseAttrs = new ActorAttribute();
            string raw = GetReaderString(reader, "base_attr");

            raw = raw.Replace(" ", "");
            var matchs = Regex.Matches(raw, @"\{(\d+),(\d+)\}");

            foreach (Match _match in matchs)
            {
                if (_match.Success)
                {
                    uint attrId  = (DBTextResource.ParseUI(_match.Groups[1].Value));
                    uint attrVal = DBTextResource.ParseUI(_match.Groups[2].Value);

                    info.BaseAttrs.Add(attrId, attrVal);
                }
            }

            mInfos[info.LvStep] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #23
0
        public DBDecorateItem GetData(uint gid)
        {
            DBDecorateItem ad = null;

            if (data.TryGetValue(gid, out ad))
            {
                return(ad);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "gid", gid);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                data[gid] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                data[gid] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            var ret = new DBDecorateItem();

            ret.Gid              = DBTextResource.ParseUI(GetReaderString(reader, "gid"));
            ret.Pos              = DBTextResource.ParseUI(GetReaderString(reader, "pos_id"));
            ret.StrengthMax      = DBTextResource.ParseUI(GetReaderString(reader, "max_lv"));
            ret.LvStep           = DBTextResource.ParseUI(GetReaderString(reader, "lv_step"));
            ret.SwallowExpValue  = DBTextResource.ParseUI(GetReaderString(reader, "value"));
            ret.Attrs            = GetReaderString(reader, "attrs");
            ret.LegendAttrs      = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "legend_attrs"));
            ret.DefaultExtraDesc = GetReaderString(reader, "default_extra_desc");
            ret.DefaultStar      = DBTextResource.ParseUI(GetReaderString(reader, "default_star"));

            data.Add(ret.Gid, ret);

            reader.Close();
            reader.Dispose();

            return(ret);
        }
コード例 #24
0
        public DBGodEquipGoodsItem GetData(uint id)
        {
            DBGodEquipGoodsItem ad = null;

            if (!data.TryGetValue(id, out ad))
            {
                string query_str    = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\" ", mTableName, "gid", id.ToString());
                var    table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(mFileName, VoiceTableName, query_str);
                if (table_reader == null)
                {
                    data[id] = null;
                    return(null);
                }

                if (!table_reader.HasRows)
                {
                    data[id] = null;
                    table_reader.Close();
                    table_reader.Dispose();
                    return(null);
                }

                if (!table_reader.Read())
                {
                    data[id] = null;
                    table_reader.Close();
                    table_reader.Dispose();
                    return(null);
                }

                ad                 = new DBGodEquipGoodsItem();
                ad.Gid             = DBTextResource.ParseUI(GetReaderString(table_reader, "gid"));
                ad.Pos             = DBTextResource.ParseUI(GetReaderString(table_reader, "pos_id"));
                ad.LvStep          = DBTextResource.ParseUI(GetReaderString(table_reader, "lv_step"));
                ad.SwallowExpValue = DBTextResource.ParseUI(GetReaderString(table_reader, "value"));
                ad.GrooveNum       = DBTextResource.ParseUI(GetReaderString(table_reader, "groove_num"));
                ad.BasicAttrs      = DBTextResource.ParseDictionaryUintUint(GetReaderString(table_reader, "attrs"));
                data.Add(ad.Gid, ad);

                table_reader.Close();
                table_reader.Dispose();
            }

            return(ad);
        }
コード例 #25
0
ファイル: DBAvatarDefault.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            mData.Clear();

            while (reader.Read())
            {
                Data data = new Data();
                data.bodyId      = DBTextResource.ParseUI(GetReaderString(reader, "body"));
                data.weaponId    = DBTextResource.ParseUI(GetReaderString(reader, "weapon"));
                data.default_res = GetReaderString(reader, "default_res");
                mData.Add((Actor.EVocationType)DBTextResource.ParseUI(GetReaderString(reader, "vocation")), data);
            }
        }
コード例 #26
0
ファイル: DBHonor.cs プロジェクト: wuhuolong/MaxBooks
        public DBHonorItem GetData(uint id)
        {
            DBHonorItem ad = null;

            if (data.TryGetValue(id, out ad))
            {
                return(ad);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                data[id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                data[id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            var ret = new DBHonorItem();

            ret.Id        = DBTextResource.ParseUI(GetReaderString(reader, "id"));
            ret.Name      = GetReaderString(reader, "name");
            ret.Icon      = GetReaderString(reader, "icon");
            ret.NeedPower = DBTextResource.ParseL(GetReaderString(reader, "need_pw"));
            ret.NeedGoods = DBTextResource.ParseDBGoodsItem(GetReaderString(reader, "need_goods"));
            ret.AddAttr   = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "attr"));
            ret.Quality   = DBTextResource.ParseUI_s(GetReaderString(reader, "qual"), 0);
            data.Add(ret.Id, ret);

            reader.Close();
            reader.Dispose();

            return(ret);
        }
コード例 #27
0
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            while (reader.Read())
            {
                DBFootprintItem ad = new DBFootprintItem();
                ad.Id            = DBTextResource.ParseUI(GetReaderString(reader, "id"));
                ad.EffectFile    = GetReaderString(reader, "effect_file");
                ad.LowEffectFile = GetReaderString(reader, "low_effect_file");
                ad.DelayTime     = DBTextResource.ParseF(GetReaderString(reader, "delay_time"));
                ad.CDTime        = DBTextResource.ParseF(GetReaderString(reader, "cd_time"));
                ad.MinDistance   = DBTextResource.ParseF(GetReaderString(reader, "min_distance"));
                data.Add(ad.Id, ad);
            }
        }
コード例 #28
0
ファイル: DBIOSDevice.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

#if UNITY_IPHONE
            mIosDevices.Clear();
            while (reader.Read())
            {
                string id      = GetReaderString(reader, "id");
                var    quality = DBTextResource.ParseUI(GetReaderString(reader, "quality"));

                var device_type = (UnityEngine.iOS.DeviceGeneration)Enum.Parse(typeof(UnityEngine.iOS.DeviceGeneration), id, true);
                mIosDevices[device_type] = quality;
            }
#endif
        }
コード例 #29
0
ファイル: DBSysPreview.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            while (reader.Read())
            {
                DBSysPreviewInfo info = new DBSysPreviewInfo();
                info.SysId    = DBTextResource.ParseUI(GetReaderString(reader, "sys_id"));
                info.Notice   = GetReaderString(reader, "notice");
                info.UiNotice = GetReaderString(reader, "ui_notice");
                info.RewardId = DBTextResource.ParseUI(GetReaderString(reader, "reward_id"));
                info.SysDesc  = GetReaderString(reader, "sys_desc");

                Data.Add(info.SysId, info);
            }
        }
コード例 #30
0
        public DBTitleEffectItem GetData(uint id)
        {
            DBTitleEffectItem ad = null;

            if (Data.TryGetValue(id, out ad))
            {
                return(ad);
            }

            string query  = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", id);
            var    reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                Data[id] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                Data[id] = null;

                reader.Close();
                reader.Dispose();
                return(null);
            }

            var ret = new DBTitleEffectItem();

            ret.Id        = DBTextResource.ParseUI(GetReaderString(reader, "id"));
            ret.Name      = GetReaderString(reader, "name");
            ret.Arg       = DBTextResource.ParseVector2(GetReaderString(reader, "arg"));
            ret.FrameSize = DBTextResource.ParseVector2(GetReaderString(reader, "frame_size"));
            ret.PatchId   = DBTextResource.ParseUI(GetReaderString(reader, "patch_id"));

            Data.Add(ret.Id, ret);

            reader.Close();
            reader.Dispose();

            return(ret);
        }