コード例 #1
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        uint        id        = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        List <uint> parentIds = DBTextResource.ParseArrayUint(GetReaderString(reader, "parentIds"), ",");
                        AddRedPointData(id, parentIds);
                    }
                }
            }
        }
コード例 #2
0
ファイル: DBSDKFilter.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            mSDKFilterInfos = new Dictionary <string, SDKFilterInfo>();

            while (reader.Read())
            {
                SDKFilterInfo info = new SDKFilterInfo();
                info.sdk_name      = GetReaderString(reader, "sdk_name");
                info.disable_share = DBTextResource.ParseUI_s(GetReaderString(reader, "disable_share"), 0) == 1;

                mSDKFilterInfos[info.sdk_name] = info;
            }
        }
コード例 #3
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            mCostInfos.Clear();

            DBPetStepItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBPetStepItem();

                        info.Id        = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Step      = DBTextResource.ParseUI_s(GetReaderString(reader, "step"), 0);
                        info.SelfAttr  = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "self_attr"));
                        info.OwnerAttr = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "owner_attr"));
                        info.CostArray = DBTextResource.ParseDBGoodsItem(GetReaderString(reader, "cost"));
                        if (mInfos.ContainsKey(info.Id) == false)
                        {
                            OneDBPetStep one_pet_step = new OneDBPetStep();
                            one_pet_step.Id = info.Id;
                            //one_pet_step.MaxStep = 0;
                            one_pet_step.OneDBPetStepArray = new Dictionary <uint, DBPetStepItem>();
                            mInfos.Add(one_pet_step.Id, one_pet_step);
                        }
                        //if (mInfos[info.Id].MaxStep < info.Step)
                        //    mInfos[info.Id].MaxStep = info.Step;

                        mInfos[info.Id].OneDBPetStepArray[info.Step] = info;

                        if (info.CostArray != null && info.CostArray.Count > 0)
                        {
                            if (mCostInfos.ContainsKey(info.CostArray[0].goods_id) == false)
                            {
                                mCostInfos[info.CostArray[0].goods_id] = info.Id;
                            }
                        }
                    }
                }
            }
        }
コード例 #4
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);
        }
コード例 #5
0
        public LightWeaponSoul GetData(uint GID)
        {
            if (data.ContainsKey(GID))
            {
                return(data[GID]);
            }

            string query = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", 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 soul = new LightWeaponSoul();

            soul.GID = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
            List <uint> Pos = DBTextResource.ParseArrayUint(GetReaderString(reader, "position"), ",");

            soul.Pos_Type  = Pos[0];
            soul.Pos_Index = Pos[1];
            var Resolve = DBTextResource.ParseArrayUint(GetReaderString(reader, "break"), ",");

            soul.ResolveType   = Resolve[0];
            soul.ResolveAmount = Resolve[1];
            soul.BasicAttrs    = DBTextResource.ParseDictionaryUintUint(GetReaderString(reader, "base_attrs"));
            data[GID]          = soul;
            reader.Close();
            reader.Dispose();
            return(soul);
        }
コード例 #6
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mSortInfos.Clear();

            DBGuildWareStepFilterItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBGuildWareStepFilterItem();

                        info.Id          = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Desc        = GetReaderString(reader, "desc");
                        info.MinStep     = DBTextResource.ParseUI_s(GetReaderString(reader, "min_step"), 0);
                        info.MaxStep     = DBTextResource.ParseUI_s(GetReaderString(reader, "max_step"), 0);
                        info.IsDefault   = DBTextResource.ParseUI_s(GetReaderString(reader, "is_default"), 0) == 1;
                        info.CaptionText = GetReaderString(reader, "caption_text");
                        if (info.CaptionText == "")
                        {
                            info.CaptionText = info.Desc;
                        }
                        mSortInfos.Add(info);
                    }
                }
            }

            mSortInfos.Sort((a, b) =>
            {
                if (a.Id < b.Id)
                {
                    return(-1);
                }
                else if (a.Id > b.Id)
                {
                    return(1);
                }
                return(0);
            });
        }
コード例 #7
0
ファイル: DBVoice.cs プロジェクト: wuhuolong/MaxBooks
        private VoiceInfo GetOneVoiceInfo(uint id)
        {
            VoiceInfo info;

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

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

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

                info = new VoiceInfo();

                info.Id   = DBTextResource.ParseUI_s(GetReaderString(table_reader, "id"), 0);
                info.Path = GetReaderString(table_reader, "res_path");

                mData.Add(id, info);

                table_reader.Close();
                table_reader.Dispose();
            }
            return(info);
        }
コード例 #8
0
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            m_HangInfo.Clear();

            while (reader.Read())
            {
                var info = new HangInfo();
                info.Id         = GetReaderUint(reader, "oid");
                info.Level      = GetReaderUint(reader, "lv");
                info.Dungeon    = DBTextResource.ParseUI_s(GetReaderString(reader, "dungeon"), 0);
                info.PosTagList = ParseTagList(GetReaderString(reader, "pos"));

                m_HangInfo.Add(info);
            }
        }
コード例 #9
0
        public DBGuildTotemItem GetOneItem(uint lv)
        {
            DBGuildTotemItem info;

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

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

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

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

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

            info = new DBGuildTotemItem();

            info.Lv              = DBTextResource.ParseUI_s(GetReaderString(reader, "lv"), 0);
            info.Exp             = DBTextResource.ParseUL_s(GetReaderString(reader, "exp"), 0);
            info.Buffs           = DBTextResource.ParseArrayUint(GetReaderString(reader, "buffs"), ",");
            info.Descs           = DBTextResource.ParseArrayString(GetReaderString(reader, "descs"));
            info.NextOffsetDescs = DBTextResource.ParseArrayString(GetReaderString(reader, "next_offset_descs"));

            mInfos.Add(info.Lv, info);

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #10
0
ファイル: DBStigmaLv.cs プロジェクト: wuhuolong/MaxBooks
        /// <summary>
        /// 根据id和level获取圣痕属性
        /// </summary>
        /// <param name="id"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public DBStigmaLvItem GetOneInfo(uint id, uint level)
        {
            uint           uid = id * 1000 + level;
            DBStigmaLvItem info;

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

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

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

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

            info              = new DBStigmaLvItem();
            info.Id           = id;
            info.Lv           = level;
            info.Exp          = GetReaderUint(reader, "exp");
            info.Attr         = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "attr"));
            info.attr_percent = DBTextResource.ParseUI_s(GetReaderString(reader, "attr_percent"), 0);
            mInfos[uid]       = info;

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

            return(info);
        }
コード例 #11
0
        private void OnMainMapLoad(CEventBaseArgs args)
        {
            InstanceOpenState.Clear();
            List <Dictionary <string, string> > data_world = DBManager.Instance.QuerySqliteTable <string>(GlobalConfig.DBFile, "data_world");

            for (int i = 0; i < data_world.Count; i++)
            {
                Dictionary <string, string> data = data_world[i];
                uint mapId        = DBTextResource.ParseUI_s(data["map_id"], 0);
                var  instanceInfo = DBInstance.Instance.GetInstanceInfo(mapId);
                if (instanceInfo != null)
                {
                    InstaneOpenState state  = InstaneOpenState.NotOpen;
                    bool             isOpen = MiniMapHelp.isMapOpen(mapId);
                    if (isOpen)
                    {
                        state = InstaneOpenState.Open;
                    }
                    InstanceOpenState.Add(mapId, state);
                }
            }
        }
コード例 #12
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            DBBaptizeColorPoolInfo info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBBaptizeColorPoolInfo();

                        info.Color        = DBTextResource.ParseUI_s(GetReaderString(reader, "color"), 0);
                        info.AttrRatioMin = DBTextResource.ParseUI_s(GetReaderString(reader, "attr_ratio_min"), 0);
                        info.AttrRatio    = DBTextResource.ParseUI_s(GetReaderString(reader, "attr_ratio"), 0);

                        mInfos[info.Color] = info;
                    }
                }
            }
        }
コード例 #13
0
        protected override void ParseData(SqliteDataReader reader)
        {
            //mInfos.Clear();
            mSortInfos.Clear();

            DBMarketQualityAndStarFilterItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBMarketQualityAndStarFilterItem();

                        info.Id        = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Name      = GetReaderString(reader, "name");
                        info.ColorType = DBTextResource.ParseUI_s(GetReaderString(reader, "color_type"), 0);
                        info.StarLv    = DBTextResource.ParseUI_s(GetReaderString(reader, "star_lv"), 0);

                        mSortInfos.Add(info);
                    }
                }
            }

            mSortInfos.Sort((a, b) =>
            {
                if (a.Id < b.Id)
                {
                    return(-1);
                }
                else if (a.Id > b.Id)
                {
                    return(1);
                }
                return(0);
            });
        }
コード例 #14
0
        protected override void ParseData(SqliteDataReader reader)
        {
            if (reader == null || !reader.HasRows)
            {
                return;
            }

            m_VocationInfos = new Dictionary <uint, VocationInfo>();
            while (reader.Read())
            {
                var vocation = DBTextResource.ParseUI(GetReaderString(reader, "vocation"));

                VocationInfo data = new VocationInfo();
                data.vocation               = vocation;
                data.name                   = GetReaderString(reader, "name");
                data.head_image             = GetReaderString(reader, "head_image");
                data.big_head_image         = GetReaderString(reader, "big_head_image");
                data.vocation_image         = GetReaderString(reader, "vocation_image");
                data.vocation_image_select  = GetReaderString(reader, "vocation_image_select");
                data.vocation_desc          = GetReaderString(reader, "vocation_desc");
                data.create_sound           = GetReaderString(reader, "create_sound");
                data.sex_type               = (SexType)DBTextResource.ParseUI_s(GetReaderString(reader, "sex"), 1);
                data.common_skill_icon_main = GetReaderString(reader, "common_skill_icon_main");
                data.boss_chip_slot_name    = GetReaderString(reader, "boss_chip_slot_name");
                data.animator_cull_mode     = (AnimatorCullingMode)DBTextResource.ParseUI_s(GetReaderString(reader, "animator_cull_mode"), (uint)AnimatorCullingMode.CullCompletely);
                //data.mount_offset = DBTextResource.ParseVector3(GetReaderString(reader, "mount_offset"));
                string rawAudio = GetReaderString(reader, "audios");
                data.audios = new List <string>();
                if (!string.IsNullOrEmpty(rawAudio))
                {
                    rawAudio = rawAudio.Replace(" ", "");
                    rawAudio = rawAudio.TrimStart('{');
                    rawAudio = rawAudio.TrimEnd('}');
                    data.audios.AddRange(rawAudio.Split(','));
                }
                m_VocationInfos[vocation] = data;
            }
        }
