I have a bunch of players that have signed up during the alpha, where they have been registered with email and username and password.
I'm now integrating Steam. When the game is eventually released, people will be signed up with their Steam account instead. Until then, I need the email registration to be open (maybe even after launch I need them to work in parallell, if I distribute the game outside Steam, or for testing accounts).
When the Steam registration is done, the player does not get a PlayFab username. (That is not ideal, since it makes it much harder to get an overview in the Players and LeaderBoard and many other sections in PlayFab's web gui.) *see note 3 below though
So, I'm consider making a call to playfab after the Steam registration and set a Username, for instance to the users Steam account name.
1) The problem I first came to think of was how I then could enforce unique Usernames. Any good suggestion? Use a prefix maybe, like s_MySteamName or something?
2) While writing this post, I realized that even then, it wouldn't be that easy. AddUsernamePasswordRequest requires a password, and that isn't what I want to do. I saw that you talked about potentially allowing post-account-creation setting of Usernames in some other thread (April 2016), but not sure if this is even possible?
3*) Also, when writing this post, I realized after testing it that the field "Display name" is actually shown in the web gui pages in the absense of a Username. Could this be the answer to it all maybe? I.e upon account creation, make a UpdateUserTitleDisplayNameRequest request? And then change everywhere in the game where I show the player's Username to instead show the DisplayName?
Sorry for the somewhat confusing unorganized topic/rambling. I guess I just want some input if I'm approaching this from the right angle or if there's something I need to think about. :)
Answer by Brendan · Feb 17 at 03:30 AM
Uniqueness is always a problem if the names aren't guaranteed unique by the originating service. In the case of PlayFab, Usernames must be unique across all titles sharing a Publisher ID, and Title Display Names must be unique within a single Title ID.
Now, specific to Steam, while their usernames must be unique, they can also be up to 32 characters, where PlayFab Usernames are up to 20, and Title Display Names are up to 25. We may change that in future to provide more flexibility, but for now the thing to know is that you can't guarantee uniqueness for a Steam name in either, due to this.
But before you start pulling hair out, there is an easier way which we'll be making available shortly - just use their Steam username. Currently, if you try searching on players by their Steam usernames in the Game Manager, you'll find that this works - and that their Steam name appears on the tile showing their linked Steam ID. That's because we're adding that information to the player profile in our service. We'll be providing ways to access more of that data in the near future, starting with the leaderboards in an upcoming release (pre-GDC).