コード例 #1
0
        InstanceTypeInfo GetItemInfo(uint warType, uint warSubType)
        {
            uint key      = MakeKey(warType, warSubType);
            var  war_type = "";

            if (warType == GameConst.WAR_TYPE_DUNGEON)
            {
                war_type = "WAR_TYPE_DUNGEON";
            }
            else if (warType == GameConst.WAR_TYPE_WILD)
            {
                war_type = "WAR_TYPE_WILD";
            }
            var    war_sub_type = DBInstanceType.Instance.GetInstanceType(warSubType);
            string query        = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\" AND {0}.{3}=\"{4}\"", mTableName, "war_type", war_type, "war_subtype", war_sub_type);
            var    reader       = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query);

            if (reader == null)
            {
                mInstanceTypeControls[key] = null;
                return(null);
            }

            if (!reader.HasRows || !reader.Read())
            {
                mInstanceTypeControls[key] = null;

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

            var info = new InstanceTypeInfo();

            info.m_WarType                  = warType;
            info.m_WarSubType               = warSubType;
            info.m_PrecedentPlayer          = DBTextResource.ParseUI_s(GetReaderString(reader, "precedent_player"), 0) == 1;
            info.m_CannotHidePlayer         = DBTextResource.ParseUI_s(GetReaderString(reader, "cannot_hide_player"), 0) == 1;
            info.m_PKLevelLimit             = DBTextResource.ParseUI_s(GetReaderString(reader, "pk_lv_limit"), 0) == 1;
            info.m_UsePKMode                = DBTextResource.ParseUI_s(GetReaderString(reader, "use_pk_mode"), 0) == 1;
            info.m_NoShowAtkCampTips        = DBTextResource.ParseUI_s(GetReaderString(reader, "no_show_atk_camp_tips"), 0) == 1;
            info.m_IgnoreClickPlayer        = DBTextResource.ParseUI_s(GetReaderString(reader, "ignore_click_player"), 0) == 1;
            info.m_ForceShowHpBar           = DBTextResource.ParseUI_s(GetReaderString(reader, "force_show_hp_bar"), 0) == 1;
            info.m_ForbidUseGoodsTypes      = DBTextResource.ParseArrayKeyValuePairUintUint(GetReaderString(reader, "forbid_use_goods_types"));
            info.m_ForbidChangePk           = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_change_pk"), 0) == 1;
            info.m_ShowDanmakuChatChannels  = DBTextResource.ParseArrayUint(GetReaderString(reader, "show_danmaku_switch"), ",");
            info.m_ForbidOpenWorldMap       = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_open_world_map"), 0) == 1;
            info.m_HideHpBar                = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_hp_bar"), 0) == 1;
            info.m_HideCamp                 = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_camp"), 0) == 1;
            info.m_ForbidPet                = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_pet"), 0) == 1;
            info.m_HideTeam                 = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_team"), 0) == 1;
            info.m_ForbidTeam               = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_team"), 0) == 1;
            info.m_HidePvpHpBar             = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_pvp_hp_bar"), 0) == 1;
            info.m_AutoPickDrop             = DBTextResource.ParseUI_s(GetReaderString(reader, "auto_pick_drop"), 0) == 1;
            info.m_IsShowAutoFightingGotExp = DBTextResource.ParseUI_s(GetReaderString(reader, "is_show_auto_fighting_got_exp"), 0) == 1;
            info.m_ActId       = DBTextResource.ParseUI_s(GetReaderString(reader, "act_id"), 0);
            info.m_ExitTips    = GetReaderString(reader, "exit_tips");
            info.m_is_can_exit = DBTextResource.ParseUI_s(GetReaderString(reader, "is_can_exit"), 0) == 1;
            info.m_ForbidJumpOutAnimationOut  = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_jump_out_animation_out"), 0) == 1;
            info.m_ForbidJumpOutAnimationIn   = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_jump_out_animation_in"), 0) == 1;
            info.m_PlayJumpOutAnimationTeamIn = DBTextResource.ParseUI_s(GetReaderString(reader, "play_jump_out_animation_team_in"), 0) == 1;
            info.m_HideCount            = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_count"), 0) == 1;
            info.m_ForbidElfin          = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_elfin"), 0) == 1;
            info.m_ForbidMagicPet       = DBTextResource.ParseUI_s(GetReaderString(reader, "forbid_magic_pet"), 0) == 1;
            info.m_hide_guild           = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_guild"), 0) == 1;
            info.m_hide_mate            = DBTextResource.ParseUI_s(GetReaderString(reader, "hide_mate"), 0) == 1;
            info.m_replace_name         = GetReaderString(reader, "replace_name");
            info.m_BanShortCutWin       = DBTextResource.ParseUI_s(GetReaderString(reader, "ban_shortCut_win"), 0) == 1;
            info.m_BanBossNoticeWin     = DBTextResource.ParseUI_s(GetReaderString(reader, "ban_boss_notice_win"), 0) == 1;
            info.m_BanMarriageNoticeWin = DBTextResource.ParseUI_s(GetReaderString(reader, "ban_marriage_notice_win"), 0) == 1;
            info.m_NoFlyShoe            = DBTextResource.ParseUI_s(GetReaderString(reader, "no_fly_shoe"), 0) == 1;
            info.m_AutoCollect          = DBTextResource.ParseUI_s(GetReaderString(reader, "auto_collect"), 0) == 1;
            info.m_DoNotPatrol          = DBTextResource.ParseUI_s(GetReaderString(reader, "do_not_patrol"), 0) == 1;
            info.m_ShowServerName       = DBTextResource.ParseUI_s(GetReaderString(reader, "show_server_name"), 0) == 1;
            info.m_ClearCd        = DBTextResource.ParseUI_s(GetReaderString(reader, "clear_cd"), 0) == 1;
            info.m_MinPlayerCount = DBTextResource.ParseUI_s(GetReaderString(reader, "min_player_count"), 0);

            mInstanceTypeControls[key] = info;

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