コード例 #15
0
        public ShiftStateInfo GetInfo(uint state)
        {
            ShiftStateInfo info;

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

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

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

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

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

            info = new ShiftStateInfo();

            info.state       = DBTextResource.ParseUI_s(GetReaderString(reader, "shift_state"), 0);
            info.target_type = DBTextResource.ParseUI_s(GetReaderString(reader, "target_type"), 0);

            mInfos[info.state] = info;

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #16
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mSkillSelectionInfos.Clear();
            SkillSelectionInfo info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new SkillSelectionInfo();

                        info.SkillId  = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Priority = DBTextResource.ParseUI_s(GetReaderString(reader, "priority"), 0);
                        string conditionStr = GetReaderString(reader, "condition");
                        if (string.IsNullOrEmpty(conditionStr) == true)
                        {
                            info.Condition = ECondition.None;
                        }
                        else
                        {
                            info.Condition = (ECondition)System.Enum.Parse(typeof(ECondition), conditionStr);
                        }
                        info.Param = GetReaderString(reader, "param");

#if UNITY_EDITOR
                        if (mSkillSelectionInfos.ContainsKey(info.SkillId))
                        {
                            GameDebug.LogError(string.Format("[{0}]表重复添加的域id[{1}]", mTableName, info.SkillId));
                            continue;
                        }
#endif
                        mSkillSelectionInfos.Add(info.SkillId, info);
                    }
                }
            }
        }
コード例 #17
0
        /// <summary>
        /// 根据物品ID来获取烟火特效的配置
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FireworkInfo GetInfo(uint id)
        {
            FireworkInfo info = null;

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

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

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

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

            info           = new FireworkInfo();
            info.ID        = DBTextResource.ParseUI_s(GetReaderString(table_reader, "id"), 0);
            info.AssetPath = GetReaderString(table_reader, "asset_path");
            info.AudioPath = GetReaderString(table_reader, "audio_path");
            info.Time      = DBTextResource.ParseF_s(GetReaderString(table_reader, "time"), 1.0f);

            table_reader.Close();
            table_reader.Dispose();
            mInfos[info.ID] = info;

            return(info);
        }
コード例 #18
0
ファイル: DBEngrave.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            mEngravenfos.Clear();
            EngraveInfo gemInfo = null;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        gemInfo               = new EngraveInfo();
                        gemInfo.Id            = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        gemInfo.Type          = DBTextResource.ParseBT_s(GetReaderString(reader, "type"), 0);
                        gemInfo.Lv            = DBTextResource.ParseUS_s(GetReaderString(reader, "lv"), 0);
                        gemInfo.NextEngraveId = DBTextResource.ParseUI_s(GetReaderString(reader, "next_engrave_id"), 0);
                        gemInfo.Attrs         = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "attr"));

                        mEngravenfos.Add(gemInfo.Id, gemInfo);
                    }
                }
            }
        }
コード例 #19
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();

            DBMallTypeItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBMallTypeItem();

                        info.Id         = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Name       = GetReaderString(reader, "name");
                        info.TapBkg     = GetReaderString(reader, "tap_bkg");
                        info.BottomDesc = GetReaderString(reader, "bottom_desc");
                        mInfos.Add(info.Id, info);
                    }
                }
            }
        }
コード例 #20
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            DBGoodsEffectIconItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBGoodsEffectIconItem();

                        info.Id   = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Path = GetReaderString(reader, "path");
                        if (mInfos.ContainsKey(info.Id) == false)
                        {
                            mInfos.Add(info.Id, info);
                        }
                    }
                }
            }
        }
コード例 #21
0
ファイル: DBBaptizeGroove.cs プロジェクト: wuhuolong/MaxBooks
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            DBBaptizeGrooveInfo info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBBaptizeGrooveInfo();

                        info.Id           = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Cost         = DBTextResource.ParseDictionaryUintUint(GetReaderString(reader, "cost"));
                        info.AttrAddition = DBTextResource.ParseUI_s(GetReaderString(reader, "attr_addition"), 0);
                        info.BaseRank     = DBTextResource.ParseUI_s(GetReaderString(reader, "base_rank"), 0);

                        mInfos[info.Id] = info;
                    }
                }
            }
        }
コード例 #22
0
ファイル: DBGuildLv.cs プロジェクト: wuhuolong/MaxBooks
        public DBGuildLvItem GetOneItem(uint level)
        {
            if (mInfos.ContainsKey(level) == true)
            {
                return(mInfos[level]);
            }

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

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

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

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

            DBGuildLvItem info = new DBGuildLvItem();

            info.Id  = DBTextResource.ParseUI_s(GetReaderString(reader, "lv"), 0);
            info.exp = DBTextResource.ParseUI_s(GetReaderString(reader, "exp"), 0);
            info.num = DBTextResource.ParseUI_s(GetReaderString(reader, "num"), 0);
            mInfos.Add(info.Id, info);

            reader.Close();
            reader.Dispose();
            return(info);
        }
コード例 #23
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();


            DBEquipPosItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info = new DBEquipPosItem();

                        info.PosId          = DBTextResource.ParseUI_s(GetReaderString(reader, "pos"), 0);
                        info.Name           = GetReaderString(reader, "name");
                        info.PosType        = (EquipPosType)DBTextResource.ParseUI_s(GetReaderString(reader, "type"), 0);
                        info.CanStrength    = DBTextResource.ParseUI_s(GetReaderString(reader, "can_strength"), 0) == 1;     //能否强化
                        info.CanBaptize     = DBTextResource.ParseUI_s(GetReaderString(reader, "can_baptize"), 0) == 1;      //能否洗练
                        info.CanInlay       = DBTextResource.ParseUI_s(GetReaderString(reader, "can_inlay"), 0) == 1;        //能否镶嵌宝石
                        info.CanSuit        = DBTextResource.ParseUI_s(GetReaderString(reader, "can_suit"), 0) == 1;         //能否锻造套装
                        info.CanCastSoul    = DBTextResource.ParseUI_s(GetReaderString(reader, "can_cast_soul"), 0) == 1;    //能否铸魂
                        info.SortId         = DBTextResource.ParseUI_s(GetReaderString(reader, "sort_id"), 0);
                        info.CanBaptizeLv   = DBTextResource.ParseUI_s(GetReaderString(reader, "can_baptize_lv"), 0);        //可洗练需要的等级
                        info.CanAutoRecycle = DBTextResource.ParseUI_s(GetReaderString(reader, "can_auto_recycle"), 0) == 1; //能否自动置入回收

                        info.CanEngrave         = DBTextResource.ParseUI_s(GetReaderString(reader, "can_engrave"), 0) == 1;  //能否镶嵌铭刻
                        info.EngraveAtrrsDesc   = GetReaderString(reader, "engrave_attrs_desc");
                        info.EngraveShowAttrIds = DBTextResource.ParseArrayUint(GetReaderString(reader, "engrave_show_attrs"));

                        mInfos[info.PosId] = info;
                    }
                }
            }
        }
