Skip to main content
Version: 5.9.0

TriggerStatsEvent

Trigger an event server side that will increase the users statistics. This may cause one or more awards to be sent back to the player - could be achievements, experience, etc. Achievements will be sent by this client library to the appropriate awards service (Apple Game Center, etc).

This mechanism supersedes the PlayerStatisticsService API methods, since PlayerStatisticsService API method only update the raw statistics without triggering the rewards.

ServiceOperation
playerStatisticsEventTRIGGER

Method Parameters

ParameterDescription
eventNameThe name of the event configured through the brainCloud portal
multiplierThe multiplier applied to the event. This must be an integer — if a float is provided, the decimal portion will be truncated by the intValue() method.

Usage

http://localhost:3000
string eventName = "GrantExperience";
int eventMultiplier = 100;
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.PlayerStatisticsEventService.TriggerStatsEvent(eventName, eventMultiplier, successCallback, failureCallback);
JSON Response
{
"data": {
"currency": {},
"rewardDetails": {},
"rewards": {}
},
"status": 200
}