Skip to main content
Version: 5.7.0

IncrementGlobalStats

Atomically increment (or decrement) global statistics. Global statistics are defined through the brainCloud portal.

StatisticsData like

{ "stat1" : 10, "stat2" : -5.5 }

would increment stat1 by 10 and decrement stat2 by 5.5. For the full statistics grammar see the statistics grammar section.

There are many more complex operations supported such as

{ "stat1" : "INC_TO_LIMIT#9#30" }

which increments stat1 by 9 up to a limit of 30.

ServiceOperation
globalGameStatisticsUPDATE_INCREMENT

Method Parameters

ParameterDescription
statisticsA collection containing the statistics to increment

Usage

http://localhost:3000
string statistics = "{\"PLAYER_COUNT\":1}";
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.IncrementGlobalStats(statistics, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"statistics": {
"PLAYER_COUNT": 16
}
}
}