コード例 #24
0
        protected override void ParseData(SqliteDataReader reader)
        {
            mInfos.Clear();
            mSortInfos.Clear();
            mNormalDegreeSortInfos.Clear();
            DBGrowSkinItem info;

            if (reader != null)
            {
                if (reader.HasRows == true)
                {
                    while (reader.Read())
                    {
                        info            = new DBGrowSkinItem();
                        info.GrowType   = DBTextResource.ParseUI_s(GetReaderString(reader, "type"), 0);
                        info.Id         = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
                        info.Name       = GetReaderString(reader, "name");
                        info.Desc       = GetReaderString(reader, "desc");                                                     //描述
                        info.UnlockType = (SkinUnLockType)DBTextResource.ParseUI_s(GetReaderString(reader, "unlock_type"), 0); //解锁方式
                        if (info.UnlockType == SkinUnLockType.WhenOpenFunc)
                        {
                            //info.UnlockPlayerLevel = DBTextResource.ParseUI_s(GetReaderString(reader, "unlock_condition"), 0);          //解锁条件
                        }
                        else if (info.UnlockType == SkinUnLockType.CostGoods)
                        {
                            info.UnLockGoodsConditionArray = new List <DBPet.UnLockGoodsCondition>();
                            List <List <uint> > str_array = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "unlock_condition"));
                            for (int index = 0; index < str_array.Count; ++index)
                            {
                                if (str_array[index].Count >= 2)
                                {
                                    DBPet.UnLockGoodsCondition tmp_item = new DBPet.UnLockGoodsCondition();
                                    tmp_item.goods_id  = str_array[index][0];
                                    tmp_item.goods_num = str_array[index][1];
                                    info.UnLockGoodsConditionArray.Add(tmp_item);
                                }
                                else
                                {
                                    GameDebug.LogError(string.Format("There is error unlock_condition (id = {0}) in data_grow_skin", info.Id));
                                }
                            }
                        }
                        else if (info.UnlockType == SkinUnLockType.GrowLevel)
                        {
                            info.UnlockGrowLevel = DBTextResource.ParseUI_s(GetReaderString(reader, "unlock_condition"), 0);          //解锁条件
                        }
                        else
                        {
                        }

                        info.UnlockDesc               = GetReaderString(reader, "unlock_desc");                           //解锁说明
                        info.SortId                   = DBTextResource.ParseUI_s(GetReaderString(reader, "sort_id"), 0);  //排序ID
                        info.Quality                  = DBTextResource.ParseUI_s(GetReaderString(reader, "quality"), 0);  //品质
                        info.ActorId                  = DBTextResource.ParseUI_s(GetReaderString(reader, "actor_id"), 0); //角色ID
                        info.ModelLocalPos            = DBTextResource.ParseVector3(GetReaderString(reader, "model_local_pos"));
                        info.ModelLocalScale          = DBTextResource.ParseVector3(GetReaderString(reader, "model_local_scale"));
                        info.ModelLocalScaleGoods     = DBTextResource.ParseVector3(GetReaderString(reader, "model_local_scale_goods"));
                        info.ModelLocalAngles         = DBTextResource.ParseVector3(GetReaderString(reader, "model_local_angles"));
                        info.ModelParentDefaultAngles = DBTextResource.ParseVector3(GetReaderString(reader, "model_parent_default_angles"));
                        info.ModelParentLocalPos      = DBTextResource.ParseVector3(GetReaderString(reader, "model_parent_local_pos"));
                        info.ModelCameraOffset        = DBTextResource.ParseVector3(GetReaderString(reader, "model_camera_offset"));
                        info.ModelDefaultAngle        = DBTextResource.ParseVector3(GetReaderString(reader, "model_default_angle"));

                        info.ModelSceneOffset     = DBTextResource.ParseVector3(GetReaderString(reader, "model_scene_offset"));
                        info.SurfaceOffset        = DBTextResource.ParseVector3(GetReaderString(reader, "surfaceOffset"));
                        info.GetOffset            = DBTextResource.ParseVector3(GetReaderString(reader, "getOffset"));
                        info.AttrArray            = DBTextResource.ParseDBAttrItems(GetReaderString(reader, "attr")); //属性加成
                        info.IdleActionWhenRiding = GetReaderString(reader, "idleActionWhenRiding");
                        info.RunActionWhenRiding  = GetReaderString(reader, "runActionWhenRiding");
                        info.SceneModelOffset     = DBTextResource.ParseVector3(GetReaderString(reader, "sceneModelOffset"));
                        if (mInfos.ContainsKey(info.GrowType) == false)
                        {
                            mInfos.Add(info.GrowType, new Dictionary <uint, DBGrowSkinItem>());
                        }
                        mInfos[info.GrowType][info.Id] = info;

                        if (mSortInfos.ContainsKey(info.GrowType) == false)
                        {
                            mSortInfos.Add(info.GrowType, new List <DBGrowSkinItem>());
                        }
                        mSortInfos[info.GrowType].Add(info);

                        if (info.UnlockType == SkinUnLockType.WhenOpenFunc || info.UnlockType == SkinUnLockType.GrowLevel)
                        {
                            if (mNormalDegreeSortInfos.ContainsKey(info.GrowType) == false)
                            {
                                mNormalDegreeSortInfos.Add(info.GrowType, new List <DBGrowSkinItem>());
                            }
                            mNormalDegreeSortInfos[info.GrowType].Add(info);
                        }
                    }

                    foreach (var item in mSortInfos)
                    {
                        item.Value.Sort((a, b) =>
                        {
                            if (a.SortId < b.SortId)
                            {
                                return(-1);
                            }
                            else if (a.SortId > b.SortId)
                            {
                                return(1);
                            }

                            if (a.Id < b.Id)
                            {
                                return(-1);
                            }
                            else if (a.Id > b.Id)
                            {
                                return(1);
                            }
                            return(0);
                        });
                    }

                    foreach (var item in mNormalDegreeSortInfos)
                    {
                        item.Value.Sort((a, b) =>
                        {
                            if (a.UnlockType == SkinUnLockType.WhenOpenFunc)
                            {
                                if (b.UnlockType != SkinUnLockType.WhenOpenFunc)
                                {
                                    return(-1);
                                }
                            }
                            else
                            {
                                if (b.UnlockType == SkinUnLockType.WhenOpenFunc)
                                {
                                    return(1);
                                }
                                else
                                {
                                    if (a.UnlockGrowLevel < b.UnlockGrowLevel)
                                    {
                                        return(-1);
                                    }
                                    else if (a.UnlockGrowLevel > b.UnlockGrowLevel)
                                    {
                                        return(1);
                                    }
                                    return(0);
                                }
                            }
                            if (a.Id < b.Id)
                            {
                                return(-1);
                            }
                            else if (a.Id > b.Id)
                            {
                                return(1);
                            }
                            return(0);
                        });
                    }
                }
            }
        }
コード例 #25
0
ファイル: DBSuit.cs プロジェクト: wuhuolong/MaxBooks
        /// <summary>
        /// 获取一个套装信息
        /// </summary>
        /// <returns></returns>
        public DBSuitInfo GetOneInfo(uint id, uint lv)
        {
            //foreach (DBSuitInfo info in mInfos)
            //{
            //    if (info.Id == id && info.Lv == lv)
            //    {
            //        return info;
            //    }
            //}
            //return null;

            string     csvId = id + "_" + lv;
            DBSuitInfo info  = null;

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

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

            if (reader == null)
            {
                mInfos.Add(csvId, null);
                return(null);
            }

            if (!reader.HasRows)
            {
                mInfos.Add(csvId, null);
                reader.Close();
                reader.Dispose();
                return(null);
            }

            if (!reader.Read())
            {
                mInfos.Add(csvId, null);
                reader.Close();
                reader.Dispose();
                return(null);
            }

            info = new DBSuitInfo();

            info.Id          = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
            info.Lv          = DBTextResource.ParseUI_s(GetReaderString(reader, "lv"), 0);
            info.Name        = GetReaderString(reader, "name");
            info.PreviewName = GetReaderString(reader, "preview_name");
            info.SuitId      = DBTextResource.ParseUI_s(GetReaderString(reader, "suit_id"), 0);
            info.ColorNeed   = DBTextResource.ParseUI_s(GetReaderString(reader, "color_need"), 0);
            info.StarNeed    = DBTextResource.ParseUI_s(GetReaderString(reader, "star_need"), 0);

            info.NeedInfos = new List <DBSuitInfo.NeedInfo>();
            info.NeedInfos.Clear();
            List <List <uint> > needConfigs = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "need"));

            foreach (List <uint> needConfig in needConfigs)
            {
                if (needConfig.Count >= 2)
                {
                    DBSuitInfo.NeedInfo needInfo = new DBSuitInfo.NeedInfo();
                    needInfo.ColorNeed = needConfig[0];
                    needInfo.StarNeed  = needConfig[1];

                    info.NeedInfos.Add(needInfo);
                }
            }

            info.CostGoodsIdList = new Dictionary <uint, List <KeyValuePair <uint, uint> > >();
            info.CostGoodsIdList.Clear();
            info.CostGoodsList = new Dictionary <uint, List <GoodsItem> >();
            info.CostGoodsList.Clear();
            // 锻造消耗的部位配置从3到10
            for (uint i = 3; i <= 10; ++i)
            {
                List <KeyValuePair <uint, uint> > costGoodsIds = new List <KeyValuePair <uint, uint> >();
                costGoodsIds.Clear();
                string raw = GetReaderString(reader, "pos_" + i + "_cost");
                raw = raw.Replace(" ", "");
                var matchs = TextHelper.ParseBraceContent(raw, true);
                foreach (var _match in matchs)
                {
                    uint goodsId = DBTextResource.ParseUI(_match[0]);
                    uint num     = DBTextResource.ParseUI(_match[1]);
                    KeyValuePair <uint, uint> goodsIdPair = new KeyValuePair <uint, uint>(goodsId, num);
                    costGoodsIds.Add(goodsIdPair);
                }
                SGameEngine.Pool <List <string> > .List.Free(matchs);

                info.CostGoodsIdList.Add(i, costGoodsIds);
            }

#if UNITY_EDITOR
            if (mInfos.ContainsKey(csvId))
            {
                GameDebug.LogError(string.Format("[{0}]表重复添加的域id[{1}]", mTableName, csvId));

                reader.Close();
                reader.Dispose();
                return(info);
            }
#endif
            mInfos.Add(csvId, info);

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

            return(info);
        }
コード例 #26
0
        Dictionary <uint, HookGoodsSettingInfo> ReadHookSettingGoodsInfos(string tableName, HookGoodsSettingInfo.ECondition condition)
        {
            Dictionary <uint, HookGoodsSettingInfo> hookSettingGoodsInfos = new Dictionary <uint, HookGoodsSettingInfo>();

            hookSettingGoodsInfos.Clear();

            List <Dictionary <string, string> > datas = DBManager.Instance.QuerySqliteTable <string>(GlobalConfig.DBFile, tableName);

            foreach (Dictionary <string, string> row in datas)
            {
                HookGoodsSettingInfo hookSettingGoodsInfo = new HookGoodsSettingInfo();
                foreach (KeyValuePair <string, string> kv in row)
                {
                    if (kv.Key == "id")
                    {
                        hookSettingGoodsInfo.Id = DBTextResource.ParseUI_s(kv.Value, 0);
                    }
                    else if (kv.Key == "condition")
                    {
                        hookSettingGoodsInfo.Condition = (HookGoodsSettingInfo.ECondition)DBTextResource.ParseUI_s(kv.Value, 0);
                    }
                    else if (kv.Key == "type")
                    {
                        hookSettingGoodsInfo.Type = (HookGoodsSettingInfo.EType)DBTextResource.ParseUI_s(kv.Value, 0);
                    }
                    else if (kv.Key == "param")
                    {
                        switch (hookSettingGoodsInfo.Type)
                        {
                        case HookGoodsSettingInfo.EType.OtherAll:
                        {
                            break;
                        }

                        case HookGoodsSettingInfo.EType.GoodsIds:
                        {
                            hookSettingGoodsInfo.Params = DBTextResource.ParseArrayUint(kv.Value, ",");
                            break;
                        }

                        case HookGoodsSettingInfo.EType.GoodsType:
                        {
                            hookSettingGoodsInfo.Params = DBTextResource.ParseArrayUint(kv.Value, ",");
                            break;
                        }

                        case HookGoodsSettingInfo.EType.EquipCertainColor:
                        {
                            hookSettingGoodsInfo.Params = new List <uint>();
                            hookSettingGoodsInfo.Params.Clear();
                            hookSettingGoodsInfo.Params.Add(DBTextResource.ParseUI_s(kv.Value, 0));
                            break;
                        }

                        case HookGoodsSettingInfo.EType.EquipUponCertainColor:
                        {
                            hookSettingGoodsInfo.Params = new List <uint>();
                            hookSettingGoodsInfo.Params.Clear();
                            hookSettingGoodsInfo.Params.Add(DBTextResource.ParseUI_s(kv.Value, 0));
                            break;
                        }

                        case HookGoodsSettingInfo.EType.EquipPoses:
                        {
                            hookSettingGoodsInfo.Params = DBTextResource.ParseArrayUint(kv.Value, ",");
                            break;
                        }

                        default:
                            break;
                        }
                    }
                    else if (kv.Key == "name")
                    {
                        hookSettingGoodsInfo.Name = kv.Value;
                    }
                }
                hookSettingGoodsInfo.IsOn = true;

                if (condition == hookSettingGoodsInfo.Condition)
                {
                    hookSettingGoodsInfos.Add(hookSettingGoodsInfo.Id, hookSettingGoodsInfo);
                }
            }

            return(hookSettingGoodsInfos);
        }
