PUN & Photon server : userID issue

Options
Hi,

I am new to photon with Unity and I try this asset https://assetstore.unity.com/packages/templates/tutorials/vr-shooting-range-photon-85121

I use the photon server SDK for 2 PCs connected on LAN.

First player doesn't have issue to connect on the server.
But the second has always this error
WARN Photon.Hive.HiveGame - JoinApplyGameStateChanges: Game '933f1ebc-2870-48da-a222-ad0a74a1a846' userId '' failed to join. msg:Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.

I found some topics with this solution : https://forum.photonengine.com/discussion/11264/user-id-not-set
But I don't understand where I have to write it and how I generate the userID ?

Moreover, do you know good photon tutorial to understand the basics or more because I find the documentation of photon a little hard to understand.


Thank you for you help.

Best regards,

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2019
    Options
    Hi @JoRangers,

    Thank you for choosing Photon and I'm sorry you stumbled into this issue!

    It is a known issue with Photon Server SDK that is a couple of versions behind what we run on Photon Cloud. The client SDKs are aligned with Photon Cloud and the new behaviour is that each client/player/actor needs a unique UserID inside rooms. The server should assign/return a GUID in case the player does not request one or get one from an external authentication provider. It's still not the case with the server SDK where clients can remain with a null or empty UserId.

    So in order to avoid this just generate a GUID (or any other unique string per user) and send it as a UserID:
    string userId = Guid.NewGuid().ToString();
    PhotonNetwork.AuthValues = new AuthenticationValues(userId);
  • ar3k_g
    Options
    First, this entry is from July 2018. I keep hearing that the standalone server is, what, several generations behind Photon Cloud? Some of us can't use Photon Cloud, are we relegated to being left behind forever, or is work really being done to bring the standalone up to speed? You sell licenses for the onpremise server, which we'll need to eventually buy, but I can't recommend that to anyone at my company based on what I'm seeing.

    Second, where does code go? I appreciate the code sample, but what is the context?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @ar3k_g,

    Second, where does code go? I appreciate the code sample, but what is the context?
    I have replied here.