question

Luke Doukakis avatar image
Luke Doukakis asked

Can I use groups as a workaround to allow searching players by display name?,Can I use groups as a workaround to allow searching for players by display name when my title allows non-unique display names??

I would like to implement a "search player by name" functionality to my game. I've unfortunately already enabled the "allow non-unique display names" option from my title's title settings, so providing display name to Client API GetAccountInfo will not work. I would also prefer not to require players to link their account via email/username/password (via Client API AddUsernamePassword) in order to do it.

I am thinking it may be possible to workaround this issue by creating a unique group for each player, where the player is the only member of the group, and the player's display name then gets set to the group's unique name. So when players search for another player, the group with that name is found first, and then the player is retrieved simply by getting the single member of that group. This would effectively result in the same behavior as having "allow non-unique display names" disabled.

Is there any reason why this approach wouldn't work in practice, or any pitfalls I may not be accounting for? I know doing so this way will trigger additional API calls to retrieve the player with the searched name, because the group will have to be retrieved before the matching player can be found, however I don't plan to be using this for anything other than searching for players.

Thanks a lot in advance for any insight!

,I would like to implement a "search player by name" functionality to my game. I've unfortunately already enabled the "allow non-unique display names" option from my title's title settings, so providing display name to Client API GetAccountInfo will not work. I would also prefer not to require players to link their account via email/username/password via Client API AddUsernamePassword in order to do it.

I am thinking it may be possible to workaround this issue by creating a unique group for each player, where the player is the only member of the group, and the player's display name then gets set to the group's unique name. So when players search for another player, the group with that name is found first, and then the player is retrieved simply by getting the single member of that group. This would effectively result in the same behavior as having "allow non-unique display names" disabled.

Is there any reason why this approach wouldn't work in practice, or any pitfalls I may not be accounting for? I know doing so this way will trigger additional API calls to retrieve the player with the searched name, because the group will have to be retrieved before the desired player is retrieved, however I don't plan to be using this for anything other than searching for players.

Thanks a lot in advance for any insight!

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

It's theoretically possible, but we don't recommend it because, as you said, there will be the cost of additional API calls. And, we still recommend using username as a workaround, could you share the reason why you don’t want players to add the username? In addition, you may also consider using external database to store the display name, then you can search the database to keep the display name unique.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.