跳转到主要内容

创建排行榜表

创建排行榜表。

源代码

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"
}
}
}

请求参数

参数说明类型
uid排行榜表识别代码string
name排行榜表名称string
rotation更新周期
never:综合排行榜
rotation:期间排行榜
string
recordType记录方式
highscore:最高分
lowscore:最低分
sum:累计分数
refresh:新分数
string
recordSortType排序方式
desc:降序
asc:升序
string
recordPriority排行榜记录优先级设置
y:设置记录优先级
n:不设置记录优先级
string
rotationTimeOffset排行榜时间 TimeOffset(以 UTC 为基准输入时差)integer
rotationDate排行榜开始日期(以 UTC 时间输入)string
rotationTime排行榜开始时间(以 UTC 时间输入)string
rotationPeriod排行榜更新周期integer
信息

创建期间制排行榜时,请务必传入 rotationTimeOffsetrotationDaterotationTimerotationPeriod 值。

危险

请注意大小写。

通信结果

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

通信结果详细信息

数据键说明类型
TableId排行榜表代码string