cannawen / dota-gsi-discord-bot

Use Dota 2's Game State Integration API to make helpful announcements in a discord voice channel
MIT License
5 stars 2 forks source link

[bug] sometimes the first couple game audios don't get played on discord or get queued up to play all at once #132

Open cannawen opened 11 months ago

cannawen commented 11 months ago

Happened in this game - https://www.opendota.com/matches/7291414321

Fish of War, wrath, and I all had the bot installed on our machines but Fish was the first one to bring the bot to the server. I did do a /coachme on the server but did not see the "public audio disabled" message. wrath also did a /coachme on the server.

The bot did not play public audio for ~10 minutes then played all the queued audio in sequence.

cannawen commented 11 months ago

Looking at analytics logs

Game started 3:45:31 PM on Aug 18th

Canna's audio were all private audio

Raf's audio was private until 11:03 into the game where the first event recorded is "free fort" (an interrupting audio) and then it starts the public audio spam: glhf at 11:05 lotus soon at 11:06 lotus soon at 11:08 ...and so on.

It looks like the audio was somehow blocked until we had an interrupting audio.

Fish's analytics are the most confusing, he only got 3 audio events: Image

The glhf was not played, I think?

Image Image

cannawen commented 11 months ago

This might not be a problem with both users doing a /coachme (because my bot didn't have a problem)

This might be the race condition we were worried about when we made the autoconnect feature.

cannawen commented 11 months ago

Not a race condition problem, but a problem with autoconnect bypassing the /coachme check if there is already someone connected to the channel it will stop it. Moving the "is there anyone already connected to this channel?" logic down deeper into the start coaching session code. Perhaps it will fix it?