Skip to main content
Version: 5.7.0

TriggerStatsEvents

Triggers multiple events 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_MULTIPLE

Method Parameters

ParameterDescription
jsonDataAn array of JSON objects representing Event Names and Multipliers. ex. [ { "eventName": "event1", "eventMultiplier": 1 } ]

Usage

http://localhost:3000
string events = "[{\"eventName\":\"GrantExperience\",\"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.TriggerStatsEvents(events, successCallback, failureCallback);
JSON Response
{
"data": {
"currency": {
"credits": {
"awarded": 10000,
"balance": 10000,
"consumed": 0,
"purchased": 0
},
"test": {
"awarded": 0,
"balance": 0,
"consumed": 0,
"purchased": 0
}
},
"rewardDetails": {},
"rewards": {
"currency": {
"credits": 10000
}
}
},
"status": 200
}