question

brendan avatar image
brendan asked

Null value for removing player data entry

Helene
started a topic on Sun, 19 July 2015 at 11:16 PM

I'm a bit confused about removing keys from player's data. I'm using c++ sdk. Documentation says that the null value should be assigned to a key for removal.

Here is the sample code:

std::string Key, Val;

Key = "testkey";

Val.assign(NULL);

PlayFab::ClientModels::UpdateUserDataRequest request;

request.Data.insert(std::pair<std::string, std::string>(Key, Val));

m_PlayFabClient.UpdateUserData(request, UpdateUserDataCB, UpdateUserDataErrorCB, this);

This code crashes (in xcode). How to set null string properly?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Apologies for the delay on this. The C++ SDK has now been updated to allow for null to be passed in as the Value for a given Key, so that you can delete them. Let us know if you're still seeing any issues with this.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Mon, 10 August 2015 at 9:47 PM

Thanks for emailing the link to this Helene - I'm not sure why it didn't show up in our inbox, but it's certainly timely for us to know about this, as we're currently investigating options for how to improve our support experience overall.

As I said in our mail thread, I'm working with the SDK team to get this sorted, and we'll update shortly.

Brendan


1 Comment
Brendan Vanous said on Mon, 10 August 2015 at 9:47 PM

Thanks for emailing the link to this Helene - I'm not sure why it didn't show up in our inbox, but it's certainly timely for us to know about this, as we're currently investigating options for how to improve our support experience overall.

As I said in our mail thread, I'm working with the SDK team to get this sorted, and we'll update shortly.

Brendan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Helene [not provided] avatar image
Helene [not provided] answered

Hi Brendan, just curious about progress on this issue.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Sorry for the delay. The SDK team is aware of this issue, but since it's not blocking, it hasn't been prioritized yet. Are you running into issues due to this?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Helene [not provided] avatar image
Helene [not provided] answered

Thanks for the quick reply. This is not a big issue, just needed an information on it. In our game player has a number of monsters, each monster data is stored in mon_data_X entry, where X index always increments. When player sells a monster, its data is supposed to be deleted from savegame. New monsters get new indices, as an additional safe measure against accidental data overriding. There is a limit on how many monsters and other game entities player can have at the same time, but no limit on index. This way save data might end up with a lot of empty strings from deleted monsters and other game entities. So I was wondering is solution coming soon or it's better to switch to reusing indices. I'm taking the second option then.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

I see. And since we're working to update the site with the usage limits, you're likely aware from our webinar that we're limiting Keys in each data store (so, per user, N Keys in Read-Write Data, N Keys in Read Only Data, etc. - the N being 100 right now, but please be sure to check our site for the latest, and note that we can adjust the limit on a per-title basis for titles that have a definite need). So you want to make sure you can delete your Keys to make room - makes sense. I've increased the priority on that issue, to make sure it'll get taken care of soon.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Helene [not provided] avatar image
Helene [not provided] answered

Sorry, that limit is new to me, thanks for mentioning it. Can't find it in docs. We were planning to allow player to have up to 120 monsters, and with other entities and data, that would hit about 300 entries. Of course several entities data can be packed in one entry, though that is not the ideal solution.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

As I said, we're working to get the limits detailed on the site shortly. Basically, they define a baseline level which we know can be supported for all titles (including free tier). This serves two purposes: First, it makes certain we can continue to provide a highly performant system which gives titles a way to deliver their server-backed experiences to a basically unlimited number of users. Second, it pushes developers to be efficient in their designs, so that they optimize the use of that backend service.

If you definitely require more than the defined limits, please contact us at devrel@playfab.com so that we can discuss the business terms on providing you with a higher limit.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Helene [not provided] avatar image
Helene [not provided] answered

Just tested the new SDK, deleting keys works. Thank you very much!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.