Setting userId for Photon Voice on self-hosted windows server
Options
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:
We are already setting the userId like this:
Any clue of why this happens?
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?
0
Comments
-
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 154return instance.client.Connect(voiceMasterAddress, null, null, null, null);
withreturn instance.client.Connect(voiceMasterAddress, null, null, voiceNickname, new LoadBalancing.AuthenticationValues(voiceUserId));
ReplacevoiceNickname
with a string of your choice.
ReplacevoiceUserId
with a string (non null, non empty) of your choice.1 -
Thanks @JohnTube , that did the trick.0
-
I did a lot of searching over the past couple days, and finally this post has the solution to my problems! Thanks!
P.S. It seems odd that the voice user id isn't exposed in a client API, given that it's required by the server. I'm guessing this bug is getting fixed by Photon?0 -
I am running the demo from photon voice 1.16 and the same problem. It is not fixed.0
-
Make sure to set the "PublishUserId" option of the room to true before creating it, otherwise the UserID will be an empty string and that will be a problem. That worked for us.Ramiro said:I am running the demo from photon voice 1.16 and the same problem. It is not fixed.
roomOptions = new RoomOptions() { PublishUserId = true };
0 -
Hi @pablomiceli24,
Do you mean PUN rooms or voice rooms?
EDIT: PUN Rooms, see post below for more details.0 -