ListAllLeaderboards
Method returns list of all the leaderboards from the server based on gameId of the user.
Service | Operation |
---|---|
leaderboard | LIST_ALL_LEADERBOARDS |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.LeaderboardService.ListAllLeaderboards(successCallback, failureCallback);
_bc->getLeaderboardService()->listAllLeaderboards(this);
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc leaderboardService] listAllLeaderboards:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
this; // implements IServerCallback
_bc.getLeaderboardService().listAllLeaderboards(this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
_bc.leaderboard.listAllLeaderboards(result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
ServerResponse result = await _bc.leaderboardService.listAllLeaderboards();
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var leaderboardProxy = bridge.getLeaderboardServiceProxy();
var postResult = leaderboardProxy.listAllLeaderboards();
if (postResult.status == 200) {
// Success!
}
{
"service": "leaderboard",
"operation": "LIST_ALL_LEADERBOARDS",
"data": {}
}
JSON Response
{
"status": 200,
"data": {
"leaderboardListCount": 3,
"leaderboardList": [
{
"leaderboardId": "default",
"leaderboardType": "HIGH_VALUE",
"resetAt": 1473793200000,
"rotationType": "WEEKLY",
"currentVersionId": 1,
"maxRetainedCount": 5,
"retainedVersionsCount": 1,
"data": {}
},
{
"leaderboardId": "default1",
"leaderboardType": "HIGH_VALUE",
"resetAt": 1517428800000,
"rotationType": "WEEKLY",
"currentVersionId": 1,
"maxRetainedCount": 2,
"retainedVersionsCount": 1,
"data": {
"retainedCount": 7
}
}
]
}
}