Пример #1
0
        public void Load(string strFilePath)
        {
            ScpReader reader = new ScpReader(strFilePath, true, 2);

            if (reader == null)
            {
                Trace.LogError("read scheme fail! file:" + strFilePath);
                return;
            }

            m_dicOBCtrlKeyCodeNodeMap.Clear();
            m_dicOBCtrlParamNodeMap.Clear();
            int nCount = reader.GetRecordCount();

            for (int row = 0; row < nCount; row++)
            {
                int nType = reader.GetInt(row, (int)Column_OBCtrl.COL_TYPE, 0);
                if (nType == 1)
                {
                    LoadKeyCodeNode(reader, row);
                }
                else if (nType == 2)
                {
                    LoadParamNode(reader, row);
                }
                else
                {
                    Trace.LogError("invalid type! row = " + row + "file:" + strFilePath);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化英雄信息配置
        /// </summary>
        /// <param name="strDefaultViewConfigPath"></param>
        private void InitAboutDetailedPropertyInfo(string strDefaultViewConfigPath)
        {
            string strDetailedPropertyInfoPath = strDefaultViewConfigPath + MobaSchemesConfig.DETAILED_PROPERTY_INFO;

            ScpReader DetailedPropertyInfoReader = new ScpReader(strDetailedPropertyInfoPath, true, 2);

            DetailedPropertyInfoTable = new Hashtable();
            int PropertyID = 0;

            for (int i = 0; i < DetailedPropertyInfoReader.GetRecordCount(); i++)
            {
                MobaDetatiledPropertyInfo PropertyInfo = new MobaDetatiledPropertyInfo();
                PropertyID = DetailedPropertyInfoReader.GetInt(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyID, -1);
                if (PropertyID == -1)
                {
                    continue;
                }
                PropertyInfo.PropertyName = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyName, "");
                PropertyInfo.PropertyDes  = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyDes, "");

                UBB.toHtml(ref PropertyInfo.PropertyDes);

                DetailedPropertyInfoTable.Add(PropertyID, PropertyInfo);
            }
        }
Пример #3
0
    public static void LoadResourceTable(string path)
    {
        resourcetable.Clear();
        ScpReader reader = new ScpReader(path, true);

        for (int i = 0; i < reader.GetRecordCount(); i++)
        {
            ResourceInfoEx currentinfo = new ResourceInfoEx();
            currentinfo.bundlename    = reader.GetString(i, 2, "");
            currentinfo.assetfilename = reader.GetString(i, 3, "");
            currentinfo.objectname    = reader.GetString(i, 1, "");
            currentinfo.classname     = reader.GetString(i, 0, "");
            currentinfo.typename      = reader.GetString(i, 4, "");
            currentinfo.path          = reader.GetString(i, 5, "");
            currentinfo.offset        = reader.GetLong(i, 6, -1);
            currentinfo.length        = reader.GetLong(i, 7, -1);
            if (resourcetable.ContainsKey(currentinfo.classname) == false)
            {
                resourcetable[currentinfo.classname] = new Dictionary <string, ResourceInfoEx>();
            }
            Dictionary <string, ResourceInfoEx> resourcelist = resourcetable[currentinfo.classname];
            resourcelist[currentinfo.objectname] = currentinfo;
        }

        reader.Dispose();

        Trace.Log("ResourceEx::LoadResourceTable:" + path + " finish");
    }
Пример #4
0
        public void Load(string strFilePath)
        {
            ScpReader reader = new ScpReader(strFilePath, true, 2);

            if (reader == null)
            {
                Trace.LogError("read sheme fail! file=" + strFilePath);
                return;
            }
            m_dicHeroSoundNodeMap.Clear();
            int nRecordCount = reader.GetRecordCount();

            for (int row = 0; row < nRecordCount; row++)
            {
                int nHeroID = reader.GetInt(row, 0, 0);
                if (m_dicHeroSoundNodeMap.ContainsKey(nHeroID))
                {
                    Trace.LogWarning("scheme id repeat! " + schemeFileName + " row=" + row);
                    continue;
                }

                string randomArry = reader.GetString(row, 1, "");

                SchemeHeroSoundNode node = new SchemeHeroSoundNode(nHeroID);
                node.PushSoundData(randomArry);

                m_dicHeroSoundNodeMap.Add(nHeroID, node);
            }
        }
Пример #5
0
        private void InitChatEmoticonConfigCsv(string strPath)
        {
            ScpReader reader = new ScpReader(strPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeChatEmoticonData sConfig = new SSchemeChatEmoticonData();
                sConfig.nEmoticonID       = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_ID, 0);
                sConfig.nEmoticonSerialID = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_Serial, 0);
                sConfig.eEmoticonType     = (EMChatEmoticonType)Enum.Parse(typeof(EMChatEmoticonType), reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_Type, ""));
                sConfig.szEmoticonKey     = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_Key, string.Empty);
                sConfig.szCharInput       = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_CharInput, string.Empty);
                sConfig.szTipDesc         = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_TipDesc, string.Empty);
                sConfig.nEmoticonSellID   = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_SellID, 0);
                sConfig.nEmoticonSkillID  = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_skillID, 0);

                if (m_dicChatEmoticonConfig.ContainsKey(sConfig.nEmoticonID))
                {
                    Trace.LogWarning("有相同的聊天表情ID" + sConfig.nEmoticonID + "表第" + i + "行");
                }
                else
                {
                    m_dicChatEmoticonConfig.Add(sConfig.nEmoticonID, sConfig);
                }

                if (!m_chatEmoticonSerialList.ContainsKey(sConfig.nEmoticonSerialID))
                {
                    m_chatEmoticonSerialList.Add(sConfig.nEmoticonSerialID, new List <SSchemeChatEmoticonData>());
                }
                m_chatEmoticonSerialList[sConfig.nEmoticonSerialID].Add(sConfig);
            }
            reader.Dispose();
            reader = null;
        }
