Dota Parser

CDP – CTS Dota Parser

Update 1.4.6 (22.10.2012) : 6.76 data and images
Update 1.4.5 (1.10.2012) : 6.74/6.75 data and images
Update 1.4.4 (6.1.2012) : 6.73 data and images
Update 1.4.3 (14.5.2011) : 6.71 & 6.72 data and images
Update 1.4.2 (26.12.2010) : 6.70 data and images
Update 1.4.1 (11.11.2010) : 6.69 data and images
Update 1.4 (16.8.2010) : 6.68, Switch & Debugging
Update 1.3.1 (1.4.2010) : 6.67 and 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.

Discussion at Play Dota Forums.

Download: CDP Latest (Zipped / 1.4.6)
Sample: Sample Parsed Replay

Patches


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 )
Patch 1.3 to 1.4 ( 274 kb )
Patch 1.4 to 1.4.1 ( 182 kb )
Patch 1.4.1 to 1.4.2 ( 407 kb )
Patch 1.4.2 to 1.4.3 ( 116 kb )
Patch 1.4.3 to 1.4.4 ( 263 kb )
Patch 1.4.4 to 1.4.5 ( 259 kb )
Patch 1.4.5 to 1.4.6 ( 109 kb )

About

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
  • Supports switching
  • Supports shuffle player mode
  • Displays end game statistics that include
    - Hero Kills / Deaths / Assists
    - Creep Kills / Denies
    - Neutrals killed
    – End game gold
    - End game Inventory
    - POTM Arrow Accuracy
    - Pudge Hook Accuracy
  • Tries to automatically determine the winning side
  • 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
