ValvePython / dota2

🐸 Python package for interacting with Dota 2 Game Coordinator
http://dota2.readthedocs.io
201 stars 32 forks source link

How to get match details after ending #37

Closed uturet closed 5 years ago

uturet commented 6 years ago

My bot takes team 4 DOTA_GC_TEAM_PLAYER_POOL and haves leaver_status: DOTA_LEAVER_DISCONNECTED. But during the game events lobby-removed and lobby-changed contains

...
match_id: 3710000726
game_start_time: 1517418800
...

And I can do nothing with it, because properties are missing

dota2.util.metadata_url(match_id, cluster, replay_salt, app_id=570)
match_id (int) – match id
cluster (int) – cluster the match is saved on
replay_salt (int) – salt linked to the replay

What solutions exists?

rossengeorgiev commented 6 years ago

@uturet you need to get the match details. See http://dota2.readthedocs.io/en/latest/dota2.features.match.html#dota2.features.match.Match.request_match_details

uturet commented 6 years ago

Thanks for your halp. I have this on DEBUG

[2018-02-03 17:46:26,979] DEBUG Dota2Client: Emit event: <EDOTAGCMsg.EMsgGCMatchDetailsResponse: 7096>
[2018-02-03 17:46:26,981] DEBUG Dota2Client: Emit event: 'job_4'
[2018-02-03 17:46:26,981] DEBUG Dota2Client: Emit event: 'match_details'
EVENT:  match_details
MatchID: 3715081950
Result: EResult.AccessDenied
Match: None

The game are waiting for bot and do not starts when I am trying to play with him in Dire or Radiant team leaver_status: DOTA_LEAVER_DISCONNECTED

rossengeorgiev commented 6 years ago

The bot can't connect so the game doesn't start. You need to put him as a broadcaster or spectator. Then after the match has finished you will be able to get match details.

liesnikov commented 6 years ago

The problem with this workaround is that, due to #26 it isn't possible to launch a match with a bot in broadcaster\spectator channel, and joining it after the match has been started (status = RUN) doesn't seem to have effect. (I've tested it quite lightly though)

Thus, it doesn't really work in case one wants to start the match with the bot and then collect results

rossengeorgiev commented 5 years ago

I haven't tested that recently, but you could certainly start a match with a bot, and collect the results once the match is finished.

Closing this issue as stale, feel free top reopen if needed.