question

thelonely_sadrain_bboy@yahoo.com avatar image
thelonely_sadrain_bboy@yahoo.com asked

Push data to Server via CloudScript get Error ?

Hello there,
Currently we are in trouble when push data to Playfab Server via CloudScript.
We using example in official API Document of PlayFab following by :
server.UpdateUserInventoryItemCustomData(
{
PlayFabId: currentPlayerId,
ItemInstanceId: itemInstanceId,
Data: {
ExtendDay : dayExtend,
Expiration: dayExpired,
Capacity: capacityValue,
RateOfFire: rateOfFireValue,
Weight: weightValue,
Reload: reloadValue,
Recoil: recoilValue,
Sturn: sturnValue,
Distance: distanceValue,
Damage: damageValue,
ArmorPenetration: armorPenetrationValue
}
});

This function working correctly if we comment out any of key, that mean the key number must be lower than 10.
Any key adding over than 10 will return Error :

Got an error: PlayFabAPIError InvalidParams: Invalid input parameters
at __playfab_internal.server_request (Script Document:3:263) -> turn 'PlayFabAPIError '+this.error+': '+this.errorMessage; }; throw result };
at server.UpdateUserInventoryItemCustomData (Script Document:253:90)
at handlers.onSetupWeaponInfoInventory (main.js:28:9)
at __playfab_internal.invokeHandler (Script Document:4:153)

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

·
brendan avatar image
brendan answered

That's correct - if you have a look at the errorDetails in the response, you'll see the rest of the info you need. It'll look like this:

{

    "code": 400,

    "status": "BadRequest",

    "error": "InvalidParams",

    "errorCode": 1000,

    "errorMessage": "Invalid input parameters",

    "errorDetails": {

        "Data": [

            "Too many keys specified in Data dictionary update. Limit is 10 and request contained 11."

        ]

    }

}

If you have a look at the limits page (https://playfab.com/limits/) you'll see that the limit on CustomData for inventory item instances is 10. Our limits were based on common title usage models, and are designed to provide titles with the space they need, encourage best practices in design, and keep our costs low enough to make the PlayFab core service available to everyone for free. That said, if your title absolutely cannot manage within the limits given, we do have the ability to provide an exception to increase the limit, based on a customized agreement in which you agree to pay the increased cost for the higher limit. If you'd like to work with us on such an agreement, please let us know by emailing devrel@playfab.com with the specific of the limits you need increased.

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.