コード例 #27
0
ファイル: DBActor.cs プロジェクト: wuhuolong/MaxBooks
        ActorData GetActorInfo(uint id)
        {
            string query_str = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id" , id.ToString());

            var table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query_str);
            if (table_reader == null)
            {
                return null;
            }

            if (!table_reader.HasRows)
            {
                table_reader.Close();
                table_reader.Dispose();
                return null;
            }

            if (!table_reader.Read())
            {
                table_reader.Close();
                table_reader.Dispose();
                return null;
            }

            ActorData ad = new ActorData();
            ad.name = GetReaderString(table_reader, "name");
            ad.vocation = DBTextResource.ParseBT(GetReaderString(table_reader, "vocation"));
            ad.level = DBTextResource.ParseUI(GetReaderString(table_reader, "level"));
            ad.color = (Monster.QualityColor)DBTextResource.ParseBT_s(GetReaderString(table_reader, "color"), 0); ;
            ad.type = DBTextResource.ParseBT(GetReaderString(table_reader, "type"));
            ad.war_tag = DBTextResource.ParseBT(GetReaderString(table_reader, "war_tag"));
            ad.race_id = DBTextResource.ParseUI(GetReaderString(table_reader, "race_id"));
            ad.skill_count = DBTextResource.ParseBT(GetReaderString(table_reader, "skill_count"));
            if (ad.skill_count > 0)
            {
                ad.skill_idx = new uint[ad.skill_count];
                ad.cast_rate = new byte[ad.skill_count];
                for (int k = 0; k < ad.skill_count; ++k)
                {
                    ad.skill_idx[k] = DBTextResource.ParseUI_s(GetReaderString(table_reader, string.Format("skill_idx_{0}", k)), 0);
                    ad.cast_rate[k] = DBTextResource.ParseBT(GetReaderString(table_reader, string.Format("cast_rate_{0}", k)));
                }
            }

            ad.model_id = DBTextResource.ParseUI(GetReaderString(table_reader, "model_id"));
            ad.runspeed = (ushort)GetReaderFloat(table_reader, "runspeed");
            ad.motion_radius = DBTextResource.ParseBT(GetReaderString(table_reader, "motion_radius"));
            ad.behaviour_tree = GetReaderString(table_reader, "behaviour_tree");
            ad.summon_behaviour_tree = GetReaderString(table_reader, "summon_behaviour_tree");
            ad.attack_rotaion = DBTextResource.ParseBT(GetReaderString(table_reader, "attack_rotaion"));
            ad.hp_bar_count = DBTextResource.ParseBT(GetReaderString(table_reader, "hp_bar_count"));
            ad.gravity = DBTextResource.ParseUS_s(GetReaderString(table_reader, "gravity"), DBActor.Gravity);
            ad.dead_notify = DBTextResource.ParseByteArray(GetReaderString(table_reader, "dead_notify"));
            ad.spawn_timeline = DBTextResource.ParseUI(GetReaderString(table_reader, "spawn_timeline"));
            ad.dead_timeline = DBTextResource.ParseUI(GetReaderString(table_reader, "dead_timeline"));
            string isHideShadow = GetReaderString(table_reader, "is_hide_shadow");
            if (isHideShadow == string.Empty || isHideShadow == "0")
            {
                ad.is_hide_shadow = false;
            }
            else
            {
                ad.is_hide_shadow = true;
            }
            string isHideSelectEffect = GetReaderString(table_reader, "is_hide_select_effect");
            if (isHideSelectEffect == string.Empty || isHideSelectEffect == "0")
            {
                ad.is_hide_select_effect = false;
            }
            else
            {
                ad.is_hide_select_effect = true;
            }
            ad.attr_param = DBTextResource.ParseUI_s(GetReaderString(table_reader, "attr_param"), 0);
            ad.default_actor_id = DBTextResource.ParseUI_s(GetReaderString(table_reader, "default_actor_id"), 0);
            data[id] = ad;

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

            return ad;
        }
コード例 #28
0
        TaskDefine ReadReader(SqliteDataReader reader)
        {
            ushort     taskType = DBTextResource.ParseUS_s(GetReaderString(reader, "type"), 0);
            TaskDefine define   = new TaskDefine();

            define.Id = DBTextResource.ParseUI_s(GetReaderString(reader, "id"), 0);
            define.DescriptionBytes = GetReaderBytes(reader, "description");
            define.NameBytes        = GetReaderBytes(reader, "name");
            define.Type             = taskType;
            define.SubType          = DBTextResource.ParseUI_s(GetReaderString(reader, "sub_type"), 0);
            define.RequestLevelMin  = DBTextResource.ParseI_s(GetReaderString(reader, "lv_min"), 0);
            define.PreviousId       = DBTextResource.ParseUI_s(GetReaderString(reader, "pre_id"), 0);
            define.NextId           = DBTextResource.ParseUI_s(GetReaderString(reader, "next_id"), 0);
            define.NextId           = DBTextResource.ParseUI_s(GetReaderString(reader, "next_id"), 0);

            string serverStepRawsString       = GetReaderString(reader, "goals");
            string clientStepRawsString       = GetReaderString(reader, "steps");
            string navigationPointsRawsString = GetReaderString(reader, "navigation_points");

            define.Steps = TaskDefine.TaskStep.CreateStepsByRawString(serverStepRawsString, clientStepRawsString, navigationPointsRawsString);
            if (define.Steps == null || define.Steps.Count == 0)
            {
                GameDebug.LogError("Parse task " + define.Id + " error, step is empty!!!");
            }

            define.RewardIds = DBTextResource.ParseArrayUint(GetReaderString(reader, "reward_ids"), ",");
            define.GetSkills = DBTextResource.ParseArrayUint(GetReaderString(reader, "get_skills"), ",");
            define.IsShowGetSkillProgress = DBTextResource.ParseI_s(GetReaderString(reader, "is_show_get_skill_progress"), 0) == 0 ? false : true;
            define.ReceiveDialogId        = DBTextResource.ParseUI_s(GetReaderString(reader, "receive_dialog_id"), 0);
            define.SubmitDialogId         = DBTextResource.ParseUI_s(GetReaderString(reader, "submit_dialog_id"), 0);
            define.ReceiveNpc             = NpcScenePosition.Make(GetReaderString(reader, "receive_npc"));
            define.SubmitNpc     = NpcScenePosition.Make(GetReaderString(reader, "submit_npc"));
            define.AutoRunType   = (TaskDefine.EAutoRunType)DBTextResource.ParseBT_s(GetReaderString(reader, "auto_run"), 0);
            define.ShowPriority  = DBManager.Instance.GetDB <DBTaskPriority>().GetTaskPriority((int)taskType);
            define.ShowPriority2 = DBManager.Instance.GetDB <DBTaskPriority>().GetTaskPriority2((int)taskType);

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

            if (string.IsNullOrEmpty(raw) == true || raw == "0")
            {
                define.IsTemporaryOnTop = false;
            }
            else
            {
                define.IsTemporaryOnTop = true;
            }

            string npcsRawString = GetReaderString(reader, "create_npcs_when_received");

            define.CreateNpcsWhenReceived = TaskDefine.MakeNpcScenePositions(npcsRawString);
            npcsRawString = GetReaderString(reader, "delete_npcs_when_received");
            define.DeleteNpcsWhenReceived = TaskDefine.MakeNpcScenePositions(npcsRawString);
            npcsRawString             = GetReaderString(reader, "create_npcs_when_done");
            define.CreateNpcsWhenDone = TaskDefine.MakeNpcScenePositions(npcsRawString);
            npcsRawString             = GetReaderString(reader, "delete_npcs_when_done");
            define.DeleteNpcsWhenDone = TaskDefine.MakeNpcScenePositions(npcsRawString);

            define.FollowNpcs         = TaskDefine.MakeNpcScenePositions(GetReaderString(reader, "follow_npcs"));
            define.CanUseBoots        = (DBTextResource.ParseI_s(GetReaderString(reader, "can_use_boots"), 0) > 0);
            define.ReceivedTimelineId = DBTextResource.ParseUI_s(GetReaderString(reader, "received_timeline_id"), 0);
            define.SubmitedTimelineId = DBTextResource.ParseUI_s(GetReaderString(reader, "submited_timeline_id"), 0);

            raw = GetReaderString(reader, "cost");
            if (string.IsNullOrEmpty(raw) == false)
            {
                define.Costs = DBTextResource.ParseArrayStringString(raw);
            }

            raw = GetReaderString(reader, "show_reward_goods_id");
            List <List <uint> > showRewardGoodsIdConfigs = DBTextResource.ParseArrayUintUint(raw);

            define.ShowRewardGoodsIds = new Dictionary <uint, uint>();
            define.ShowRewardGoodsIds.Clear();
            define.ShowRewardGoodsNums = new Dictionary <uint, uint>();
            define.ShowRewardGoodsNums.Clear();
            define.ShowRewardGoodsIsBinds = new Dictionary <uint, byte>();
            define.ShowRewardGoodsIsBinds.Clear();
            uint index = 1;

            foreach (List <uint> showRewardGoodsIdConfig in showRewardGoodsIdConfigs)
            {
                define.ShowRewardGoodsIds[index]     = showRewardGoodsIdConfig[0];
                define.ShowRewardGoodsNums[index]    = showRewardGoodsIdConfig[1];
                define.ShowRewardGoodsIsBinds[index] = (byte)showRewardGoodsIdConfig[2];
                ++index;
            }

            mTasksData.Add(define.Id, define);
            if (mTasksDataByType.ContainsKey(define.Type) == true)
            {
                mTasksDataByType[define.Type].Add(define.Id, define);
            }
            else
            {
                Dictionary <uint, TaskDefine> taskDefines = new Dictionary <uint, TaskDefine>();
                taskDefines.Clear();
                taskDefines.Add(define.Id, define);

                mTasksDataByType.Add(define.Type, taskDefines);
            }

            return(define);
        }
