I want to set my user's displayName from server but it seems that the server api doesn't have any APIs to do that, am I right?
If not, how can I do that. reasoning is that I want to apply validation and bad word filtering on the server
I want to set my user's displayName from server but it seems that the server api doesn't have any APIs to do that, am I right?
If not, how can I do that. reasoning is that I want to apply validation and bad word filtering on the server
If you are talking about from a custom server and not Cloud Script, you could make use of the Admin API.
Admin.UpdateUserTitleDisplayName
edit: Don't forget to disallow the client from calling UpdateUserTitleDisplayName for more info on that see this blog post.
Sorry to bump an old thread, but I was wondering a similar thing - is it possible to change the DisplayName of a player via Cloud Script?
I was looking to enforce some rules on the display name (min/max length, characters, etc) and had planned on enforcing them on the server via cloud script, but I cannot find any api references - only admin and client, which I do not believe work in this context.
Any advice would be appreciated.
While the cloud script can't actually do the update, you can absolutely use cloud script to vet a proposed new name before letting the client set it (or look into using Community Sift). It wouldn't be 100% secure, but would work in the majority of cases. You could also trigger some script off the display name changed event and verify it aligns with the proposed name change you received in the earlier call. If it doesn't, you can add the player to a "special" segment.
Thanks for advice. I will look at creating a work around like that for the interim.
I might raise adding this api call in as an idea because I think it will be useful in the future for things like this.
Thanks again for all your help. You guys are awesome at responding.
4 People are following this question.