UserId not set

edited June 2017 in Native
I testing connection to photon server.
and Getting an error in Photon Control Log

2017-06-18 00:30:38,454 [7] WARN Photon.Hive.HiveGame - JoinApplyGameStateChanges: Game 'UE-MyWFT-room1' userId '' failed to join. msg:Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId. -- peer:GameClientPeer: PID 85, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 18.06.2017 7:30:38 in Room UE-MyWFT-room1,

in app

MutableRoom& myRoom = mLbc->getCurrentlyJoinedRoom();
const JVector& players = myRoom.getPlayers();

const Player* p = players[i];

result = result + "\r\n " + FString::Printf(TEXT("[ %d ]"), p->getNumber()) + p->getName().UTF8Representation().cstr();

return this:

i.e. userid not set


  • hi, @WolfgangAbersdorf
    there is an issue with released SDK. it does not set user id automatically. the possible workaround could be providing userId when you connect to master.

    then everything will work as expected

  • hi, @chvetsov
    Please, tell me how to do this?
    I need to send a command from the client or change the script on the server?
  • yes, you need to send it from client

    what client lib are you using?

  • Loadbalancing lib
    i tested PhotonDemoParticle-UE4 example on local PhotonServer.

  • okl, it is a native lib, i will redirect you to native lib forum
  • Hi @WolfgangAbersdorf.

    Youc an set the userID in the AuthValues instance that you pass to connect().

    Example code (copied from demo_loadBalancing which is part of the C++ Client SDKs):
    mLoadBalancingClient.connect(ExitGames::LoadBalancing::AuthenticationValues().setUserID(USER_ID), PLAYER_NAME);

    The user ID should be a globally unique identifier. For development purposes something like a timestamp (maybe even appended by a random value) will do just fine, but before going live you should switch to something that is guaranteed to be unique to be absolutely sure that there won't be any ID collisions between end users.

    The user ID is not intended for displaying it on screen. For a user readable display name that can be chosen by the user and that does not need to be unique please use the player name (also part of the above example).
  • Thank you. it works
Sign In or Register to comment.