Sign In Register

How can we help you today?

Start a new topic

Change Registration Fields

 Hi! I want to change the kinds of things that users need when they register, for example having a displayname and a username are unnecessary for me- but I also need to record things like age along with other bits of player data. I see this here https://docs.gamesparks.com/tutorials/social-authentication-and-player-profile/accessing-player-records.html But I don't find it necessary to have 6 different currencies and a lot of the other things. How do I go about deleting/changing these fields?


Hi Vivian,


You can't change the default player account details but you can add any custom data you want either to a player by passing up scriptData with the request itself and then inserting it into a custom runtime collection or by storing it on the player object with player scriptData or privateData. Which SDK are you using ? 


Regards,

Liam

Using Unity, I'm currently trying to figure out how to download custom player fields now. I'll need to be able to download JSONs of data for each player, I'm assuming it's going to be a different "table" in the NoSQL area for this custom info? Everything that isn't default to the registration will be somewhere else instead of all the player data in one place? I don't mind it I just want to understand. I'm used to MySQL.

 

You can store your extra registration data within the same system player document. If, on successful registration, you set it to the player's scriptData (Spark.getPlayer().setScriptData("myKey", myValue), you'll then be able to retrieve it using Spark.getPlayer().getScriptData("myKey");. 


Additionally, requests that retreive playerData (e.g. AccountDetailsRequest, GetMyTeamsRequest, etc) will return the player's scriptData also.


Regards,

Vinnie

Login to post a comment