ReadAllGlobalStats
Method returns all of the global statistics.
Service | Operation |
---|---|
globalGameStatistics | READ |
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.GlobalStatisticsService.ReadAllGlobalStats(successCallback, failureCallback);
_bc->getGlobalStatisticsService()->readAllGlobalStats(this);
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc globalStatisticsService] readAllGlobalStats:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
this; // implements IServerCallback
_bc.getGlobalStatisticsService().readAllGlobalStats(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.globalStatistics.readAllGlobalStats(result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
ServerResponse result = await _bc.globalGameStatisticsService.readAllGlobalStats();
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var globalStatisticsProxy = bridge.getGlobalStatisticsServiceProxy();
var postResult = globalStatisticsProxy.readAllGlobalStats();
if (postResult.status == 200) {
// Success!
}
var globalStatisticsProxy = bridge.getGlobalStatisticsServiceProxy();
var postResult = globalStatisticsProxy.readAllGlobalStats();
if (postResult.status == 200) {
// Success!
}
JSON Response
{
"status": 200,
"data": {
"statistics": {
"TotalXpEarned": 0,
"_GAME_LOGINS": 805
}
}
}