question

Larry Dietz avatar image
Larry Dietz asked

Question concerning Title Display Names

I have, as part of the game I am working on, a random name generator to generate the Title Display Names for the players. What I want to do, in the case of the same name being chosen more than once, is append "The 1st, 2nd, ... 427th" etc...

What I am trying to figure out, is how would I go about figuring out what the current count of players with that name is? I though about iterating through until I failed to get user data when trying, but if a particular name has been used hundreds of times, I would be pounding the server, and would quickly end up in trouble :)

Is there a way to do this that wouldn't require pounding the server?

Any help is appreciated.

-Larry

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

·
brendan avatar image
brendan answered

Unfortunately, what you have in mind would require an atomic operation to increment a global counter, which isn't supported currently. We will be adding support for that later, but for now (since you are correct that hammering the service with many calls isn't valid - and would, in fact, cause the client to be throttled or blocked) we would have to recommend adding a random value to the end of the name. Since display names are limited to 25 characters, you may need to trim some off the end of the user's entered name, if you let them use the full length. Alternately, you may want to offer the user the option to change it to make it more unique, and offer that as a suggestion.

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.

Larry Dietz avatar image Larry Dietz commented ·

I understand, and was afraid that was going to be the answer, but it didn't hurt to ask, in case I was missing something.

I will figure out a work-around for it.

Thanks for your help!

-Larry

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.