public static void Initialize() { if (_initialized) { return; } //MpqManager.InitializeDBC(); _taxiNodes = MpqManager.GetDB6("TaxiNodes"); _taxiPath = MpqManager.GetDB6("TaxiPath"); _cachedTaxiNodesRows = _taxiNodes.Rows.ToArray(); _cachedTaxiPathRows = _taxiNodes.Rows.ToArray(); _cachedTaxiPathRecords = new TaxiPath.TaxiPathDb2Record[_cachedTaxiPathRows.Length]; for (int i = 0; i < _cachedTaxiPathRows.Length - 1; i++) { _cachedTaxiPathRecords[i] = DB6Reader.ByteToType <TaxiPath.TaxiPathDb2Record>(_cachedTaxiPathRows[i]); } _cachedTaxiNodesRecords = new TaxiNode.TaxiNodesDb2Record[_cachedTaxiNodesRows.Length]; for (int i = 0; i < _cachedTaxiNodesRows.Length - 1; i++) { _cachedTaxiNodesRecords[i] = DB6Reader.ByteToType <TaxiNode.TaxiNodesDb2Record>(_cachedTaxiNodesRows[i]); } _initialized = true; }
public static void Initialize() { if (_initialized) { return; } _cache = new Dictionary <int, string>(1000); _gameobjectDisplayInfo = MpqManager.GetDB6("GameobjectDisplayInfo"); _cachedGameobjectDisplayInfoRows = _gameobjectDisplayInfo.Rows.ToArray(); _cachedGameobjectDisplayInfoRecords = new GameobjectDisplayInfoEntry.GameobjectDisplayInfoDb2Record[_cachedGameobjectDisplayInfoRows.Length]; for (int i = 0; i < _cachedGameobjectDisplayInfoRows.Length - 1; i++) { _cachedGameobjectDisplayInfoRecords[i] = DB6Reader.ByteToType <GameobjectDisplayInfoEntry.GameobjectDisplayInfoDb2Record>(_cachedGameobjectDisplayInfoRows[i]); } /*_fileData = MpqManager.GetDBC("FileData"); * _filaDataEntries = _fileData.Records.Select(r => new FileDataEntry(r));*/ // FileData no longer requires, we can open files directly from their FileDataId, but need a CascLib update first. _myConn = new MySqlConnection("server=127.0.0.1; user id=tnb; password=tnb006; database=offydump;"); _myConn.Open(); /*List<MapEntry> titi = PhaseHelper.GetAllMaps(); * foreach (MapEntry e in titi) * { * string sqlcode = "INSERT INTO Maps VALUES (" + e.Id + ",'" + e.InternalName.Replace("'", "\\'") + "','" + e.Name.Replace("'", "\\'") + "',"; * sqlcode += (int)e.InstanceType + "," + (int)e.MapType + "," + e.PhaseParent + "," + e.Flags + ");"; * System.Console.WriteLine(sqlcode); * var cmd = new MySqlCommand(sqlcode, _myConn); * cmd.ExecuteNonQuery(); * }*/ _initialized = true; }