Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

[bug] Client degraded on Bolt Network reconnect #215

Closed lukefanning closed 3 years ago

lukefanning commented 3 years ago

Context

Hi, we are experiencing an issue with Dissonance integrated with Photon Bolt that we are able to reliably replicate everytime. Within our lobby scene when a client initially connects to the host, everything works normally. If the client then exits the lobby (which shuts down BoltNetwork) and then re-joins the same lobby Dissonance shows under Network Stats, mode: Client with Connection Status: Degraded. The client is not shown as a connected player under the Dissonance Comms component and they are unable to hear anyone or send any voice

On the client "[Dissonance:Network] (15:48:16.685) VoiceSender`1: Attempted to send voice before assigned a client ID by the host (100 packets discarded so far)" warnings are generated if you speak into the mic

Expected Behavior

On client re-connecting to a Bolt session after leaving one Dissonance should connect as normal

Actual Behavior

Client is unable to join the Hosts dissonance session

Workaround

De-activating the DissonanceSetup GameObject and then immediately re-activating it after bolt has shutdown fixes it

Steps to Reproduce

Provide a detailed set of steps to reproduce the problem

  1. Host a Bolt network session
  2. Join Bolt session with a client
  3. Shutdown Bolt on the client
  4. After shutdown, re-join the bolt session with the same client

Your Environment

Include as many relevant details about the environment you experienced the bug in

martindevans commented 3 years ago

Hi @ssg-luke

Are you preserving the DissonanceComms object (and the other components on that object) between scenes (e.g. with DontDestroyOnLoad)? Ideally they should be discarded and recreated when you leave/join a session.

lukefanning commented 3 years ago

So this is all occurring within the same scene so I dont think DontDestroyOnLoad is relevant to this bug. Referring to it as "lobby scene" is a bit inaccurate. Effectively we have a menu scene and within that one scene you can go between being in a lobby and not being in a lobby

martindevans commented 3 years ago

Ok that makes sense. What do the Mode and Connection Status show after you leave the Bolt session?

lukefanning commented 3 years ago

Ah I'd have to check for sure but I am fairly sure that Mode becomes None and Connection Status vanishes. Edit: Yep confirmed

martindevans commented 3 years ago

Sorry for letting this issue go stale. We've had a few Dissonance releases since this was an issue, in particular Dissonance 8.0.0 has some improvements for reconnecting clients to sessions and flushing out old state. I'll close this issue for now, but if you still have an issue even with 8.0.0 please don't hesitate to comment here again.