Skip to main content

Create Table

Creates a leaderboard table.

Source Code

playNANOOHandlers.leaderboardTableCreate = function (args) {
var result = plugin['v20240301'].leaderboard.tableCreate({
parameters: {
uid: args.uid,
name: args.name,
rotation: args.rotation,
rotationTimeOffset: args.rotation === 'rotation' ? args.rotationTimeOffset : '',
rotationDate: args.rotation === 'rotation' ? args.rotationDate : '',
rotationTime: args.rotation === 'rotation' ? args.rotationTime : '',
rotationPeriod: args.rotation === 'rotation' ? args.rotationPeriod : '',
recordType: args.recordType,
recordSortType: args.recordSortType,
recordPriority: args.recordPriority,
}
});

if (result.statusCode === 200) {
const parse = JSON.parse(result.body.toString());
log.debug(parse.TableId);

return {
status: "success"
}
} else {
return {
status: "false"
}
}
}

Request Parameter

ParameterDescriptionType
uidTable identification codestring
nameTable namestring
rotationRefresh cycle
never : Overall leaderboard
rotation : Periodic leaderboard
string
recordTypeRecord method
highscore : Highest score
lowscore : Lowest score
sum : Cumulative score
refresh : New score
string
recordSortTypeSort method
desc : Descending order
asc : Ascending order
string
recordPriorityLeaderboard record priority setting
y : Set record priority
n : Do not set record priority
string
rotationTimeOffsetLeaderboard time TimeOffset (Enter time difference based on UTC)integer
rotationDateLeaderboard start date (Enter in UTC time)string
rotationTimeLeaderboard start time (Enter in UTC time)string
rotationPeriodLeaderboard refresh cycleinteger
info

When creating a periodic leaderboard, you must provide values for rotationTimeOffset, rotationDate, rotationTime, and rotationPeriod.

danger

Pay attention to case sensitivity.

Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"TableId": "string"
}

Response Details

Data KeyDescriptionType
TableIdTable codestring