Пример #6
0
        // 初始化csv表
        protected void InitRunePageCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            allRunePageTable = new Hashtable();
            aRuneArray       = new int[DefaultTypeCount, DefaultLevelCount, DefaultSameLevelCount]; // 目前写死
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeRuneConfig sConfig = new SSchemeRuneConfig();
                sConfig.nId                    = reader.GetInt(i, (int)Rune.EMT_ID, 0);
                sConfig.szRuneName             = reader.GetString(i, (int)Rune.EMT_NAME, "");
                sConfig.nRuneIconId            = reader.GetInt(i, (int)Rune.EMT_ICONID, 0);
                sConfig.nExclusiveId           = reader.GetInt(i, (int)Rune.EMT_EXCLUSIVEID, 0);
                sConfig.nRuneInlayType         = reader.GetInt(i, (int)Rune.EMT_INLAYTYPE, 0);
                sConfig.nRunePropertyType      = reader.GetInt(i, (int)Rune.EMT_PROPERTYTYPE, 0);
                sConfig.nRuneLevel             = reader.GetInt(i, (int)Rune.EMT_LEVEL, 0);
                sConfig.szRuneDESC             = reader.GetString(i, (int)Rune.EMT_DESC, "");
                sConfig.szEffectIdArray        = reader.GetString(i, (int)Rune.EMT_EFFECTIDARRAY, "");
                sConfig.szParametersValueArray = reader.GetString(i, (int)Rune.EMT_EFFECTPARAMETERS, "");
                sConfig.nPropertyNameType      = reader.GetInt(i, (int)Rune.EMT_PROPERTYNAMETYPE, 0);

                if (sConfig.nId == 0)
                {
                    continue;
                }

                allRunePageTable[sConfig.nId] = sConfig;
            }
        }
Пример #7
0
        private void InitCameraConfigCsv(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            CameraConfigTable = new Hashtable();

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int index  = reader.GetInt(i, (int)CamConfig.EMT_INDEX, 0);
                int heroID = reader.GetInt(i, (int)CamConfig.EMT_HEROTYPE, 0);
                int mapID  = reader.GetInt(i, (int)CamConfig.EMT_MAPTYPE, 0);


                SoldierCamera.CameraParam[] caminfo = new SoldierCamera.CameraParam[4];

                int modeAttributeCount = 8;//每一项有8个参数
                for (int mode = 0; mode < 4; mode++)
                {
                    caminfo[mode]             = new SoldierCamera.CameraParam();
                    caminfo[mode].curDistance = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_DEFAULTDISTANCE, 0);
                    Vector2 disRange = new Vector2();
                    disRange.x = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MINDISTANCE, 0);
                    disRange.y = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MAXDISTANCE, 0);
                    caminfo[mode].distanceRange = disRange;
                    caminfo[mode].curPitchAngle = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_DEFAULTANGLE, 0);
                    Vector2 angleRange = new Vector2();
                    angleRange.x = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MINANGLE, 0);
                    angleRange.y = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MAXANGLE, 0);
                    caminfo[mode].pitchAngleRange = angleRange;
                    caminfo[mode].targetOffset    = reader.GetFloat(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_TARGETOFFSET, 0);
                    caminfo[mode].FOV             = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_FOV, 0);
                }
                CameraConfigTable[mapID * MAX_HERO_TYPE + heroID] = caminfo;
            }
        }
