At 10/11/20 02:11 PM, RaIix wrote:At 10/10/20 09:42 PM, MayChant wrote: Hi. I'm trying to add a scoreboard to my game (in Unity3D). I created the scoreboard and made API calls to post and get scores from the same scoreboard. The post score requests always had a successful status, yet I never get any scores from the get request. I can get the scoreboard object itself but the array I get is always empty. I tried to get with period="A" and with period being left out (which defaulted to "D"), and neither way worked. I was testing it in preview mode, if that's relevant.I tried it and ran into the same issue as you ("success" with an empty list), even though the code seemed OK to me.
I don't know if the parameters sometimes behave weirdly or if it was my fault (most likely the latter) but after a few attempts, I ended up with this parameter combination which worked with both live and a (different) preview scoreboard.
(You don't have to use the event; I just use it to feed the scores into a text field.)
Handle results:
Live scoreboard test:
Preview (incremental) scoreboard test:
You can see the sample if you add Ngio as a package or just the code here.
That worked, thanks! Seems like I was missing either social = false (which is weird because the user should be able to see their own score anyway) or limit = 10 (which was the default according to the documentation so maybe it's a bug?). How did you do the live scoreboard testing though?
Hi. I'm trying to add a scoreboard to my game (in Unity3D). I created the scoreboard and made API calls to post and get scores from the same scoreboard. The post score requests always had a successful status, yet I never get any scores from the get request. I can get the scoreboard object itself but the array I get is always empty. I tried to get with period="A" and with period being left out (which defaulted to "D"), and neither way worked. I was testing it in preview mode, if that's relevant.
Response I got from postScore:
{ "success":true, "app_id":"<My app id>", "result": [{ "component":"ScoreBoard.postScore", "data": { "success":true, "scoreboard": { "id":9529, "name":"Expert" }, "score": { "formatted_value":"2", "value":2, "tag":null } } }] }
Response I got from getScores:
{ "success":true, "app_id":"<My app id>", "result": [{ "component":"ScoreBoard.getScores", "data": { "success":true, "scoreboard": { "id":9529, "name":"Expert" }, "period":"D", "social":false, "skip":0, "limit":0, "user":null, "scores":[] } }] }