Installation
  1. Extract the files.
  2. Ensure the structure is as follows:
  3. ./*.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

  4. Make sure the ./replays folder is writable.
Usage

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.

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

Old versions:

Changelog:

  1. 1.4.6 – 22.10.2012
    • Features:

      • Added 6.76 data and images.
  2. 1.4.5 – 1.10.2012
    • Features:

      • Added support for 6.75+ CM Ban/Pick order.
      • Added 6.74 and 6.75 data and images.
  3. 1.4.4 – 6.1.2012
    • Features:

      • Added 6.73 data and images.
  4. 1.4.3 – 14.5.2011
    • Features:

      • Added 6.71 & 6.72 data and images.
  5. 1.4.2 – 26.12.2010
    • Features:

      • Added 6.70 data and images.
  6. 1.4.1 – 10.11.2010
    • Features:

      • Added 6.69c data and images.
  7. 1.4 – 16.8.2010
    • Features:

      • 6.68 images / map data
      • Handles new CM mode 3/2 split
      • Added support for Switch
      • Added an AUTO mode for determening the winner, check
        view_replay.php and upload_replay.php to get the idea
        on how to implement it. It works most of the time, only
        fails when the saver leaves unexpectedly or prematurely.
      • Added POTM Arrow Accuracy data (see “Show more” in a replay with potm)
      • Added Pudge Hook Accuracy data (see “Show more” in a replay with pudge)
      • Added Player Leaving information (see “Show more” in a replay)
    • Various:

      • Tweaked leveling and skill level accuracy for duplicated actions non-owned stats skilling.
    • Bugs:

      • Fixed a bug with skilling non-owned or SP mode owned morphing heroes (ie. Batrider, KOTL)
      • Fixed certain wrong skill IDs in 6.67, 6.68 XML files for Panda, Tiny, Leoric, Gorgon, Lanaya, Ursa, Enigma and Doom Bringer
      • Some other minor bugs.
  8. 1.3.1 – 1.4.2010
    • Features:

      • Added 6.67c and 6.66 data and images.
  9. 1.3 – 7.1.2010
    • Features:

      • 6.65 images / map data.
      • Now properly remaps names in SP mode.
    • Various:

      • Added some base code for handling various drafting modes such as CD and CM, but not finished yet due to 6.65′s buggy replay data serving.
    • Bugs:

      • Fixed an issue with SD mode picks before 15sec.
      • Changed all “Batrider (firefly)” names to “Batrider” in 6.60 to 6.65 xml files.
      • Changed all “Flesh Golem” names to “Undying” in 6.59 to 6.65 xml files.
      • Fixed an issue with failed handling of random hero picks in CM mode.
  10. 1.2.2 – 27.10.2009
    • Bugs:

      • Added delayed skilling for handling first skills.
      • Fixed an error caused by 6.64 & skills.
  11. 1.2.1 – 8.10.2009
    • Bugs:

      • Fixed a problem with ‘morphing’ heroes.
  12. 1.2 – 6.10.2009
    • Features:

      • 6.63 images / map data.
    • Various:

      • Recoded the way Hero – Player – Skills are related.
    • Bugs:

      • Fixed various skill assignment bugs.
  13. 1.1.3 – 10.9.2009
    • Bugs:

      • Fixed an issue with duplicated ban / pick packets.
  14. 1.1.2 – 7.7.2009
    • Features:

      • The script now tries to detect the map version and uses the appropriate .xml file from the maps/ folder.
      • Added some config options to tools.php regarding version handling
      • 6.61 – Weaver’s remade ability
    • Various:

      • Disabled download logging by default. (Channged LOG_DOWNLOADS to false in download.php)
    • Cosmetics:

      • Unified player colors.
    • Bugs:

      • Increased memory_limit to work with 64 bit *nix systems.
      • Added some extra level 25 limit detection.
  15. 1.1.1 – 19.6.2009
    • Bugs:

      • Tweaked zlib decompressing to allow parsing of modified replays
  16. 1.1 – 12.6.2009
    • Features:

      • Added 6.60 XML data to the /maps folder
    • Various:

      • Tweaked the JS / HTML display
    • Bugs:

      • Proper parsing for Batrider’s two hero ID internals
      • Fixed Invoker leveling / skills
      • Fixed XML Parser oddities
  17. 1.0 – 27.2.2009
    • Clean up
  • Adam
    #101 written by Adam 6 years ago

    Thanks for the reply.
    Why don’t you upload to a svn or something? this way we would know all the changes that happen to your project. :)

    Also, which all folder permissions can be changed?
    I just want users to see upload_replay and view_replay pages thats it, rest all i want to keep non-readable even if tried to browse.

  • vipnight
    #102 written by vipnight 5 years ago

    hi can tell me why this error is harm?

    Page: > >>

    Fatal error: Class ‘replay’ not found in C:\xampp\htdocs\cdp\view_replay.php on line 82

  • code
    #103 written by code 5 years ago

    have some thing to list all the replays?

  • MG9
    #105 written by MG9 5 years ago

    “Make sure the ./replays folder is writable.”

    How to make the replays folder writable???
    please help me,
    Thanks

  • Sekarepan Wes
    #107 written by Sekarepan Wes 5 years ago

    hi seven, can you help ???

    how to display game modes in view_reply.php ???

    maybe you just need what the code to display game mode ?

    i try it, but no work for me …

    Game Mode : ‘.$replay->game['modes'].’

  • Rizal
    #108 written by Rizal 5 years ago

    Hy seven, I like your script and wanna say thank you very much.
    In your script you can extract many data from saved replay, but I dont see a game name displayed, can you add it please, it will be help full information I think.

    Sorry for my english :D

  • Seven
    #109 written by Seven 5 years ago

    @Rizal

    You can access the game name in replay object member: game, index ‘name’ for instance: $replay->game['name'];

    @Wes

    You could try extracting the game mode from the game name, although that’s quite a janky solution. Proper support for game mode detection is not implemented.

  • Rizal
    #110 written by Rizal 5 years ago

    Hello seven, I found new problem on this script, sorry for disturbing you again, because I dont understand about this script especially if the problem is on the parsing part.
    I have found that if a user pick/use ember spirit (Xin) it would not give information about that user n hero build ( but this user still present in conversation in chat log ), so in the view_replay.php it just show that it is 4 vs 5

  • Rizal
    #111 written by Rizal 5 years ago

    Again, sorry. I have question again. Why does this parser does not give hero kill statistic and creeping statistic if game mode is captain mode?
    this is sample of my replay : http://speedy.sh/yxbgz/Versus-vs-Crew4.w3g

  • Rizal
    #112 written by Rizal 5 years ago


    Rizal:

    Again, sorry. I have question again. Why does this parser does not give hero kill statistic and creeping statistic if game mode is captain mode?
    this is sample of my replay : http://speedy.sh/yxbgz/Versus-vs-Crew4.w3g

    sorry for this comment, this is my fault because I parse replay of unfinished game. but for my question in comment #110 I still waiting for your explanation
    thank you very much

  • Sekarepan Wes
    #113 written by Sekarepan Wes 5 years ago

    hey seven, sorry for your time …

    can i know , what your Yahoo messenger ID ?

    i need ask to you …

    if i asking in here, maybe cant be good idea …

    and i’m sorry for my bad english …

  • Luis
    #114 written by Luis 5 years ago

    I have a question plz! how can i show the time a player left?? something like http://www.adotaparser.com

  • Seven
    #115 written by Seven 5 years ago

    Sorry for the late replies.

    @Rizal:
    You should download the updated 6.74 XML map data.
    I seemed to have missed a silent ID change to XIN in version 6.74.

    @Sekarepan:
    You can also email me.

    @Luis:
    Check the sample parse output view_replay.php packaged in every CDP release.
    Look up lines 303 to 315 in CDP 1.4.4 for an example. (Or search for “Handle player left events”)

  • Jeremy John
    #116 written by Jeremy John 5 years ago

    Hey Seven, i was wondering if there is a way i can get in touch with you for some advance coding suggestions. thanks

  • lucky
    #118 written by lucky 5 years ago

    how can i upload are game? thanks

  • BLOOR
    #119 written by BLOOR 4 years ago

    Isssue with SKILL code “A1YY” — Phoenix Laser Beam.

    Is not in the XML. Parser crashes.

    PS: i changed the reshine.php so it skips the bad attributes [that generate no $heroId] in the case loop.

    I added right after the $heroId is generated:

    1
    2
    3
    4
    if (strlen($heroId) != 4){
       echo "[#1]Unidentified attribute code: ".$value->getId()."<br>";
       break;
     }

    This ensures that the missing attribute won’t halt/stop the repaly parsing and also gives me feedback with the missing attribute code from XML.

    But other can simply use :

    1
    if (strlen($heroId) != 4) break;

    Cheers.

  • DotaBattle
    #120 written by DotaBattle 4 years ago

    please someone update the XML for the latest map ( dota 678b )

    thanks

  • Col
    #121 written by Col 3 years ago

    Hi Seven!
    Is there any update for 6.77 and 6.78 map xml?

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong>

  • Comment Feed for this Post
Go to Top