question

nalin avatar image
nalin asked

Possible bug in GetLeaderboardAroundPlayer?

I just found that if the player has no entry in this Leaderboard then the API still returns a single entry with a StatValue of 0.

To me this seems incorrect as it should not return anything at all?

As it stands this means extra unnecessary work at the client unless there is a good reason?

thanks

Nalin

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

The call in question returns a 0 because it's specifically a request for scores around the player. Since the request is requiring it to be in the context of the player specified, that player has to be listed somehow - hence, 0.

I should also point out that given that this call has worked this way for a long time, it's not something we can alter, as that would be a breaking change for existing titles. If we update with a new API call, we could provide a flag like "ReturnErrorIfNoValue", so that you can get an error code back if the player simply has no score on that leaderboard.

10 |1200

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

Jeremy Kabanoff avatar image
Jeremy Kabanoff answered

Seems all the other entries Position will be off by one if this occurs too

,

Worth noting that all other positions will be off by one if this occurs.

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.