question

sanjayhillstudios@gmail.com avatar image
sanjayhillstudios@gmail.com asked

How to get player username from cloudcsript??

Hello everyone.I am running a cloudscript on playfab.I am not taking ny parameters and i need to get playfab username from it.how can i get playfab username from cloudscripts.Thank you

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

·
Rick Chen avatar image
Rick Chen answered

Do you mean the username that is used to login the player with password? Or the title display name of the user? There is the pre-defined variable “currentPlayerId” in CloudScript representing the PlayFab ID of the player who execute this function. You can call the server.GetUserAccountInfo with the “currentPlayerId” in CloudScript to get the username or display name of that user.

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.

sanjayhillstudios@gmail.com avatar image sanjayhillstudios@gmail.com commented ·

Yeah thanks for your answer.

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.