voice not working after switching scenes
Options
when I switch the scenes voice is not working and it shows the error as,
OnDisconnected cause=DisconnectByServer
UnityEngine.Debug:LogErrorFormat(String, Object[])
Photon.Voice.Unity.UtilityScripts.ConnectAndJoin:OnDisconnected(DisconnectCause) (at Assets/Photon/PhotonVoice/Code/UtilityScripts/ConnectAndJoin.cs:155)
Photon.Realtime.ConnectionCallbacksContainer:OnDisconnected(DisconnectCause) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3240)
Photon.Realtime.LoadBalancingClient:OnStatusChanged(StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2371)
ExitGames.Client.Photon.<>c__DisplayClass100_0:b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:893)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:429)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1428)
Photon.Voice.Unity.VoiceConnection:FixedUpdate() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:304)
OnDisconnected cause=DisconnectByServer
UnityEngine.Debug:LogErrorFormat(String, Object[])
Photon.Voice.Unity.UtilityScripts.ConnectAndJoin:OnDisconnected(DisconnectCause) (at Assets/Photon/PhotonVoice/Code/UtilityScripts/ConnectAndJoin.cs:155)
Photon.Realtime.ConnectionCallbacksContainer:OnDisconnected(DisconnectCause) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3240)
Photon.Realtime.LoadBalancingClient:OnStatusChanged(StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2371)
ExitGames.Client.Photon.<>c__DisplayClass100_0:b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:893)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:429)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1428)
Photon.Voice.Unity.VoiceConnection:FixedUpdate() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:304)
0
Comments
-
Hi @Arivazhagan,
Thank you for choosing Photon!
You need to set the GameObject to which the VoiceConnection script is attached to as DontDestroyOnLoad so it persists across scenes.
If you use PhotonVoiceNetwork it has this option built-in.
But I doubt that your issue is related to scene switching as if it was the case the DisconnectCause would be TimeoutDisconnect.
Make sure you are not sending too much to the server.0 -
Can I know when the error will come as DisconnectByServer?0
-
Hi @Arivazhagan,
What do you mean?
I have checked the code ofDisconnectCause
and it seems I was wrong about something:/// <summary>OnStatusChanged: The server disconnected this client due to timing out (missing acknowledgements from the client).</summary> ServerTimeout, /// <summary>OnStatusChanged: The server disconnected this client. Most likely the server's send buffer is full (receiving too much from other clients).</summary> [Obsolete("Replace with: ServerTimeout (same value).")] DisconnectByServer = ServerTimeout, /// <summary>OnStatusChanged: This client detected that the server's responses are not received in due time.</summary> ClientTimeout, /// <summary>OnStatusChanged: This client detected that the server's responses are not received in due time.</summary> [Obsolete("Replace with: ClientTimeout (same value).")] TimeoutDisconnect = ClientTimeout,
DisconnectByServer
is now obsolete and replaced withServerTimeout
.
TheTimeoutDisconnect
is also obsolete is replaced withClientTimeout
.
Loading level can take too much time (> 10 seconds) during which the server will disconnect the client if the latter "does not show any sign of life" (reply or send back ACKs to the server).
So the solution is to have the GameObject to whichVoiceConnection
(orPhotonVoiceNetwork
) component attached set as DontDestroyOnLoad to persist between scenes.0 -
Yeah I set it on DontDestroyonload, But I'm having the error0
-
Hi @Arivazhagan,
I managed to reproduce and I'm trying to fix this.
Will post an update here if I make it work as expected.
Sorry for the inconvenience!
0 -
Hi @Arivazhagan,
Could you try replacing "Photon/PhotonVoice/Code/VoiceConnection.cs" with this and test again?0 -
yeah, It's working...thanks for your support.1
-
Thank you for your help!
We will include this fix in the next update.0 -
FYI:
This was fixed in Photon Voice 2.1.3.0 -
That script you gave was not working also. At first, it works now I'm checking it again it's not working.0
-
0
-
I'm using version 2.1 that came on November 8th, 2018, is it updated?
If not, can I know how to update the newest version?0 -
Currently, last version is 2.1.3 released on December 7th, 2018.
The update is done via Unity Asset Store.
You should get notifications from Unity Asset Store about assets that has updates.0 -
After updating to the new version voice is not working.0
-
I don't understand how you confirmed that it's working the first time then it stopped working for you.
If this is a random behaviour where you can't reproduce 100% then it is tricky to debug.
Does this happen in the Unity Editor or in a build? if it's a build which platform?
what Unity version is this?
could you send us a minimal repro project?0