How i get my UserId or a player UserId?

Options
I used Custom Authentication. How i get my UserId retrieved from auth server? How i get UserId from PhotonPlayer of other player in the room (for example to add it to my friends)?

Best Answer

Answers

  • ahoogol
    Options
    @JohnTube thanks. PUN doesn't support PublishUserId. so i use custom properties. what about getting own UserId? if can get by PhotonNetwork.AuthValues.UserId after connect to photon?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Let's keep that discussion on the other thread.
  • sosh
    Options
    Is there any update on whether the real UserId of other actors is or will be readable in the future? It seems to me that relying on the client to explicitly send userId as a player property is not secure, and could lead to impersonation etc.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @sosh,

    Please take a look at RoomOptions.PublishUserId.