Why does this only let me save string key value pairs?
like so:
void SetUserDataString(string key, string value) { UpdateUserDataRequest request = new UpdateUserDataRequest() { Data = new Dictionary<string, string>(){ {key, value} } }; PlayFabClientAPI.UpdateUserData(request, (result) => { Debug.Log("Successfully updated user data"); }, (error) => { Debug.Log("Got error setting user data Ancestor to Arthur"); Debug.Log(error.ErrorDetails); }); }
it would have been really convenient if data took floats and ints as well so i could use these the same way unity playerprefs does taking a string key and then a float or int as well as value but unfortunately it does not seem to be possible?
We currently use DynamoDB rows for User Data, so it is all stored the same way - as arbitrary string data. It's also important to note that anything less than 1000 bytes is still "costing" 1000 bytes in terms of the read/write operations, since that's the base size for an entry. So the best practice is to aggregate small data values into fewer, larger key/value pairs. We'll be updating the data system in an upcoming update to provide for more efficient use of small data values, but for now, that would be the way to go in terms of usage.