コード例 #29
0
ファイル: DBEquipMod.cs プロジェクト: wuhuolong/MaxBooks
        public EquipModData GetModData(uint eid)
        {
            EquipModData data = null;

            if (EquipModDatas.TryGetValue(eid, out data))
            {
                return(data);
            }

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

            if (reader == null)
            {
                EquipModDatas[eid] = null;
                return(null);
            }

            if (!reader.HasRows)
            {
                EquipModDatas[eid] = null;
                reader.Close();
                reader.Dispose();
                return(null);
            }

            if (!reader.Read())
            {
                EquipModDatas[eid] = null;
                reader.Close();
                reader.Dispose();
                return(null);
            }

            var id          = DBTextResource.ParseUI(GetReaderString(reader, "gid"));
            var pos         = DBTextResource.ParseUI(GetReaderString(reader, "pos"));
            var ar_con_need = DBTextResource.ParseUI(GetReaderString(reader, "ar_con_need"));
            var ar_str_need = DBTextResource.ParseUI(GetReaderString(reader, "ar_str_need"));
            var ar_agi_need = DBTextResource.ParseUI(GetReaderString(reader, "ar_agi_need"));
            var ar_int_need = DBTextResource.ParseUI(GetReaderString(reader, "ar_int_need"));
            //var transfer_need = DBTextResource.ParseUI(GetReaderString(reader, "transfer_need"));
            var legend_attrs_num   = DBTextResource.ParseUI(GetReaderString(reader, "legend_attrs_num"));
            var model              = DBTextResource.ParseUI(GetReaderString(reader, "model"));
            var lv_step            = DBTextResource.ParseUI(GetReaderString(reader, "lv_step"));
            var strength_max       = DBTextResource.ParseUI(GetReaderString(reader, "strength_limit"));
            var suit_id            = DBTextResource.ParseUI(GetReaderString(reader, "suit_id"));
            var pet_exp            = DBTextResource.ParseUI(GetReaderString(reader, "pet_exp"));
            var default_extra_desc = GetReaderBytes(reader, "default_extra_desc");
            var default_star       = DBTextResource.ParseUI_s(GetReaderString(reader, "default_star"), 0);
            var can_identify       = DBTextResource.ParseUI_s(GetReaderString(reader, "can_identify"), 0) == 1;
            var default_score      = DBTextResource.ParseUI_s(GetReaderString(reader, "default_score"), 0);
            var legend_attrs       = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "legend_attrs"));
            var mod_data           = new EquipModData(id, pos, ar_con_need, ar_str_need, ar_agi_need, ar_int_need, legend_attrs_num,
                                                      model, lv_step, strength_max, suit_id, pet_exp, default_extra_desc, default_star, can_identify, default_score, legend_attrs);

            EquipModDatas.Add(mod_data.Id, mod_data);

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

            return(mod_data);
        }