Пример #8
0
        // 载入商城广告页脚本
        private void LoadPointShopADPageConfig(string stPath)
        {
            m_adConfig = new List <SSchemePointShopADConfig>();

            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemePointShopADConfig config = new SSchemePointShopADConfig();
                int nIndex = 0;
                config.nID      = reader.GetInt(i, nIndex++, 0);
                config.strTitle = reader.GetString(i, nIndex++, "");
                config.strDesc  = reader.GetString(i, nIndex++, "");
                config.nLocType = reader.GetInt(i, nIndex++, 0);
                String   strSellID  = reader.GetString(i, nIndex++, "");
                string[] sellIDList = strSellID.Split(';');
                if (sellIDList != null)
                {
                    config.nSellIDList = new List <int>();
                    for (int j = 0; j < sellIDList.Length; ++j)
                    {
                        int nSellID = 0;
                        if (Int32.TryParse(sellIDList[j], out nSellID))
                        {
                            config.nSellIDList.Add(nSellID);
                        }
                    }
                }

                config.strPicName = reader.GetString(i, nIndex++, "");

                m_adConfig.Add(config);
            }
        }
Пример #9
0
        private void LoadDefaultConfig(string stPath)
        {
            //走mpk包暂不判断文件
            //if (!File.Exists(stPath))
            //{
            //    Trace.Error("配置表:ChatSettingConfig.csv 不存在!");
            //    return;
            //}

            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int    index = reader.GetInt(i, (int)ChatSettingTableColumn.Index, 0);
                string value = reader.GetString(i, (int)ChatSettingTableColumn.Value, "");
                if (defaultChatSettingTable.ContainsKey((ChatSettingIndex)index))
                {
                    defaultChatSettingTable[(ChatSettingIndex)index] = value;
                }
                else
                {
                    defaultChatSettingTable.Add((ChatSettingIndex)index, value);
                }
            }

            foreach (KeyValuePair <ChatSettingIndex, string> kvp in defaultChatSettingTable)
            {
                currentChatSettingTable.Add(kvp.Key, kvp.Value);
            }
        }
Пример #10
0
        // 初始化csv表
        protected void InitSelectArrayTipPageCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            allSelectArrayTipPageTable = new Hashtable();
            int nIndex = (int)SELECTARRAYTIP.EMT_ID;

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeSelectArrayTipConfig sConfig = new SSchemeSelectArrayTipConfig();
                sConfig.nId                = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.sName              = reader.GetString(i, (int)nIndex++, "");
                sConfig.nTiplimit          = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAssassinDown      = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAssassinUp        = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSoldier_limitDown = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSoldier_limitUp   = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nMagicDown         = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nMagicUp           = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAdcDown           = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAdcUp             = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSupportDown       = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSupportUp         = reader.GetInt(i, (int)nIndex++, 0);
                allSelectArrayTipPageTable[sConfig.nId] = sConfig;
            }

            InitSelectArrayTypeWord((int)MatchType.MatchType_One);
        }
Пример #11
0
        // 初始化csv表
        protected void InitWarSupportPositionConfigCsv(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            allWarSupportPositionConfigTable = new Hashtable();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nCol = 0;
                SSchemeWarSupportPositionConfig sConfig = new SSchemeWarSupportPositionConfig();
                sConfig.nSortID            = reader.GetInt(i, nCol++, 0);
                sConfig.nPlayerCount       = reader.GetInt(i, nCol++, 0);
                sConfig.fUIPositionOffsetX = reader.GetFloat(i, nCol++, 0.0f);
                sConfig.playerOffsetVec3.x = reader.GetFloat(i, nCol++, 0.0f);
                sConfig.playerOffsetVec3.y = reader.GetFloat(i, nCol++, 0.0f);
                sConfig.playerOffsetVec3.z = reader.GetFloat(i, nCol++, 0.0f);

                if (allWarSupportPositionConfigTable.ContainsKey(sConfig.nSortID))
                {
                    (allWarSupportPositionConfigTable[sConfig.nSortID] as List <SSchemeWarSupportPositionConfig>).Add(sConfig);
                }
                else
                {
                    List <SSchemeWarSupportPositionConfig> positionList = new List <SSchemeWarSupportPositionConfig>();
                    positionList.Add(sConfig);
                    allWarSupportPositionConfigTable[sConfig.nSortID] = positionList;
                }
            }
        }
Пример #12
0
        // 载入奖励脚本
        private void LoadActorPrizeConfig(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nIndex = 0;
                SSchemeActorPrizeConfig sConfig = new SSchemeActorPrizeConfig();
                sConfig.nPrizeID              = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.strPrizeName          = reader.GetString(i, (int)nIndex++, "");
                sConfig.nPrizeIcon            = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPrizeGrade           = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.strPrizeDesc          = reader.GetString(i, (int)nIndex++, "");
                sConfig.nBroadcastFlag        = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPrizeType            = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nCakeTrailEffectID    = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPedestalEffectID     = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPedestalGlowEffectID = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPrizeParam           = new int[5];
                for (int j = 0; j < 5; ++j)
                {
                    sConfig.nPrizeParam[j] = reader.GetInt(i, (int)nIndex++, 0);
                }

                m_actorPrizeConfig[sConfig.nPrizeID] = sConfig;
            }
        }
