Jump to content

need some help on exacting dbc and the ad's source code


darkspear

Recommended Posts

dear all:

I pretent to compile a version of mangos for my client 3.3.5(13930)version. while using the ad.exe to exact the dbc/maps i encounter a lot of problem. first is the fatal error:Invalid component.wow-zhCN.txt file format , I slove it by using mpqeditor to modify the component.wow-zhcn.txt to component.wow-zhCN.txt ,but while exacting maps it told me that the Invalid map.dbc file format.

I check the source code of ad.exe. i foud the problem

  1. if(header[0]!='W' || header[1]!='D' || header[2]!='B' || header[3]!='C')
  2. return false;

then i check the dbc file exact from trinitycore, the first four characters is truly WDBC,but my dbc file is ? character.

i know my the mpq patch-zhCN-3.MPQ is strange it has only 32k byte. did the ad.exe will exact the map.dbc from this file(this file has no DBC file exist inside)?

and when i trace the source, i was confused at some place.

in mpq_libmpq.cpp

  1. MPQFile::MPQFile(const char* filename):
  2. eof(false),
  3. buffer(0),
  4. pointer(0),
  5. size(0)
  6. {
  7. for(ArchiveSet::iterator i=gOpenArchives.begin(); i!=gOpenArchives.end();++i)
  8. {
  9. mpq_archive &mpq_a = (*i)->mpq_a;

  10. mpq_hash hash = (*i)->GetHashEntry(filename);
  11. uint32 blockindex = hash.blockindex;

  12. if (blockindex == 0xFFFFFFFF)
  13. continue; //file not found

  14. uint32 fileno = blockindex;

  15. //int fileno = libmpq_file_number(&mpq_a, filename);
  16. //if(fileno == LIBMPQ_EFILE_NOT_FOUND)
  17. // continue;

  18. // Found!
  19. size = libmpq_file_info(&mpq_a, LIBMPQ_FILE_UNCOMPRESSED_SIZE, fileno);
  20. // HACK: in patch.mpq some files don't want to open and give 1 for filesize
  21. if (size<=1) {
  22. eof = true;
  23. buffer = 0;
  24. return;
  25. }
  26. buffer = new char;

  27. //libmpq_file_getdata
  28. libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer);
  29. return;

  30. }
  31. eof = true;
  32. buffer = 0;
  33. }

the buffer in the line31 seems not free very well(it was newed many times) was i right?

in the realse mode it works but in the debug mode, it told me that the heap was not release.

can anyone help me on this? thank you very much.

Link to comment
Share on other sites

  • 3 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use