SysCreateLeaderboardConfig
Creates a leaderboard configuration, with support for tournament leaderboards.
Service | Operation |
---|---|
leaderboard | SYS_CREATE_LEADERBOARD_CONFIG |
Method Parameters
Parameter | Description |
---|---|
leaderboardId | ID uniquely identifying the leaderboard configuration to retrieve. |
configJson | Configuration for the leaderboard, specified as JSON object. |
Configuration fields of configJson
Parameter | Description |
---|---|
entryType | Required. Valid values are 'PLAYER' and 'GROUP' |
leaderboardType | Required. Type of leaderboard. Valid values are 'LAST_VALUE', 'HIGH_VALUE', 'LOW_VALUE', 'CUMULATIVE', 'ARCADE_HIGH', 'ARCADE_LOW'. |
rotationType | Required. Type of rotation. Valid values are 'NEVER', 'DAILY', 'DAYS', 'WEEKLY', 'MONTHLY', 'YEARLY'. |
numDaysToRotate | Required if 'DAYS' rotation type, with valid values between 2 and 14, otherwise null. |
resetAt | UTC timestamp, in milliseconds, at which to rotate the period. Always null if 'NEVER' rotation type. |
expireInMins | Set leaderboard expiry time in minute, setting to null will not be automatically deleted. |
retainedCount | Required. Number of rotations (versions) of the leaderboard to retain. |
data | Optional parameter for data. |
tEnabled | Optional parameter to set whether tournaments are enabled (true) or not (false). Must be false for NEVER. Must be true for ADHOC. Can be true or false for recurring rotation types. Defaults to false. |
tTemplateOnly | Optional parameter to set whether leaderboard is a tournament template only (true) or not (false). Can only be true if tEnabled is true. Defaults to false. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
//cloud code only
//cloud code only
//cloud code only
//cloud code only
//cloud code only
// Cloud Code only. To view example, switch to the Cloud Code tab
var leaderboardId = "default";
var configJson = {
"entryType": "PLAYER",
"leaderboardType": "HIGH_VALUE",
"rotationType": "DAYS",
"numDaysToRotate": 4,
"resetAt": 1631492744000,
"expireInMins": null,
"retainedCount": 5,
"data": { "info": "Adding tournament to encourage play." },
"tEnabled": true,
"tTemplateOnly": false
};
var leaderboardProxy = bridge.getLeaderboardServiceProxy();
var retVal = leaderboardProxy.sysCreateLeaderboardConfig(
leaderboardId,
configJson
);
{
"service": "leaderboard",
"operation": "SYS_CREATE_LEADERBOARD_CONFIG",
"data": {
"leaderboardId": "aLeaderboardId",
"configJson": {
"entryType": "PLAYER",
"leaderboardType": "HIGH_VALUE",
"rotationType": "DAYS",
"numDaysToRotate": 4,
"resetAt": 1631492744000,
"expireInMins": null,
"retainedCount": 5,
"data": { "info": "Adding tournament to encourage play." },
"tEnabled": true,
"tTemplateOnly": false
}
}
}
JSON Response
{
"data": {
"aLeaderboardId2": {
"leaderboardId": "aLeaderboardId",
"dbVersion": 1,
"resetAt": 1633492744000,
"leaderboardType": "HIGH_VALUE",
"rotationType": "DAYS",
"retainedCount": 5,
"data": {
"info": "Adding tournament to encourage play."
},
"numDaysToRotate": 4,
"entryType": "PLAYER",
"tEnabled": true,
"tTemplateOnly": false,
"expiry": null,
"currentVersionId": 1,
"currentPeriod": {
"versionId": 1,
"startingAt": 1632752317162,
"endingAt": 1633492744000,
"rotationType": "DAYS",
"numDaysToRotate": 4
}
}
},
"status": 200
}