Dota Parser

CDP – CTS Dota Parser

Dota 6.74 Map data: (download) (CDP 1.4.4 ships with 6.73 data)

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.4)
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 )

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.4 – 6.1.2012
    • Features:

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

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

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

      • Added 6.69c data and images.
  5. 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.
  6. 1.3.1 – 1.4.2010
    • Features:

      • Added 6.67c and 6.66 data and images.
  7. 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.
  8. 1.2.2 – 27.10.2009
    • Bugs:

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

      • Fixed a problem with ‘morphing’ heroes.
  10. 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.
  11. 1.1.3 – 10.9.2009
    • Bugs:

      • Fixed an issue with duplicated ban / pick packets.
  12. 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.
  13. 1.1.1 – 19.6.2009
    • Bugs:

      • Tweaked zlib decompressing to allow parsing of modified replays
  14. 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
  15. 1.0 – 27.2.2009
    • Clean up
  • Richard
    #1 written by Richard 2 years ago

    Vow! So how does the integration work with phpbb3 and other forum softwares ?is there any support/help/guide for that?

    Seems promising

  • luciddream
    #2 written by luciddream 2 years ago

    i dont need integration etc..just need parsed data get MySQL-ed..

  • Seven
    #3 written by Seven 2 years ago

    Well this is simply meant to parse the replay and store / output relevant human readable information.

    It’s up to the webmaster / user to use the processed information as he sees fit, be it an SQL driven replay indexing page, Forum Board integrated feature or whatever.

    This final step is where practical implementation varies too much and making a unified SQL driven backend doesn’t seem a particularly good or useful idea to me.
    It’s really a matter of what you’re using the parser for and tapping into the relevant data stripped from the replay files to suit your needs.

  • luciddream
    #4 written by luciddream 2 years ago

    how can i READ your parsed replayname.txt ?

  • Seven
    #5 written by Seven 2 years ago

    You unserialize it using:

    1
    $replay = unserialize($data);

    Just open up view_replay.php and you’ll see what I mean.

    It’s not human readable but you can extract the info you need from it after unserializing. You can check out the structure with print_r($replay)

  • Luciddream
    #6 written by Luciddream 2 years ago

    when data unseriealized i can parse into mysql table data isnt it?
    thanks for replay Seven..

  • ming
    #7 written by ming 2 years ago

    may i know that how to setup server like this.
    i’m from malaysia here, think to do a dota webpage, so need to learn this one too.
    ^_^

  • Seven
    #8 written by Seven 2 years ago

    Hey ming.

    As Gdn | TD already explained at PD forums, some basic PHP understanding is required to integrate this script into your web page or CMS.

    Hopefully the friend you mentioned will be help enough.

  • naze
    #9 written by naze 2 years ago

    i love your parser..

    but why this parser doesn’t redirected to the “view details” page after finished upload?

    plz resolve this

  • iman
    #10 written by iman 2 years ago

    6.65 ? new update ?

  • Seven
    #11 written by Seven 2 years ago

    @naze:
    The parser doesn’t redirect because the upload_replay / view_replay.php pages are really just templates / examples to showcase what CDP can extract from a replay. If you’d like to redirect automatically just add some javascript to your upload page, like:

    1
    2
    3
    4
    5
    6
    7
    8
    <script type="text/javascript">
    <!--
    function delayer(){
        window.location = "view_replay.php?file=<?php echo $replayFile; ?>"
    }
    </script>
    </head>
    <body onLoad="setTimeout('delayer()', 5000)">

    @iman:
    You can find the 6.65 xml data and images at PlayDota for now, but I’ll be releasing a new version with 6.65 data and some fixes for SD / CD mode.

  • unholly
    #12 written by unholly 2 years ago

    thx seven for your’s amazing job, waiting a 1.31 patch for dota 6.66

  • Seven
    #13 written by Seven 2 years ago

    You’re welcome.

    As for the 6.66 XML, the change is so minor (Echo Slam), I’ll just link the XML file and leave the version update for later.

    You can get the 6.66 XML here.

  • Luciddream
    #14 written by Luciddream 2 years ago

    I`m member of Dota Clan and web designer who can work with HTML,CSS but i have very limited knowledge of PHP..
    i`m going to update my clan website.i need to import your parsed replay data into MySQL
    How to do this?i dont understand most of common PHP functions.
    Please help here.i think there will be other players like in my situation.
    thank you

  • sEEn
    #15 written by sEEn 2 years ago

    hi, i implement your php on my blog. i dont know why when i try to download the file myself, the file always comes as .html instead of .w3g. So the name of the file is File.w3g.html

    any suggestion?

  • Farman Ahmed
    #16 written by Farman Ahmed 2 years ago

    my website is made on joomla how do i install there …
    I want to know how can i install it and I dont know anything about php or css plz tell me step by step how to show replays data when people upload their replays

    Thankyou

  • Seven
    #17 written by Seven 1 year ago

    sEEn:

    I already answered at playdota.com, however I’ll point it out again. The problem is most likely with your hosting provider’s configuration and any tweaking should be done in the [b]downloads.php[b] file.

    Farman Ahmed:
    This parser is mostly made for people who know how to integrate it in their web system.
    Unfortunately I quit Dota more than a year ago, so the extent of updating the CDP is limited to debugging, maintenance and keeping up with new versions.

  • supgeis
    #18 written by supgeis 1 year ago

    im getting these errors after uploading :/

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/david/public_html/reshine.php on line 425

    Fatal error: Call to a member function getName() on a non-object in /home/david/public_html/reshine.php on line 698

    any ideas?

  • Seven
    #19 written by Seven 1 year ago

    Hum, are you uploading proper Dota games, not some sort of single player ones? That might be the cause, since the parser doesn’t handle single player Dota games gracefully.

  • supgeis
    #20 written by supgeis 1 year ago

    doh!, i used lastreplay for testing thinking it was a dota replay from the night before! turns out it was a single player replay in which i was doing some testing :S… thanks for the tip

    i have got it working, but i noticed some heroes abilities aren’t in order correctly

    http://www.faketheworld.net/wc3/details/2026 <– sb
    http://www.faketheworld.net/wc3/details/2017 <– bs
    http://www.faketheworld.net/wc3/details/2012 <– naix

    there are more that i can point out but it is pretty random..

  • supgeis
    #21 written by supgeis 1 year ago

    ps. that page isn’t what ive got working, it is linked from someone else, just using it as a reference to those errors

  • Seven
    #22 written by Seven 1 year ago

    Seems the mysql server on the page you linked is not accessible at the moment, however I did manage to sneak a peak into the SB replay. Might be that’s an issue with a player other than the hero’s owner skilling the hero with a “Common attribute” level.

    It’s the first idea that pops into my mind, but I’ll take a look if the page becomes operational again.

  • supgeis
    #23 written by supgeis 1 year ago

    any news? :)

  • reshine
    #24 written by reshine 1 year ago

    hi seven ,
    do you know how to show left time on the stats ? right now the script only show who left the game in chat logs .. can you give me a hint how to show the left time on each player on the statistic table ?

  • Seven
    #25 written by Seven 1 year ago

    @Supgeis:
    Haven’t been able to figure it out yet, didn’t have a lot time to spend on it, but I’ll figure it out eventually.

    @Reshine:
    Simplest way to do it would be to add:

    Step 1: in view_replay.php (Somewhere around line ~290 for instance, in the foreach player loop)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    // Handle player left events
                if(isset($player['time'])) {
                    $playerLeaveTime = convert_time($player['time']);
                }
                else {
                    $playerLeaveTime = convert_time($replay->header['length']);
                }
                if(isset($player['leave_result'])) {
                    $leaveResult = $player['leave_result'];
                }
                else {
                    $leaveResult = "Finished";
                }

    Step 2: in view_replay.php change the // Display other part to:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    // Display other
                echo  ('<div class="extraOther" style="float: right;">
                            <div class="displaySelect">
                                Left at '
    .$playerLeaveTime.', reason: '.$leaveResult.'.
                            </div>
                            <div class="displaySelect">
                                <a href="javascript:toggleDisplayedExtra(\'player'
    .$player['player_id'].'_skills\',\''.$player['player_id'].'\');">Skills</a> |
                                <a href="javascript:toggleDisplayedExtra(\'player'
    .$player['player_id'].'_items\',\''.$player['player_id'].'\');">Items</a> |
                                <a href="javascript:toggleDisplayedExtra(\'player'
    .$player['player_id'].'_actions\',\''.$player['player_id'].'\');">Actions</a>
                            </div>'
    );

    This would produce an output as can be seen on this Screenshot.

  • reshine
    #26 written by reshine 1 year ago

    did you have any e-mail or ym ? i have some question ^_^ ..

    please contact me in my e-mail on this comment

  • Rush
    #27 written by Rush 1 year ago

    does it work with usual wc3 replays 1×1, 2×2 etc?

  • Seven
    #28 written by Seven 1 year ago

    Nah it’s only meant to be used with DoTA.

  • SomeOne
    #29 written by SomeOne 1 year ago

    How can we see the game name??

  • SomeOne
    #30 written by SomeOne 1 year ago

    oh, and how to add the Win Team to auto also??

  • Xan
    #31 written by Xan 1 year ago

    Is it possible to Update it to 6.68b ?

  • cai
    #32 written by cai 1 year ago

    Is it possible to Update it to 6.68b ?

  • SomeOne
    #33 written by SomeOne 1 year ago

    maybe u could add new function for -switch

  • rEa
    #34 written by rEa 1 year ago

    Seven update your parser pls, like your work! cheers

  • Farman Ahmed
    #35 written by Farman Ahmed 1 year ago

    I have successfully used the parser it is also uploading all replays but for viewing replay i had to give the filename and that i dont want.
    I want to see the whole replay folder where my replays are being saved on my site with brief description with each replay.
    Plz help

  • Farman Ahmed
    #36 written by Farman Ahmed 1 year ago

    And one more thing replays are saving like some random integers how to change, the replay to be saved in its original name.
    Plz Help

  • Seven
    #37 written by Seven 1 year ago

    Hey, I’m working on an update for 6.68b.
    Sorted out the new CM mode already and going to add the new items, heroes and images next.

    This release will also include the automated winner extraction option.

    I’ll look into switch, but no promises.

  • Xan
    #38 written by Xan 1 year ago

    Thanks. We really appreciate your work.

  • Xan
    #39 written by Xan 1 year ago

    Oh, i can’t edit. Could it be possible to add a option to show when the replay was uploaded? The date i mean.

  • Farman Ahmed
    #40 written by Farman Ahmed 1 year ago

    thanks man w8ing to get it

  • SomeOne
    #41 written by SomeOne 1 year ago

    thanks seven :) you work is awsome!! :D

  • SomeOne
    #42 written by SomeOne 1 year ago

    oh, i forgot, about the switch, i think the main problem is in the reshine.php…
    i manage to disable the switch function so it won’t affect the player position, but the heroes keep switching place, i guess it’s detected as -swap…

  • sayedzul
    #43 written by sayedzul 1 year ago

    please update so it can support 6.68c

    anyway, good job steve… we really apreciate u’r work…

  • Seven
    #44 written by Seven 1 year ago

    I uploaded CDP 1.4 with 6.68 support, switch handling, auto winner detection and some other features, with a handful of bugs smashed.

    @SomeOne: Switching was indeed unintentionally partially handled by the -swap detection procedures, however now it should be fully implemented.

    @Xan & Farman Ahmed: Adding the upload date and handling filenames is rather trivial and should be done somewhere in your upload front-end. I try focusing on changing only the core parser files, while upload_replay.php and view_replay.php present mainly for documentation and primer purposes.

  • Xan
    #45 written by Xan 1 year ago

    I’ll try to do it myself, thanks anyway. We really like this parser

  • Xan
    #46 written by Xan 1 year ago

    i have a little problem with Gem of true Sight. It doesn’t display correctly
    http://img444.imageshack.us/img444/46/parser.jpg

  • Farman Ahmed
    #47 written by Farman Ahmed 1 year ago

    I have successfully used the parser it is also uploading all replays but for viewing replay i had to give the filename and that i dont want.
    I want to see the whole replay folder where my replays are being saved on my site with brief description with each replay.
    And one more thing replays are saving like some random integers how to change, the replay to be saved in its original name.
    Plz Help

  • Seven
    #48 written by Seven 1 year ago

    @Xan: I think the problem with the Gem of true Sight is that it was a “borrowed” gem, seems I didn’t include the appropriate image. For now you can just use this image and it should do the trick.

    @Farman: I can see where you’re coming from, but saving replays with their original names leads certain problems that are best avoided.
    For one you get illegal characters for filenames and blank spaces for links. You also have problems with names like “Last Replay” for instance…. sure you can get up to “Last Replay(420042)”, but I think with that, you once again stray from keeping original filenames.
    That’s why I chose to save the files as timestamps and retain the original filename in the replay data, which is then provided when downloading the replay via the download.php script and the user gets the file with the original name, even though the file was saved as a timestamp.w3g on the server’s filesystem.

    As far as seeing the replay folder goes, you could get some pointers from this indexing script skeleton I quickly threw together once for somebody. Mind you there are some layout issues due to certain changes in CDP and since the indexing script was made for an older version and to accommodate some other site, but you can still use it as reference or a starting point,
    I would however advise against using a non-db driven indexing site for any real production deployment.

  • Fatal error
    #49 written by Fatal error 1 year ago

    Fatal error: Call to a member function setAA_Total() on a non-object in c:\………………\reshine.php on line 1370
    :’(

  • Seven
    #50 written by Seven 1 year ago

    Hm adding this condition on line 1370 in reshine.php should fix it.

    1
    && isset($this->stats[$pid])

    http://i37.tinypic.com/2zp1eev.jpg

  • 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