knuxyl Posted June 15, 2017 Report Share Posted June 15, 2017 (edited) I am creating an online database viewer for TrinityCore master and I just finished the styling and Javascript. The database uses JQuery, JQuery UI Tabs, and JQuery DataTables. I am trying to recreate wowhead but one that reads TrinityCore's database so it would be easier to work with the database and see values in a human readable form. I am intending to release the source to TrinityCore so anybody would be able to use it. It has full functioning tooltips, sorting, pagination, tabs, etc. Just when I went to start the php code to query the database, I realized the world schema is missing the table item_template. This is crucial for being able to search items. I read that it is now stored in .db2 files, but I have absolutely no idea how to search them, let alone extract/open/read them. Does anybody have any idea how to search for items in the TrinityCore database? Thanks Edit: I've read that .db2 is a database file, similar to how .sql is a database file. If I could find a tool that can convert the .db2 file to either .sql or .csv, I could create a sql database specifically for the website. I've attached a picture of the database with a test item populating the table Edited June 15, 2017 by knuxyl Link to comment Share on other sites More sharing options...
darki73 Posted June 16, 2017 Report Share Posted June 16, 2017 Don't know if there are any updated tools for this matter, but what you can do is (with PHP): Read file as binary ('rb' option for fopen) Read first 4 bytes of the stream to find out which type of the file it is (WDB2, WDB5, etc) Unpack stream of bytes (according to order of bytes) Perform any necessary operations to get data from the file I've made a script for doing that, however, cant share it, since it depends on the other framework classes and methods, and obviously i cannot share the framework (for now). Can only give you the following part (these are the variables you will most likely need to work with) protected $wdbVersion = 0; protected $isWDBC = false; protected $idField = 0; protected $idMap = []; protected $headerFieldCount = 0; protected $recordCount = 0; protected $fieldCount = 0; protected $recordSize = 0; protected $stringBlockSize = 0; protected $tableHash = 0; protected $layoutHash = 0; protected $build = 0; protected $timestamp = 0; protected $flags = 0; protected $minId = 0; protected $maxId = 0; protected $locale = 0; protected $commonBlockSize = 0; protected $copyBlockSize = 0; protected $headerSize = 0; protected $headerFormat = null; protected $preambleLength = 0; protected $hasEmbeddedStrings = false; protected $totalFieldCount = 0; protected $hasIdBlock = false; protected $hasIdsInIndexBlock = false; protected $idBlockPosition = 0; protected $indexBlockPosition = 0; protected $commonBlockPosition = 0; protected $stringBlockPosition = 0; protected $copyBlockPosition = 0; protected $endOfFile = 0; protected $recordFormat = []; protected $recordOffsets = null; protected $commonLookup = []; Link to comment Share on other sites More sharing options...
CDawg Posted June 18, 2017 Report Share Posted June 18, 2017 On 6/15/2017 at 4:06 PM, knuxyl said: Does anybody have any idea how to search for items in the TrinityCore database? Thanks with PhP? yes. I can share tidbits Link to comment Share on other sites More sharing options...
Taaboy Posted June 19, 2017 Report Share Posted June 19, 2017 Possible with extract the db2 and export the tables for example(sql/json/csv) with WDBX Editor (Link https://github.com/WowDevTools/WDBXEditor) ItemSparse.db2 is example has 99k + Rows ,but i think that is only the tip, there is plenty of other item*.db2 files maybe required to link for all the info. Link to comment Share on other sites More sharing options...
Recommended Posts