Пример #13
0
        // 载入宝箱脚本
        private void LoadPrizeChestConfig(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nIndex = 0;
                SSchemePrizeChestConfig sConfig = new SSchemePrizeChestConfig();
                sConfig.nChestId        = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nChestFlag      = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.strChestName    = reader.GetString(i, (int)nIndex++, "");
                sConfig.nShowPrizeID    = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nChestIcon      = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.strChestDesc    = reader.GetString(i, (int)nIndex++, "");
                sConfig.nCanBuy         = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAlwaysShow     = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nChestModelID   = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.strNormalAction = reader.GetString(i, (int)nIndex++, "");
                sConfig.strOpenAction   = reader.GetString(i, (int)nIndex++, "");
                sConfig.strShowAction   = reader.GetString(i, (int)nIndex++, "");
                sConfig.nCamEffectID    = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nNormalEffect   = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nOpenEffect     = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nShowEffect     = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nNotHaveEffect  = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nPrizeGroupID   = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nBgEffectID     = reader.GetInt(i, (int)nIndex++, 0);

                m_prizeChestConfig[sConfig.nChestId] = sConfig;
            }
        }
Пример #14
0
        //加载快捷键信息
        private void LoadKeyCodeNode(ScpReader reader, int row)
        {
            int nGroup = reader.GetInt(row, (int)Column_OBCtrl.COL_GROUP, 0);
            int nIndex = reader.GetInt(row, (int)Column_OBCtrl.COL_INDEX, 0);

            List <SchemeOBCtrlKeyCodeNode> nodeList;

            if (m_dicOBCtrlKeyCodeNodeMap.TryGetValue(nGroup, out nodeList))
            {
                int tempIndex = nodeList.FindIndex(x => x.nIndex == nIndex);
                if (tempIndex > -1)
                {
                    Trace.Log("scheme repeat! row = " + row + "file:" + schemeFileName);
                    return;
                }
            }

            string szLabel   = reader.GetString(row, (int)Column_OBCtrl.COL_LABEL, "");
            string szKeyCode = reader.GetString(row, (int)Column_OBCtrl.COL_KEYCODE, "");

            if (!m_dicOBCtrlKeyCodeNodeMap.ContainsKey(nGroup))
            {
                m_dicOBCtrlKeyCodeNodeMap.Add(nGroup, new List <SchemeOBCtrlKeyCodeNode>());
            }

            SchemeOBCtrlKeyCodeNode node = new SchemeOBCtrlKeyCodeNode(nGroup, nIndex, szLabel, szKeyCode);

            m_dicOBCtrlKeyCodeNodeMap[nGroup].Add(node);

            List <UnityEngine.KeyCode[]> keyCodeList = new List <UnityEngine.KeyCode[]>();

            keyCodeList.AddRange(node.keyCodeList);
            m_dicOBCtrlKeyCodeMap.Add(nGroup * keyCodeEachTypeMax + nIndex, keyCodeList);
        }
Пример #15
0
        // 初始化csv表
        protected void InitHeroAIConfigCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            allHeroAIConfigTable = new Hashtable();

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeHeroAIConfig sConfig = new SSchemeHeroAIConfig();
                sConfig.nBattleFieldID = reader.GetInt(i, (int)HeroAI.EMT_BATTLEFIELDID, 0);
                sConfig.nHeroId        = reader.GetInt(i, (int)HeroAI.EMT_HEROID, 0);
                sConfig.szAIIDArray    = reader.GetString(i, (int)HeroAI.EMT_AI_IDLIST, "");
                sConfig.szAIRankArray  = reader.GetString(i, (int)HeroAI.EMT_AI_RANKLIST, "");
                sConfig.szAIDESArray   = reader.GetString(i, (int)HeroAI.EMT_AI_DESLIST, "");
                sConfig.bIsOpen        = reader.GetInt(i, (int)HeroAI.EMT_AI_ISOPEN, 0) == 1? true: false;

                // 配置检查
                string   szAIDescList       = sConfig.szAIDESArray;
                string[] AIDescArrayStr     = szAIDescList.Split(';');
                int      nAIDescArrayLength = AIDescArrayStr.Length;

                string   szAIIDList       = sConfig.szAIIDArray;
                string[] AIIDArrayStr     = szAIDescList.Split(';');
                int      nAIIDArrayLength = AIIDArrayStr.Length;

                if (nAIDescArrayLength != nAIIDArrayLength)
                {
                    Trace.LogError("配置出错 请检查 HeroAIConfig.csv 位置:=(" + (i + 1) + ")行");
                }

                int keyID = sConfig.nBattleFieldID * KEY_ID_BASE + sConfig.nHeroId;
                allHeroAIConfigTable[keyID] = sConfig;
            }
        }
