Hello. I am making a party invite feature for my game, and I would like to store an array of structs, each struct is a party invite which contains party invite data such as username and avatarurl. However, to store data, you can only use string key-value pairs. How would I go about storing an array?
Answer by SethDu · Oct 23, 2020 at 08:50 AM
In the common scenario, we will use JSON to store the structured value and convert the format between Objects and String. In PlayFab SDK, you may use the following codes to serialize and deserialize the data:
PlayFab.PluginManager.GetPlugin<ISerializerPlugin>(PluginContract.PlayFab_Serializer)
In addition, you may also use the Newtonsoft.Json NuGet package to do the conversion.
Answer by kylemukundi · Oct 23, 2020 at 04:56 PM
Thank you, could I get a code sample? I'm a little confused but I know what you mean.
You may find an example in Sarah's answer of this thread: https://community.playfab.com/questions/40159/how-can-i-access-json-value.html
Store a list of variable values for all players,Store a list of values that constantly changes 1 Answer
Can we do action when Leaderboard is reset? 1 Answer
Trouble uploading a text file as an entity file onto playfab. 1 Answer
Upload JSON file Unity (entity) 2 Answers
Having trouble with getting invalid input parameters error when calling UpdateUserData. 1 Answer