Setting userId for Photon Voice on self-hosted windows server

Hi, I have a test project to try some photon features, and I wanted to have photon voice on it. It works fine on photon cloud, but when switching to self-hosted server, photon voice doesn't work.

It seems that when the first player connects and creates the room, everything goes well, but when the next player wants to join, the server logs this warning:

2018-05-08 17:18:12,015 [11] WARN Photon.Hive.HiveGame - JoinApplyGameStateChanges: Game 'Default Room 2_voice_' userId '' failed to join. msg:Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId. -- peer:GameClientPeer: PID 8640, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 5/8/2018 8:18:12 PM in Room Default Room 2_voice_, IP 192.168.10.136:64909,

We are already setting the userId like this:

PhotonNetwork.AuthValues = new AuthenticationValues(SystemInfo.deviceUniqueIdentifier); PhotonNetwork.ConnectUsingSettings("PUNTest1");

Any clue of why this happens?

Comments

  • JohnTubeJohnTube mod
    edited May 9
    Hi @pablomiceli24,

    Thank you for choosing Photon!

    Photon Cloud runs a newer Photon Server version that has this issue related, on Photon Cloud if the client does not provide a UserId, the server will assign a new GUID for it.
    However, here is a workaround that allows setting UserId for Photon Voice client:

    in PhotonVoiceNetwork.cs":

    replace line 154
    return instance.client.Connect(voiceMasterAddress, null, null, null, null);
    
    with
    return instance.client.Connect(voiceMasterAddress, null, null, voiceNickname, new LoadBalancing.AuthenticationValues(voiceUserId));
    Replace voiceNickname with a string of your choice.
    Replace voiceUserId with a string (non null, non empty) of your choice.
  • Thanks @JohnTube , that did the trick.
Sign In or Register to comment.