Пример #16
0
        public void Load(string strPath)
        {
            m_dicSchemeSceneEffectNodeData = new Dictionary <int, SSchemeSceneEffectNodeData>();

            ScpReader reader = new ScpReader(strPath, true, 1);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeSceneEffectNodeData sConfig = new SSchemeSceneEffectNodeData();
                sConfig.eSceneEffectID       = reader.GetInt(i, (int)ESceneEffectNodeConfig.SEN_ID, 0);
                sConfig.nSceneEffectDuration = reader.GetInt(i, (int)ESceneEffectNodeConfig.SEN_Duration, 0);
                sConfig.strSceneEffectPath   = reader.GetString(i, (int)ESceneEffectNodeConfig.SEN_Path, string.Empty);

                if (m_dicSchemeSceneEffectNodeData.ContainsKey(sConfig.eSceneEffectID))
                {
                    Trace.LogWarning("有相同的场景特效ID" + sConfig.eSceneEffectID + "表第" + i + "行");
                }
                else
                {
                    m_dicSchemeSceneEffectNodeData.Add(sConfig.eSceneEffectID, sConfig);
                }
            }
            reader.Dispose();
            reader = null;
        }
Пример #17
0
        private void LoadGuideTypeConfig(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            m_guideTypeDic = new Dictionary <int, SSchemeGuideType>();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int    nTypeId       = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_TYPE, 0);
                string strGuideName  = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_NAME, "");
                string strGuideTitle = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_TITLE, "");
                string strGuideDesc  = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_DESC, "");
                int    nWndId        = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_WND, 0);

                if (!m_guideTypeDic.ContainsKey(nTypeId))
                {
                    SSchemeGuideType guideType = new SSchemeGuideType();
                    guideType.nTypeId       = nTypeId;
                    guideType.strGuideName  = strGuideName;
                    guideType.strGuideTitle = strGuideTitle;
                    guideType.guideWndList  = new List <SSchemeGuideWnd>();
                    m_guideTypeDic.Add(nTypeId, guideType);
                }
                SSchemeGuideWnd guideWnd = new SSchemeGuideWnd();
                guideWnd.nGuideDesc = strGuideDesc;
                guideWnd.nGuideWnd  = nWndId;
                m_guideTypeDic[nTypeId].guideWndList.Add(guideWnd);
            }
        }
Пример #18
0
        /// <summary>
        /// 根据某个战场类型ID取相应的物品
        /// </summary>
        /// <param name="_nWarID"></param>
        /// <param name="_dicNewTable"></param>
        public void GetGoodsSschemdTable(int _nWarID, ref Dictionary <int, SSchemeMobaGoods> _dicNewTable)
        {
            List <int> WarIdList = null;

            char[] charSeparator = new char[] { MobaSchemesConfig.separator };

            foreach (var goods in m_dicGoodsSchemeTable)
            {
                if (WarIdList != null)
                {
                    WarIdList.Clear();
                }
                if (!string.IsNullOrEmpty(goods.Value.GoodsWarLimit))
                {
                    WarIdList = ScpReader.ConvertStringToIntArray(goods.Value.GoodsWarLimit, charSeparator);
                    if (WarIdList.IndexOf(_nWarID) != -1)
                    {
                        _dicNewTable.Add(goods.Key, goods.Value);
                    }
                }
                else if (goods.Key == 0)
                {
                    _dicNewTable.Add(goods.Key, goods.Value);
                }
            }
        }
Пример #19
0
        private void InitWarBgmConfigCsv(string path)
        {
            ScpReader reader = new ScpReader(path, true, 2);

            warBgmConfigDic = new Dictionary <int, List <SSchemeWarBgmConfig> >();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nCol     = 0;
                int configID = reader.GetInt(i, nCol++, 0);
                SSchemeWarBgmConfig sConfig = new SSchemeWarBgmConfig();
                sConfig.soundID      = reader.GetInt(i, nCol++, 0);
                sConfig.playCount    = reader.GetInt(i, nCol++, 0);
                sConfig.playDelay    = reader.GetFloat(i, nCol++, 0);
                sConfig.playInterval = reader.GetFloat(i, nCol++, 0);
                List <SSchemeWarBgmConfig> warBgmList;
                if (!warBgmConfigDic.TryGetValue(configID, out warBgmList))
                {
                    warBgmList = new List <SSchemeWarBgmConfig>();
                    warBgmConfigDic.Add(configID, warBgmList);
                }
                warBgmConfigDic[configID].Add(sConfig);
            }
            reader.Dispose();
            reader = null;
        }
