PHP Dota Replay Parser (CDP)

I've been working on and toying around with a PHP dota replay parser I've whipped together using *Reshine and *esby's xml dota data as a starting point.

I've tried to keep the code as clean as possible, however since the core of the parser's been worked on by 2 or 3 programmers before me, it's not exactly the best example of clean structured code in the known universe.

Still I believe the code is comprehensive enough and at the very least the w3g parsing procedures and Dota ID data can be a useful reference for anyone working on their own Dota replay parser.

* see credits

Update 1.3.1 (1.4.2010) : 6.67c, 6.66 data and images
Update 1.3 (7.1.2010) : 6.65, SP & Debugging
Update 1.2.2 (27.10.2009) : Debugging skilling & 6.64
Update 1.2.1 (8.10.2009) : Handling morphers
Update 1.2 (5.10.2009) : Hero - Player - Skill handling
Update 1.1.3 (10.9.2009) : Ban / Pick duplication bug.
Update 1.1.2 (7.7.2009) : 64 Bit memory / 6.61.
Update 1.1.1 (19.6.2009) : Decompression tweak.
Update 1.1 (12.6.2009) : Added 6.60 support.

Download: CDP Latest (Zipped / 1.3.1) / Mirror 1 / also attached
Sample: Sample Parsed Replay

Patch 1.1.1 to 1.1.2
Patch 1.1.2 to 1.1.3
Patch 1.1.3 to 1.2
Patch 1.2 to 1.2.1 ( 16 kb )
Patch 1.2.1 to 1.2.2 ( 74 kb )
Patch 1.2.2 to 1.3 ( 469 kb )
Patch 1.3 to 1.3.1 ( 195 kb )


CDP CTS Dota Parser is an open source Dota Replay parser written in PHP,
meant to be used with WC3 DoTA replays of version 6.59 and higher.

Quick Feature List
  • Supports CM mode and properly lists bans and picks
  • Supports swapping
  • Displays end game statistics that include
    • Hero Kills / Deaths / Assists
    • Creep Kills / Denies
    • Neutrals killed
    • End game gold
    • End game Inventory
  • Categorizes player’s actions and calculates his APM excluding picking time.
  • Generates time ordered lists of player’s obtained items and learned skills.
  • Displays colored chat
  • XML database of Items, Skills and Heroes.
  • Easy storing and restoring of parsed replay data with php serialization

  1. Extract the files.
  2. Ensure the structure is as follows:
    • ./*.php *.css - All the php / css files
    • ./maps/*.xml - All the XML data files
    • ./images - All the icons
    • ./replays - Folder for storing replays and replay info
  3. Make sure the ./replays folder is writable.


Use the ./upload_reply.php file to upload replays or
write your own interface, using the included
upload_replay.php file as a guide.

All the replays are parsed upon the first view and a
serialized representation of the replay is stored as
a REPLAY_ID.txt file. Upon further viewing the replay
data is only obtained from the serialized object.

All the replays are saved as unix_timestamp.w3g files
while conserving their original name in the $replay->extra
variable, making it possible to let the user download
the replay with the uploader’s original filename.


Julas - Original wc3 php parser
rush4hire - Dota port of Jula’s parser
esby - 6.56 XML Structure / Data
Tedi Rachmadi - Reshine

Attached Files
File Type: zip (6.58 MB, 233 views)
Related Posts with Thumbnails


Newer Next home

Get Latest Updates DotA-Throne.Com

  © Blog design based on by dzelque ' Header by Dota-throne' 2016

Back to TOP