Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] World of Tanks xml reader

Joined
Jun 23, 2010
Messages
2,318
Reaction score
2,195
He,

For the people who dont know what World of Tanks is, it's a online tank game. Where you can battle with other people's tanks and win.

I'm currently trying to make a private server for WoT (World of Tanks) and that's why I made the XML reader.

The xml's of WoT are encoded and not readable for the eye which makes it hard to edit.

This php code can generate a nice xml where you can edit it, after you're done. You can import the xml and save it to a file.

Reading file:
PHP:
$file = new FileSystem('./scripts_config_new.xml');
    $wotfile = new WOTXMLFile($file);
    $wotps = new WOTPacketSection($wotfile);
    
    $xmloutput = $wotfile->ExportToXML($wotps, 'scripts_config')->OutputMemory();
    
    echo htmlspecialchars($xmloutput);

Writing file:
PHP:
$newfile = new FileSystem('./scripts_config_new.xml', true);
    $newwotfile = new WOTXMLFile($newfile, WOTPacketSection::HEADER);
    $newwotps = new WOTPacketSection($newwotfile);
    
// Arguments: WOTPacketSection, XML, remove roottag
    $newwotfile->ImportFromXML($newwotps, '', true);


Source code:*** removed ***
Encoded xml file:*** removed ***
Live demo: *** removed ***

There are some predefined attributes:
export-type: Needed for importing the xml back so the typecast wont get lost
export-length: Needed for numeric length (8/16/32 bit) or floats length


Comments are welcome.
 
Last edited:
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
Not bad, but aren't you supposed to set the content-type to text/xml or application/xml instead of text/html?
 
Initiate Mage
Joined
Nov 17, 2013
Messages
2
Reaction score
0
Are you still working on this emu :)? I started working on decrypting packets
 
Back
Top