Page 2 of 8 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 71

Thread: Another way for API processing with PHP

  1. #11
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Added methods to delete match(es). See match_mapper_db and matches_mapper_db.
    Added JSON for regions.
    Added halloween and greevil items to items.json.

    See ReadMe for more info.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  2. #12
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Added class for creating map image with barracks and tower (thanks all in this thread).
    Matches_mapper_web now returns array of match objects (not assoc array of data as it was).
    Matches_mapper_db now returns data with info about additional units.

    See ReadMe with examples.

    For now map may not working sometimes - api returns incorrect values (situations when t3 tower isn't destroyed, but barracks on this line are destroyed etc).

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  3. #13
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Some updates. Fixed few bugs and added few improvments.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  4. #14
    Basic Member
    Join Date
    Apr 2013
    Posts
    2
    I'm not a good programmer, sorry about that.
    But I can't make it work.
    And actually I don't get why we use database.

    I'm making a championship, if you wanna join me, contact me here.
    Thanks.

  5. #15
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Jarolim, we use database to store parsed matches, because access to local db is faster then to API-server.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  6. #16
    Basic Member
    Join Date
    Apr 2013
    Posts
    2
    Ahh, thanks.
    But it is not working yet.

    test.php =
    <?php
    require_once ('config.php');
    $mm = new match_mapper_web(121995119);
    $match = $mm->load();
    echo $match->get('match_id');
    echo $match->get('start_time');
    echo $match->get('game_mode');
    $slots = $match->get_all_slots();
    foreach($slots as $slot) {
    echo $slot->get('last_hits');
    }
    print_r($match->get_data_array());
    print_r($match->get_slot(0)->get_data_array());
    ?>
    and I'm getting this =
    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62

    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62

    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62
    1219951192013-02-10 17:44:04410753303181Array ( [match_id] => 121995119 [season] => 7 [radiant_win] => 1 [duration] => 251 [first_blood_time] => 138 [start_time] => 2013-02-10 17:44:04 [match_seq_num] => 112119348 [game_mode] => 4 [tower_status_radiant] => 2047 [tower_status_dire] => 2047 [barracks_status_radiant] => 63 [barracks_status_dire] => 63 [replay_salt] => [lobby_type] => 0 [human_players] => 10 [leagueid] => 0 [cluster] => 132 [positive_votes] => 0 [negative_votes] => 0 [radiant_team_id] => [radiant_name] => [radiant_logo] => [radiant_team_complete] => [dire_team_id] => [dire_name] => [dire_logo] => [dire_team_complete] => ) Array ( [id] => [account_id] => 4294967295 [player_slot] => 0 [hero_id] => 59 [item_0] => 25 [item_1] => 29 [item_2] => 0 [item_3] => 0 [item_4] => 0 [item_5] => 0 [kills] => 1 [deaths] => 0 [assists] => 0 [leaver_status] => 0 [gold] => 559 [last_hits] => 10 [denies] => 0 [gold_per_min] => 248 [xp_per_min] => 401 [gold_spent] => 1085 [hero_damage] => 603 [tower_damage] => 0 [hero_healing] => 0 [level] => 5 [match_id] => 121995119 )
    What can be wrong? I tried everything.

  7. #17
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Jarolim, just turn off error reporting.
    In your case you just got few warnings. All works.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  8. #18
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Topic up.
    Fixed league listing issue.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  9. #19
    Basic Member
    Join Date
    May 2013
    Posts
    4
    With your API as I can get the nicknames of the players? because it brings the ID of the participating players a game

  10. #20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •