OnUpdatedFriendList => No UserId?

Options
Seems that we get isInRoom, isOnline, Name, and Room --

But where is the UserId? I am a bit surprised that I can't find this. I provided a list of UserId to get friends, so it seems that it would make sense to provide it on the other side since my list won't match the callback (unless 100% of my friends are playing 100% of the time) and comparing by Name is unreliable (and probably inefficient if the user has thousands of friends, such as streamers).



1 - Is there a way to get the userId here?

2 - Any suggestions outside of comparing by Name?

PS -- The word "Name" seems a bit inconsistent to the other naming conventions -- as a minor suggestion, should this probably be "NickName" to match Player.NickName (as player.name is deprecated and player,Name doesn't exist)?

Comments

  • xblade724
    Options
    Wait.... upon testing, it seems that Name is actually UserId!

    This is quite misleading (although I'm much happier to get that over a NickName lol).

    Any reason it's called Name instead of UserId?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @xblade724,

    Thank you for reporting this!
    Yes indeed the Name is the UserId in fact it is not returned by server but cached on client from the list you provide in FindFriends.

    Any reason it's called Name instead of UserId?
    "Historical" reasons! "UserId" is a concept we now enforce (it is a must, even if you do not explicitly set one the server does this for you) and is relatively new in Photon. "NickName"/"Nickname" should be the new naming for the old "UserName"/"Username" or "PlayerName"/"Playername" or "Name".
    We will change this in future versions ("Name" to "UserId").
  • xblade724
    xblade724
    edited October 2017
    Options
    Ah, interesting :) cool stuff.

    As for the name, not a huge deal, but may help others in the future!