PUN Voice is repeating Disconnect and connect. And I cannot leave room.

Options
2018-11-29 15:48:13.989 14267-14335/? I/Unity: PUNVoice: OpAuthenticate()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:13.989 14267-14335/? I/Unity: PUNVoice: Voice Client state: Authenticating

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.029 14267-14335/? I/Unity: PUNVoice: Voice Client state: ConnectedToMaster

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.029 14267-14335/? I/Unity: PUNVoice: Voice Client state: Joining

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.031 14267-14335/? I/Unity: PUNVoice: OpJoinRoom()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.056 14267-14335/? I/Unity: PUNVoice: Voice Client state: DisconnectingFromMasterserver

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.056 14267-14335/? I/Unity: PUNVoice: CSharpSocket.Disconnect()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.059 14267-14335/? I/Unity: PUNVoice: Voice Client state: ConnectingToGameserver

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.059 14267-14335/? I/Unity: PUNVoice: CSharpSocket.Disconnect()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.255 14267-14335/? I/Unity: PUNVoice: OpAuthenticate()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.255 14267-14335/? I/Unity: PUNVoice: Voice Client state: Authenticating

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.290 14267-14335/? I/Unity: PUNVoice: Voice Client state: Joining

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.293 14267-14335/? I/Unity: PUNVoice: OpJoinRoom()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.624 14267-14335/? I/Unity: PUNVoice: Voice Client state: DisconnectingFromGameserver

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.625 14267-14335/? I/Unity: PUNVoice: CSharpSocket.Disconnect()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.627 14267-14335/? I/Unity: PUNVoice: Voice Client state: ConnectingToMasterserver

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
2018-11-29 15:48:14.627 14267-14335/? I/Unity: PUNVoice: CSharpSocket.Disconnect()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
---------------------------------------------------------------------------------------------------------------------------------------
I'm using PUN Voice in android platform. When I join room, pun voice is repeating disconnect and connect.(Up code is that)
And when I tried to leave room with PhotonNetwork.LeaveRoom() It didn't work.
So I followed the PhotonNetwork.LeaveRoom() function with using Debug.Log, and it stopped at OpLeaveRoom which in LoadbalancingPeer script.

I'm using custom authenticate, playfab to login pun voice.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @KGD,

    Thank you for choosing Photon!

    1. What Photon Voice version is this?
    2. Does this happen with the demo scenes?
    3. What are the values of PhotonVoiceSettings.AutoConnect and PhotonVoiceSettings.AutoDisconnect?
    4. How do you connect and join rooms? You do it in PUN or directly in Photon Voice?
    5. If you increase the log what do you see? it could be an error when Photon Voice tries to join the voice room.
    6. Do you have unique UserId in Photon Voice? Please log that once connect to Photon Voice.
    7. Did you try creating rooms using RoomOptions.PublishUserId enabled?
  • KGD
    Options
    1. My Photon Voice version is v1.15
    2. I test my PUN voice APP ID at demo scenes, and it happened same.
    But If I make new PUN voice APP ID, It didn't happen.
    At this point, I guess the problem is I didn't connect PhotonVoiceNetwork manually with adding authValue.
    If this is right, I don't know how to add authValue when connecting photonVoiceNetwork.
    I set Playfab custom authenticate at PUN Voice Application, and I don't know that made this happen
    3. I set the values of Autoconnect and AutoDisconnect - On and Off, but same.
    4. I'm not good at English, so I paste my code here. I'm not connect photon voice manually.
    -----------------------------------------------------------------------------------------------------------------------------------
    Debug.Log("Google Signed In");
    var serverAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode();
    Debug.Log("Server Auth Code: " + serverAuthCode);

    PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
    {
    TitleId = PlayFabSettings.TitleId,
    ServerAuthCode = serverAuthCode,
    CreateAccount = true
    }, (result) =>
    {
    Debug.Log("Signed In as " + result.PlayFabId);
    PlayFabClientAPI.GetPhotonAuthenticationToken(new GetPhotonAuthenticationTokenRequest()
    {
    PhotonApplicationId = PhotonNetwork.PhotonServerSettings.AppID
    }, (result_in) =>
    {
    var customAuth = new AuthenticationValues { AuthType = CustomAuthenticationType.Custom };
    //We add "username" parameter. Do not let it confuse you: PlayFab is expecting this parameter to contain player PlayFab ID (!) and not username.
    customAuth.AddAuthParameter("username", result.PlayFabId); // expected by PlayFab custom auth service
    //We add "token" parameter. PlayFab expects it to contain Photon Authentication Token issues to your during previous step.
    customAuth.AddAuthParameter("token", result_in.PhotonCustomAuthenticationToken);
    //We finally tell Photon to use this authentication parameters throughout the entire application.
    PhotonNetwork.AuthValues = customAuth;
    PhotonNetwork.ConnectUsingSettings("1.0");

    }, (error) => { Debug.Log("Error !"); });


    }, (error)=> { Debug.Log("Error !"); });
    ----------------------------------------------------------------------------------------------------------------------

    5. I increased log and tried to find error when join room, But can't find.
    6. here is my debug log which get userID.
    ------------------------------------------------------------------------------------------------------------------------
    2018-12-01 17:14:17.646 20919-20936/? I/Unity: PUNVoice: Received your UserID from server. Updating local value to: 7a075187-1b88-4293-9031-33bc6aac40cf

    (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    ------------------------------------------------------------------------------------------------------------------------
    7. I didn't try it because I don't think it could be help for my problem
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @KGD,

    OK. So you are saying you configured custom authentication with PlayFab for the Photon Voice application you use as Photon Voice AppId? I think you left "Allow anonymous clients to connect, independently of configured providers." because you were able to connect and get random UserId (GUID) from the Photon Cloud.

    I don't know if you need to authenticate voice clients also or just use random UserIDs, it's up to you.
    If you want to authenticate voice clients, try adding one line:
    PhotonNetwork.AuthValues = customAuth;
    PhotonVoiceNetwork.Client.AuthValues = customAuth;
    PhotonNetwork.ConnectUsingSettings("1.0");
    However, I don't think that this is what is causing our issue.
    Do you have webhooks enabled for the Voice Application, if you do then you must have custom authentication using PlayFab working properly.

    I recommend you do not use anything from PlayFab with Photon Voice as you don't need it, you already have the authentication done via PUN and no need for the webhooks unless you want to track analytics of Photon Voice AppId which should be the same as PUN. But if you do use webhooks with Photon Voice AppId, which -again- I do not recommend, make sure to use webhooks 1.2.