• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Dat file reader [C++]

Lisior

New Member
Joined
Aug 4, 2009
Messages
4
Reaction score
1
Hello. I'm posting some classes to handle dat file reading. I meant to write standalone application that does dat/spr io, but i don't have time for that. There's also no big point of doing that as it's already implemented in rme, otclient and tfs. It has no license so do whatever you want with the code (rapidxml is MIT, it's included in the xml dir). It will run on every c++11 capable compiler and has no dependencies.
The program is capable of reading flags structure from xml config, and can handle different dat versions without the need of recompiling it. It needs some exception handling improvements and deleting() some pointers in destructors, but overall it works. Codeblocks project in attachment. You can use it like:
Code:
#include "datReader.hpp"

using namespace std;

int main(int argc, char *argv[])
{
    datReader czytacz;
    czytacz.set_xml("configs/854.xml");
    czytacz.set_dat_file("Tibia.dat");
    datItem* item = czytacz.get_item(10939);
    item->print();
    return 0;
}
 

Attachments

Back
Top