question

dreamingearthling avatar image
dreamingearthling asked

Read payer's leaderboard position from cloud script return

Hello,

I'm trying to get the current player's position in the leaderboard from the server by calling

ExecuteCloudScript on the client side and execute a function in a cloud script which looks like this:

handlers.returnPlayerLeaderboardPosition = function (args, context) {
    
    var leaderboardPosition = server.GetLeaderboardAroundUser({
            PlayFabId: currentPlayerId,
            StatisticName: "Leaderboard_Name",
            MaxResultsCount : 1
    });

    return { messageValue: leaderboardPosition };    
};

The client side will an get ExecuteCloudScriptResult in which you can find a bunch of information.

My question is, is there a simple way to extract the position information from the

ExecuteCloudScriptResult?

Thank You!

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

Why not just call the Client API version of GetLeaderboardAroundUser, given that you're not modifying or otherwise checking that data in any way in the Cloud Script?

1 comment
10 |1200

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

dreamingearthling avatar image dreamingearthling commented ·

Didn't know there is a client API version of the same function. Thank You.

0 Likes 0 ·

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.