Jump to content
TrinityCore

item_template no longer in DB


knuxyl
 Share

Recommended Posts

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

Screenshot_2017-06-15_18-01-32.png

Edited by knuxyl
Link to comment
Share on other sites

Don't know if there are any updated tools for this matter, but what you can do is (with PHP):

  1. Read file as binary ('rb' option for fopen)
  2. Read first 4 bytes of the stream to find out which type of the file it is (WDB2, WDB5, etc)
  3. Unpack stream of bytes (according to order of bytes)
  4. 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

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...