public void BeginStepTest()
        {
            ConsoleProgressBar target         = new ConsoleProgressBar(); // TODO: 初始化为适当的值
            string             strBeginString = string.Empty;             // TODO: 初始化为适当的值

            target.BeginStep(strBeginString);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static bool LoadDBCFiles(string strDirectory)
        {
            ConsoleProgressBar consoleProgressBar = new ConsoleProgressBar(40);

            consoleProgressBar.BeginStep(string.Format("开始读取文件 {0}\\*.dbc", strDirectory));

            string strFileName = strDirectory + "\\AreaTable.dbc";

            if (s_AreaTableEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\AuctionHouse.dbc";
            if (s_AuctionHouseEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\BankBagSlotPrices.dbc";
            if (s_BankBagSlotPricesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\BattlemasterList.dbc";
            if (s_BattlemasterListEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ChatChannels.dbc";
            if (s_ChatChannelsEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ChrClasses.dbc";
            if (s_ChrClassesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ChrRaces.dbc";
            if (s_ChrRacesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\CreatureFamily.dbc";
            if (s_CreatureFamilyEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\CreatureSpellData.dbc";
            if (s_CreatureSpellDataEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\DurabilityCosts.dbc";
            if (s_DurabilityCostsEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\DurabilityQuality.dbc";
            if (s_DurabilityQualityEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\EmotesText.dbc";
            if (s_EmotesTextEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\Faction.dbc";
            if (s_FactionEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\FactionTemplate.dbc";
            if (s_FactionTemplateEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\GemProperties.dbc";
            if (s_GemPropertiesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ItemExtendedCost.dbc";
            if (s_ItemExtendedCostEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ItemRandomProperties.dbc";
            if (s_ItemRandomPropertiesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\ItemSet.dbc";
            if (s_ItemSetEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\Lock.dbc";
            if (s_LockEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\Map.dbc";
            if (s_MapEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\NameGen.dbc";
            if (s_NameGenEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SkillLineAbility.dbc";
            if (s_SkillLineAbilityEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SkillLine.dbc";
            if (s_SkillLineEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellCastTimes.dbc";
            if (s_SpellCastTimesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellDuration.dbc";
            if (s_SpellDurationEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\Spell.dbc";
            if (s_SpellEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellItemEnchantmentCondition.dbc";
            if (s_SpellItemEnchantmentConditionEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellItemEnchantment.dbc";
            if (s_SpellItemEnchantmentEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellRadius.dbc";
            if (s_SpellRadiusEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\SpellRange.dbc";
            if (s_SpellRangeEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\StableSlotPrices.dbc";
            if (s_StableSlotPricesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\Talent.dbc";
            if (s_TalentEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\TalentTab.dbc";
            if (s_TalentTabEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\TaxiNodes.dbc";
            if (s_TaxiNodesEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\TaxiPath.dbc";
            if (s_TaxiPathEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\TaxiPathNode.dbc";
            if (s_TaxiPathNodeEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\TransportAnimation.dbc";
            if (s_TransportAnimationEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\WorldMapArea.dbc";
            if (s_WorldMapAreaEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\WorldMapOverlay.dbc";
            if (s_WorldMapOverlayEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            strFileName = strDirectory + "\\WorldSafeLocs.dbc";
            if (s_WorldSafeLocsEntry.LoadFile(strFileName) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, "读取文件 {0} 失败!", strFileName);

                return(false);
            }
            consoleProgressBar.Step();

            consoleProgressBar.EndStep(string.Format("完成读取文件 {0}\\*.dbc", strDirectory));

            // must be after sAreaStore and sMapStore loading
            for (uint iIndex = 0; iIndex < s_AreaTableEntry.Count; ++iIndex)
            {
                AreaTableEntry areaTableEntry = s_AreaTableEntry.LookupRowEntry(iIndex);

                if (areaTableEntry != null)
                {
                    // fill AreaId->DBC records
                    s_AreaFlagByAreaID.Add(areaTableEntry.ID, areaTableEntry.m_ExplorationFlag);

                    // fill MapId->DBC records
                    if (areaTableEntry.m_ZoneId == 0)     // not sub-zone
                    {
                        MapEntry mapEntry = s_MapEntry.LookupIDEntry(areaTableEntry.m_MapId);
                        if (mapEntry == null)
                        {
                            continue;
                        }

                        if (mapEntry.m_MapType != 0 /*MAP_COMMON*/)  // 有不用的值?
                        {
                            s_AreaFlagByMapID[areaTableEntry.m_MapId] = areaTableEntry.m_ExplorationFlag;
                        }
                    }
                }
            }

            for (uint iIndex = 0; iIndex < s_SpellEntry.Count; ++iIndex)
            {
                SpellEntry spellEntry = s_SpellEntry.LookupRowEntry(iIndex);
                if (spellEntry == null)
                {
                    continue;
                }

                if (spellEntry.m_Category != 0)
                {
                    s_SpellCategory.Add(spellEntry.m_Category, iIndex);
                }
            }

            // create telent spells set
            for (uint iIndex = 0; iIndex < s_TalentEntry.Count; ++iIndex)
            {
                TalentEntry talentEntry = s_TalentEntry.LookupRowEntry(iIndex);
                if (talentEntry == null)
                {
                    continue;
                }

                if (talentEntry.m_RankID1 != 0)
                {
                    s_TalentSpellCosts.Add(talentEntry.m_RankID1, 1);
                }

                if (talentEntry.m_RankID2 != 0)
                {
                    s_TalentSpellCosts.Add(talentEntry.m_RankID2, 2);
                }

                if (talentEntry.m_RankID3 != 0)
                {
                    s_TalentSpellCosts.Add(talentEntry.m_RankID3, 3);
                }

                if (talentEntry.m_RankID4 != 0)
                {
                    s_TalentSpellCosts.Add(talentEntry.m_RankID4, 4);
                }

                if (talentEntry.m_RankID5 != 0)
                {
                    s_TalentSpellCosts.Add(talentEntry.m_RankID5, 5);
                }
            }

            // Initialize global taxinodes mask
            for (uint iIndex = 0; iIndex < s_TalentEntry.Count; ++iIndex)
            {
                TalentEntry talentEntry = s_TalentEntry.LookupRowEntry(iIndex);
                if (talentEntry != null)
                {
                    uint field   = (iIndex / 32);
                    uint submask = (uint)(1 << (int)(iIndex % 32));
                    s_TaxiNodesMask[field] |= submask;
                }
            }

            for (uint iIndex = 0; iIndex < s_TaxiPathEntry.Count; ++iIndex)
            {
                TaxiPathEntry taxiPathEntry = s_TaxiPathEntry.LookupRowEntry(iIndex);
                if (taxiPathEntry == null)
                {
                    continue;
                }

                Dictionary <uint, TaxiPathBySourceAndDestination> taxiPathSetForSource = null;
                s_TaxiPathSetBySource.TryGetValue(taxiPathEntry.m_From, out taxiPathSetForSource);

                if (taxiPathSetForSource == null)
                {
                    taxiPathSetForSource = new Dictionary <uint, TaxiPathBySourceAndDestination>();
                    TaxiPathBySourceAndDestination taxiPathBySourceAndDestination = new TaxiPathBySourceAndDestination();
                    taxiPathBySourceAndDestination.m_ID    = taxiPathEntry.ID;
                    taxiPathBySourceAndDestination.m_Price = taxiPathEntry.m_Price;

                    taxiPathSetForSource.Add(taxiPathEntry.m_To, taxiPathBySourceAndDestination);

                    s_TaxiPathSetBySource.Add(taxiPathEntry.m_From, taxiPathSetForSource);
                }
                else
                {
                    TaxiPathBySourceAndDestination taxiPathBySourceAndDestination = new TaxiPathBySourceAndDestination();
                    taxiPathBySourceAndDestination.m_ID    = taxiPathEntry.ID;
                    taxiPathBySourceAndDestination.m_Price = taxiPathEntry.m_Price;

                    taxiPathSetForSource.Add(taxiPathEntry.m_To, taxiPathBySourceAndDestination);
                }
            }

            for (uint iIndex = 0; iIndex < s_TaxiPathNodeEntry.Count; ++iIndex)
            {
                TaxiPathNodeEntry taxiPathNodeEntry = s_TaxiPathNodeEntry.LookupRowEntry(iIndex);
                if (taxiPathNodeEntry == null)
                {
                    continue;
                }

                Dictionary <uint, TaxiPathNode> taxiPathNodeSeq = null;
                s_TaxiPathNodesByPath.TryGetValue(taxiPathNodeEntry.m_Path, out taxiPathNodeSeq);

                if (taxiPathNodeSeq == null)
                {
                    taxiPathNodeSeq = new Dictionary <uint, TaxiPathNode>();
                    TaxiPathNode taxiPathNode = new TaxiPathNode();
                    taxiPathNode.m_MapId      = taxiPathNodeEntry.m_MapId;
                    taxiPathNode.m_X          = taxiPathNodeEntry.m_X;
                    taxiPathNode.m_Y          = taxiPathNodeEntry.m_Y;
                    taxiPathNode.m_Z          = taxiPathNodeEntry.m_Z;
                    taxiPathNode.m_ActionFlag = taxiPathNodeEntry.m_ActionFlag;
                    taxiPathNode.m_WaitTime   = taxiPathNodeEntry.m_WaitTime;

                    taxiPathNodeSeq.Add(taxiPathNodeEntry.m_Seq, taxiPathNode);

                    s_TaxiPathNodesByPath.Add(taxiPathNodeEntry.m_Path, taxiPathNodeSeq);
                }
                else
                {
                    TaxiPathNode taxiPathNode = new TaxiPathNode();
                    taxiPathNode.m_MapId      = taxiPathNodeEntry.m_MapId;
                    taxiPathNode.m_X          = taxiPathNodeEntry.m_X;
                    taxiPathNode.m_Y          = taxiPathNodeEntry.m_Y;
                    taxiPathNode.m_Z          = taxiPathNodeEntry.m_Z;
                    taxiPathNode.m_ActionFlag = taxiPathNodeEntry.m_ActionFlag;
                    taxiPathNode.m_WaitTime   = taxiPathNodeEntry.m_WaitTime;

                    taxiPathNodeSeq.Add(taxiPathNodeEntry.m_Seq, taxiPathNode);
                }
            }

            return(false);
        }