Пример #20
0
        public void Load(string _strPath)
        {
            m_dicGoodsSchemeTable = new Dictionary <int, SSchemeMobaGoods>();

            ScpReader MobaGoodsReader = new ScpReader(_strPath, true, 2);//new ScpReader(SchemeAllText, "MobaGoods", 2);

            for (int i = 0; i < MobaGoodsReader.GetRecordCount(); i++)
            {
                SSchemeMobaGoods goods = new SSchemeMobaGoods();
                goods.GoodsID                   = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_ID, 0);
                goods.GoodsName                 = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_Name, string.Empty);
                goods.GoodsIconID               = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_IconID, 0);
                goods.GoodsCost                 = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_Cost, 0);
                goods.GoodsSoldOutCost          = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_SoldOutCost, 0);
                goods.GoodsDes                  = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_Description, string.Empty);
                goods.GoodsCanComposeList       = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_CanComposeList, string.Empty);
                goods.GoodsNeedComposeList      = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_NeedComposeList, string.Empty);
                goods.GoodsLabel                = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_Label, string.Empty);
                goods.GoodsWarLimit             = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_WarLimit, string.Empty);
                goods.GoodsSlotDes              = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_SlotDescription, string.Empty);
                goods.GoodsVocationLimit        = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_VocationTypeLimit, 0);
                goods.GoodsPreciousDegree       = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_PreciousDegree, 0);
                goods.GoodsFlag                 = MobaGoodsReader.GetInt(i, (int)EMobaGoods.EMG_Flag, 0);
                goods.GoodsLocationInstructions = MobaGoodsReader.GetString(i, (int)EMobaGoods.EMG_LocationInstructions, string.Empty);

                m_dicGoodsSchemeTable.Add(goods.GoodsID, goods);
            }
            // 需要加一列空值(服务端传过来时会传过来一个0  在这个容器里查找 如果不加会报错)
            if (m_dicGoodsSchemeTable.ContainsKey(0) == false)
            {
                m_dicGoodsSchemeTable.Add(0, new SSchemeMobaGoods());
            }

            MobaGoodsReader.Dispose();
        }
Пример #21
0
        public void Load(string strPath)
        {
            m_personModelConfigs = new List <SSchemePersonModelData>();

            ScpReader reader = new ScpReader(strPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemePersonModelData data = new SSchemePersonModelData();
                data.nHeroID        = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROID, 0);
                data.nHeroType      = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROTYPE, 0);
                data.nOperationType = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_OPERATIONTYPE, 0);
                data.nHeroCharacter = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROCHARACTER, 0);
                data.nSex           = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_SEX, 0);
                data.nDefaultSkinID = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_DEFAULTSKINID, 0);
                data.szHeroName     = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_HERONAME, "");
                data.szHeroTitle    = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_HEROTITLE, "");
                data.nMiniMapIcon   = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_MINIMAPICON, 0);
                data.nViewDistance  = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_VIEWDISTANCE, 0);
                data.nHeroSwitch    = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROSWITCH, 0);
                data.szTotalSkinID  = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_TOTALSKINID, "");
                data.nHeroUnLockLv  = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROUNLOCKLV, 0);
                m_personModelConfigs.Add(data);
            }
            reader.Dispose();
            reader = null;
        }
Пример #22
0
        // 初始化csv表
        protected void InitMatchRoomCustomerConfigCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeMatchRoomCustomer sConfig = new SSchemeMatchRoomCustomer();
                sConfig.nID                   = reader.GetInt(i, (int)CreateRoomCustomer.ERC_ID, 0);
                sConfig.MapDes                = reader.GetString(i, (int)CreateRoomCustomer.ERC_MAPDES, "");
                sConfig.MapDetailDes          = reader.GetString(i, (int)CreateRoomCustomer.ERC_MAPDETAILDES, "");
                sConfig.PictrueID             = reader.GetInt(i, (int)CreateRoomCustomer.ERC_PICTRUE_ID, 0);
                sConfig.strPersonCountListDes = reader.GetString(i, (int)CreateRoomCustomer.ERC_PERSONCOUNT_DES, "");
                sConfig.strMatchTypeList      = reader.GetString(i, (int)CreateRoomCustomer.ERC_MATCHTYPE_LIST, "");

                // 配置检查
                string[] PersonCountStr   = sConfig.strPersonCountListDes.Split(';');
                int      nDescArrayLength = PersonCountStr.Length;

                string[] AIIDArrayStr = sConfig.strMatchTypeList.Split(';');
                int      nArrayLength = AIIDArrayStr.Length;

                if (nDescArrayLength != nArrayLength)
                {
                    Trace.LogError("配置出错 请检查 MatchRoomCustomer.csv 位置:=(" + (i + 1) + ")行");
                }
                sConfig.bIsOpen = reader.GetInt(i, (int)CreateRoomCustomer.ERC_ISOPEN, 0) == 1 ? true : false;
                if (allMatchRoomCustomerTable.ContainsKey(sConfig.nID))
                {
                    Trace.LogError("重复id 检查配置MatchRoomCustomer.csv!id =" + sConfig.nID);
                }
                allMatchRoomCustomerTable.Add(sConfig.nID, sConfig);
            }
        }
