- 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:
Writing file:
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.
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: