question

Niall Muldoon avatar image
Niall Muldoon asked

Unique Display Names - GetAccountInfo / UpdateUserTitleDisplayName Client API Limits

Hi

We are generating automatic display names on the client from a large pool of possible names. The user can choose to generate a new name until they find one they like. Ideally we would like to only show names to the player that have not already been taken.

To do this, I would need to generate a name on the client, check if it has been taken on the server and if it is already taken, generate and check again until a unique name is found, we then offer that name to the user, but they are of course free to reject that name and kick off the generation process again as many times as they like. This could mean we need to make quite a few calls to the API in quick succession and the risk of collisions increases as our player base increases. We would still need to handle the case of a collision occuring due to the time between calls.

For each generation process, I would expect a unique name to be found on the first try or very soon after, but just in case, I want to handle any limits to ensure our game is not throttled or billed excessively.

I plan to check if a name is taken via GetAccountInfo (providing the display name) rather than using the error codes of UpdateTitleUserDisplayName as players can enter a flow to change their name but then decide to cancel it before committing to the change, I would not wnat the player to lose their current name in this case.

Any info you can provide on this and connected APIs or insights in to ow best to design a system like this would be appreciated.

All the best,

Niall

limits
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

·
Neils Shi avatar image
Neils Shi answered

You mentioned that you want to call API GetAccountInfo to check whether the display name exists or not and you want to only show names to the player that have not already been taken. However, checking whether a display name is duplicated using the GetAccountInfo API before calling UpdateUserTitleDisplayName does not mean that it will be successful when calling UpdateUserTitleDisplayName. Because the AccountNotFound returned by GetAccountInfo only tells you that the display name does not exist at that very moment, there is a time gap between calling GetAccountInfo and UpdateUserTitleDisplayName. The display name could be taken by other players in this gap. It would be better to handle both errors, and when the error “NameNotAvailable” occurs (if you call UpdateUserTitleDisplayName API with an existing name, it will return this error), you should also prompt the user to choose another name. In addition, your logic for generating random names should ensure the retries are minimal so that the API GetAccountInfo calls will be reduced.

2 comments
10 |1200

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

Niall Muldoon avatar image Niall Muldoon commented ·

Hi @Neils Shi ,

Thanks for your reply.

Yes, I am aware of this edge case and will need to handle it. As I mentioned though, as the player can cancel the name change while the name generation dialog is open, I can't actually change their name until they tap the Accept button. Doing so would mean another player could take what they still perceive to be their current name.

Are you aware of any limitations around the APIs that I need to be careful of to avoid throttling? I have checked the Title Settings Limits page but could not really figure out which limit was relevant here.

Thank you.

0 Likes 0 ·
Neils Shi avatar image Neils Shi Niall Muldoon commented ·

In your case, the main used API would be Client API GetAccountInfo. This API doesn’t have a specific limit, but client APIs have a common limit: 1000 requests per 120 seconds. If your logic for generating random names ensures that the number of retries is low enough, then I think it should meet your requirements.

0 Likes 0 ·

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.