Пример #23
0
        private void InitPreLoadSkinLayoutCsv(string stPath)
        {
            m_ConfigMap = new Dictionary <int, SPreLoadSkinLayout>();

            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SPreLoadSkinLayout config = new SPreLoadSkinLayout();
                config.nSkinID = reader.GetInt(i, (int)PreLoadSkinLayoutColnum.EPSLC_SKIN_ID, 0);

                string   strRelateSkinID   = reader.GetString(i, (int)PreLoadSkinLayoutColnum.EPSLC_RELATE_SKIN_ID, "");
                string[] relateSkinIDArray = strRelateSkinID.Split(';');

                config.nRelateSkinID = new int[relateSkinIDArray.Length];
                for (int j = 0; j < relateSkinIDArray.Length; ++j)
                {
                    if (relateSkinIDArray[j] == "")
                    {
                        continue;
                    }

                    if (!int.TryParse(relateSkinIDArray[j], out config.nRelateSkinID[j]))
                    {
                        Debug.LogError(String.Format("配置格式错误:皮肤id格式错误,relateskinid={0},{1}", relateSkinIDArray[j], stPath));
                        continue;
                    }
                }

                m_ConfigMap.Add(config.nSkinID, config);
            }
        }
Пример #24
0
        public void Load(string strFilePath)
        {
            ScpReader reader = new ScpReader(strFilePath, true);

            if (reader == null)
            {
                Trace.LogError("read scheme fail! file = " + strFilePath);
                return;
            }

            m_dicLightEffectNodeList.Clear();

            if (AssetBundleManager.isOnRunTimeMode)
            {
                int nRecorderCount = reader.GetRecordCount();
                for (int row = 0; row < nRecorderCount; row++)
                {
                    int nType = reader.GetInt(row, (int)Column_Common.COL_CFGTYPE, 0);

                    AddSchemeNode(nType, reader, row);
                }
            }
            else
            {
                UnityEngine.Object[] assets = AssetBundleManager.LoadAllAssetOnEditorFromPathInstance(editorModeAssetPath, typeof(LightingEffect));
                foreach (UnityEngine.Object asset in assets)
                {
                    LightingEffect ef = asset as LightingEffect;
                    AddLightEffect(ef);
                }
            }
        }
Пример #25
0
    public static void ReadCSVFile(string filename, string tag, bool headerRow, DataTable datatable)
    {
        ScpReader reader = new ScpReader(filename, tag);

        reader.CreateDataTable(headerRow, datatable);
        reader.Dispose();
    }
Пример #26
0
        // 任务脚本
        private void LoadSeasonConfig(string strPath)
        {
            ScpReader reader = new ScpReader(strPath, true, 2);

            m_mapSeasonPrizeConfig = new Dictionary <int, Dictionary <int, SSchemeSeasonPrizeConfig> >();

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nCol = 0;

                SSchemeSeasonPrizeConfig node = new SSchemeSeasonPrizeConfig();

                node.nPrizeConfigID = reader.GetInt(i, nCol++, 0);
                node.szSeasonDesc   = reader.GetString(i, nCol++, "");
                node.nRankGrade     = reader.GetInt(i, nCol++, 0);
                node.szGradeDesc    = reader.GetString(i, nCol++, "");

                string[] strNormalPrizeList = reader.GetString(i, nCol++, "").Split(';');
                if (strNormalPrizeList != null && strNormalPrizeList.Length > 0)
                {
                    node.arrNormalPrize = new int[strNormalPrizeList.Length];
                    for (int j = 0; j < strNormalPrizeList.Length; j++)
                    {
                        Int32.TryParse(strNormalPrizeList[j], out node.arrNormalPrize[j]);
                    }
                }

                string[] strExtraConditionList = reader.GetString(i, nCol++, "").Split(';');
                if (strExtraConditionList != null && strExtraConditionList.Length > 0)
                {
                    node.arrExtraCondition = new int[strExtraConditionList.Length];
                    for (int j = 0; j < strExtraConditionList.Length; j++)
                    {
                        Int32.TryParse(strExtraConditionList[j], out node.arrExtraCondition[j]);
                    }
                }

                string[] strExtraPrizeList = reader.GetString(i, nCol++, "").Split(';');
                if (strExtraPrizeList != null && strExtraPrizeList.Length > 0)
                {
                    node.arrExtraPrize = new int[strExtraPrizeList.Length];
                    for (int j = 0; j < strExtraPrizeList.Length; j++)
                    {
                        Int32.TryParse(strExtraPrizeList[j], out node.arrExtraPrize[j]);
                    }
                }

                node.nAccountScore     = reader.GetInt(i, nCol++, 0);
                node.szNormalCondition = reader.GetString(i, nCol++, "");
                node.szExtralCondition = reader.GetString(i, nCol++, "");

                if (m_mapSeasonPrizeConfig.ContainsKey(node.nPrizeConfigID) == false)
                {
                    Dictionary <int, SSchemeSeasonPrizeConfig> dicPrize = new Dictionary <int, SSchemeSeasonPrizeConfig>();
                    m_mapSeasonPrizeConfig.Add(node.nPrizeConfigID, dicPrize);
                }

                m_mapSeasonPrizeConfig[node.nPrizeConfigID].Add(node.nRankGrade, node);
            }
        }
