This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Legion] WDB5 format  (Read 4943 times)

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
[Legion] WDB5 format
« on: April 13, 2016, 11:52:02 am »
[deleted]
« Last Edit: May 17, 2016, 01:59:44 pm by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [Leagion]  WDB4 format
« Reply #1 on: April 13, 2016, 12:58:01 pm »
Please. IF you discover stuff. Create and dev wiki account and document it.
If we not build on each others discovery we will never get to a good point.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Leagion]  WDB4 format
« Reply #2 on: April 13, 2016, 02:02:14 pm »
Note that the layout of tables can (has and will again) change depending on the data contained in a client patch. Columns are compressed to fit the maximum value in them. If the maximum value changes, the column layout will change. If you reverse the layout for a table for a given build, please add it to the wiki, e.g. at wowdev.wiki/DB/ChrClasses in your case.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Leagion]  WDB4 format
« Reply #3 on: April 13, 2016, 02:05:03 pm »
[deleted]
« Last Edit: May 17, 2016, 02:00:01 pm by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Leagion]  WDB4 format
« Reply #4 on: April 13, 2016, 02:09:19 pm »
[deleted]
« Last Edit: May 17, 2016, 02:00:13 pm by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Legion] WDB4 format
« Reply #5 on: April 13, 2016, 05:39:22 pm »
I finally switch to another DB2, CurrencyTypes.db2, same columns but with different size / order
That was easy for this one, i'm 100% sure that's the good structure.

https://wowdev.wiki/DB/CurrencyTypes
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Legion] WDB4 format
« Reply #6 on: April 13, 2016, 06:07:27 pm »
In general, the order of columns should be the same, but with stable-sorting by type size.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Legion] WDB4 format
« Reply #7 on: April 14, 2016, 06:33:33 pm »
New Legion Build...

Now it's WDB5

*dies internally*
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Legion] WDB5 format
« Reply #8 on: April 18, 2016, 02:18:05 am »
[deleted]
« Last Edit: May 17, 2016, 02:00:30 pm by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Legion] WDB5 format
« Reply #9 on: April 18, 2016, 10:31:42 am »
Uint40 sounds wrong
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Legion] WDB5 format
« Reply #10 on: April 18, 2016, 03:55:17 pm »
[deleted]
« Last Edit: May 17, 2016, 02:00:45 pm by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Legion] WDB5 format
« Reply #11 on: April 18, 2016, 08:37:31 pm »
Weird shit, but okay, that's blizzard.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Simca

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
Re: [Legion] WDB5 format
« Reply #12 on: April 18, 2016, 09:04:28 pm »
It is uint16; uint40 is an illusion created by record alignment.

When Blizzard writes records to files, the end of the record is aligned to the largest field size used.

In this file in question, the ID field starts at 0x1B into the record and lasts for 2 bytes according to the field structure block ((32 - 0x10) / 8 = 2). This puts the end of the field at 0x1D. However, the record size field in the header says the record is 0x20. The difference is because of the alignment I just mentioned. The largest field size used in the record is 4 bytes. The nearest values divisible by 4 bytes are 0x1C (which the ID field goes past) and 0x20, so the record is padded by 3 bytes to make it properly align at 0x20.

So yes, you can read it with that structure, but it would be better to read it as uint16 and then skip to the end of the record.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Legion] WDB5 format
« Reply #13 on: April 18, 2016, 09:41:46 pm »
Also, get onto irc, as you seem to be one of the intrersting people doing stuff (^ー^)ノ
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [Legion] WDB5 format
« Reply #14 on: April 18, 2016, 11:54:55 pm »
Quote from: "Simca"
It is uint16; uint40 is an illusion created by record alignment.

When Blizzard writes records to files, the end of the record is aligned to the largest field size used.

In this file in question, the ID field starts at 0x1B into the record and lasts for 2 bytes according to the field structure block ((32 - 0x10) / 8 = 2). This puts the end of the field at 0x1D. However, the record size field in the header says the record is 0x20. The difference is because of the alignment I just mentioned. The largest field size used in the record is 4 bytes. The nearest values divisible by 4 bytes are 0x1C (which the ID field goes past) and 0x20, so the record is padded by 3 bytes to make it properly align at 0x20.

So yes, you can read it with that structure, but it would be better to read it as uint16 and then skip to the end of the record.

Ok i get it, thanks for your explanation :)
I think this could be helpful to write a fake-column with the amount of padding for each DB
« Last Edit: January 01, 1970, 01:00:00 am by Admin »