Arcana / node-dota2

A node-steam plugin for Dota 2.
MIT License
546 stars 191 forks source link

Get practice lobby result with bot that abandoned at the start #395

Closed angel200sdnot closed 7 years ago

angel200sdnot commented 7 years ago

Is it possible to get the result from a private lobby that isn't ticketed without having to make the bot stay as a spactator/broadcaster/coach until the game is finished?

zackcoburn commented 7 years ago

I'm also interested in the answer to this question.

Crazy-Duck commented 7 years ago

Alright, since there have been like a million different tickets open for this: As soon as you create a lobby, a match ID is assigned. You should be able to read this from the lobby updates you receive. However, details about private lobbies are not publicly made available through the API, except for those who actually played them (so even if you stay in the lobby until the end as a spectator, you won't be able to get the details at a later point). This is because they are private lobbies. As soon as you ticket a lobby, it becomes a public lobby for which the details can be queried. Pro players would not be happy when their scrims were disclosed to the public, as this would evidently prevent them from saving strats for TI27. So if you want to have the details of a private lobby, you better stick around until it finishes, so you can get the details from the lobby updates.

zackcoburn commented 7 years ago

So, is this statement correct? There is no way to get the Match ID of a lobby created through the API unless the bot creating the lobby plays in the match.

Is there a way to ticket a lobby through the API?

Crazy-Duck commented 7 years ago

the bot doesn't need to play, he only needs to be in the player pool afaik. Don't know about ticket, there's probably a way to do it through the createPracticeLobby settings, but I don't have any experience with that

zackcoburn commented 7 years ago

The 'Start game' button doesn't appear if the bot is in the unassigned player pool.

Crazy-Duck commented 7 years ago

let the bot create the lobby, then it's admin and can start the game

zackcoburn commented 7 years ago

Is there an API call that will start the game?

Crazy-Duck commented 7 years ago

launchPracticeLobby ...? It's all in the README

zackcoburn commented 7 years ago

I had been doing that without waiting for the other players to join, and it didn't work. It just occurred to me to try doing it after the players have joined, and now it works. It didn't occur to me that 'launching a practice lobby' is equivalent to 'starting a game.' 👍

Crazy-Duck commented 7 years ago

yeah you need to wait till there's at least one real person in either team before you launch. Since the bot can't connect to the game server itself, if you launch while it's just sitting there alone, game's just gonna fail