Пример #27
0
        /// <summary>
        /// 初始化技能提示
        /// </summary>
        /// <param name="strDefaultViewConfigPath"></param>
        private void InitAboutShowSpellPromptScheme(string strDefaultViewConfigPath)
        {
            string strLabelDescriptionPath = strDefaultViewConfigPath + MobaSchemesConfig.SHOW_SPELL_PROMPT;


            ScpReader ShowSpellPromptReader = new ScpReader(strLabelDescriptionPath, true, 2);

            ShowSpellPromptTable = new Hashtable();
            for (int i = 0; i < ShowSpellPromptReader.GetRecordCount(); i++)
            {
                SSchemeShowSpellPrompt data = new SSchemeShowSpellPrompt();
                data.nID = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_ID, -1);
                if (data.nID == -1)
                {
                    break;
                }
                data.nSpellID = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_SpellID, 0);
                data.nSlotID  = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_SlotID, 0);


                ShowSpellPromptTable.Add(data.nID, data);
            }

            ShowSpellPromptReader.Dispose();
        }
Пример #28
0
        // 初始化csv表
        protected void InitMatchRoomOpenAILevelConfigCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeMatchRoomOpenAILevel sConfig = new SSchemeMatchRoomOpenAILevel();
                sConfig.nMatchTypeID = reader.GetInt(i, (int)EMatchRoomOpenAILevel.ERC_MATCHTYPE_ID, 0);
                sConfig.AILevelDes   = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_DES, "");
                sConfig.AILevelScore = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_SCORE, "");

                // 配置检查
                string[] AILevelDesStr = sConfig.AILevelDes.Split(';');
                int      nDescLength   = AILevelDesStr.Length;

                string[] AIScoreArrayStr = sConfig.AILevelScore.Split(';');
                int      nScoreLength    = AIScoreArrayStr.Length;

                if (nDescLength != nScoreLength)
                {
                    Trace.LogError("配置出错 请检查 MatchRoomOpenAILevel.csv 位置:=(" + (i + 1) + ")行");
                }

                if (allOpenAILevelTable.ContainsKey(sConfig.nMatchTypeID))
                {
                    Trace.LogError("重复id 检查配置MatchRoomOpenAILevel.csv!id =" + sConfig.nMatchTypeID);
                }

                allOpenAILevelTable.Add(sConfig.nMatchTypeID, sConfig);
            }
        }
Пример #29
0
        private void InitSpellSlotConfigCsv(string stPath)
        {
            if (slotDict != null || slotDict.Count > 0)
            {
                return;
            }
            if (!File.Exists(stPath))
            {
                return;
            }

            ScpReader reader = new ScpReader(stPath, true, 2);

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int nCol = 0;
                //读取表中记录的数据类型(HeroGemPageSettingConfig)
                int          nHeroID       = reader.GetInt(i, nCol, 0);
                int          nGemPageIndex = reader.GetInt(i, nCol++, 0);
                HeroSlotItem item          = new HeroSlotItem();
                const int    slotNumCol    = 13;
                item.slotNum     = reader.GetInt(i, slotNumCol, 0);
                item.skillIDList = new List <int>();
                for (int n = 1; n <= item.slotNum; n++)
                {
                    int skillID = reader.GetInt(i, slotNumCol + n, 0);
                    item.skillIDList.Add(skillID);
                }
                slotDict.Add(nHeroID, item);
            }
        }
Пример #30
0
        public void Load(string strFilePath)
        {
            ScpReader reader = new ScpReader(strFilePath, true, 2);

            if (reader == null)
            {
                Trace.LogError("read sheme fail! file=" + strFilePath);
                return;
            }
            m_dicSocialSharingNodeList.Clear();
            int nRecordCount = reader.GetRecordCount();

            for (int row = 0; row < nRecordCount; row++)
            {
                int nType = reader.GetInt(row, (int)Column.COL_SHARINGTYPE, 0);
                if (nType < 0 || nType >= (int)SocialSharingType.TypeMax)
                {
                    Trace.LogWarning("scheme sharingType invalid! file=" + strFilePath);
                    continue;
                }

                string title = reader.GetString(row, (int)Column.COL_TITLE, "");
                string desc  = reader.GetString(row, (int)Column.COL_DESC, "");

                AddNode((SocialSharingType)nType, title, desc);
            }
        }