Numbers, integers... same thing, right? :)
So it took me a while to figure out why the PlayFab API did not accept my leaderboard update requests. If you play the jam version of the game there is a very good chance you'll see this error message in your JavaScript console if you try to submit your time to the leaderboards:
Error:Invalid input parameters
Statistics[0].StatisticName: The StatisticName field is required.
It drove me up the wall for better part of an hour, but finally googling the problem brought results:
https://community.playfab.com/answers/13210/view.html
TL;DR: the problem is, that even though the official API docs say StatisticUpdate objects' Value properties should be "number" type (and not integer), indeed the problem is that I'm trying to submit split second values like 13.37. Unfortunately the error message above is not very helpful to say the least, in fact I was sure that there was a typo somewhere and the request body was malformed... except that thanks to PlayFab's very detailed error object, I could see my original request object was in fact not malformed, and contained the required StatisticName and Value fields.
Hopefully PlayFab will either fix their docs so it says "integer" instead of "number" at the aforementioned place (and maybe give the right error message if the problem is a non-integer number)..., or indeed accept non-integer numbers :)
Files
Get Chain? Reaction!
Chain? Reaction!
A game about reacting quickly to chains. You know, chain reaction.
More posts
- Post-jam feature updateSep 22, 2021
- Leaderboards are up!Sep 15, 2021
- Bug fix 1Sep 13, 2021
- Update 5Sep 13, 2021
- Update 4Sep 13, 2021
- Update 3Sep 13, 2021
- Update 2Sep 12, 2021
- Update 1Sep 12, 2021
- 26 hours left... I'm ready to get started ;)Sep 12, 2021
Leave a comment
Log in with itch.io to leave a comment.