Download

Write Leaderboard Integer return value

What does the return value on the write leaderboard integer node tell you?

I want it to return false if the user is not logged in to google play games services yet, or if it fails because the user does not have internet at that moment, but for some reason it will return true.
Any way of achieving what I want?

Also, if the user is logged in, but not online at the moment and that node is called. Will the value be written to the leaderboard automatically when the user is online again?

Thanks.

Hi Pesk92,

There is a “Is Logged In” node in 4.9 you can check. On the rest, I’m not sure.

Unfortunately, not much at the moment. As of 4.9, Write Leaderboard Integer should return false if you call it before calling the Show External Login UI node, but even if the login fails, subsequent calls to Write Leaderboard Integer will return true. This should be improved and I’ve created a task (UE-20149) to track it.

You can’t change the return value of the node without changing engine code, but as Chris mentioned, you can check the Is Logged In node.

The engine does not handle this explicitly, so it depends on any caching implemented by the Google Play library itself. We use the C++ SDK, but the related Java documentation indicates that it does: see the reference to STATUS_NETWORK_ERROR_OPERATION_DEFERRED, which is a possible result of the SubmitScore method.