Інсталювати Steam
увійти
|
мова
简体中文 (спрощена китайська)
繁體中文 (традиційна китайська)
日本語 (японська)
한국어 (корейська)
ไทย (тайська)
Български (болгарська)
Čeština (чеська)
Dansk (данська)
Deutsch (німецька)
English (англійська)
Español - España (іспанська — Іспанія)
Español - Latinoamérica (іспанська — Латинська Америка)
Ελληνικά (грецька)
Français (французька)
Italiano (італійська)
Bahasa Indonesia (індонезійська)
Magyar (угорська)
Nederlands (нідерландська)
Norsk (норвезька)
Polski (польська)
Português (португальська — Португалія)
Português - Brasil (португальська — Бразилія)
Română (румунська)
Русский (російська)
Suomi (фінська)
Svenska (шведська)
Türkçe (турецька)
Tiếng Việt (в’єтнамська)
Повідомити про проблему з перекладом
my guess would be without looking into it too much would be that you need to look into the method IDOTA2Match
so i guess you would need to get the match id from the person you want the hero selection from, so you would need to acquire that, i would think.
https://steamapi.xpaw.me/#IDOTA2Match_570
but do test around yourself, you might figure it out then.
so i found this api https://docs.opendota.com/ this has everything you need.
so first you need to get the account id for the person you want to retrieve hero selection status from, I used my friends as he was the only one currently playing dota 2 as omniknight.
get the account id, which ever way you find easiest, i used steamdb:
- https://steamdb.info/calculator/76561197966244188/
- Steam3 ID [U:1:5978460] > we only need the end bit after the second colon "5978460"
api request call 1:
https://api.opendota.com/api/players/5978460/matches
the first match is the current match
this is what we need from here : "hero_id":57
now we need to know which hero that is so we need to get a list of hero_ids and look for id 57:
https://api.opendota.com/api/heroes
and then we know which hero the person is playing currently ingame, this guy was ingame playing while i checked so i know this works, this also means you are able to create some live stat for that person, such as kills etc.
Still got one question though: how do I know that the game is actually live? I understand that I get the 'latest' games with the above, but that does not say anything whether the game is live or not?
so my approach would be doing a second request to check whether or not either of the values of the keys have changed.
such as the one you mentioned > start_time
maybe even look at the duration to see if it is static, it might be an indicator whether or not a match would be over or not.
(er du dansker?)