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:
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
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 with Replace
voiceNickname
with a string of your choice.Replace
voiceUserId
with a string (non null, non empty) of your choice.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?
Thank you for choosing Photon and sorry for the delay.
Photon Voice 1.16 is released and we now use the same Nickname and UserID from PUN when we connect to self-hosted Photon Voice Server.
roomOptions = new RoomOptions() { PublishUserId = true };
Do you mean PUN rooms or voice rooms?
EDIT: PUN Rooms, see post below for more details.