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 identifier codestring
nameTable namestring
rotationRefresh cycle
never : Overall leaderboard
rotation : Periodic leaderboard
string
recordTypeRecord type
highscore : Highest score
lowscore : Lowest score
sum : Cumulative score
refresh : Latest score
string
recordSortTypeSort method
desc : Descending order
asc : Ascending order
string
recordPriorityLeaderboard record priority setting
y : Set record priority
n : Not set record priority
string
rotationTimeOffsetLeaderboard offset time (Time difference input 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, it is required to provide values for rotationTimeOffset, rotationDate, rotationTime, and rotationPeriod.

danger

Pay attention to case sensitivity.

Communication Result

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

Communication Result Details

Data KeyDescriptionType
TableIdTable Codestring