Closed CreativeTechGuy closed 9 months ago
Hmmmm...I wonder if it's because notifications are fired on their own thread. Might be a threading issue. Will probably have to put a lock on the playNext
method of the player (I think that's what it's called). They're probably setting soundTimeout
at the same time or some race condition. When you say the second one will stop
do you mean it will stop when the first one plays? or that it will stop correctly after user interaction?
When you say the second one will stop do you mean it will stop when the first one plays? or that it will stop correctly after user interaction?
It'll stop correctly after user interaction. Although this seems to be inconsistent. Not sure exactly why, but sometimes all of the sounds that are looping cannot be canceled with user interaction, sometimes after user interaction one of them stops (seems like if that's the case, it's the last one which was triggered in order).
After doing some testing myself, it looks like this only happens if you're not using the sound queue
Ah good catch. Yeah I don't have the sound queue setting on. I didn't think of that. And the solution seems reasonable! Thank you :)
Repro:
The alert above is the easiest way to reproduce this, but it can also occur if a
repeatDuration: -1
sound exists in two different alerts that get triggered at the same time. What will happen is that both will play, the second one will stop, the first one will never be cancelled, regardless of what you do (including logging out, disabling the plugin, etc). The only way to recover is to completely close RuneLite.