Approaches for friends list with display names

  1. Versions: Nakama v3.23.0-r2-mc+11a95d5, Unreal Plugin v2.10

So my plan was to directly import steam friends to display it as is and not deal with add/remove kind of things. But apparently it’s possible to hide friends from Steam profile options which makes it not possible to import friends into Nakama account.

So far I’ve authenticated users with their Steam token and using <steamID>@steam as the username for Nakama. Using steam display name as the Nakama display name and showing that to the users instead of usernames. I will need to have friend add/remove/block functionality but I’m not sure what’s the best way to implement “friend search”. I don’t want to expose steamIDs to people. And there is also no add/search functionality with Nakam display names. Should I let players pick their usernames and let them search each other through that? Would it be possible to implement discriminators like Battlenet and Discord (used to) have?

Our intention was to let people display their Steam name which can change and/or duplicate so there is no “This username is taken” or “Usernames can’t be changed” issues on the user side. What are best/recommended ways for this?

Hello @MetaCan,

Usernames is the preferred way, display names are meant for display only and do not have uniqueness constraints, this makes them inefficient for search which is why we don’t expose such APIs for them.

If you’d like to use discriminators this can be easily achieved by having some custom logic in a before hook on your authentication function that enforces them.

You can still link a Steam account later or use it as authentication source and sync friends (if the Steam account allows), the SteamID is stored as part of the user account data, not it’s username.

Usernames need to be unique, if you go down the Battle.net style discriminators route, you can make the user experience a bit better by automatically generating the discriminator and omitting any username is taken errors to the user.

Ultimately, the users should use the username to manage their friends, but you could optionally allow them to set the display name to allow them more freedom.