question

Thomas Brown avatar image
Thomas Brown asked

UpdateUserTitleDisplayName allows non unique display names despite option being disabled

I've noticed that my client-side UpdateUserTitleDisplayName call still allows duplicate display names despite the "Allow non-unique player display names" option being disabled within the settings. I think this might be a bug. See the image below.


One other strange bit of behavior is that if I try to change the display names via the UI on the backend it will indeed tell me that the display name has already been taken as I expect it to.

Thanks for any help in advance!

Account Management
10 |1200

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

Thomas Brown avatar image
Thomas Brown answered

@SethDu was right in the reply to my question. Thanks a ton!

Essentially the issue was the ZERO WIDTH SPACE (U+200B) being included in my returned text. I mistakenly tried to trim the character out using Trim(). Trim() however only trims spaces from the start and end of a string and this was a Unicode character. Here is a good tool I found to view included Unicode characters and text (just copy & paste string).

Essentially my issue boiled down to pulling the text from the TextMeshProUI.text field on a TextMeshProInput component in Unity rather than the TextMeshProInput.text field. This is the intended way to get text from the input field in Unity. See this link for more info!

Problem

Solution






context.png (67.1 KiB)
1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

Thanks for the feedback.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

What's the title ID? Are you able to use this display name to locate a player via GetUserAccountInfo API call? if the API returns a player, it means "Allow non-unique player display names" is disabled and works propertly.

I also notice that one of player is from Android. the text field components sometimes contain ZERO WIDTH SPACE' (U+200B) or any other invisible character. It is recommended to strip the string before it is used in the display name update API call.

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.

Thomas Brown avatar image Thomas Brown commented ·

The title ID is D5D8C. I am able to use GetUserAccountInfo to retrieve logged-in player info. Although I'm not sure how that relates as the API call has me entering in the PlayFabId rather than a display name?

What's really strange is that I do indeed receive a NameNotAvailable error when making the client UpdateUserTitleDisplayName via Postman. However even after trimming the string in (in Unity Editor) the UpdateUserTitleDisplayName succeeds. See images below

Call In Unity

Postman Call

0 Likes 0 ·
Thomas Brown avatar image Thomas Brown commented ·

Sorry @SethDu turns out you were right about the extra Unicode character! Sorry about the confusion on my end. I mistakenly used Trim() without thinking.

I went ahead and added an answer to what my issue was for potential future people with the issue :).

Thanks for the help!

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.