コード例 #30
0
ファイル: DebugCommand.cs プロジェクト: wuhuolong/MaxBooks
        public static bool ToProcessCommand(string main, List <string> paramArray, DebugUI debugUI)
        {
            if (main.ToLower() == "h" || main.ToLower() == "help")
            {
                string desc = "常用GM指令如下:";
                debugUI.PushLog(desc);
                desc = "monster [type_id] [num] : 创建n个怪物";
                debugUI.PushLog(desc);
                desc = "playerai : 开启/关闭玩家ai";
                debugUI.PushLog(desc);
                return(true);
            }
            else if (main.ToLower() == "playerai")
            {
                LocalPlayer act = (LocalPlayer)Game.GetInstance().GetLocalPlayer();

                if (act != null)
                {
                    bool aiEnable = act.GetAIEnable();
                    act.ActiveAI(!aiEnable);
                }
            }
            else if (main.ToLower() == "aoinum")
            {
                debugUI.DrawActorCount = !debugUI.DrawActorCount;
            }
            else if (main.ToLower() == "fsm_trace")
            {
                // 输入UnitID,开启或关闭状态调试
                // 第一个参数是UnitID的
                if (paramArray.Count == 3)
                {
                    UnitID uid = new UnitID();
                    uid.type    = byte.Parse(paramArray[0]);
                    uid.obj_idx = uint.Parse(paramArray[1]);

                    Actor actor = ActorManager.Instance.GetActor(uid);
                    if (actor != null)
                    {
                        actor.FSM.bIsDebug = !actor.FSM.bIsDebug;
                        return(true);
                    }
                }
            }
            else if (main.ToLower() == "fsm_getcurstate")
            {
                // 输入UnitID,开启或关闭状态调试
                // 第一个参数是UnitID的type, 第二个是serial_idx, 第三个是obj_idx
                if (paramArray.Count == 3)
                {
                    UnitID uid = new UnitID();
                    uid.type    = byte.Parse(paramArray[0]);
                    uid.obj_idx = uint.Parse(paramArray[1]);

                    Actor actor = ActorManager.Instance.GetActor(uid);
                    if (actor != null)
                    {
                        string name = actor.FSM.GetCurState().Name;
                        debugUI.PushLog("CurState: " + name);

                        return(true);
                    }
                }
            }
            else if (main.ToLower() == "localplayerid")
            {
                debugUI.PushLog("type:" + Game.GetInstance().LocalPlayerID.type +
                                ",obj_id:" + Game.GetInstance().LocalPlayerID.obj_idx);
                return(true);
            }
            else if (main.ToLower() == "attackspeed")
            {
                float fSpeed = 1.0f;
                if (paramArray.Count >= 1)
                {
                    if (paramArray[0] != "")
                    {
                        fSpeed = float.Parse(paramArray[0]);
                    }
                }

                Game.GetInstance().GetLocalPlayer().AttackSpeed = fSpeed;
                return(true);
            }
            else if (main.ToLower() == "movespeed")
            {
                float fSpeed = 1.0f;
                if (paramArray.Count >= 1)
                {
                    if (paramArray[0] != "")
                    {
                        fSpeed = float.Parse(paramArray[0]);
                    }
                }

                Game.GetInstance().GetLocalPlayer().SetMoveSpeedScale(fSpeed, 0);
                return(true);
            }
            else if (main.ToLower() == "clear")
            {
                debugUI.Clear();
                return(true);
            }
            else if (main.ToLower() == "globalcfg")
            {
                if (paramArray.Count >= 2)
                {
                    try
                    {
                        xc.GlobalSettings             settings = xc.GlobalSettings.GetInstance();
                        System.Reflection.FieldInfo[] fields   = settings.GetType().GetFields();
                        foreach (System.Reflection.FieldInfo field in fields)
                        {
                            if (field.Name.ToLower() == paramArray[0].ToLower())
                            {
                                if (field.FieldType == typeof(bool))
                                {
                                    field.SetValue(settings, bool.Parse(paramArray[1]));
                                    return(true);
                                }
                                else if (field.FieldType == typeof(float))
                                {
                                    field.SetValue(settings, float.Parse(paramArray[1]));
                                    return(true);
                                }
                                else if (field.FieldType == typeof(int))
                                {
                                    field.SetValue(settings, int.Parse(paramArray[1]));
                                    return(true);
                                }

                                return(true);
                            }
                        }
                    }
                    catch (System.Exception e)
                    {
                        GameDebug.Log(e.Message);
                    }
                }
            }
            else if (main.ToLower() == "test_voice")
            {
                AudioManager.Instance.PlayBattleSFX(GlobalConst.ResPath + "Sound/voice/Test4.ogg", SoundType.NPC);
                //AudioManager.Instance.PlayBattleSFX(GlobalConst.ResPath + "Sound/voice/Test2.ogg", SoundType.Voice);
                //AudioManager.Instance.PlayBattleSFX(GlobalConst.ResPath + "Sound/voice/Test3.ogg", SoundType.Voice);

                return(true);
            }
            else if (main.ToLower() == "test_fight")
            {
                //LocalPlayerManager.Instance.TryShowFightRankAnim(100);
                int num = 0;
                for (var i = 0; i < paramArray.Count; i++)
                {
                    if (int.TryParse(paramArray[i], out num))
                    {
                        LocalPlayerManager.Instance.TryShowFightRankAnim(num);
                        ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_LOCALPLAYER_BATTLE_POWER_CHANGED, null);
                    }
                }
                return(true);
            }

            else if (main.ToLower() == "ip")
            {
                if (paramArray.Count >= 1)
                {
                    Game.GetInstance().ServerIP = paramArray[0];
                }

                if (paramArray.Count >= 2)
                {
                    Game.GetInstance().ServerPort = int.Parse(paramArray[1]);
                }
                return(true);
            }
            else if (main.ToLower() == "pos")
            {
                LocalPlayer player = Game.GetInstance().GetLocalPlayer() as LocalPlayer;
                if (player != null)
                {
                    debugUI.PushLog("Player Pos:" + player.transform.position);
                }
                return(true);
            }
            else if (main.ToLower() == "gl")
            {
                if (paramArray.Count > 0)
                {
                    int lv = 0;
                    if (int.TryParse(paramArray[0], out lv))
                    {
                        QualitySetting.GraphicLevel = lv;
                        return(true);
                    }
                }
            }
            else if (main.ToLower() == "test")
            {
                // **** 临时测试命令
                int alpha = 0;
                if (paramArray.Count > 0)
                {
                    int.TryParse(paramArray[0], out alpha);
                }
                Game.GetInstance().GetLocalPlayer().Alpha = Mathf.Clamp01((float)(alpha / 255.0f));

                return(true);
            }
            else if (main.ToLower() == "openallsys")
            {
                debugUI.ProcessCommand("c:#set_open&1");
                return(true);
            }
            else if (main.ToLower() == "sleep_guide")
            {
                GuideManager.GetInstance().ForceToSleepGuide();
                return(true);
            }
            else if (main.ToLower() == "sg")
            {
                GuideManager.GetInstance().ForceToSleepGuide();
                return(true);
            }
            else if (main.ToLower() == "sleep_auto")
            {
                TaskHelper.IsAutoMainTask = false;
                return(true);
            }
            else if (main.ToLower() == "sa")
            {
                TaskHelper.IsAutoMainTask = false;
                return(true);
            }
            else if (main.ToLower() == "reset_guide")
            {
                GuideManager.GetInstance().ResetAllSysGuide();
                return(true);
            }
            else if (main.ToLower() == "diaobao")
            {
                // sleep guide
                GuideManager.GetInstance().ForceToSleepGuide();
                /*xc.ui.UIMainmapSysOpenWindow.ShowSysOpenAnim = false;*/

                // lv max
                debugUI.ProcessCommand("c:#lv&70");

                // rich
                debugUI.ProcessCommand("c:#rich");

                // gm equip
                debugUI.ProcessCommand("c:#e_new&1000905&8");
                debugUI.ProcessCommand("c:#e_new&1000906&8");
            }
            else if (main.ToLower() == "test_equip&1")
            {
                //                 string str = GameConstHelper.GetString("GAME_TEST_ADD_EQUIPS1");
                //                 string[] strList = str.Split(',');
                //                 for (int i = 0; i < strList.Length; i++)
                //                 {
                //                     string str1 = strList[i].Replace(" ", "");
                //                     str1 = str1.Substring(1, str1.Length - 2);
                //                     debugUI.ProcessCommand(str1);
                //                 }
                debugUI.ProcessCommand("c:#add_goods&100001&1");
                debugUI.ProcessCommand("c:#add_goods&100002&1");
                debugUI.ProcessCommand("c:#add_goods&100003&1");
                debugUI.ProcessCommand("c:#add_goods&100004&1");
                debugUI.ProcessCommand("c:#add_goods&100005&1");
                debugUI.ProcessCommand("c:#add_goods&100006&1");
                debugUI.ProcessCommand("c:#add_goods&100007&1");
                debugUI.ProcessCommand("c:#add_goods&100008&1");
                debugUI.ProcessCommand("c:#add_goods&100009&1");
            }
            else if (main.ToLower() == "test_equip&2")
            {
                string   str     = GameConstHelper.GetString("GAME_TEST_ADD_EQUIPS2");
                string[] strList = str.Split(',');
                for (int i = 0; i < strList.Length; i++)
                {
                    string str1 = strList[i].Replace(" ", "");
                    str1 = str1.Substring(1, str1.Length - 2);
                    debugUI.ProcessCommand(str1);
                }
            }
            else if (main.ToLower() == "test_equip&3")
            {
                string   str     = GameConstHelper.GetString("GAME_TEST_ADD_EQUIPS3");
                string[] strList = str.Split(',');
                for (int i = 0; i < strList.Length; i++)
                {
                    string str1 = strList[i].Replace(" ", "");
                    str1 = str1.Substring(1, str1.Length - 2);
                    debugUI.ProcessCommand(str1);
                }
            }
            else if (main.ToLower() == "test_equip")
            {
                string   str     = GameConstHelper.GetString("GAME_TEST_ADD_EQUIPS");
                string[] strList = str.Split(',');
                for (int i = 0; i < strList.Length; i++)
                {
                    string str1 = strList[i].Replace(" ", "");
                    str1 = str1.Substring(1, str1.Length - 2);
                    debugUI.ProcessCommand(str1);
                }

                return(true);
            }
            else if (main.ToLower() == "test_refining")
            {
                debugUI.ProcessCommand("c:#add_goods&30001&90");
                debugUI.ProcessCommand("c:#add_goods&30002&45");
                debugUI.ProcessCommand("c:#add_goods&30003&30");
                debugUI.ProcessCommand("c:#add_goods&30004&60");
                return(true);
            }
            else if (main.ToLower() == "start_guide")
            {
                GuideManager.Instance.StartGuide(DBTextResource.ParseUI(paramArray[0]), null);
                return(true);
            }
            else if (main.ToLower() == "open_sys")
            {
                foreach (var param in paramArray)
                {
                    SysConfigManager.Instance.ForceOpenSys(uint.Parse(param));
                }
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_NEW_WAITING_SYS, new CEventBaseArgs());

                return(true);
            }
            else if (main.ToLower() == "close_sys")
            {
                foreach (var param in paramArray)
                {
                    SysConfigManager.Instance.ForceCloseSys(uint.Parse(param));
                }

                return(true);
            }
            else if (main.ToLower().StartsWith("start_inst"))
            {
                if (paramArray.Count > 0)
                {
                    uint instanceId = DBTextResource.ParseUI_s(paramArray[0], 0);
                    SceneHelp.JumpToScene(instanceId);
                }
            }
            else if (main.ToLower().StartsWith("jump"))
            {
                if (paramArray.Count > 0)
                {
                    uint instanceId = DBTextResource.ParseUI_s(paramArray[0], 0);
                    SceneHelp.JumpToScene(instanceId);
                }
            }
            else if (main.ToLower().StartsWith("dialog"))
            {
                if (paramArray.Count > 0)
                {
                    uint dialogId = DBTextResource.ParseUI_s(paramArray[0], 0);
                    DialogManager.GetInstance().TriggerDialog(dialogId);
                }
            }
            else if (main.ToLower().StartsWith("ride_all"))
            {
                mTestRide = true;
                foreach (var item in ActorManager.Instance.PlayerSet)
                {
                    item.Value.mRideCtrl.RemotePlayerUsingRideId        = 400001;
                    item.Value.mRideCtrl.RemotePlayerServerStatusRiding = true;
                }
                return(true);
            }
            else if (main.ToLower().StartsWith("unride_all"))
            {
                mTestRide = false;
                foreach (var item in ActorManager.Instance.PlayerSet)
                {
                    item.Value.mRideCtrl.RemotePlayerServerStatusRiding = false;
                }
                return(true);
            }
            else if (main.ToLower().StartsWith("exit"))
            {
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_EXITINSTANCE, null);
                return(true);
            }
            else if (main.ToLower() == "fast_sys_open")
            {
                //                 xc.ui.UIMainmapSysOpenWindow.ShowSysOpenAnim = false;
                return(true);
            }
            else if (main.ToLower().Equals("show_win"))
            {
                if (paramArray.Count > 2)
                {
                    int param_int   = 0;
                    int param_int_2 = 0;
                    if (int.TryParse(paramArray[1], out param_int) && int.TryParse(paramArray[2], out param_int_2))
                    {
                        xc.ui.ugui.UIManager.Instance.ShowWindow(paramArray[0], param_int, param_int_2);
                    }
                }
                else if (paramArray.Count > 1)
                {
                    int param_int = 0;
                    if (int.TryParse(paramArray[1], out param_int))
                    {
                        xc.ui.ugui.UIManager.Instance.ShowWindow(paramArray[0], param_int);
                    }
                }
                else if (paramArray.Count > 0)
                {
                    //xc.ui.UIManager.Instance.UIMain.StartCoroutine(xc.ui.UIManager.GetInstance().ShowWindow(paramArray[0]));
                    xc.ui.ugui.UIManager.Instance.ShowWindow(paramArray[0]);
                }
                return(true);
            }
            else if (main.ToLower().Equals("show_sys_win"))
            {
                if (paramArray.Count > 0)
                {
                    xc.ui.ugui.UIManager.Instance.ShowSysWindow(paramArray[0]);
                }
                return(true);
            }
            else if (main.ToLower().Equals("close_win"))
            {
                if (paramArray.Count > 0)
                {
                    //xc.ui.UIManager.Instance.UIMain.StartCoroutine(xc.ui.UIManager.GetInstance().ShowWindow(paramArray[0]));
                    xc.ui.ugui.UIManager.Instance.CloseWindow(paramArray[0]);
                }
                return(true);
            }
            else if (main.ToLower().Equals("close_sys_win"))
            {
                if (paramArray.Count > 0)
                {
                    xc.ui.ugui.UIManager.Instance.CloseSysWindow(paramArray[0]);
                }
                return(true);
            }
            else if (main.ToLower().StartsWith("crashu"))
            {
                //becarefull!
                Debug.Log("crash c#");
                MainGame.HeartBehavior.StartCoroutine(CreateNewObject());
                return(true);
            }
            else if (main.ToLower().StartsWith("hangup"))
            {
                //becarefull!
                System.Threading.Thread.Sleep(10000);
                return(true);
            }
            else if (main.ToLower() == "test_lua")
            {
                //xc.ui.UIManager.Instance.ShowWindow("LuaTestWindow");
                var funcName = paramArray[0];
                var method   = typeof(LuaTestMgr).GetMethod(funcName);
                if (method != null)
                {
                    method.Invoke(LuaTestMgr.Instance, null);
                }
                else
                {
                    GameDebug.LogError("Can not find method " + funcName + " in LuaTestMgr");
                }
                return(true);
            }
            else if (main.ToLower() == "save_call")
            {
                //LuaBugFixMgr.SaveCallFile();
                return(true);
            }
            else if (main.ToLower().StartsWith("play_movie"))
            {
#if UNITY_ANDROID || UNITY_IPHONE
                var path = paramArray[0];
                Handheld.PlayFullScreenMovie(path, Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);
#endif
                return(true);
            }
            else if (main.ToLower() == "test_avatar") // 测试变身技能
            {
                uint type_id = 0;                     // 角色id
                if (paramArray.Count > 0)
                {
                    uint.TryParse(paramArray[0], out type_id);
                }

                var player = Game.Instance.GetLocalPlayer();
                if (player != null)
                {
                    //bool isShifted = player.mAvatarCtrl.IsShapeShift;
                    //player.mAvatarCtrl.ShapeShift(!isShifted, type_id, 0);
                    //player.mAvatarCtrl.ShapeShift(isShifted, type_id, 1);

                    player.BuffCtrl.AddBuff(20018, 3.0f);
                    player.BuffCtrl.AddBuff(23005, 5.0f);//test_avatar 19001
                }
                return(true);
            }
            else if (main.ToLower() == "test_shift") // 测试变身技能
            {
                uint type_id = 0;                    // 角色id
                if (paramArray.Count > 0)
                {
                    uint.TryParse(paramArray[0], out type_id);
                }

                var player = Game.Instance.GetLocalPlayer();
                if (player != null)
                {
                    player.BuffCtrl.AddBuff(23005, 30.0f);
                    player.Kill();
                }
                return(true);
            }

            else if (main.ToLower() == "fightingtip")
            {
                var str = paramArray[0];
                buffID = uint.Parse(str);

                new Utils.Timer((int)(20 * 1000f), true, 0.5f * 1000f, OnFightEffectTimer);
                return(true);
            }
            else if (main.ToLower() == "clearcd")
            {
                uint skill_id = 0;// 角色id
                if (paramArray.Count > 0)
                {
                    uint.TryParse(paramArray[0], out skill_id);
                }

                Actor localplayer = Game.GetInstance().GetLocalPlayer();
                if (localplayer != null)
                {
                    localplayer.CDCtrl.RemoveCD(skill_id);
                }
                debugUI.ProcessCommand("c:#ignore_skill_cd");

                return(true);
            }
            else if (main.ToLower() == "setskill")
            {
                uint skill_id  = 0; // 技能id
                uint skill_pos = 0; // 技能pos
                if (paramArray.Count < 2)
                {
                    return(false);
                }

                uint.TryParse(paramArray[0], out skill_id);
                uint.TryParse(paramArray[1], out skill_pos);

                SkillManager.Instance.SetOpeningSkill(DBCommandList.BtnToOPFlag(skill_pos), skill_id);
                return(true);
            }
            else if (main.ToLower().StartsWith("float_tips"))
            {
                UINotice.Instance.ShowMessage(paramArray[0]);
                return(true);
            }
            else if (main.ToLower().StartsWith("rolling_notice"))
            {
                UINotice.Instance.ShowRollingNotice(paramArray[0]);
                return(true);
            }
            else if (main.ToLower().StartsWith("warnning"))
            {
                UINotice.Instance.ShowWarnning(paramArray[0]);
                return(true);
            }
            else if (main.ToLower().StartsWith("danmu"))
            {
                UINotice.Instance.ShowDanmaku(paramArray[0]);
                return(true);
            }
            else if (main.ToLower().StartsWith("bottom_message"))
            {
                UINotice.Instance.ShowBottomMessage(paramArray[0]);
                return(true);
            }
            else if (main.ToLower().StartsWith("reloadui"))
            {
                string name = "";
                if (paramArray.Count > 0)
                {
                    name = paramArray[0];
                    xc.ui.ugui.UIManager.Instance.CloseWindow(name);
                    xc.ui.ugui.UIManager.Instance.ShowWindow(name);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else if (main.ToLower().StartsWith("pet_attack_parent_target"))
            {
                if (paramArray.Count > 0)
                {
                    int         useParentTarget = DBTextResource.ParseI_s(paramArray[0], 0);
                    LocalPlayer localPlayer     = Game.Instance.GetLocalPlayer() as LocalPlayer;
                    if (localPlayer != null)
                    {
                        Pet currentPet = localPlayer.GetPet();
                        if (currentPet != null)
                        {
                            BehaviourAI ai = currentPet.GetAI() as BehaviourAI;
                            if (ai != null && ai.RunningProperty != null)
                            {
                                if (useParentTarget == 0)
                                {
                                    ai.RunningProperty.IsAttackParentTarget = false;
                                }
                                else
                                {
                                    ai.RunningProperty.IsAttackParentTarget = true;
                                }
                            }
                        }
                    }
                }
            }
            else if (main.ToLower().Equals("p"))
            {
                TestUnit.DisplayDebugDraw = !TestUnit.DisplayDebugDraw;
                return(true);
            }
            else if (main.ToLower() == "test_db")
            {
                System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
                stopwatch.Start();
                for (int i = 0; i < 1; ++i)
                {
                    List <Dictionary <string, string> > ret = DBManager.Instance.QuerySqliteRow <string>(GlobalConfig.DBFile, "reward", "item_id", "100101");
                }
                GameDebug.LogRed("Db query time: " + stopwatch.ElapsedMilliseconds);
                stopwatch.Stop();
                stopwatch.Start();
                for (int i = 0; i < 1; ++i)
                {
                    string queryStr = string.Format("SELECT * FROM {0} WHERE {0}.{1} LIKE \"{2}__\"", "reward", "item_id", 1001);
                    List <Dictionary <string, string> > ret = DBManager.Instance.QuerySqliteRow(GlobalConfig.DBFile, "reward", queryStr);
                }
                GameDebug.LogRed("Db query time: " + stopwatch.ElapsedMilliseconds);
                return(true);
            }
            else if (main.ToLower() == "notice_dlg")
            {
                if (paramArray.Count > 0)
                {
                    string text = paramArray[0];
                    xc.ui.UIWidgetHelp.GetInstance().ShowNoticeDlg(xc.ui.ugui.UINoticeWindow.EWindowType.WT_OK_DisableCloseBtn, "", text, null, null);
                }
                else
                {
                    xc.ui.UIWidgetHelp.GetInstance().ShowNoticeDlg(xc.ui.ugui.UINoticeWindow.EWindowType.WT_OK_DisableCloseBtn, "teset", null, null);
                }
                return(true);
            }
            else if (main.ToLower() == "toggle_notice_dlg")
            {
                xc.ui.UIWidgetHelp.GetInstance().ShowNoticeDlg(xc.ui.ugui.UINoticeWindow.EWindowType.WT_OK_Cancel_Toggle, "title", "content", null, null, null, null, "", "", "toggle_text", false);
                return(true);
            }
            else if (main.ToLower() == "reload") // 重载表格
            {
                string table_name = "";
                if (paramArray.Count > 0)
                {
                    DBManager.Instance.ClearCache();
                    table_name = paramArray[0];
                    var table = DBManager.Instance.GetDB(table_name);
                    if (table != null)
                    {
                        table.Unload();
                        table.Load();
                    }
                }

                return(true);
            }
            else if (main.ToLower() == "newskill")// 新技能的指令
            {
                uint skill_id = 0;
                if (paramArray.Count > 0)
                {
                    skill_id = uint.Parse(paramArray[0]);
                    SkillHoleManager.Instance.ClearSkill(skill_id);
                    SkillHoleManager.Instance.OpenNewSkill(skill_id);
                }

                return(true);
            }
            else if (main.ToLower().Equals("hide_debug_ui"))
            {
                MainGame.HideDebugUI();
                return(true);
            }
            else if (main.ToLower().Equals("hide_ui"))
            {
                MainGame.HideDebugUI();
                xc.ui.ugui.UIManager.Instance.ClearUI();
                return(true);
            }
            else if (main.ToLower().Equals("hide_ui_and_hook"))
            {
                MainGame.HideDebugUI();
                xc.ui.ugui.UIManager.Instance.ClearUI();
                InstanceManager.Instance.SetOnHook(true);
                return(true);
            }
            else if (main.ToLower().Equals("play_timeline"))
            {
                if (paramArray.Count > 0)
                {
                    uint id = uint.Parse(paramArray[0]);
                    TimelineManager.Instance.Play(id, null);
                }
                return(true);
            }
            else if (main.ToLower().Equals("timeline_change_skin"))
            {
                if (paramArray.Count > 0)
                {
                    uint param = uint.Parse(paramArray[0]);
                    TimelineManager.Instance.changeSkin = param == 1;
                }
                return(true);
            }
            else if (main.ToLower().Equals("play_timeline_and_jump"))
            {
                if (paramArray.Count > 1)
                {
                    uint id         = uint.Parse(paramArray[0]);
                    uint instanceId = uint.Parse(paramArray[1]);
                    TimelineManager.Instance.Play(id, () =>
                    {
                        xc.SceneHelp.JumpToScene(instanceId);
                    });
                }
                return(true);
            }
            else if (main.ToLower().Equals("preload_timeline"))
            {
                if (paramArray.Count > 0)
                {
                    uint id = uint.Parse(paramArray[0]);
                    TimelineManager.Instance.Preload(id);
                }
                return(true);
            }
            else if (main.ToLower().Equals("st"))
            {
                TimelineManager.Instance.Stop();
                return(true);
            }
            else if (main.ToLower().Equals("npc_unload_model"))
            {
                if (paramArray.Count > 0)
                {
                    uint      id  = uint.Parse(paramArray[0]);
                    NpcPlayer npc = NpcManager.Instance.GetNpcByNpcId(id);
                    if (npc != null)
                    {
                        npc.mAvatarCtrl.UnloadModel();
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("npc_reload_model"))
            {
                if (paramArray.Count > 0)
                {
                    uint      id  = uint.Parse(paramArray[0]);
                    NpcPlayer npc = NpcManager.Instance.GetNpcByNpcId(id);
                    if (npc != null)
                    {
                        npc.mAvatarCtrl.ReloadModel();
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("ui_delay"))
            {
                if (paramArray.Count < 0)
                {
                    return(false);
                }
                float delay;
                float.TryParse(paramArray[0], out delay);
                if (delay >= 0)
                {
                    UIManager.Instance.MainCtrl.Delay = delay;
                }
                return(true);
            }
            else if (main.ToLower().Equals("skip_sys_open") || main.ToLower().Equals("sso"))
            {
                SysConfigManager.Instance.SkipSysOpen = true;
                return(true);
            }
            else if (main.ToLower() == "show_chip")// 显示碎片动画
            {
                if (paramArray.Count >= 2)
                {
                    uint goods_id  = uint.Parse(paramArray[0]);
                    uint goods_num = uint.Parse(paramArray[1]);
                    xc.ui.ugui.UIManager.Instance.ShowWindow("UIBossFragmentsWindow", goods_id, goods_num);
                }
                return(true);
            }
            else if (main.ToLower() == "show_pet")// 显示获得守护
            {
                if (paramArray.Count >= 1)
                {
                    uint pet_id = uint.Parse(paramArray[0]);
                    xc.ui.ugui.UIManager.Instance.ShowWindow("UIGetNewPetWindow", pet_id);
                }
                return(true);
            }
            else if (main.ToLower() == "play_xihun")
            {
                string sound_path = "Assets/" + ResPath.Sound_ui_xihun;

                xc.AudioManager.DynamicAudioParam param = new xc.AudioManager.DynamicAudioParam();
                param.res_path = sound_path;
                param.is_loop  = false;
                param.volume   = 1;
                xihun_sound_id = xc.AudioManager.Instance.PlayAudio_dynamic_out(param);
                return(true);
            }
            else if (main.ToLower() == "stop_xihun")
            {
                xc.AudioManager.Instance.StopAudio_dynamic(xihun_sound_id);
                return(true);
            }
            else if (main.ToLower() == "show_mount")// 显示坐骑获得动画
            {
                if (paramArray.Count >= 1)
                {
                    uint mount_id = uint.Parse(paramArray[0]);
                    xc.ui.ugui.UIManager.Instance.ShowWindow("UIGetNewMountWindow", mount_id);
                }
            }
            else if (main.ToLower() == "set_mount")// 设置主角坐骑ID
            {
                if (paramArray.Count >= 1)
                {
                    uint  mount_id     = uint.Parse(paramArray[0]);
                    Actor local_player = xc.Game.Instance.GetLocalPlayer();
                    if (local_player != null)
                    {
                        local_player.MountId = mount_id;
                    }
                }
            }
            else if (main.ToLower() == "router")   //跳转
            {
                if (paramArray.Count == 1)
                {
                    uint sys_id = uint.Parse(paramArray[0]);
                    RouterManager.Instance.GenericGoToSysWindow(sys_id);
                }
                else if (paramArray.Count == 2)
                {
                    uint sys_id = uint.Parse(paramArray[0]);
                    uint param1 = uint.Parse(paramArray[1]);
                    RouterManager.Instance.GenericGoToSysWindow(sys_id, param1);
                }
            }
            else if (main.ToLower() == "pause_instance")// 暂停副本
            {
                InstanceHelper.PauseInstance();
            }
            else if (main.ToLower() == "resume_instance")// 恢复副本
            {
                InstanceHelper.ResumeInstance();
            }
            else if (main.ToLower().Equals("task_changed"))// fire一个任务变化的事件
            {
                ClientEventMgr.Instance.FireEvent((int)ClientEvent.TASK_CHANGED, null);
                return(true);
            }
            else if (main.ToLower().Equals("finish_task"))// fire一个完成任务的事件
            {
                if (paramArray.Count > 0)
                {
                    uint id = uint.Parse(paramArray[0]);
                    ClientEventMgr.Instance.FireEvent((int)ClientEvent.TASK_FINISHED, new CEventBaseArgs(id));
                }
                return(true);
            }
            else if (main.ToLower().Equals("cam_zoom"))// 拉近拉远摄像机
            {
                if (paramArray.Count > 0)
                {
                    float zoom = float.Parse(paramArray[0]);
                    if (Game.Instance.CameraControl != null)
                    {
                        Game.Instance.CameraControl.Zoom = zoom;
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("cam_fov"))// 拉近拉远摄像机
            {
                if (paramArray.Count > 0)
                {
                    float fov = float.Parse(paramArray[0]);
                    if (Game.Instance.CameraControl != null)
                    {
                        Game.Instance.CameraControl.FOV = fov;
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("cam_follow_dis"))// 拉近拉远摄像机
            {
                if (paramArray.Count > 0)
                {
                    float followDistance = float.Parse(paramArray[0]);
                    if (Game.Instance.CameraControl != null)
                    {
                        Game.Instance.CameraControl.FollowDistance = followDistance;
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("stop_navigate"))// 停止寻路
            {
                TargetPathManager.Instance.StopPlayerAndReset();
                return(true);
            }
            else if (main.ToLower().Equals("large_num_float_tips"))// 大数字飘字
            {
                if (paramArray.Count > 0)
                {
                    ulong num           = ulong.Parse(paramArray[0]);
                    uint  decimalPlaces = 1;
                    if (paramArray.Count > 1)
                    {
                        decimalPlaces = uint.Parse(paramArray[1]);
                    }
                    UINotice.Instance.ShowMessage(xc.ui.UIWidgetHelp.GetLargeNumberString(num, decimalPlaces));
                }
                return(true);
            }
            else if (main.ToLower().Equals("enter_guild_manor"))// 进入帮派领地
            {
                InstanceHelper.EnterGuildManor();
                return(true);
            }
            else if (main.ToLower().Equals("fly"))// 主角瞬移
            {
                if (paramArray.Count > 1)
                {
                    float x           = float.Parse(paramArray[0]);
                    float z           = float.Parse(paramArray[1]);
                    Actor localPlayer = Game.Instance.GetLocalPlayer();
                    if (localPlayer != null)
                    {
                        localPlayer.MoveCtrl.SendFly(new Vector3(x, 0f, z));
                    }
                }
                return(true);
            }
            else if (main.ToLower().Equals("-jumpscene"))// 跳场景动画测试
            {
                var local_player = Game.Instance.GetLocalPlayer();
                if (local_player != null)
                {
                    local_player.BeginJumpScene("jumpout");
                }

                return(true);
            }
            else if (main.ToLower().Equals("posteffect"))// 后处理效果测试
            {
                WaterWaveEffect.Instance.Start(2.0f, null);

                return(true);
            }
            else if (main.ToLower().Equals("lowfps"))// fps较低
            {
                ClientEventMgr.Instance.PostEvent((int)ClientEvent.CE_SETTING_LOW_FPS, null);

                return(true);
            }
            else if (main.ToLower().Equals("event"))//
            {
                int eventId = 0;
                if (paramArray.Count > 0)
                {
                    eventId = int.Parse(paramArray[0]);
                }
                ClientEventMgr.GetInstance().FireEvent(eventId, null);
            }
            else if (main.ToLower().Equals("testdb"))
            {
                var buff_info = DBBuffSev.GetInstance().GetBuffInfo(25103);

                /*var db_stigmalv = DBManager.Instance.GetDB<DBStigmaLv>();
                 * var max_lv = db_stigmalv.GetMaxLevel(100001);
                 * var info = db_stigmalv.GetOneInfo(100001, 1);
                 *
                 * var text = DBConstText.GetText("GUILD_FIRE_DRINK_WINE_ROLLING_NOTICE");
                 * var random_text = DBConstText.GetRandomText("GUILD_FIRE_GET_MEAT_SYS_MSG_",3);
                 * var db_guildskill = DBManager.Instance.GetDB<DBGuildSkill>();
                 * var skill_info = db_guildskill.GetOneItem(1, 10);
                 *
                 * var dv_equip_attr = DBManager.Instance.GetDB<DBEquipAttr>();
                 * var a = dv_equip_attr.GetAttrData(993901);
                 * var b = dv_equip_attr.GetAttrDataByGroupId(9939);
                 *
                 * var d = DBSuitRefine.Instance.GetRefineListByPos(EEquipPos.POS_ARMOUR, 5);
                 * var s = DBSuitRefine.Instance.GetData("3_7_3");*/

                return(true);
            }
            else if (main.ToLower().Equals("testdrop"))
            {
                //InstanceDropManager.Instance.DestroyAllDrops();

                var drop = new S2CNwarDrop();
                drop.em_id     = 0;
                drop.drop_type = 1;
                for (int i = 0; i < 100; ++i)
                {
                    var give = new PkgDropGive();
                    give.oid  = (uint)i + 1;
                    give.type = GameConst.GIVE_TYPE_GOODS;
                    give.gid  = 1085;
                    give.num  = 1;
                    give.time = Game.Instance.ServerTime;
                    give.name = System.Text.Encoding.UTF8.GetBytes("掉落归属者");
                    drop.drops.Add(give);
                }

                byte[] serialData = null;
                using (MemoryStream m = new MemoryStream())
                {
                    Serializer.Serialize <S2CNwarDrop>(m, drop);
                    m.Position = 0;

                    serialData = new byte[m.Length];
                    m.Read(serialData, 0, (int)m.Length);
                }

                Game.GetInstance().ProcessServerData(NetMsg.MSG_NWAR_DROP, serialData);
            }
            else if (main.ToLower().Equals("clear_drop"))
            {
                InstanceDropManager.Instance.DestroyAllDrops();
            }
            else if (main.ToLower().Equals("copy"))
            {
                if (paramArray.Count > 0)
                {
                    TextHelper.CopyTextToClipboard(paramArray[0]);
                }
            }
            else if (main.ToLower().Equals("test_download"))
            {
                if (paramArray.Count > 0)
                {
                    xpatch.http.Request httpRequest = new xpatch.http.Request();
                    httpRequest.Url        = paramArray[0];
                    httpRequest.SavePath   = Application.dataPath + "/../download";
                    httpRequest.ResumeSize = 0;
                    httpRequest.ExecuteDownload();
                }
            }
            else if (main.ToLower().Equals("log_msg"))
            {
                xc.Game.Instance.PackRecorder.EnableLogFile = true;
            }

            LuaScriptMgr.Instance.CallLuaFunction(LuaScriptMgr.Instance.Lua.Global, "LuaProcessDebugCommand", main, paramArray);

            return(false);
        }